From d1f1c3c7031a5ad4a040cca0c1d4b7ab15ecae13 Mon Sep 17 00:00:00 2001 From: Joep Meindertsma Date: Tue, 27 Jun 2023 14:36:01 +0200 Subject: [PATCH] Update JS assets, history view --- CHANGELOG.md | 1 + server/app_assets/assets/index.js | 280 ++++++++++++------------- server/app_assets/assets/index.js.map | 2 +- server/app_assets/assets/index2.js.map | 2 +- server/app_assets/sw.js | 2 +- server/app_assets/sw.js.map | 2 +- server/e2e_tests/e2e-generated.spec.ts | 39 +++- 7 files changed, 183 insertions(+), 145 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebe0eacd6..1e6e7fa60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain - Add support for Bearer token authentication, find in `/app/token` #632 - Add a `query` endpoint that allows peroforming collection queries via an enpoint instead of repurposing the collections collection. - `resource.destroy` now recursively destroys its children. +- Update JS assets, add History view ## [v0.34.2] - 2023-03-04 diff --git a/server/app_assets/assets/index.js b/server/app_assets/assets/index.js index a22c70cf5..64681d874 100644 --- a/server/app_assets/assets/index.js +++ b/server/app_assets/assets/index.js @@ -1,4 +1,4 @@ -function rE(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Qn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function A6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var w={},iE={get exports(){return w},set exports(e){w=e}},qe={};/** +function uE(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Zn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function j6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var w={},cE={get exports(){return w},set exports(e){w=e}},Ge={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function rE(e,t){for(var n=0;n>>1,I=$[D];if(0>>1;Di(he,ee))Wi(ge,he)?($[D]=ge,$[W]=ee,D=W):($[D]=he,$[se]=ee,D=se);else if(Wi(ge,ee))$[D]=ge,$[W]=ee,D=W;else break e}}return K}function i($,K){var ee=$.sortIndex-K.sortIndex;return ee!==0?ee:$.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var u=[],l=[],c=1,h=null,p=3,y=!1,g=!1,b=!1,_=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C($){for(var K=n(l);K!==null;){if(K.callback===null)r(l);else if(K.startTime<=$)r(l),K.sortIndex=K.expirationTime,t(u,K);else break;K=n(l)}}function d($){if(b=!1,C($),!g)if(n(u)!==null)g=!0,R(v);else{var K=n(l);K!==null&&q(d,K.startTime-$)}}function v($,K){g=!1,b&&(b=!1,S(A),A=-1),y=!0;var ee=p;try{for(C(K),h=n(u);h!==null&&(!(h.expirationTime>K)||$&&!O());){var D=h.callback;if(typeof D=="function"){h.callback=null,p=h.priorityLevel;var I=D(h.expirationTime<=K);K=e.unstable_now(),typeof I=="function"?h.callback=I:h===n(u)&&r(u),C(K)}else r(u);h=n(u)}if(h!==null)var re=!0;else{var se=n(l);se!==null&&q(d,se.startTime-K),re=!1}return re}finally{h=null,p=ee,y=!1}}var m=!1,x=null,A=-1,L=5,P=-1;function O(){return!(e.unstable_now()-P$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function($){switch(p){case 1:case 2:case 3:var K=3;break;default:K=p}var ee=p;p=K;try{return $()}finally{p=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,K){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ee=p;p=$;try{return K()}finally{p=ee}},e.unstable_scheduleCallback=function($,K,ee){var D=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0D?($.sortIndex=ee,t(l,$),n(u)===null&&$===n(l)&&(b?(S(A),A=-1):b=!0,q(d,ee-D))):($.sortIndex=I,t(u,$),g||y||(g=!0,R(v))),$},e.unstable_shouldYield=O,e.unstable_wrapCallback=function($){var K=p;return function(){var ee=p;p=K;try{return $.apply(this,arguments)}finally{p=ee}}}})(N6);(function(e){e.exports=N6})(SE);/** + */(function(e){function t($,K){var ee=$.length;$.push(K);e:for(;0>>1,I=$[N];if(0>>1;Ni(he,ee))Vi(ge,he)?($[N]=ge,$[V]=ee,N=V):($[N]=he,$[se]=ee,N=se);else if(Vi(ge,ee))$[N]=ge,$[V]=ee,N=V;else break e}}return K}function i($,K){var ee=$.sortIndex-K.sortIndex;return ee!==0?ee:$.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var u=[],l=[],c=1,h=null,p=3,y=!1,g=!1,b=!1,_=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C($){for(var K=n(l);K!==null;){if(K.callback===null)r(l);else if(K.startTime<=$)r(l),K.sortIndex=K.expirationTime,t(u,K);else break;K=n(l)}}function d($){if(b=!1,C($),!g)if(n(u)!==null)g=!0,R(v);else{var K=n(l);K!==null&&q(d,K.startTime-$)}}function v($,K){g=!1,b&&(b=!1,S(A),A=-1),y=!0;var ee=p;try{for(C(K),h=n(u);h!==null&&(!(h.expirationTime>K)||$&&!L());){var N=h.callback;if(typeof N=="function"){h.callback=null,p=h.priorityLevel;var I=N(h.expirationTime<=K);K=e.unstable_now(),typeof I=="function"?h.callback=I:h===n(u)&&r(u),C(K)}else r(u);h=n(u)}if(h!==null)var re=!0;else{var se=n(l);se!==null&&q(d,se.startTime-K),re=!1}return re}finally{h=null,p=ee,y=!1}}var m=!1,x=null,A=-1,D=5,P=-1;function L(){return!(e.unstable_now()-P$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function($){switch(p){case 1:case 2:case 3:var K=3;break;default:K=p}var ee=p;p=K;try{return $()}finally{p=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,K){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ee=p;p=$;try{return K()}finally{p=ee}},e.unstable_scheduleCallback=function($,K,ee){var N=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0N?($.sortIndex=ee,t(l,$),n(u)===null&&$===n(l)&&(b?(S(A),A=-1):b=!0,q(d,ee-N))):($.sortIndex=I,t(u,$),g||y||(g=!0,R(v))),$},e.unstable_shouldYield=L,e.unstable_wrapCallback=function($){var K=p;return function(){var ee=p;p=K;try{return $.apply(this,arguments)}finally{p=ee}}}})(q6);(function(e){e.exports=q6})(RE);/** * @license React * react-dom.production.min.js * @@ -22,14 +22,14 @@ function rE(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hg=Object.prototype.hasOwnProperty,kE=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ib={},ob={};function xE(e){return Hg.call(ob,e)?!0:Hg.call(ib,e)?!1:kE.test(e)?ob[e]=!0:(ib[e]=!0,!1)}function CE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _E(e,t,n,r){if(t===null||typeof t>"u"||CE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Nn(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var yn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){yn[e]=new Nn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];yn[t]=new Nn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){yn[e]=new Nn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){yn[e]=new Nn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){yn[e]=new Nn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){yn[e]=new Nn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){yn[e]=new Nn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){yn[e]=new Nn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){yn[e]=new Nn(e,5,!1,e.toLowerCase(),null,!1,!1)});var iv=/[\-:]([a-z])/g;function ov(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(iv,ov);yn[t]=new Nn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(iv,ov);yn[t]=new Nn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(iv,ov);yn[t]=new Nn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){yn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!1,!1)});yn.xlinkHref=new Nn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){yn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!0,!0)});function av(e,t,n,r){var i=yn.hasOwnProperty(t)?yn[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vg=Object.prototype.hasOwnProperty,AE=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fb={},hb={};function TE(e){return Vg.call(hb,e)?!0:Vg.call(fb,e)?!1:AE.test(e)?hb[e]=!0:(fb[e]=!0,!1)}function PE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function IE(e,t,n,r){if(t===null||typeof t>"u"||PE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function zn(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var bn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){bn[e]=new zn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];bn[t]=new zn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){bn[e]=new zn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){bn[e]=new zn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){bn[e]=new zn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){bn[e]=new zn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){bn[e]=new zn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){bn[e]=new zn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){bn[e]=new zn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ov=/[\-:]([a-z])/g;function av(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ov,av);bn[t]=new zn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ov,av);bn[t]=new zn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ov,av);bn[t]=new zn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){bn[e]=new zn(e,1,!1,e.toLowerCase(),null,!1,!1)});bn.xlinkHref=new zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){bn[e]=new zn(e,1,!1,e.toLowerCase(),null,!0,!0)});function sv(e,t,n,r){var i=bn.hasOwnProperty(t)?bn[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var u=` -`+i[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=s);break}}}finally{Vp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ll(e):""}function EE(e){switch(e.tag){case 5:return ll(e.type);case 16:return ll("Lazy");case 13:return ll("Suspense");case 19:return ll("SuspenseList");case 0:case 2:case 15:return e=qp(e.type,!1),e;case 11:return e=qp(e.type.render,!1),e;case 1:return e=qp(e.type,!0),e;default:return""}}function Kg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Na:return"Fragment";case Ma:return"Portal";case Wg:return"Profiler";case sv:return"StrictMode";case Vg:return"Suspense";case qg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case F6:return(e.displayName||"Context")+".Consumer";case B6:return(e._context.displayName||"Context")+".Provider";case lv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case uv:return t=e.displayName||null,t!==null?t:Kg(e.type)||"Memo";case so:t=e._payload,e=e._init;try{return Kg(e(t))}catch{}}return null}function RE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Kg(t);case 8:return t===sv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ro(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function U6(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function AE(e){var t=U6(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ec(e){e._valueTracker||(e._valueTracker=AE(e))}function H6(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=U6(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Gg(e,t){var n=t.checked;return Lt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function sb(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ro(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function W6(e,t){t=t.checked,t!=null&&av(e,"checked",t,!1)}function Yg(e,t){W6(e,t);var n=Ro(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xg(e,t.type,Ro(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lb(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Xg(e,t,n){(t!=="number"||Pd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ul=Array.isArray;function Qa(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=tc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function zl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ml={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},TE=["Webkit","ms","Moz","O"];Object.keys(ml).forEach(function(e){TE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ml[t]=ml[e]})});function G6(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ml.hasOwnProperty(e)&&ml[e]?(""+t).trim():t+"px"}function Y6(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=G6(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var PE=Lt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zg(e,t){if(t){if(PE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function e0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var t0=null;function cv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var n0=null,Ja=null,Za=null;function db(e){if(e=Eu(e)){if(typeof n0!="function")throw Error(le(280));var t=e.stateNode;t&&(t=oh(t),n0(e.stateNode,e.type,t))}}function X6(e){Ja?Za?Za.push(e):Za=[e]:Ja=e}function Q6(){if(Ja){var e=Ja,t=Za;if(Za=Ja=null,db(e),t)for(e=0;e>>=0,e===0?32:31-($E(e)/UE|0)|0}var nc=64,rc=4194304;function cl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=cl(s):(o&=a,o!==0&&(r=cl(o)))}else a=n&~i,a!==0?r=cl(a):o!==0&&(r=cl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Cu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ti(t),e[t]=n}function qE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=vl),wb=String.fromCharCode(32),Sb=!1;function vS(e,t){switch(e){case"keyup":return wR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var za=!1;function kR(e,t){switch(e){case"compositionend":return yS(t);case"keypress":return t.which!==32?null:(Sb=!0,wb);case"textInput":return e=t.data,e===wb&&Sb?null:e;default:return null}}function xR(e,t){if(za)return e==="compositionend"||!yv&&vS(e,t)?(e=mS(),nd=mv=po=null,za=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_b(n)}}function kS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xS(){for(var e=window,t=Pd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pd(e.document)}return t}function bv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function OR(e){var t=xS(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kS(n.ownerDocument.documentElement,n)){if(r!==null&&bv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Eb(n,o);var a=Eb(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ja=null,l0=null,bl=null,u0=!1;function Rb(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;u0||ja==null||ja!==Pd(r)||(r=ja,"selectionStart"in r&&bv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bl&&Hl(bl,r)||(bl=r,r=zd(l0,"onSelect"),0$a||(e.current=m0[$a],m0[$a]=null,$a--)}function bt(e,t){$a++,m0[$a]=e.current,e.current=t}var Ao={},_n=No(Ao),Kn=No(!1),la=Ao;function cs(e,t){var n=e.type.contextTypes;if(!n)return Ao;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Gn(e){return e=e.childContextTypes,e!=null}function Bd(){Ct(Kn),Ct(_n)}function Db(e,t,n){if(_n.current!==Ao)throw Error(le(168));bt(_n,t),bt(Kn,n)}function OS(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(le(108,RE(e)||"Unknown",i));return Lt({},n,r)}function Fd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ao,la=_n.current,bt(_n,e),bt(Kn,Kn.current),!0}function Mb(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=OS(e,t,la),r.__reactInternalMemoizedMergedChildContext=e,Ct(Kn),Ct(_n),bt(_n,e)):Ct(Kn),bt(Kn,n)}var Oi=null,ah=!1,am=!1;function LS(e){Oi===null?Oi=[e]:Oi.push(e)}function WR(e){ah=!0,LS(e)}function zo(){if(!am&&Oi!==null){am=!0;var e=0,t=ct;try{var n=Oi;for(ct=1;e>=a,i-=a,Mi=1<<32-ti(t)+i|n<A?(L=x,x=null):L=x.sibling;var P=p(S,x,C[A],d);if(P===null){x===null&&(x=L);break}e&&x&&P.alternate===null&&t(S,x),k=o(P,k,A),m===null?v=P:m.sibling=P,m=P,x=L}if(A===C.length)return n(S,x),Rt&&Vo(S,A),v;if(x===null){for(;AA?(L=x,x=null):L=x.sibling;var O=p(S,x,P.value,d);if(O===null){x===null&&(x=L);break}e&&x&&O.alternate===null&&t(S,x),k=o(O,k,A),m===null?v=O:m.sibling=O,m=O,x=L}if(P.done)return n(S,x),Rt&&Vo(S,A),v;if(x===null){for(;!P.done;A++,P=C.next())P=h(S,P.value,d),P!==null&&(k=o(P,k,A),m===null?v=P:m.sibling=P,m=P);return Rt&&Vo(S,A),v}for(x=r(S,x);!P.done;A++,P=C.next())P=y(x,S,A,P.value,d),P!==null&&(e&&P.alternate!==null&&x.delete(P.key===null?A:P.key),k=o(P,k,A),m===null?v=P:m.sibling=P,m=P);return e&&x.forEach(function(V){return t(S,V)}),Rt&&Vo(S,A),v}function _(S,k,C,d){if(typeof C=="object"&&C!==null&&C.type===Na&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Zu:e:{for(var v=C.key,m=k;m!==null;){if(m.key===v){if(v=C.type,v===Na){if(m.tag===7){n(S,m.sibling),k=i(m,C.props.children),k.return=S,S=k;break e}}else if(m.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===so&&Ub(v)===m.type){n(S,m.sibling),k=i(m,C.props),k.ref=qs(S,m,C),k.return=S,S=k;break e}n(S,m);break}else t(S,m);m=m.sibling}C.type===Na?(k=oa(C.props.children,S.mode,d,C.key),k.return=S,S=k):(d=ud(C.type,C.key,C.props,null,S.mode,d),d.ref=qs(S,k,C),d.return=S,S=d)}return a(S);case Ma:e:{for(m=C.key;k!==null;){if(k.key===m)if(k.tag===4&&k.stateNode.containerInfo===C.containerInfo&&k.stateNode.implementation===C.implementation){n(S,k.sibling),k=i(k,C.children||[]),k.return=S,S=k;break e}else{n(S,k);break}else t(S,k);k=k.sibling}k=hm(C,S.mode,d),k.return=S,S=k}return a(S);case so:return m=C._init,_(S,k,m(C._payload),d)}if(ul(C))return g(S,k,C,d);if(Fs(C))return b(S,k,C,d);uc(S,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,k!==null&&k.tag===6?(n(S,k.sibling),k=i(k,C),k.return=S,S=k):(n(S,k),k=fm(C,S.mode,d),k.return=S,S=k),a(S)):n(S,k)}return _}var fs=BS(!0),FS=BS(!1),Ru={},ki=No(Ru),Kl=No(Ru),Gl=No(Ru);function Zo(e){if(e===Ru)throw Error(le(174));return e}function Rv(e,t){switch(bt(Gl,t),bt(Kl,e),bt(ki,Ru),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jg(t,e)}Ct(ki),bt(ki,t)}function hs(){Ct(ki),Ct(Kl),Ct(Gl)}function $S(e){Zo(Gl.current);var t=Zo(ki.current),n=Jg(t,e.type);t!==n&&(bt(Kl,e),bt(ki,n))}function Av(e){Kl.current===e&&(Ct(ki),Ct(Kl))}var Pt=No(0);function qd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sm=[];function Tv(){for(var e=0;en?n:4,e(!0);var r=lm.transition;lm.transition={};try{e(!1),t()}finally{ct=n,lm.transition=r}}function n5(){return Fr().memoizedState}function GR(e,t,n){var r=xo(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},r5(e)?i5(t,n):(o5(e,t,n),n=Dn(),e=zr(e,r,n),e!==null&&a5(e,t,r))}function YR(e,t,n){var r=xo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(r5(e))i5(t,i);else{o5(e,t,i);var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,ii(s,a))return}catch{}finally{}n=Dn(),e=zr(e,r,n),e!==null&&a5(e,t,r)}}function r5(e){var t=e.alternate;return e===It||t!==null&&t===It}function i5(e,t){wl=Kd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function o5(e,t,n){x5(e)?(e=t.interleaved,e===null?(n.next=n,Jr===null?Jr=[t]:Jr.push(t)):(n.next=e.next,e.next=n),t.interleaved=n):(e=t.pending,e===null?n.next=n:(n.next=e.next,e.next=n),t.pending=n)}function a5(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,fv(e,n)}}var Gd={readContext:Br,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},XR={readContext:Br,useCallback:function(e,t){return mi().memoizedState=[e,t===void 0?null:t],e},useContext:Br,useEffect:Wb,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ad(4194308,4,QS.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ad(4194308,4,e,t)},useInsertionEffect:function(e,t){return ad(4,2,e,t)},useMemo:function(e,t){var n=mi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=GR.bind(null,It,e),[r.memoizedState,e]},useRef:function(e){var t=mi();return e={current:e},t.memoizedState=e},useState:Hb,useDebugValue:Dv,useDeferredValue:function(e){return mi().memoizedState=e},useTransition:function(){var e=Hb(!1),t=e[0];return e=KR.bind(null,e[1]),mi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=It,i=mi();if(Rt){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),nn===null)throw Error(le(349));ca&30||WS(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Wb(qS.bind(null,r,o,e),[e]),r.flags|=2048,Ql(9,VS.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=mi(),t=nn.identifierPrefix;if(Rt){var n=Ni,r=Mi;n=(r&~(1<<32-ti(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Yl++,0")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=s);break}}}finally{qp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ul(e):""}function OE(e){switch(e.tag){case 5:return ul(e.type);case 16:return ul("Lazy");case 13:return ul("Suspense");case 19:return ul("SuspenseList");case 0:case 2:case 15:return e=Kp(e.type,!1),e;case 11:return e=Kp(e.type.render,!1),e;case 1:return e=Kp(e.type,!0),e;default:return""}}function Gg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ba:return"Fragment";case ja:return"Portal";case Wg:return"Profiler";case lv:return"StrictMode";case qg:return"Suspense";case Kg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case X6:return(e.displayName||"Context")+".Consumer";case Y6:return(e._context.displayName||"Context")+".Provider";case uv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case cv:return t=e.displayName||null,t!==null?t:Gg(e.type)||"Memo";case lo:t=e._payload,e=e._init;try{return Gg(e(t))}catch{}}return null}function LE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Gg(t);case 8:return t===lv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ao(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J6(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function DE(e){var t=J6(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nc(e){e._valueTracker||(e._valueTracker=DE(e))}function Z6(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=J6(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Od(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yg(e,t){var n=t.checked;return Dt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mb(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ao(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function eS(e,t){t=t.checked,t!=null&&sv(e,"checked",t,!1)}function Xg(e,t){eS(e,t);var n=Ao(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Qg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Qg(e,t.type,Ao(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gb(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Qg(e,t,n){(t!=="number"||Od(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var cl=Array.isArray;function es(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=rc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var gl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},NE=["Webkit","ms","Moz","O"];Object.keys(gl).forEach(function(e){NE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),gl[t]=gl[e]})});function iS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||gl.hasOwnProperty(e)&&gl[e]?(""+t).trim():t+"px"}function oS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=iS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var ME=Dt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function e0(e,t){if(t){if(ME[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function t0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var n0=null;function dv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var r0=null,ts=null,ns=null;function bb(e){if(e=Ru(e)){if(typeof r0!="function")throw Error(le(280));var t=e.stateNode;t&&(t=sh(t),r0(e.stateNode,e.type,t))}}function aS(e){ts?ns?ns.push(e):ns=[e]:ts=e}function sS(){if(ts){var e=ts,t=ns;if(ns=ts=null,bb(e),t)for(e=0;e>>=0,e===0?32:31-(KE(e)/GE|0)|0}var ic=64,oc=4194304;function dl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Md(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=dl(s):(o&=a,o!==0&&(r=dl(o)))}else a=n&~i,a!==0?r=dl(a):o!==0&&(r=dl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function _u(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ri(t),e[t]=n}function JE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=yl),Ab=String.fromCharCode(32),Tb=!1;function RS(e,t){switch(e){case"keyup":return ER.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function AS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fa=!1;function AR(e,t){switch(e){case"compositionend":return AS(t);case"keypress":return t.which!==32?null:(Tb=!0,Ab);case"textInput":return e=t.data,e===Ab&&Tb?null:e;default:return null}}function TR(e,t){if(Fa)return e==="compositionend"||!bv&&RS(e,t)?(e=_S(),id=gv=mo=null,Fa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Lb(n)}}function OS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?OS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function LS(){for(var e=window,t=Od();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Od(e.document)}return t}function wv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function jR(e){var t=LS(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&OS(n.ownerDocument.documentElement,n)){if(r!==null&&wv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Db(n,o);var a=Db(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$a=null,u0=null,wl=null,c0=!1;function Nb(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;c0||$a==null||$a!==Od(r)||(r=$a,"selectionStart"in r&&wv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wl&&Vl(wl,r)||(wl=r,r=Bd(u0,"onSelect"),0Va||(e.current=g0[Va],g0[Va]=null,Va--)}function bt(e,t){Va++,g0[Va]=e.current,e.current=t}var To={},_n=Mo(To),Yn=Mo(!1),la=To;function hs(e,t){var n=e.type.contextTypes;if(!n)return To;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Xn(e){return e=e.childContextTypes,e!=null}function $d(){Ct(Yn),Ct(_n)}function Hb(e,t,n){if(_n.current!==To)throw Error(le(168));bt(_n,t),bt(Yn,n)}function HS(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(le(108,LE(e)||"Unknown",i));return Dt({},n,r)}function Hd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||To,la=_n.current,bt(_n,e),bt(Yn,Yn.current),!0}function Ub(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=HS(e,t,la),r.__reactInternalMemoizedMergedChildContext=e,Ct(Yn),Ct(_n),bt(_n,e)):Ct(Yn),bt(Yn,n)}var Li=null,lh=!1,sm=!1;function US(e){Li===null?Li=[e]:Li.push(e)}function XR(e){lh=!0,US(e)}function zo(){if(!sm&&Li!==null){sm=!0;var e=0,t=ct;try{var n=Li;for(ct=1;e>=a,i-=a,Mi=1<<32-ri(t)+i|n<A?(D=x,x=null):D=x.sibling;var P=p(S,x,C[A],d);if(P===null){x===null&&(x=D);break}e&&x&&P.alternate===null&&t(S,x),k=o(P,k,A),m===null?v=P:m.sibling=P,m=P,x=D}if(A===C.length)return n(S,x),At&&Wo(S,A),v;if(x===null){for(;AA?(D=x,x=null):D=x.sibling;var L=p(S,x,P.value,d);if(L===null){x===null&&(x=D);break}e&&x&&L.alternate===null&&t(S,x),k=o(L,k,A),m===null?v=L:m.sibling=L,m=L,x=D}if(P.done)return n(S,x),At&&Wo(S,A),v;if(x===null){for(;!P.done;A++,P=C.next())P=h(S,P.value,d),P!==null&&(k=o(P,k,A),m===null?v=P:m.sibling=P,m=P);return At&&Wo(S,A),v}for(x=r(S,x);!P.done;A++,P=C.next())P=y(x,S,A,P.value,d),P!==null&&(e&&P.alternate!==null&&x.delete(P.key===null?A:P.key),k=o(P,k,A),m===null?v=P:m.sibling=P,m=P);return e&&x.forEach(function(W){return t(S,W)}),At&&Wo(S,A),v}function _(S,k,C,d){if(typeof C=="object"&&C!==null&&C.type===Ba&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case tc:e:{for(var v=C.key,m=k;m!==null;){if(m.key===v){if(v=C.type,v===Ba){if(m.tag===7){n(S,m.sibling),k=i(m,C.props.children),k.return=S,S=k;break e}}else if(m.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===lo&&Xb(v)===m.type){n(S,m.sibling),k=i(m,C.props),k.ref=Ys(S,m,C),k.return=S,S=k;break e}n(S,m);break}else t(S,m);m=m.sibling}C.type===Ba?(k=oa(C.props.children,S.mode,d,C.key),k.return=S,S=k):(d=dd(C.type,C.key,C.props,null,S.mode,d),d.ref=Ys(S,k,C),d.return=S,S=d)}return a(S);case ja:e:{for(m=C.key;k!==null;){if(k.key===m)if(k.tag===4&&k.stateNode.containerInfo===C.containerInfo&&k.stateNode.implementation===C.implementation){n(S,k.sibling),k=i(k,C.children||[]),k.return=S,S=k;break e}else{n(S,k);break}else t(S,k);k=k.sibling}k=pm(C,S.mode,d),k.return=S,S=k}return a(S);case lo:return m=C._init,_(S,k,m(C._payload),d)}if(cl(C))return g(S,k,C,d);if(Us(C))return b(S,k,C,d);dc(S,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,k!==null&&k.tag===6?(n(S,k.sibling),k=i(k,C),k.return=S,S=k):(n(S,k),k=hm(C,S.mode,d),k.return=S,S=k),a(S)):n(S,k)}return _}var ms=YS(!0),XS=YS(!1),Au={},ki=Mo(Au),Gl=Mo(Au),Yl=Mo(Au);function Zo(e){if(e===Au)throw Error(le(174));return e}function Av(e,t){switch(bt(Yl,t),bt(Gl,e),bt(ki,Au),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Zg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Zg(t,e)}Ct(ki),bt(ki,t)}function gs(){Ct(ki),Ct(Gl),Ct(Yl)}function QS(e){Zo(Yl.current);var t=Zo(ki.current),n=Zg(t,e.type);t!==n&&(bt(Gl,e),bt(ki,n))}function Tv(e){Gl.current===e&&(Ct(ki),Ct(Gl))}var It=Mo(0);function Gd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lm=[];function Pv(){for(var e=0;en?n:4,e(!0);var r=um.transition;um.transition={};try{e(!1),t()}finally{ct=n,um.transition=r}}function f5(){return Ur().memoizedState}function eA(e,t,n){var r=Co(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},h5(e)?p5(t,n):(m5(e,t,n),n=Dn(),e=Fr(e,r,n),e!==null&&g5(e,t,r))}function tA(e,t,n){var r=Co(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(h5(e))p5(t,i);else{m5(e,t,i);var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,ai(s,a))return}catch{}finally{}n=Dn(),e=Fr(e,r,n),e!==null&&g5(e,t,r)}}function h5(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function p5(e,t){Sl=Yd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function m5(e,t,n){L5(e)?(e=t.interleaved,e===null?(n.next=n,ei===null?ei=[t]:ei.push(t)):(n.next=e.next,e.next=n),t.interleaved=n):(e=t.pending,e===null?n.next=n:(n.next=e.next,e.next=n),t.pending=n)}function g5(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hv(e,n)}}var Xd={readContext:Hr,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useInsertionEffect:Sn,useLayoutEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useMutableSource:Sn,useSyncExternalStore:Sn,useId:Sn,unstable_isNewReconciler:!1},nA={readContext:Hr,useCallback:function(e,t){return mi().memoizedState=[e,t===void 0?null:t],e},useContext:Hr,useEffect:Jb,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ld(4194308,4,s5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ld(4194308,4,e,t)},useInsertionEffect:function(e,t){return ld(4,2,e,t)},useMemo:function(e,t){var n=mi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=eA.bind(null,Ot,e),[r.memoizedState,e]},useRef:function(e){var t=mi();return e={current:e},t.memoizedState=e},useState:Qb,useDebugValue:Nv,useDeferredValue:function(e){return mi().memoizedState=e},useTransition:function(){var e=Qb(!1),t=e[0];return e=ZR.bind(null,e[1]),mi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ot,i=mi();if(At){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),nn===null)throw Error(le(349));ca&30||e5(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Jb(n5.bind(null,r,o,e),[e]),r.flags|=2048,Jl(9,t5.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=mi(),t=nn.identifierPrefix;if(At){var n=zi,r=Mi;n=(r&~(1<<32-ri(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Xl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[bi]=t,e[ql]=r,u5(e,t,!1,!1),t.stateNode=e;e:{switch(a=e0(n,r),n){case"dialog":St("cancel",e),St("close",e),i=r;break;case"iframe":case"object":case"embed":St("load",e),i=r;break;case"video":case"audio":for(i=0;ips&&(t.flags|=128,r=!0,Ks(o,!1),t.lanes=4194304)}else{if(!r)if(e=qd(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ks(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Rt)return Sn(t),null}else 2*Ft()-o.renderingStartTime>ps&&n!==1073741824&&(t.flags|=128,r=!0,Ks(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ft(),t.sibling=null,n=Pt.current,bt(Pt,r?n&1|2:n&1),t):(Sn(t),null);case 22:case 23:return Fv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lr&1073741824&&(Sn(t),t.subtreeFlags&6&&(t.flags|=8192)):Sn(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}var tA=Hi.ReactCurrentOwner,Vn=!1;function In(e,t,n,r){t.child=e===null?FS(t,null,n,r):fs(t,e.child,n,r)}function Gb(e,t,n,r,i){n=n.render;var o=t.ref;return ts(t,i),r=Iv(e,t,n,r,o,i),n=Ov(),e!==null&&!Vn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,$i(e,t,i)):(Rt&&n&&Cv(t),t.flags|=1,In(e,t,r,i),t.child)}function Yb(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Uv(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,f5(e,t,o,r,i)):(e=ud(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Hl,n(a,r)&&e.ref===t.ref)return $i(e,t,i)}return t.flags|=1,e=To(o,r),e.ref=t.ref,e.return=t,t.child=e}function f5(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Hl(o,r)&&e.ref===t.ref)if(Vn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Vn=!0);else return t.lanes=e.lanes,$i(e,t,i)}return x0(e,t,n,r,i)}function h5(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},bt(qa,lr),lr|=n;else if(n&1073741824)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,bt(qa,lr),lr|=r;else return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,bt(qa,lr),lr|=e,null;else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,bt(qa,lr),lr|=r;return In(e,t,i,n),t.child}function p5(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function x0(e,t,n,r,i){var o=Gn(n)?la:_n.current;return o=cs(t,o),ts(t,i),n=Iv(e,t,n,r,o,i),r=Ov(),e!==null&&!Vn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,$i(e,t,i)):(Rt&&r&&Cv(t),t.flags|=1,In(e,t,n,i),t.child)}function Xb(e,t,n,r,i){if(Gn(n)){var o=!0;Fd(t)}else o=!1;if(ts(t,i),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),NS(t,n,r),y0(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,l=n.contextType;typeof l=="object"&&l!==null?l=Br(l):(l=Gn(n)?la:_n.current,l=cs(t,l));var c=n.getDerivedStateFromProps,h=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||u!==l)&&Bb(t,a,r,l),lo=!1;var p=t.memoizedState;a.state=p,Hd(t,r,a,i),u=t.memoizedState,s!==r||p!==u||Kn.current||lo?(typeof c=="function"&&(v0(t,n,c,r),u=t.memoizedState),(s=lo||jb(t,n,s,r,p,u,l))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=l,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,DS(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Yr(t.type,s),a.props=l,h=t.pendingProps,p=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=Br(u):(u=Gn(n)?la:_n.current,u=cs(t,u));var y=n.getDerivedStateFromProps;(c=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==h||p!==u)&&Bb(t,a,r,u),lo=!1,p=t.memoizedState,a.state=p,Hd(t,r,a,i);var g=t.memoizedState;s!==h||p!==g||Kn.current||lo?(typeof y=="function"&&(v0(t,n,y,r),g=t.memoizedState),(l=lo||jb(t,n,l,r,p,g,u)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=u,r=l):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return C0(e,t,n,r,o,i)}function C0(e,t,n,r,i,o){p5(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Mb(t,n,!1),$i(e,t,o);r=t.stateNode,tA.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=fs(t,e.child,null,o),t.child=fs(t,null,s,o)):In(e,t,s,o),t.memoizedState=r.state,i&&Mb(t,n,!0),t.child}function m5(e){var t=e.stateNode;t.pendingContext?Db(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Db(e,t.context,!1),Rv(e,t.containerInfo)}function Qb(e,t,n,r,i){return ds(),Ev(i),t.flags|=256,In(e,t,n,r),t.child}var cc={dehydrated:null,treeContext:null,retryLane:0};function dc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Jb(e,t){return{baseLanes:e.baseLanes|t,cachePool:null,transitions:e.transitions}}function g5(e,t,n){var r=t.pendingProps,i=Pt.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),bt(Pt,i&1),e===null)return w0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=Zd(i,r,0,null),e=oa(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=dc(n),t.memoizedState=cc,e):_0(t,i));if(i=e.memoizedState,i!==null){if(s=i.dehydrated,s!==null){if(a)return t.flags&256?(t.flags&=-257,fc(e,t,n,Error(le(422)))):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Zd({mode:"visible",children:r.children},i,0,null),o=oa(o,i,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&fs(t,e.child,null,n),t.child.memoizedState=dc(n),t.memoizedState=cc,o);if(!(t.mode&1))t=fc(e,t,n,null);else if(s.data==="$!")t=fc(e,t,n,Error(le(419)));else if(r=(n&e.childLanes)!==0,Vn||r){if(r=nn,r!==null){switch(n&-n){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}r=o&(r.suspendedLanes|n)?0:o,r!==0&&r!==i.retryLane&&(i.retryLane=r,zr(e,r,-1))}$v(),t=fc(e,t,n,Error(le(421)))}else s.data==="$?"?(t.flags|=128,t.child=e.child,t=hA.bind(null,e),s._reactRetry=t,t=null):(n=i.treeContext,Wn=Di(s.nextSibling),pr=t,Rt=!0,Qr=null,n!==null&&(Tr[Pr++]=Mi,Tr[Pr++]=Ni,Tr[Pr++]=ua,Mi=n.id,Ni=n.overflow,ua=t),t=_0(t,t.pendingProps.children),t.flags|=4096);return t}return o?(r=e3(e,t,r.children,r.fallback,n),o=t.child,i=e.child.memoizedState,o.memoizedState=i===null?dc(n):Jb(i,n),o.childLanes=e.childLanes&~n,t.memoizedState=cc,r):(n=Zb(e,t,r.children,n),t.memoizedState=null,n)}return o?(r=e3(e,t,r.children,r.fallback,n),o=t.child,i=e.child.memoizedState,o.memoizedState=i===null?dc(n):Jb(i,n),o.childLanes=e.childLanes&~n,t.memoizedState=cc,r):(n=Zb(e,t,r.children,n),t.memoizedState=null,n)}function _0(e,t){return t=Zd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zb(e,t,n,r){var i=e.child;return e=i.sibling,n=To(i,{mode:"visible",children:n}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n}function e3(e,t,n,r,i){var o=t.mode;e=e.child;var a=e.sibling,s={mode:"hidden",children:n};return!(o&1)&&t.child!==e?(n=t.child,n.childLanes=0,n.pendingProps=s,t.deletions=null):(n=To(e,s),n.subtreeFlags=e.subtreeFlags&14680064),a!==null?r=To(a,r):(r=oa(r,o,i,null),r.flags|=2),r.return=t,n.return=t,n.sibling=r,t.child=n,r}function fc(e,t,n,r){return r!==null&&Ev(r),fs(t,e.child,null,n),e=_0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function t3(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),g0(e.return,t,n)}function dm(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function v5(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(In(e,t,r.children,n),r=Pt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&t3(e,n,t);else if(e.tag===19)t3(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(bt(Pt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&qd(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),dm(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&qd(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}dm(t,!0,n,null,o);break;case"together":dm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $i(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),da|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(le(153));if(t.child!==null){for(e=t.child,n=To(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=To(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nA(e,t,n){switch(t.tag){case 3:m5(t),ds();break;case 5:$S(t);break;case 1:Gn(t.type)&&Fd(t);break;case 4:Rv(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;bt($d,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(bt(Pt,Pt.current&1),t.flags|=128,null):n&t.child.childLanes?g5(e,t,n):(bt(Pt,Pt.current&1),e=$i(e,t,n),e!==null?e.sibling:null);bt(Pt,Pt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return v5(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),bt(Pt,Pt.current),r)break;return null;case 22:case 23:return t.lanes=0,h5(e,t,n)}return $i(e,t,n)}function rA(e,t){switch(_v(t),t.tag){case 1:return Gn(t.type)&&Bd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hs(),Ct(Kn),Ct(_n),Tv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Av(t),null;case 13:if(Ct(Pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ct(Pt),null;case 4:return hs(),null;case 10:return kv(t.type._context),null;case 22:case 23:return Fv(),null;case 24:return null;default:return null}}var hc=!1,xn=!1,iA=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Va(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Mt(e,t,r)}else n.current=null}function E0(e,t,n){try{n()}catch(r){Mt(e,t,r)}}var n3=!1;function oA(e,t){if(c0=Md,e=xS(),bv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,u=-1,l=0,c=0,h=e,p=null;t:for(;;){for(var y;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(u=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)p=h,h=y;for(;;){if(h===e)break t;if(p===n&&++l===i&&(s=a),p===o&&++c===r&&(u=a),(y=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=y}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(d0={focusedElem:e,selectionRange:n},Md=!1,ke=t;ke!==null;)if(t=ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ke=e;else for(;ke!==null;){t=ke;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var b=g.memoizedProps,_=g.memoizedState,S=t.stateNode,k=S.getSnapshotBeforeUpdate(t.elementType===t.type?b:Yr(t.type,b),_);S.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var C=t.stateNode.containerInfo;if(C.nodeType===1)C.textContent="";else if(C.nodeType===9){var d=C.body;d!=null&&(d.textContent="")}break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(v){Mt(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,ke=e;break}ke=t.return}return g=n3,n3=!1,g}function Sl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&E0(t,n,o)}i=i.next}while(i!==r)}}function uh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function R0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function y5(e){var t=e.alternate;t!==null&&(e.alternate=null,y5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bi],delete t[ql],delete t[p0],delete t[UR],delete t[HR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function b5(e){return e.tag===5||e.tag===3||e.tag===4}function r3(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||b5(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function A0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=jd));else if(r!==4&&(e=e.child,e!==null))for(A0(e,t,n),e=e.sibling;e!==null;)A0(e,t,n),e=e.sibling}function T0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(T0(e,t,n),e=e.sibling;e!==null;)T0(e,t,n),e=e.sibling}var pn=null,Xr=!1;function Zi(e,t,n){for(n=n.child;n!==null;)w5(e,t,n),n=n.sibling}function w5(e,t,n){if(Si&&typeof Si.onCommitFiberUnmount=="function")try{Si.onCommitFiberUnmount(th,n)}catch{}switch(n.tag){case 5:xn||Va(n,t);case 6:var r=pn,i=Xr;pn=null,Zi(e,t,n),pn=r,Xr=i,pn!==null&&(Xr?(e=pn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pn.removeChild(n.stateNode));break;case 18:pn!==null&&(Xr?(e=pn,n=n.stateNode,e.nodeType===8?om(e.parentNode,n):e.nodeType===1&&om(e,n),$l(e)):om(pn,n.stateNode));break;case 4:r=pn,i=Xr,pn=n.stateNode.containerInfo,Xr=!0,Zi(e,t,n),pn=r,Xr=i;break;case 0:case 11:case 14:case 15:if(!xn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&E0(n,t,a),i=i.next}while(i!==r)}Zi(e,t,n);break;case 1:if(!xn&&(Va(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Mt(n,t,s)}Zi(e,t,n);break;case 21:Zi(e,t,n);break;case 22:n.mode&1?(xn=(r=xn)||n.memoizedState!==null,Zi(e,t,n),xn=r):Zi(e,t,n);break;default:Zi(e,t,n)}}function i3(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new iA),t.forEach(function(r){var i=pA.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function qr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Ft()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sA(r/1960))-r,10e?16:e,mo===null)var r=!1;else{if(e=mo,mo=null,Qd=0,et&6)throw Error(le(331));var i=et;for(et|=4,ke=e.current;ke!==null;){var o=ke,a=o.child;if(ke.flags&16){var s=o.deletions;if(s!==null){for(var u=0;uFt()-jv?ia(e,0):zv|=n),Yn(e,t)}function T5(e,t){t===0&&(e.mode&1?(t=rc,rc<<=1,!(rc&130023424)&&(rc=4194304)):t=1);var n=Dn();e=dh(e,t),e!==null&&(Cu(e,t,n),Yn(e,n))}function hA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),T5(e,n)}function pA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),T5(e,n)}var P5;P5=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Kn.current)Vn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Vn=!1,nA(e,t,n);Vn=!!(e.flags&131072)}else Vn=!1,Rt&&t.flags&1048576&&zS(t,Vd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var i=cs(t,_n.current);ts(t,n),i=Iv(null,t,r,e,i,n);var o=Ov();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gn(r)?(o=!0,Fd(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xv(t),i.updater=sh,t.stateNode=i,i._reactInternals=t,y0(t,r,e,n),t=C0(null,t,r,!0,o,n)):(t.tag=0,Rt&&o&&Cv(t),In(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=gA(r),e=Yr(r,e),i){case 0:t=x0(null,t,r,e,n);break e;case 1:t=Xb(null,t,r,e,n);break e;case 11:t=Gb(null,t,r,e,n);break e;case 14:t=Yb(null,t,r,Yr(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),x0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),Xb(e,t,r,i,n);case 3:e:{if(m5(t),e===null)throw Error(le(387));r=t.pendingProps,o=t.memoizedState,i=o.element,DS(e,t),Hd(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Error(le(423)),t=Qb(e,t,r,n,i);break e}else if(r!==i){i=Error(le(424)),t=Qb(e,t,r,n,i);break e}else for(Wn=Di(t.stateNode.containerInfo.firstChild),pr=t,Rt=!0,Qr=null,n=FS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ds(),r===i){t=$i(e,t,n);break e}In(e,t,r,n)}t=t.child}return t;case 5:return $S(t),e===null&&w0(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,f0(r,i)?a=null:o!==null&&f0(r,o)&&(t.flags|=32),p5(e,t),In(e,t,a,n),t.child;case 6:return e===null&&w0(t),null;case 13:return g5(e,t,n);case 4:return Rv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fs(t,null,r,n):In(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),Gb(e,t,r,i,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,bt($d,r._currentValue),r._currentValue=a,o!==null)if(ii(o.value,a)){if(o.children===i.children&&!Kn.current){t=$i(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=ji(-1,n&-n),u.tag=2;var l=o.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),g0(o.return,n,t),s.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(le(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),g0(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}In(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ts(t,n),i=Br(i),r=r(i),t.flags|=1,In(e,t,r,n),t.child;case 14:return r=t.type,i=Yr(r,t.pendingProps),i=Yr(r.type,i),Yb(e,t,r,i,n);case 15:return f5(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,Gn(r)?(e=!0,Fd(t)):e=!1,ts(t,n),NS(t,r,i),y0(t,r,i,n),C0(null,t,r,!0,e,n);case 19:return v5(e,t,n);case 22:return h5(e,t,n)}throw Error(le(156,t.tag))};function I5(e,t){return iS(e,t)}function mA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(e,t,n,r){return new mA(e,t,n,r)}function Uv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gA(e){if(typeof e=="function")return Uv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lv)return 11;if(e===uv)return 14}return 2}function To(e,t){var n=e.alternate;return n===null?(n=Mr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ud(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")Uv(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Na:return oa(n.children,i,o,t);case sv:a=8,i|=8;break;case Wg:return e=Mr(12,n,t,i|2),e.elementType=Wg,e.lanes=o,e;case Vg:return e=Mr(13,n,t,i),e.elementType=Vg,e.lanes=o,e;case qg:return e=Mr(19,n,t,i),e.elementType=qg,e.lanes=o,e;case $6:return Zd(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B6:a=10;break e;case F6:a=9;break e;case lv:a=11;break e;case uv:a=14;break e;case so:a=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=Mr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function oa(e,t,n,r){return e=Mr(7,e,r,t),e.lanes=n,e}function Zd(e,t,n,r){return e=Mr(22,e,r,t),e.elementType=$6,e.lanes=n,e.stateNode={},e}function fm(e,t,n){return e=Mr(6,e,null,t),e.lanes=n,e}function hm(e,t,n){return t=Mr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vA(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gp(0),this.expirationTimes=Gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Hv(e,t,n,r,i,o,a,s,u){return e=new vA(e,t,n,s,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Mr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xv(o),e}function yA(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=vr})(wE);var M5,f3=Lr;M5=f3.createRoot,f3.hydrateRoot;/** +`+o.stack}return{value:e,source:t,stack:i}}function k0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var oA=typeof WeakMap=="function"?WeakMap:Map;function v5(e,t,n){n=Bi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Jd||(Jd=!0,I0=r),k0(e,t)},n}function y5(e,t,n){n=Bi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){k0(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){k0(e,t),typeof r!="function"&&(xo===null?xo=new Set([this]):xo.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Zb(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oA;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=yA.bind(null,e,t,n),t.then(e,e))}function e3(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function t3(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bi(-1,1),t.tag=2,ko(n,t))),n.lanes|=1),e)}var b5,x0,w5,S5;b5=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};x0=function(){};w5=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Zo(ki.current);var o=null;switch(n){case"input":i=Yg(e,i),r=Yg(e,r),o=[];break;case"select":i=Dt({},i,{value:void 0}),r=Dt({},r,{value:void 0}),o=[];break;case"textarea":i=Jg(e,i),r=Jg(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Fd)}e0(n,r);var a;n=null;for(l in i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var s=i[l];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(zl.hasOwnProperty(l)?o||(o=[]):(o=o||[]).push(l,null));for(l in r){var u=r[l];if(s=i!=null?i[l]:void 0,r.hasOwnProperty(l)&&u!==s&&(u!=null||s!=null))if(l==="style")if(s){for(a in s)!s.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&s[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(o||(o=[]),o.push(l,n)),n=u;else l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(o=o||[]).push(l,u)):l==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(l,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(zl.hasOwnProperty(l)?(u!=null&&l==="onScroll"&&St("scroll",e),o||s===u||(o=[])):(o=o||[]).push(l,u))}n&&(o=o||[]).push("style",n);var l=o;(t.updateQueue=l)&&(t.flags|=4)}};S5=function(e,t,n,r){n!==r&&(t.flags|=4)};function Xs(e,t){if(!At)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function kn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function aA(e,t,n){var r=t.pendingProps;switch(Ev(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(t),null;case 1:return Xn(t.type)&&$d(),kn(t),null;case 3:return r=t.stateNode,gs(),Ct(Yn),Ct(_n),Pv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zr!==null&&(D0(Zr),Zr=null))),x0(e,t),kn(t),null;case 5:Tv(t);var i=Zo(Yl.current);if(n=t.type,e!==null&&t.stateNode!=null)w5(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(le(166));return kn(t),null}if(e=Zo(ki.current),Gs(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[bi]=t,r[Kl]=o,e=(t.mode&1)!==0,n){case"dialog":St("cancel",r),St("close",r);break;case"iframe":case"object":case"embed":St("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[bi]=t,e[Kl]=r,b5(e,t,!1,!1),t.stateNode=e;e:{switch(a=t0(n,r),n){case"dialog":St("cancel",e),St("close",e),i=r;break;case"iframe":case"object":case"embed":St("load",e),i=r;break;case"video":case"audio":for(i=0;ivs&&(t.flags|=128,r=!0,Xs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Gd(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!At)return kn(t),null}else 2*$t()-o.renderingStartTime>vs&&n!==1073741824&&(t.flags|=128,r=!0,Xs(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=$t(),t.sibling=null,n=It.current,bt(It,r?n&1|2:n&1),t):(kn(t),null);case 22:case 23:return $v(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?cr&1073741824&&(kn(t),t.subtreeFlags&6&&(t.flags|=8192)):kn(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}var sA=Vi.ReactCurrentOwner,qn=!1;function In(e,t,n,r){t.child=e===null?XS(t,null,n,r):ms(t,e.child,n,r)}function n3(e,t,n,r,i){n=n.render;var o=t.ref;return is(t,i),r=Ov(e,t,n,r,o,i),n=Lv(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hi(e,t,i)):(At&&n&&_v(t),t.flags|=1,In(e,t,r,i),t.child)}function r3(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Uv(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,k5(e,t,o,r,i)):(e=dd(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Vl,n(a,r)&&e.ref===t.ref)return Hi(e,t,i)}return t.flags|=1,e=Po(o,r),e.ref=t.ref,e.return=t,t.child=e}function k5(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Vl(o,r)&&e.ref===t.ref)if(qn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(qn=!0);else return t.lanes=e.lanes,Hi(e,t,i)}return C0(e,t,n,r,i)}function x5(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},bt(Ya,cr),cr|=n;else if(n&1073741824)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,bt(Ya,cr),cr|=r;else return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,bt(Ya,cr),cr|=e,null;else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,bt(Ya,cr),cr|=r;return In(e,t,i,n),t.child}function C5(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function C0(e,t,n,r,i){var o=Xn(n)?la:_n.current;return o=hs(t,o),is(t,i),n=Ov(e,t,n,r,o,i),r=Lv(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hi(e,t,i)):(At&&r&&_v(t),t.flags|=1,In(e,t,n,i),t.child)}function i3(e,t,n,r,i){if(Xn(n)){var o=!0;Hd(t)}else o=!1;if(is(t,i),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),qS(t,n,r),b0(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,l=n.contextType;typeof l=="object"&&l!==null?l=Hr(l):(l=Xn(n)?la:_n.current,l=hs(t,l));var c=n.getDerivedStateFromProps,h=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||u!==l)&&Kb(t,a,r,l),uo=!1;var p=t.memoizedState;a.state=p,Wd(t,r,a,i),u=t.memoizedState,s!==r||p!==u||Yn.current||uo?(typeof c=="function"&&(y0(t,n,c,r),u=t.memoizedState),(s=uo||qb(t,n,s,r,p,u,l))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=l,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,VS(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Qr(t.type,s),a.props=l,h=t.pendingProps,p=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=Hr(u):(u=Xn(n)?la:_n.current,u=hs(t,u));var y=n.getDerivedStateFromProps;(c=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==h||p!==u)&&Kb(t,a,r,u),uo=!1,p=t.memoizedState,a.state=p,Wd(t,r,a,i);var g=t.memoizedState;s!==h||p!==g||Yn.current||uo?(typeof y=="function"&&(y0(t,n,y,r),g=t.memoizedState),(l=uo||qb(t,n,l,r,p,g,u)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=u,r=l):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return _0(e,t,n,r,o,i)}function _0(e,t,n,r,i,o){C5(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Ub(t,n,!1),Hi(e,t,o);r=t.stateNode,sA.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=ms(t,e.child,null,o),t.child=ms(t,null,s,o)):In(e,t,s,o),t.memoizedState=r.state,i&&Ub(t,n,!0),t.child}function _5(e){var t=e.stateNode;t.pendingContext?Hb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Hb(e,t.context,!1),Av(e,t.containerInfo)}function o3(e,t,n,r,i){return ps(),Rv(i),t.flags|=256,In(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0};function hc(e){return{baseLanes:e,cachePool:null,transitions:null}}function a3(e,t){return{baseLanes:e.baseLanes|t,cachePool:null,transitions:e.transitions}}function E5(e,t,n){var r=t.pendingProps,i=It.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),bt(It,i&1),e===null)return S0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=tf(i,r,0,null),e=oa(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=hc(n),t.memoizedState=fc,e):E0(t,i));if(i=e.memoizedState,i!==null){if(s=i.dehydrated,s!==null){if(a)return t.flags&256?(t.flags&=-257,pc(e,t,n,Error(le(422)))):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=tf({mode:"visible",children:r.children},i,0,null),o=oa(o,i,n,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&ms(t,e.child,null,n),t.child.memoizedState=hc(n),t.memoizedState=fc,o);if(!(t.mode&1))t=pc(e,t,n,null);else if(s.data==="$!")t=pc(e,t,n,Error(le(419)));else if(r=(n&e.childLanes)!==0,qn||r){if(r=nn,r!==null){switch(n&-n){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}r=o&(r.suspendedLanes|n)?0:o,r!==0&&r!==i.retryLane&&(i.retryLane=r,Fr(e,r,-1))}Hv(),t=pc(e,t,n,Error(le(421)))}else s.data==="$?"?(t.flags|=128,t.child=e.child,t=bA.bind(null,e),s._reactRetry=t,t=null):(n=i.treeContext,Wn=Ni(s.nextSibling),mr=t,At=!0,Zr=null,n!==null&&(Or[Lr++]=Mi,Or[Lr++]=zi,Or[Lr++]=ua,Mi=n.id,zi=n.overflow,ua=t),t=E0(t,t.pendingProps.children),t.flags|=4096);return t}return o?(r=l3(e,t,r.children,r.fallback,n),o=t.child,i=e.child.memoizedState,o.memoizedState=i===null?hc(n):a3(i,n),o.childLanes=e.childLanes&~n,t.memoizedState=fc,r):(n=s3(e,t,r.children,n),t.memoizedState=null,n)}return o?(r=l3(e,t,r.children,r.fallback,n),o=t.child,i=e.child.memoizedState,o.memoizedState=i===null?hc(n):a3(i,n),o.childLanes=e.childLanes&~n,t.memoizedState=fc,r):(n=s3(e,t,r.children,n),t.memoizedState=null,n)}function E0(e,t){return t=tf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function s3(e,t,n,r){var i=e.child;return e=i.sibling,n=Po(i,{mode:"visible",children:n}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n}function l3(e,t,n,r,i){var o=t.mode;e=e.child;var a=e.sibling,s={mode:"hidden",children:n};return!(o&1)&&t.child!==e?(n=t.child,n.childLanes=0,n.pendingProps=s,t.deletions=null):(n=Po(e,s),n.subtreeFlags=e.subtreeFlags&14680064),a!==null?r=Po(a,r):(r=oa(r,o,i,null),r.flags|=2),r.return=t,n.return=t,n.sibling=r,t.child=n,r}function pc(e,t,n,r){return r!==null&&Rv(r),ms(t,e.child,null,n),e=E0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function u3(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),v0(e.return,t,n)}function fm(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function R5(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(In(e,t,r.children,n),r=It.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&u3(e,n,t);else if(e.tag===19)u3(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(bt(It,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Gd(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),fm(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Gd(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}fm(t,!0,n,null,o);break;case"together":fm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),da|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(le(153));if(t.child!==null){for(e=t.child,n=Po(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Po(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lA(e,t,n){switch(t.tag){case 3:_5(t),ps();break;case 5:QS(t);break;case 1:Xn(t.type)&&Hd(t);break;case 4:Av(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;bt(Ud,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(bt(It,It.current&1),t.flags|=128,null):n&t.child.childLanes?E5(e,t,n):(bt(It,It.current&1),e=Hi(e,t,n),e!==null?e.sibling:null);bt(It,It.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return R5(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),bt(It,It.current),r)break;return null;case 22:case 23:return t.lanes=0,x5(e,t,n)}return Hi(e,t,n)}function uA(e,t){switch(Ev(t),t.tag){case 1:return Xn(t.type)&&$d(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gs(),Ct(Yn),Ct(_n),Pv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Tv(t),null;case 13:if(Ct(It),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));ps()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ct(It),null;case 4:return gs(),null;case 10:return xv(t.type._context),null;case 22:case 23:return $v(),null;case 24:return null;default:return null}}var mc=!1,xn=!1,cA=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Ga(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Mt(e,t,r)}else n.current=null}function R0(e,t,n){try{n()}catch(r){Mt(e,t,r)}}var c3=!1;function dA(e,t){if(d0=zd,e=LS(),wv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,u=-1,l=0,c=0,h=e,p=null;t:for(;;){for(var y;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(u=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)p=h,h=y;for(;;){if(h===e)break t;if(p===n&&++l===i&&(s=a),p===o&&++c===r&&(u=a),(y=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=y}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(f0={focusedElem:e,selectionRange:n},zd=!1,ke=t;ke!==null;)if(t=ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ke=e;else for(;ke!==null;){t=ke;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var b=g.memoizedProps,_=g.memoizedState,S=t.stateNode,k=S.getSnapshotBeforeUpdate(t.elementType===t.type?b:Qr(t.type,b),_);S.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var C=t.stateNode.containerInfo;if(C.nodeType===1)C.textContent="";else if(C.nodeType===9){var d=C.body;d!=null&&(d.textContent="")}break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(v){Mt(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,ke=e;break}ke=t.return}return g=c3,c3=!1,g}function kl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&R0(t,n,o)}i=i.next}while(i!==r)}}function dh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function A0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function A5(e){var t=e.alternate;t!==null&&(e.alternate=null,A5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bi],delete t[Kl],delete t[m0],delete t[GR],delete t[YR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function T5(e){return e.tag===5||e.tag===3||e.tag===4}function d3(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||T5(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function T0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Fd));else if(r!==4&&(e=e.child,e!==null))for(T0(e,t,n),e=e.sibling;e!==null;)T0(e,t,n),e=e.sibling}function P0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(P0(e,t,n),e=e.sibling;e!==null;)P0(e,t,n),e=e.sibling}var mn=null,Jr=!1;function eo(e,t,n){for(n=n.child;n!==null;)P5(e,t,n),n=n.sibling}function P5(e,t,n){if(Si&&typeof Si.onCommitFiberUnmount=="function")try{Si.onCommitFiberUnmount(rh,n)}catch{}switch(n.tag){case 5:xn||Ga(n,t);case 6:var r=mn,i=Jr;mn=null,eo(e,t,n),mn=r,Jr=i,mn!==null&&(Jr?(e=mn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):mn.removeChild(n.stateNode));break;case 18:mn!==null&&(Jr?(e=mn,n=n.stateNode,e.nodeType===8?am(e.parentNode,n):e.nodeType===1&&am(e,n),Hl(e)):am(mn,n.stateNode));break;case 4:r=mn,i=Jr,mn=n.stateNode.containerInfo,Jr=!0,eo(e,t,n),mn=r,Jr=i;break;case 0:case 11:case 14:case 15:if(!xn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&R0(n,t,a),i=i.next}while(i!==r)}eo(e,t,n);break;case 1:if(!xn&&(Ga(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Mt(n,t,s)}eo(e,t,n);break;case 21:eo(e,t,n);break;case 22:n.mode&1?(xn=(r=xn)||n.memoizedState!==null,eo(e,t,n),xn=r):eo(e,t,n);break;default:eo(e,t,n)}}function f3(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cA),t.forEach(function(r){var i=wA.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Gr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=$t()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*hA(r/1960))-r,10e?16:e,go===null)var r=!1;else{if(e=go,go=null,Zd=0,et&6)throw Error(le(331));var i=et;for(et|=4,ke=e.current;ke!==null;){var o=ke,a=o.child;if(ke.flags&16){var s=o.deletions;if(s!==null){for(var u=0;u$t()-Bv?ia(e,0):jv|=n),Qn(e,t)}function B5(e,t){t===0&&(e.mode&1?(t=oc,oc<<=1,!(oc&130023424)&&(oc=4194304)):t=1);var n=Dn();e=hh(e,t),e!==null&&(_u(e,t,n),Qn(e,n))}function bA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),B5(e,n)}function wA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),B5(e,n)}var F5;F5=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yn.current)qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qn=!1,lA(e,t,n);qn=!!(e.flags&131072)}else qn=!1,At&&t.flags&1048576&&KS(t,Kd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var i=hs(t,_n.current);is(t,n),i=Ov(null,t,r,e,i,n);var o=Lv();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Xn(r)?(o=!0,Hd(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cv(t),i.updater=uh,t.stateNode=i,i._reactInternals=t,b0(t,r,e,n),t=_0(null,t,r,!0,o,n)):(t.tag=0,At&&o&&_v(t),In(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=kA(r),e=Qr(r,e),i){case 0:t=C0(null,t,r,e,n);break e;case 1:t=i3(null,t,r,e,n);break e;case 11:t=n3(null,t,r,e,n);break e;case 14:t=r3(null,t,r,Qr(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),C0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),i3(e,t,r,i,n);case 3:e:{if(_5(t),e===null)throw Error(le(387));r=t.pendingProps,o=t.memoizedState,i=o.element,VS(e,t),Wd(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Error(le(423)),t=o3(e,t,r,n,i);break e}else if(r!==i){i=Error(le(424)),t=o3(e,t,r,n,i);break e}else for(Wn=Ni(t.stateNode.containerInfo.firstChild),mr=t,At=!0,Zr=null,n=XS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ps(),r===i){t=Hi(e,t,n);break e}In(e,t,r,n)}t=t.child}return t;case 5:return QS(t),e===null&&S0(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,h0(r,i)?a=null:o!==null&&h0(r,o)&&(t.flags|=32),C5(e,t),In(e,t,a,n),t.child;case 6:return e===null&&S0(t),null;case 13:return E5(e,t,n);case 4:return Av(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ms(t,null,r,n):In(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),n3(e,t,r,i,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,bt(Ud,r._currentValue),r._currentValue=a,o!==null)if(ai(o.value,a)){if(o.children===i.children&&!Yn.current){t=Hi(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Bi(-1,n&-n),u.tag=2;var l=o.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),v0(o.return,n,t),s.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(le(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),v0(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}In(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,is(t,n),i=Hr(i),r=r(i),t.flags|=1,In(e,t,r,n),t.child;case 14:return r=t.type,i=Qr(r,t.pendingProps),i=Qr(r.type,i),r3(e,t,r,i,n);case 15:return k5(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,Xn(r)?(e=!0,Hd(t)):e=!1,is(t,n),qS(t,r,i),b0(t,r,i,n),_0(null,t,r,!0,e,n);case 19:return R5(e,t,n);case 22:return x5(e,t,n)}throw Error(le(156,t.tag))};function $5(e,t){return pS(e,t)}function SA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(e,t,n,r){return new SA(e,t,n,r)}function Uv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kA(e){if(typeof e=="function")return Uv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===uv)return 11;if(e===cv)return 14}return 2}function Po(e,t){var n=e.alternate;return n===null?(n=jr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function dd(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")Uv(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ba:return oa(n.children,i,o,t);case lv:a=8,i|=8;break;case Wg:return e=jr(12,n,t,i|2),e.elementType=Wg,e.lanes=o,e;case qg:return e=jr(13,n,t,i),e.elementType=qg,e.lanes=o,e;case Kg:return e=jr(19,n,t,i),e.elementType=Kg,e.lanes=o,e;case Q6:return tf(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y6:a=10;break e;case X6:a=9;break e;case uv:a=11;break e;case cv:a=14;break e;case lo:a=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=jr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function oa(e,t,n,r){return e=jr(7,e,r,t),e.lanes=n,e}function tf(e,t,n,r){return e=jr(22,e,r,t),e.elementType=Q6,e.lanes=n,e.stateNode={},e}function hm(e,t,n){return e=jr(6,e,null,t),e.lanes=n,e}function pm(e,t,n){return t=jr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xA(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yp(0),this.expirationTimes=Yp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Vv(e,t,n,r,i,o,a,s,u){return e=new xA(e,t,n,s,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=jr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cv(o),e}function CA(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=br})(EE);var W5,w3=Mr;W5=w3.createRoot,w3.hydrateRoot;/** * @remix-run/router v1.4.0 * * Copyright (c) Remix Software Inc. @@ -38,7 +38,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Zl(){return Zl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Kv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function CA(){return Math.random().toString(36).substr(2,8)}function p3(e,t){return{usr:e.state,key:e.key,idx:t}}function D0(e,t,n,r){return n===void 0&&(n=null),Zl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ks(t):t,{state:n,key:t&&t.key||r||CA()})}function N5(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ks(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function _A(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=go.Pop,u=null,l=c();l==null&&(l=0,a.replaceState(Zl({},a.state,{idx:l}),""));function c(){return(a.state||{idx:null}).idx}function h(){s=go.Pop;let _=c(),S=_==null?null:_-l;l=_,u&&u({action:s,location:b.location,delta:S})}function p(_,S){s=go.Push;let k=D0(b.location,_,S);n&&n(k,_),l=c()+1;let C=p3(k,l),d=b.createHref(k);try{a.pushState(C,"",d)}catch{i.location.assign(d)}o&&u&&u({action:s,location:b.location,delta:1})}function y(_,S){s=go.Replace;let k=D0(b.location,_,S);n&&n(k,_),l=c();let C=p3(k,l),d=b.createHref(k);a.replaceState(C,"",d),o&&u&&u({action:s,location:b.location,delta:0})}function g(_){let S=i.location.origin!=="null"?i.location.origin:i.location.href,k=typeof _=="string"?_:N5(_);return cn(S,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,S)}let b={get action(){return s},get location(){return e(i,a)},listen(_){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(h3,h),u=_,()=>{i.removeEventListener(h3,h),u=null}},createHref(_){return t(i,_)},createURL:g,encodeLocation(_){let S=g(_);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:y,go(_){return a.go(_)}};return b}var m3;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(m3||(m3={}));function EA(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?ks(t):t,i=B5(r.pathname||"/",n);if(i==null)return null;let o=z5(e);RA(o);let a=null;for(let s=0;a==null&&s{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(cn(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let l=aa([r,u.relativePath]),c=n.concat(u);o.children&&o.children.length>0&&(cn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),z5(o.children,t,c,l)),!(o.path==null&&!o.index)&&t.push({path:l,score:DA(l,o.index),routesMeta:c})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let u of j5(o.path))i(o,a,u)}),t}function j5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=j5(r.join("/")),s=[];return s.push(...a.map(u=>u===""?o:[o,u].join("/"))),i&&s.push(...a),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function RA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:MA(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const AA=/^:\w+$/,TA=3,PA=2,IA=1,OA=10,LA=-2,g3=e=>e==="*";function DA(e,t){let n=e.split("/"),r=n.length;return n.some(g3)&&(r+=LA),t&&(r+=PA),n.filter(i=>!g3(i)).reduce((i,o)=>i+(AA.test(o)?TA:o===""?IA:OA),r)}function MA(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function NA(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a{if(c==="*"){let p=s[h]||"";a=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}return l[c]=FA(s[h]||"",c),l},{}),pathname:o,pathnameBase:a,pattern:e}}function jA(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Kv(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function BA(e){try{return decodeURI(e)}catch(t){return Kv(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function FA(e,t){try{return decodeURIComponent(e)}catch(n){return Kv(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function B5(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function $A(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ks(e):e;return{pathname:n?n.startsWith("/")?n:UA(n,t):t,search:qA(r),hash:KA(i)}}function UA(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function pm(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function HA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function WA(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ks(e):(i=Zl({},e),cn(!i.pathname||!i.pathname.includes("?"),pm("?","pathname","search",i)),cn(!i.pathname||!i.pathname.includes("#"),pm("#","pathname","hash",i)),cn(!i.search||!i.search.includes("#"),pm("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(r||a==null)s=n;else{let h=t.length-1;if(a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}s=h>=0?t[h]:"/"}let u=$A(i,s),l=a&&a!=="/"&&a.endsWith("/"),c=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(l||c)&&(u.pathname+="/"),u}const aa=e=>e.join("/").replace(/\/\/+/g,"/"),VA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,KA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function GA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const YA=["post","put","patch","delete"];[...YA];/** + */function eu(){return eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Gv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PA(){return Math.random().toString(36).substr(2,8)}function k3(e,t){return{usr:e.state,key:e.key,idx:t}}function N0(e,t,n,r){return n===void 0&&(n=null),eu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_s(t):t,{state:n,key:t&&t.key||r||PA()})}function q5(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function _s(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function IA(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=vo.Pop,u=null,l=c();l==null&&(l=0,a.replaceState(eu({},a.state,{idx:l}),""));function c(){return(a.state||{idx:null}).idx}function h(){s=vo.Pop;let _=c(),S=_==null?null:_-l;l=_,u&&u({action:s,location:b.location,delta:S})}function p(_,S){s=vo.Push;let k=N0(b.location,_,S);n&&n(k,_),l=c()+1;let C=k3(k,l),d=b.createHref(k);try{a.pushState(C,"",d)}catch{i.location.assign(d)}o&&u&&u({action:s,location:b.location,delta:1})}function y(_,S){s=vo.Replace;let k=N0(b.location,_,S);n&&n(k,_),l=c();let C=k3(k,l),d=b.createHref(k);a.replaceState(C,"",d),o&&u&&u({action:s,location:b.location,delta:0})}function g(_){let S=i.location.origin!=="null"?i.location.origin:i.location.href,k=typeof _=="string"?_:q5(_);return cn(S,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,S)}let b={get action(){return s},get location(){return e(i,a)},listen(_){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(S3,h),u=_,()=>{i.removeEventListener(S3,h),u=null}},createHref(_){return t(i,_)},createURL:g,encodeLocation(_){let S=g(_);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:y,go(_){return a.go(_)}};return b}var x3;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(x3||(x3={}));function OA(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?_s(t):t,i=Y5(r.pathname||"/",n);if(i==null)return null;let o=K5(e);LA(o);let a=null;for(let s=0;a==null&&s{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(cn(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let l=aa([r,u.relativePath]),c=n.concat(u);o.children&&o.children.length>0&&(cn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),K5(o.children,t,c,l)),!(o.path==null&&!o.index)&&t.push({path:l,score:FA(l,o.index),routesMeta:c})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let u of G5(o.path))i(o,a,u)}),t}function G5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=G5(r.join("/")),s=[];return s.push(...a.map(u=>u===""?o:[o,u].join("/"))),i&&s.push(...a),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function LA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$A(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const DA=/^:\w+$/,NA=3,MA=2,zA=1,jA=10,BA=-2,C3=e=>e==="*";function FA(e,t){let n=e.split("/"),r=n.length;return n.some(C3)&&(r+=BA),t&&(r+=MA),n.filter(i=>!C3(i)).reduce((i,o)=>i+(DA.test(o)?NA:o===""?zA:jA),r)}function $A(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function HA(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a{if(c==="*"){let p=s[h]||"";a=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}return l[c]=qA(s[h]||"",c),l},{}),pathname:o,pathnameBase:a,pattern:e}}function VA(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Gv(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function WA(e){try{return decodeURI(e)}catch(t){return Gv(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function qA(e,t){try{return decodeURIComponent(e)}catch(n){return Gv(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Y5(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function KA(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?_s(e):e;return{pathname:n?n.startsWith("/")?n:GA(n,t):t,search:JA(r),hash:ZA(i)}}function GA(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function mm(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function YA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function XA(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=_s(e):(i=eu({},e),cn(!i.pathname||!i.pathname.includes("?"),mm("?","pathname","search",i)),cn(!i.pathname||!i.pathname.includes("#"),mm("#","pathname","hash",i)),cn(!i.search||!i.search.includes("#"),mm("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(r||a==null)s=n;else{let h=t.length-1;if(a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}s=h>=0?t[h]:"/"}let u=KA(i,s),l=a&&a!=="/"&&a.endsWith("/"),c=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(l||c)&&(u.pathname+="/"),u}const aa=e=>e.join("/").replace(/\/\/+/g,"/"),QA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),JA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function eT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const tT=["post","put","patch","delete"];[...tT];/** * React Router v6.9.0 * * Copyright (c) Remix Software Inc. @@ -47,7 +47,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function XA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const QA=typeof Object.is=="function"?Object.is:XA,{useState:JA,useEffect:ZA,useLayoutEffect:eT,useDebugValue:tT}=$g;function nT(e,t,n){const r=t(),[{inst:i},o]=JA({inst:{value:r,getSnapshot:t}});return eT(()=>{i.value=r,i.getSnapshot=t,mm(i)&&o({inst:i})},[e,r,t]),ZA(()=>(mm(i)&&o({inst:i}),e(()=>{mm(i)&&o({inst:i})})),[e]),tT(r),r}function mm(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!QA(n,r)}catch{return!0}}function rT(e,t,n){return t()}const iT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",oT=!iT,aT=oT?rT:nT;"useSyncExternalStore"in $g&&(e=>e.useSyncExternalStore)($g);const F5=w.createContext(null),$5=w.createContext(null),Gv=w.createContext(null),Au=w.createContext(null),Tu=w.createContext({outlet:null,matches:[]}),U5=w.createContext(null);function M0(){return M0=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.pathnameBase)),o=w.useRef(!1);return w.useEffect(()=>{o.current=!0}),w.useCallback(function(s,u){if(u===void 0&&(u={}),!o.current)return;if(typeof s=="number"){t.go(s);return}let l=WA(s,JSON.parse(i),r,u.relative==="path");e!=="/"&&(l.pathname=l.pathname==="/"?e:aa([e,l.pathname])),(u.replace?t.replace:t.push)(l,u.state,u)},[e,t,i,r])}function sT(e,t){gh()||cn(!1);let{navigator:n}=w.useContext(Gv),r=w.useContext($5),{matches:i}=w.useContext(Tu),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let u=ka(),l;if(t){var c;let b=typeof t=="string"?ks(t):t;s==="/"||(c=b.pathname)!=null&&c.startsWith(s)||cn(!1),l=b}else l=u;let h=l.pathname||"/",p=s==="/"?h:h.slice(s.length)||"/",y=EA(e,{pathname:p}),g=dT(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:aa([s,n.encodeLocation?n.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?s:aa([s,n.encodeLocation?n.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r||void 0);return t&&g?w.createElement(Au.Provider,{value:{location:M0({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:go.Pop}},g):g}function lT(){let e=mT(),t=GA(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,o)}class uT extends w.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?w.createElement(Tu.Provider,{value:this.props.routeContext},w.createElement(U5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function cT(e){let{routeContext:t,match:n,children:r}=e,i=w.useContext(F5);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(Tu.Provider,{value:t},r)}function dT(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let o=r.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));o>=0||cn(!1),r=r.slice(0,Math.min(r.length,o+1))}return r.reduceRight((o,a,s)=>{let u=a.route.id?i==null?void 0:i[a.route.id]:null,l=null;n&&(a.route.ErrorBoundary?l=w.createElement(a.route.ErrorBoundary,null):a.route.errorElement?l=a.route.errorElement:l=w.createElement(lT,null));let c=t.concat(r.slice(0,s+1)),h=()=>{let p=o;return u?p=l:a.route.Component?p=w.createElement(a.route.Component,null):a.route.element&&(p=a.route.element),w.createElement(cT,{match:a,routeContext:{outlet:o,matches:c},children:p})};return n&&(a.route.ErrorBoundary||a.route.errorElement||s===0)?w.createElement(uT,{location:n.location,component:l,error:u,children:h(),routeContext:{outlet:null,matches:c}}):h()},null)}var v3;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(v3||(v3={}));var tf;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(tf||(tf={}));function fT(e){let t=w.useContext($5);return t||cn(!1),t}function hT(e){let t=w.useContext(Tu);return t||cn(!1),t}function pT(e){let t=hT(),n=t.matches[t.matches.length-1];return n.route.id||cn(!1),n.route.id}function mT(){var e;let t=w.useContext(U5),n=fT(tf.UseRouteError),r=pT(tf.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function kn(e){cn(!1)}function gT(e){let{basename:t="/",children:n=null,location:r,navigationType:i=go.Pop,navigator:o,static:a=!1}=e;gh()&&cn(!1);let s=t.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:s,navigator:o,static:a}),[s,o,a]);typeof r=="string"&&(r=ks(r));let{pathname:l="/",search:c="",hash:h="",state:p=null,key:y="default"}=r,g=w.useMemo(()=>{let b=B5(l,s);return b==null?null:{location:{pathname:b,search:c,hash:h,state:p,key:y},navigationType:i}},[s,l,c,h,p,y,i]);return g==null?null:w.createElement(Gv.Provider,{value:u},w.createElement(Au.Provider,{children:n,value:g}))}function vT(e){let{children:t,location:n}=e,r=w.useContext(F5),i=r&&!t?r.router.routes:N0(t);return sT(i,n)}var y3;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(y3||(y3={}));new Promise(()=>{});function N0(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(r,i)=>{if(!w.isValidElement(r))return;if(r.type===w.Fragment){n.push.apply(n,N0(r.props.children,t));return}r.type!==kn&&cn(!1),!r.props.index||!r.props.children||cn(!1);let o=[...t,i],a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=N0(r.props.children,o)),n.push(a)}),n}/** + */function nT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const rT=typeof Object.is=="function"?Object.is:nT,{useState:iT,useEffect:oT,useLayoutEffect:aT,useDebugValue:sT}=Hg;function lT(e,t,n){const r=t(),[{inst:i},o]=iT({inst:{value:r,getSnapshot:t}});return aT(()=>{i.value=r,i.getSnapshot=t,gm(i)&&o({inst:i})},[e,r,t]),oT(()=>(gm(i)&&o({inst:i}),e(()=>{gm(i)&&o({inst:i})})),[e]),sT(r),r}function gm(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!rT(n,r)}catch{return!0}}function uT(e,t,n){return t()}const cT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dT=!cT,fT=dT?uT:lT;"useSyncExternalStore"in Hg&&(e=>e.useSyncExternalStore)(Hg);const X5=w.createContext(null),Q5=w.createContext(null),Yv=w.createContext(null),Tu=w.createContext(null),Pu=w.createContext({outlet:null,matches:[]}),J5=w.createContext(null);function M0(){return M0=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.pathnameBase)),o=w.useRef(!1);return w.useEffect(()=>{o.current=!0}),w.useCallback(function(s,u){if(u===void 0&&(u={}),!o.current)return;if(typeof s=="number"){t.go(s);return}let l=XA(s,JSON.parse(i),r,u.relative==="path");e!=="/"&&(l.pathname=l.pathname==="/"?e:aa([e,l.pathname])),(u.replace?t.replace:t.push)(l,u.state,u)},[e,t,i,r])}function hT(e,t){yh()||cn(!1);let{navigator:n}=w.useContext(Yv),r=w.useContext(Q5),{matches:i}=w.useContext(Pu),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let u=ka(),l;if(t){var c;let b=typeof t=="string"?_s(t):t;s==="/"||(c=b.pathname)!=null&&c.startsWith(s)||cn(!1),l=b}else l=u;let h=l.pathname||"/",p=s==="/"?h:h.slice(s.length)||"/",y=OA(e,{pathname:p}),g=vT(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:aa([s,n.encodeLocation?n.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?s:aa([s,n.encodeLocation?n.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r||void 0);return t&&g?w.createElement(Tu.Provider,{value:{location:M0({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:vo.Pop}},g):g}function pT(){let e=ST(),t=eT(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,o)}class mT extends w.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?w.createElement(Pu.Provider,{value:this.props.routeContext},w.createElement(J5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gT(e){let{routeContext:t,match:n,children:r}=e,i=w.useContext(X5);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(Pu.Provider,{value:t},r)}function vT(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let o=r.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));o>=0||cn(!1),r=r.slice(0,Math.min(r.length,o+1))}return r.reduceRight((o,a,s)=>{let u=a.route.id?i==null?void 0:i[a.route.id]:null,l=null;n&&(a.route.ErrorBoundary?l=w.createElement(a.route.ErrorBoundary,null):a.route.errorElement?l=a.route.errorElement:l=w.createElement(pT,null));let c=t.concat(r.slice(0,s+1)),h=()=>{let p=o;return u?p=l:a.route.Component?p=w.createElement(a.route.Component,null):a.route.element&&(p=a.route.element),w.createElement(gT,{match:a,routeContext:{outlet:o,matches:c},children:p})};return n&&(a.route.ErrorBoundary||a.route.errorElement||s===0)?w.createElement(mT,{location:n.location,component:l,error:u,children:h(),routeContext:{outlet:null,matches:c}}):h()},null)}var _3;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(_3||(_3={}));var rf;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(rf||(rf={}));function yT(e){let t=w.useContext(Q5);return t||cn(!1),t}function bT(e){let t=w.useContext(Pu);return t||cn(!1),t}function wT(e){let t=bT(),n=t.matches[t.matches.length-1];return n.route.id||cn(!1),n.route.id}function ST(){var e;let t=w.useContext(J5),n=yT(rf.UseRouteError),r=wT(rf.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function pn(e){cn(!1)}function kT(e){let{basename:t="/",children:n=null,location:r,navigationType:i=vo.Pop,navigator:o,static:a=!1}=e;yh()&&cn(!1);let s=t.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:s,navigator:o,static:a}),[s,o,a]);typeof r=="string"&&(r=_s(r));let{pathname:l="/",search:c="",hash:h="",state:p=null,key:y="default"}=r,g=w.useMemo(()=>{let b=Y5(l,s);return b==null?null:{location:{pathname:b,search:c,hash:h,state:p,key:y},navigationType:i}},[s,l,c,h,p,y,i]);return g==null?null:w.createElement(Yv.Provider,{value:u},w.createElement(Tu.Provider,{children:n,value:g}))}function xT(e){let{children:t,location:n}=e,r=w.useContext(X5),i=r&&!t?r.router.routes:z0(t);return hT(i,n)}var E3;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(E3||(E3={}));new Promise(()=>{});function z0(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(r,i)=>{if(!w.isValidElement(r))return;if(r.type===w.Fragment){n.push.apply(n,z0(r.props.children,t));return}r.type!==pn&&cn(!1),!r.props.index||!r.props.children||cn(!1);let o=[...t,i],a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=z0(r.props.children,o)),n.push(a)}),n}/** * React Router DOM v6.9.0 * * Copyright (c) Remix Software Inc. @@ -56,10 +56,10 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function z0(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function yT(e,t){let n=z0(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}function bT(e){let{basename:t,children:n,window:r}=e,i=w.useRef();i.current==null&&(i.current=xA({window:r,v5Compat:!0}));let o=i.current,[a,s]=w.useState({action:o.action,location:o.location});return w.useLayoutEffect(()=>o.listen(s),[o]),w.createElement(gT,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o})}var b3;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(b3||(b3={}));var w3;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(w3||(w3={}));function wT(e){let t=w.useRef(z0(e)),n=w.useRef(!1),r=ka(),i=w.useMemo(()=>yT(r.search,n.current?null:t.current),[r.search]),o=_t(),a=w.useCallback((s,u)=>{const l=z0(typeof s=="function"?s(i):s);n.current=!0,o("?"+l,u)},[o,i]);return[i,a]}var ie={},ST={get exports(){return ie},set exports(e){ie=e}},kT="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xT=kT,CT=xT;function W5(){}function V5(){}V5.resetWarningCache=W5;var _T=function(){function e(r,i,o,a,s,u){if(u!==CT){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:V5,resetWarningCache:W5};return n.PropTypes=n,n};ST.exports=_T();var ET=typeof Element<"u",RT=typeof Map=="function",AT=typeof Set=="function",TT=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function cd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!cd(e[r],t[r]))return!1;return!0}var o;if(RT&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!cd(r.value[1],t.get(r.value[0])))return!1;return!0}if(AT&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(TT&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(ET&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!cd(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var PT=function(t,n){try{return cd(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}},IT=function(e,t,n,r,i,o,a,s){if(!e){var u;if(t===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}},S3=IT,OT=function(t,n,r,i){var o=r?r.call(i,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var a=Object.keys(t),s=Object.keys(n);if(a.length!==s.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(n),l=0;l=0||(i[n]=e[n]);return i}var Le={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},LT={rel:["amphtml","canonical","alternate"]},DT={type:["application/ld+json"]},MT={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},x3=Object.keys(Le).map(function(e){return Le[e]}),nf={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},NT=Object.keys(nf).reduce(function(e,t){return e[nf[t]]=t,e},{}),rs=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},zT=function(e){var t=rs(e,Le.TITLE),n=rs(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,function(){return t});var r=rs(e,"defaultTitle");return t||r||void 0},jT=function(e){return rs(e,"onChangeClientState")||function(){}},gm=function(e,t){return t.filter(function(n){return n[e]!==void 0}).map(function(n){return n[e]}).reduce(function(n,r){return Bt({},n,r)},{})},BT=function(e,t){return t.filter(function(n){return n[Le.BASE]!==void 0}).map(function(n){return n[Le.BASE]}).reverse().reduce(function(n,r){if(!n.length)for(var i=Object.keys(r),o=0;o/g,">").replace(/"/g,""").replace(/'/g,"'")},_3=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n]!==void 0?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r},"")},E3=function(e,t){return t===void 0&&(t={}),Object.keys(e).reduce(function(n,r){return n[nf[r]||r]=e[r],n},t)},dd=function(e,t){return t.map(function(n,r){var i,o=((i={key:r})["data-rh"]=!0,i);return Object.keys(n).forEach(function(a){var s=nf[a]||a;s==="innerHTML"||s==="cssText"?o.dangerouslySetInnerHTML={__html:n.innerHTML||n.cssText}:o[s]=n[a]}),de.createElement(e,o)})},Er=function(e,t,n){switch(e){case Le.TITLE:return{toComponent:function(){return i=t.titleAttributes,(o={key:r=t.title})["data-rh"]=!0,a=E3(i,o),[de.createElement(Le.TITLE,a,r)];var r,i,o,a},toString:function(){return function(r,i,o,a){var s=_3(o),u=q5(i);return s?"<"+r+' data-rh="true" '+s+">"+ym(u,a)+"":"<"+r+' data-rh="true">'+ym(u,a)+""}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return E3(t)},toString:function(){return _3(t)}};default:return{toComponent:function(){return dd(e,t)},toString:function(){return function(r,i,o){return i.reduce(function(a,s){var u=Object.keys(s).filter(function(h){return!(h==="innerHTML"||h==="cssText")}).reduce(function(h,p){var y=s[p]===void 0?p:p+'="'+ym(s[p],o)+'"';return h?h+" "+y:y},""),l=s.innerHTML||s.cssText||"",c=$T.indexOf(r)===-1;return a+"<"+r+' data-rh="true" '+u+(c?"/>":">"+l+"")},"")}(e,t,n)}}}},B0=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,i=e.htmlAttributes,o=e.noscriptTags,a=e.styleTags,s=e.title,u=s===void 0?"":s,l=e.titleAttributes,c=e.linkTags,h=e.metaTags,p=e.scriptTags,y={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var g=function(b){var _=b.linkTags,S=b.scriptTags,k=b.encode,C=vm(b.metaTags,MT),d=vm(_,LT),v=vm(S,DT);return{priorityMethods:{toComponent:function(){return[].concat(dd(Le.META,C.priority),dd(Le.LINK,d.priority),dd(Le.SCRIPT,v.priority))},toString:function(){return Er(Le.META,C.priority,k)+" "+Er(Le.LINK,d.priority,k)+" "+Er(Le.SCRIPT,v.priority,k)}},metaTags:C.default,linkTags:d.default,scriptTags:v.default}}(e);y=g.priorityMethods,c=g.linkTags,h=g.metaTags,p=g.scriptTags}return{priority:y,base:Er(Le.BASE,t,r),bodyAttributes:Er("bodyAttributes",n,r),htmlAttributes:Er("htmlAttributes",i,r),link:Er(Le.LINK,c,r),meta:Er(Le.META,h,r),noscript:Er(Le.NOSCRIPT,o,r),script:Er(Le.SCRIPT,p,r),style:Er(Le.STYLE,a,r),title:Er(Le.TITLE,{title:u,titleAttributes:l},r)}},gc=[],F0=function(e,t){var n=this;t===void 0&&(t=typeof document<"u"),this.instances=[],this.value={setHelmet:function(r){n.context.helmet=r},helmetInstances:{get:function(){return n.canUseDOM?gc:n.instances},add:function(r){(n.canUseDOM?gc:n.instances).push(r)},remove:function(r){var i=(n.canUseDOM?gc:n.instances).indexOf(r);(n.canUseDOM?gc:n.instances).splice(i,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=B0({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},K5=de.createContext({}),UT=ie.shape({setHelmet:ie.func,helmetInstances:ie.shape({get:ie.func,add:ie.func,remove:ie.func})}),HT=typeof document<"u",Ka=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new F0(r.props.context,t.canUseDOM),r}return Yv(t,e),t.prototype.render=function(){return de.createElement(K5.Provider,{value:this.helmetData.value},this.props.children)},t}(w.Component);Ka.canUseDOM=HT,Ka.propTypes={context:ie.shape({helmet:ie.shape()}),children:ie.node.isRequired},Ka.defaultProps={context:{}},Ka.displayName="HelmetProvider";var Aa=function(e,t){var n,r=document.head||document.querySelector(Le.HEAD),i=r.querySelectorAll(e+"[data-rh]"),o=[].slice.call(i),a=[];return t&&t.length&&t.forEach(function(s){var u=document.createElement(e);for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(l==="innerHTML"?u.innerHTML=s.innerHTML:l==="cssText"?u.styleSheet?u.styleSheet.cssText=s.cssText:u.appendChild(document.createTextNode(s.cssText)):u.setAttribute(l,s[l]===void 0?"":s[l]));u.setAttribute("data-rh","true"),o.some(function(c,h){return n=h,u.isEqualNode(c)})?o.splice(n,1):a.push(u)}),o.forEach(function(s){return s.parentNode.removeChild(s)}),a.forEach(function(s){return r.appendChild(s)}),{oldTags:o,newTags:a}},bm=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),i=r?r.split(","):[],o=[].concat(i),a=Object.keys(t),s=0;s=0;h-=1)n.removeAttribute(o[h]);i.length===o.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==a.join(",")&&n.setAttribute("data-rh",a.join(","))}},R3=function(e,t){var n=e.baseTag,r=e.htmlAttributes,i=e.linkTags,o=e.metaTags,a=e.noscriptTags,s=e.onChangeClientState,u=e.scriptTags,l=e.styleTags,c=e.title,h=e.titleAttributes;bm(Le.BODY,e.bodyAttributes),bm(Le.HTML,r),function(b,_){b!==void 0&&document.title!==b&&(document.title=q5(b)),bm(Le.TITLE,_)}(c,h);var p={baseTag:Aa(Le.BASE,n),linkTags:Aa(Le.LINK,i),metaTags:Aa(Le.META,o),noscriptTags:Aa(Le.NOSCRIPT,a),scriptTags:Aa(Le.SCRIPT,u),styleTags:Aa(Le.STYLE,l)},y={},g={};Object.keys(p).forEach(function(b){var _=p[b],S=_.newTags,k=_.oldTags;S.length&&(y[b]=S),k.length&&(g[b]=p[b].oldTags)}),t&&t(),s(e,y,g)},Xs=null,rf=function(e){function t(){for(var r,i=arguments.length,o=new Array(i),a=0;a elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(r){var i,o=r.child,a=r.arrayTypeChildren;return Bt({},a,((i={})[o.type]=[].concat(a[o.type]||[],[Bt({},r.newChildProps,this.mapNestedChildrenToProps(o,r.nestedChildren))]),i))},n.mapObjectTypeChildren=function(r){var i,o,a=r.child,s=r.newProps,u=r.newChildProps,l=r.nestedChildren;switch(a.type){case Le.TITLE:return Bt({},s,((i={})[a.type]=l,i.titleAttributes=Bt({},u),i));case Le.BODY:return Bt({},s,{bodyAttributes:Bt({},u)});case Le.HTML:return Bt({},s,{htmlAttributes:Bt({},u)});default:return Bt({},s,((o={})[a.type]=Bt({},u),o))}},n.mapArrayTypeChildrenToProps=function(r,i){var o=Bt({},i);return Object.keys(r).forEach(function(a){var s;o=Bt({},o,((s={})[a]=r[a],s))}),o},n.warnOnInvalidChildren=function(r,i){return S3(x3.some(function(o){return r.type===o}),typeof r.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+x3.join(", ")+" are allowed. Helmet does not support rendering <"+r.type+"> elements. Refer to our API for more information."),S3(!i||typeof i=="string"||Array.isArray(i)&&!i.some(function(o){return typeof o!="string"}),"Helmet expects a string as a child of <"+r.type+">. Did you forget to wrap your children in braces? ( <"+r.type+">{``} ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(r,i){var o=this,a={};return de.Children.forEach(r,function(s){if(s&&s.props){var u=s.props,l=u.children,c=k3(u,WT),h=Object.keys(c).reduce(function(y,g){return y[NT[g]||g]=c[g],y},{}),p=s.type;switch(typeof p=="symbol"?p=p.toString():o.warnOnInvalidChildren(s,l),p){case Le.FRAGMENT:i=o.mapChildrenToProps(l,i);break;case Le.LINK:case Le.META:case Le.NOSCRIPT:case Le.SCRIPT:case Le.STYLE:a=o.flattenArrayTypeChildren({child:s,arrayTypeChildren:a,newChildProps:h,nestedChildren:l});break;default:i=o.mapObjectTypeChildren({child:s,newProps:i,newChildProps:h,nestedChildren:l})}}}),this.mapArrayTypeChildrenToProps(a,i)},n.render=function(){var r=this.props,i=r.children,o=k3(r,VT),a=Bt({},o),s=o.helmetData;return i&&(a=this.mapChildrenToProps(i,a)),!s||s instanceof F0||(s=new F0(s.context,s.instances)),s?de.createElement(rf,Bt({},a,{context:s.value,helmetData:void 0})):de.createElement(K5.Consumer,null,function(u){return de.createElement(rf,Bt({},a,{context:u}))})},t}(w.Component);fd.propTypes={base:ie.object,bodyAttributes:ie.object,children:ie.oneOfType([ie.arrayOf(ie.node),ie.node]),defaultTitle:ie.string,defer:ie.bool,encodeSpecialCharacters:ie.bool,htmlAttributes:ie.object,link:ie.arrayOf(ie.object),meta:ie.arrayOf(ie.object),noscript:ie.arrayOf(ie.object),onChangeClientState:ie.func,script:ie.arrayOf(ie.object),style:ie.arrayOf(ie.object),title:ie.string,titleAttributes:ie.object,titleTemplate:ie.string,prioritizeSeoTags:ie.bool,helmetData:ie.object},fd.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},fd.displayName="Helmet";var A3=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},T3=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0:!1},XT=function(){document.cookie="".concat(Y5,"=;Max-Age=-99999999")},QT=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},JT=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function CT(e,t){let n=j0(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}function _T(e){let{basename:t,children:n,window:r}=e,i=w.useRef();i.current==null&&(i.current=TA({window:r,v5Compat:!0}));let o=i.current,[a,s]=w.useState({action:o.action,location:o.location});return w.useLayoutEffect(()=>o.listen(s),[o]),w.createElement(kT,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o})}var R3;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(R3||(R3={}));var A3;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(A3||(A3={}));function ET(e){let t=w.useRef(j0(e)),n=w.useRef(!1),r=ka(),i=w.useMemo(()=>CT(r.search,n.current?null:t.current),[r.search]),o=Et(),a=w.useCallback((s,u)=>{const l=j0(typeof s=="function"?s(i):s);n.current=!0,o("?"+l,u)},[o,i]);return[i,a]}var ie={},RT={get exports(){return ie},set exports(e){ie=e}},AT="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",TT=AT,PT=TT;function ek(){}function tk(){}tk.resetWarningCache=ek;var IT=function(){function e(r,i,o,a,s,u){if(u!==PT){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:tk,resetWarningCache:ek};return n.PropTypes=n,n};RT.exports=IT();var OT=typeof Element<"u",LT=typeof Map=="function",DT=typeof Set=="function",NT=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function fd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!fd(e[r],t[r]))return!1;return!0}var o;if(LT&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!fd(r.value[1],t.get(r.value[0])))return!1;return!0}if(DT&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(NT&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(OT&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!fd(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var MT=function(t,n){try{return fd(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}},zT=function(e,t,n,r,i,o,a,s){if(!e){var u;if(t===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}},T3=zT,jT=function(t,n,r,i){var o=r?r.call(i,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var a=Object.keys(t),s=Object.keys(n);if(a.length!==s.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(n),l=0;l=0||(i[n]=e[n]);return i}var Le={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},BT={rel:["amphtml","canonical","alternate"]},FT={type:["application/ld+json"]},$T={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},I3=Object.keys(Le).map(function(e){return Le[e]}),of={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},HT=Object.keys(of).reduce(function(e,t){return e[of[t]]=t,e},{}),as=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},UT=function(e){var t=as(e,Le.TITLE),n=as(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,function(){return t});var r=as(e,"defaultTitle");return t||r||void 0},VT=function(e){return as(e,"onChangeClientState")||function(){}},vm=function(e,t){return t.filter(function(n){return n[e]!==void 0}).map(function(n){return n[e]}).reduce(function(n,r){return Ft({},n,r)},{})},WT=function(e,t){return t.filter(function(n){return n[Le.BASE]!==void 0}).map(function(n){return n[Le.BASE]}).reverse().reduce(function(n,r){if(!n.length)for(var i=Object.keys(r),o=0;o/g,">").replace(/"/g,""").replace(/'/g,"'")},L3=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n]!==void 0?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r},"")},D3=function(e,t){return t===void 0&&(t={}),Object.keys(e).reduce(function(n,r){return n[of[r]||r]=e[r],n},t)},hd=function(e,t){return t.map(function(n,r){var i,o=((i={key:r})["data-rh"]=!0,i);return Object.keys(n).forEach(function(a){var s=of[a]||a;s==="innerHTML"||s==="cssText"?o.dangerouslySetInnerHTML={__html:n.innerHTML||n.cssText}:o[s]=n[a]}),de.createElement(e,o)})},Tr=function(e,t,n){switch(e){case Le.TITLE:return{toComponent:function(){return i=t.titleAttributes,(o={key:r=t.title})["data-rh"]=!0,a=D3(i,o),[de.createElement(Le.TITLE,a,r)];var r,i,o,a},toString:function(){return function(r,i,o,a){var s=L3(o),u=nk(i);return s?"<"+r+' data-rh="true" '+s+">"+bm(u,a)+"":"<"+r+' data-rh="true">'+bm(u,a)+""}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return D3(t)},toString:function(){return L3(t)}};default:return{toComponent:function(){return hd(e,t)},toString:function(){return function(r,i,o){return i.reduce(function(a,s){var u=Object.keys(s).filter(function(h){return!(h==="innerHTML"||h==="cssText")}).reduce(function(h,p){var y=s[p]===void 0?p:p+'="'+bm(s[p],o)+'"';return h?h+" "+y:y},""),l=s.innerHTML||s.cssText||"",c=KT.indexOf(r)===-1;return a+"<"+r+' data-rh="true" '+u+(c?"/>":">"+l+"")},"")}(e,t,n)}}}},F0=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,i=e.htmlAttributes,o=e.noscriptTags,a=e.styleTags,s=e.title,u=s===void 0?"":s,l=e.titleAttributes,c=e.linkTags,h=e.metaTags,p=e.scriptTags,y={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var g=function(b){var _=b.linkTags,S=b.scriptTags,k=b.encode,C=ym(b.metaTags,$T),d=ym(_,BT),v=ym(S,FT);return{priorityMethods:{toComponent:function(){return[].concat(hd(Le.META,C.priority),hd(Le.LINK,d.priority),hd(Le.SCRIPT,v.priority))},toString:function(){return Tr(Le.META,C.priority,k)+" "+Tr(Le.LINK,d.priority,k)+" "+Tr(Le.SCRIPT,v.priority,k)}},metaTags:C.default,linkTags:d.default,scriptTags:v.default}}(e);y=g.priorityMethods,c=g.linkTags,h=g.metaTags,p=g.scriptTags}return{priority:y,base:Tr(Le.BASE,t,r),bodyAttributes:Tr("bodyAttributes",n,r),htmlAttributes:Tr("htmlAttributes",i,r),link:Tr(Le.LINK,c,r),meta:Tr(Le.META,h,r),noscript:Tr(Le.NOSCRIPT,o,r),script:Tr(Le.SCRIPT,p,r),style:Tr(Le.STYLE,a,r),title:Tr(Le.TITLE,{title:u,titleAttributes:l},r)}},yc=[],$0=function(e,t){var n=this;t===void 0&&(t=typeof document<"u"),this.instances=[],this.value={setHelmet:function(r){n.context.helmet=r},helmetInstances:{get:function(){return n.canUseDOM?yc:n.instances},add:function(r){(n.canUseDOM?yc:n.instances).push(r)},remove:function(r){var i=(n.canUseDOM?yc:n.instances).indexOf(r);(n.canUseDOM?yc:n.instances).splice(i,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=F0({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},rk=de.createContext({}),GT=ie.shape({setHelmet:ie.func,helmetInstances:ie.shape({get:ie.func,add:ie.func,remove:ie.func})}),YT=typeof document<"u",Xa=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new $0(r.props.context,t.canUseDOM),r}return Xv(t,e),t.prototype.render=function(){return de.createElement(rk.Provider,{value:this.helmetData.value},this.props.children)},t}(w.Component);Xa.canUseDOM=YT,Xa.propTypes={context:ie.shape({helmet:ie.shape()}),children:ie.node.isRequired},Xa.defaultProps={context:{}},Xa.displayName="HelmetProvider";var Ta=function(e,t){var n,r=document.head||document.querySelector(Le.HEAD),i=r.querySelectorAll(e+"[data-rh]"),o=[].slice.call(i),a=[];return t&&t.length&&t.forEach(function(s){var u=document.createElement(e);for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(l==="innerHTML"?u.innerHTML=s.innerHTML:l==="cssText"?u.styleSheet?u.styleSheet.cssText=s.cssText:u.appendChild(document.createTextNode(s.cssText)):u.setAttribute(l,s[l]===void 0?"":s[l]));u.setAttribute("data-rh","true"),o.some(function(c,h){return n=h,u.isEqualNode(c)})?o.splice(n,1):a.push(u)}),o.forEach(function(s){return s.parentNode.removeChild(s)}),a.forEach(function(s){return r.appendChild(s)}),{oldTags:o,newTags:a}},wm=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),i=r?r.split(","):[],o=[].concat(i),a=Object.keys(t),s=0;s=0;h-=1)n.removeAttribute(o[h]);i.length===o.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==a.join(",")&&n.setAttribute("data-rh",a.join(","))}},N3=function(e,t){var n=e.baseTag,r=e.htmlAttributes,i=e.linkTags,o=e.metaTags,a=e.noscriptTags,s=e.onChangeClientState,u=e.scriptTags,l=e.styleTags,c=e.title,h=e.titleAttributes;wm(Le.BODY,e.bodyAttributes),wm(Le.HTML,r),function(b,_){b!==void 0&&document.title!==b&&(document.title=nk(b)),wm(Le.TITLE,_)}(c,h);var p={baseTag:Ta(Le.BASE,n),linkTags:Ta(Le.LINK,i),metaTags:Ta(Le.META,o),noscriptTags:Ta(Le.NOSCRIPT,a),scriptTags:Ta(Le.SCRIPT,u),styleTags:Ta(Le.STYLE,l)},y={},g={};Object.keys(p).forEach(function(b){var _=p[b],S=_.newTags,k=_.oldTags;S.length&&(y[b]=S),k.length&&(g[b]=p[b].oldTags)}),t&&t(),s(e,y,g)},Zs=null,af=function(e){function t(){for(var r,i=arguments.length,o=new Array(i),a=0;a elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(r){var i,o=r.child,a=r.arrayTypeChildren;return Ft({},a,((i={})[o.type]=[].concat(a[o.type]||[],[Ft({},r.newChildProps,this.mapNestedChildrenToProps(o,r.nestedChildren))]),i))},n.mapObjectTypeChildren=function(r){var i,o,a=r.child,s=r.newProps,u=r.newChildProps,l=r.nestedChildren;switch(a.type){case Le.TITLE:return Ft({},s,((i={})[a.type]=l,i.titleAttributes=Ft({},u),i));case Le.BODY:return Ft({},s,{bodyAttributes:Ft({},u)});case Le.HTML:return Ft({},s,{htmlAttributes:Ft({},u)});default:return Ft({},s,((o={})[a.type]=Ft({},u),o))}},n.mapArrayTypeChildrenToProps=function(r,i){var o=Ft({},i);return Object.keys(r).forEach(function(a){var s;o=Ft({},o,((s={})[a]=r[a],s))}),o},n.warnOnInvalidChildren=function(r,i){return T3(I3.some(function(o){return r.type===o}),typeof r.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+I3.join(", ")+" are allowed. Helmet does not support rendering <"+r.type+"> elements. Refer to our API for more information."),T3(!i||typeof i=="string"||Array.isArray(i)&&!i.some(function(o){return typeof o!="string"}),"Helmet expects a string as a child of <"+r.type+">. Did you forget to wrap your children in braces? ( <"+r.type+">{``} ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(r,i){var o=this,a={};return de.Children.forEach(r,function(s){if(s&&s.props){var u=s.props,l=u.children,c=P3(u,XT),h=Object.keys(c).reduce(function(y,g){return y[HT[g]||g]=c[g],y},{}),p=s.type;switch(typeof p=="symbol"?p=p.toString():o.warnOnInvalidChildren(s,l),p){case Le.FRAGMENT:i=o.mapChildrenToProps(l,i);break;case Le.LINK:case Le.META:case Le.NOSCRIPT:case Le.SCRIPT:case Le.STYLE:a=o.flattenArrayTypeChildren({child:s,arrayTypeChildren:a,newChildProps:h,nestedChildren:l});break;default:i=o.mapObjectTypeChildren({child:s,newProps:i,newChildProps:h,nestedChildren:l})}}}),this.mapArrayTypeChildrenToProps(a,i)},n.render=function(){var r=this.props,i=r.children,o=P3(r,QT),a=Ft({},o),s=o.helmetData;return i&&(a=this.mapChildrenToProps(i,a)),!s||s instanceof $0||(s=new $0(s.context,s.instances)),s?de.createElement(af,Ft({},a,{context:s.value,helmetData:void 0})):de.createElement(rk.Consumer,null,function(u){return de.createElement(af,Ft({},a,{context:u}))})},t}(w.Component);pd.propTypes={base:ie.object,bodyAttributes:ie.object,children:ie.oneOfType([ie.arrayOf(ie.node),ie.node]),defaultTitle:ie.string,defer:ie.bool,encodeSpecialCharacters:ie.bool,htmlAttributes:ie.object,link:ie.arrayOf(ie.object),meta:ie.arrayOf(ie.object),noscript:ie.arrayOf(ie.object),onChangeClientState:ie.func,script:ie.arrayOf(ie.object),style:ie.arrayOf(ie.object),title:ie.string,titleAttributes:ie.object,titleTemplate:ie.string,prioritizeSeoTags:ie.bool,helmetData:ie.object},pd.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},pd.displayName="Helmet";var M3=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},z3=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0:!1},nP=function(){document.cookie="".concat(ok,"=;Max-Age=-99999999")},rP=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},iP=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]-1};function h(j){if(typeof j!="string"&&(j=String(j)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(j))throw new TypeError("Invalid character in header field name");return j.toLowerCase()}function p(j){return typeof j!="string"&&(j=String(j)),j}function y(j){var F={next:function(){var R=j.shift();return{done:R===void 0,value:R}}};return s.iterable&&(F[Symbol.iterator]=function(){return F}),F}function g(j){this.map={},j instanceof g?j.forEach(function(F,R){this.append(R,F)},this):Array.isArray(j)?j.forEach(function(F){this.append(F[0],F[1])},this):j&&Object.getOwnPropertyNames(j).forEach(function(F){this.append(F,j[F])},this)}g.prototype.append=function(j,F){j=h(j),F=p(F);var R=this.map[j];this.map[j]=R?R+", "+F:F},g.prototype.delete=function(j){delete this.map[h(j)]},g.prototype.get=function(j){return j=h(j),this.has(j)?this.map[j]:null},g.prototype.has=function(j){return this.map.hasOwnProperty(h(j))},g.prototype.set=function(j,F){this.map[h(j)]=p(F)},g.prototype.forEach=function(j,F){for(var R in this.map)this.map.hasOwnProperty(R)&&j.call(F,this.map[R],R,this)},g.prototype.keys=function(){var j=[];return this.forEach(function(F,R){j.push(R)}),y(j)},g.prototype.values=function(){var j=[];return this.forEach(function(F){j.push(F)}),y(j)},g.prototype.entries=function(){var j=[];return this.forEach(function(F,R){j.push([R,F])}),y(j)},s.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function b(j){if(j.bodyUsed)return Promise.reject(new TypeError("Already read"));j.bodyUsed=!0}function _(j){return new Promise(function(F,R){j.onload=function(){F(j.result)},j.onerror=function(){R(j.error)}})}function S(j){var F=new FileReader,R=_(F);return F.readAsArrayBuffer(j),R}function k(j){var F=new FileReader,R=_(F);return F.readAsText(j),R}function C(j){for(var F=new Uint8Array(j),R=new Array(F.length),q=0;q-1?F:j}function A(j,F){F=F||{};var R=F.body;if(j instanceof A){if(j.bodyUsed)throw new TypeError("Already read");this.url=j.url,this.credentials=j.credentials,F.headers||(this.headers=new g(j.headers)),this.method=j.method,this.mode=j.mode,this.signal=j.signal,!R&&j._bodyInit!=null&&(R=j._bodyInit,j.bodyUsed=!0)}else this.url=String(j);if(this.credentials=F.credentials||this.credentials||"same-origin",(F.headers||!this.headers)&&(this.headers=new g(F.headers)),this.method=x(F.method||this.method||"GET"),this.mode=F.mode||this.mode||null,this.signal=F.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&R)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(R)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})};function L(j){var F=new FormData;return j.trim().split("&").forEach(function(R){if(R){var q=R.split("="),$=q.shift().replace(/\+/g," "),K=q.join("=").replace(/\+/g," ");F.append(decodeURIComponent($),decodeURIComponent(K))}}),F}function P(j){var F=new g,R=j.replace(/\r?\n[\t ]+/g," ");return R.split(/\r?\n/).forEach(function(q){var $=q.split(":"),K=$.shift().trim();if(K){var ee=$.join(":").trim();F.append(K,ee)}}),F}v.call(A.prototype);function O(j,F){F||(F={}),this.type="default",this.status=F.status===void 0?200:F.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in F?F.statusText:"OK",this.headers=new g(F.headers),this.url=F.url||"",this._initBody(j)}v.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},O.error=function(){var j=new O(null,{status:0,statusText:""});return j.type="error",j};var V=[301,302,303,307,308];O.redirect=function(j,F){if(V.indexOf(F)===-1)throw new RangeError("Invalid status code");return new O(null,{status:F,headers:{location:j}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(F,R){this.message=F,this.name=R;var q=Error(F);this.stack=q.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function H(j,F){return new Promise(function(R,q){var $=new A(j,F);if($.signal&&$.signal.aborted)return q(new a.DOMException("Aborted","AbortError"));var K=new XMLHttpRequest;function ee(){K.abort()}K.onload=function(){var D={status:K.status,statusText:K.statusText,headers:P(K.getAllResponseHeaders()||"")};D.url="responseURL"in K?K.responseURL:D.headers.get("X-Request-URL");var I="response"in K?K.response:K.responseText;R(new O(I,D))},K.onerror=function(){q(new TypeError("Network request failed"))},K.ontimeout=function(){q(new TypeError("Network request failed"))},K.onabort=function(){q(new a.DOMException("Aborted","AbortError"))},K.open($.method,$.url,!0),$.credentials==="include"?K.withCredentials=!0:$.credentials==="omit"&&(K.withCredentials=!1),"responseType"in K&&s.blob&&(K.responseType="blob"),$.headers.forEach(function(D,I){K.setRequestHeader(I,D)}),$.signal&&($.signal.addEventListener("abort",ee),K.onreadystatechange=function(){K.readyState===4&&$.signal.removeEventListener("abort",ee)}),K.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return H.polyfill=!0,o.fetch||(o.fetch=H,o.Headers=g,o.Request=A,o.Response=O),a.Headers=g,a.Request=A,a.Response=O,a.fetch=H,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(tP,af);const nP=eh(af);var U0=globalThis&&globalThis.__assign||function(){return U0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},rP=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r"u")throw new ur("No fetch available, If the current environment doesn't have a fetch implementation you can pass one yourself.");return n},enumerable:!1,configurable:!0}),e.tryValidSubject=function(t){try{new URL(t)}catch(n){throw new Error("Not a valid URL: ".concat(t,". ").concat(n))}},e.isValidSubject=function(t){if(typeof t!="string")return!1;try{return e.tryValidSubject(t),!0}catch{return!1}},e.removeQueryParamsFromURL=function(t){return t==null?void 0:t.split("?")[0]},e.prototype.setFetch=function(t){this.__fetchOverride=t},e.prototype.fetchResourceHTTP=function(t,n){return n===void 0&&(n={}),wm(this,void 0,void 0,function(){var r,i,o,a,s,u,l,c,h,p,y,g,b,_,S,k;return Sm(this,function(C){switch(C.label){case 0:r=n.signInfo,i=n.from,o=n.body,a=[],s=new pa,u=new xi(t),C.label=1;case 1:return C.trys.push([1,7,,8]),e.tryValidSubject(t),l={},l.Accept=iP,r?t.startsWith(window.location.origin)?(YT()||X5(r.serverURL,r.agent),[3,4]):[3,2]:[3,4];case 2:return[4,$0(t,r.agent,l)];case 3:C.sent(),C.label=4;case 4:return c=t,i!==void 0&&(h=new URL("".concat(i,"/path")),h.searchParams.set("path",t),c=h.href),[4,this.fetch(c,{headers:l,method:o?"POST":"GET",body:o})];case 5:return p=C.sent(),[4,p.text()];case 6:if(y=C.sent(),p.status===200)try{g=JSON.parse(y),b=km(s.parseObject(g,t),2),_=b[0],S=b[1],u=_,a.push.apply(a,rP([],km(S),!1))}catch(d){throw new ur("Could not parse JSON from fetching ".concat(t,". Is it an Atomic Data resource? Error message: ").concat(d.message))}else throw p.status===401?new ur(y,Zr.Unauthorized):p.status===500?new ur(y,Zr.Server):p.status===404?new ur(y,Zr.NotFound):new ur(y);return[3,8];case 7:return k=C.sent(),u.setError(k),a=[u],console.error(t,k),[3,8];case 8:return u.loading=!1,[2,{resource:u,createdResources:a}]}})})},e.prototype.postCommit=function(t,n){return wm(this,void 0,void 0,function(){var r,i,o,a,s;return Sm(this,function(u){switch(u.label){case 0:r=ak(U0({},t)),i=new Headers,i.set("Content-Type","application/ad+json"),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.fetch(n,{headers:i,method:"POST",body:r})];case 2:return o=u.sent(),[3,4];case 3:throw a=u.sent(),new ur("Posting Commit to ".concat(n," failed: ").concat(a));case 4:return[4,o.text()];case 5:if(s=u.sent(),o.status!==200)throw new ur(s,Zr.Server);return[2,lk(s)]}})})},e.prototype.uploadFiles=function(t,n,r,i){return wm(this,void 0,void 0,function(){var o,a,s,u,l,c,h,p,y,g;return Sm(this,function(b){switch(b.label){case 0:return o=new pa,a=new FormData,t.map(function(_){a.append("assets",_,_.name)}),s=new URL("".concat(n,"/upload")),s.searchParams.set("parent",i),[4,$0(s.toString(),r,{})];case 1:return u=b.sent(),l={method:"POST",body:a,headers:u},[4,this.fetch(s.toString(),l)];case 2:return c=b.sent(),[4,c.text()];case 3:if(h=b.sent(),c.status!==200)throw Error(h);return p=JSON.parse(h),y=km(o.parseArray(p),1),g=y[0],[2,g]}})})},e}();const Q5={},Zte=Object.freeze(Object.defineProperty({__proto__:null,default:Q5},Symbol.toStringTag,{value:"Module"}));/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const ln=BigInt(0),Ze=BigInt(1),On=BigInt(2),J5=BigInt(255),P3=On**BigInt(252)+BigInt("27742317777372353535851937790883648493"),At={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:On**J5-BigInt(19),l:P3,n:P3,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")},Z5=On**BigInt(256),Cl=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742");const oP=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),aP=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),sP=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),lP=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class pt{constructor(t,n,r,i){this.x=t,this.y=n,this.z=r,this.t=i}static fromAffine(t){if(!(t instanceof tn))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return t.equals(tn.ZERO)?pt.ZERO:new pt(t.x,t.y,Ze,oe(t.x*t.y))}static toAffineBatch(t){const n=dP(t.map(r=>r.z));return t.map((r,i)=>r.toAffine(n[i]))}static normalizeZ(t){return this.toAffineBatch(t).map(this.fromAffine)}equals(t){I3(t);const{x:n,y:r,z:i}=this,{x:o,y:a,z:s}=t,u=oe(n*s),l=oe(o*i),c=oe(r*s),h=oe(a*i);return u===l&&c===h}negate(){return new pt(oe(-this.x),this.y,this.z,oe(-this.t))}double(){const{x:t,y:n,z:r}=this,{a:i}=At,o=oe(t**On),a=oe(n**On),s=oe(On*oe(r**On)),u=oe(i*o),l=oe(oe((t+n)**On)-o-a),c=u+a,h=c-s,p=u-a,y=oe(l*h),g=oe(c*p),b=oe(l*p),_=oe(h*c);return new pt(y,g,_,b)}add(t){I3(t);const{x:n,y:r,z:i,t:o}=this,{x:a,y:s,z:u,t:l}=t,c=oe((r-n)*(s+a)),h=oe((r+n)*(s-a)),p=oe(h-c);if(p===ln)return this.double();const y=oe(i*On*l),g=oe(o*On*u),b=g+y,_=h+c,S=g-y,k=oe(b*p),C=oe(_*S),d=oe(b*S),v=oe(p*_);return new pt(k,C,v,d)}subtract(t){return this.add(t.negate())}precomputeWindow(t){const n=1+256/t,r=[];let i=this,o=i;for(let a=0;a>=h,g>u&&(g-=c,t+=Ze),g===0){let b=i[y];p%2&&(b=b.negate()),a=a.add(b)}else{let b=i[y+Math.abs(g)-1];g<0&&(b=b.negate()),o=o.add(b)}}return pt.normalizeZ([o,a])[0]}multiply(t,n){return this.wNAF(sf(t,At.l),n)}multiplyUnsafe(t){let n=sf(t,At.l,!1);const r=pt.BASE,i=pt.ZERO;if(n===ln)return i;if(this.equals(i)||n===Ze)return this;if(this.equals(r))return this.wNAF(n);let o=i,a=this;for(;n>ln;)n&Ze&&(o=o.add(a)),a=a.double(),n>>=Ze;return o}isSmallOrder(){return this.multiplyUnsafe(At.h).equals(pt.ZERO)}isTorsionFree(){return this.multiplyUnsafe(At.l).equals(pt.ZERO)}toAffine(t=vh(this.z)){const{x:n,y:r,z:i}=this,o=oe(n*t),a=oe(r*t);if(oe(i*t)!==Ze)throw new Error("invZ was invalid");return new tn(o,a)}fromRistrettoBytes(){Cm()}toRistrettoBytes(){Cm()}fromRistrettoHash(){Cm()}}pt.BASE=new pt(At.Gx,At.Gy,Ze,oe(At.Gx*At.Gy));pt.ZERO=new pt(ln,Ze,Ze,ln);function I3(e){if(!(e instanceof pt))throw new TypeError("ExtendedPoint expected")}function xm(e){if(!(e instanceof Ir))throw new TypeError("RistrettoPoint expected")}function Cm(){throw new Error("Legacy method: switch to RistrettoPoint")}class Ir{constructor(t){this.ep=t}static calcElligatorRistrettoMap(t){const{d:n}=At,r=oe(Cl*t*t),i=oe((r+Ze)*sP);let o=BigInt(-1);const a=oe((o-n*r)*oe(r+n));let{isValid:s,value:u}=ey(i,a),l=oe(u*t);oo(l)||(l=oe(-l)),s||(u=l),s||(o=r);const c=oe(o*(r-Ze)*lP-a),h=u*u,p=oe((u+u)*a),y=oe(c*oP),g=oe(Ze-h),b=oe(Ze+h);return new pt(oe(p*b),oe(g*y),oe(y*b),oe(p*g))}static hashToCurve(t){t=ha(t,64);const n=_m(t.slice(0,32)),r=this.calcElligatorRistrettoMap(n),i=_m(t.slice(32,64)),o=this.calcElligatorRistrettoMap(i);return new Ir(r.add(o))}static fromHex(t){t=ha(t,32);const{a:n,d:r}=At,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",o=_m(t);if(!hP(eu(o),t)||oo(o))throw new Error(i);const a=oe(o*o),s=oe(Ze+n*a),u=oe(Ze-n*a),l=oe(s*s),c=oe(u*u),h=oe(n*r*l-c),{isValid:p,value:y}=O3(oe(h*c)),g=oe(y*u),b=oe(y*g*h);let _=oe((o+o)*g);oo(_)&&(_=oe(-_));const S=oe(s*b),k=oe(_*S);if(!p||oo(k)||S===ln)throw new Error(i);return new Ir(new pt(_,S,Ze,k))}toRawBytes(){let{x:t,y:n,z:r,t:i}=this.ep;const o=oe(oe(r+n)*oe(r-n)),a=oe(t*n),{value:s}=O3(oe(o*a**On)),u=oe(s*o),l=oe(s*a),c=oe(u*l*i);let h;if(oo(i*c)){let y=oe(n*Cl),g=oe(t*Cl);t=y,n=g,h=oe(u*aP)}else h=l;oo(t*c)&&(n=oe(-n));let p=oe((r-n)*h);return oo(p)&&(p=oe(-p)),eu(p)}toHex(){return Pu(this.toRawBytes())}toString(){return this.toHex()}equals(t){xm(t);const n=this.ep,r=t.ep,i=oe(n.x*r.y)===oe(n.y*r.x),o=oe(n.y*r.y)===oe(n.x*r.x);return i||o}add(t){return xm(t),new Ir(this.ep.add(t.ep))}subtract(t){return xm(t),new Ir(this.ep.subtract(t.ep))}multiply(t){return new Ir(this.ep.multiply(t))}multiplyUnsafe(t){return new Ir(this.ep.multiplyUnsafe(t))}}Ir.BASE=new Ir(pt.BASE);Ir.ZERO=new Ir(pt.ZERO);const H0=new WeakMap;class tn{constructor(t,n){this.x=t,this.y=n}_setWindowSize(t){this._WINDOW_SIZE=t,H0.delete(this)}static fromHex(t,n=!0){const{d:r,P:i}=At;t=ha(t,32);const o=t.slice();o[31]=t[31]&-129;const a=xs(o);if(n&&a>=i)throw new Error("Expected 0 < hex < P");if(!n&&a>=Z5)throw new Error("Expected 0 < hex < 2**256");const s=oe(a*a),u=oe(s-Ze),l=oe(r*s+Ze);let{isValid:c,value:h}=ey(u,l);if(!c)throw new Error("Point.fromHex: invalid y coordinate");const p=(h&Ze)===Ze;return(t[31]&128)!==0!==p&&(h=oe(-h)),new tn(h,a)}static async fromPrivateKey(t){return(await yh(t)).point}toRawBytes(){const t=eu(this.y);return t[31]|=this.x&Ze?128:0,t}toHex(){return Pu(this.toRawBytes())}toX25519(){const{y:t}=this,n=oe((Ze+t)*vh(Ze-t));return eu(n)}isTorsionFree(){return pt.fromAffine(this).isTorsionFree()}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new tn(oe(-this.x),this.y)}add(t){return pt.fromAffine(this).add(pt.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return pt.fromAffine(this).multiply(t,this).toAffine()}}tn.BASE=new tn(At.Gx,At.Gy);tn.ZERO=new tn(ln,Ze);class Zv{constructor(t,n){this.r=t,this.s=n,this.assertValidity()}static fromHex(t){const n=ha(t,64),r=tn.fromHex(n.slice(0,32),!1),i=xs(n.slice(32,64));return new Zv(r,i)}assertValidity(){const{r:t,s:n}=this;if(!(t instanceof tn))throw new Error("Expected Point instance");return sf(n,At.l,!1),this}toRawBytes(){const t=new Uint8Array(64);return t.set(this.r.toRawBytes()),t.set(eu(this.s),32),t}toHex(){return Pu(this.toRawBytes())}}function uP(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rt.toString(16).padStart(2,"0"));function Pu(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let n=0;n=ln?n:t+n}function vh(e,t=At.P){if(e===ln||t<=ln)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=oe(e,t),r=t,i=ln,o=Ze;for(;n!==ln;){const s=r/n,u=r%n,l=i-o*s;r=n,n=u,i=o,o=l}if(r!==Ze)throw new Error("invert: does not exist");return oe(i,t)}function dP(e,t=At.P){const n=new Array(e.length),r=e.reduce((o,a,s)=>a===ln?o:(n[s]=o,oe(o*a,t)),Ze),i=vh(r,t);return e.reduceRight((o,a,s)=>a===ln?o:(n[s]=oe(o*n[s],t),oe(o*a,t)),i),n}function fi(e,t){const{P:n}=At;let r=e;for(;t-- >ln;)r*=r,r%=n;return r}function fP(e){const{P:t}=At,n=BigInt(5),r=BigInt(10),i=BigInt(20),o=BigInt(40),a=BigInt(80),u=e*e%t*e%t,l=fi(u,On)*u%t,c=fi(l,Ze)*e%t,h=fi(c,n)*c%t,p=fi(h,r)*h%t,y=fi(p,i)*p%t,g=fi(y,o)*y%t,b=fi(g,a)*g%t,_=fi(b,a)*g%t,S=fi(_,r)*h%t;return{pow_p_5_8:fi(S,On)*e%t,b2:u}}function ey(e,t){const n=oe(t*t*t),r=oe(n*n*t),i=fP(e*r).pow_p_5_8;let o=oe(e*n*i);const a=oe(t*o*o),s=o,u=oe(o*Cl),l=a===e,c=a===oe(-e),h=a===oe(-e*Cl);return l&&(o=s),(c||h)&&(o=u),oo(o)&&(o=oe(-o)),{isValid:l||c,value:o}}function O3(e){return ey(Ze,e)}async function L3(...e){const t=await Cs.sha512(uP(...e)),n=xs(t);return oe(n,At.l)}function hP(e,t){if(e.length!==t.length)return!1;for(let n=0;n{if(e=ha(e),e.length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const t=oe(xs(e),At.l);if(t===ln||t===Ze)throw new Error("Invalid private key");return t},randomBytes:(e=32)=>{if(eo.web)return eo.web.getRandomValues(new Uint8Array(e));if(eo.node){const{randomBytes:t}=eo.node;return new Uint8Array(t(e).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Cs.randomBytes(32),sha512:async e=>{if(eo.web){const t=await eo.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(t)}else{if(eo.node)return Uint8Array.from(eo.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(e=8,t=tn.BASE){const n=t.equals(tn.BASE)?t:new tn(t.x,t.y);return n._setWindowSize(e),n.multiply(On),n}};var gP=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var n=typeof t.cycles=="boolean"?t.cycles:!1,r=t.cmp&&function(o){return function(a){return function(s,u){var l={key:s,value:a[s]},c={key:u,value:a[u]};return o(l,c)}}}(t.cmp),i=[];return function o(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var s,u;if(Array.isArray(a)){for(u="[",s=0;s"u"?[]:new Uint8Array(256);for(var vc=0;vc>2],i+=Ga[(t[n]&3)<<4|t[n+1]>>4],i+=Ga[(t[n+1]&15)<<2|t[n+2]>>6],i+=Ga[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},rk=function(e){var t=e.length*.75,n=e.length,r,i=0,o,a,s,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var l=new ArrayBuffer(t),c=new Uint8Array(l);for(r=0;r>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|u&63;return l};/*! noble-hashes - MIT License (c) 2021 Paul Miller (paulmillr.com) */const Em=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),yP=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!yP)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));(()=>{const e=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);try{if(e){const{setImmediate:t}=e("timers");return()=>new Promise(n=>t(n))}}catch{}return()=>new Promise(t=>setTimeout(t,0))})();function bP(e){if(typeof e!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}function ik(e){if(typeof e=="string"&&(e=bP(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}class wP{clone(){return this._cloneInto()}}function ty(e){const t=r=>e().update(ik(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t.init=t.create,t}function SP(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),s=Number(n&o),u=r?4:0,l=r?0:4;e.setUint32(t+u,a,r),e.setUint32(t+l,s,r)}class kP extends wP{constructor(t,n,r,i){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Em(this.buffer)}update(t){if(this.destroyed)throw new Error("instance is destroyed");const{view:n,buffer:r,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");t=ik(t);const a=t.length;for(let s=0;si-a&&(this.process(r,0),a=0);for(let u=a;us.setUint32(4*l,u,o))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:o,destroyed:a,pos:s}=this;return t.length=i,t.pos=s,t.finished=o,t.destroyed=a,i%n&&t.buffer.set(r),t}}const yc=BigInt(2**32-1),D3=BigInt(32);function xP(e,t=!1){return t?{h:Number(e&yc),l:Number(e>>D3&yc)}:{h:Number(e>>D3&yc)|0,l:Number(e&yc)|0}}function CP(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;ie>>>n,N3=(e,t,n)=>e<<32-n|t>>>n,Ta=(e,t,n)=>e>>>n|t<<32-n,Pa=(e,t,n)=>e<<32-n|t>>>n,bc=(e,t,n)=>e<<64-n|t>>>n-32,wc=(e,t,n)=>e>>>n-32|t<<64-n;function Ri(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const _P=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),EP=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,RP=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),AP=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,TP=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),PP=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0,[IP,OP]=CP(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),to=new Uint32Array(80),no=new Uint32Array(80);class ny extends kP{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:i,Ch:o,Cl:a,Dh:s,Dl:u,Eh:l,El:c,Fh:h,Fl:p,Gh:y,Gl:g,Hh:b,Hl:_}=this;return[t,n,r,i,o,a,s,u,l,c,h,p,y,g,b,_]}set(t,n,r,i,o,a,s,u,l,c,h,p,y,g,b,_){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=l|0,this.El=c|0,this.Fh=h|0,this.Fl=p|0,this.Gh=y|0,this.Gl=g|0,this.Hh=b|0,this.Hl=_|0}process(t,n){for(let C=0;C<16;C++,n+=4)to[C]=t.getUint32(n),no[C]=t.getUint32(n+=4);for(let C=16;C<80;C++){const d=to[C-15]|0,v=no[C-15]|0,m=Ta(d,v,1)^Ta(d,v,8)^M3(d,v,7),x=Pa(d,v,1)^Pa(d,v,8)^N3(d,v,7),A=to[C-2]|0,L=no[C-2]|0,P=Ta(A,L,19)^bc(A,L,61)^M3(A,L,6),O=Pa(A,L,19)^wc(A,L,61)^N3(A,L,6),V=RP(x,O,no[C-7],no[C-16]),H=AP(V,m,P,to[C-7],to[C-16]);to[C]=H|0,no[C]=V|0}let{Ah:r,Al:i,Bh:o,Bl:a,Ch:s,Cl:u,Dh:l,Dl:c,Eh:h,El:p,Fh:y,Fl:g,Gh:b,Gl:_,Hh:S,Hl:k}=this;for(let C=0;C<80;C++){const d=Ta(h,p,14)^Ta(h,p,18)^bc(h,p,41),v=Pa(h,p,14)^Pa(h,p,18)^wc(h,p,41),m=h&y^~h&b,x=p&g^~p&_,A=TP(k,v,x,OP[C],no[C]),L=PP(A,S,d,m,IP[C],to[C]),P=A|0,O=Ta(r,i,28)^bc(r,i,34)^bc(r,i,39),V=Pa(r,i,28)^wc(r,i,34)^wc(r,i,39),H=r&o^r&s^o&s,j=i&a^i&u^a&u;S=b|0,k=_|0,b=y|0,_=g|0,y=h|0,g=p|0,{h,l:p}=Ri(l|0,c|0,L|0,P|0),l=s|0,c=u|0,s=o|0,u=a|0,o=r|0,a=i|0;const F=_P(P,V,j);r=EP(F,L,O,H),i=F|0}({h:r,l:i}=Ri(this.Ah|0,this.Al|0,r|0,i|0)),{h:o,l:a}=Ri(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Ri(this.Ch|0,this.Cl|0,s|0,u|0),{h:l,l:c}=Ri(this.Dh|0,this.Dl|0,l|0,c|0),{h,l:p}=Ri(this.Eh|0,this.El|0,h|0,p|0),{h:y,l:g}=Ri(this.Fh|0,this.Fl|0,y|0,g|0),{h:b,l:_}=Ri(this.Gh|0,this.Gl|0,b|0,_|0),{h:S,l:k}=Ri(this.Hh|0,this.Hl|0,S|0,k|0),this.set(r,i,o,a,s,u,l,c,h,p,y,g,b,_,S,k)}roundClean(){to.fill(0),no.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class LP extends ny{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class DP extends ny{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const ok=ty(()=>new ny);ty(()=>new LP);ty(()=>new DP);var Yo=globalThis&&globalThis.__assign||function(){return Yo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cr=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ea=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0||this.push.size>0||this.destroy||this.remove.size>0},e.prototype.clone=function(){var t={set:this.set,push:this.push,remove:this.remove,destroy:this.destroy,previousCommit:this.previousCommit};return new e(this.subject,structuredClone(t))},e.prototype.toPlainObject=function(){return{subject:this.subject,set:Object.fromEntries(this.set.entries()),push:Object.fromEntries(Array.from(this.push.entries()).map(function(t){var n=cr(t,2),r=n[0],i=n[1];return[r,Array.from(i)]})),remove:Array.from(this.remove),destroy:this.destroy,previousCommit:this.previousCommit}},e.prototype.signAt=function(t,n,r){return tu(this,void 0,void 0,function(){var i,o,a,s;return nu(this,function(u){switch(u.label){case 0:if(t===void 0)throw new Error("No agent passed to sign commit");return i=Yo(Yo({},this.clone().toPlainObject()),{createdAt:r,signer:t}),o=ak(Yo({},i)),[4,sk(o,n)];case 1:return a=u.sent(),s=Yo(Yo({},i),{signature:a}),[2,s]}})})},e}();function Ai(e,t,n){t in e&&t!==n&&(Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(e,t)),delete e[t])}function ak(e){return e.remove&&Object.keys(e.remove).length===0&&delete e.remove,e.set&&Object.keys(e.set).length===0&&delete e.set,e.push&&Object.keys(e.push).length===0&&delete e.push,e.destroy===!1&&delete e.destroy,Ai(e,"createdAt",J.properties.commit.createdAt),Ai(e,"subject",J.properties.commit.subject),Ai(e,"set",J.properties.commit.set),Ai(e,"push",J.properties.commit.push),Ai(e,"signer",J.properties.commit.signer),Ai(e,"signature",J.properties.commit.signature),Ai(e,"remove",J.properties.commit.remove),Ai(e,"destroy",J.properties.commit.destroy),Ai(e,"previousCommit",J.properties.commit.previousCommit),e[J.properties.isA]=[J.classes.commit],vP(e)}var sk=function(e,t){return tu(void 0,void 0,void 0,function(){var n,r,i,o,a,s;return nu(this,function(u){switch(u.label){case 0:return n=rk(t),r=new Uint8Array(n),i=new TextEncoder,o=i.encode(e),[4,mP(o,r)];case 1:return a=u.sent(),s=lf(a),[2,s]}})})},MP=function(e){return tu(void 0,void 0,void 0,function(){var t,n,r,i;return nu(this,function(o){switch(o.label){case 0:return t=rk(e),n=new Uint8Array(t),[4,nk(n)];case 1:return r=o.sent(),i=lf(r),[2,i]}})})};function NP(){return tu(this,void 0,void 0,function(){var e,t,n,r;return nu(this,function(i){switch(i.label){case 0:return e=Cs.randomPrivateKey(),[4,nk(e)];case 1:return t=i.sent(),n=lf(e),r=lf(t),[2,{publicKey:r,privateKey:n}]}})})}function lk(e){try{var t=JSON.parse(e),n=t[J.properties.commit.subject],r=t[J.properties.commit.set],i=t[J.properties.commit.push],o=t[J.properties.commit.signer],a=t[J.properties.commit.createdAt],s=t[J.properties.commit.remove],u=t[J.properties.commit.destroy],l=t[J.properties.commit.signature],c=t["@id"],h=t[J.properties.commit.previousCommit];return{subject:n,set:r,push:i,signer:o,createdAt:a,remove:s,destroy:u,signature:l,id:c,previousCommit:h}}catch(p){throw new Error("Could not parse commit: ".concat(p))}}function zP(e,t){var n=lk(e),r=n.subject,i=n.set,o=n.remove,a=n.id,s=n.destroy,u=n.signature,l=n.push,c=t.resources.get(r);if(!c)c=new xi(r);else if(c.appliedCommitSignatures.has(u))return;if(i&&jP(i,c,t),o&&BP(o,c),l&&FP(l,c,t),a&&c.setUnsafe(G.commit.lastCommit,a),s){t.removeResource(r);return}else c.appliedCommitSignatures.add(u),t.addResources(c)}function jP(e,t,n){var r,i,o=new pa,a=[],s=function(y,g){var b=g;if((g==null?void 0:g.constructor)==={}.constructor){var _=cr(o.parseValue(g,y),2),S=_[0],k=_[1];b=S,a.push.apply(a,ea([],cr(k),!1))}ry(g)&&(b=g.map(function(C){var d=cr(o.parseValue(C,y),2),v=d[0],m=d[1];return a.push.apply(a,ea([],cr(m),!1)),v})),t.setUnsafe(y,b)};try{for(var u=bh(Object.entries(e)),l=u.next();!l.done;l=u.next()){var c=cr(l.value,2),h=c[0],p=c[1];s(h,p)}}catch(y){r={error:y}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}n.addResources.apply(n,ea([],cr(a),!1))}function BP(e,t){var n,r;try{for(var i=bh(e),o=i.next();!o.done;o=i.next()){var a=o.value;t.removePropValLocally(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function FP(e,t,n){var r,i,o=new pa,a=[],s=function(y,g){var b=t.get(y)||[],_=g,S=_.map(function(C){var d=cr(o.parseValue(C,y),2),v=d[0],m=d[1];return a.push.apply(a,ea([],cr(m),!1)),v}),k=ea(ea([],cr(b),!1),cr(S),!1);t.setUnsafe(y,k)};try{for(var u=bh(Object.entries(e)),l=u.next();!l.done;l=u.next()){var c=cr(l.value,2),h=c[0],p=c[1];s(h,p)}}catch(y){r={error:y}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}n.addResources.apply(n,ea([],cr(a),!1))}var $P=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zr;(function(e){e.Unauthorized="Unauthorized",e.NotFound="NotFound",e.Server="Server",e.Client="Client"})(Zr||(Zr={}));function uk(e){if(e instanceof ur){if(e.type===Zr.Unauthorized)return!0;if(e.message.includes("Unauthorized"))return!0}return!1}var ur=function(e){$P(t,e);function t(n,r){r===void 0&&(r=Zr.Client);var i=e.call(this,n)||this;Object.setPrototypeOf(i,t.prototype),i.type=r,i.message=n;try{var o=JSON.parse(n),a=o[G.description];a&&(i.message=a)}catch{}return i.message||(i.message=i.createMessage()),i}return t.fromResource=function(n){var r=new t(n.get(G.description).toString());return r},t.prototype.createMessage=function(){switch(this.type){case Zr.Unauthorized:return"You don't have the rights to do this.";case Zr.NotFound:return"404 Not found.";case Zr.Server:return"500 Unknown server error.";default:return"Unknown error."}},t}(Error),UP=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},HP=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},VP=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},qP=function(e,t){var n,r,i=new URL(e);try{for(var o=WP(Object.entries(t)),a=o.next();!a.done;a=o.next()){var s=VP(a.value,2),u=s[0],l=s[1];i.searchParams.set(u,l)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i.toString()};function KP(e){if(e.error)throw e.error;return xi}function GP(e,t,n){return UP(this,void 0,void 0,function(){var r,i;return HP(this,function(o){switch(o.label){case 0:return r=qP(e.getServerUrl()+J.endpoints.import,{parent:n.parent,"overwrite-outside":n.overwriteOutside?"true":"false"}),i=KP,[4,e.postToServer(r,t)];case 1:return[2,i.apply(void 0,[o.sent()])]}})})}var Ie;(function(e){e.ATOMIC_URL="https://atomicdata.dev/datatypes/atomicURL",e.BOOLEAN="https://atomicdata.dev/datatypes/boolean",e.DATE="https://atomicdata.dev/datatypes/date",e.FLOAT="https://atomicdata.dev/datatypes/float",e.INTEGER="https://atomicdata.dev/datatypes/integer",e.MARKDOWN="https://atomicdata.dev/datatypes/markdown",e.RESOURCEARRAY="https://atomicdata.dev/datatypes/resourceArray",e.SLUG="https://atomicdata.dev/datatypes/slug",e.STRING="https://atomicdata.dev/datatypes/string",e.TIMESTAMP="https://atomicdata.dev/datatypes/timestamp",e.UNKNOWN="unknown-datatype"})(Ie||(Ie={}));var ck=function(e){switch(e){case J.datatypes.atomicUrl:return Ie.ATOMIC_URL;case J.datatypes.boolean:return Ie.BOOLEAN;case J.datatypes.date:return Ie.DATE;case J.datatypes.float:return Ie.FLOAT;case J.datatypes.integer:return Ie.INTEGER;case J.datatypes.markdown:return Ie.MARKDOWN;case J.datatypes.resourceArray:return Ie.RESOURCEARRAY;case J.datatypes.slug:return Ie.SLUG;case J.datatypes.string:return Ie.STRING;case J.datatypes.timestamp:return Ie.TIMESTAMP;default:return Ie.UNKNOWN}},YP=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,XP=/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/,QP=function(e,t){var n=null;if(e===void 0)throw new Error("Value is undefined, expected ".concat(t));switch(t){case Ie.STRING:{if(!Ya(e)){n="Not a string";break}break}case Ie.SLUG:{if(!Ya(e)){n="Not a slug, not even a string";break}e.match(YP)===null&&(n="Not a valid slug. Only lowercase letters and numbers with dashes `-` between them");break}case Ie.ATOMIC_URL:{if(!Ya(e)){n="Not a string. Should be a URL";break}dn.tryValidSubject(e);break}case Ie.RESOURCEARRAY:{if(!ry(e)){n="Not an array";break}e.map(function(r,i){try{dn.tryValidSubject(r)}catch{var o=new Error("Invalid URL");throw o.index=i,o}});break}case Ie.INTEGER:{if(!JP(e)){n="Not a number";break}e%1!==0&&(n="Not an integer");break}case Ie.DATE:{if(!Ya(e)){n="Not a string";break}e.match(XP)===null&&(n="Not a date string: YYYY-MM-DD");break}}if(n!==null)throw new Error(n)};function ry(e){return Object.prototype.toString.call(e)==="[object Array]"}function Ya(e){return typeof e=="string"}function JP(e){return typeof e=="number"}var Sc=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Am=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pa=function(){function e(){this.parsedResources=[]}return e.prototype.parseObject=function(t,n){this.parsedResources=[];var r=this.parseJsonADResource(t,n);return[r,Am([],Sc(this.parsedResources),!1)]},e.prototype.parseArray=function(t){this.parsedResources=[];var n=this.parseJsonADArray(t);return[n,Am([],Sc(this.parsedResources),!1)]},e.prototype.parseValue=function(t,n){this.parsedResources=[];var r=this.parseJsonAdResourceValue(t,n);return[r,Am([],Sc(this.parsedResources),!1)]},e.prototype.parseJsonADResource=function(t,n){var r,i,o=this;n===void 0&&(n=Li);var a=new xi(n);this.parsedResources.push(a);try{var s=function(g,b){if(g==="@id"){if(typeof b!="string")throw new Error("'@id' field must be a string");if(a.getSubject()!=="undefined"&&a.getSubject()!==Li&&b!==a.getSubject())throw new Error("Resource has wrong subject in @id. Received subject was ".concat(b,", expected ").concat(a.getSubject(),"."));return a.setSubject(b),"continue"}try{if(ry(b)){var _=b.map(function(d){return o.parseJsonAdResourceValue(d,g)});a.setUnsafe(g,_)}else if(typeof b=="string")a.setUnsafe(g,b);else if(typeof b=="number")a.setUnsafe(g,b);else if(typeof b=="boolean")a.setUnsafe(g,b);else{var S=u.parseJsonAdResourceValue(b,g);a.setUnsafe(g,S)}}catch(d){var k="Failed creating value ".concat(b," for key ").concat(g," in resource ").concat(a.getSubject()),C="".concat(k,". ").concat(d.message);throw new Error(C)}},u=this;try{for(var l=z3(Object.entries(t)),c=l.next();!c.done;c=l.next()){var h=Sc(c.value,2),p=h[0],y=h[1];s(p,y)}}catch(g){r={error:g}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}a.loading=!1,a.hasClasses(J.classes.error)&&(a.error=ur.fromResource(a))}catch(g){throw g.message="Failed parsing JSON "+g.message,a.setError(g),a.loading=!1,g}return a},e.prototype.parseJsonAdResourceValue=function(t,n){if(typeof t=="string")return t;if((t==null?void 0:t.constructor)==={}.constructor)if(Object.keys(t).includes("@id")){var r=t["@id"];return this.parseJsonADResource(t),r}else return t;throw new Error("Value ".concat(t," in ").concat(n," not a string or a nested Resource"))},e.prototype.parseJsonADArray=function(t){var n,r,i=[];try{try{for(var o=z3(t),a=o.next();!a.done;a=o.next()){var s=a.value,u=this.parseJsonADResource(s);i.push(u)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}catch(l){throw l.message="Failed parsing JSON "+l.message,l}return i},e}(),ZP=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},eI=["+","^","`",":","{","}",'"',"[","]","(",")","!","\\","*"," ","."];function tI(e){return e.replace(new RegExp("([".concat(eI.join("\\"),"])"),"g"),"\\$1")}function nI(e){return Object.entries(e).map(function(t){var n=ZP(t,2),r=n[0],i=n[1];return i&&i.length>0&&"".concat(tI(r),':"').concat(i,'"')}).join(" AND ")}function rI(e,t,n){n===void 0&&(n={});var r=n.include,i=r===void 0?!1:r,o=n.limit,a=o===void 0?30:o,s=n.scope,u=n.filters,l=new URL(e);l.pathname="search",t&&l.searchParams.set("q",t),i&&l.searchParams.set("include",i.toString()),a&&l.searchParams.set("limit",a.toString());var c=u&&Object.keys(u).length>0&&Object.values(u).filter(function(h){return h&&h.length>0}).length>0;return c&&l.searchParams.set("filters",nI(u)),s&&l.searchParams.set("parent",s),l.toString()}var Qs=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},Js=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Pm=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},$3=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hk=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},aI=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},kc=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Im=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r"u"?!1:!(!((t=window==null?void 0:window.navigator)===null||t===void 0)&&t.onLine)},e.prototype.notify=function(t){return Bn(this,void 0,void 0,function(){var n,r,i=this;return Fn(this,function(o){return n=t.getSubject(),r=this.subscribers.get(n),r===void 0?[2]:(Promise.allSettled(r.map(function(a){return Bn(i,void 0,void 0,function(){return Fn(this,function(s){return[2,a(t)]})})})),[2])})})},e.prototype.notifyResourceSaved=function(t){this.eventManager.emit(dr.ResourceSaved,t)},e.prototype.notifyResourceManuallyCreated=function(t){this.eventManager.emit(dr.ResourceManuallyCreated,t)},e.prototype.parseMetaTags=function(){var t=this,n=document.querySelectorAll('meta[property="json-ad-initial"]'),r=new pa;n.forEach(function(i){var o=i.getAttribute("content");if(o!==null){var a=JSON.parse(atob(o)),s=kc(r.parseObject(a),2);s[0];var u=s[1];t.addResources.apply(t,Im([],kc(u),!1))}})},e.prototype.preloadPropsAndClasses=function(){return Bn(this,void 0,void 0,function(){var t,n;return Fn(this,function(r){switch(r.label){case 0:return t=new URL("/classes",this.serverUrl),n=new URL("/properties",this.serverUrl),t.searchParams.set("include_external","true"),n.searchParams.set("include_external","true"),t.searchParams.set("include_nested","true"),n.searchParams.set("include_nested","true"),t.searchParams.set("page_size","999"),n.searchParams.set("page_size","999"),[4,Promise.all([this.fetchResourceFromServer(t.toString()),this.fetchResourceFromServer(n.toString())])];case 1:return r.sent(),[2]}})})},e.prototype.postToServer=function(t,n){return Bn(this,void 0,void 0,function(){return Fn(this,function(r){return[2,this.fetchResourceFromServer(t,{body:n,noWebSocket:!0,method:"POST"})]})})},e.prototype.removeResource=function(t){var n=this.resources.get(t);this.resources.delete(t),n&&this.eventManager.emit(dr.ResourceRemoved,n)},e.prototype.renameSubject=function(t,n){return Bn(this,void 0,void 0,function(){var r;return Fn(this,function(i){switch(i.label){case 0:return dn.tryValidSubject(n),r=t.getSubject(),[4,this.checkSubjectTaken(n)];case 1:if(i.sent())throw Error("New subject name is already taken: ".concat(n));return t.setSubject(n),this.addResources(t),this.resources.set(n,t),this.removeResource(r),[2]}})})},e.prototype.setAgent=function(t){var n=this;this.agent=t,t&&t.subject?(X5(this.serverUrl,t),this.webSockets.forEach(function(r){r.readyState===r.OPEN&&mk(r,n)}),this.resources.forEach(function(r){r.isUnauthorized()&&n.fetchResourceFromServer(r.getSubject())})):XT(),this.eventManager.emit(dr.AgentChanged,t)},e.prototype.setServerUrl=function(t){if(dn.tryValidSubject(t),t.substring(-1)==="/")throw Error("baseUrl should not have a trailing slash");this.serverUrl=t,Om()&&this.openWebSocket(t)},e.prototype.openWebSocket=function(t){if(Om()){if(this.webSockets.has(t))return;this.webSockets.set(t,U3(t,this))}else console.warn("WebSockets not supported, no window available")},e.prototype.subscribe=function(t,n){if(t===void 0)throw Error("Cannot subscribe to undefined subject");var r=this.subscribers.get(t);r===void 0&&(this.subscribeWebSocket(t),r=[]),r.push(n),this.subscribers.set(t,r)},e.prototype.subscribeWebSocket=function(t){if(t!==Li)try{var n=this.getWebSocketForSubject(t);(n==null?void 0:n.readyState)===1&&(n==null||n.send("SUBSCRIBE ".concat(t)))}catch(r){console.error(r)}},e.prototype.unSubscribeWebSocket=function(t){var n;if(t!==Li)try{(n=this.getDefaultWebSocket())===null||n===void 0||n.send("UNSUBSCRIBE ".concat(t))}catch(r){console.error(r)}},e.prototype.unsubscribe=function(t,n){if(t!==void 0){var r=this.subscribers.get(t);r&&(r=r==null?void 0:r.filter(function(i){return i!==n}),this.subscribers.set(t,r))}},e.prototype.on=function(t,n){return this.eventManager.register(t,n)},e.prototype.uploadFiles=function(t,n){return Bn(this,void 0,void 0,function(){var r,i;return Fn(this,function(o){switch(o.label){case 0:if(r=this.getAgent(),!r)throw Error("No agent set, cannot upload files");return[4,this.client.uploadFiles(t,this.getServerUrl(),r,n)];case 1:return i=o.sent(),this.addResources.apply(this,Im([],kc(i),!1)),[2,i.map(function(a){return a.getSubject()})]}})})},e.prototype.postCommit=function(t,n){return Bn(this,void 0,void 0,function(){return Fn(this,function(r){return[2,this.client.postCommit(t,n)]})})},e.prototype.getResourceAncestry=function(t){return Bn(this,void 0,void 0,function(){var n,r,i;return Fn(this,function(o){switch(o.label){case 0:n=[t.getSubject()],r=t.get(J.properties.parent),r&&n.push(r),o.label=1;case 1:return r?[4,this.getResourceAsync(r)]:[3,3];case 2:if(i=o.sent(),i){if(r=i.get(J.properties.parent),n.includes(r))throw new Error("Resource ".concat(t.getSubject()," ancestry is cyclical. ").concat(r," is already in the ancestry}"));n.push(r)}return[3,1];case 3:return[2,n]}})})},e.prototype.randomPart=function(){return Math.random().toString(36).substring(2)},e.prototype.findAvailableSubject=function(t,n){return n===void 0&&(n=!0),Bn(this,void 0,void 0,function(){var r,i,o;return Fn(this,function(a){switch(a.label){case 0:return r="".concat(this.getServerUrl(),"/").concat(t),n||(i=this.randomPart(),r+="-".concat(i)),[4,this.checkSubjectTaken(r)];case 1:return o=a.sent(),o?[2,this.findAvailableSubject(t,!1)]:[2,r]}})})},e}(),fI=function(){function e(){}return e}(),hI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function _l(e){if(e===void 0)throw new Error("Not an array: ".concat(e,", is ").concat(typeof e));if(e.constructor===Array)return e;throw new Error("Not an array: ".concat(e,", is a ").concat(typeof e))}function pI(e){if(typeof e!="boolean")throw new Error("Not a boolean: ".concat(e,", is a ").concat(typeof e));return e}function vk(e){if(typeof e=="number"){var t=new Date(0);return t.setUTCMilliseconds(e),t}if(typeof e=="string")return new Date(e.toString());throw new Error("Cannot be converted into Date: ".concat(e,", is a ").concat(typeof e))}function mI(e){if(typeof e!="number")throw new Error("Not a number: ".concat(e,", is a ").concat(typeof e));return e}function W0(e){var t;return(t=e==null?void 0:e.toString())!==null&&t!==void 0?t:"undefined"}function gI(e){if(typeof e=="string")return e;if(e instanceof Date)throw new Error("Not a resource: ".concat(e,", is a Date"));if((e==null?void 0:e.constructor)===Array)throw new Error("Not a resource: ".concat(e,", is an Array"));if(typeof e=="object"){var t=new pa,n=hI(t.parseObject(e,"nested-resource"),1),r=n[0];return r}throw typeof e!="object"?new Error("Not a resource: ".concat(e,", is a ").concat(typeof e)):new Error("Not a resource: ".concat(e,", is a ").concat(typeof e))}var Ue={agent:"https://atomicdata.dev/classes/Agent",chatRoom:"https://atomicdata.dev/classes/ChatRoom",collection:"https://atomicdata.dev/classes/Collection",commit:"https://atomicdata.dev/classes/Commit",class:"https://atomicdata.dev/classes/Class",document:"https://atomicdata.dev/classes/Document",bookmark:"https://atomicdata.dev/class/Bookmark",elements:{paragraph:"https://atomicdata.dev/classes/elements/Paragraph"},error:"https://atomicdata.dev/classes/Error",property:"https://atomicdata.dev/classes/Property",datatype:"https://atomicdata.dev/classes/Datatype",endpoint:"https://atomicdata.dev/classes/Endpoint",drive:"https://atomicdata.dev/classes/Drive",redirect:"https://atomicdata.dev/classes/Redirect",invite:"https://atomicdata.dev/classes/Invite",file:"https://atomicdata.dev/classes/File",message:"https://atomicdata.dev/classes/Message",importer:"https://atomicdata.dev/classes/Importer",folder:"https://atomicdata.dev/classes/Folder",article:"https://atomicdata.dev/classes/Article",displayStyle:"https://atomicdata.dev/class/DisplayStyle",displayStyles:{grid:"https://atomicdata.dev/display-style/grid",list:"https://atomicdata.dev/display-style/list"}},G={children:"https://atomicdata.dev/properties/children",classType:"https://atomicdata.dev/properties/classtype",createdBy:"https://atomicdata.dev/properties/createdBy",datatype:"https://atomicdata.dev/properties/datatype",description:"https://atomicdata.dev/properties/description",drives:"https://atomicdata.dev/properties/drives",incomplete:"https://atomicdata.dev/properties/incomplete",isA:"https://atomicdata.dev/properties/isA",isDynamic:"https://atomicdata.dev/properties/isDynamic",name:"https://atomicdata.dev/properties/name",parent:"https://atomicdata.dev/properties/parent",paymentPointer:"https://atomicdata.dev/properties/paymentPointer",read:"https://atomicdata.dev/properties/read",recommends:"https://atomicdata.dev/properties/recommends",requires:"https://atomicdata.dev/properties/requires",shortname:"https://atomicdata.dev/properties/shortname",subResources:"https://atomicdata.dev/properties/subresources",write:"https://atomicdata.dev/properties/write",displayStyle:"https://atomicdata.dev/property/display-style",publishedAt:"https://atomicdata.dev/properties/published-at",agent:{publicKey:"https://atomicdata.dev/properties/publicKey"},collection:{members:"https://atomicdata.dev/properties/collection/members",currentPage:"https://atomicdata.dev/properties/collection/currentPage",pageSize:"https://atomicdata.dev/properties/collection/pageSize",property:"https://atomicdata.dev/properties/collection/property",totalMembers:"https://atomicdata.dev/properties/collection/totalMembers",totalPages:"https://atomicdata.dev/properties/collection/totalPages",value:"https://atomicdata.dev/properties/collection/value"},commit:{subject:"https://atomicdata.dev/properties/subject",createdAt:"https://atomicdata.dev/properties/createdAt",lastCommit:"https://atomicdata.dev/properties/lastCommit",previousCommit:"https://atomicdata.dev/properties/previousCommit",signer:"https://atomicdata.dev/properties/signer",set:"https://atomicdata.dev/properties/set",push:"https://atomicdata.dev/properties/push",remove:"https://atomicdata.dev/properties/remove",destroy:"https://atomicdata.dev/properties/destroy",signature:"https://atomicdata.dev/properties/signature"},document:{elements:"https://atomicdata.dev/properties/documents/elements"},endpoint:{parameters:"https://atomicdata.dev/properties/endpoint/parameters",results:"https://atomicdata.dev/properties/endpoint/results"},search:{query:"https://atomicdata.dev/properties/search/query",limit:"https://atomicdata.dev/properties/search/limit",property:"https://atomicdata.dev/properties/search/property"},redirect:{destination:"https://atomicdata.dev/properties/destination",redirectAgent:"https://atomicdata.dev/properties/invite/redirectAgent"},invite:{agent:"https://atomicdata.dev/properties/invite/agent",publicKey:"https://atomicdata.dev/properties/invite/publicKey",target:"https://atomicdata.dev/properties/invite/target",usagesLeft:"https://atomicdata.dev/properties/invite/usagesLeft",users:"https://atomicdata.dev/properties/invite/users",write:"https://atomicdata.dev/properties/invite/write"},file:{filename:"https://atomicdata.dev/properties/filename",filesize:"https://atomicdata.dev/properties/filesize",downloadUrl:"https://atomicdata.dev/properties/downloadURL",mimetype:"https://atomicdata.dev/properties/mimetype",attachments:"https://atomicdata.dev/properties/attachments"},chatRoom:{messages:"https://atomicdata.dev/properties/messages",nextPage:"https://atomicdata.dev/properties/nextPage",replyTo:"https://atomicdata.dev/properties/replyTo"},bookmark:{url:"https://atomicdata.dev/property/url",preview:"https://atomicdata.dev/property/preview",imageUrl:"https://atomicdata.dev/properties/imageUrl"}},V0={atomicUrl:"https://atomicdata.dev/datatypes/atomicURL",boolean:"https://atomicdata.dev/datatypes/boolean",date:"https://atomicdata.dev/datatypes/date",float:"https://atomicdata.dev/datatypes/float",integer:"https://atomicdata.dev/datatypes/integer",markdown:"https://atomicdata.dev/datatypes/markdown",resourceArray:"https://atomicdata.dev/datatypes/resourceArray",slug:"https://atomicdata.dev/datatypes/slug",string:"https://atomicdata.dev/datatypes/string",timestamp:"https://atomicdata.dev/datatypes/timestamp"},yk={publicAgent:"https://atomicdata.dev/agents/publicAgent",displayStyleGrid:"https://atomicdata.dev/agents/publicAgent"},vI={import:"/import"},J={properties:G,endpoints:vI,classes:Ue,datatypes:V0,instances:yk};function bk(e,t,n){var r=e.replace(/(^\w+:|^)\/\//,"");if(typeof window<"u"&&(window!=null&&window.location)&&r.startsWith(window.location.hostname)&&(r=r.slice(window.location.hostname.length)),r.length<=t)return r;if(n){var i=r.length-t;return"..."+r.slice(i)}return r.slice(0,t)+"..."}var wk=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},Sk=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},W3=globalThis&&globalThis.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Ce(e,t){e===void 0&&(e=Li);var n=Ke(),r=Cn(w.useState(n.getResourceLoading(e,t)),2),i=r[0],o=r[1];return w.useEffect(function(){o(n.getResourceLoading(e,t))},[e,n]),w.useEffect(function(){function a(s){o(s)}if(e)return n.subscribe(e,a),function(){n.unsubscribe(e,a)}},[n,e]),i}function cf(e,t){t===void 0&&(t={});var n=Cn(w.useState(new Map),2),r=n[0],i=n[1],o=Ke();return w.useEffect(function(){function a(s){i(function(u){return u.set(s.getSubject(),s),new Map(u)})}return i(function(s){var u,l;try{for(var c=W3(e),h=c.next();!h.done;h=c.next()){var p=h.value,y=o.getResourceLoading(p,t);s.set(p,y),o.subscribe(p,a)}}catch(g){u={error:g}}finally{try{h&&!h.done&&(l=c.return)&&l.call(c)}finally{if(u)throw u.error}}return new Map(s)}),function(){var s,u;try{for(var l=W3(e),c=l.next();!c.done;c=l.next()){var h=c.value;o.unsubscribe(h,a)}}catch(p){s={error:p}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}}},[e,o]),r}function Ou(e){var t=Ce(e);if(t.loading)return{subject:e,datatype:Ie.UNKNOWN,shortname:"loading",description:"Loading property ".concat(e),loading:!0};if(t.error)return{subject:e,datatype:Ie.UNKNOWN,shortname:"error",description:"Error getting Property. "+t.error.message,error:t.error};var n=t.get(J.properties.datatype),r=ck(n),i=t.get(J.properties.shortname),o=t.get(J.properties.description),a=t.get(J.properties.classType),s=!!t.get(J.properties.isDynamic),u={subject:e,datatype:r,shortname:i,description:o,classType:a,isDynamic:s};return u}function xa(e,t,n){var r=this;n===void 0&&(n={});var i=n.commit,o=i===void 0?!1:i,a=n.validate,s=a===void 0?!0:a,u=n.commitDebounce,l=u===void 0?100:u,c=n.handleValidationError,h=Cn(w.useState(void 0),2),p=h[0],y=h[1],g=Ke(),b=iu(p,l),_=Cn(w.useState(!1),2),S=_[0],k=_[1];w.useEffect(function(){o&&S&&(k(!1),e.save(g,g.getAgent()).catch(function(v){return g.notifyError(v)}))},[JSON.stringify(b)]);var C=w.useCallback(function(v){return wk(r,void 0,void 0,function(){var m;return Sk(this,function(x){switch(x.label){case 0:if(v===void 0)return e.removePropVal(t),y(void 0),[2];y(v),k(!0),x.label=1;case 1:return x.trys.push([1,3,,4]),[4,e.set(t,v,g,s)];case 2:return x.sent(),c==null||c(void 0),g.notify(e.clone()),[3,4];case 3:return m=x.sent(),c?c(m):g.notifyError(m),[3,4];case 4:return[2]}})})},[e,c,g,s]);if(p!==void 0)return[p,C];var d=void 0;try{d=e.get(t),e.getSubject().startsWith("http://localhost/sear")&&console.error("useValue",p,e.getSubject())}catch(v){g.notifyError(v)}return d===void 0?[void 0,C]:[d,C]}function ye(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return typeof i=="string"?[i,o]:i===void 0?[void 0,o]:[W0(i),o]}var kk="error:no_support_for_editing_nested_resources_yet";function Po(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return i?typeof i=="string"?[i,o]:[kk,o]:[void 0,o]}var yI={commit:!0};function Xe(e,t,n){t===void 0&&(t=40),n===void 0&&(n=yI);var r=Cn(ye(e,J.properties.name,n),2),i=r[0],o=r[1],a=Cn(ye(e,J.properties.shortname,n),2),s=a[0],u=a[1],l=Cn(ye(e,J.properties.file.filename,n),2),c=l[0],h=l[1];if(e.loading)return["...",o];if(i!==void 0)return[i,o];if(s!==void 0)return[s,u];if(c!==void 0)return[c,h];var p=e==null?void 0:e.getSubject();return typeof p=="string"&&p.length>0?[bk(p,t),o]:[p,o]}function it(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1],a=w.useRef([]),s=w.useMemo(function(){if(i===void 0)return a.current;try{return _l(i)}catch(u){return console.error(u,i,t,e.getSubject()),a.current}},[i]);return[s,o]}function ru(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return i===void 0?[NaN,o]:[mI(i),o]}function xk(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return i===void 0?[!1,o]:[pI(i),o]}function bI(e,t,n){var r=Ke(),i=Cn(xa(e,t,n),1),o=i[0];if(o!==void 0)try{return vk(o)}catch(a){r.notifyError(a);return}}function Ke(){var e=de.useContext(Ck);if(e===void 0)throw new Error("Store is not found in react context. Have you wrapped your application in ``?");return e}function Wi(e,t){var n=Ke(),r=Cn(w.useState(!1),2),i=r[0],o=r[1],a=Cn(w.useState(void 0),2),s=a[0],u=a[1],l=n.getAgent();return w.useEffect(function(){if(t===void 0&&(t=l==null?void 0:l.subject),t===void 0){u("No Agent set"),o(!1);return}if(e.new){o(!0);return}u("Checking write rights...");function c(){return wk(this,void 0,void 0,function(){var h,p,y;return Sk(this,function(g){switch(g.label){case 0:return[4,e.canWrite(n,t)];case 1:return h=Cn.apply(void 0,[g.sent(),2]),p=h[0],y=h[1],o(p),u(p?void 0:"You don't have write rights in this resource or its parents: "+y),[2]}})})}c()},[e,t,l==null?void 0:l.subject]),[i,s]}var Ck=de.createContext(new gk),wI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},iy=function(){var e=Ke(),t=wI(yi("serverUrl",e.getServerUrl()),2),n=t[0],r=t[1],i=w.useCallback(function(o){if(o){var a="https://atomicdata.dev";dn.isValidSubject(o)?a=o:e.notifyError(new Error("Invalid base URL: ".concat(o,", defaulting to atomicdata.dev"))),r(a),e.setServerUrl(a)}},[e]);return[n,i]},_k=function(){var e=Ke(),t=w.useCallback(function(r){return e.on(dr.AgentChanged,r)},[e]),n=w.useSyncExternalStore(t,e.getAgent);return[n,e.setAgent]},SI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ek=function(e){var t=Ke(),n=e.getChildrenCollection(),r=Ce(n),i=SI(it(r,G.collection.members),1),o=i[0];return w.useEffect(function(){t.fetchResourceFromServer(n)},[t]),o},kI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function iu(e,t){var n=kI(w.useState(e),2),r=n[0],i=n[1];return w.useEffect(function(){var o=setTimeout(function(){i(e)},t);return function(){clearTimeout(o)}},[e,t]),r}var xI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function yi(e,t){var n=xI(w.useState(function(){try{var a=window.localStorage.getItem(e);return a==="undefined"?t:a?JSON.parse(a):t}catch(s){return console.error("Error finding ".concat(e," in localStorage:"),s),t}}),2),r=n[0],i=n[1],o=w.useCallback(function(a){try{var s=a instanceof Function?a(r):a;i(s),window.localStorage.setItem(e,JSON.stringify(s))}catch(u){console.error(u)}},[r,e]);return[r,o]}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;globalThis&&globalThis.__asyncValues;globalThis&&globalThis.__read;var Lm=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},CI=[];function Rk(e,t){var n;t===void 0&&(t={});var r=t.debounce,i=r===void 0?50:r,o=Lm(w.useState([]),2),a=o[0],s=o[1],u=Lm(iy(),1),l=u[0],c=(n=iu(e,i))!==null&&n!==void 0?n:"",h=w.useMemo(function(){return rI(l,c,t)},[c,t,l]),p=Ce(h,{noWebSocket:!0}),y=Lm(it(p,J.properties.endpoint.results),1),g=y[0];return w.useEffect(function(){!p.loading&&g&&s(g)},[g==null?void 0:g.toString(),p.loading]),e?{results:a,loading:p.loading,error:p.error}:{results:CI,loading:!1,error:void 0}}var ou={},_I={get exports(){return ou},set exports(e){ou=e}},ft={};/** +`)}var r,i,o,a;return iP(this,function(s){switch(s.label){case 0:return[4,Promise.all(e.getSubjects(G.requires).map(function(u){return t.getProperty(u)}))];case 1:return r=s.sent(),[4,Promise.all(e.getSubjects(G.recommends).map(function(u){return t.getProperty(u)}))];case 2:return i=s.sent(),o=e.get(G.shortname),a="interface ".concat(o,` { +`),r.forEach(function(u){a=a.concat(n(u,!0))}),i.forEach(function(u){a=a.concat(n(u,!1))}),a=a.concat("}"),[2,a]}})})}function aP(e){switch(e){case Ie.ATOMIC_URL:return"string | Resource";case Ie.BOOLEAN:return"boolean";case Ie.DATE:return"string";case Ie.FLOAT:return"number";case Ie.INTEGER:return"number";case Ie.MARKDOWN:return"string";case Ie.RESOURCEARRAY:return"string[] | Resource[]";case Ie.SLUG:return"string";case Ie.STRING:return"string";case Ie.TIMESTAMP:return"number";case Ie.UNKNOWN:return"unknown"}}var lf={},sP={get exports(){return lf},set exports(e){lf=e}};(function(e,t){var n=typeof self<"u"?self:Zn,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function u(j){return j&&DataView.prototype.isPrototypeOf(j)}if(s.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(j){return j&&l.indexOf(Object.prototype.toString.call(j))>-1};function h(j){if(typeof j!="string"&&(j=String(j)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(j))throw new TypeError("Invalid character in header field name");return j.toLowerCase()}function p(j){return typeof j!="string"&&(j=String(j)),j}function y(j){var F={next:function(){var R=j.shift();return{done:R===void 0,value:R}}};return s.iterable&&(F[Symbol.iterator]=function(){return F}),F}function g(j){this.map={},j instanceof g?j.forEach(function(F,R){this.append(R,F)},this):Array.isArray(j)?j.forEach(function(F){this.append(F[0],F[1])},this):j&&Object.getOwnPropertyNames(j).forEach(function(F){this.append(F,j[F])},this)}g.prototype.append=function(j,F){j=h(j),F=p(F);var R=this.map[j];this.map[j]=R?R+", "+F:F},g.prototype.delete=function(j){delete this.map[h(j)]},g.prototype.get=function(j){return j=h(j),this.has(j)?this.map[j]:null},g.prototype.has=function(j){return this.map.hasOwnProperty(h(j))},g.prototype.set=function(j,F){this.map[h(j)]=p(F)},g.prototype.forEach=function(j,F){for(var R in this.map)this.map.hasOwnProperty(R)&&j.call(F,this.map[R],R,this)},g.prototype.keys=function(){var j=[];return this.forEach(function(F,R){j.push(R)}),y(j)},g.prototype.values=function(){var j=[];return this.forEach(function(F){j.push(F)}),y(j)},g.prototype.entries=function(){var j=[];return this.forEach(function(F,R){j.push([R,F])}),y(j)},s.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function b(j){if(j.bodyUsed)return Promise.reject(new TypeError("Already read"));j.bodyUsed=!0}function _(j){return new Promise(function(F,R){j.onload=function(){F(j.result)},j.onerror=function(){R(j.error)}})}function S(j){var F=new FileReader,R=_(F);return F.readAsArrayBuffer(j),R}function k(j){var F=new FileReader,R=_(F);return F.readAsText(j),R}function C(j){for(var F=new Uint8Array(j),R=new Array(F.length),q=0;q-1?F:j}function A(j,F){F=F||{};var R=F.body;if(j instanceof A){if(j.bodyUsed)throw new TypeError("Already read");this.url=j.url,this.credentials=j.credentials,F.headers||(this.headers=new g(j.headers)),this.method=j.method,this.mode=j.mode,this.signal=j.signal,!R&&j._bodyInit!=null&&(R=j._bodyInit,j.bodyUsed=!0)}else this.url=String(j);if(this.credentials=F.credentials||this.credentials||"same-origin",(F.headers||!this.headers)&&(this.headers=new g(F.headers)),this.method=x(F.method||this.method||"GET"),this.mode=F.mode||this.mode||null,this.signal=F.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&R)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(R)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})};function D(j){var F=new FormData;return j.trim().split("&").forEach(function(R){if(R){var q=R.split("="),$=q.shift().replace(/\+/g," "),K=q.join("=").replace(/\+/g," ");F.append(decodeURIComponent($),decodeURIComponent(K))}}),F}function P(j){var F=new g,R=j.replace(/\r?\n[\t ]+/g," ");return R.split(/\r?\n/).forEach(function(q){var $=q.split(":"),K=$.shift().trim();if(K){var ee=$.join(":").trim();F.append(K,ee)}}),F}v.call(A.prototype);function L(j,F){F||(F={}),this.type="default",this.status=F.status===void 0?200:F.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in F?F.statusText:"OK",this.headers=new g(F.headers),this.url=F.url||"",this._initBody(j)}v.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},L.error=function(){var j=new L(null,{status:0,statusText:""});return j.type="error",j};var W=[301,302,303,307,308];L.redirect=function(j,F){if(W.indexOf(F)===-1)throw new RangeError("Invalid status code");return new L(null,{status:F,headers:{location:j}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(F,R){this.message=F,this.name=R;var q=Error(F);this.stack=q.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function U(j,F){return new Promise(function(R,q){var $=new A(j,F);if($.signal&&$.signal.aborted)return q(new a.DOMException("Aborted","AbortError"));var K=new XMLHttpRequest;function ee(){K.abort()}K.onload=function(){var N={status:K.status,statusText:K.statusText,headers:P(K.getAllResponseHeaders()||"")};N.url="responseURL"in K?K.responseURL:N.headers.get("X-Request-URL");var I="response"in K?K.response:K.responseText;R(new L(I,N))},K.onerror=function(){q(new TypeError("Network request failed"))},K.ontimeout=function(){q(new TypeError("Network request failed"))},K.onabort=function(){q(new a.DOMException("Aborted","AbortError"))},K.open($.method,$.url,!0),$.credentials==="include"?K.withCredentials=!0:$.credentials==="omit"&&(K.withCredentials=!1),"responseType"in K&&s.blob&&(K.responseType="blob"),$.headers.forEach(function(N,I){K.setRequestHeader(I,N)}),$.signal&&($.signal.addEventListener("abort",ee),K.onreadystatechange=function(){K.readyState===4&&$.signal.removeEventListener("abort",ee)}),K.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return U.polyfill=!0,o.fetch||(o.fetch=U,o.Headers=g,o.Request=A,o.Response=L),a.Headers=g,a.Request=A,a.Response=L,a.fetch=U,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(sP,lf);const lP=nh(lf);var U0=globalThis&&globalThis.__assign||function(){return U0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},uP=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r"u")throw new dr("No fetch available, If the current environment doesn't have a fetch implementation you can pass one yourself.");return n},enumerable:!1,configurable:!0}),e.tryValidSubject=function(t){try{new URL(t)}catch(n){throw new Error("Not a valid URL: ".concat(t,". ").concat(n))}},e.isValidSubject=function(t){if(typeof t!="string")return!1;try{return e.tryValidSubject(t),!0}catch{return!1}},e.removeQueryParamsFromURL=function(t){return t==null?void 0:t.split("?")[0]},e.prototype.setFetch=function(t){this.__fetchOverride=t},e.prototype.fetchResourceHTTP=function(t,n){return n===void 0&&(n={}),Sm(this,void 0,void 0,function(){var r,i,o,a,s,u,l,c,h,p,y,g,b,_,S,k;return km(this,function(C){switch(C.label){case 0:r=n.signInfo,i=n.from,o=n.body,a=[],s=new pa,u=new xi(t),C.label=1;case 1:return C.trys.push([1,7,,8]),e.tryValidSubject(t),l={},l.Accept=cP,r?t.startsWith(window.location.origin)?(tP()||ak(r.serverURL,r.agent),[3,4]):[3,2]:[3,4];case 2:return[4,H0(t,r.agent,l)];case 3:C.sent(),C.label=4;case 4:return c=t,i!==void 0&&(h=new URL("".concat(i,"/path")),h.searchParams.set("path",t),c=h.href),[4,this.fetch(c,{headers:l,method:o?"POST":"GET",body:o})];case 5:return p=C.sent(),[4,p.text()];case 6:if(y=C.sent(),p.status===200)try{g=JSON.parse(y),n.noNested?u=g:(b=xm(s.parseObject(g,t),2),_=b[0],S=b[1],u=_,a.push.apply(a,uP([],xm(S),!1)))}catch(d){throw new dr("Could not parse JSON from fetching ".concat(t,". Is it an Atomic Data resource? Error message: ").concat(d.message))}else throw p.status===401?new dr(y,ti.Unauthorized):p.status===500?new dr(y,ti.Server):p.status===404?new dr(y,ti.NotFound):new dr(y);return[3,8];case 7:return k=C.sent(),u.setError(k),a=[u],console.error(t,k),[3,8];case 8:return u.loading=!1,[2,{resource:u,createdResources:a}]}})})},e.prototype.postCommit=function(t,n){return Sm(this,void 0,void 0,function(){var r,i,o,a,s;return km(this,function(u){switch(u.label){case 0:r=gk(U0({},t)),i=new Headers,i.set("Content-Type","application/ad+json"),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.fetch(n,{headers:i,method:"POST",body:r})];case 2:return o=u.sent(),[3,4];case 3:throw a=u.sent(),new dr("Posting Commit to ".concat(n," failed: ").concat(a));case 4:return[4,o.text()];case 5:if(s=u.sent(),o.status!==200)throw new dr(s,ti.Server);return[2,yk(s)]}})})},e.prototype.uploadFiles=function(t,n,r,i){return Sm(this,void 0,void 0,function(){var o,a,s,u,l,c,h,p,y,g;return km(this,function(b){switch(b.label){case 0:return o=new pa,a=new FormData,t.map(function(_){a.append("assets",_,_.name)}),s=new URL("".concat(n,"/upload")),s.searchParams.set("parent",i),[4,H0(s.toString(),r,{})];case 1:return u=b.sent(),l={method:"POST",body:a,headers:u},[4,this.fetch(s.toString(),l)];case 2:return c=b.sent(),[4,c.text()];case 3:if(h=b.sent(),c.status!==200)throw Error(h);return p=JSON.parse(h),y=xm(o.parseArray(p),1),g=y[0],[2,g]}})})},e}();const sk={},Ine=Object.freeze(Object.defineProperty({__proto__:null,default:sk},Symbol.toStringTag,{value:"Module"}));/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const ln=BigInt(0),Ze=BigInt(1),On=BigInt(2),lk=BigInt(255),j3=On**BigInt(252)+BigInt("27742317777372353535851937790883648493"),Tt={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:On**lk-BigInt(19),l:j3,n:j3,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")},uk=On**BigInt(256),_l=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742");const dP=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),fP=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),hP=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),pP=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class pt{constructor(t,n,r,i){this.x=t,this.y=n,this.z=r,this.t=i}static fromAffine(t){if(!(t instanceof tn))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return t.equals(tn.ZERO)?pt.ZERO:new pt(t.x,t.y,Ze,oe(t.x*t.y))}static toAffineBatch(t){const n=vP(t.map(r=>r.z));return t.map((r,i)=>r.toAffine(n[i]))}static normalizeZ(t){return this.toAffineBatch(t).map(this.fromAffine)}equals(t){B3(t);const{x:n,y:r,z:i}=this,{x:o,y:a,z:s}=t,u=oe(n*s),l=oe(o*i),c=oe(r*s),h=oe(a*i);return u===l&&c===h}negate(){return new pt(oe(-this.x),this.y,this.z,oe(-this.t))}double(){const{x:t,y:n,z:r}=this,{a:i}=Tt,o=oe(t**On),a=oe(n**On),s=oe(On*oe(r**On)),u=oe(i*o),l=oe(oe((t+n)**On)-o-a),c=u+a,h=c-s,p=u-a,y=oe(l*h),g=oe(c*p),b=oe(l*p),_=oe(h*c);return new pt(y,g,_,b)}add(t){B3(t);const{x:n,y:r,z:i,t:o}=this,{x:a,y:s,z:u,t:l}=t,c=oe((r-n)*(s+a)),h=oe((r+n)*(s-a)),p=oe(h-c);if(p===ln)return this.double();const y=oe(i*On*l),g=oe(o*On*u),b=g+y,_=h+c,S=g-y,k=oe(b*p),C=oe(_*S),d=oe(b*S),v=oe(p*_);return new pt(k,C,v,d)}subtract(t){return this.add(t.negate())}precomputeWindow(t){const n=1+256/t,r=[];let i=this,o=i;for(let a=0;a>=h,g>u&&(g-=c,t+=Ze),g===0){let b=i[y];p%2&&(b=b.negate()),a=a.add(b)}else{let b=i[y+Math.abs(g)-1];g<0&&(b=b.negate()),o=o.add(b)}}return pt.normalizeZ([o,a])[0]}multiply(t,n){return this.wNAF(uf(t,Tt.l),n)}multiplyUnsafe(t){let n=uf(t,Tt.l,!1);const r=pt.BASE,i=pt.ZERO;if(n===ln)return i;if(this.equals(i)||n===Ze)return this;if(this.equals(r))return this.wNAF(n);let o=i,a=this;for(;n>ln;)n&Ze&&(o=o.add(a)),a=a.double(),n>>=Ze;return o}isSmallOrder(){return this.multiplyUnsafe(Tt.h).equals(pt.ZERO)}isTorsionFree(){return this.multiplyUnsafe(Tt.l).equals(pt.ZERO)}toAffine(t=bh(this.z)){const{x:n,y:r,z:i}=this,o=oe(n*t),a=oe(r*t);if(oe(i*t)!==Ze)throw new Error("invZ was invalid");return new tn(o,a)}fromRistrettoBytes(){_m()}toRistrettoBytes(){_m()}fromRistrettoHash(){_m()}}pt.BASE=new pt(Tt.Gx,Tt.Gy,Ze,oe(Tt.Gx*Tt.Gy));pt.ZERO=new pt(ln,Ze,Ze,ln);function B3(e){if(!(e instanceof pt))throw new TypeError("ExtendedPoint expected")}function Cm(e){if(!(e instanceof Dr))throw new TypeError("RistrettoPoint expected")}function _m(){throw new Error("Legacy method: switch to RistrettoPoint")}class Dr{constructor(t){this.ep=t}static calcElligatorRistrettoMap(t){const{d:n}=Tt,r=oe(_l*t*t),i=oe((r+Ze)*hP);let o=BigInt(-1);const a=oe((o-n*r)*oe(r+n));let{isValid:s,value:u}=ty(i,a),l=oe(u*t);ao(l)||(l=oe(-l)),s||(u=l),s||(o=r);const c=oe(o*(r-Ze)*pP-a),h=u*u,p=oe((u+u)*a),y=oe(c*dP),g=oe(Ze-h),b=oe(Ze+h);return new pt(oe(p*b),oe(g*y),oe(y*b),oe(p*g))}static hashToCurve(t){t=ha(t,64);const n=Em(t.slice(0,32)),r=this.calcElligatorRistrettoMap(n),i=Em(t.slice(32,64)),o=this.calcElligatorRistrettoMap(i);return new Dr(r.add(o))}static fromHex(t){t=ha(t,32);const{a:n,d:r}=Tt,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",o=Em(t);if(!bP(tu(o),t)||ao(o))throw new Error(i);const a=oe(o*o),s=oe(Ze+n*a),u=oe(Ze-n*a),l=oe(s*s),c=oe(u*u),h=oe(n*r*l-c),{isValid:p,value:y}=F3(oe(h*c)),g=oe(y*u),b=oe(y*g*h);let _=oe((o+o)*g);ao(_)&&(_=oe(-_));const S=oe(s*b),k=oe(_*S);if(!p||ao(k)||S===ln)throw new Error(i);return new Dr(new pt(_,S,Ze,k))}toRawBytes(){let{x:t,y:n,z:r,t:i}=this.ep;const o=oe(oe(r+n)*oe(r-n)),a=oe(t*n),{value:s}=F3(oe(o*a**On)),u=oe(s*o),l=oe(s*a),c=oe(u*l*i);let h;if(ao(i*c)){let y=oe(n*_l),g=oe(t*_l);t=y,n=g,h=oe(u*fP)}else h=l;ao(t*c)&&(n=oe(-n));let p=oe((r-n)*h);return ao(p)&&(p=oe(-p)),tu(p)}toHex(){return Iu(this.toRawBytes())}toString(){return this.toHex()}equals(t){Cm(t);const n=this.ep,r=t.ep,i=oe(n.x*r.y)===oe(n.y*r.x),o=oe(n.y*r.y)===oe(n.x*r.x);return i||o}add(t){return Cm(t),new Dr(this.ep.add(t.ep))}subtract(t){return Cm(t),new Dr(this.ep.subtract(t.ep))}multiply(t){return new Dr(this.ep.multiply(t))}multiplyUnsafe(t){return new Dr(this.ep.multiplyUnsafe(t))}}Dr.BASE=new Dr(pt.BASE);Dr.ZERO=new Dr(pt.ZERO);const V0=new WeakMap;class tn{constructor(t,n){this.x=t,this.y=n}_setWindowSize(t){this._WINDOW_SIZE=t,V0.delete(this)}static fromHex(t,n=!0){const{d:r,P:i}=Tt;t=ha(t,32);const o=t.slice();o[31]=t[31]&-129;const a=Es(o);if(n&&a>=i)throw new Error("Expected 0 < hex < P");if(!n&&a>=uk)throw new Error("Expected 0 < hex < 2**256");const s=oe(a*a),u=oe(s-Ze),l=oe(r*s+Ze);let{isValid:c,value:h}=ty(u,l);if(!c)throw new Error("Point.fromHex: invalid y coordinate");const p=(h&Ze)===Ze;return(t[31]&128)!==0!==p&&(h=oe(-h)),new tn(h,a)}static async fromPrivateKey(t){return(await wh(t)).point}toRawBytes(){const t=tu(this.y);return t[31]|=this.x&Ze?128:0,t}toHex(){return Iu(this.toRawBytes())}toX25519(){const{y:t}=this,n=oe((Ze+t)*bh(Ze-t));return tu(n)}isTorsionFree(){return pt.fromAffine(this).isTorsionFree()}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new tn(oe(-this.x),this.y)}add(t){return pt.fromAffine(this).add(pt.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return pt.fromAffine(this).multiply(t,this).toAffine()}}tn.BASE=new tn(Tt.Gx,Tt.Gy);tn.ZERO=new tn(ln,Ze);class ey{constructor(t,n){this.r=t,this.s=n,this.assertValidity()}static fromHex(t){const n=ha(t,64),r=tn.fromHex(n.slice(0,32),!1),i=Es(n.slice(32,64));return new ey(r,i)}assertValidity(){const{r:t,s:n}=this;if(!(t instanceof tn))throw new Error("Expected Point instance");return uf(n,Tt.l,!1),this}toRawBytes(){const t=new Uint8Array(64);return t.set(this.r.toRawBytes()),t.set(tu(this.s),32),t}toHex(){return Iu(this.toRawBytes())}}function mP(...e){if(!e.every(r=>r instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rt.toString(16).padStart(2,"0"));function Iu(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let n=0;n=ln?n:t+n}function bh(e,t=Tt.P){if(e===ln||t<=ln)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=oe(e,t),r=t,i=ln,o=Ze;for(;n!==ln;){const s=r/n,u=r%n,l=i-o*s;r=n,n=u,i=o,o=l}if(r!==Ze)throw new Error("invert: does not exist");return oe(i,t)}function vP(e,t=Tt.P){const n=new Array(e.length),r=e.reduce((o,a,s)=>a===ln?o:(n[s]=o,oe(o*a,t)),Ze),i=bh(r,t);return e.reduceRight((o,a,s)=>a===ln?o:(n[s]=oe(o*n[s],t),oe(o*a,t)),i),n}function fi(e,t){const{P:n}=Tt;let r=e;for(;t-- >ln;)r*=r,r%=n;return r}function yP(e){const{P:t}=Tt,n=BigInt(5),r=BigInt(10),i=BigInt(20),o=BigInt(40),a=BigInt(80),u=e*e%t*e%t,l=fi(u,On)*u%t,c=fi(l,Ze)*e%t,h=fi(c,n)*c%t,p=fi(h,r)*h%t,y=fi(p,i)*p%t,g=fi(y,o)*y%t,b=fi(g,a)*g%t,_=fi(b,a)*g%t,S=fi(_,r)*h%t;return{pow_p_5_8:fi(S,On)*e%t,b2:u}}function ty(e,t){const n=oe(t*t*t),r=oe(n*n*t),i=yP(e*r).pow_p_5_8;let o=oe(e*n*i);const a=oe(t*o*o),s=o,u=oe(o*_l),l=a===e,c=a===oe(-e),h=a===oe(-e*_l);return l&&(o=s),(c||h)&&(o=u),ao(o)&&(o=oe(-o)),{isValid:l||c,value:o}}function F3(e){return ty(Ze,e)}async function $3(...e){const t=await Rs.sha512(mP(...e)),n=Es(t);return oe(n,Tt.l)}function bP(e,t){if(e.length!==t.length)return!1;for(let n=0;n{if(e=ha(e),e.length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const t=oe(Es(e),Tt.l);if(t===ln||t===Ze)throw new Error("Invalid private key");return t},randomBytes:(e=32)=>{if(to.web)return to.web.getRandomValues(new Uint8Array(e));if(to.node){const{randomBytes:t}=to.node;return new Uint8Array(t(e).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Rs.randomBytes(32),sha512:async e=>{if(to.web){const t=await to.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(t)}else{if(to.node)return Uint8Array.from(to.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(e=8,t=tn.BASE){const n=t.equals(tn.BASE)?t:new tn(t.x,t.y);return n._setWindowSize(e),n.multiply(On),n}};var kP=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var n=typeof t.cycles=="boolean"?t.cycles:!1,r=t.cmp&&function(o){return function(a){return function(s,u){var l={key:s,value:a[s]},c={key:u,value:a[u]};return o(l,c)}}}(t.cmp),i=[];return function o(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var s,u;if(Array.isArray(a)){for(u="[",s=0;s"u"?[]:new Uint8Array(256);for(var bc=0;bc>2],i+=Qa[(t[n]&3)<<4|t[n+1]>>4],i+=Qa[(t[n+1]&15)<<2|t[n+2]>>6],i+=Qa[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},hk=function(e){var t=e.length*.75,n=e.length,r,i=0,o,a,s,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var l=new ArrayBuffer(t),c=new Uint8Array(l);for(r=0;r>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|u&63;return l};/*! noble-hashes - MIT License (c) 2021 Paul Miller (paulmillr.com) */const Rm=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),CP=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!CP)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));(()=>{const e=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);try{if(e){const{setImmediate:t}=e("timers");return()=>new Promise(n=>t(n))}}catch{}return()=>new Promise(t=>setTimeout(t,0))})();function _P(e){if(typeof e!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}function pk(e){if(typeof e=="string"&&(e=_P(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}class EP{clone(){return this._cloneInto()}}function ny(e){const t=r=>e().update(pk(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t.init=t.create,t}function RP(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),s=Number(n&o),u=r?4:0,l=r?0:4;e.setUint32(t+u,a,r),e.setUint32(t+l,s,r)}class AP extends EP{constructor(t,n,r,i){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Rm(this.buffer)}update(t){if(this.destroyed)throw new Error("instance is destroyed");const{view:n,buffer:r,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");t=pk(t);const a=t.length;for(let s=0;si-a&&(this.process(r,0),a=0);for(let u=a;us.setUint32(4*l,u,o))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:o,destroyed:a,pos:s}=this;return t.length=i,t.pos=s,t.finished=o,t.destroyed=a,i%n&&t.buffer.set(r),t}}const wc=BigInt(2**32-1),H3=BigInt(32);function TP(e,t=!1){return t?{h:Number(e&wc),l:Number(e>>H3&wc)}:{h:Number(e>>H3&wc)|0,l:Number(e&wc)|0}}function PP(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;ie>>>n,V3=(e,t,n)=>e<<32-n|t>>>n,Pa=(e,t,n)=>e>>>n|t<<32-n,Ia=(e,t,n)=>e<<32-n|t>>>n,Sc=(e,t,n)=>e<<64-n|t>>>n-32,kc=(e,t,n)=>e>>>n-32|t<<64-n;function Ai(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const IP=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),OP=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,LP=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),DP=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,NP=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),MP=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0,[zP,jP]=PP(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),no=new Uint32Array(80),ro=new Uint32Array(80);class ry extends AP{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:i,Ch:o,Cl:a,Dh:s,Dl:u,Eh:l,El:c,Fh:h,Fl:p,Gh:y,Gl:g,Hh:b,Hl:_}=this;return[t,n,r,i,o,a,s,u,l,c,h,p,y,g,b,_]}set(t,n,r,i,o,a,s,u,l,c,h,p,y,g,b,_){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=l|0,this.El=c|0,this.Fh=h|0,this.Fl=p|0,this.Gh=y|0,this.Gl=g|0,this.Hh=b|0,this.Hl=_|0}process(t,n){for(let C=0;C<16;C++,n+=4)no[C]=t.getUint32(n),ro[C]=t.getUint32(n+=4);for(let C=16;C<80;C++){const d=no[C-15]|0,v=ro[C-15]|0,m=Pa(d,v,1)^Pa(d,v,8)^U3(d,v,7),x=Ia(d,v,1)^Ia(d,v,8)^V3(d,v,7),A=no[C-2]|0,D=ro[C-2]|0,P=Pa(A,D,19)^Sc(A,D,61)^U3(A,D,6),L=Ia(A,D,19)^kc(A,D,61)^V3(A,D,6),W=LP(x,L,ro[C-7],ro[C-16]),U=DP(W,m,P,no[C-7],no[C-16]);no[C]=U|0,ro[C]=W|0}let{Ah:r,Al:i,Bh:o,Bl:a,Ch:s,Cl:u,Dh:l,Dl:c,Eh:h,El:p,Fh:y,Fl:g,Gh:b,Gl:_,Hh:S,Hl:k}=this;for(let C=0;C<80;C++){const d=Pa(h,p,14)^Pa(h,p,18)^Sc(h,p,41),v=Ia(h,p,14)^Ia(h,p,18)^kc(h,p,41),m=h&y^~h&b,x=p&g^~p&_,A=NP(k,v,x,jP[C],ro[C]),D=MP(A,S,d,m,zP[C],no[C]),P=A|0,L=Pa(r,i,28)^Sc(r,i,34)^Sc(r,i,39),W=Ia(r,i,28)^kc(r,i,34)^kc(r,i,39),U=r&o^r&s^o&s,j=i&a^i&u^a&u;S=b|0,k=_|0,b=y|0,_=g|0,y=h|0,g=p|0,{h,l:p}=Ai(l|0,c|0,D|0,P|0),l=s|0,c=u|0,s=o|0,u=a|0,o=r|0,a=i|0;const F=IP(P,W,j);r=OP(F,D,L,U),i=F|0}({h:r,l:i}=Ai(this.Ah|0,this.Al|0,r|0,i|0)),{h:o,l:a}=Ai(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Ai(this.Ch|0,this.Cl|0,s|0,u|0),{h:l,l:c}=Ai(this.Dh|0,this.Dl|0,l|0,c|0),{h,l:p}=Ai(this.Eh|0,this.El|0,h|0,p|0),{h:y,l:g}=Ai(this.Fh|0,this.Fl|0,y|0,g|0),{h:b,l:_}=Ai(this.Gh|0,this.Gl|0,b|0,_|0),{h:S,l:k}=Ai(this.Hh|0,this.Hl|0,S|0,k|0),this.set(r,i,o,a,s,u,l,c,h,p,y,g,b,_,S,k)}roundClean(){no.fill(0),ro.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class BP extends ry{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class FP extends ry{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const mk=ny(()=>new ry);ny(()=>new BP);ny(()=>new FP);var Yo=globalThis&&globalThis.__assign||function(){return Yo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fr=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ea=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0||this.push.size>0||this.destroy||this.remove.size>0},e.prototype.clone=function(){var t={set:this.set,push:this.push,remove:this.remove,destroy:this.destroy,previousCommit:this.previousCommit};return new e(this.subject,structuredClone(t))},e.prototype.toPlainObject=function(){return{subject:this.subject,set:Object.fromEntries(this.set.entries()),push:Object.fromEntries(Array.from(this.push.entries()).map(function(t){var n=fr(t,2),r=n[0],i=n[1];return[r,Array.from(i)]})),remove:Array.from(this.remove),destroy:this.destroy,previousCommit:this.previousCommit}},e.prototype.signAt=function(t,n,r){return nu(this,void 0,void 0,function(){var i,o,a,s;return ru(this,function(u){switch(u.label){case 0:if(t===void 0)throw new Error("No agent passed to sign commit");return i=Yo(Yo({},this.clone().toPlainObject()),{createdAt:r,signer:t}),o=gk(Yo({},i)),[4,vk(o,n)];case 1:return a=u.sent(),s=Yo(Yo({},i),{signature:a}),[2,s]}})})},e}();function Ti(e,t,n){t in e&&t!==n&&(Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(e,t)),delete e[t])}function gk(e){return e.remove&&Object.keys(e.remove).length===0&&delete e.remove,e.set&&Object.keys(e.set).length===0&&delete e.set,e.push&&Object.keys(e.push).length===0&&delete e.push,e.destroy===!1&&delete e.destroy,Ti(e,"createdAt",Q.properties.commit.createdAt),Ti(e,"subject",Q.properties.commit.subject),Ti(e,"set",Q.properties.commit.set),Ti(e,"push",Q.properties.commit.push),Ti(e,"signer",Q.properties.commit.signer),Ti(e,"signature",Q.properties.commit.signature),Ti(e,"remove",Q.properties.commit.remove),Ti(e,"destroy",Q.properties.commit.destroy),Ti(e,"previousCommit",Q.properties.commit.previousCommit),e[Q.properties.isA]=[Q.classes.commit],xP(e)}var vk=function(e,t){return nu(void 0,void 0,void 0,function(){var n,r,i,o,a,s;return ru(this,function(u){switch(u.label){case 0:return n=hk(t),r=new Uint8Array(n),i=new TextEncoder,o=i.encode(e),[4,SP(o,r)];case 1:return a=u.sent(),s=cf(a),[2,s]}})})},$P=function(e){return nu(void 0,void 0,void 0,function(){var t,n,r,i;return ru(this,function(o){switch(o.label){case 0:return t=hk(e),n=new Uint8Array(t),[4,fk(n)];case 1:return r=o.sent(),i=cf(r),[2,i]}})})};function HP(){return nu(this,void 0,void 0,function(){var e,t,n,r;return ru(this,function(i){switch(i.label){case 0:return e=Rs.randomPrivateKey(),[4,fk(e)];case 1:return t=i.sent(),n=cf(e),r=cf(t),[2,{publicKey:r,privateKey:n}]}})})}function UP(e){var t={id:e.getSubject(),subject:e.get(Q.properties.commit.subject),set:e.get(Q.properties.commit.set),push:e.get(Q.properties.commit.push),signer:e.get(Q.properties.commit.signer),createdAt:e.get(Q.properties.commit.createdAt),remove:e.get(Q.properties.commit.remove),destroy:e.get(Q.properties.commit.destroy),signature:e.get(Q.properties.commit.signature)};return t}function yk(e){try{var t=JSON.parse(e);if(typeof t!="object")throw new Error("Commit is not an object");var n=t[Q.properties.commit.subject],r=t[Q.properties.commit.set],i=t[Q.properties.commit.push],o=t[Q.properties.commit.signer],a=t[Q.properties.commit.createdAt],s=t[Q.properties.commit.remove],u=t[Q.properties.commit.destroy],l=t[Q.properties.commit.signature],c=t["@id"],h=t[Q.properties.commit.previousCommit];if(!l)throw new Error("Commit has no signature");return{subject:n,set:r,push:i,signer:o,createdAt:a,remove:s,destroy:u,signature:l,id:c,previousCommit:h}}catch(p){throw new Error("Could not parse commit: ".concat(p,", Commit: ").concat(e))}}function bk(e,t){var n=t.set,r=t.remove,i=t.push;return n&&WP(n,e),r&&qP(r,e),i&&KP(i,e),e}function VP(e,t){var n=yk(e),r=n.subject,i=n.id,o=n.destroy,a=n.signature,s=t.resources.get(r);if(!s)s=new xi(r);else if(s.appliedCommitSignatures.has(a))return;if(s=bk(s,n),i&&s.setUnsafe(G.commit.lastCommit,i),o){t.removeResource(r);return}else s.appliedCommitSignatures.add(a),t.addResources(s)}function WP(e,t,n){var r,i,o=new pa,a=[],s=function(y,g){var b=g;if((g==null?void 0:g.constructor)==={}.constructor){var _=fr(o.parseValue(g,y),2),S=_[0],k=_[1];b=S,a.push.apply(a,ea([],fr(k),!1))}iy(g)&&(b=g.map(function(C){var d=fr(o.parseValue(C,y),2),v=d[0],m=d[1];return a.push.apply(a,ea([],fr(m),!1)),v})),t.setUnsafe(y,b)};try{for(var u=Sh(Object.entries(e)),l=u.next();!l.done;l=u.next()){var c=fr(l.value,2),h=c[0],p=c[1];s(h,p)}}catch(y){r={error:y}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}n&&n.addResources.apply(n,ea([],fr(a),!1))}function qP(e,t){var n,r;try{for(var i=Sh(e),o=i.next();!o.done;o=i.next()){var a=o.value;t.removePropValLocally(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function KP(e,t,n){var r,i,o=new pa,a=[],s=function(y,g){var b=t.get(y)||[],_=g,S=_.map(function(C){var d=fr(o.parseValue(C,y),2),v=d[0],m=d[1];return a.push.apply(a,ea([],fr(m),!1)),v}),k=ea(ea([],fr(b),!1),fr(S),!1);t.setUnsafe(y,k)};try{for(var u=Sh(Object.entries(e)),l=u.next();!l.done;l=u.next()){var c=fr(l.value,2),h=c[0],p=c[1];s(h,p)}}catch(y){r={error:y}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}n&&n.addResources.apply(n,ea([],fr(a),!1))}var GP=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ti;(function(e){e.Unauthorized="Unauthorized",e.NotFound="NotFound",e.Server="Server",e.Client="Client"})(ti||(ti={}));function wk(e){if(e instanceof dr){if(e.type===ti.Unauthorized)return!0;if(e.message.includes("Unauthorized"))return!0}return!1}var dr=function(e){GP(t,e);function t(n,r){r===void 0&&(r=ti.Client);var i=e.call(this,n)||this;Object.setPrototypeOf(i,t.prototype),i.type=r,i.message=n;try{var o=JSON.parse(n),a=o[G.description];a&&(i.message=a)}catch{}return i.message||(i.message=i.createMessage()),i}return t.fromResource=function(n){var r=new t(n.get(G.description).toString());return r},t.prototype.createMessage=function(){switch(this.type){case ti.Unauthorized:return"You don't have the rights to do this.";case ti.NotFound:return"404 Not found.";case ti.Server:return"500 Unknown server error.";default:return"Unknown error."}},t}(Error),YP=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},XP=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},JP=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ZP=function(e,t){var n,r,i=new URL(e);try{for(var o=QP(Object.entries(t)),a=o.next();!a.done;a=o.next()){var s=JP(a.value,2),u=s[0],l=s[1];i.searchParams.set(u,l)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i.toString()};function eI(e){if(e.error)throw e.error;return xi}function tI(e,t,n){return YP(this,void 0,void 0,function(){var r,i;return XP(this,function(o){switch(o.label){case 0:return r=ZP(e.getServerUrl()+Q.endpoints.import,{parent:n.parent,"overwrite-outside":n.overwriteOutside?"true":"false"}),i=eI,[4,e.postToServer(r,t)];case 1:return[2,i.apply(void 0,[o.sent()])]}})})}var Ie;(function(e){e.ATOMIC_URL="https://atomicdata.dev/datatypes/atomicURL",e.BOOLEAN="https://atomicdata.dev/datatypes/boolean",e.DATE="https://atomicdata.dev/datatypes/date",e.FLOAT="https://atomicdata.dev/datatypes/float",e.INTEGER="https://atomicdata.dev/datatypes/integer",e.MARKDOWN="https://atomicdata.dev/datatypes/markdown",e.RESOURCEARRAY="https://atomicdata.dev/datatypes/resourceArray",e.SLUG="https://atomicdata.dev/datatypes/slug",e.STRING="https://atomicdata.dev/datatypes/string",e.TIMESTAMP="https://atomicdata.dev/datatypes/timestamp",e.UNKNOWN="unknown-datatype"})(Ie||(Ie={}));var Sk=function(e){switch(e){case Q.datatypes.atomicUrl:return Ie.ATOMIC_URL;case Q.datatypes.boolean:return Ie.BOOLEAN;case Q.datatypes.date:return Ie.DATE;case Q.datatypes.float:return Ie.FLOAT;case Q.datatypes.integer:return Ie.INTEGER;case Q.datatypes.markdown:return Ie.MARKDOWN;case Q.datatypes.resourceArray:return Ie.RESOURCEARRAY;case Q.datatypes.slug:return Ie.SLUG;case Q.datatypes.string:return Ie.STRING;case Q.datatypes.timestamp:return Ie.TIMESTAMP;default:return Ie.UNKNOWN}},nI=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,rI=/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/,iI=function(e,t){var n=null;if(e===void 0)throw new Error("Value is undefined, expected ".concat(t));switch(t){case Ie.STRING:{if(!Ja(e)){n="Not a string";break}break}case Ie.SLUG:{if(!Ja(e)){n="Not a slug, not even a string";break}e.match(nI)===null&&(n="Not a valid slug. Only lowercase letters and numbers with dashes `-` between them");break}case Ie.ATOMIC_URL:{if(!Ja(e)){n="Not a string. Should be a URL";break}dn.tryValidSubject(e);break}case Ie.RESOURCEARRAY:{if(!iy(e)){n="Not an array";break}e.map(function(r,i){try{dn.tryValidSubject(r)}catch{var o=new Error("Invalid URL");throw o.index=i,o}});break}case Ie.INTEGER:{if(!oI(e)){n="Not a number";break}e%1!==0&&(n="Not an integer");break}case Ie.DATE:{if(!Ja(e)){n="Not a string";break}e.match(rI)===null&&(n="Not a date string: YYYY-MM-DD");break}}if(n!==null)throw new Error(n)};function iy(e){return Object.prototype.toString.call(e)==="[object Array]"}function Ja(e){return typeof e=="string"}function oI(e){return typeof e=="number"}var xc=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Tm=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pa=function(){function e(){this.parsedResources=[]}return e.prototype.parseObject=function(t,n){this.parsedResources=[];var r=this.parseJsonADResource(t,n);return[r,Tm([],xc(this.parsedResources),!1)]},e.prototype.parseArray=function(t){this.parsedResources=[];var n=this.parseJsonADArray(t);return[n,Tm([],xc(this.parsedResources),!1)]},e.prototype.parseValue=function(t,n){this.parsedResources=[];var r=this.parseJsonAdResourceValue(t,n);return[r,Tm([],xc(this.parsedResources),!1)]},e.prototype.parseJsonADResource=function(t,n){var r,i,o=this;n===void 0&&(n=Di);var a=new xi(n);this.parsedResources.push(a);try{var s=function(g,b){if(g==="@id"){if(typeof b!="string")throw new Error("'@id' field must be a string");if(a.getSubject()!=="undefined"&&a.getSubject()!==Di&&b!==a.getSubject())throw new Error("Resource has wrong subject in @id. Received subject was ".concat(b,", expected ").concat(a.getSubject(),"."));return a.setSubject(b),"continue"}try{if(iy(b)){var _=b.map(function(d){return o.parseJsonAdResourceValue(d,g)});a.setUnsafe(g,_)}else if(typeof b=="string")a.setUnsafe(g,b);else if(typeof b=="number")a.setUnsafe(g,b);else if(typeof b=="boolean")a.setUnsafe(g,b);else{var S=u.parseJsonAdResourceValue(b,g);a.setUnsafe(g,S)}}catch(d){var k="Failed creating value ".concat(b," for key ").concat(g," in resource ").concat(a.getSubject()),C="".concat(k,". ").concat(d.message);throw new Error(C)}},u=this;try{for(var l=W3(Object.entries(t)),c=l.next();!c.done;c=l.next()){var h=xc(c.value,2),p=h[0],y=h[1];s(p,y)}}catch(g){r={error:g}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}a.loading=!1,a.hasClasses(Q.classes.error)&&(a.error=dr.fromResource(a))}catch(g){throw g.message="Failed parsing JSON "+g.message,a.setError(g),a.loading=!1,g}return a},e.prototype.parseJsonAdResourceValue=function(t,n){if(typeof t=="string")return t;if((t==null?void 0:t.constructor)==={}.constructor)if(Object.keys(t).includes("@id")){var r=t["@id"];return this.parseJsonADResource(t),r}else return t;throw new Error("Value ".concat(t," in ").concat(n," not a string or a nested Resource"))},e.prototype.parseJsonADArray=function(t){var n,r,i=[];try{try{for(var o=W3(t),a=o.next();!a.done;a=o.next()){var s=a.value,u=this.parseJsonADResource(s);i.push(u)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}catch(l){throw l.message="Failed parsing JSON "+l.message,l}return i},e}(),aI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},sI=["+","^","`",":","{","}",'"',"[","]","(",")","!","\\","*"," ","."];function lI(e){return e.replace(new RegExp("([".concat(sI.join("\\"),"])"),"g"),"\\$1")}function uI(e){return Object.entries(e).map(function(t){var n=aI(t,2),r=n[0],i=n[1];return i&&i.length>0&&"".concat(lI(r),':"').concat(i,'"')}).join(" AND ")}function cI(e,t,n){n===void 0&&(n={});var r=n.include,i=r===void 0?!1:r,o=n.limit,a=o===void 0?30:o,s=n.scope,u=n.filters,l=new URL(e);l.pathname="search",t&&l.searchParams.set("q",t),i&&l.searchParams.set("include",i.toString()),a&&l.searchParams.set("limit",a.toString());var c=u&&Object.keys(u).length>0&&Object.values(u).filter(function(h){return h&&h.length>0}).length>0;return c&&l.searchParams.set("filters",uI(u)),s&&l.searchParams.set("parent",s),l.toString()}var Oa=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},La=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pm=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Im=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Y3=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ck=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},pI=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Cc=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Om=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r"u"?!1:!(!((t=window==null?void 0:window.navigator)===null||t===void 0)&&t.onLine)},e.prototype.notify=function(t){return Fn(this,void 0,void 0,function(){var n,r,i=this;return $n(this,function(o){return n=t.getSubject(),r=this.subscribers.get(n),r===void 0?[2]:(Promise.allSettled(r.map(function(a){return Fn(i,void 0,void 0,function(){return $n(this,function(s){return[2,a(t)]})})})),[2])})})},e.prototype.notifyResourceSaved=function(t){this.eventManager.emit(hr.ResourceSaved,t)},e.prototype.notifyResourceManuallyCreated=function(t){this.eventManager.emit(hr.ResourceManuallyCreated,t)},e.prototype.parseMetaTags=function(){var t=this,n=document.querySelectorAll('meta[property="json-ad-initial"]'),r=new pa;n.forEach(function(i){var o=i.getAttribute("content");if(o!==null){var a=JSON.parse(atob(o)),s=Cc(r.parseObject(a),2);s[0];var u=s[1];t.addResources.apply(t,Om([],Cc(u),!1))}})},e.prototype.preloadPropsAndClasses=function(){return Fn(this,void 0,void 0,function(){var t,n;return $n(this,function(r){switch(r.label){case 0:return t=new URL("/classes",this.serverUrl),n=new URL("/properties",this.serverUrl),t.searchParams.set("include_external","true"),n.searchParams.set("include_external","true"),t.searchParams.set("include_nested","true"),n.searchParams.set("include_nested","true"),t.searchParams.set("page_size","999"),n.searchParams.set("page_size","999"),[4,Promise.all([this.fetchResourceFromServer(t.toString()),this.fetchResourceFromServer(n.toString())])];case 1:return r.sent(),[2]}})})},e.prototype.postToServer=function(t,n){return Fn(this,void 0,void 0,function(){return $n(this,function(r){return[2,this.fetchResourceFromServer(t,{body:n,noWebSocket:!0,method:"POST"})]})})},e.prototype.removeResource=function(t){var n=this.resources.get(t);this.resources.delete(t),n&&this.eventManager.emit(hr.ResourceRemoved,n)},e.prototype.renameSubject=function(t,n){return Fn(this,void 0,void 0,function(){var r;return $n(this,function(i){switch(i.label){case 0:return dn.tryValidSubject(n),r=t.getSubject(),[4,this.checkSubjectTaken(n)];case 1:if(i.sent())throw Error("New subject name is already taken: ".concat(n));return t.setSubject(n),this.addResources(t),this.resources.set(n,t),this.removeResource(r),[2]}})})},e.prototype.setAgent=function(t){var n=this;this.agent=t,t&&t.subject?(ak(this.serverUrl,t),this.webSockets.forEach(function(r){r.readyState===r.OPEN&&Ek(r,n)}),this.resources.forEach(function(r){r.isUnauthorized()&&n.fetchResourceFromServer(r.getSubject())})):nP(),this.eventManager.emit(hr.AgentChanged,t)},e.prototype.setServerUrl=function(t){if(dn.tryValidSubject(t),t.substring(-1)==="/")throw Error("baseUrl should not have a trailing slash");this.serverUrl=t,Lm()&&this.openWebSocket(t)},e.prototype.openWebSocket=function(t){if(Lm()){if(this.webSockets.has(t))return;this.webSockets.set(t,X3(t,this))}else console.warn("WebSockets not supported, no window available")},e.prototype.subscribe=function(t,n){if(t===void 0)throw Error("Cannot subscribe to undefined subject");var r=this.subscribers.get(t);r===void 0&&(this.subscribeWebSocket(t),r=[]),r.push(n),this.subscribers.set(t,r)},e.prototype.subscribeWebSocket=function(t){if(t!==Di)try{var n=this.getWebSocketForSubject(t);(n==null?void 0:n.readyState)===1&&(n==null||n.send("SUBSCRIBE ".concat(t)))}catch(r){console.error(r)}},e.prototype.unSubscribeWebSocket=function(t){var n;if(t!==Di)try{(n=this.getDefaultWebSocket())===null||n===void 0||n.send("UNSUBSCRIBE ".concat(t))}catch(r){console.error(r)}},e.prototype.unsubscribe=function(t,n){if(t!==void 0){var r=this.subscribers.get(t);r&&(r=r==null?void 0:r.filter(function(i){return i!==n}),this.subscribers.set(t,r))}},e.prototype.on=function(t,n){return this.eventManager.register(t,n)},e.prototype.uploadFiles=function(t,n){return Fn(this,void 0,void 0,function(){var r,i;return $n(this,function(o){switch(o.label){case 0:if(r=this.getAgent(),!r)throw Error("No agent set, cannot upload files");return[4,this.client.uploadFiles(t,this.getServerUrl(),r,n)];case 1:return i=o.sent(),this.addResources.apply(this,Om([],Cc(i),!1)),[2,i.map(function(a){return a.getSubject()})]}})})},e.prototype.postCommit=function(t,n){return Fn(this,void 0,void 0,function(){return $n(this,function(r){return[2,this.client.postCommit(t,n)]})})},e.prototype.getResourceAncestry=function(t){return Fn(this,void 0,void 0,function(){var n,r,i;return $n(this,function(o){switch(o.label){case 0:n=[t.getSubject()],r=t.get(Q.properties.parent),r&&n.push(r),o.label=1;case 1:return r?[4,this.getResourceAsync(r)]:[3,3];case 2:if(i=o.sent(),i){if(r=i.get(Q.properties.parent),n.includes(r))throw new Error("Resource ".concat(t.getSubject()," ancestry is cyclical. ").concat(r," is already in the ancestry}"));n.push(r)}return[3,1];case 3:return[2,n]}})})},e.prototype.randomPart=function(){return Math.random().toString(36).substring(2)},e.prototype.findAvailableSubject=function(t,n){return n===void 0&&(n=!0),Fn(this,void 0,void 0,function(){var r,i,o;return $n(this,function(a){switch(a.label){case 0:return r="".concat(this.getServerUrl(),"/").concat(t),n||(i=this.randomPart(),r+="-".concat(i)),[4,this.checkSubjectTaken(r)];case 1:return o=a.sent(),o?[2,this.findAvailableSubject(t,!1)]:[2,r]}})})},e}(),wI=function(){function e(){}return e}(),SI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function El(e){if(e===void 0)throw new Error("Not an array: ".concat(e,", is ").concat(typeof e));if(e.constructor===Array)return e;throw new Error("Not an array: ".concat(e,", is a ").concat(typeof e))}function kI(e){if(typeof e!="boolean")throw new Error("Not a boolean: ".concat(e,", is a ").concat(typeof e));return e}function Ak(e){if(typeof e=="number"){var t=new Date(0);return t.setUTCMilliseconds(e),t}if(typeof e=="string")return new Date(e.toString());throw new Error("Cannot be converted into Date: ".concat(e,", is a ").concat(typeof e))}function xI(e){if(typeof e!="number")throw new Error("Not a number: ".concat(e,", is a ").concat(typeof e));return e}function W0(e){var t;return(t=e==null?void 0:e.toString())!==null&&t!==void 0?t:"undefined"}function CI(e){if(typeof e=="string")return e;if(e instanceof Date)throw new Error("Not a resource: ".concat(e,", is a Date"));if((e==null?void 0:e.constructor)===Array)throw new Error("Not a resource: ".concat(e,", is an Array"));if(typeof e=="object"){var t=new pa,n=SI(t.parseObject(e,"nested-resource"),1),r=n[0];return r}throw typeof e!="object"?new Error("Not a resource: ".concat(e,", is a ").concat(typeof e)):new Error("Not a resource: ".concat(e,", is a ").concat(typeof e))}var He={agent:"https://atomicdata.dev/classes/Agent",chatRoom:"https://atomicdata.dev/classes/ChatRoom",collection:"https://atomicdata.dev/classes/Collection",commit:"https://atomicdata.dev/classes/Commit",class:"https://atomicdata.dev/classes/Class",document:"https://atomicdata.dev/classes/Document",bookmark:"https://atomicdata.dev/class/Bookmark",elements:{paragraph:"https://atomicdata.dev/classes/elements/Paragraph"},error:"https://atomicdata.dev/classes/Error",property:"https://atomicdata.dev/classes/Property",datatype:"https://atomicdata.dev/classes/Datatype",endpoint:"https://atomicdata.dev/classes/Endpoint",drive:"https://atomicdata.dev/classes/Drive",redirect:"https://atomicdata.dev/classes/Redirect",invite:"https://atomicdata.dev/classes/Invite",file:"https://atomicdata.dev/classes/File",message:"https://atomicdata.dev/classes/Message",importer:"https://atomicdata.dev/classes/Importer",folder:"https://atomicdata.dev/classes/Folder",article:"https://atomicdata.dev/classes/Article",displayStyle:"https://atomicdata.dev/class/DisplayStyle",displayStyles:{grid:"https://atomicdata.dev/display-style/grid",list:"https://atomicdata.dev/display-style/list"}},G={children:"https://atomicdata.dev/properties/children",classType:"https://atomicdata.dev/properties/classtype",createdBy:"https://atomicdata.dev/properties/createdBy",datatype:"https://atomicdata.dev/properties/datatype",description:"https://atomicdata.dev/properties/description",drives:"https://atomicdata.dev/properties/drives",incomplete:"https://atomicdata.dev/properties/incomplete",isA:"https://atomicdata.dev/properties/isA",isDynamic:"https://atomicdata.dev/properties/isDynamic",name:"https://atomicdata.dev/properties/name",parent:"https://atomicdata.dev/properties/parent",paymentPointer:"https://atomicdata.dev/properties/paymentPointer",read:"https://atomicdata.dev/properties/read",recommends:"https://atomicdata.dev/properties/recommends",requires:"https://atomicdata.dev/properties/requires",shortname:"https://atomicdata.dev/properties/shortname",subResources:"https://atomicdata.dev/properties/subresources",write:"https://atomicdata.dev/properties/write",displayStyle:"https://atomicdata.dev/property/display-style",publishedAt:"https://atomicdata.dev/properties/published-at",agent:{publicKey:"https://atomicdata.dev/properties/publicKey"},collection:{members:"https://atomicdata.dev/properties/collection/members",currentPage:"https://atomicdata.dev/properties/collection/currentPage",pageSize:"https://atomicdata.dev/properties/collection/pageSize",property:"https://atomicdata.dev/properties/collection/property",totalMembers:"https://atomicdata.dev/properties/collection/totalMembers",totalPages:"https://atomicdata.dev/properties/collection/totalPages",value:"https://atomicdata.dev/properties/collection/value"},commit:{subject:"https://atomicdata.dev/properties/subject",createdAt:"https://atomicdata.dev/properties/createdAt",lastCommit:"https://atomicdata.dev/properties/lastCommit",previousCommit:"https://atomicdata.dev/properties/previousCommit",signer:"https://atomicdata.dev/properties/signer",set:"https://atomicdata.dev/properties/set",push:"https://atomicdata.dev/properties/push",remove:"https://atomicdata.dev/properties/remove",destroy:"https://atomicdata.dev/properties/destroy",signature:"https://atomicdata.dev/properties/signature"},document:{elements:"https://atomicdata.dev/properties/documents/elements"},endpoint:{parameters:"https://atomicdata.dev/properties/endpoint/parameters",results:"https://atomicdata.dev/properties/endpoint/results"},search:{query:"https://atomicdata.dev/properties/search/query",limit:"https://atomicdata.dev/properties/search/limit",property:"https://atomicdata.dev/properties/search/property"},redirect:{destination:"https://atomicdata.dev/properties/destination",redirectAgent:"https://atomicdata.dev/properties/invite/redirectAgent"},invite:{agent:"https://atomicdata.dev/properties/invite/agent",publicKey:"https://atomicdata.dev/properties/invite/publicKey",target:"https://atomicdata.dev/properties/invite/target",usagesLeft:"https://atomicdata.dev/properties/invite/usagesLeft",users:"https://atomicdata.dev/properties/invite/users",write:"https://atomicdata.dev/properties/invite/write"},file:{filename:"https://atomicdata.dev/properties/filename",filesize:"https://atomicdata.dev/properties/filesize",downloadUrl:"https://atomicdata.dev/properties/downloadURL",mimetype:"https://atomicdata.dev/properties/mimetype",attachments:"https://atomicdata.dev/properties/attachments"},chatRoom:{messages:"https://atomicdata.dev/properties/messages",nextPage:"https://atomicdata.dev/properties/nextPage",replyTo:"https://atomicdata.dev/properties/replyTo"},bookmark:{url:"https://atomicdata.dev/property/url",preview:"https://atomicdata.dev/property/preview",imageUrl:"https://atomicdata.dev/properties/imageUrl"}},q0={atomicUrl:"https://atomicdata.dev/datatypes/atomicURL",boolean:"https://atomicdata.dev/datatypes/boolean",date:"https://atomicdata.dev/datatypes/date",float:"https://atomicdata.dev/datatypes/float",integer:"https://atomicdata.dev/datatypes/integer",markdown:"https://atomicdata.dev/datatypes/markdown",resourceArray:"https://atomicdata.dev/datatypes/resourceArray",slug:"https://atomicdata.dev/datatypes/slug",string:"https://atomicdata.dev/datatypes/string",timestamp:"https://atomicdata.dev/datatypes/timestamp"},Tk={publicAgent:"https://atomicdata.dev/agents/publicAgent",displayStyleGrid:"https://atomicdata.dev/agents/publicAgent"},_I={import:"/import"},Q={properties:G,endpoints:_I,classes:He,datatypes:q0,instances:Tk};function Pk(e,t,n){var r=e.replace(/(^\w+:|^)\/\//,"");if(typeof window<"u"&&(window!=null&&window.location)&&r.startsWith(window.location.hostname)&&(r=r.slice(window.location.hostname.length)),r.length<=t)return r;if(n){var i=r.length-t;return"..."+r.slice(i)}return r.slice(0,t)+"..."}var Ik=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},Ok=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},J3=globalThis&&globalThis.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Ce(e,t){e===void 0&&(e=Di);var n=We(),r=Cn(w.useState(n.getResourceLoading(e,t)),2),i=r[0],o=r[1];return w.useEffect(function(){o(n.getResourceLoading(e,t))},[e,n]),w.useEffect(function(){function a(s){o(s)}if(e)return n.subscribe(e,a),function(){n.unsubscribe(e,a)}},[n,e]),i}function ff(e,t){t===void 0&&(t={});var n=Cn(w.useState(new Map),2),r=n[0],i=n[1],o=We();return w.useEffect(function(){function a(s){i(function(u){return u.set(s.getSubject(),s),new Map(u)})}return i(function(s){var u,l;try{for(var c=J3(e),h=c.next();!h.done;h=c.next()){var p=h.value,y=o.getResourceLoading(p,t);s.set(p,y),o.subscribe(p,a)}}catch(g){u={error:g}}finally{try{h&&!h.done&&(l=c.return)&&l.call(c)}finally{if(u)throw u.error}}return new Map(s)}),function(){var s,u;try{for(var l=J3(e),c=l.next();!c.done;c=l.next()){var h=c.value;o.unsubscribe(h,a)}}catch(p){s={error:p}}finally{try{c&&!c.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}}},[e,o]),r}function Lu(e){var t=Ce(e);if(t.loading)return{subject:e,datatype:Ie.UNKNOWN,shortname:"loading",description:"Loading property ".concat(e),loading:!0};if(t.error)return{subject:e,datatype:Ie.UNKNOWN,shortname:"error",description:"Error getting Property. "+t.error.message,error:t.error};var n=t.get(Q.properties.datatype),r=Sk(n),i=t.get(Q.properties.shortname),o=t.get(Q.properties.description),a=t.get(Q.properties.classType),s=!!t.get(Q.properties.isDynamic),u={subject:e,datatype:r,shortname:i,description:o,classType:a,isDynamic:s};return u}function xa(e,t,n){var r=this;n===void 0&&(n={});var i=n.commit,o=i===void 0?!1:i,a=n.validate,s=a===void 0?!0:a,u=n.commitDebounce,l=u===void 0?100:u,c=n.handleValidationError,h=Cn(w.useState(void 0),2),p=h[0],y=h[1],g=We(),b=ou(p,l),_=Cn(w.useState(!1),2),S=_[0],k=_[1];w.useEffect(function(){o&&S&&(k(!1),e.save(g,g.getAgent()).catch(function(v){return g.notifyError(v)}))},[JSON.stringify(b)]);var C=w.useCallback(function(v){return Ik(r,void 0,void 0,function(){var m;return Ok(this,function(x){switch(x.label){case 0:if(v===void 0)return e.removePropVal(t),y(void 0),[2];y(v),k(!0),x.label=1;case 1:return x.trys.push([1,3,,4]),[4,e.set(t,v,g,s)];case 2:return x.sent(),c==null||c(void 0),g.notify(e.clone()),[3,4];case 3:return m=x.sent(),c?c(m):g.notifyError(m),[3,4];case 4:return[2]}})})},[e,c,g,s]);if(p!==void 0)return[p,C];var d=void 0;try{d=e.get(t),e.getSubject().startsWith("http://localhost/sear")&&console.error("useValue",p,e.getSubject())}catch(v){g.notifyError(v)}return d===void 0?[void 0,C]:[d,C]}function be(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return typeof i=="string"?[i,o]:i===void 0?[void 0,o]:[W0(i),o]}var Lk="error:no_support_for_editing_nested_resources_yet";function Io(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return i?typeof i=="string"?[i,o]:[Lk,o]:[void 0,o]}var EI={commit:!0};function qe(e,t,n){t===void 0&&(t=40),n===void 0&&(n=EI);var r=Cn(be(e,Q.properties.name,n),2),i=r[0],o=r[1],a=Cn(be(e,Q.properties.shortname,n),2),s=a[0],u=a[1],l=Cn(be(e,Q.properties.file.filename,n),2),c=l[0],h=l[1];if(e.loading)return["...",o];if(i!==void 0)return[i,o];if(s!==void 0)return[s,u];if(c!==void 0)return[c,h];var p=e==null?void 0:e.getSubject();return typeof p=="string"&&p.length>0?[Pk(p,t),o]:[p,o]}function it(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1],a=w.useRef([]),s=w.useMemo(function(){if(i===void 0)return a.current;try{return El(i)}catch(u){return console.error(u,i,t,e.getSubject()),a.current}},[i]);return[s,o]}function iu(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return i===void 0?[NaN,o]:[xI(i),o]}function Dk(e,t,n){var r=Cn(xa(e,t,n),2),i=r[0],o=r[1];return i===void 0?[!1,o]:[kI(i),o]}function RI(e,t,n){var r=We(),i=Cn(xa(e,t,n),1),o=i[0];if(o!==void 0)try{return Ak(o)}catch(a){r.notifyError(a);return}}function We(){var e=de.useContext(Nk);if(e===void 0)throw new Error("Store is not found in react context. Have you wrapped your application in ``?");return e}function Wi(e,t){var n=We(),r=Cn(w.useState(!1),2),i=r[0],o=r[1],a=Cn(w.useState(void 0),2),s=a[0],u=a[1],l=n.getAgent();return w.useEffect(function(){if(t===void 0&&(t=l==null?void 0:l.subject),t===void 0){u("No Agent set"),o(!1);return}if(e.new){o(!0);return}u("Checking write rights...");function c(){return Ik(this,void 0,void 0,function(){var h,p,y;return Ok(this,function(g){switch(g.label){case 0:return[4,e.canWrite(n,t)];case 1:return h=Cn.apply(void 0,[g.sent(),2]),p=h[0],y=h[1],o(p),u(p?void 0:"You don't have write rights in this resource or its parents: "+y),[2]}})})}c()},[e,t,l==null?void 0:l.subject]),[i,s]}var Nk=de.createContext(new Rk),AI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},oy=function(){var e=We(),t=AI(yi("serverUrl",e.getServerUrl()),2),n=t[0],r=t[1],i=w.useCallback(function(o){if(o){var a="https://atomicdata.dev";dn.isValidSubject(o)?a=o:e.notifyError(new Error("Invalid base URL: ".concat(o,", defaulting to atomicdata.dev"))),r(a),e.setServerUrl(a)}},[e]);return[n,i]},Mk=function(){var e=We(),t=w.useCallback(function(r){return e.on(hr.AgentChanged,r)},[e]),n=w.useSyncExternalStore(t,e.getAgent);return[n,e.setAgent]},TI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},zk=function(e){var t=We(),n=e.getChildrenCollection(),r=Ce(n),i=TI(it(r,G.collection.members),1),o=i[0];return w.useEffect(function(){t.fetchResourceFromServer(n)},[t]),o},PI=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function ou(e,t){var n=PI(w.useState(e),2),r=n[0],i=n[1];return w.useEffect(function(){var o=setTimeout(function(){i(e)},t);return function(){clearTimeout(o)}},[e,t]),r}var II=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function yi(e,t){var n=II(w.useState(function(){try{var a=window.localStorage.getItem(e);return a==="undefined"?t:a?JSON.parse(a):t}catch(s){return console.error("Error finding ".concat(e," in localStorage:"),s),t}}),2),r=n[0],i=n[1],o=w.useCallback(function(a){try{var s=a instanceof Function?a(r):a;i(s),window.localStorage.setItem(e,JSON.stringify(s))}catch(u){console.error(u)}},[r,e]);return[r,o]}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;globalThis&&globalThis.__asyncValues;globalThis&&globalThis.__read;var Dm=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},OI=[];function jk(e,t){var n;t===void 0&&(t={});var r=t.debounce,i=r===void 0?50:r,o=Dm(w.useState([]),2),a=o[0],s=o[1],u=Dm(oy(),1),l=u[0],c=(n=ou(e,i))!==null&&n!==void 0?n:"",h=w.useMemo(function(){return cI(l,c,t)},[c,t,l]),p=Ce(h,{noWebSocket:!0}),y=Dm(it(p,Q.properties.endpoint.results),1),g=y[0];return w.useEffect(function(){!p.loading&&g&&s(g)},[g==null?void 0:g.toString(),p.loading]),e?{results:a,loading:p.loading,error:p.error}:{results:OI,loading:!1,error:void 0}}var au={},LI={get exports(){return au},set exports(e){au=e}},ft={};/** * @license React * react-is.production.min.js * @@ -67,17 +67,17 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oy=Symbol.for("react.element"),ay=Symbol.for("react.portal"),wh=Symbol.for("react.fragment"),Sh=Symbol.for("react.strict_mode"),kh=Symbol.for("react.profiler"),xh=Symbol.for("react.provider"),Ch=Symbol.for("react.context"),EI=Symbol.for("react.server_context"),_h=Symbol.for("react.forward_ref"),Eh=Symbol.for("react.suspense"),Rh=Symbol.for("react.suspense_list"),Ah=Symbol.for("react.memo"),Th=Symbol.for("react.lazy"),RI=Symbol.for("react.offscreen"),Ak;Ak=Symbol.for("react.module.reference");function $r(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case oy:switch(e=e.type,e){case wh:case kh:case Sh:case Eh:case Rh:return e;default:switch(e=e&&e.$$typeof,e){case EI:case Ch:case _h:case Th:case Ah:case xh:return e;default:return t}}case ay:return t}}}ft.ContextConsumer=Ch;ft.ContextProvider=xh;ft.Element=oy;ft.ForwardRef=_h;ft.Fragment=wh;ft.Lazy=Th;ft.Memo=Ah;ft.Portal=ay;ft.Profiler=kh;ft.StrictMode=Sh;ft.Suspense=Eh;ft.SuspenseList=Rh;ft.isAsyncMode=function(){return!1};ft.isConcurrentMode=function(){return!1};ft.isContextConsumer=function(e){return $r(e)===Ch};ft.isContextProvider=function(e){return $r(e)===xh};ft.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===oy};ft.isForwardRef=function(e){return $r(e)===_h};ft.isFragment=function(e){return $r(e)===wh};ft.isLazy=function(e){return $r(e)===Th};ft.isMemo=function(e){return $r(e)===Ah};ft.isPortal=function(e){return $r(e)===ay};ft.isProfiler=function(e){return $r(e)===kh};ft.isStrictMode=function(e){return $r(e)===Sh};ft.isSuspense=function(e){return $r(e)===Eh};ft.isSuspenseList=function(e){return $r(e)===Rh};ft.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wh||e===kh||e===Sh||e===Eh||e===Rh||e===RI||typeof e=="object"&&e!==null&&(e.$$typeof===Th||e.$$typeof===Ah||e.$$typeof===xh||e.$$typeof===Ch||e.$$typeof===_h||e.$$typeof===Ak||e.getModuleId!==void 0)};ft.typeOf=$r;(function(e){e.exports=ft})(_I);const AI=eh(ou);function TI(e){function t(I,re,se,he,W){for(var ge=0,te=0,Oe=0,pe=0,Ne,xe,Ge=0,Ve=0,De,Ye=De=Ne=0,ae=0,Re=0,nt=0,ze=0,gt=se.length,zt=gt-1,wt,Ee="",rt="",tr="",Ht="",X;aeNe)&&(ze=(Ee=Ee.replace(" ",":")).length),0<$&&(X=s(1,Ee,re,I,H,V,rt.length,he,W,he))!==void 0&&(ze=(Ee=X.trim()).length)===0&&(Ee="\0\0"),Ne=Ee.charCodeAt(0),xe=Ee.charCodeAt(1),Ne){case 0:break;case 64:if(xe===105||xe===99){Ht+=Ee+se.charAt(ae);break}default:Ee.charCodeAt(ze-1)!==58&&(rt+=i(Ee,Ne,xe,Ee.charCodeAt(2)))}nt=Re=Ye=Ne=0,Ee="",xe=se.charCodeAt(++ae)}}switch(xe){case 13:case 10:te===47?te=0:1+Ne===0&&he!==107&&0he&&(he=(re=re.trim()).charCodeAt(0)),he){case 38:return re.replace(S,"$1"+I.trim());case 58:return I.trim()+re.replace(S,"$1"+I.trim());default:if(0<1*se&&0te.charCodeAt(8))break;case 115:W=W.replace(te,"-webkit-"+te)+";"+W;break;case 207:case 102:W=W.replace(te,"-webkit-"+(102se.charCodeAt(0)&&(se=se.trim()),D=se,se=[D],0<$){var he=s(-1,re,se,se,H,V,0,0,0,0);he!==void 0&&typeof he=="string"&&(re=he)}var W=t(R,se,re,0,0);return 0<$&&(he=s(-2,W,se,se,H,V,W.length,0,0,0),he!==void 0&&(W=he)),D="",j=0,V=H=1,W}var h=/^\0+/g,p=/[\0\r\f]/g,y=/: */g,g=/zoo|gra/,b=/([,: ])(transform)/g,_=/,\r+?/g,S=/([\t\r\n ])*\f?&/g,k=/@(k\w+)\s*(\S*)\s*/,C=/::(place)/g,d=/:(read-only)/g,v=/[svh]\w+-[tblr]{2}/,m=/\(\s*(.*)\s*\)/g,x=/([\s\S]*?);/g,A=/-self|flex-/g,L=/[^]*?(:[rp][el]a[\w-]+)[^]*/,P=/stretch|:\s*\w+\-(?:conte|avail)/,O=/([^-])(image-set\()/,V=1,H=1,j=0,F=1,R=[],q=[],$=0,K=null,ee=0,D="";return c.use=u,c.set=l,e!==void 0&&l(e),c}var PI={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function II(e){var t={};return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var OI=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,V3=II(function(e){return OI.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),q0={},LI={get exports(){return q0},set exports(e){q0=e}},ht={};/** @license React v16.13.1 + */var ay=Symbol.for("react.element"),sy=Symbol.for("react.portal"),kh=Symbol.for("react.fragment"),xh=Symbol.for("react.strict_mode"),Ch=Symbol.for("react.profiler"),_h=Symbol.for("react.provider"),Eh=Symbol.for("react.context"),DI=Symbol.for("react.server_context"),Rh=Symbol.for("react.forward_ref"),Ah=Symbol.for("react.suspense"),Th=Symbol.for("react.suspense_list"),Ph=Symbol.for("react.memo"),Ih=Symbol.for("react.lazy"),NI=Symbol.for("react.offscreen"),Bk;Bk=Symbol.for("react.module.reference");function Vr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ay:switch(e=e.type,e){case kh:case Ch:case xh:case Ah:case Th:return e;default:switch(e=e&&e.$$typeof,e){case DI:case Eh:case Rh:case Ih:case Ph:case _h:return e;default:return t}}case sy:return t}}}ft.ContextConsumer=Eh;ft.ContextProvider=_h;ft.Element=ay;ft.ForwardRef=Rh;ft.Fragment=kh;ft.Lazy=Ih;ft.Memo=Ph;ft.Portal=sy;ft.Profiler=Ch;ft.StrictMode=xh;ft.Suspense=Ah;ft.SuspenseList=Th;ft.isAsyncMode=function(){return!1};ft.isConcurrentMode=function(){return!1};ft.isContextConsumer=function(e){return Vr(e)===Eh};ft.isContextProvider=function(e){return Vr(e)===_h};ft.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ay};ft.isForwardRef=function(e){return Vr(e)===Rh};ft.isFragment=function(e){return Vr(e)===kh};ft.isLazy=function(e){return Vr(e)===Ih};ft.isMemo=function(e){return Vr(e)===Ph};ft.isPortal=function(e){return Vr(e)===sy};ft.isProfiler=function(e){return Vr(e)===Ch};ft.isStrictMode=function(e){return Vr(e)===xh};ft.isSuspense=function(e){return Vr(e)===Ah};ft.isSuspenseList=function(e){return Vr(e)===Th};ft.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kh||e===Ch||e===xh||e===Ah||e===Th||e===NI||typeof e=="object"&&e!==null&&(e.$$typeof===Ih||e.$$typeof===Ph||e.$$typeof===_h||e.$$typeof===Eh||e.$$typeof===Rh||e.$$typeof===Bk||e.getModuleId!==void 0)};ft.typeOf=Vr;(function(e){e.exports=ft})(LI);const MI=nh(au);function zI(e){function t(I,re,se,he,V){for(var ge=0,te=0,Oe=0,pe=0,Me,xe,Ye=0,Ke=0,De,Xe=De=Me=0,ae=0,Re=0,nt=0,ze=0,gt=se.length,jt=gt-1,wt,Ee="",rt="",rr="",Ut="",X;aeMe)&&(ze=(Ee=Ee.replace(" ",":")).length),0<$&&(X=s(1,Ee,re,I,U,W,rt.length,he,V,he))!==void 0&&(ze=(Ee=X.trim()).length)===0&&(Ee="\0\0"),Me=Ee.charCodeAt(0),xe=Ee.charCodeAt(1),Me){case 0:break;case 64:if(xe===105||xe===99){Ut+=Ee+se.charAt(ae);break}default:Ee.charCodeAt(ze-1)!==58&&(rt+=i(Ee,Me,xe,Ee.charCodeAt(2)))}nt=Re=Xe=Me=0,Ee="",xe=se.charCodeAt(++ae)}}switch(xe){case 13:case 10:te===47?te=0:1+Me===0&&he!==107&&0he&&(he=(re=re.trim()).charCodeAt(0)),he){case 38:return re.replace(S,"$1"+I.trim());case 58:return I.trim()+re.replace(S,"$1"+I.trim());default:if(0<1*se&&0te.charCodeAt(8))break;case 115:V=V.replace(te,"-webkit-"+te)+";"+V;break;case 207:case 102:V=V.replace(te,"-webkit-"+(102se.charCodeAt(0)&&(se=se.trim()),N=se,se=[N],0<$){var he=s(-1,re,se,se,U,W,0,0,0,0);he!==void 0&&typeof he=="string"&&(re=he)}var V=t(R,se,re,0,0);return 0<$&&(he=s(-2,V,se,se,U,W,V.length,0,0,0),he!==void 0&&(V=he)),N="",j=0,W=U=1,V}var h=/^\0+/g,p=/[\0\r\f]/g,y=/: */g,g=/zoo|gra/,b=/([,: ])(transform)/g,_=/,\r+?/g,S=/([\t\r\n ])*\f?&/g,k=/@(k\w+)\s*(\S*)\s*/,C=/::(place)/g,d=/:(read-only)/g,v=/[svh]\w+-[tblr]{2}/,m=/\(\s*(.*)\s*\)/g,x=/([\s\S]*?);/g,A=/-self|flex-/g,D=/[^]*?(:[rp][el]a[\w-]+)[^]*/,P=/stretch|:\s*\w+\-(?:conte|avail)/,L=/([^-])(image-set\()/,W=1,U=1,j=0,F=1,R=[],q=[],$=0,K=null,ee=0,N="";return c.use=u,c.set=l,e!==void 0&&l(e),c}var jI={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function BI(e){var t={};return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var FI=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Z3=BI(function(e){return FI.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),K0={},$I={get exports(){return K0},set exports(e){K0=e}},ht={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fn=typeof Symbol=="function"&&Symbol.for,sy=fn?Symbol.for("react.element"):60103,ly=fn?Symbol.for("react.portal"):60106,Ph=fn?Symbol.for("react.fragment"):60107,Ih=fn?Symbol.for("react.strict_mode"):60108,Oh=fn?Symbol.for("react.profiler"):60114,Lh=fn?Symbol.for("react.provider"):60109,Dh=fn?Symbol.for("react.context"):60110,uy=fn?Symbol.for("react.async_mode"):60111,Mh=fn?Symbol.for("react.concurrent_mode"):60111,Nh=fn?Symbol.for("react.forward_ref"):60112,zh=fn?Symbol.for("react.suspense"):60113,DI=fn?Symbol.for("react.suspense_list"):60120,jh=fn?Symbol.for("react.memo"):60115,Bh=fn?Symbol.for("react.lazy"):60116,MI=fn?Symbol.for("react.block"):60121,NI=fn?Symbol.for("react.fundamental"):60117,zI=fn?Symbol.for("react.responder"):60118,jI=fn?Symbol.for("react.scope"):60119;function br(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case sy:switch(e=e.type,e){case uy:case Mh:case Ph:case Oh:case Ih:case zh:return e;default:switch(e=e&&e.$$typeof,e){case Dh:case Nh:case Bh:case jh:case Lh:return e;default:return t}}case ly:return t}}}function Tk(e){return br(e)===Mh}ht.AsyncMode=uy;ht.ConcurrentMode=Mh;ht.ContextConsumer=Dh;ht.ContextProvider=Lh;ht.Element=sy;ht.ForwardRef=Nh;ht.Fragment=Ph;ht.Lazy=Bh;ht.Memo=jh;ht.Portal=ly;ht.Profiler=Oh;ht.StrictMode=Ih;ht.Suspense=zh;ht.isAsyncMode=function(e){return Tk(e)||br(e)===uy};ht.isConcurrentMode=Tk;ht.isContextConsumer=function(e){return br(e)===Dh};ht.isContextProvider=function(e){return br(e)===Lh};ht.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===sy};ht.isForwardRef=function(e){return br(e)===Nh};ht.isFragment=function(e){return br(e)===Ph};ht.isLazy=function(e){return br(e)===Bh};ht.isMemo=function(e){return br(e)===jh};ht.isPortal=function(e){return br(e)===ly};ht.isProfiler=function(e){return br(e)===Oh};ht.isStrictMode=function(e){return br(e)===Ih};ht.isSuspense=function(e){return br(e)===zh};ht.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ph||e===Mh||e===Oh||e===Ih||e===zh||e===DI||typeof e=="object"&&e!==null&&(e.$$typeof===Bh||e.$$typeof===jh||e.$$typeof===Lh||e.$$typeof===Dh||e.$$typeof===Nh||e.$$typeof===NI||e.$$typeof===zI||e.$$typeof===jI||e.$$typeof===MI)};ht.typeOf=br;(function(e){e.exports=ht})(LI);var cy=q0,BI={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},FI={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},$I={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Pk={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},dy={};dy[cy.ForwardRef]=$I;dy[cy.Memo]=Pk;function q3(e){return cy.isMemo(e)?Pk:dy[e.$$typeof]||BI}var UI=Object.defineProperty,HI=Object.getOwnPropertyNames,K3=Object.getOwnPropertySymbols,WI=Object.getOwnPropertyDescriptor,VI=Object.getPrototypeOf,G3=Object.prototype;function Ik(e,t,n){if(typeof t!="string"){if(G3){var r=VI(t);r&&r!==G3&&Ik(e,r,n)}var i=HI(t);K3&&(i=i.concat(K3(t)));for(var o=q3(e),a=q3(t),s=0;s1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var GI=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,o=i.length,a=o;n>=a;)(a<<=1)<0&&ma(16,""+n);this.groupSizes=new Uint32Array(a),this.groupSizes.set(i),this.length=a;for(var s=o;s=this.length||this.groupSizes[n]===0)return r;for(var i=this.groupSizes[n],o=this.indexOfGroup(n),a=o+i,s=o;s=El&&(El=t+1),hd.set(e,t),ff.set(t,e)},QI="style["+gs+'][data-styled-version="5.3.3"]',JI=new RegExp("^"+gs+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),ZI=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o=0;l--){var c=u[l];if(c&&c.nodeType===1&&c.hasAttribute(gs))return c}}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(gs,"active"),r.setAttribute("data-styled-version","5.3.3");var a=tO();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},nO=function(){function e(n){var r=this.element=Ok(n);r.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var o=document.styleSheets,a=0,s=o.length;a=0){var i=document.createTextNode(r),o=this.nodes[n];return this.element.insertBefore(i,o||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(h+=p+",")}),o+=""+l+c+'{content:"'+h+`"}/*!sc*/ -`}}}return o}(this)},e}(),aO=/(a)(d)/gi,J3=function(e){return String.fromCharCode(e+(e>25?39:97))};function G0(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=J3(t%52)+n;return(J3(t%52)+n).replace(aO,"$1-$2")}var Xa=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Lk=function(e){return Xa(5381,e)};function Dk(e){for(var t=0;t>>0);if(!n.hasNameForId(i,s)){var u=r(a,"."+s,void 0,i);n.insertRules(i,s,u)}o.push(s),this.staticRulesId=s}else{for(var l=this.rules.length,c=Xa(this.baseHash,r.hash),h="",p=0;p>>0);if(!n.hasNameForId(i,_)){var S=r(h,"."+_,void 0,i);n.insertRules(i,_,S)}o.push(_)}}return o.join(" ")},e}(),uO=/^\s*\/\/.*$/gm,cO=[":","[",".","#"];function dO(e){var t,n,r,i,o=e===void 0?Co:e,a=o.options,s=a===void 0?Co:a,u=o.plugins,l=u===void 0?df:u,c=new TI(s),h=[],p=function(b){function _(S){if(S)try{b(S+"}")}catch{}}return function(S,k,C,d,v,m,x,A,L,P){switch(S){case 1:if(L===0&&k.charCodeAt(0)===64)return b(k+";"),"";break;case 2:if(A===0)return k+"/*|*/";break;case 3:switch(A){case 102:case 112:return b(C[0]+k),"";default:return k+(P===0?"/*|*/":"")}case-2:k.split("/*|*/}").forEach(_)}}}(function(b){h.push(b)}),y=function(b,_,S){return _===0&&cO.indexOf(S[n.length])!==-1||S.match(i)?b:"."+t};function g(b,_,S,k){k===void 0&&(k="&");var C=b.replace(uO,""),d=_&&S?S+" "+_+" { "+C+" }":C;return t=k,n=_,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),c(S||!_?"":_,d)}return c.use([].concat(l,[function(b,_,S){b===2&&S.length&&S[0].lastIndexOf(n)>0&&(S[0]=S[0].replace(r,y))},p,function(b){if(b===-2){var _=h;return h=[],_}}])),g.hash=l.length?l.reduce(function(b,_){return _.name||ma(15),Xa(b,_.name)},5381).toString():"",g}var Mk=de.createContext();Mk.Consumer;var Nk=de.createContext(),fO=(Nk.Consumer,new hf),Y0=dO();function zk(){return w.useContext(Mk)||fO}function jk(){return w.useContext(Nk)||Y0}var Bk=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Y0);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.toString=function(){return ma(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Y0),this.name+t.hash},e}(),hO=/([A-Z])/,pO=/([A-Z])/g,mO=/^ms-/,gO=function(e){return"-"+e.toLowerCase()};function Z3(e){return hO.test(e)?e.replace(pO,gO).replace(mO,"-ms-"):e}var ew=function(e){return e==null||e===!1||e===""};function ga(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,yO=/(^-|-$)/g;function Dm(e){return e.replace(vO,"-").replace(yO,"")}var my=function(e){return G0(Lk(e)>>>0)};function Cc(e){return typeof e=="string"&&!0}var X0=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},bO=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function wO(e,t,n){var r=e[n];X0(t)&&X0(r)?$k(r,t):e[n]=t}function $k(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[A]=m[A]);return P}(t,["componentId"]),v=C&&C+"-"+(Cc(k)?k:Dm(X3(k)));return Uk(k,ei({},d,{attrs:p,componentId:v}),n)},Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(k){this._foldedDefaultProps=r?$k({},e.defaultProps,k):k}}),g.toString=function(){return"."+g.styledComponentId},i&&fy(g,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),g}var Q0=function(e){return function t(n,r,i){if(i===void 0&&(i=Co),!ou.isValidElementType(r))return ma(1,String(r));var o=function(){return n(r,i,Jn.apply(void 0,arguments))};return o.withConfig=function(a){return t(n,r,ei({},i,{},a))},o.attrs=function(a){return t(n,r,ei({},i,{attrs:Array.prototype.concat(i.attrs,a).filter(Boolean)}))},o}(Uk,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Q0[e]=Q0(e)});var kO=function(){function e(n,r){this.rules=n,this.componentId=r,this.isStatic=Dk(n),hf.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(n,r,i,o){var a=o(ga(this.rules,r,i,o).join(""),""),s=this.componentId+n;i.insertRules(s,s,a)},t.removeStyles=function(n,r){r.clearRules(this.componentId+n)},t.renderStyles=function(n,r,i,o){n>2&&hf.registerId(this.componentId+n),this.removeStyles(n,i),this.createStyles(n,r,i,o)},e}();function xO(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pd(e,t,n){return EO()?pd=Reflect.construct.bind():pd=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),l=new u;return a&&au(l,a.prototype),l},pd.apply(null,arguments)}function e1(e){var t=typeof Map=="function"?new Map:void 0;return e1=function(r){if(r===null||!_O(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return pd(r,arguments,Z0(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),au(i,r)},e1(e)}var wi=function(e){gy(t,e);function t(n){var r;return r=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+n+" for more information.")||this,J0(r)}return t}(e1(Error));function Nm(e){return Math.round(e*255)}function RO(e,t,n){return Nm(e)+","+Nm(t)+","+Nm(n)}function su(e,t,n,r){if(r===void 0&&(r=RO),t===0)return r(n,n,n);var i=(e%360+360)%360/60,o=(1-Math.abs(2*n-1))*t,a=o*(1-Math.abs(i%2-1)),s=0,u=0,l=0;i>=0&&i<1?(s=o,u=a):i>=1&&i<2?(s=a,u=o):i>=2&&i<3?(u=o,l=a):i>=3&&i<4?(u=a,l=o):i>=4&&i<5?(s=a,l=o):i>=5&&i<6&&(s=o,l=a);var c=n-o/2,h=s+c,p=u+c,y=l+c;return r(h,p,y)}var nw={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function AO(e){if(typeof e!="string")return e;var t=e.toLowerCase();return nw[t]?"#"+nw[t]:e}var TO=/^#[a-fA-F0-9]{6}$/,PO=/^#[a-fA-F0-9]{8}$/,IO=/^#[a-fA-F0-9]{3}$/,OO=/^#[a-fA-F0-9]{4}$/,zm=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,LO=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,DO=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,MO=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function vy(e){if(typeof e!="string")throw new wi(3);var t=AO(e);if(t.match(TO))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(PO)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(IO))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(OO)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=zm.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=LO.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])};var a=DO.exec(t);if(a){var s=parseInt(""+a[1],10),u=parseInt(""+a[2],10)/100,l=parseInt(""+a[3],10)/100,c="rgb("+su(s,u,l)+")",h=zm.exec(c);if(!h)throw new wi(4,t,c);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10)}}var p=MO.exec(t.substring(0,50));if(p){var y=parseInt(""+p[1],10),g=parseInt(""+p[2],10)/100,b=parseInt(""+p[3],10)/100,_="rgb("+su(y,g,b)+")",S=zm.exec(_);if(!S)throw new wi(4,t,_);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10),alpha:parseFloat(""+p[4])}}throw new wi(5)}function NO(e){var t=e.red/255,n=e.green/255,r=e.blue/255,i=Math.max(t,n,r),o=Math.min(t,n,r),a=(i+o)/2;if(i===o)return e.alpha!==void 0?{hue:0,saturation:0,lightness:a,alpha:e.alpha}:{hue:0,saturation:0,lightness:a};var s,u=i-o,l=a>.5?u/(2-i-o):u/(i+o);switch(i){case t:s=(n-r)/u+(n=1?pf(e,t,n):"rgba("+su(e,t,n)+","+r+")";if(typeof e=="object"&&t===void 0&&n===void 0&&r===void 0)return e.alpha>=1?pf(e.hue,e.saturation,e.lightness):"rgba("+su(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new wi(2)}function n1(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return t1("#"+Ko(e)+Ko(t)+Ko(n));if(typeof e=="object"&&t===void 0&&n===void 0)return t1("#"+Ko(e.red)+Ko(e.green)+Ko(e.blue));throw new wi(6)}function Wk(e,t,n,r){if(typeof e=="string"&&typeof t=="number"){var i=vy(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}else{if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof r=="number")return r>=1?n1(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if(typeof e=="object"&&t===void 0&&n===void 0&&r===void 0)return e.alpha>=1?n1(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")"}throw new wi(7)}var FO=function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&(typeof t.alpha!="number"||typeof t.alpha>"u")},$O=function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&typeof t.alpha=="number"},UO=function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&(typeof t.alpha!="number"||typeof t.alpha>"u")},HO=function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&typeof t.alpha=="number"};function Vk(e){if(typeof e!="object")throw new wi(8);if($O(e))return Wk(e);if(FO(e))return n1(e);if(HO(e))return BO(e);if(UO(e))return jO(e);throw new wi(8)}function qk(e,t,n){return function(){var i=n.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):qk(e,t,i)}}function yy(e){return qk(e,e.length,[])}function by(e,t,n){return Math.max(e,Math.min(t,n))}function WO(e,t){if(t==="transparent")return t;var n=Hk(t);return Vk(lt({},n,{lightness:by(0,1,n.lightness-parseFloat(e))}))}var ro=yy(WO);function VO(e,t){if(t==="transparent")return t;var n=Hk(t);return Vk(lt({},n,{lightness:by(0,1,n.lightness+parseFloat(e))}))}var gi=yy(VO);function qO(e,t){if(t==="transparent")return t;var n=vy(t),r=typeof n.alpha=="number"?n.alpha:1,i=lt({},n,{alpha:by(0,1,+(r*100-parseFloat(e)*100).toFixed(2)/100)});return Wk(i)}var KO=yy(qO);var Rl=(e=>(e.always="always",e.never="never",e.auto="auto",e))(Rl||{});const GO=()=>{const[e,t]=w.useState(()=>Bm()),[n,r]=yi("darkMode","auto");function i(o){o===void 0?(t(Bm()),r("auto")):o===!0?(t(o),r("always")):o===!1&&(t(o),r("never"))}return w.useEffect(()=>{const o=s=>{n==="auto"&&t(s.matches)},a=window.matchMedia("(prefers-color-scheme: dark)");return a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[]),w.useEffect(()=>{n==="auto"?t(Bm()):n==="always"?t(!0):n==="never"&&t(!1)},[n]),[e,i,n]};function Bm(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}let YO={data:""},XO=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||YO,QO=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,JO=/\/\*[^]*?\*\/| +/g,rw=/\n+/g,ho=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+a+";":r+=o[1]=="f"?ho(a,o):o+"{"+ho(a,o[1]=="k"?"":t)+"}":typeof a=="object"?r+=ho(a,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=ho.p?ho.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Ti={},Kk=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Kk(e[n]);return t}return e},ZO=(e,t,n,r,i)=>{let o=Kk(e),a=Ti[o]||(Ti[o]=(u=>{let l=0,c=11;for(;l>>0;return"go"+c})(o));if(!Ti[a]){let u=o!==e?e:(l=>{let c,h,p=[{}];for(;c=QO.exec(l.replace(JO,""));)c[4]?p.shift():c[3]?(h=c[3].replace(rw," ").trim(),p.unshift(p[0][h]=p[0][h]||{})):p[0][c[1]]=c[2].replace(rw," ").trim();return p[0]})(e);Ti[a]=ho(i?{["@keyframes "+a]:u}:u,n?"":"."+a)}let s=n&&Ti.g?Ti.g:null;return n&&(Ti.g=Ti[a]),((u,l,c,h)=>{h?l.data=l.data.replace(h,u):l.data.indexOf(u)===-1&&(l.data=c?u+l.data:l.data+u)})(Ti[a],t,r,s),a},eL=(e,t,n)=>e.reduce((r,i,o)=>{let a=t[o];if(a&&a.call){let s=a(n),u=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=u?"."+u:s&&typeof s=="object"?s.props?"":ho(s,""):s===!1?"":s}return r+i+(a??"")},"");function Fh(e){let t=this||{},n=e.call?e(t.p):e;return ZO(n.unshift?n.raw?eL(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,XO(t.target),t.g,t.o,t.k)}let Gk,r1,i1;Fh.bind({g:1});let Ui=Fh.bind({k:1});function tL(e,t,n,r){ho.p=t,Gk=e,r1=n,i1=r}function jo(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),u=s.className||i.className;n.p=Object.assign({theme:r1&&r1()},s),n.o=/ *go\d+/.test(u),s.className=Fh.apply(n,r)+(u?" "+u:""),t&&(s.ref=a);let l=e;return e[0]&&(l=s.as||e,delete s.as),i1&&l[0]&&i1(s),Gk(l,s)}return t?t(i):i}}var nL=e=>typeof e=="function",mf=(e,t)=>nL(e)?e(t):e,rL=(()=>{let e=0;return()=>(++e).toString()})(),Yk=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),iL=20,md=new Map,oL=1e3,iw=e=>{if(md.has(e))return;let t=setTimeout(()=>{md.delete(e),Ca({type:4,toastId:e})},oL);md.set(e,t)},aL=e=>{let t=md.get(e);t&&clearTimeout(t)},o1=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,iL)};case 1:return t.toast.id&&aL(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?o1(e,{type:1,toast:n}):o1(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?iw(r):e.toasts.forEach(o=>{iw(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},gd=[],vd={toasts:[],pausedAt:void 0},Ca=e=>{vd=o1(vd,e),gd.forEach(t=>{t(vd)})},sL={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},lL=(e={})=>{let[t,n]=w.useState(vd);w.useEffect(()=>(gd.push(n),()=>{let i=gd.indexOf(n);i>-1&&gd.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,a;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||sL[i.type],style:{...e.style,...(a=e[i.type])==null?void 0:a.style,...i.style}}});return{...t,toasts:r}},uL=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||rL()}),Du=e=>(t,n)=>{let r=uL(t,e,n);return Ca({type:2,toast:r}),r.id},fr=(e,t)=>Du("blank")(e,t);fr.error=Du("error");fr.success=Du("success");fr.loading=Du("loading");fr.custom=Du("custom");fr.dismiss=e=>{Ca({type:3,toastId:e})};fr.remove=e=>Ca({type:4,toastId:e});fr.promise=(e,t,n)=>{let r=fr.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(fr.success(mf(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{fr.error(mf(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var cL=(e,t)=>{Ca({type:1,toast:{id:e,height:t}})},dL=()=>{Ca({type:5,time:Date.now()})},fL=e=>{let{toasts:t,pausedAt:n}=lL(e);w.useEffect(()=>{if(n)return;let o=Date.now(),a=t.map(s=>{if(s.duration===1/0)return;let u=(s.duration||0)+s.pauseDuration-(o-s.createdAt);if(u<0){s.visible&&fr.dismiss(s.id);return}return setTimeout(()=>fr.dismiss(s.id),u)});return()=>{a.forEach(s=>s&&clearTimeout(s))}},[t,n]);let r=w.useCallback(()=>{n&&Ca({type:6,time:Date.now()})},[n]),i=w.useCallback((o,a)=>{let{reverseOrder:s=!1,gutter:u=8,defaultPosition:l}=a||{},c=t.filter(y=>(y.position||l)===(o.position||l)&&y.height),h=c.findIndex(y=>y.id===o.id),p=c.filter((y,g)=>gy.visible).slice(...s?[p+1]:[0,p]).reduce((y,g)=>y+(g.height||0)+u,0)},[t]);return{toasts:t,handlers:{updateHeight:cL,startPause:dL,endPause:r,calculateOffset:i}}},hL=Ui` + */var fn=typeof Symbol=="function"&&Symbol.for,ly=fn?Symbol.for("react.element"):60103,uy=fn?Symbol.for("react.portal"):60106,Oh=fn?Symbol.for("react.fragment"):60107,Lh=fn?Symbol.for("react.strict_mode"):60108,Dh=fn?Symbol.for("react.profiler"):60114,Nh=fn?Symbol.for("react.provider"):60109,Mh=fn?Symbol.for("react.context"):60110,cy=fn?Symbol.for("react.async_mode"):60111,zh=fn?Symbol.for("react.concurrent_mode"):60111,jh=fn?Symbol.for("react.forward_ref"):60112,Bh=fn?Symbol.for("react.suspense"):60113,HI=fn?Symbol.for("react.suspense_list"):60120,Fh=fn?Symbol.for("react.memo"):60115,$h=fn?Symbol.for("react.lazy"):60116,UI=fn?Symbol.for("react.block"):60121,VI=fn?Symbol.for("react.fundamental"):60117,WI=fn?Symbol.for("react.responder"):60118,qI=fn?Symbol.for("react.scope"):60119;function Sr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ly:switch(e=e.type,e){case cy:case zh:case Oh:case Dh:case Lh:case Bh:return e;default:switch(e=e&&e.$$typeof,e){case Mh:case jh:case $h:case Fh:case Nh:return e;default:return t}}case uy:return t}}}function Fk(e){return Sr(e)===zh}ht.AsyncMode=cy;ht.ConcurrentMode=zh;ht.ContextConsumer=Mh;ht.ContextProvider=Nh;ht.Element=ly;ht.ForwardRef=jh;ht.Fragment=Oh;ht.Lazy=$h;ht.Memo=Fh;ht.Portal=uy;ht.Profiler=Dh;ht.StrictMode=Lh;ht.Suspense=Bh;ht.isAsyncMode=function(e){return Fk(e)||Sr(e)===cy};ht.isConcurrentMode=Fk;ht.isContextConsumer=function(e){return Sr(e)===Mh};ht.isContextProvider=function(e){return Sr(e)===Nh};ht.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ly};ht.isForwardRef=function(e){return Sr(e)===jh};ht.isFragment=function(e){return Sr(e)===Oh};ht.isLazy=function(e){return Sr(e)===$h};ht.isMemo=function(e){return Sr(e)===Fh};ht.isPortal=function(e){return Sr(e)===uy};ht.isProfiler=function(e){return Sr(e)===Dh};ht.isStrictMode=function(e){return Sr(e)===Lh};ht.isSuspense=function(e){return Sr(e)===Bh};ht.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Oh||e===zh||e===Dh||e===Lh||e===Bh||e===HI||typeof e=="object"&&e!==null&&(e.$$typeof===$h||e.$$typeof===Fh||e.$$typeof===Nh||e.$$typeof===Mh||e.$$typeof===jh||e.$$typeof===VI||e.$$typeof===WI||e.$$typeof===qI||e.$$typeof===UI)};ht.typeOf=Sr;(function(e){e.exports=ht})($I);var dy=K0,KI={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},GI={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},YI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},$k={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},fy={};fy[dy.ForwardRef]=YI;fy[dy.Memo]=$k;function ew(e){return dy.isMemo(e)?$k:fy[e.$$typeof]||KI}var XI=Object.defineProperty,QI=Object.getOwnPropertyNames,tw=Object.getOwnPropertySymbols,JI=Object.getOwnPropertyDescriptor,ZI=Object.getPrototypeOf,nw=Object.prototype;function Hk(e,t,n){if(typeof t!="string"){if(nw){var r=ZI(t);r&&r!==nw&&Hk(e,r,n)}var i=QI(t);tw&&(i=i.concat(tw(t)));for(var o=ew(e),a=ew(t),s=0;s1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var nO=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,o=i.length,a=o;n>=a;)(a<<=1)<0&&ma(16,""+n);this.groupSizes=new Uint32Array(a),this.groupSizes.set(i),this.length=a;for(var s=o;s=this.length||this.groupSizes[n]===0)return r;for(var i=this.groupSizes[n],o=this.indexOfGroup(n),a=o+i,s=o;s=Rl&&(Rl=t+1),md.set(e,t),pf.set(t,e)},oO="style["+bs+'][data-styled-version="5.3.3"]',aO=new RegExp("^"+bs+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),sO=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o=0;l--){var c=u[l];if(c&&c.nodeType===1&&c.hasAttribute(bs))return c}}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(bs,"active"),r.setAttribute("data-styled-version","5.3.3");var a=uO();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},cO=function(){function e(n){var r=this.element=Uk(n);r.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var o=document.styleSheets,a=0,s=o.length;a=0){var i=document.createTextNode(r),o=this.nodes[n];return this.element.insertBefore(i,o||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(h+=p+",")}),o+=""+l+c+'{content:"'+h+`"}/*!sc*/ +`}}}return o}(this)},e}(),pO=/(a)(d)/gi,aw=function(e){return String.fromCharCode(e+(e>25?39:97))};function Y0(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=aw(t%52)+n;return(aw(t%52)+n).replace(pO,"$1-$2")}var Za=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Vk=function(e){return Za(5381,e)};function Wk(e){for(var t=0;t>>0);if(!n.hasNameForId(i,s)){var u=r(a,"."+s,void 0,i);n.insertRules(i,s,u)}o.push(s),this.staticRulesId=s}else{for(var l=this.rules.length,c=Za(this.baseHash,r.hash),h="",p=0;p>>0);if(!n.hasNameForId(i,_)){var S=r(h,"."+_,void 0,i);n.insertRules(i,_,S)}o.push(_)}}return o.join(" ")},e}(),vO=/^\s*\/\/.*$/gm,yO=[":","[",".","#"];function bO(e){var t,n,r,i,o=e===void 0?_o:e,a=o.options,s=a===void 0?_o:a,u=o.plugins,l=u===void 0?hf:u,c=new zI(s),h=[],p=function(b){function _(S){if(S)try{b(S+"}")}catch{}}return function(S,k,C,d,v,m,x,A,D,P){switch(S){case 1:if(D===0&&k.charCodeAt(0)===64)return b(k+";"),"";break;case 2:if(A===0)return k+"/*|*/";break;case 3:switch(A){case 102:case 112:return b(C[0]+k),"";default:return k+(P===0?"/*|*/":"")}case-2:k.split("/*|*/}").forEach(_)}}}(function(b){h.push(b)}),y=function(b,_,S){return _===0&&yO.indexOf(S[n.length])!==-1||S.match(i)?b:"."+t};function g(b,_,S,k){k===void 0&&(k="&");var C=b.replace(vO,""),d=_&&S?S+" "+_+" { "+C+" }":C;return t=k,n=_,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),c(S||!_?"":_,d)}return c.use([].concat(l,[function(b,_,S){b===2&&S.length&&S[0].lastIndexOf(n)>0&&(S[0]=S[0].replace(r,y))},p,function(b){if(b===-2){var _=h;return h=[],_}}])),g.hash=l.length?l.reduce(function(b,_){return _.name||ma(15),Za(b,_.name)},5381).toString():"",g}var qk=de.createContext();qk.Consumer;var Kk=de.createContext(),wO=(Kk.Consumer,new mf),X0=bO();function Gk(){return w.useContext(qk)||wO}function Yk(){return w.useContext(Kk)||X0}var Xk=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=X0);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.toString=function(){return ma(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=X0),this.name+t.hash},e}(),SO=/([A-Z])/,kO=/([A-Z])/g,xO=/^ms-/,CO=function(e){return"-"+e.toLowerCase()};function sw(e){return SO.test(e)?e.replace(kO,CO).replace(xO,"-ms-"):e}var lw=function(e){return e==null||e===!1||e===""};function ga(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,EO=/(^-|-$)/g;function Nm(e){return e.replace(_O,"-").replace(EO,"")}var gy=function(e){return Y0(Vk(e)>>>0)};function Ec(e){return typeof e=="string"&&!0}var Q0=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},RO=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function AO(e,t,n){var r=e[n];Q0(t)&&Q0(r)?Jk(r,t):e[n]=t}function Jk(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[A]=m[A]);return P}(t,["componentId"]),v=C&&C+"-"+(Ec(k)?k:Nm(iw(k)));return Zk(k,ni({},d,{attrs:p,componentId:v}),n)},Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(k){this._foldedDefaultProps=r?Jk({},e.defaultProps,k):k}}),g.toString=function(){return"."+g.styledComponentId},i&&hy(g,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),g}var J0=function(e){return function t(n,r,i){if(i===void 0&&(i=_o),!au.isValidElementType(r))return ma(1,String(r));var o=function(){return n(r,i,er.apply(void 0,arguments))};return o.withConfig=function(a){return t(n,r,ni({},i,{},a))},o.attrs=function(a){return t(n,r,ni({},i,{attrs:Array.prototype.concat(i.attrs,a).filter(Boolean)}))},o}(Zk,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){J0[e]=J0(e)});var PO=function(){function e(n,r){this.rules=n,this.componentId=r,this.isStatic=Wk(n),mf.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(n,r,i,o){var a=o(ga(this.rules,r,i,o).join(""),""),s=this.componentId+n;i.insertRules(s,s,a)},t.removeStyles=function(n,r){r.clearRules(this.componentId+n)},t.renderStyles=function(n,r,i,o){n>2&&mf.registerId(this.componentId+n),this.removeStyles(n,i),this.createStyles(n,r,i,o)},e}();function IO(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gd(e,t,n){return DO()?gd=Reflect.construct.bind():gd=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),l=new u;return a&&su(l,a.prototype),l},gd.apply(null,arguments)}function t1(e){var t=typeof Map=="function"?new Map:void 0;return t1=function(r){if(r===null||!LO(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return gd(r,arguments,e1(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),su(i,r)},t1(e)}var wi=function(e){vy(t,e);function t(n){var r;return r=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+n+" for more information.")||this,Z0(r)}return t}(t1(Error));function zm(e){return Math.round(e*255)}function NO(e,t,n){return zm(e)+","+zm(t)+","+zm(n)}function lu(e,t,n,r){if(r===void 0&&(r=NO),t===0)return r(n,n,n);var i=(e%360+360)%360/60,o=(1-Math.abs(2*n-1))*t,a=o*(1-Math.abs(i%2-1)),s=0,u=0,l=0;i>=0&&i<1?(s=o,u=a):i>=1&&i<2?(s=a,u=o):i>=2&&i<3?(u=o,l=a):i>=3&&i<4?(u=a,l=o):i>=4&&i<5?(s=a,l=o):i>=5&&i<6&&(s=o,l=a);var c=n-o/2,h=s+c,p=u+c,y=l+c;return r(h,p,y)}var cw={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function MO(e){if(typeof e!="string")return e;var t=e.toLowerCase();return cw[t]?"#"+cw[t]:e}var zO=/^#[a-fA-F0-9]{6}$/,jO=/^#[a-fA-F0-9]{8}$/,BO=/^#[a-fA-F0-9]{3}$/,FO=/^#[a-fA-F0-9]{4}$/,jm=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,$O=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,HO=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,UO=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function yy(e){if(typeof e!="string")throw new wi(3);var t=MO(e);if(t.match(zO))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(jO)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(BO))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(FO)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=jm.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=$O.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])};var a=HO.exec(t);if(a){var s=parseInt(""+a[1],10),u=parseInt(""+a[2],10)/100,l=parseInt(""+a[3],10)/100,c="rgb("+lu(s,u,l)+")",h=jm.exec(c);if(!h)throw new wi(4,t,c);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10)}}var p=UO.exec(t.substring(0,50));if(p){var y=parseInt(""+p[1],10),g=parseInt(""+p[2],10)/100,b=parseInt(""+p[3],10)/100,_="rgb("+lu(y,g,b)+")",S=jm.exec(_);if(!S)throw new wi(4,t,_);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10),alpha:parseFloat(""+p[4])}}throw new wi(5)}function VO(e){var t=e.red/255,n=e.green/255,r=e.blue/255,i=Math.max(t,n,r),o=Math.min(t,n,r),a=(i+o)/2;if(i===o)return e.alpha!==void 0?{hue:0,saturation:0,lightness:a,alpha:e.alpha}:{hue:0,saturation:0,lightness:a};var s,u=i-o,l=a>.5?u/(2-i-o):u/(i+o);switch(i){case t:s=(n-r)/u+(n=1?gf(e,t,n):"rgba("+lu(e,t,n)+","+r+")";if(typeof e=="object"&&t===void 0&&n===void 0&&r===void 0)return e.alpha>=1?gf(e.hue,e.saturation,e.lightness):"rgba("+lu(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new wi(2)}function r1(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return n1("#"+Ko(e)+Ko(t)+Ko(n));if(typeof e=="object"&&t===void 0&&n===void 0)return n1("#"+Ko(e.red)+Ko(e.green)+Ko(e.blue));throw new wi(6)}function tx(e,t,n,r){if(typeof e=="string"&&typeof t=="number"){var i=yy(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}else{if(typeof e=="number"&&typeof t=="number"&&typeof n=="number"&&typeof r=="number")return r>=1?r1(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if(typeof e=="object"&&t===void 0&&n===void 0&&r===void 0)return e.alpha>=1?r1(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")"}throw new wi(7)}var GO=function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&(typeof t.alpha!="number"||typeof t.alpha>"u")},YO=function(t){return typeof t.red=="number"&&typeof t.green=="number"&&typeof t.blue=="number"&&typeof t.alpha=="number"},XO=function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&(typeof t.alpha!="number"||typeof t.alpha>"u")},QO=function(t){return typeof t.hue=="number"&&typeof t.saturation=="number"&&typeof t.lightness=="number"&&typeof t.alpha=="number"};function nx(e){if(typeof e!="object")throw new wi(8);if(YO(e))return tx(e);if(GO(e))return r1(e);if(QO(e))return KO(e);if(XO(e))return qO(e);throw new wi(8)}function rx(e,t,n){return function(){var i=n.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):rx(e,t,i)}}function by(e){return rx(e,e.length,[])}function wy(e,t,n){return Math.max(e,Math.min(t,n))}function JO(e,t){if(t==="transparent")return t;var n=ex(t);return nx(lt({},n,{lightness:wy(0,1,n.lightness-parseFloat(e))}))}var io=by(JO);function ZO(e,t){if(t==="transparent")return t;var n=ex(t);return nx(lt({},n,{lightness:wy(0,1,n.lightness+parseFloat(e))}))}var gi=by(ZO);function eL(e,t){if(t==="transparent")return t;var n=yy(t),r=typeof n.alpha=="number"?n.alpha:1,i=lt({},n,{alpha:wy(0,1,+(r*100-parseFloat(e)*100).toFixed(2)/100)});return tx(i)}var tL=by(eL);var Al=(e=>(e.always="always",e.never="never",e.auto="auto",e))(Al||{});const nL=()=>{const[e,t]=w.useState(()=>Fm()),[n,r]=yi("darkMode","auto");function i(o){o===void 0?(t(Fm()),r("auto")):o===!0?(t(o),r("always")):o===!1&&(t(o),r("never"))}return w.useEffect(()=>{const o=s=>{n==="auto"&&t(s.matches)},a=window.matchMedia("(prefers-color-scheme: dark)");return a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[]),w.useEffect(()=>{n==="auto"?t(Fm()):n==="always"?t(!0):n==="never"&&t(!1)},[n]),[e,i,n]};function Fm(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}let rL={data:""},iL=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||rL,oL=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,aL=/\/\*[^]*?\*\/| +/g,dw=/\n+/g,po=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+a+";":r+=o[1]=="f"?po(a,o):o+"{"+po(a,o[1]=="k"?"":t)+"}":typeof a=="object"?r+=po(a,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=po.p?po.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Pi={},ix=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+ix(e[n]);return t}return e},sL=(e,t,n,r,i)=>{let o=ix(e),a=Pi[o]||(Pi[o]=(u=>{let l=0,c=11;for(;l>>0;return"go"+c})(o));if(!Pi[a]){let u=o!==e?e:(l=>{let c,h,p=[{}];for(;c=oL.exec(l.replace(aL,""));)c[4]?p.shift():c[3]?(h=c[3].replace(dw," ").trim(),p.unshift(p[0][h]=p[0][h]||{})):p[0][c[1]]=c[2].replace(dw," ").trim();return p[0]})(e);Pi[a]=po(i?{["@keyframes "+a]:u}:u,n?"":"."+a)}let s=n&&Pi.g?Pi.g:null;return n&&(Pi.g=Pi[a]),((u,l,c,h)=>{h?l.data=l.data.replace(h,u):l.data.indexOf(u)===-1&&(l.data=c?u+l.data:l.data+u)})(Pi[a],t,r,s),a},lL=(e,t,n)=>e.reduce((r,i,o)=>{let a=t[o];if(a&&a.call){let s=a(n),u=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=u?"."+u:s&&typeof s=="object"?s.props?"":po(s,""):s===!1?"":s}return r+i+(a??"")},"");function Hh(e){let t=this||{},n=e.call?e(t.p):e;return sL(n.unshift?n.raw?lL(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,iL(t.target),t.g,t.o,t.k)}let ox,i1,o1;Hh.bind({g:1});let Ui=Hh.bind({k:1});function uL(e,t,n,r){po.p=t,ox=e,i1=n,o1=r}function jo(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),u=s.className||i.className;n.p=Object.assign({theme:i1&&i1()},s),n.o=/ *go\d+/.test(u),s.className=Hh.apply(n,r)+(u?" "+u:""),t&&(s.ref=a);let l=e;return e[0]&&(l=s.as||e,delete s.as),o1&&l[0]&&o1(s),ox(l,s)}return t?t(i):i}}var cL=e=>typeof e=="function",vf=(e,t)=>cL(e)?e(t):e,dL=(()=>{let e=0;return()=>(++e).toString()})(),ax=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),fL=20,vd=new Map,hL=1e3,fw=e=>{if(vd.has(e))return;let t=setTimeout(()=>{vd.delete(e),Ca({type:4,toastId:e})},hL);vd.set(e,t)},pL=e=>{let t=vd.get(e);t&&clearTimeout(t)},a1=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,fL)};case 1:return t.toast.id&&pL(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?a1(e,{type:1,toast:n}):a1(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?fw(r):e.toasts.forEach(o=>{fw(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},yd=[],bd={toasts:[],pausedAt:void 0},Ca=e=>{bd=a1(bd,e),yd.forEach(t=>{t(bd)})},mL={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gL=(e={})=>{let[t,n]=w.useState(bd);w.useEffect(()=>(yd.push(n),()=>{let i=yd.indexOf(n);i>-1&&yd.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,a;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||mL[i.type],style:{...e.style,...(a=e[i.type])==null?void 0:a.style,...i.style}}});return{...t,toasts:r}},vL=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||dL()}),Nu=e=>(t,n)=>{let r=vL(t,e,n);return Ca({type:2,toast:r}),r.id},Kn=(e,t)=>Nu("blank")(e,t);Kn.error=Nu("error");Kn.success=Nu("success");Kn.loading=Nu("loading");Kn.custom=Nu("custom");Kn.dismiss=e=>{Ca({type:3,toastId:e})};Kn.remove=e=>Ca({type:4,toastId:e});Kn.promise=(e,t,n)=>{let r=Kn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Kn.success(vf(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Kn.error(vf(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var yL=(e,t)=>{Ca({type:1,toast:{id:e,height:t}})},bL=()=>{Ca({type:5,time:Date.now()})},wL=e=>{let{toasts:t,pausedAt:n}=gL(e);w.useEffect(()=>{if(n)return;let o=Date.now(),a=t.map(s=>{if(s.duration===1/0)return;let u=(s.duration||0)+s.pauseDuration-(o-s.createdAt);if(u<0){s.visible&&Kn.dismiss(s.id);return}return setTimeout(()=>Kn.dismiss(s.id),u)});return()=>{a.forEach(s=>s&&clearTimeout(s))}},[t,n]);let r=w.useCallback(()=>{n&&Ca({type:6,time:Date.now()})},[n]),i=w.useCallback((o,a)=>{let{reverseOrder:s=!1,gutter:u=8,defaultPosition:l}=a||{},c=t.filter(y=>(y.position||l)===(o.position||l)&&y.height),h=c.findIndex(y=>y.id===o.id),p=c.filter((y,g)=>gy.visible).slice(...s?[p+1]:[0,p]).reduce((y,g)=>y+(g.height||0)+u,0)},[t]);return{toasts:t,handlers:{updateHeight:yL,startPause:bL,endPause:r,calculateOffset:i}}},SL=Ui` from { transform: scale(0) rotate(45deg); opacity: 0; @@ -85,7 +85,7 @@ from { to { transform: scale(1) rotate(45deg); opacity: 1; -}`,pL=Ui` +}`,kL=Ui` from { transform: scale(0); opacity: 0; @@ -93,7 +93,7 @@ from { to { transform: scale(1); opacity: 1; -}`,mL=Ui` +}`,xL=Ui` from { transform: scale(0) rotate(90deg); opacity: 0; @@ -101,7 +101,7 @@ from { to { transform: scale(1) rotate(90deg); opacity: 1; -}`,gL=jo("div")` +}`,CL=jo("div")` width: 20px; opacity: 0; height: 20px; @@ -110,14 +110,14 @@ to { position: relative; transform: rotate(45deg); - animation: ${hL} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${SL} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; - animation: ${pL} 0.15s ease-out forwards; + animation: ${kL} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; @@ -130,18 +130,18 @@ to { } &:before { - animation: ${mL} 0.15s ease-out forwards; + animation: ${xL} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } -`,vL=Ui` +`,_L=Ui` from { transform: rotate(0deg); } to { transform: rotate(360deg); } -`,yL=jo("div")` +`,EL=jo("div")` width: 12px; height: 12px; box-sizing: border-box; @@ -149,8 +149,8 @@ to { border-radius: 100%; border-color: ${e=>e.secondary||"#e0e0e0"}; border-right-color: ${e=>e.primary||"#616161"}; - animation: ${vL} 1s linear infinite; -`,bL=Ui` + animation: ${_L} 1s linear infinite; +`,RL=Ui` from { transform: scale(0) rotate(45deg); opacity: 0; @@ -158,7 +158,7 @@ from { to { transform: scale(1) rotate(45deg); opacity: 1; -}`,wL=Ui` +}`,AL=Ui` 0% { height: 0; width: 0; @@ -172,7 +172,7 @@ to { 100% { opacity: 1; height: 10px; -}`,SL=jo("div")` +}`,TL=jo("div")` width: 20px; opacity: 0; height: 20px; @@ -181,13 +181,13 @@ to { position: relative; transform: rotate(45deg); - animation: ${bL} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${RL} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; - animation: ${wL} 0.2s ease-out forwards; + animation: ${AL} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; @@ -199,16 +199,16 @@ to { height: 10px; width: 6px; } -`,kL=jo("div")` +`,PL=jo("div")` position: absolute; -`,xL=jo("div")` +`,IL=jo("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; -`,CL=Ui` +`,OL=Ui` from { transform: scale(0.6); opacity: 0.4; @@ -216,20 +216,20 @@ from { to { transform: scale(1); opacity: 1; -}`,_L=jo("div")` +}`,LL=jo("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; - animation: ${CL} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${OL} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; -`,EL=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?w.createElement(_L,null,t):t:n==="blank"?null:w.createElement(xL,null,w.createElement(yL,{...r}),n!=="loading"&&w.createElement(kL,null,n==="error"?w.createElement(gL,{...r}):w.createElement(SL,{...r})))},RL=e=>` +`,DL=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?w.createElement(LL,null,t):t:n==="blank"?null:w.createElement(IL,null,w.createElement(EL,{...r}),n!=="loading"&&w.createElement(PL,null,n==="error"?w.createElement(CL,{...r}):w.createElement(TL,{...r})))},NL=e=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} -`,AL=e=>` +`,ML=e=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} -`,TL="0%{opacity:0;} 100%{opacity:1;}",PL="0%{opacity:1;} 100%{opacity:0;}",IL=jo("div")` +`,zL="0%{opacity:0;} 100%{opacity:1;}",jL="0%{opacity:1;} 100%{opacity:0;}",BL=jo("div")` display: flex; align-items: center; background: #fff; @@ -241,19 +241,19 @@ to { pointer-events: auto; padding: 8px 10px; border-radius: 8px; -`,OL=jo("div")` +`,FL=jo("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; -`,LL=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=Yk()?[TL,PL]:[RL(n),AL(n)];return{animation:t?`${Ui(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ui(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Xk=w.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?LL(e.position||t||"top-center",e.visible):{opacity:0},o=w.createElement(EL,{toast:e}),a=w.createElement(OL,{...e.ariaProps},mf(e.message,e));return w.createElement(IL,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:o,message:a}):w.createElement(w.Fragment,null,o,a))});tL(w.createElement);var DL=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let o=w.useCallback(a=>{if(a){let s=()=>{let u=a.getBoundingClientRect().height;r(e,u)};s(),new MutationObserver(s).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return w.createElement("div",{ref:o,className:t,style:n},i)},ML=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Yk()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},NL=Fh` +`,$L=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=ax()?[zL,jL]:[NL(n),ML(n)];return{animation:t?`${Ui(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ui(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},sx=w.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?$L(e.position||t||"top-center",e.visible):{opacity:0},o=w.createElement(DL,{toast:e}),a=w.createElement(FL,{...e.ariaProps},vf(e.message,e));return w.createElement(BL,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:o,message:a}):w.createElement(w.Fragment,null,o,a))});uL(w.createElement);var HL=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let o=w.useCallback(a=>{if(a){let s=()=>{let u=a.getBoundingClientRect().height;r(e,u)};s(),new MutationObserver(s).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return w.createElement("div",{ref:o,className:t,style:n},i)},UL=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:ax()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},VL=Hh` z-index: 9999; > * { pointer-events: auto; } -`,_c=16,zL=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:s,handlers:u}=fL(n);return w.createElement("div",{style:{position:"fixed",zIndex:9999,top:_c,left:_c,right:_c,bottom:_c,pointerEvents:"none",...o},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},s.map(l=>{let c=l.position||t,h=u.calculateOffset(l,{reverseOrder:e,gutter:r,defaultPosition:t}),p=ML(c,h);return w.createElement(DL,{id:l.id,key:l.id,onHeightUpdate:u.updateHeight,className:l.visible?NL:"",style:p},l.type==="custom"?mf(l.message,l):i?i(l):w.createElement(Xk,{toast:l,position:c}))}))},dt=fr;function jL(e){const[t,n]=w.useState(!1),r=w.useRef(null);return w.useEffect(()=>{const i=()=>n(!0),o=()=>n(!1),a=r.current;if(!e&&a)return a.addEventListener("mouseover",i),a.addEventListener("mouseout",o),()=>{a.removeEventListener("mouseover",i),a.removeEventListener("mouseout",o)}},[e]),window.matchMedia("(pointer: coarse)").matches?[r,!1]:[r,t]}var Qk={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ow=de.createContext&&de.createContext(Qk),_o=globalThis&&globalThis.__assign||function(){return _o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{o===void 0?t.delete(e):t.set(e,o),n(t)},i=t.get(e);return i===null?[void 0,r]:[i,r]}function cx(){return va("query")}const $m={classSubject:"classSubject",parent:"parent",newSubject:"newSubject"};function Ry(e,t,n){const r=new URL(location.origin);return r.pathname=$e.new,r.searchParams.append($m.classSubject,e),t&&r.searchParams.append($m.parent,t),n&&r.searchParams.append($m.newSubject,n),$e.new+r.search}function Hh(e){return Es($e.edit,{subject:e})}function bD(e){return Es($e.share,{subject:e})}function dx(e){return Es($e.data,{subject:e})}function wD(e){return window.location.origin+e}function SD(e){return Es($e.import,{subject:e})}function kD(e,t){const n=new URL(t);return n.pathname=$e.allVersions,n.searchParams.append("subject",e),$t(n.toString())}function Nu(...e){const t=n=>e.map(r=>`${r} ${n.animation.duration} ease-in-out`).join(",");return Jn(["transition:",";"],({theme:n})=>t(n))}var lu={},xD={get exports(){return lu},set exports(e){lu=e}},Wh={};/** +`,Rc=16,WL=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:s,handlers:u}=wL(n);return w.createElement("div",{style:{position:"fixed",zIndex:9999,top:Rc,left:Rc,right:Rc,bottom:Rc,pointerEvents:"none",...o},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},s.map(l=>{let c=l.position||t,h=u.calculateOffset(l,{reverseOrder:e,gutter:r,defaultPosition:t}),p=UL(c,h);return w.createElement(HL,{id:l.id,key:l.id,onHeightUpdate:u.updateHeight,className:l.visible?VL:"",style:p},l.type==="custom"?vf(l.message,l):i?i(l):w.createElement(sx,{toast:l,position:c}))}))},dt=Kn;function qL(e){const[t,n]=w.useState(!1),r=w.useRef(null);return w.useEffect(()=>{const i=()=>n(!0),o=()=>n(!1),a=r.current;if(!e&&a)return a.addEventListener("mouseover",i),a.addEventListener("mouseout",o),()=>{a.removeEventListener("mouseover",i),a.removeEventListener("mouseout",o)}},[e]),window.matchMedia("(pointer: coarse)").matches?[r,!1]:[r,t]}var lx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},hw=de.createContext&&de.createContext(lx),Eo=globalThis&&globalThis.__assign||function(){return Eo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{o===void 0?t.delete(e):t.set(e,o),n(t)},i=t.get(e);return i===null?[void 0,r]:[i,r]}function Sx(){return va("query")}const Hm={classSubject:"classSubject",parent:"parent",newSubject:"newSubject"};function Ay(e,t,n){const r=new URL(location.origin);return r.pathname=Fe.new,r.searchParams.append(Hm.classSubject,e),t&&r.searchParams.append(Hm.parent,t),n&&r.searchParams.append(Hm.newSubject,n),Fe.new+r.search}function Wh(e){return _a(Fe.edit,{subject:e})}function AD(e){return _a(Fe.share,{subject:e})}function kx(e){return _a(Fe.data,{subject:e})}function TD(e){return window.location.origin+e}function PD(e){return _a(Fe.import,{subject:e})}function ID(e){return _a(Fe.history,{subject:e})}function OD(e,t){const n=new URL(t);return n.pathname=Fe.allVersions,n.searchParams.append("subject",e),zt(n.toString())}function zu(...e){const t=n=>e.map(r=>`${r} ${n.animation.duration} ease-in-out`).join(",");return er(["transition:",";"],({theme:n})=>t(n))}var uu={},LD={get exports(){return uu},set exports(e){uu=e}},qh={};/** * @license React * react-jsx-runtime.production.min.js * @@ -261,7 +261,7 @@ to { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var CD=w,_D=Symbol.for("react.element"),ED=Symbol.for("react.fragment"),RD=Object.prototype.hasOwnProperty,AD=CD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,TD={key:!0,ref:!0,__self:!0,__source:!0};function fx(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)RD.call(t,r)&&!TD.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:_D,type:e,key:o,ref:a,props:i,_owner:AD.current}}Wh.Fragment=ED;Wh.jsx=fx;Wh.jsxs=fx;(function(e){e.exports=Wh})(xD);const f=lu.jsx,M=lu.jsxs,be=lu.Fragment,hx=()=>f(PD,{viewBox:"0 0 50 50",children:f("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4"})}),PD=B.svg.withConfig({displayName:"StyledSpinner",componentId:"sc-1q9znf8-0"})(["animation:rotate 2s linear infinite;width:50px;height:50px;max-width:100%;max-height:100%;& .path{stroke:",";stroke-linecap:round;animation:dash 1.5s ease-in-out infinite;}@keyframes rotate{100%{transform:rotate(360deg);}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0;}50%{stroke-dasharray:90,150;stroke-dashoffset:-35;}100%{stroke-dasharray:90,150;stroke-dashoffset:-124;}}"],e=>e.theme.colors.main),ve=de.forwardRef(({children:e,clean:t,icon:n,loading:r,...i},o)=>{let a=mx;return n&&(a=ID),t&&(a=Ay),f(a,{type:"button",...i,ref:o,children:r?f(hx,{}):e})});ve.displayName="Button";const Ay=B.button.withConfig({displayName:"ButtonClean",componentId:"sc-1inckz0-0"})(["cursor:pointer;border:none;outline:none;font-size:inherit;padding:0;color:inherit;margin:0;-webkit-appearance:none;background-color:initial;-webkit-tap-highlight-color:transparent;"]),px=B(Ay).withConfig({displayName:"ButtonBase",componentId:"sc-1inckz0-1"})(["height:2rem;display:flex;align-items:center;justify-content:center;background-color:",";color:",";white-space:nowrap;margin-bottom:",";",";@media (hover:hover) and (pointer:fine){&:hover:not([disabled]),&:focus-visible:not([disabled]){border-color:",";outline:0;}}&:active:not([disabled]){transition:all 0s;}&:disabled{cursor:default;display:auto;opacity:0.5;}"],e=>e.theme.colors.main,e=>e.theme.colors.bg,e=>e.gutter?`${e.theme.margin}rem`:"",Nu("background-color","box-shadow","transform","color"),e=>e.theme.colors.main),yd=B(Ay).withConfig({displayName:"ButtonBar",componentId:"sc-1inckz0-2"})(["padding-right:0.5rem;padding-left:0.5rem;color:",";background-color:",";height:100%;display:flex;align-items:center;&:hover:not([disabled]),&:focus-visible:not([disabled]){background-color:",";}&:active:not([disabled]){background-color:",";}padding-left:",";padding-right:",";"],e=>e.theme.colors.main,e=>e.selected?e.theme.colors.bg2:e.theme.colors.bg,e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.leftPadding?"1.2rem":"",e=>e.rightPadding?"1.2rem":""),mx=B(px).withConfig({displayName:"ButtonDefault",componentId:"sc-1inckz0-3"})(["padding:0.4rem;border-radius:",";padding-left:","rem;padding-right:","rem;box-shadow:",";display:inline-flex;background-color:",";color:",";border:solid 1px ",";&:focus-visible:not([disabled]),&:hover:not([disabled]){box-shadow:",";background-color:",";color:",";border-color:",";}&:active:not([disabled]){box-shadow:inset ",";}"],e=>e.theme.radius,e=>e.theme.margin,e=>e.theme.margin,e=>e.subtle?e.theme.boxShadow:"none",e=>e.subtle?e.theme.colors.bg:e.theme.colors.main,e=>e.subtle?e.theme.colors.textLight:e.theme.colors.bg,e=>e.subtle?e.theme.colors.bg2:e.theme.colors.main,e=>e.theme.boxShadowSoft,e=>e.subtle?e.theme.colors.bg:e.theme.colors.mainLight,e=>e.subtle?e.theme.colors.main:e.theme.colors.bg,e=>e.subtle?e.theme.colors.main:e.theme.colors.mainLight,e=>e.theme.boxShadowIntense),ID=B(mx).withConfig({displayName:"ButtonIcon",componentId:"sc-1inckz0-4"})(["box-shadow:none;border-color:transparent;border-radius:999px;font-size:0.8rem;width:1.3rem;height:1.3rem;display:inline-flex;margin:0;padding:0;&:active:not([disabled]){box-shadow:",";}&:active:not([disabled]){box-shadow:inset ",";}"],e=>e.theme.boxShadowIntense,e=>e.theme.boxShadowIntense),ta=B(px).withConfig({displayName:"ButtonInput",componentId:"sc-1inckz0-5"})(["padding:0 0.5rem;background-color:",";color:",";flex:0;height:auto;border-left:solid 1px ",";border-radius:0;@media (hover:hover) and (pointer:fine){&:hover:not([disabled]),&:active:not([disabled]),&:focus-visible:not([disabled]){color:",";background-color:",";}}&:last-child{border-radius:",";border-top-left-radius:0;border-bottom-left-radius:0;}"],e=>e.theme.colors.bg,e=>e.theme.colors.textLight,e=>e.theme.colors.bg2,e=>e.theme.colors.main,e=>e.theme.colors.bg1,e=>e.theme.radius);function Ur(e){const[t,n]=va("subject"),r=_t(),{pathname:i,search:o}=ka();function a(s){const u=new URL(s);window.location.origin===u.origin?e?r(u.pathname+u.search,{replace:!0}):r(u.pathname+u.search):n(s)}if(t===void 0){if(i.startsWith("/app/"))return[void 0,a];const s=i==="/"?"":i;return[window.location.origin+s+o,a]}return[t,a]}function gf(e){const[t,n]=Ur(),[r,i]=w.useState(void 0);w.useEffect(()=>{i(t?new URL(t).searchParams:void 0)},[t]);function o(s){if(!r||!t)return;s===void 0?r.delete(e):r.set(e,s);const u=new URL(t);s&&u.searchParams.set(e,s),(s===void 0||s===""||s===null)&&u.searchParams.delete(e),n(u.href)}let a=r==null?void 0:r.get(e);return a==null&&(a=void 0),[a,o]}const bd=B("span").withConfig({displayName:"SideBarItem",componentId:"sc-ekpp36-0"})(["display:flex;min-height:","rem;align-items:center;justify-content:flex-start;color:",";padding:0.2rem;padding-left:1rem;text-overflow:ellipsis;text-decoration:none;border-radius:",";&:hover,&:focus{background-color:",";color:",";}&:active{background-color:",";}"],e=>e.theme.margin*.5+1,e=>e.disabled?e.theme.colors.main:e.theme.colors.textLight,e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.disabled?e.theme.colors.main:e.theme.colors.text,e=>e.theme.colors.bg2),Nt=B.span.withConfig({displayName:"ErrorLook",componentId:"sc-9yiuih-0"})(["color:",";font-family:monospace;line-height:1.2rem;"],e=>e.theme.colors.alert);function s1({error:e,showTrace:t}){return M(OD,{children:[M(LD,{children:[f(rx,{}),"Something went wrong"]}),f(uw,{children:e.message}),t&&M(be,{children:[f("span",{children:"Stack trace:"}),f(uw,{children:e.stack})]})]})}const OD=B.div.withConfig({displayName:"ErrorLookBig",componentId:"sc-9yiuih-1"})(["color:",";font-size:1rem;padding:","rem;border-radius:",";border:1px solid ",";background-color:",";"],e=>e.theme.colors.alert,e=>e.theme.margin,e=>e.theme.radius,e=>gi(.2,e.theme.colors.alert),e=>e.theme.colors.bg1),uw=B.code.withConfig({displayName:"CodeBlock",componentId:"sc-9yiuih-2"})(["white-space:pre-wrap;border-radius:",";padding:","rem;background-color:",";"],e=>e.theme.radius,e=>e.theme.margin,e=>e.theme.colors.bg),LD=B.p.withConfig({displayName:"BiggerText",componentId:"sc-9yiuih-3"})(["font-size:1.3rem;display:flex;align-items:center;gap:1ch;"]);function gx(){return typeof window<"u"&&window.__TAURI_METADATA__!==void 0}const DD=e=>new Promise(t=>setTimeout(t,e));function Vh(){const e=_t(),{viewTransitionsEnabled:t}=ot();return w.useCallback(r=>{if(!t||!document.startViewTransition){e(r);return}document.startViewTransition(async()=>new Promise(i=>{Lr.flushSync(()=>{e(r),DD(1).then(()=>{i()})})}))},[e])}const We=({children:e,clean:t,subject:n,path:r,href:i,untabbable:o,className:a,...s})=>{const u=Vh();if(!n&&!i&&!r)return f(Nt,{children:"No `subject`, `path` or `href` passed to this AtomicLink."});let l;try{l=n?window.location.toString()===$t(n):!1}catch{return f("span",{children:n})}const c=p=>{if(!i){if(p.preventDefault(),r){u(r);return}if(n){if(l)return;u($t(n))}}},h=i||n||wD(r);return M(MD,{clean:t,className:a,about:n,onClick:c,href:h,disabled:l,tabIndex:l||o?-1:0,target:gx()&&!i?"":"_blank",...s,children:[e,i&&!t&&f(ix,{})]})},MD=B.a.withConfig({displayName:"LinkView",componentId:"sc-ctv6y7-0"})(["color:",";text-decoration:none;cursor:pointer;pointer-events:",";svg{font-size:60%;}&:hover{color:",";text-decoration:",";}&:active{color:",";}"],e=>e.disabled?e.theme.colors.text:e.theme.colors.main,e=>e.disabled?"none":"inherit",e=>e.theme.colors.mainLight,e=>e.clean?"none":"underline",e=>e.theme.colors.mainDark);function ND(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}const vx=()=>eC*1.5;function Ty({open:e,className:t,children:n}){const[r,i]=w.useState(e);return w.useEffect(()=>{if(!e)return ND(()=>{i(!1)},vx());i(!0)},[e]),f(zD,{open:e,className:t,children:f(jD,{children:r&&n})})}const zD=B.div.withConfig({displayName:"GridCollapser",componentId:"sc-1po5n2j-0"})(["display:grid;grid-template-rows:",";transition:grid-template-rows ","ms ease-in-out;@media (prefers-reduced-motion){transition:unset;}"],({open:e})=>e?"1fr":"0fr",()=>vx()),jD=B.div.withConfig({displayName:"CollapseInner",componentId:"sc-1po5n2j-1"})(["overflow:hidden;"]);function yx({open:e,initialState:t,children:n,title:r,disabled:i,onStateToggle:o}){const[a,s]=de.useState(t);w.useEffect(()=>{s(e)},[e]);const u=w.useCallback(()=>{s(l=>(o==null||o(!l),!l))},[]);return M(be,{children:[M(BD,{children:[f(UD,{type:"button",onClick:u,turn:!!a,hide:!!i,"aria-label":a?"collapse":"expand",children:f($D,{})}),f(FD,{children:r})]}),f(HD,{open:!!a,children:n})]})}yx.defaultProps={open:!1};const BD=B.div.withConfig({displayName:"SummaryWrapper",componentId:"sc-1pf9ay1-0"})(["max-width:100%;display:flex;align-items:center;gap:0.4rem;"]),FD=B.div.withConfig({displayName:"TitleWrapper",componentId:"sc-1pf9ay1-1"})(["flex:1;width:1px;*{user-select:none;}"]),$D=B(Sy).withConfig({displayName:"Icon",componentId:"sc-1pf9ay1-2"})(["color:",";margin-top:auto;cursor:pointer;*{cursor:pointer;}font-size:1.2rem;"],({theme:e})=>e.colors.main),UD=B.button.withConfig({displayName:"IconButton",componentId:"sc-1pf9ay1-3"})(["--speed:",";aspect-ratio:1/1;display:flex;align-items:center;padding:0.2rem;visibility:",";transition:transform var(--speed) ease-in-out,background-color var(--speed) ease;transform:rotate(",");background-color:transparent;border:none;border-radius:50%;:hover,:focus{background-color:",";}"],e=>e.theme.animation.duration,e=>e.hide?"hidden":"visible",e=>e.turn?"90deg":"0deg",e=>e.theme.colors.bg1),HD=B(Ty).withConfig({displayName:"StyledCollapse",componentId:"sc-1pf9ay1-4"})(["overflow-x:hidden;margin-left:","rem;"],({theme:e})=>e.margin);function WD(e){const t=new URLSearchParams({...e?{parentSubject:e}:{}});return`${$e.new}?${t.toString()}`}function bx(e){const t=_t();return w.useCallback(()=>{const r=WD(e);t(r)},[e])}var uu=(e=>(e[e.Simple=0]="Simple",e[e.Outline=1]="Outline",e[e.Fill=2]="Fill",e[e.Colored=3]="Colored",e))(uu||{});const oi=de.forwardRef(({variant:e,children:t,color:n,...r},i)=>{const o=Sx.get(e)??Iy;return f(o,{ref:i,color:n,...r,children:t})});oi.displayName="IconButton";const wx={variant:0,color:"inherit",size:"1em"};oi.defaultProps=wx;const Py=de.forwardRef(({variant:e,children:t,color:n,...r},i)=>{const o=Sx.get(e)??Iy;return f(o,{ref:i,color:n,as:"a",...r,children:t})});Py.displayName="IconButtonLink";Py.defaultProps=wx;const qh=B.button.withConfig({displayName:"IconButtonBase",componentId:"sc-7cq1bm-0"})(["--button-padding:0.4em;cursor:pointer;display:inline-grid;place-items:center;",";color:",";font-size:",";border:none;padding:var(--button-padding);width:calc(1em + var(--button-padding) * 2);height:calc(1em + var(--button-padding) * 2);&[disabled]{opacity:0.5;cursor:not-allowed;}"],Nu("background-color","color","box-shadow","filter"),e=>e.theme.colors.text,e=>e.size??"1em"),Iy=B(qh).withConfig({displayName:"SimpleIconButton",componentId:"sc-7cq1bm-1"})(["color:",";background-color:transparent;border-radius:",";&:not([disabled]){&:hover,&:focus{background-color:",";}:active{background-color:",";}}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.theme.colors.bg2),VD=B(qh).withConfig({displayName:"OutlineIconButton",componentId:"sc-7cq1bm-2"})(["color:",";background-color:",";border-radius:50%;&:not([disabled]){&:hover,&:focus{color:",";box-shadow:0px 0px 0px 1.5px ",",",";}}&&:active{background-color:",";color:white;}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.colors.bg,e=>e.theme.colors.main,e=>e.theme.colors.main,e=>e.theme.boxShadowSoft,e=>e.theme.colors.main),qD=B(qh).withConfig({displayName:"FillIconButton",componentId:"sc-7cq1bm-3"})(["color:",";background-color:unset;border-radius:50%;&:hover,&:focus{color:white;background-color:",";box-shadow:",";}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.colors.main,e=>e.theme.boxShadowSoft),KD=B(qh).withConfig({displayName:"ColoredIconButton",componentId:"sc-7cq1bm-4"})(["color:white;background-color:",";border-radius:50%;&:hover,&:focus{color:white;filter:brightness(1.3);box-shadow:",";}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.boxShadowSoft),Sx=new Map([[0,Iy],[1,VD],[2,qD],[3,KD]]),Oy=(e,t="Open menu",n=oi)=>{const r=({onClick:i,menuId:o},a)=>f(n,{"aria-controls":o,onClick:i,ref:a,title:t,children:e});return r.DisplayName="DefaultTrigger",r};/*! + */var DD=w,ND=Symbol.for("react.element"),MD=Symbol.for("react.fragment"),zD=Object.prototype.hasOwnProperty,jD=DD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,BD={key:!0,ref:!0,__self:!0,__source:!0};function xx(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)zD.call(t,r)&&!BD.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:ND,type:e,key:o,ref:a,props:i,_owner:jD.current}}qh.Fragment=MD;qh.jsx=xx;qh.jsxs=xx;(function(e){e.exports=qh})(LD);const f=uu.jsx,O=uu.jsxs,ye=uu.Fragment,Cx=()=>f(FD,{viewBox:"0 0 50 50",children:f("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4"})}),FD=B.svg.withConfig({displayName:"StyledSpinner",componentId:"sc-1q9znf8-0"})(["animation:rotate 2s linear infinite;width:50px;height:50px;max-width:100%;max-height:100%;& .path{stroke:",";stroke-linecap:round;animation:dash 1.5s ease-in-out infinite;}@keyframes rotate{100%{transform:rotate(360deg);}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0;}50%{stroke-dasharray:90,150;stroke-dashoffset:-35;}100%{stroke-dasharray:90,150;stroke-dashoffset:-124;}}"],e=>e.theme.colors.main),ve=de.forwardRef(({children:e,clean:t,icon:n,loading:r,...i},o)=>{let a=Ty;return n&&(a=$D),t&&(a=Kh),f(a,{type:"button",...i,ref:o,children:r?f(Cx,{}):e})});ve.displayName="Button";const Kh=B.button.withConfig({displayName:"ButtonClean",componentId:"sc-1inckz0-0"})(["cursor:pointer;border:none;outline:none;font-size:inherit;padding:0;color:inherit;margin:0;-webkit-appearance:none;background-color:initial;-webkit-tap-highlight-color:transparent;"]),_x=B(Kh).withConfig({displayName:"ButtonBase",componentId:"sc-1inckz0-1"})(["height:2rem;display:flex;align-items:center;justify-content:center;background-color:",";color:",";white-space:nowrap;margin-bottom:",";",";@media (hover:hover) and (pointer:fine){&:hover:not([disabled]),&:focus-visible:not([disabled]){border-color:",";outline:0;}}&:active:not([disabled]){transition:all 0s;}&:disabled{cursor:default;display:auto;opacity:0.5;}"],e=>e.theme.colors.main,e=>e.theme.colors.bg,e=>e.gutter?`${e.theme.margin}rem`:"",zu("background-color","box-shadow","transform","color"),e=>e.theme.colors.main),wd=B(Kh).withConfig({displayName:"ButtonBar",componentId:"sc-1inckz0-2"})(["padding-right:0.5rem;padding-left:0.5rem;color:",";background-color:",";height:100%;display:flex;align-items:center;&:hover:not([disabled]),&:focus-visible:not([disabled]){background-color:",";}&:active:not([disabled]){background-color:",";}padding-left:",";padding-right:",";"],e=>e.theme.colors.main,e=>e.selected?e.theme.colors.bg2:e.theme.colors.bg,e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.leftPadding?"1.2rem":"",e=>e.rightPadding?"1.2rem":""),Ty=B(_x).withConfig({displayName:"ButtonDefault",componentId:"sc-1inckz0-3"})(["padding:0.4rem;border-radius:",";padding-left:","rem;padding-right:","rem;box-shadow:",";display:inline-flex;background-color:",";color:",";border:solid 1px ",";&:focus-visible:not([disabled]),&:hover:not([disabled]){box-shadow:",";background-color:",";color:",";border-color:",";}&:active:not([disabled]){box-shadow:inset ",";}"],e=>e.theme.radius,e=>e.theme.margin,e=>e.theme.margin,e=>e.subtle?e.theme.boxShadow:"none",e=>e.subtle?e.theme.colors.bg:e.theme.colors.main,e=>e.subtle?e.theme.colors.textLight:e.theme.colors.bg,e=>e.subtle?e.theme.colors.bg2:e.theme.colors.main,e=>e.theme.boxShadowSoft,e=>e.subtle?e.theme.colors.bg:e.theme.colors.mainLight,e=>e.subtle?e.theme.colors.main:e.theme.colors.bg,e=>e.subtle?e.theme.colors.main:e.theme.colors.mainLight,e=>e.theme.boxShadowIntense),$D=B(Ty).withConfig({displayName:"ButtonIcon",componentId:"sc-1inckz0-4"})(["box-shadow:none;border-color:transparent;border-radius:999px;font-size:0.8rem;width:1.3rem;height:1.3rem;display:inline-flex;margin:0;padding:0;&:active:not([disabled]){box-shadow:",";}&:active:not([disabled]){box-shadow:inset ",";}"],e=>e.theme.boxShadowIntense,e=>e.theme.boxShadowIntense),ta=B(_x).withConfig({displayName:"ButtonInput",componentId:"sc-1inckz0-5"})(["padding:0 0.5rem;background-color:",";color:",";flex:0;height:auto;border-left:solid 1px ",";border-radius:0;@media (hover:hover) and (pointer:fine){&:hover:not([disabled]),&:active:not([disabled]),&:focus-visible:not([disabled]){color:",";background-color:",";}}&:last-child{border-radius:",";border-top-left-radius:0;border-bottom-left-radius:0;}"],e=>e.theme.colors.bg,e=>e.theme.colors.textLight,e=>e.theme.colors.bg2,e=>e.theme.colors.main,e=>e.theme.colors.bg1,e=>e.theme.radius);function kr(e){const[t,n]=va("subject"),r=Et(),{pathname:i,search:o}=ka();function a(s){const u=new URL(s);window.location.origin===u.origin?e?r(u.pathname+u.search,{replace:!0}):r(u.pathname+u.search):n(s)}if(t===void 0){if(i.startsWith("/app/"))return[void 0,a];const s=i==="/"?"":i;return[window.location.origin+s+o,a]}return[t,a]}function yf(e){const[t,n]=kr(),[r,i]=w.useState(void 0);w.useEffect(()=>{i(t?new URL(t).searchParams:void 0)},[t]);function o(s){if(!r||!t)return;s===void 0?r.delete(e):r.set(e,s);const u=new URL(t);s&&u.searchParams.set(e,s),(s===void 0||s===""||s===null)&&u.searchParams.delete(e),n(u.href)}let a=r==null?void 0:r.get(e);return a==null&&(a=void 0),[a,o]}const Sd=B("span").withConfig({displayName:"SideBarItem",componentId:"sc-ekpp36-0"})(["display:flex;min-height:","rem;align-items:center;justify-content:flex-start;color:",";padding:0.2rem;padding-left:1rem;text-overflow:ellipsis;text-decoration:none;border-radius:",";&:hover,&:focus{background-color:",";color:",";}&:active{background-color:",";}"],e=>e.theme.margin*.5+1,e=>e.disabled?e.theme.colors.main:e.theme.colors.textLight,e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.disabled?e.theme.colors.main:e.theme.colors.text,e=>e.theme.colors.bg2),Lt=B.span.withConfig({displayName:"ErrorLook",componentId:"sc-9yiuih-0"})(["color:",";font-family:monospace;line-height:1.2rem;"],e=>e.theme.colors.alert);function l1({error:e,showTrace:t}){return O(HD,{children:[O(UD,{children:[f(px,{}),"Something went wrong"]}),f(yw,{children:e.message}),t&&O(ye,{children:[f("span",{children:"Stack trace:"}),f(yw,{children:e.stack})]})]})}const HD=B.div.withConfig({displayName:"ErrorLookBig",componentId:"sc-9yiuih-1"})(["color:",";font-size:1rem;padding:","rem;border-radius:",";border:1px solid ",";background-color:",";"],e=>e.theme.colors.alert,e=>e.theme.margin,e=>e.theme.radius,e=>gi(.2,e.theme.colors.alert),e=>e.theme.colors.bg1),yw=B.code.withConfig({displayName:"CodeBlock",componentId:"sc-9yiuih-2"})(["white-space:pre-wrap;border-radius:",";padding:","rem;background-color:",";"],e=>e.theme.radius,e=>e.theme.margin,e=>e.theme.colors.bg),UD=B.p.withConfig({displayName:"BiggerText",componentId:"sc-9yiuih-3"})(["font-size:1.3rem;display:flex;align-items:center;gap:1ch;"]);function Ex(){return typeof window<"u"&&window.__TAURI_METADATA__!==void 0}const VD=e=>new Promise(t=>setTimeout(t,e));function ju(){const e=Et(),{viewTransitionsEnabled:t}=ot();return w.useCallback(r=>{if(!t||!document.startViewTransition){e(r);return}document.startViewTransition(async()=>new Promise(i=>{Mr.flushSync(()=>{e(r),VD(1).then(()=>{i()})})}))},[e])}const Ve=({children:e,clean:t,subject:n,path:r,href:i,untabbable:o,className:a,...s})=>{const u=ju();if(!n&&!i&&!r)return f(Lt,{children:"No `subject`, `path` or `href` passed to this AtomicLink."});let l;try{l=n?window.location.toString()===zt(n):!1}catch{return f("span",{children:n})}const c=p=>{if(!i){if(p.preventDefault(),r){u(r);return}if(n){if(l)return;u(zt(n))}}},h=i||n||TD(r);return O(WD,{clean:t,className:a,about:n,onClick:c,href:h,disabled:l,tabIndex:l||o?-1:0,target:Ex()&&!i?"":"_blank",...s,children:[e,i&&!t&&f(mx,{})]})},WD=B.a.withConfig({displayName:"LinkView",componentId:"sc-ctv6y7-0"})(["color:",";text-decoration:none;cursor:pointer;pointer-events:",";svg{font-size:60%;}&:hover{color:",";text-decoration:",";}&:active{color:",";}"],e=>e.disabled?e.theme.colors.text:e.theme.colors.main,e=>e.disabled?"none":"inherit",e=>e.theme.colors.mainLight,e=>e.clean?"none":"underline",e=>e.theme.colors.mainDark);function qD(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}const Rx=()=>oC*1.5;function Py({open:e,className:t,children:n}){const[r,i]=w.useState(e);return w.useEffect(()=>{if(!e)return qD(()=>{i(!1)},Rx());i(!0)},[e]),f(KD,{open:e,className:t,children:f(GD,{children:r&&n})})}const KD=B.div.withConfig({displayName:"GridCollapser",componentId:"sc-1po5n2j-0"})(["display:grid;grid-template-rows:",";transition:grid-template-rows ","ms ease-in-out;@media (prefers-reduced-motion){transition:unset;}"],({open:e})=>e?"1fr":"0fr",()=>Rx()),GD=B.div.withConfig({displayName:"CollapseInner",componentId:"sc-1po5n2j-1"})(["overflow:hidden;"]);function Ax({open:e,initialState:t,children:n,title:r,disabled:i,onStateToggle:o}){const[a,s]=de.useState(t);w.useEffect(()=>{s(e)},[e]);const u=w.useCallback(()=>{s(l=>(o==null||o(!l),!l))},[]);return O(ye,{children:[O(YD,{children:[f(JD,{type:"button",onClick:u,turn:!!a,hide:!!i,"aria-label":a?"collapse":"expand",children:f(QD,{})}),f(XD,{children:r})]}),f(ZD,{open:!!a,children:n})]})}Ax.defaultProps={open:!1};const YD=B.div.withConfig({displayName:"SummaryWrapper",componentId:"sc-1pf9ay1-0"})(["max-width:100%;display:flex;align-items:center;gap:0.4rem;"]),XD=B.div.withConfig({displayName:"TitleWrapper",componentId:"sc-1pf9ay1-1"})(["flex:1;width:1px;*{user-select:none;}"]),QD=B(ky).withConfig({displayName:"Icon",componentId:"sc-1pf9ay1-2"})(["color:",";margin-top:auto;cursor:pointer;*{cursor:pointer;}font-size:1.2rem;"],({theme:e})=>e.colors.main),JD=B.button.withConfig({displayName:"IconButton",componentId:"sc-1pf9ay1-3"})(["--speed:",";aspect-ratio:1/1;display:flex;align-items:center;padding:0.2rem;visibility:",";transition:transform var(--speed) ease-in-out,background-color var(--speed) ease;transform:rotate(",");background-color:transparent;border:none;border-radius:50%;:hover,:focus{background-color:",";}"],e=>e.theme.animation.duration,e=>e.hide?"hidden":"visible",e=>e.turn?"90deg":"0deg",e=>e.theme.colors.bg1),ZD=B(Py).withConfig({displayName:"StyledCollapse",componentId:"sc-1pf9ay1-4"})(["overflow-x:hidden;margin-left:","rem;"],({theme:e})=>e.margin);function eN(e){const t=new URLSearchParams({...e?{parentSubject:e}:{}});return`${Fe.new}?${t.toString()}`}function Tx(e){const t=Et();return w.useCallback(()=>{const r=eN(e);t(r)},[e])}var cu=(e=>(e[e.Simple=0]="Simple",e[e.Outline=1]="Outline",e[e.Fill=2]="Fill",e[e.Colored=3]="Colored",e))(cu||{});const yr=de.forwardRef(({variant:e,children:t,color:n,...r},i)=>{const o=Ix.get(e)??Oy;return f(o,{ref:i,color:n,...r,children:t})});yr.displayName="IconButton";const Px={variant:0,color:"inherit",size:"1em"};yr.defaultProps=Px;const Iy=de.forwardRef(({variant:e,children:t,color:n,...r},i)=>{const o=Ix.get(e)??Oy;return f(o,{ref:i,color:n,as:"a",...r,children:t})});Iy.displayName="IconButtonLink";Iy.defaultProps=Px;const Gh=B.button.withConfig({displayName:"IconButtonBase",componentId:"sc-7cq1bm-0"})(["--button-padding:0.4em;cursor:pointer;display:inline-grid;place-items:center;",";color:",";font-size:",";border:none;padding:var(--button-padding);width:calc(1em + var(--button-padding) * 2);height:calc(1em + var(--button-padding) * 2);&[disabled]{opacity:0.5;cursor:not-allowed;}"],zu("background-color","color","box-shadow","filter"),e=>e.theme.colors.text,e=>e.size??"1em"),Oy=B(Gh).withConfig({displayName:"SimpleIconButton",componentId:"sc-7cq1bm-1"})(["color:",";background-color:transparent;border-radius:",";&:not([disabled]){&:hover,&:focus{background-color:",";}:active{background-color:",";}}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.theme.colors.bg2),tN=B(Gh).withConfig({displayName:"OutlineIconButton",componentId:"sc-7cq1bm-2"})(["color:",";background-color:",";border-radius:50%;&:not([disabled]){&:hover,&:focus{color:",";box-shadow:0px 0px 0px 1.5px ",",",";}}&&:active{background-color:",";color:white;}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.colors.bg,e=>e.theme.colors.main,e=>e.theme.colors.main,e=>e.theme.boxShadowSoft,e=>e.theme.colors.main),nN=B(Gh).withConfig({displayName:"FillIconButton",componentId:"sc-7cq1bm-3"})(["color:",";background-color:unset;border-radius:50%;&:hover,&:focus{color:white;background-color:",";box-shadow:",";}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.colors.main,e=>e.theme.boxShadowSoft),rN=B(Gh).withConfig({displayName:"ColoredIconButton",componentId:"sc-7cq1bm-4"})(["color:white;background-color:",";border-radius:50%;&:hover,&:focus{color:white;filter:brightness(1.3);box-shadow:",";}"],e=>e.color==="inherit"?"inherit":e.theme.colors[e.color],e=>e.theme.boxShadowSoft),Ix=new Map([[0,Oy],[1,tN],[2,nN],[3,rN]]),Ly=(e,t="Open menu",n=yr)=>{const r=({onClick:i,menuId:o},a)=>f(n,{"aria-controls":o,onClick:i,ref:a,title:t,children:e});return r.DisplayName="DefaultTrigger",r};/*! * hotkeys-js v3.8.7 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * @@ -269,27 +269,27 @@ to { * http://jaywcjlove.github.io/hotkeys * * Licensed under the MIT license. - */var Um=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Hm(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function kx(e,t){for(var n=t.slice(0,t.length-1),r=0;r=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function GD(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,o=0;o=0&&Et.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Et.splice(0,Et.length),(t===93||t===224)&&(t=91),t in mn){mn[t]=!1;for(var r in ya)ya[r]===t&&(hr[r]=!1)}}function eM(e){if(!e)Object.keys(sn).forEach(function(a){return delete sn[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Wm(a)});else if(typeof e=="object")e.key&&Wm(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?kx(ya,l):[];sn[p]=sn[p].map(function(g){var b=i?g.method===i:!0;return b&&g.scope===r&&GD(g.mods,y)?{}:g})}})};function dw(e,t,n){var r;if(t.scope===n||t.scope==="all"){r=t.mods.length>0;for(var i in mn)Object.prototype.hasOwnProperty.call(mn,i)&&(!mn[i]&&t.mods.indexOf(+i)>-1||mn[i]&&t.mods.indexOf(+i)===-1)&&(r=!1);(t.mods.length===0&&!mn[16]&&!mn[18]&&!mn[17]&&!mn[91]||r||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function fw(e){var t=sn["*"],n=e.keyCode||e.which||e.charCode;if(hr.filter.call(this,e)){if((n===93||n===224)&&(n=91),Et.indexOf(n)===-1&&n!==229&&Et.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(y){var g=cw[y];e[y]&&Et.indexOf(g)===-1?Et.push(g):!e[y]&&Et.indexOf(g)>-1?Et.splice(Et.indexOf(g),1):y==="metaKey"&&e[y]&&Et.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Et=Et.slice(Et.indexOf(g))))}),n in mn){mn[n]=!0;for(var r in ya)ya[r]===n&&(hr[r]=!0);if(!t)return}for(var i in mn)Object.prototype.hasOwnProperty.call(mn,i)&&(mn[i]=e[cw[i]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Et.indexOf(17)===-1&&Et.push(17),Et.indexOf(18)===-1&&Et.push(18),mn[17]=!0,mn[18]=!0);var o=cu();if(t)for(var a=0;a-1}function hr(e,t,n){Et=[];var r=xx(e),i=[],o="all",a=document,s=0,u=!1,l=!0,c="+";for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(o=t.scope),t.element&&(a=t.element),t.keyup&&(u=t.keyup),t.keydown!==void 0&&(l=t.keydown),typeof t.splitKey=="string"&&(c=t.splitKey)),typeof t=="string"&&(o=t);s1&&(i=kx(ya,e)),e=e[e.length-1],e=e==="*"?"*":Kh(e),e in sn||(sn[e]=[]),sn[e].push({keyup:u,keydown:l,scope:o,mods:i,shortcut:r[s],method:n,key:r[s],splitKey:c});typeof a<"u"&&!tM(a)&&window&&(Ex.push(a),Hm(a,"keydown",function(h){fw(h)}),Hm(window,"focus",function(){Et=[]}),Hm(a,"keyup",function(h){fw(h),ZD(h)}))}var Vm={setScope:Rx,getScope:cu,deleteScope:JD,getPressedKeyCodes:YD,isPressed:QD,filter:XD,unbind:eM};for(var qm in Vm)Object.prototype.hasOwnProperty.call(Vm,qm)&&(hr[qm]=Vm[qm]);if(typeof window<"u"){var nM=window.hotkeys;hr.noConflict=function(e){return e&&window.hotkeys===hr&&(window.hotkeys=nM),hr},window.hotkeys=hr}hr.filter=function(){return!0};var Ax=function(t,n){var r=t.target,i=r&&r.tagName;return Boolean(i&&n&&n.includes(i))},rM=function(t){return Ax(t,["INPUT","TEXTAREA","SELECT"])};function je(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},o=i.enableOnTags,a=i.filter,s=i.keyup,u=i.keydown,l=i.filterPreventDefault,c=l===void 0?!0:l,h=i.enabled,p=h===void 0?!0:h,y=i.enableOnContentEditable,g=y===void 0?!1:y,b=w.useRef(null),_=w.useCallback(function(S,k){var C;return a&&!a(S)?!c:rM(S)&&!Ax(S,o)||(C=S.target)!=null&&C.isContentEditable&&!g?!0:b.current===null||document.activeElement===b.current?(t(S,k),!0):!1},r?[b,o,a].concat(r):[b,o,a]);return w.useEffect(function(){if(!p){hr.unbind(e,_);return}return s&&u!==!0&&(n.keydown=!1),hr(e,n||{},_),function(){return hr.unbind(e,_)}},[_,e,p]),b}hr.isPressed;const iM=(e,t)=>e.filter(n=>n.current).some(n=>{var r;return n.current===t||((r=n.current)==null?void 0:r.contains(t))}),oM=(e,t)=>{e.forEach(n=>window.addEventListener(n,t))},hw=(e,t)=>{e.forEach(n=>window.removeEventListener(n,t))},Tx=(e,t,n=!0,r=["mousedown"])=>{w.useEffect(()=>{const i=o=>{n&&!iM(e,o.target)&&(o.preventDefault(),t(),hw(r,i))};return oM(r,i),()=>{hw(r,i)}},[e,t,n])},st={edit:Ho("e"),data:Ho("d"),home:Ho("h"),new:Ho("n"),userSettings:Ho("u"),themeSettings:Ho("t"),keyboardShortcuts:"shift+/",search:"/",menu:Ho("m"),sidebarToggle:"\\",moveLineUp:Km("up"),moveLineDown:Km("down"),deleteLine:Km("backspace")};function Ho(e){return navigator.platform.includes("Mac")?`cmd+${e}`:`ctrl+${e}`}function Km(e){return navigator.platform.includes("Mac")?`option+${e}`:`alt+${e}`}function aM(e){return navigator.platform.includes("Mac")?e.replace("cmd+","⌘").replace("option+","⌥").replace("shift+","⇧").replace("backspace","⌫"):e}function sM({children:e}){const t=_t(),[n]=Ur(),{sideBarLocked:r,setSideBarLocked:i}=ot();return je(st.edit,o=>{o.preventDefault(),dn.isValidSubject(n)&&t(Hh(n))},{},[n]),je(st.data,o=>{o.preventDefault(),dn.isValidSubject(n)&&t(dx(n))},{},[n]),je(st.home,o=>{o.preventDefault(),t("/")}),je(st.new,o=>{o.preventDefault(),t($e.new)}),je(st.userSettings,o=>{o.preventDefault(),t($e.agentSettings)}),je(st.themeSettings,o=>{o.preventDefault(),t($e.themeSettings)}),je(st.keyboardShortcuts,o=>{o.preventDefault(),t($e.shortcuts)}),je(st.sidebarToggle,o=>{o.preventDefault(),i(!r)},{},[r]),f(be,{children:e})}function Px({shortcut:e,className:t}){const n=aM(e).split("+");return f(lM,{className:t,children:n.map((r,i)=>M(de.Fragment,{children:[f(uM,{children:r})," ",ie.theme.colors.bg2,e=>e.theme.colors.bg1),l1="divider",cM=(e,t)=>(e%t+t)%t,is=e=>typeof e!="string"&&typeof(e==null?void 0:e.label)=="string",dM=e=>!is(e)||e.disabled,fM=e=>(t,n)=>{const r=i=>{const o=cM(t+i,e.length);return o===t?0:dM(e[o])?r(i+n):o};return r(n)};function hM(e){return e.reduce((t,n,r)=>(r===0||r===e.length-1)&&!is(n)||!is(n)&&!is(t[r-1])?t:[...t,n],[])}function Ix({items:e,trigger:t,isMainMenu:n}){const r=w.useId(),i=w.useRef(null),o=w.useRef(null),[a,s]=w.useState(!1),[u,l]=w.useState(!1),c=w.useCallback(()=>{l(!1),d(!1),setTimeout(()=>{s(!1),S(0)},100)},[]);Tx([o,i],c,a,["click","mouseout"]);const h=w.useMemo(()=>hM(e),[e]),[p,y]=w.useState(0),[g,b]=w.useState(0),[_,S]=w.useState(0),k=fM(h),[C,d]=w.useState(!1),v=w.useCallback(()=>{if(a){c();return}s(!0),requestAnimationFrame(()=>{const A=o.current.getBoundingClientRect(),L=i.current.getBoundingClientRect(),P=A.y-L.height;P<0?b(A.y+A.height/2):b(P+A.height/2),A.x-L.width<0?y(A.x):y(A.x-L.width+A.width),l(!0)})},[a]),m=w.useCallback(()=>{d(!1),v()},[v]);je("esc",()=>{c()},{enabled:a}),je(st.menu,A=>{A.preventDefault(),v(),d(!0)},{enabled:!!n},[a]),je("enter",A=>{A.preventDefault(),h[_].onClick(),c()},{enabled:a},[_,h]),je("up",A=>{A.preventDefault(),d(!0),S(L=>k(L,-1))},{enabled:a},[k]),je("down",A=>(A.preventDefault(),d(!0),S(L=>k(L,1)),!1),{enabled:a},[k]);const x=w.useMemo(()=>de.forwardRef(t),[]);return M(be,{children:[f(x,{ref:o,onClick:m,isActive:a,menuId:r}),f(bM,{ref:i,visible:u,x:p,y:g,id:r,children:a&&h.map((A,L)=>{if(!is(A))return f(yM,{},L);const{label:P,onClick:O,helper:V,id:H,disabled:j,shortcut:F,icon:R}=A;return f(pM,{onClick:()=>{c(),O()},id:H,"data-test":`menu-item-${H}`,disabled:j,helper:F?`${V} (${F})`:V,label:P,selected:C&&_===L,icon:R,shortcut:F},H)})})]})}function pM({onClick:e,selected:t,helper:n,disabled:r,shortcut:i,icon:o,label:a,...s}){return M(vM,{clean:!0,onClick:e,selected:t,title:n,disabled:r,...s,children:[o,f(gM,{children:a}),i&&f(mM,{shortcut:i})]})}const mM=B(Px).withConfig({displayName:"StyledShortcut",componentId:"sc-yx9vez-0"})(["margin-left:0.3rem;"]),gM=B.span.withConfig({displayName:"StyledLabel",componentId:"sc-yx9vez-1"})(["flex:1;"]),vM=B(ve).withConfig({displayName:"MenuItemStyled",componentId:"sc-yx9vez-2"})(["align-items:center;display:flex;gap:0.5rem;width:100%;text-align:left;color:",";padding:0.4rem 1rem;height:auto;text-transform:capitalize;background-color:",";text-decoration:",";&:hover{background-color:",";}&:active{background-color:",";}&:disabled{color:",";&:hover{cursor:'default';}background-color:",";}svg{color:",";}"],e=>e.theme.colors.text,e=>e.selected?e.theme.colors.bg1:e.theme.colors.bg,e=>e.selected?"underline":"none",e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,e=>e.theme.colors.bg,e=>e.theme.colors.textLight),yM=B.div.withConfig({displayName:"ItemDivider",componentId:"sc-yx9vez-3"})(["width:100%;border-bottom:1px solid ",";"],e=>e.theme.colors.bg2),bM=B.div.withConfig({displayName:"Menu",componentId:"sc-yx9vez-4"})(["font-size:","rem;overflow:hidden;background:",";border:",";padding-top:0.4rem;padding-bottom:0.4rem;border-radius:8px;position:fixed;z-index:1;top:","px;left:","px;width:auto;box-shadow:",";opacity:",";",";"],e=>e.theme.fontSizeBody,e=>e.theme.colors.bg,e=>e.theme.darkMode?`solid 1px ${e.theme.colors.bg2}`:"none",e=>e.y,e=>e.x,e=>e.theme.boxShadowSoft,e=>e.visible?1:0,Nu("opacity"));function Gh(e){const[t,n]=va("queryscope"),r=_t(),i=w.useCallback(()=>{const a=new URLSearchParams({queryscope:e??""});r(`/app/search?${a.toString()}`,{replace:!0})},[n,e]),o=w.useCallback(()=>{n(void 0)},[n]);return{scope:t,enableScope:i,clearScope:o}}function Ox({subject:e,hide:t,trigger:n,simple:r,isMainMenu:i}){const o=Ke(),a=_t(),s=ka(),{enableScope:u}=Gh(e);if(e===void 0||!dn.isValidSubject(e))return null;async function l(){if(window.confirm("Are you sure you want to permanently delete this resource?")){const y=o.getResourceLoading(e);try{await y.destroy(o),dt.success("Resource deleted!"),a("/")}catch(g){dt.error(g.message)}}}const c=[...r?[]:[{disabled:s.pathname.startsWith($e.show),id:"view",label:"normal view",helper:"Open the regular, default View.",onClick:()=>a($t(e))},{disabled:s.pathname.startsWith($e.data),id:"data",label:"data view",helper:"View the resource and its properties in the Data View.",shortcut:st.data,onClick:()=>a(dx(e))},l1,{id:"refresh",icon:f(lD,{}),label:"refresh",helper:"Fetch the resouce again from the server, possibly see new changes.",onClick:()=>o.fetchResourceFromServer(e)}],{id:"edit",label:"edit",helper:"Open the edit form.",icon:f(_s,{}),shortcut:r?"":st.edit,onClick:()=>a(Hh(e))},{id:"scope",label:"search in",helper:"Scope search to resource",icon:f(Ey,{}),onClick:u},{id:"share",label:"share",icon:f(sx,{}),helper:"Open the share menu",onClick:()=>a(bD(e))},{id:"delete",icon:f(Uh,{}),label:"delete",helper:"Fetch the resouce again from the server, possibly see new changes.",onClick:l},{id:"versions",icon:f(nx,{}),label:"versions",helper:"Show the versions of this resource",onClick:()=>a(kD(e,o.getServerUrl()))},{id:"import",icon:f(Cy,{}),label:"import",helper:"Import Atomic Data to this resource",onClick:()=>a(SD(e))}],h=t?c.filter(y=>!is(y)||!t.includes(y.id)):c,p=n??Oy(f(_y,{}));return f(Ix,{items:h,trigger:p,isMainMenu:i})}function wM({subject:e,className:t}){const n=Ce(e),[r]=Xe(n),i=bx(e);return M(u1,{className:t,children:[f(oi,{"data-test":"add-subresource",onClick:i,title:`Create new resource under ${r}`,children:f(ui,{})}),f(Ox,{simple:!0,subject:e,trigger:kM})]})}const u1=B.span.withConfig({displayName:"Wrapper",componentId:"sc-1q6pwac-0"})(["visibility:hidden;display:none;font-size:0.9rem;color:",";"],e=>e.theme.colors.main),SM=Jn(["position:relative;&:hover ",",&:focus-within ","{visibility:visible;display:inline;}"],u1,u1),kM=Oy(f(_y,{})),Lx=Lu(["from{background-color:var(--loader-bg-from);}to{background-color:var(--loader-bg-to);}"]),Dx=B.span.withConfig({displayName:"LoaderInline",componentId:"sc-1vzqiqx-0"})(["--loader-bg-from:",";--loader-bg-to:",";background-color:",";border-radius:",";animation:"," 0.8s infinite ease-in-out alternate;width:100%;height:1rem;"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg,e=>e.theme.colors.bg1,e=>e.theme.radius,Lx),xM=B.div.withConfig({displayName:"LoaderBlock",componentId:"sc-1vzqiqx-1"})(["--loader-bg-from:",";--loader-bg-to:",";background-color:",";border-radius:",";animation:"," 0.8s infinite ease-in-out alternate;width:100%;height:100%;"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg,e=>e.theme.colors.bg1,e=>e.theme.radius,Lx),CM=new Map([[Ue.folder,ox],[Ue.bookmark,tx],[Ue.chatRoom,KL],[Ue.document,XL],[Ue.file,JL],[Ue.drive,ax],[Ue.commit,nx],[Ue.importer,QL],[Ue.invite,sx],[Ue.collection,iD],[Ue.class,GL],[Ue.property,YL]]);function zu(e,t=WL){return CM.get(e)??t}function Mx({subject:e,ancestry:t,handleClose:n}){const r=w.useRef(null),i=Ce(e,{allowIncomplete:!0}),[o]=Ur(),[a]=Xe(i),[s]=ye(i,J.properties.description),u=o===e,[l,c]=w.useState(u),[h]=it(i,J.properties.subResources),p=h.length>0,[y]=ye(i,J.properties.isA),g=zu(y);w.useEffect(()=>{t.includes(e)&&t[0]!==e&&c(!0)},[t]);const b=w.useMemo(()=>M(_M,{children:[f(EM,{subject:e,clean:!0,active:u,children:f(bd,{onClick:n,disabled:u,resource:e,title:s,ref:r,children:M(RM,{children:[f(g,{}),a]})})}),f(wM,{subject:e})]}),[e,u,n,s,a]);return i.loading?f(bd,{onClick:n,disabled:u,resource:e,title:`${e} is loading...`,children:f(Dx,{})}):i.error?f(bd,{onClick:n,disabled:u,resource:e,ref:r,children:f(Nt,{about:e,title:i.error.message,children:e})}):f(yx,{initialState:l,open:l,disabled:!p,onStateToggle:c,"data-test":"resource-sidebar",title:b,children:p&&h.map(_=>f(Mx,{subject:_,ancestry:t},_))})}const _M=B.div.withConfig({displayName:"ActionWrapper",componentId:"sc-1hsw2p7-0"})(["position:relative;display:flex;width:100%;margin-left:-0.7rem;",""],SM),EM=B(We).withConfig({displayName:"Title",componentId:"sc-1hsw2p7-1"})(["flex:1;overflow:hidden;white-space:nowrap;"]),RM=B.span.withConfig({displayName:"TextWrapper",componentId:"sc-1hsw2p7-2"})(["display:inline-flex;align-items:center;gap:0.4rem;svg{font-size:0.8em;}"]);function Nx(){const e=_t();return f(ve,{type:"button",onClick:()=>e($e.agentSettings),title:"Go the the User Settings page",children:"Sign in"})}const Ly=B("div").withConfig({displayName:"SideBarHeader",componentId:"sc-jc5h9q-0"})(["margin-top:","rem;margin-bottom:0.5rem;padding-left:","rem;padding-right:0.7rem;font-size:1.4rem;font-weight:bold;display:flex;"],e=>e.theme.margin,e=>e.theme.margin);function zx(){return!1}const Gm=[window.location.origin,"https://atomicdata.dev"],AM={commit:!0};function Yh(){const{agent:e}=ot(),t=Ke(),n=Ce(e==null?void 0:e.subject),[r,i]=it(n,J.properties.drives,AM),o=w.useMemo(()=>[...Gm,...r],[r]),a=w.useCallback(u=>{Gm.includes(u)||r.includes(u)||i([...r,u]).then(()=>{n.save(t)})},[r,i]),s=w.useCallback(u=>{Gm.includes(u)||r.includes(u)&&i(r.filter(l=>l!==u)).then(()=>{n.save(t)})},[r,i]);return[o,a,s]}const TM=5;function Dy(e=[],t=Number.MAX_VALUE){const[n]=Yh(),[r,i]=yi("driveHistory",[]),o=w.useCallback(u=>{i(l=>l[0]===u?l:[u,...l.filter(c=>c!==u)].slice(0,TM))},[n,i]),a=w.useCallback(u=>{i(l=>l.filter(c=>c!==u))},[i]);return[w.useMemo(()=>r.slice(0,t).filter(u=>!e.includes(u)),[r,e]),o,a]}const PM=(e,t)=>{const n=setTimeout(e,t);return()=>clearTimeout(n)},Xh=B.div.withConfig({displayName:"Slot",componentId:"sc-1xg8hie-0"})(["grid-area:",";"],e=>e.slot),My=w.createContext(null),jx=w.createContext(!1),Bx=()=>{const[e,t]=w.useState(!1),[n,r]=w.useState(!1),i=w.useCallback(()=>{t(!0),r(!0)},[]),o=w.useCallback(()=>{t(!1)},[]),a=w.useCallback(()=>{r(!1)},[]);return[w.useMemo(()=>({show:e,onClose:o,onClosed:a}),[e,o,a]),i,o,n]},Fx=80,Ia=`${Fx}ms`,$x=({children:e,show:t,onClose:n,onClosed:r})=>{const i=w.useRef(null),o=w.useRef(null),a=w.useContext(My),s=w.useCallback(u=>{var l;!((l=o.current)!=null&&l.contains(u.target))&&o.current!==u.target&&n()},[o.current]);return je("esc",()=>{n()},{enabled:t}),w.useLayoutEffect(()=>{!t&&i.current&&i.current.hasAttribute("open")&&i.current.setAttribute("data-closing","true")},[t]),w.useEffect(()=>{if(i.current&&(t&&(i.current.hasAttribute("open")||i.current.showModal()),i.current.hasAttribute("data-closing")))return PM(()=>{var u;i.current.close(),(u=i.current)==null||u.removeAttribute("data-closing"),r()},Fx)},[t]),a.current?Lr.createPortal(f(zM,{ref:i,onClick:s,children:f(jx.Provider,{value:!0,children:M(DM,{ref:o,children:[f(IM,{slot:"close",children:f(ve,{icon:!0,onClick:n,"aria-label":"close",children:f(Mu,{})})}),e]})})}),a.current):null},Ux=({children:e})=>f(Xh,{slot:"title",as:"header",children:e}),Hx=({children:e})=>f(OM,{slot:"content",as:"main",children:e}),Wx=({children:e})=>f(LM,{slot:"actions",as:"footer",children:e}),IM=B(Xh).withConfig({displayName:"CloseButtonSlot",componentId:"sc-126dlw9-0"})(["justify-self:end;"]),OM=B(Xh).withConfig({displayName:"DialogContentSlot",componentId:"sc-126dlw9-1"})(["overflow:auto;max-height:calc(80vh - 8rem);padding-bottom:","rem;margin-right:-","rem;padding-right:","rem;"],({theme:e})=>e.margin,e=>e.theme.margin,e=>e.theme.margin),LM=B(Xh).withConfig({displayName:"DialogActionsSlot",componentId:"sc-126dlw9-2"})(["display:flex;gap:","rem;align-items:center;justify-content:flex-end;border-top:1px solid ",";padding-top:1rem;"],e=>e.theme.margin,e=>e.theme.colors.bg2),DM=B.div.withConfig({displayName:"StyledInnerDialog",componentId:"sc-126dlw9-3"})(["display:grid;grid-template-columns:auto 2rem;grid-template-rows:1fr auto 1fr;grid-template-areas:'title close' 'content content' 'actions actions';max-height:100%;"]),MM=Lu(["from{opacity:0;transform:translateY(5rem);}to{opacity:1;transform:translateY(0);}"]),NM=Lu(["from{background-color:rgba(0,0,0,0);backdrop-filter:blur(0px);}to{background-color:rgba(0,0,0,0.383);backdrop-filter:blur(5px);}"]),zM=B.dialog.withConfig({displayName:"StyledDialog",componentId:"sc-126dlw9-4"})(["--animation-speed:500ms;box-sizing:border-box;inset:0px;position:relative;z-index:",";padding:","rem;color:",";background-color:",";border-radius:",";border:solid 1px ",";max-inline-size:min(90vw,75ch);max-block-size:100vh;overflow:hidden;box-shadow:",";opacity:0;transform:translateY(5rem);transition:opacity "," ease-in-out,transform "," ease-in-out;&::backdrop{background-color:rgba(0,0,0,0);backdrop-filter:blur(0px);transition:background-color "," ease-out,backdrop-filter "," ease-out;will-change:background-color,backdrop-filter;}&[open]{opacity:1;transform:translateY(0);animation:"," "," ease-in-out;}&[data-closing='true']{opacity:0;transform:translateY(5rem);}&[open]::backdrop{background-color:rgba(0,0,0,0.383);backdrop-filter:blur(5px);animation:"," "," ease-out;}&[data-closing='true']::backdrop{background-color:rgba(0,0,0,0);backdrop-filter:blur(0px);}@media (max-width:","rem){max-inline-size:100%;max-block-size:100vh;}"],e=>e.theme.zIndex.dialog,e=>e.theme.margin,e=>e.theme.colors.text,e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.colors.bg2,e=>e.theme.boxShadowSoft,Ia,Ia,Ia,Ia,MM,Ia,NM,Ia,e=>e.theme.containerWidth),Ut=de.forwardRef(({children:e,reverse:t,...n},r)=>f(Vx,{...n,direction:t?"row-reverse":"row",ref:r,children:e}));Ut.displayName="Row";const ai=de.forwardRef(({children:e,reverse:t,...n},r)=>f(Vx,{...n,direction:t?"column-reverse":"column",ref:r,children:e}));ai.displayName="Column";const Vx=B.div.withConfig({displayName:"Flex",componentId:"sc-1gqg9q0-0"})(["align-items:",";display:flex;gap:",";justify-content:",";flex-direction:",";flex-wrap:",";width:",";height:",";"],e=>e.center?"center":"initial",e=>e.gap??`${e.theme.margin}rem`,e=>e.justify??"start",e=>e.direction??"row",e=>e.wrapItems?"wrap":"no-wrap",e=>e.fullWidth?"100%":"initial",e=>e.fullHeight?"100%":"initial"),qx=B.div.withConfig({displayName:"FieldStyled",componentId:"sc-itnd03-0"})(["margin-bottom:","rem;"],e=>e.theme.margin),jM=B.div.withConfig({displayName:"LabelWrapper",componentId:"sc-itnd03-1"})(["display:flex;align-items:center;margin-bottom:0.5rem;"]),Kx=B.label.withConfig({displayName:"LabelStyled",componentId:"sc-itnd03-2"})(["font-weight:bold;display:block;"]),BM=B.label.withConfig({displayName:"LabelHelper",componentId:"sc-itnd03-3"})(["font-size:0.9em;display:block;"]),un=B.div.withConfig({displayName:"InputWrapper",componentId:"sc-itnd03-4"})(["display:flex;flex:1;border:solid 1px ",";border-radius:",";overflow:hidden;"],e=>e.theme.colors.bg2,e=>e.theme.radius),Ny=Jn(["height:2rem;flex:1;color:",";font-size:1em;padding:","rem;border:none;--webkit-appearance:none;box-shadow:none;display:block;background-color:",";border:solid 1px ",";outline:none;box-sizing:border-box;border-top-left-radius:",";border-bottom-left-radius:",";&:disabled{background-color:",";border-color:",";color:",";&:hover{border-color:",";}}&:hover{border-color:",";}&:focus{border:solid 1px ",";background-color:",";}&:last-child{border-radius:",";}"],e=>e.theme.colors.text,e=>e.theme.margin/2,e=>e.theme.colors.bg,e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.theme.colors.bg1,e=>e.theme.colors.textLight,e=>e.theme.colors.bg1,e=>e.theme.colors.main,e=>e.theme.colors.main,e=>e.theme.colors.bg,e=>e.theme.radius),Xn=B.input.withConfig({displayName:"InputStyled",componentId:"sc-itnd03-5"})(["",""],Ny),FM=B.textarea.withConfig({displayName:"TextAreaStyled",componentId:"sc-itnd03-6"})([""," min-height:5rem;height:unset;"],Ny),xt=B.div.withConfig({displayName:"ErrMessage",componentId:"sc-itnd03-7"})(["font-size:0.8em;line-height:1rem;color:",";margin-bottom:","rem;"],e=>e.theme.colors.alert,e=>e.theme.margin),$M=B.span.withConfig({displayName:"InlineErrMessage",componentId:"sc-itnd03-8"})(["font-size:0.8em;line-height:1rem;color:",";"],e=>e.theme.colors.alert),UM=B.div.withConfig({displayName:"InputOverlay",componentId:"sc-itnd03-9"})([""," position:absolute;pointer-events:none !important;border:transparent;line-height:1rem;width:100%;border-color:rgba(0,0,0,0);"],Ny);function ni({label:e,helper:t,children:n,error:r,handleDelete:i,required:o,disabled:a}){const[s,u]=w.useState(!0);return M(qx,{children:[f(jM,{children:M(Ut,{gap:"0.4rem",center:!0,children:[M(HM,{"data-test":`field-label-${e}`,children:[f("span",{children:e}),o&&f(HL,{title:"Required field"})]}),t&&f(oi,{variant:uu.Outline,color:"textLight",type:"button",size:"0.7rem",onClick:()=>u(!s),title:"Show helper",children:f($h,{})}),!a&&i&&f(oi,{variant:uu.Outline,title:"Delete this property",color:"textLight",type:"button",size:"0.7rem",onClick:()=>i("test"),children:f(Uh,{})})]})}),f(BM,{children:M(Ty,{open:!s,children:[t,o&&f("p",{children:"Required field."})]})}),n,r&&f(xt,{title:`Error: ${JSON.stringify(r)}`,children:r.message})]})}const HM=B.label.withConfig({displayName:"FieldLabel",componentId:"sc-1a9dton-0"})(["text-transform:capitalize;display:inline-flex;gap:0.2rem;align-items:center;font-weight:bold;svg{color:",";font-size:0.8rem;}"],e=>e.theme.colors.textLight);function Gx({children:e,subtle:t,title:n,icon:r,onClick:i,IconComponent:o,label:a,className:s}){const l=Ke().getAgent(),c=_t(),h=w.useCallback(()=>{if(!l){dt.error("You need to be logged in to create new things"),c($e.agentSettings);return}i()},[l,c]),p=o??ui;return M(ve,{onClick:h,subtle:t,title:l?`Create a new ${n}`:"No User set - sign in first",className:s,children:[r?M(WM,{children:[f(p,{}),a]}):a??n,e]})}const WM=B.div.withConfig({displayName:"IconWrapper",componentId:"sc-171lpg2-0"})(["display:flex;align-items:center;gap:0.5rem;"]);function zy(e,t){const n=Ke(),r=Ce(e),[i]=Xe(r),o=_t();return w.useCallback(async(a,s,u,l)=>{const c=n.createSubject(a,l?void 0:t),h=new xi(c,!0);await Promise.all([...Object.entries(s).map(([p,y])=>h.set(p,y,n)),!l&&h.set(G.parent,t,n)]);try{await h.save(n),o($t(c,u)),dt.success(`${i} created`),n.notifyResourceManuallyCreated(h)}catch(p){n.notifyError(p)}return h},[n,r,i,o,t])}function VM(e){return/^[http://|https://]/i.test(e)?e:`https://${e}`}function qM({klass:e,subtle:t,icon:n,IconComponent:r,parent:i,children:o,label:a}){const s=Ce(e),[u]=Xe(s),[l,c]=w.useState(""),[h,p,y]=Bx(),g=zy(e,i),b=w.useCallback(_=>{_.preventDefault();const S=VM(l);g("bookmark",{[G.name]:"New Bookmark",[G.bookmark.url]:S,[G.isA]:[Ue.bookmark]})},[l]);return M(be,{children:[f(Gx,{onClick:p,title:u,icon:n,IconComponent:r,subtle:t,label:a,children:o}),M($x,{...h,children:[f(Ux,{children:f("h1",{children:"New Bookmark"})}),f(Hx,{children:f("form",{onSubmit:b,children:f(ni,{required:!0,label:"url",children:f(un,{children:f(Xn,{placeholder:"https://example.com",value:l,autoFocus:!0,onChange:_=>c(_.target.value)})})})})}),M(Wx,{children:[f(ve,{onClick:y,subtle:!0,children:"Cancel"}),f(ve,{onClick:b,disabled:l.trim()==="",children:"Ok"})]})]})]})}function Yx(e,t){const n=Ke(),{setDrive:r}=ot(),i=_t(),o=Ce(e),[a]=ye(o,G.shortname),s=zy(e,t);return w.useCallback(async()=>{try{switch(e){case Ue.chatRoom:{s("chatRoom",{[G.name]:"Untitled ChatRoom",[G.isA]:[Ue.chatRoom]});break}case Ue.document:{s("document",{[G.isA]:[Ue.document],[G.name]:"Untitled Document"});break}case Ue.folder:{s("folder",{[G.isA]:[Ue.folder],[G.name]:"Untitled Folder",[G.displayStyle]:Ue.displayStyles.list});break}case Ue.drive:{const l=n.getAgent();if(!l||l.subject===void 0)throw new Error("No agent set in the Store, required when creating a Drive");const c=await s("drive",{[G.isA]:[Ue.drive],[G.write]:[l.subject],[G.read]:[l.subject]},void 0,!0),h=await n.getResourceAsync(l.subject);h.pushPropVal(G.drives,c.getSubject()),h.save(n),r(c.getSubject());break}default:i(Ry(e,t,n.createSubject(a)))}}catch(l){n.notifyError(l)}},[e,n,t,s])}function KM({klass:e,subtle:t,icon:n,IconComponent:r,parent:i,children:o,label:a,className:s}){const u=Ce(e),[l]=Xe(u),c=Yx(e,i);return f(Gx,{className:s,onClick:c,IconComponent:r,title:l,icon:n,subtle:t,label:a,children:o})}const GM=new Map([[Ue.bookmark,qM]]);function du(e){const{klass:t,parent:n}=e,{drive:r}=ot(),i=GM.get(t)??KM;return f(i,{...e,parent:n??r})}const YM=Oy(f(ax,{}),"Open Drive Settings");function Rc(e){return e.get(J.properties.name)??e.getSubject()}function XM(e,t){return new Map([...e].filter(([n])=>!t.has(n)))}function QM(){const e=_t(),{drive:t,setDrive:n,agent:r}=ot(),[i]=Yh(),[o,a]=Dy(i,5),s=cf(i),u=cf(o),l=p=>()=>{n(p),a(p),e($t(p))},c=Yx(Ue.drive,r==null?void 0:r.subject),h=w.useMemo(()=>[...Array.from(s.entries()).map(([p,y])=>({id:p,label:Rc(y),helper:`Switch to ${Rc(y)}`,disabled:p===t,onClick:()=>{n(p),e($t(p))},icon:p===t?f(sw,{}):f(lw,{})})).slice(0,5),l1,...Array.from(XM(u,s)).map(([p,y])=>({label:Rc(y),id:p,helper:`Switch to ${Rc(y)}`,icon:p===t?f(sw,{}):f(lw,{}),onClick:l(p),disabled:p===t})).slice(0,5),l1,{id:"configure-drives",label:"Configure Drives",icon:f(ky,{}),helper:"Load drives not displayed in this list.",onClick:()=>e($e.serverSettings)},{id:"new-drive",label:"New Drive",icon:f(ui,{}),helper:"Create a new drive",onClick:c}],[s,t,u]);return f(Ix,{trigger:YM,items:h})}function JM({handleClickItem:e}){const t=Ke(),{drive:n,agent:r}=ot(),i=Ce(n),[o]=it(i,J.properties.subResources),[a]=Xe(i),s=_t(),[u]=Wi(i),[l]=Ur(),c=Ce(l),[h,p]=w.useState([]);return w.useEffect(()=>{t.getResourceAncestry(c).then(y=>{p(y)})},[t,c]),M(be,{children:[M(Ly,{children:[f(eN,{clean:!0,title:`Your current baseURL is ${n}`,"data-test":"sidebar-drive-open",onClick:()=>{e(),s($t(n))},children:M(ZM,{"data-test":"current-drive-title",children:[a||n," "]})}),M(rN,{gap:"0",children:[u&&f(oi,{onClick:()=>s($e.new),title:`Create a new resource in this drive (${st.new})`,"data-test":"sidebar-new-resource",children:f(ui,{})}),f(QM,{})]})]}),f(nN,{children:i.isReady()?o.map(y=>f(Mx,{subject:y,ancestry:h,handleClose:e},y)):i.loading?null:f(tN,{children:i.error?i.isUnauthorized()?r?"unauthorized":f(Nx,{}):i.error.message:"this should not happen"})})]})}const ZM=B.h2.withConfig({displayName:"DriveTitle",componentId:"sc-1kzsu0v-0"})(["margin:0;padding:0;font-size:1.4rem;flex:1;"]),eN=B(ve).withConfig({displayName:"TitleButton",componentId:"sc-1kzsu0v-1"})(["text-align:left;flex:1;"]),tN=B(Nt).withConfig({displayName:"SideBarErr",componentId:"sc-1kzsu0v-2"})(["padding-left:","rem;"],e=>e.theme.margin),nN=B.div.withConfig({displayName:"ListWrapper",componentId:"sc-1kzsu0v-3"})(["overflow-y:auto;overflow-x:hidden;margin-left:0.5rem;"]),rN=B(Ut).withConfig({displayName:"HeadingButtonWrapper",componentId:"sc-1kzsu0v-4"})(["color:",";font-size:0.9rem;"],e=>e.theme.colors.main),iN=` + */var Um=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Vm(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function Ox(e,t){for(var n=t.slice(0,t.length-1),r=0;r=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function iN(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,o=0;o=0&&Rt.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Rt.splice(0,Rt.length),(t===93||t===224)&&(t=91),t in gn){gn[t]=!1;for(var r in ya)ya[r]===t&&(pr[r]=!1)}}function cN(e){if(!e)Object.keys(sn).forEach(function(a){return delete sn[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Wm(a)});else if(typeof e=="object")e.key&&Wm(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?Ox(ya,l):[];sn[p]=sn[p].map(function(g){var b=i?g.method===i:!0;return b&&g.scope===r&&iN(g.mods,y)?{}:g})}})};function ww(e,t,n){var r;if(t.scope===n||t.scope==="all"){r=t.mods.length>0;for(var i in gn)Object.prototype.hasOwnProperty.call(gn,i)&&(!gn[i]&&t.mods.indexOf(+i)>-1||gn[i]&&t.mods.indexOf(+i)===-1)&&(r=!1);(t.mods.length===0&&!gn[16]&&!gn[18]&&!gn[17]&&!gn[91]||r||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Sw(e){var t=sn["*"],n=e.keyCode||e.which||e.charCode;if(pr.filter.call(this,e)){if((n===93||n===224)&&(n=91),Rt.indexOf(n)===-1&&n!==229&&Rt.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(y){var g=bw[y];e[y]&&Rt.indexOf(g)===-1?Rt.push(g):!e[y]&&Rt.indexOf(g)>-1?Rt.splice(Rt.indexOf(g),1):y==="metaKey"&&e[y]&&Rt.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Rt=Rt.slice(Rt.indexOf(g))))}),n in gn){gn[n]=!0;for(var r in ya)ya[r]===n&&(pr[r]=!0);if(!t)return}for(var i in gn)Object.prototype.hasOwnProperty.call(gn,i)&&(gn[i]=e[bw[i]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Rt.indexOf(17)===-1&&Rt.push(17),Rt.indexOf(18)===-1&&Rt.push(18),gn[17]=!0,gn[18]=!0);var o=du();if(t)for(var a=0;a-1}function pr(e,t,n){Rt=[];var r=Lx(e),i=[],o="all",a=document,s=0,u=!1,l=!0,c="+";for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(o=t.scope),t.element&&(a=t.element),t.keyup&&(u=t.keyup),t.keydown!==void 0&&(l=t.keydown),typeof t.splitKey=="string"&&(c=t.splitKey)),typeof t=="string"&&(o=t);s1&&(i=Ox(ya,e)),e=e[e.length-1],e=e==="*"?"*":Yh(e),e in sn||(sn[e]=[]),sn[e].push({keyup:u,keydown:l,scope:o,mods:i,shortcut:r[s],method:n,key:r[s],splitKey:c});typeof a<"u"&&!dN(a)&&window&&(Mx.push(a),Vm(a,"keydown",function(h){Sw(h)}),Vm(window,"focus",function(){Rt=[]}),Vm(a,"keyup",function(h){Sw(h),uN(h)}))}var qm={setScope:zx,getScope:du,deleteScope:lN,getPressedKeyCodes:oN,isPressed:sN,filter:aN,unbind:cN};for(var Km in qm)Object.prototype.hasOwnProperty.call(qm,Km)&&(pr[Km]=qm[Km]);if(typeof window<"u"){var fN=window.hotkeys;pr.noConflict=function(e){return e&&window.hotkeys===pr&&(window.hotkeys=fN),pr},window.hotkeys=pr}pr.filter=function(){return!0};var jx=function(t,n){var r=t.target,i=r&&r.tagName;return Boolean(i&&n&&n.includes(i))},hN=function(t){return jx(t,["INPUT","TEXTAREA","SELECT"])};function je(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},o=i.enableOnTags,a=i.filter,s=i.keyup,u=i.keydown,l=i.filterPreventDefault,c=l===void 0?!0:l,h=i.enabled,p=h===void 0?!0:h,y=i.enableOnContentEditable,g=y===void 0?!1:y,b=w.useRef(null),_=w.useCallback(function(S,k){var C;return a&&!a(S)?!c:hN(S)&&!jx(S,o)||(C=S.target)!=null&&C.isContentEditable&&!g?!0:b.current===null||document.activeElement===b.current?(t(S,k),!0):!1},r?[b,o,a].concat(r):[b,o,a]);return w.useEffect(function(){if(!p){pr.unbind(e,_);return}return s&&u!==!0&&(n.keydown=!1),pr(e,n||{},_),function(){return pr.unbind(e,_)}},[_,e,p]),b}pr.isPressed;const pN=(e,t)=>e.filter(n=>n.current).some(n=>{var r;return n.current===t||((r=n.current)==null?void 0:r.contains(t))}),mN=(e,t)=>{e.forEach(n=>window.addEventListener(n,t))},kw=(e,t)=>{e.forEach(n=>window.removeEventListener(n,t))},Bx=(e,t,n=!0,r=["mousedown"])=>{w.useEffect(()=>{const i=o=>{n&&!pN(e,o.target)&&(o.preventDefault(),t(),kw(r,i))};return mN(r,i),()=>{kw(r,i)}},[e,t,n])},st={edit:Uo("e"),data:Uo("d"),home:Uo("h"),new:Uo("n"),userSettings:Uo("u"),themeSettings:Uo("t"),keyboardShortcuts:"shift+/",search:"/",menu:Uo("m"),sidebarToggle:"\\",moveLineUp:Gm("up"),moveLineDown:Gm("down"),deleteLine:Gm("backspace")};function Uo(e){return navigator.platform.includes("Mac")?`cmd+${e}`:`ctrl+${e}`}function Gm(e){return navigator.platform.includes("Mac")?`option+${e}`:`alt+${e}`}function gN(e){return navigator.platform.includes("Mac")?e.replace("cmd+","⌘").replace("option+","⌥").replace("shift+","⇧").replace("backspace","⌫"):e}function vN({children:e}){const t=Et(),[n]=kr(),{sideBarLocked:r,setSideBarLocked:i}=ot();return je(st.edit,o=>{o.preventDefault(),dn.isValidSubject(n)&&t(Wh(n))},{},[n]),je(st.data,o=>{o.preventDefault(),dn.isValidSubject(n)&&t(kx(n))},{},[n]),je(st.home,o=>{o.preventDefault(),t("/")}),je(st.new,o=>{o.preventDefault(),t(Fe.new)}),je(st.userSettings,o=>{o.preventDefault(),t(Fe.agentSettings)}),je(st.themeSettings,o=>{o.preventDefault(),t(Fe.themeSettings)}),je(st.keyboardShortcuts,o=>{o.preventDefault(),t(Fe.shortcuts)}),je(st.sidebarToggle,o=>{o.preventDefault(),i(!r)},{},[r]),f(ye,{children:e})}function Fx({shortcut:e,className:t}){const n=gN(e).split("+");return f(yN,{className:t,children:n.map((r,i)=>O(de.Fragment,{children:[f(bN,{children:r})," ",ie.theme.colors.bg2,e=>e.theme.colors.bg1),u1="divider",wN=(e,t)=>(e%t+t)%t,ss=e=>typeof e!="string"&&typeof(e==null?void 0:e.label)=="string",SN=e=>!ss(e)||e.disabled,kN=e=>(t,n)=>{const r=i=>{const o=wN(t+i,e.length);return o===t?0:SN(e[o])?r(i+n):o};return r(n)};function xN(e){return e.reduce((t,n,r)=>(r===0||r===e.length-1)&&!ss(n)||!ss(n)&&!ss(t[r-1])?t:[...t,n],[])}function $x({items:e,trigger:t,isMainMenu:n}){const r=w.useId(),i=w.useRef(null),o=w.useRef(null),[a,s]=w.useState(!1),[u,l]=w.useState(!1),c=w.useCallback(()=>{l(!1),d(!1),setTimeout(()=>{s(!1),S(0)},100)},[]);Bx([o,i],c,a,["click","mouseout"]);const h=w.useMemo(()=>xN(e),[e]),[p,y]=w.useState(0),[g,b]=w.useState(0),[_,S]=w.useState(0),k=kN(h),[C,d]=w.useState(!1),v=w.useCallback(()=>{if(a){c();return}s(!0),requestAnimationFrame(()=>{const A=o.current.getBoundingClientRect(),D=i.current.getBoundingClientRect(),P=A.y-D.height;P<0?b(A.y+A.height/2):b(P+A.height/2),A.x-D.width<0?y(A.x):y(A.x-D.width+A.width),l(!0)})},[a]),m=w.useCallback(()=>{d(!1),v()},[v]);je("esc",()=>{c()},{enabled:a}),je(st.menu,A=>{A.preventDefault(),v(),d(!0)},{enabled:!!n},[a]),je("enter",A=>{A.preventDefault(),h[_].onClick(),c()},{enabled:a},[_,h]),je("up",A=>{A.preventDefault(),d(!0),S(D=>k(D,-1))},{enabled:a},[k]),je("down",A=>(A.preventDefault(),d(!0),S(D=>k(D,1)),!1),{enabled:a},[k]);const x=w.useMemo(()=>de.forwardRef(t),[]);return O(ye,{children:[f(x,{ref:o,onClick:m,isActive:a,menuId:r}),f(TN,{ref:i,visible:u,x:p,y:g,id:r,children:a&&h.map((A,D)=>{if(!ss(A))return f(AN,{},D);const{label:P,onClick:L,helper:W,id:U,disabled:j,shortcut:F,icon:R}=A;return f(CN,{onClick:()=>{c(),L()},id:U,"data-test":`menu-item-${U}`,disabled:j,helper:F?`${W} (${F})`:W,label:P,selected:C&&_===D,icon:R,shortcut:F},U)})})]})}function CN({onClick:e,selected:t,helper:n,disabled:r,shortcut:i,icon:o,label:a,...s}){return O(RN,{clean:!0,onClick:e,selected:t,title:n,disabled:r,...s,children:[o,f(EN,{children:a}),i&&f(_N,{shortcut:i})]})}const _N=B(Fx).withConfig({displayName:"StyledShortcut",componentId:"sc-yx9vez-0"})(["margin-left:0.3rem;"]),EN=B.span.withConfig({displayName:"StyledLabel",componentId:"sc-yx9vez-1"})(["flex:1;"]),RN=B(ve).withConfig({displayName:"MenuItemStyled",componentId:"sc-yx9vez-2"})(["align-items:center;display:flex;gap:0.5rem;width:100%;text-align:left;color:",";padding:0.4rem 1rem;height:auto;text-transform:capitalize;background-color:",";text-decoration:",";&:hover{background-color:",";}&:active{background-color:",";}&:disabled{color:",";&:hover{cursor:'default';}background-color:",";}svg{color:",";}"],e=>e.theme.colors.text,e=>e.selected?e.theme.colors.bg1:e.theme.colors.bg,e=>e.selected?"underline":"none",e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,e=>e.theme.colors.bg,e=>e.theme.colors.textLight),AN=B.div.withConfig({displayName:"ItemDivider",componentId:"sc-yx9vez-3"})(["width:100%;border-bottom:1px solid ",";"],e=>e.theme.colors.bg2),TN=B.div.withConfig({displayName:"Menu",componentId:"sc-yx9vez-4"})(["font-size:","rem;overflow:hidden;background:",";border:",";padding-top:0.4rem;padding-bottom:0.4rem;border-radius:8px;position:fixed;z-index:1;top:","px;left:","px;width:auto;box-shadow:",";opacity:",";",";"],e=>e.theme.fontSizeBody,e=>e.theme.colors.bg,e=>e.theme.darkMode?`solid 1px ${e.theme.colors.bg2}`:"none",e=>e.y,e=>e.x,e=>e.theme.boxShadowSoft,e=>e.visible?1:0,zu("opacity"));function Xh(e){const[t,n]=va("queryscope"),r=Et(),i=w.useCallback(()=>{const a=new URLSearchParams({queryscope:e??""});r(`/app/search?${a.toString()}`,{replace:!0})},[n,e]),o=w.useCallback(()=>{n(void 0)},[n]);return{scope:t,enableScope:i,clearScope:o}}function Hx({subject:e,hide:t,trigger:n,simple:r,isMainMenu:i}){const o=We(),a=Et(),s=ka(),{enableScope:u}=Xh(e);if(e===void 0||!dn.isValidSubject(e))return null;async function l(){if(window.confirm("Are you sure you want to permanently delete this resource?")){const y=o.getResourceLoading(e);try{await y.destroy(o),dt.success("Resource deleted!"),a("/")}catch(g){dt.error(g.message)}}}const c=[...r?[]:[{disabled:s.pathname.startsWith(Fe.show),id:"view",label:"normal view",helper:"Open the regular, default View.",onClick:()=>a(zt(e))},{disabled:s.pathname.startsWith(Fe.data),id:"data",label:"data view",helper:"View the resource and its properties in the Data View.",shortcut:st.data,onClick:()=>a(kx(e))},u1,{id:"refresh",icon:f(vD,{}),label:"refresh",helper:"Fetch the resouce again from the server, possibly see new changes.",onClick:()=>o.fetchResourceFromServer(e)}],{id:"edit",label:"edit",helper:"Open the edit form.",icon:f(As,{}),shortcut:r?"":st.edit,onClick:()=>a(Wh(e))},{id:"scope",label:"search in",helper:"Scope search to resource",icon:f(Ry,{}),onClick:u},{id:"share",label:"share",icon:f(yx,{}),helper:"Open the share menu",onClick:()=>a(AD(e))},{id:"delete",icon:f(Vh,{}),label:"delete",helper:"Fetch the resouce again from the server, possibly see new changes.",onClick:l},{id:"history",icon:f(hx,{}),label:"history",helper:"Show the history of this resource",onClick:()=>a(ID(e))},{id:"import",icon:f(_y,{}),label:"import",helper:"Import Atomic Data to this resource",onClick:()=>a(PD(e))}],h=t?c.filter(y=>!ss(y)||!t.includes(y.id)):c,p=n??Ly(f(Ey,{}));return f($x,{items:h,trigger:p,isMainMenu:i})}function PN({subject:e,className:t}){const n=Ce(e),[r]=qe(n),i=Tx(e);return O(c1,{className:t,children:[f(yr,{"data-test":"add-subresource",onClick:i,title:`Create new resource under ${r}`,children:f(ui,{})}),f(Hx,{simple:!0,subject:e,trigger:ON})]})}const c1=B.span.withConfig({displayName:"Wrapper",componentId:"sc-1q6pwac-0"})(["visibility:hidden;display:none;font-size:0.9rem;color:",";"],e=>e.theme.colors.main),IN=er(["position:relative;&:hover ",",&:focus-within ","{visibility:visible;display:inline;}"],c1,c1),ON=Ly(f(Ey,{})),Ux=Du(["from{background-color:var(--loader-bg-from);}to{background-color:var(--loader-bg-to);}"]),Vx=B.span.withConfig({displayName:"LoaderInline",componentId:"sc-1vzqiqx-0"})(["--loader-bg-from:",";--loader-bg-to:",";background-color:",";border-radius:",";animation:"," 0.8s infinite ease-in-out alternate;width:100%;height:1rem;"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg,e=>e.theme.colors.bg1,e=>e.theme.radius,Ux),LN=B.div.withConfig({displayName:"LoaderBlock",componentId:"sc-1vzqiqx-1"})(["--loader-bg-from:",";--loader-bg-to:",";background-color:",";border-radius:",";animation:"," 0.8s infinite ease-in-out alternate;width:100%;height:100%;"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg,e=>e.theme.colors.bg1,e=>e.theme.radius,Ux),DN=new Map([[He.folder,gx],[He.bookmark,fx],[He.chatRoom,nD],[He.document,oD],[He.file,sD],[He.drive,vx],[He.commit,hx],[He.importer,aD],[He.invite,yx],[He.collection,hD],[He.class,rD],[He.property,iD]]);function Bu(e,t=JL){return DN.get(e)??t}function Wx({subject:e,ancestry:t,handleClose:n}){const r=w.useRef(null),i=Ce(e,{allowIncomplete:!0}),[o]=kr(),[a]=qe(i),[s]=be(i,Q.properties.description),u=o===e,[l,c]=w.useState(u),[h]=it(i,Q.properties.subResources),p=h.length>0,[y]=be(i,Q.properties.isA),g=Bu(y);w.useEffect(()=>{t.includes(e)&&t[0]!==e&&c(!0)},[t]);const b=w.useMemo(()=>O(NN,{children:[f(MN,{subject:e,clean:!0,active:u,children:f(Sd,{onClick:n,disabled:u,resource:e,title:s,ref:r,children:O(zN,{children:[f(g,{}),a]})})}),f(PN,{subject:e})]}),[e,u,n,s,a]);return i.loading?f(Sd,{onClick:n,disabled:u,resource:e,title:`${e} is loading...`,children:f(Vx,{})}):i.error?f(Sd,{onClick:n,disabled:u,resource:e,ref:r,children:f(Lt,{about:e,title:i.error.message,children:e})}):f(Ax,{initialState:l,open:l,disabled:!p,onStateToggle:c,"data-test":"resource-sidebar",title:b,children:p&&h.map(_=>f(Wx,{subject:_,ancestry:t},_))})}const NN=B.div.withConfig({displayName:"ActionWrapper",componentId:"sc-1hsw2p7-0"})(["position:relative;display:flex;width:100%;margin-left:-0.7rem;",""],IN),MN=B(Ve).withConfig({displayName:"Title",componentId:"sc-1hsw2p7-1"})(["flex:1;overflow:hidden;white-space:nowrap;"]),zN=B.span.withConfig({displayName:"TextWrapper",componentId:"sc-1hsw2p7-2"})(["display:inline-flex;align-items:center;gap:0.4rem;svg{font-size:0.8em;}"]);function qx(){const e=Et();return f(ve,{type:"button",onClick:()=>e(Fe.agentSettings),title:"Go the the User Settings page",children:"Sign in"})}const Dy=B("div").withConfig({displayName:"SideBarHeader",componentId:"sc-jc5h9q-0"})(["margin-top:","rem;margin-bottom:0.5rem;padding-left:","rem;padding-right:0.7rem;font-size:1.4rem;font-weight:bold;display:flex;"],e=>e.theme.margin,e=>e.theme.margin);function Kx(){return!1}const Ym=[window.location.origin,"https://atomicdata.dev"],jN={commit:!0};function Qh(){const{agent:e}=ot(),t=We(),n=Ce(e==null?void 0:e.subject),[r,i]=it(n,Q.properties.drives,jN),o=w.useMemo(()=>[...Ym,...r],[r]),a=w.useCallback(u=>{Ym.includes(u)||r.includes(u)||i([...r,u]).then(()=>{n.save(t)})},[r,i]),s=w.useCallback(u=>{Ym.includes(u)||r.includes(u)&&i(r.filter(l=>l!==u)).then(()=>{n.save(t)})},[r,i]);return[o,a,s]}const BN=5;function Ny(e=[],t=Number.MAX_VALUE){const[n]=Qh(),[r,i]=yi("driveHistory",[]),o=w.useCallback(u=>{i(l=>l[0]===u?l:[u,...l.filter(c=>c!==u)].slice(0,BN))},[n,i]),a=w.useCallback(u=>{i(l=>l.filter(c=>c!==u))},[i]);return[w.useMemo(()=>r.slice(0,t).filter(u=>!e.includes(u)),[r,e]),o,a]}const FN=(e,t)=>{const n=setTimeout(e,t);return()=>clearTimeout(n)},Jh=B.div.withConfig({displayName:"Slot",componentId:"sc-1xg8hie-0"})(["grid-area:",";"],e=>e.slot),My=w.createContext(null),Gx=w.createContext(!1),zy=()=>{const[e,t]=w.useState(!1),[n,r]=w.useState(!1),i=w.useCallback(()=>{t(!0),r(!0)},[]),o=w.useCallback(()=>{t(!1)},[]),a=w.useCallback(()=>{r(!1)},[]);return[w.useMemo(()=>({show:e,onClose:o,onClosed:a}),[e,o,a]),i,o,n]},Yx=80,Da=`${Yx}ms`,jy=({children:e,show:t,onClose:n,onClosed:r})=>{const i=w.useRef(null),o=w.useRef(null),a=w.useContext(My),s=w.useCallback(u=>{var l;!((l=o.current)!=null&&l.contains(u.target))&&o.current!==u.target&&n()},[o.current]);return je("esc",()=>{n()},{enabled:t}),w.useLayoutEffect(()=>{!t&&i.current&&i.current.hasAttribute("open")&&i.current.setAttribute("data-closing","true")},[t]),w.useEffect(()=>{if(i.current&&(t&&(i.current.hasAttribute("open")||i.current.showModal()),i.current.hasAttribute("data-closing")))return FN(()=>{var u;i.current.close(),(u=i.current)==null||u.removeAttribute("data-closing"),r()},Yx)},[t]),a.current?Mr.createPortal(f(KN,{ref:i,onClick:s,children:f(Gx.Provider,{value:!0,children:O(VN,{ref:o,children:[f($N,{slot:"close",children:f(ve,{icon:!0,onClick:n,"aria-label":"close",children:f(Mu,{})})}),e]})})}),a.current):null},By=({children:e})=>f(Jh,{slot:"title",as:"header",children:e}),Fy=({children:e})=>f(HN,{slot:"content",as:"main",children:e}),$y=({children:e})=>f(UN,{slot:"actions",as:"footer",children:e}),$N=B(Jh).withConfig({displayName:"CloseButtonSlot",componentId:"sc-126dlw9-0"})(["justify-self:end;"]),HN=B(Jh).withConfig({displayName:"DialogContentSlot",componentId:"sc-126dlw9-1"})(["overflow:auto;max-height:calc(80vh - 8rem);padding-bottom:","rem;margin-right:-","rem;padding-right:","rem;"],({theme:e})=>e.margin,e=>e.theme.margin,e=>e.theme.margin),UN=B(Jh).withConfig({displayName:"DialogActionsSlot",componentId:"sc-126dlw9-2"})(["display:flex;gap:","rem;align-items:center;justify-content:flex-end;border-top:1px solid ",";padding-top:1rem;"],e=>e.theme.margin,e=>e.theme.colors.bg2),VN=B.div.withConfig({displayName:"StyledInnerDialog",componentId:"sc-126dlw9-3"})(["display:grid;grid-template-columns:auto 2rem;grid-template-rows:1fr auto 1fr;grid-template-areas:'title close' 'content content' 'actions actions';max-height:100%;"]),WN=Du(["from{opacity:0;transform:translateY(5rem);}to{opacity:1;transform:translateY(0);}"]),qN=Du(["from{background-color:rgba(0,0,0,0);backdrop-filter:blur(0px);}to{background-color:rgba(0,0,0,0.383);backdrop-filter:blur(5px);}"]),KN=B.dialog.withConfig({displayName:"StyledDialog",componentId:"sc-126dlw9-4"})(["--animation-speed:500ms;box-sizing:border-box;inset:0px;position:relative;z-index:",";padding:","rem;color:",";background-color:",";border-radius:",";border:solid 1px ",";max-inline-size:min(90vw,75ch);max-block-size:100vh;overflow:hidden;box-shadow:",";opacity:0;transform:translateY(5rem);transition:opacity "," ease-in-out,transform "," ease-in-out;&::backdrop{background-color:rgba(0,0,0,0);backdrop-filter:blur(0px);transition:background-color "," ease-out,backdrop-filter "," ease-out;will-change:background-color,backdrop-filter;}&[open]{opacity:1;transform:translateY(0);animation:"," "," ease-in-out;}&[data-closing='true']{opacity:0;transform:translateY(5rem);}&[open]::backdrop{background-color:rgba(0,0,0,0.383);backdrop-filter:blur(5px);animation:"," "," ease-out;}&[data-closing='true']::backdrop{background-color:rgba(0,0,0,0);backdrop-filter:blur(0px);}@media (max-width:","rem){max-inline-size:100%;max-block-size:100vh;}"],e=>e.theme.zIndex.dialog,e=>e.theme.margin,e=>e.theme.colors.text,e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.colors.bg2,e=>e.theme.boxShadowSoft,Da,Da,Da,Da,WN,Da,qN,Da,e=>e.theme.containerWidth),Ht=de.forwardRef(({children:e,reverse:t,...n},r)=>f(Xx,{...n,direction:t?"row-reverse":"row",ref:r,children:e}));Ht.displayName="Row";const Nn=de.forwardRef(({children:e,reverse:t,...n},r)=>f(Xx,{...n,direction:t?"column-reverse":"column",ref:r,children:e}));Nn.displayName="Column";const Xx=B.div.withConfig({displayName:"Flex",componentId:"sc-1gqg9q0-0"})(["align-items:",";display:flex;gap:",";justify-content:",";flex-direction:",";flex-wrap:",";width:",";height:",";& ","{align-self:flex-start;}"],e=>e.center?"center":"initial",e=>e.gap??`${e.theme.margin}rem`,e=>e.justify??"start",e=>e.direction??"row",e=>e.wrapItems?"wrap":"no-wrap",e=>e.fullWidth?"100%":"initial",e=>e.fullHeight?"100%":"initial",Ty),Qx=B.div.withConfig({displayName:"FieldStyled",componentId:"sc-itnd03-0"})(["margin-bottom:","rem;"],e=>e.theme.margin),GN=B.div.withConfig({displayName:"LabelWrapper",componentId:"sc-itnd03-1"})(["display:flex;align-items:center;margin-bottom:0.5rem;"]),Jx=B.label.withConfig({displayName:"LabelStyled",componentId:"sc-itnd03-2"})(["font-weight:bold;display:block;"]),YN=B.label.withConfig({displayName:"LabelHelper",componentId:"sc-itnd03-3"})(["font-size:0.9em;display:block;"]),un=B.div.withConfig({displayName:"InputWrapper",componentId:"sc-itnd03-4"})(["display:flex;flex:1;border:solid 1px ",";border-radius:",";overflow:hidden;"],e=>e.theme.colors.bg2,e=>e.theme.radius),Hy=er(["height:2rem;flex:1;color:",";font-size:1em;padding:","rem;border:none;--webkit-appearance:none;box-shadow:none;display:block;background-color:",";border:solid 1px ",";outline:none;box-sizing:border-box;border-top-left-radius:",";border-bottom-left-radius:",";&:disabled{background-color:",";border-color:",";color:",";&:hover{border-color:",";}}&:hover{border-color:",";}&:focus{border:solid 1px ",";background-color:",";}&:last-child{border-radius:",";}"],e=>e.theme.colors.text,e=>e.theme.margin/2,e=>e.theme.colors.bg,e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.theme.colors.bg1,e=>e.theme.colors.textLight,e=>e.theme.colors.bg1,e=>e.theme.colors.main,e=>e.theme.colors.main,e=>e.theme.colors.bg,e=>e.theme.radius),Jn=B.input.withConfig({displayName:"InputStyled",componentId:"sc-itnd03-5"})(["",""],Hy),XN=B.textarea.withConfig({displayName:"TextAreaStyled",componentId:"sc-itnd03-6"})([""," min-height:5rem;height:unset;"],Hy),xt=B.div.withConfig({displayName:"ErrMessage",componentId:"sc-itnd03-7"})(["font-size:0.8em;line-height:1rem;color:",";margin-bottom:","rem;"],e=>e.theme.colors.alert,e=>e.theme.margin),QN=B.span.withConfig({displayName:"InlineErrMessage",componentId:"sc-itnd03-8"})(["font-size:0.8em;line-height:1rem;color:",";"],e=>e.theme.colors.alert),JN=B.div.withConfig({displayName:"InputOverlay",componentId:"sc-itnd03-9"})([""," position:absolute;pointer-events:none !important;border:transparent;line-height:1rem;width:100%;border-color:rgba(0,0,0,0);"],Hy);function ii({label:e,helper:t,children:n,error:r,handleDelete:i,required:o,disabled:a}){const[s,u]=w.useState(!0);return O(Qx,{children:[f(GN,{children:O(Ht,{gap:"0.4rem",center:!0,children:[O(ZN,{"data-test":`field-label-${e}`,children:[f("span",{children:e}),o&&f(QL,{title:"Required field"})]}),t&&f(yr,{variant:cu.Outline,color:"textLight",type:"button",size:"0.7rem",onClick:()=>u(!s),title:"Show helper",children:f(Uh,{})}),!a&&i&&f(yr,{variant:cu.Outline,title:"Delete this property",color:"textLight",type:"button",size:"0.7rem",onClick:()=>i("test"),children:f(Vh,{})})]})}),f(YN,{children:O(Py,{open:!s,children:[t,o&&f("p",{children:"Required field."})]})}),n,r&&f(xt,{title:`Error: ${JSON.stringify(r)}`,children:r.message})]})}const ZN=B.label.withConfig({displayName:"FieldLabel",componentId:"sc-1a9dton-0"})(["text-transform:capitalize;display:inline-flex;gap:0.2rem;align-items:center;font-weight:bold;svg{color:",";font-size:0.8rem;}"],e=>e.theme.colors.textLight);function Zx({children:e,subtle:t,title:n,icon:r,onClick:i,IconComponent:o,label:a,className:s}){const l=We().getAgent(),c=Et(),h=w.useCallback(()=>{if(!l){dt.error("You need to be logged in to create new things"),c(Fe.agentSettings);return}i()},[l,c]),p=o??ui;return O(ve,{onClick:h,subtle:t,title:l?`Create a new ${n}`:"No User set - sign in first",className:s,children:[r?O(eM,{children:[f(p,{}),a]}):a??n,e]})}const eM=B.div.withConfig({displayName:"IconWrapper",componentId:"sc-171lpg2-0"})(["display:flex;align-items:center;gap:0.5rem;"]);function Uy(e,t){const n=We(),r=Ce(e),[i]=qe(r),o=Et();return w.useCallback(async(a,s,u,l)=>{const c=n.createSubject(a,l?void 0:t),h=new xi(c,!0);await Promise.all([...Object.entries(s).map(([p,y])=>h.set(p,y,n)),!l&&h.set(G.parent,t,n)]);try{await h.save(n),o(zt(c,u)),dt.success(`${i} created`),n.notifyResourceManuallyCreated(h)}catch(p){n.notifyError(p)}return h},[n,r,i,o,t])}function tM(e){return/^[http://|https://]/i.test(e)?e:`https://${e}`}function nM({klass:e,subtle:t,icon:n,IconComponent:r,parent:i,children:o,label:a}){const s=Ce(e),[u]=qe(s),[l,c]=w.useState(""),[h,p,y]=zy(),g=Uy(e,i),b=w.useCallback(_=>{_.preventDefault();const S=tM(l);g("bookmark",{[G.name]:"New Bookmark",[G.bookmark.url]:S,[G.isA]:[He.bookmark]})},[l]);return O(ye,{children:[f(Zx,{onClick:p,title:u,icon:n,IconComponent:r,subtle:t,label:a,children:o}),O(jy,{...h,children:[f(By,{children:f("h1",{children:"New Bookmark"})}),f(Fy,{children:f("form",{onSubmit:b,children:f(ii,{required:!0,label:"url",children:f(un,{children:f(Jn,{placeholder:"https://example.com",value:l,autoFocus:!0,onChange:_=>c(_.target.value)})})})})}),O($y,{children:[f(ve,{onClick:y,subtle:!0,children:"Cancel"}),f(ve,{onClick:b,disabled:l.trim()==="",children:"Ok"})]})]})]})}function eC(e,t){const n=We(),{setDrive:r}=ot(),i=Et(),o=Ce(e),[a]=be(o,G.shortname),s=Uy(e,t);return w.useCallback(async()=>{try{switch(e){case He.chatRoom:{s("chatRoom",{[G.name]:"Untitled ChatRoom",[G.isA]:[He.chatRoom]});break}case He.document:{s("document",{[G.isA]:[He.document],[G.name]:"Untitled Document"});break}case He.folder:{s("folder",{[G.isA]:[He.folder],[G.name]:"Untitled Folder",[G.displayStyle]:He.displayStyles.list});break}case He.drive:{const l=n.getAgent();if(!l||l.subject===void 0)throw new Error("No agent set in the Store, required when creating a Drive");const c=await s("drive",{[G.isA]:[He.drive],[G.write]:[l.subject],[G.read]:[l.subject]},void 0,!0),h=await n.getResourceAsync(l.subject);h.pushPropVal(G.drives,c.getSubject()),h.save(n),r(c.getSubject());break}default:i(Ay(e,t,n.createSubject(a)))}}catch(l){n.notifyError(l)}},[e,n,t,s])}function rM({klass:e,subtle:t,icon:n,IconComponent:r,parent:i,children:o,label:a,className:s}){const u=Ce(e),[l]=qe(u),c=eC(e,i);return f(Zx,{className:s,onClick:c,IconComponent:r,title:l,icon:n,subtle:t,label:a,children:o})}const iM=new Map([[He.bookmark,nM]]);function fu(e){const{klass:t,parent:n}=e,{drive:r}=ot(),i=iM.get(t)??rM;return f(i,{...e,parent:n??r})}const oM=Ly(f(vx,{}),"Open Drive Settings");function Tc(e){return e.get(Q.properties.name)??e.getSubject()}function aM(e,t){return new Map([...e].filter(([n])=>!t.has(n)))}function sM(){const e=Et(),{drive:t,setDrive:n,agent:r}=ot(),[i]=Qh(),[o,a]=Ny(i,5),s=ff(i),u=ff(o),l=p=>()=>{n(p),a(p),e(zt(p))},c=eC(He.drive,r==null?void 0:r.subject),h=w.useMemo(()=>[...Array.from(s.entries()).map(([p,y])=>({id:p,label:Tc(y),helper:`Switch to ${Tc(y)}`,disabled:p===t,onClick:()=>{n(p),e(zt(p))},icon:p===t?f(gw,{}):f(vw,{})})).slice(0,5),u1,...Array.from(aM(u,s)).map(([p,y])=>({label:Tc(y),id:p,helper:`Switch to ${Tc(y)}`,icon:p===t?f(gw,{}):f(vw,{}),onClick:l(p),disabled:p===t})).slice(0,5),u1,{id:"configure-drives",label:"Configure Drives",icon:f(xy,{}),helper:"Load drives not displayed in this list.",onClick:()=>e(Fe.serverSettings)},{id:"new-drive",label:"New Drive",icon:f(ui,{}),helper:"Create a new drive",onClick:c}],[s,t,u]);return f($x,{trigger:oM,items:h})}function lM({handleClickItem:e}){const t=We(),{drive:n,agent:r}=ot(),i=Ce(n),[o]=it(i,Q.properties.subResources),[a]=qe(i),s=Et(),[u]=Wi(i),[l]=kr(),c=Ce(l),[h,p]=w.useState([]);return w.useEffect(()=>{t.getResourceAncestry(c).then(y=>{p(y)})},[t,c]),O(ye,{children:[O(Dy,{children:[f(cM,{clean:!0,title:`Your current baseURL is ${n}`,"data-test":"sidebar-drive-open",onClick:()=>{e(),s(zt(n))},children:O(uM,{"data-test":"current-drive-title",children:[a||n," "]})}),O(hM,{gap:"0",children:[u&&f(yr,{onClick:()=>s(Fe.new),title:`Create a new resource in this drive (${st.new})`,"data-test":"sidebar-new-resource",children:f(ui,{})}),f(sM,{})]})]}),f(fM,{children:i.isReady()?o.map(y=>f(Wx,{subject:y,ancestry:h,handleClose:e},y)):i.loading?null:f(dM,{children:i.error?i.isUnauthorized()?r?"unauthorized":f(qx,{}):i.error.message:"this should not happen"})})]})}const uM=B.h2.withConfig({displayName:"DriveTitle",componentId:"sc-1kzsu0v-0"})(["margin:0;padding:0;font-size:1.4rem;flex:1;"]),cM=B(ve).withConfig({displayName:"TitleButton",componentId:"sc-1kzsu0v-1"})(["text-align:left;flex:1;"]),dM=B(Lt).withConfig({displayName:"SideBarErr",componentId:"sc-1kzsu0v-2"})(["padding-left:","rem;"],e=>e.theme.margin),fM=B.div.withConfig({displayName:"ListWrapper",componentId:"sc-1kzsu0v-3"})(["overflow-y:auto;overflow-x:hidden;margin-left:0.5rem;"]),hM=B(Ht).withConfig({displayName:"HeadingButtonWrapper",componentId:"sc-1kzsu0v-4"})(["color:",";font-size:0.9rem;"],e=>e.theme.colors.main),pM=` * { cursor: col-resize; user-select: none; pointer-events: none; } -`;function oN(e){const t=document.getElementById(e);if(t)return t;const n=document.createElement("style");return n.setAttribute("id",e),document.head.appendChild(n),n}function pw(e){const t=document.getElementById(e);t&&document.head.contains(t)&&document.head.removeChild(t)}function mw(e,t){const n=oN(e);t?n.innerHTML=iN:n.innerHTML=""}function aN(e,t=0,n=1/0){const r=w.useRef(null),i=w.useRef(null),[o,a]=w.useState(!1),[s,u]=w.useState(`${e}px`),l=w.useId(),c=w.useRef(h=>{const p=Math.min(n,Math.max(t,h.clientX));requestAnimationFrame(()=>{u(`${p}px`)})});return w.useEffect(()=>{if(!r.current||!i.current)return()=>{pw(l)};const h=()=>{a(!0)},p=()=>{a(!1)};return i.current.addEventListener("mousedown",h),window.addEventListener("mouseup",p),()=>{var y;(y=i.current)==null||y.removeEventListener("mousedown",h),window.removeEventListener("mouseup",p),pw(l)}},[]),w.useEffect(()=>(o?(window.addEventListener("mousemove",c.current),mw(l,!0)):(window.removeEventListener("mousemove",c.current),mw(l,!1)),()=>{window.removeEventListener("mousemove",c.current)}),[o]),{size:s,targetRef:r,dragAreaRef:i,isDragging:o}}const sN=B.div.withConfig({displayName:"DragAreaBase",componentId:"sc-m709fc-0"})(["--drag-color:hsla(0,0%,0%,0.2);position:absolute;cursor:col-resize;background-color:",";backdrop-filter:",";:hover{transition:background-color 0.2s;background-color:var(--drag-color);backdrop-filter:blur(5px);}"],({isDragging:e})=>e?"var(--drag-color)":"transparent",({isDragging:e})=>e?"blur(5px)":"none");function lN(e,t=[]){return w.useCallback(n=>{for(const r of e)r.current=n},t)}const uN="2rem",cN=` + ${uN}`,gw=(e="0rem",t)=>`calc(${e}${t?cN:""})`;function vf({position:e,baseMargin:t}){const{navbarFloating:n,navbarTop:r}=ot();return f(dN,{size:(()=>e==="top"?gw(t,r):gw(t,!n&&!r))()})}const dN=B.div.withConfig({displayName:"Spacing",componentId:"sc-v1wie-0"})(["height:",";transition:height 0.2s ease-out;"],e=>e.size),Ym=[{icon:f(ux,{}),label:"User Settings",helper:"See and edit the current Agent / User (u)",path:$e.agentSettings},{icon:f(ky,{}),label:"Theme Settings",helper:"Edit the theme, current Agent, and more. (t)",path:$e.themeSettings},{icon:f(nD,{}),label:"Keyboard Shortcuts",helper:"View the keyboard shortcuts (?)",path:$e.shortcuts},{icon:f($h,{}),label:"About",helper:"Welcome page, tells about this app",path:$e.about}];function fN({helper:e,label:t,icon:n,path:r,href:i,subject:o,handleClickItem:a}){return f(We,{href:i,subject:o,path:r,clean:!0,children:M(bd,{title:e,onClick:a,children:[n&&f(hN,{children:n}),t]},t)})}const hN=B.span.withConfig({displayName:"SideBarIcon",componentId:"sc-1k80fv1-0"})(["display:flex;margin-right:0.5rem;font-size:1.5rem;"]);function pN({onItemClick:e}){const t=w.useRef(null),[n]=Ur(),[r,i]=w.useState(!1),o=w.useCallback(()=>{t.current&&t.current.prompt().then(s=>{s.outcome==="accepted"&&i(!1)})},[t.current]);w.useEffect(()=>{const s=u=>{u.preventDefault(),i(!0),t.current=u};return window.addEventListener("beforeinstallprompt",s),()=>window.removeEventListener("beforeinstallprompt",s)},[]);const a=w.useMemo(()=>r?[{icon:f(sD,{}),label:"Install App",helper:"Install app to desktop",handleClickItem:o,path:$t(n??window.location.href)},...Ym]:Ym,[Ym,r,n]);return M(be,{children:[f(Ly,{children:"App"}),a.map(s=>f(fN,{...s,handleClickItem:s.handleClickItem??e},s.label))]})}function Xx({style:e}){const{darkMode:t}=ot(),n=t?"white":"black";return M("svg",{style:e,viewBox:"0 0 647 75",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("path",{d:"M57.512 58.4H23.712L17.264 74H0L32.448 1.19995H49.088L81.64 74H63.96L57.512 58.4ZM52.208 45.608L40.664 17.736L29.12 45.608H52.208Z",fill:n}),f("path",{d:"M119.469 71.296C117.875 72.4746 115.899 73.376 113.541 74C111.253 74.5546 108.827 74.832 106.261 74.832C99.6052 74.832 94.4398 73.1333 90.7652 69.736C87.1598 66.3386 85.3572 61.3466 85.3572 54.76V31.776H76.7252V19.296H85.3572V5.67196H101.581V19.296H115.517V31.776H101.581V54.552C101.581 56.9093 102.171 58.7466 103.349 60.064C104.597 61.312 106.331 61.936 108.549 61.936C111.115 61.936 113.299 61.2426 115.101 59.856L119.469 71.296Z",fill:n}),f("path",{d:"M258.334 17.216C265.337 17.216 270.884 19.296 274.974 23.456C279.134 27.5466 281.214 33.7173 281.214 41.9679V74H264.99V44.464C264.99 40.0266 264.054 36.7333 262.182 34.584C260.38 32.3653 257.78 31.256 254.382 31.256C250.569 31.256 247.553 32.504 245.334 35C243.116 37.4266 242.006 41.0666 242.006 45.92V74H225.782V44.464C225.782 35.6586 222.246 31.256 215.174 31.256C211.43 31.256 208.449 32.504 206.23 35C204.012 37.4266 202.902 41.0666 202.902 45.92V74H186.678V18.048H202.174V24.496C204.254 22.1386 206.785 20.336 209.766 19.088C212.817 17.84 216.145 17.216 219.75 17.216C223.702 17.216 227.273 18.0133 230.462 19.608C233.652 21.1333 236.217 23.3866 238.158 26.368C240.446 23.456 243.324 21.2026 246.79 19.608C250.326 18.0133 254.174 17.216 258.334 17.216Z",fill:n}),f("path",{d:"M291.596 18.048H307.82V74H291.596V18.048Z",fill:n}),f("path",{d:"M345.758 74.832C339.795 74.832 334.422 73.6186 329.638 71.192C324.923 68.696 321.214 65.264 318.51 60.896C315.875 56.528 314.558 51.5706 314.558 46.0239C314.558 40.4773 315.875 35.52 318.51 31.152C321.214 26.784 324.923 23.3866 329.638 20.96C334.422 18.464 339.795 17.216 345.758 17.216C351.651 17.216 356.782 18.464 361.15 20.96C365.587 23.3866 368.811 26.888 370.822 31.464L358.238 38.224C355.326 33.0933 351.131 30.528 345.654 30.528C341.424 30.528 337.923 31.9146 335.15 34.688C332.376 37.4613 330.99 41.2399 330.99 46.0239C330.99 50.808 332.376 54.5866 335.15 57.36C337.923 60.1333 341.424 61.52 345.654 61.52C351.2 61.52 355.395 58.9546 358.238 53.824L370.822 60.688C368.811 65.1253 365.587 68.592 361.15 71.088C356.782 73.584 351.651 74.832 345.758 74.832Z",fill:n}),f("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.633 17.5725C139.483 22.4964 144.235 26 149.806 26C155.376 26 160.128 22.4964 161.979 17.5725C172.482 22.241 179.806 32.7652 179.806 45C179.806 61.5685 166.374 75 149.806 75C133.237 75 119.806 61.5685 119.806 45C119.806 32.7652 127.13 22.241 137.633 17.5725ZM141.39 16.1965C142.679 19.589 145.961 22 149.806 22C153.65 22 156.932 19.589 158.221 16.1965C155.551 15.4176 152.727 15 149.806 15C146.884 15 144.06 15.4176 141.39 16.1965ZM163.806 45C163.806 52.732 157.538 59 149.806 59C142.074 59 135.806 52.732 135.806 45C135.806 37.268 142.074 31 149.806 31C157.538 31 163.806 37.268 163.806 45Z",fill:n}),f("path",{d:"M143.442 19.364C139.927 15.8492 139.927 10.1508 143.442 6.63604C146.956 3.12132 152.655 3.12132 156.17 6.63604C157.784 8.25001 158.656 10.3245 158.788 12.4365C158.943 14.9238 158.07 17.4632 156.17 19.364C152.655 22.8787 146.956 22.8787 143.442 19.364Z",fill:"url(#paint0_linear)"}),f("path",{d:"M415.806 1.19995H448.878C456.782 1.19995 463.75 2.72528 469.782 5.77595C475.883 8.75729 480.598 12.9866 483.926 18.464C487.323 23.9413 489.022 30.32 489.022 37.6C489.022 44.88 487.323 51.2586 483.926 56.736C480.598 62.2133 475.883 66.4773 469.782 69.528C463.75 72.5093 456.782 74 448.878 74H415.806V1.19995ZM448.046 60.168C455.326 60.168 461.115 58.1573 465.414 54.136C469.782 50.0453 471.966 44.5333 471.966 37.6C471.966 30.6666 469.782 25.1893 465.414 21.168C461.115 17.0773 455.326 15.032 448.046 15.032H432.654V60.168H448.046Z",fill:n}),f("path",{d:"M518.992 17.216C527.658 17.216 534.314 19.296 538.96 23.456C543.605 27.5466 545.928 33.752 545.928 42.072V74H530.744V67.032C527.693 72.232 522.008 74.832 513.688 74.832C509.389 74.832 505.645 74.104 502.456 72.648C499.336 71.192 496.944 69.1813 495.28 66.616C493.616 64.0506 492.784 61.1386 492.784 57.88C492.784 52.68 494.725 48.5893 498.608 45.608C502.56 42.6266 508.626 41.136 516.808 41.136H529.704C529.704 37.6 528.629 34.896 526.48 33.024C524.33 31.0826 521.106 30.112 516.808 30.112C513.826 30.112 510.88 30.5973 507.968 31.568C505.125 32.4693 502.698 33.7173 500.688 35.312L494.864 23.976C497.914 21.8266 501.554 20.1626 505.784 18.9839C510.082 17.8053 514.485 17.216 518.992 17.216ZM517.744 63.912C520.517 63.912 522.978 63.288 525.128 62.04C527.277 60.7226 528.802 58.816 529.704 56.32V50.6H518.576C511.92 50.6 508.592 52.784 508.592 57.152C508.592 59.232 509.389 60.896 510.984 62.144C512.648 63.3226 514.901 63.912 517.744 63.912Z",fill:n}),f("path",{d:"M592.539 71.296C590.944 72.4746 588.968 73.376 586.611 74C584.323 74.5546 581.896 74.832 579.331 74.832C572.675 74.832 567.51 73.1333 563.835 69.736C560.23 66.3386 558.427 61.3466 558.427 54.76V31.776H549.795V19.296H558.427V5.67196H574.651V19.296H588.587V31.776H574.651V54.552C574.651 56.9093 575.24 58.7466 576.419 60.064C577.667 61.312 579.4 61.936 581.619 61.936C584.184 61.936 586.368 61.2426 588.171 59.856L592.539 71.296Z",fill:n}),f("path",{d:"M620.054 17.216C628.721 17.216 635.377 19.296 640.022 23.456C644.668 27.5466 646.99 33.752 646.99 42.072V74H631.806V67.032C628.756 72.232 623.07 74.832 614.75 74.832C610.452 74.832 606.708 74.104 603.518 72.648C600.398 71.192 598.006 69.1813 596.342 66.616C594.678 64.0506 593.846 61.1386 593.846 57.88C593.846 52.68 595.788 48.5893 599.67 45.608C603.622 42.6266 609.689 41.136 617.87 41.136H630.766C630.766 37.6 629.692 34.896 627.542 33.024C625.393 31.0826 622.169 30.112 617.87 30.112C614.889 30.112 611.942 30.5973 609.03 31.568C606.188 32.4693 603.761 33.7173 601.75 35.312L595.926 23.976C598.977 21.8266 602.617 20.1626 606.846 18.9839C611.145 17.8053 615.548 17.216 620.054 17.216ZM618.806 63.912C621.58 63.912 624.041 63.288 626.19 62.04C628.34 60.7226 629.865 58.816 630.766 56.32V50.6H619.638C612.982 50.6 609.654 52.784 609.654 57.152C609.654 59.232 610.452 60.896 612.046 62.144C613.71 63.3226 615.964 63.912 618.806 63.912Z",fill:n}),f("defs",{children:M("linearGradient",{id:"paint0_linear",x1:"156.17",y1:"19.364",x2:"143.442",y2:"6.63604",gradientUnits:"userSpaceOnUse",children:[f("stop",{stopColor:"#033049"}),f("stop",{offset:"1",stopColor:"#00C2FF"})]})})]})}const mN=[{icon:f(UL,{}),helper:"Github; View the source code for this application",href:"https://github.com/atomicdata-dev/atomic-data-browser"},{icon:f($L,{}),helper:"Discord; Chat with the Atomic Data community",href:"https://discord.gg/a72Rv2P"},{icon:f(tx,{}),helper:"Docs; Read the Atomic Data documentation",href:"https://docs.atomicdata.dev"}];function gN(){return M(be,{children:[f(Ly,{children:f(Xx,{style:{height:"1.1rem",maxWidth:"100%"}})}),f(vN,{children:mN.map(({href:e,icon:t,helper:n})=>f(Py,{target:"_blank",rel:"noreferrer",href:e,title:n,size:"1.2em",color:"textLight",children:t},e))})]})}const vN=B.div.withConfig({displayName:"AboutWrapper",componentId:"sc-1v67gcx-0"})(["--inner-padding:0.5rem;display:flex;align-items:center;gap:0.5rem;margin-left:calc(1rem - var(--inner-padding));"]);function Qh(e,t=!1){const[n,r]=w.useState(t);return w.useEffect(()=>{if(!window.matchMedia)return;const i=a=>{r(a.matches)},o=window.matchMedia(e);return r(o.matches),o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[]),n}const Qx=600,yN=w.memo(JM);function bN(){const{drive:e,sideBarLocked:t,setSideBarLocked:n}=ot(),[r,i]=jL(t),o=Qh(`(min-width: ${Qx}px)`,!0),{size:a,targetRef:s,dragAreaRef:u,isDragging:l}=aN(300,200,2e3),c=lN([r,s]),h=w.useCallback(()=>{o||n(!1)},[o]);return M(kN,{children:[M(wN,{ref:c,size:a,"data-test":"sidebar",locked:o&&t,exposed:t||i&&o,children:[f(vf,{position:"top"}),f(yN,{handleClickItem:h},e),M(SN,{children:[f(pN,{onItemClick:h}),f(gN,{})]}),f(vf,{baseMargin:"1rem",position:"bottom"}),f(CN,{ref:u,isDragging:l})]}),f(xN,{onClick:()=>n(!1),visible:t&&!o})]})}const wN=B("nav").attrs(e=>({style:{"--width":e.size}})).withConfig({displayName:"SideBarStyled",componentId:"sc-14wl40b-0"})(["z-index:",";box-sizing:border-box;background:",";border-right:solid 1px ",";transition:opacity 0.3s,left 0.3s;left:",";opacity:",";height:100vh;width:var(--width);position:",";display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;"],e=>e.theme.zIndex.sidebar,e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.exposed?"0":"calc(var(--width) * -1 + 0.5rem)",e=>e.exposed?1:0,e=>e.locked?"relative":"absolute"),SN=B.div.withConfig({displayName:"MenuWrapper",componentId:"sc-14wl40b-1"})(["margin-top:auto;flex-direction:column;justify-items:flex-end;display:flex;justify-content:end;"]),kN=B("div").withConfig({displayName:"SideBarContainer",componentId:"sc-14wl40b-2"})(["position:relative;"]),xN=B.div.withConfig({displayName:"SideBarOverlay",componentId:"sc-14wl40b-3"})(["position:absolute;left:0;top:0;bottom:0;right:0;width:100vw;transition:background-color 0.2s;background-color:",";pointer-events:",";height:100%;cursor:pointer;z-index:1;-webkit-tap-highlight-color:transparent;"],e=>e.visible?"rgba(0, 0, 0, .5)":"rgba(0, 0, 0, 0.0)",e=>e.visible?"auto":"none"),CN=B(sN).withConfig({displayName:"SideBarDragArea",componentId:"sc-14wl40b-4"})(["height:100%;width:12px;right:-6px;top:0;bottom:0;"]);var c1={},_N={get exports(){return c1},set exports(e){c1=e}},d1={},EN={get exports(){return d1},set exports(e){d1=e}};(function(e,t){(function(n){e.exports=n()})(function(){var n=["navigation","request","process","log","user","state","error","manual"],r=function(E,T,z){for(var N=z,U=0,Y=E.length;U=E&&z<=T}},h=function(E){return typeof E=="function"||a(E)&&i(E,function(T){return typeof T=="function"}).length===E.length},p=function(E){return typeof E=="string"&&!!E.length},y={},g=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};y.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:p},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(E){return E===void 0||p(E)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(E){return E===void 0||p(E)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(E){return E===!0||E===!1}},enabledErrorTypes:{defaultValue:function(){return g()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(E){if(typeof E!="object"||!E)return!1;var T=l(E),z=l(g());return!(i(T,function(N){return o(z,N)}).length0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:h},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:h},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:h},endpoints:{defaultValue:function(){return{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(E){return E&&typeof E=="object"&&p(E.notify)&&p(E.sessions)&&i(l(E),function(T){return!o(["notify","sessions"],T)}).length===0}},autoTrackSessions:{defaultValue:function(E){return!0},message:"should be true|false",validate:function(E){return E===!0||E===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(E){return E===null||a(E)&&i(E,function(T){return typeof T=="string"}).length===E.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(E){return typeof E=="string"&&E.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number ≤100",validate:function(E){return c(0,100)(E)}},enabledBreadcrumbTypes:{defaultValue:function(){return n},message:"should be null or a list of available breadcrumb types ("+n.join(",")+")",validate:function(E){return E===null||a(E)&&r(E,function(T,z){return T===!1?T:o(n,z)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(E){return E===void 0||typeof E=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(E){return E===null||E&&r(l(E),function(T,z){return T&&o(["id","email","name"],z)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(E){return typeof E=="object"&&E!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(E){return!E||E&&r(["debug","info","warn","error"],function(T,z){return T&&typeof E[z]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(E){return a(E)&&E.length===i(E,function(T){return typeof T=="string"||T&&typeof T.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(E){return a(E)&&E.length===i(E,function(T){return T&&typeof T=="object"&&typeof T.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(E){return a(E)&&E.length===i(E,function(T){return T&&typeof T=="object"&&typeof T.name=="string"}).length}}};var b=function(E){for(var T=1;T-1&&(ne=ne.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var Se=ne.replace(/^\s+/,"").replace(/\(eval code/g,"("),me=Se.match(/ (\((.+):(\d+):(\d+)\)$)/);Se=me?Se.replace(me[0],""):Se;var Pe=Se.split(/\s+/).slice(1),we=this.extractLocation(me?me[1]:Pe.pop()),Qe=Pe.join(" ")||void 0,Dt=["eval",""].indexOf(we[0])>-1?void 0:we[0];return new T({functionName:Qe,fileName:Dt,lineNumber:we[1],columnNumber:we[2],source:ne})},this)},parseFFOrSafari:function(Q){var fe=Q.stack.split(` -`).filter(function(ne){return!ne.match(U)},this);return fe.map(function(ne){if(ne.indexOf(" > eval")>-1&&(ne=ne.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),ne.indexOf("@")===-1&&ne.indexOf(":")===-1)return new T({functionName:ne});var Se=/((.*".+"[^@]*)?[^@]*)(?:@)/,me=ne.match(Se),Pe=me&&me[1]?me[1]:void 0,we=this.extractLocation(ne.replace(Se,""));return new T({functionName:Pe,fileName:we[0],lineNumber:we[1],columnNumber:we[2],source:ne})},this)},parseOpera:function(Q){return!Q.stacktrace||Q.message.indexOf(` -`)>-1&&Q.message.split(` -`).length>Q.stacktrace.split(` -`).length?this.parseOpera9(Q):Q.stack?this.parseOpera11(Q):this.parseOpera10(Q)},parseOpera9:function(Q){for(var fe=/Line (\d+).*script (?:in )?(\S+)/i,ne=Q.message.split(` -`),Se=[],me=2,Pe=ne.length;me/,"$2").replace(/\([^\)]*\)/g,"")||void 0,Qe;Pe.match(/\(([^\)]*)\)/)&&(Qe=Pe.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var Dt=Qe===void 0||Qe==="[arguments not available]"?void 0:Qe.split(",");return new T({functionName:we,args:Dt,fileName:me[0],lineNumber:me[1],columnNumber:me[2],source:ne})},this)}}});var L=A,P=function(E,T,z,N){var U=N&&N.redactedKeys?N.redactedKeys:[],Y=N&&N.redactedPaths?N.redactedPaths:[];return JSON.stringify(I(E,U,Y),T,z)},O=20,V=25e3,H=8,j="...";function F(E){return E instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(E))}function R(E){return"[Throws: "+(E?E.message:"?")+"]"}function q(E,T){for(var z=0,N=E.length;zH&&U>V}if(U++,fe.length>O||ne())return j;if(Q===null||typeof Q!="object")return Q;if(q(N,Q))return"[Circular]";if(N.push(Q),typeof Q.toJSON=="function")try{U--;var Se=Y(Q.toJSON(),fe);return N.pop(),Se}catch(ut){return R(ut)}var me=F(Q);if(me){U--;var Pe=Y({name:Q.name,message:Q.message},fe);return N.pop(),Pe}if(ee(Q)){for(var we=[],Qe=0,Dt=Q.length;Qe-1&&!T.file&&!T.method&&(T.file="global code"),T},Re=function(E){return/^global code$/i.test(E)?"global code":E},nt=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},ze=function(E){return typeof E=="string"?E:""};Ye.getStacktrace=function(E,T,z){if(ge(E))return L.parse(E).slice(T);try{return i(De.backtrace(),function(N){return(N.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+z)}catch{return[]}},Ye.create=function(E,T,z,N,U,Y){U===void 0&&(U=0);var Q=zt(E,T,N,Y),fe=Q[0],ne=Q[1],Se;try{var me=Ye.getStacktrace(fe,ne>0?1+ne+U:0,1+U);Se=new Ye(fe.name,fe.message,me,z,E)}catch{Se=new Ye(fe.name,fe.message,[],z,E)}return fe.name==="InvalidError"&&Se.addMetadata(""+N,"non-error parameter",gt(E)),Se};var gt=function(E){return E===null?"null":E===void 0?"undefined":E},zt=function(E,T,z,N){var U,Y=0,Q=function(fe){N&&N.warn(z+' received a non-error: "'+fe+'"');var ne=new Error(z+' received a non-error. See "'+z+'" tab for more detail.');return ne.name="InvalidError",ne};if(!T)pe(E)?U=E:(U=Q(typeof E),Y+=2);else switch(typeof E){case"string":case"number":case"boolean":U=new Error(String(E)),Y+=1;break;case"function":U=Q("function"),Y+=2;break;case"object":E!==null&&pe(E)?U=E:E!==null&&wt(E)?(U=new Error(E.message||E.errorMessage),U.name=E.name||E.errorClass,Y+=1):(U=Q(E===null?"null":"unsupported object"),Y+=2);break;default:U=Q("nothing"),Y+=2}if(!ge(U))try{throw U}catch(fe){ge(fe)&&(U=fe,Y=1)}return[U,Y]};Ye.__type="browserjs";var wt=function(E){return(typeof E.name=="string"||typeof E.errorClass=="string")&&(typeof E.message=="string"||typeof E.errorMessage=="string")},Ee=Ye,rt=function(E,T,z){var N=0,U=function(){if(N>=E.length)return z(null,!0);T(E[N],function(Y,Q){if(Y)return z(Y);if(Q===!1)return z(null,!1);N++,U()})};U()},tr=function(E,T,z,N){var U=function(Y,Q){if(typeof Y!="function")return Q(null);try{if(Y.length!==2){var fe=Y(T);return fe&&typeof fe.then=="function"?fe.then(function(ne){return setTimeout(function(){return Q(null,ne)})},function(ne){setTimeout(function(){return z(ne),Q(null,!0)})}):Q(null,fe)}Y(T,function(ne,Se){if(ne)return z(ne),Q(null);Q(null,Se)})}catch(ne){z(ne),Q(null)}};rt(E,U,N)},Ht=function(E,T,z,N){for(var U=!1,Y=E.slice();!U&&Y.length;)try{U=Y.pop()(T)===!1}catch(Q){N.error("Error occurred in "+z+" callback, continuing anyway…"),N.error(Q)}return U},X=function(T,z){var N="000000000"+T;return N.substr(N.length-z)},ce=typeof window=="object"?window:self,Te=0;for(var Be in ce)Object.hasOwnProperty.call(ce,Be)&&Te++;var Xt=navigator.mimeTypes?navigator.mimeTypes.length:0,Ei=X((Xt+navigator.userAgent.length).toString(36)+Te.toString(36),4),at=function(){return Ei},vt=0,Sr=4,nr=36,yt=Math.pow(nr,Sr);function Gi(){return X((Math.random()*yt<<0).toString(nr),Sr)}function rr(){return vt=vtthis._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},T._isBreadcrumbTypeEnabled=function(N){var U=this._config.enabledBreadcrumbTypes;return U===null||o(U,N)},T.notify=function(N,U,Y){Y===void 0&&(Y=jt);var Q=Ee.create(N,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(Q,U,Y)},T._notify=function(N,U,Y){var Q=this;if(Y===void 0&&(Y=jt),N.app=b({},N.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),N.context=N.context||this._context,N._metadata=b({},N._metadata,this._metadata),N._features=b({},N._features,this._features),N._user=b({},N._user,this._user),N.breadcrumbs=this._breadcrumbs.slice(),this._config.enabledReleaseStages!==null&&!o(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),Y(null,N);var fe=N.severity,ne=function(me){Q._logger.error("Error occurred in onError callback, continuing anyway…"),Q._logger.error(me)},Se=[].concat(this._cbs.e).concat(U);tr(Se,N,ne,function(me,Pe){if(me&&ne(me),!Pe)return Q._logger.debug("Event not sent due to onError callback"),Y(null,N);Q._isBreadcrumbTypeEnabled("error")&&E.prototype.leaveBreadcrumb.call(Q,N.errors[0].errorClass,{errorClass:N.errors[0].errorClass,errorMessage:N.errors[0].errorMessage,severity:N.severity},"error"),fe!==N.severity&&(N._handledState.severityReason={type:"userCallbackSetSeverity"}),N.unhandled!==N._handledState.unhandled&&(N._handledState.severityReason.unhandledOverridden=!0,N._handledState.unhandled=N.unhandled),Q._session&&(Q._session._track(N),N._session=Q._session),Q._delivery.sendEvent({apiKey:N.apiKey||Q._config.apiKey,notifier:Q._notifier,events:[N]},function(we){return Y(we,N)})})},E}(),xr=function(E,T){var z=new Error(`Invalid configuration -`+_(l(E),function(N){return" - "+N+" "+E[N]+", got "+Yi(T[N])}).join(` - -`));return z},Yi=function(E){switch(typeof E){case"string":case"number":case"object":return JSON.stringify(E);default:return String(E)}},Tn=ir,Cr={},Xi=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];Cr.event=function(E,T){var z=P(E,null,null,{redactedPaths:Xi,redactedKeys:T});if(z.length>1e6&&(E.events[0]._metadata={notifier:`WARNING! +`;function mM(e){const t=document.getElementById(e);if(t)return t;const n=document.createElement("style");return n.setAttribute("id",e),document.head.appendChild(n),n}function xw(e){const t=document.getElementById(e);t&&document.head.contains(t)&&document.head.removeChild(t)}function Cw(e,t){const n=mM(e);t?n.innerHTML=pM:n.innerHTML=""}function gM(e,t=0,n=1/0){const r=w.useRef(null),i=w.useRef(null),[o,a]=w.useState(!1),[s,u]=w.useState(`${e}px`),l=w.useId(),c=w.useRef(h=>{const p=Math.min(n,Math.max(t,h.clientX));requestAnimationFrame(()=>{u(`${p}px`)})});return w.useEffect(()=>{if(!r.current||!i.current)return()=>{xw(l)};const h=()=>{a(!0)},p=()=>{a(!1)};return i.current.addEventListener("mousedown",h),window.addEventListener("mouseup",p),()=>{var y;(y=i.current)==null||y.removeEventListener("mousedown",h),window.removeEventListener("mouseup",p),xw(l)}},[]),w.useEffect(()=>(o?(window.addEventListener("mousemove",c.current),Cw(l,!0)):(window.removeEventListener("mousemove",c.current),Cw(l,!1)),()=>{window.removeEventListener("mousemove",c.current)}),[o]),{size:s,targetRef:r,dragAreaRef:i,isDragging:o}}const vM=B.div.withConfig({displayName:"DragAreaBase",componentId:"sc-m709fc-0"})(["--drag-color:hsla(0,0%,0%,0.2);position:absolute;cursor:col-resize;background-color:",";backdrop-filter:",";:hover{transition:background-color 0.2s;background-color:var(--drag-color);backdrop-filter:blur(5px);}"],({isDragging:e})=>e?"var(--drag-color)":"transparent",({isDragging:e})=>e?"blur(5px)":"none");function yM(e,t=[]){return w.useCallback(n=>{for(const r of e)r.current=n},t)}const bM="2rem",wM=` + ${bM}`,_w=(e="0rem",t)=>`calc(${e}${t?wM:""})`;function bf({position:e,baseMargin:t}){const{navbarFloating:n,navbarTop:r}=ot();return f(SM,{size:(()=>e==="top"?_w(t,r):_w(t,!n&&!r))()})}const SM=B.div.withConfig({displayName:"Spacing",componentId:"sc-v1wie-0"})(["height:",";transition:height 0.2s ease-out;"],e=>e.size),Xm=[{icon:f(wx,{}),label:"User Settings",helper:"See and edit the current Agent / User (u)",path:Fe.agentSettings},{icon:f(xy,{}),label:"Theme Settings",helper:"Edit the theme, current Agent, and more. (t)",path:Fe.themeSettings},{icon:f(dD,{}),label:"Keyboard Shortcuts",helper:"View the keyboard shortcuts (?)",path:Fe.shortcuts},{icon:f(Uh,{}),label:"About",helper:"Welcome page, tells about this app",path:Fe.about}];function kM({helper:e,label:t,icon:n,path:r,href:i,subject:o,handleClickItem:a}){return f(Ve,{href:i,subject:o,path:r,clean:!0,children:O(Sd,{title:e,onClick:a,children:[n&&f(xM,{children:n}),t]},t)})}const xM=B.span.withConfig({displayName:"SideBarIcon",componentId:"sc-1k80fv1-0"})(["display:flex;margin-right:0.5rem;font-size:1.5rem;"]);function CM({onItemClick:e}){const t=w.useRef(null),[n]=kr(),[r,i]=w.useState(!1),o=w.useCallback(()=>{t.current&&t.current.prompt().then(s=>{s.outcome==="accepted"&&i(!1)})},[t.current]);w.useEffect(()=>{const s=u=>{u.preventDefault(),i(!0),t.current=u};return window.addEventListener("beforeinstallprompt",s),()=>window.removeEventListener("beforeinstallprompt",s)},[]);const a=w.useMemo(()=>r?[{icon:f(gD,{}),label:"Install App",helper:"Install app to desktop",handleClickItem:o,path:zt(n??window.location.href)},...Xm]:Xm,[Xm,r,n]);return O(ye,{children:[f(Dy,{children:"App"}),a.map(s=>f(kM,{...s,handleClickItem:s.handleClickItem??e},s.label))]})}function tC({style:e}){const{darkMode:t}=ot(),n=t?"white":"black";return O("svg",{style:e,viewBox:"0 0 647 75",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("path",{d:"M57.512 58.4H23.712L17.264 74H0L32.448 1.19995H49.088L81.64 74H63.96L57.512 58.4ZM52.208 45.608L40.664 17.736L29.12 45.608H52.208Z",fill:n}),f("path",{d:"M119.469 71.296C117.875 72.4746 115.899 73.376 113.541 74C111.253 74.5546 108.827 74.832 106.261 74.832C99.6052 74.832 94.4398 73.1333 90.7652 69.736C87.1598 66.3386 85.3572 61.3466 85.3572 54.76V31.776H76.7252V19.296H85.3572V5.67196H101.581V19.296H115.517V31.776H101.581V54.552C101.581 56.9093 102.171 58.7466 103.349 60.064C104.597 61.312 106.331 61.936 108.549 61.936C111.115 61.936 113.299 61.2426 115.101 59.856L119.469 71.296Z",fill:n}),f("path",{d:"M258.334 17.216C265.337 17.216 270.884 19.296 274.974 23.456C279.134 27.5466 281.214 33.7173 281.214 41.9679V74H264.99V44.464C264.99 40.0266 264.054 36.7333 262.182 34.584C260.38 32.3653 257.78 31.256 254.382 31.256C250.569 31.256 247.553 32.504 245.334 35C243.116 37.4266 242.006 41.0666 242.006 45.92V74H225.782V44.464C225.782 35.6586 222.246 31.256 215.174 31.256C211.43 31.256 208.449 32.504 206.23 35C204.012 37.4266 202.902 41.0666 202.902 45.92V74H186.678V18.048H202.174V24.496C204.254 22.1386 206.785 20.336 209.766 19.088C212.817 17.84 216.145 17.216 219.75 17.216C223.702 17.216 227.273 18.0133 230.462 19.608C233.652 21.1333 236.217 23.3866 238.158 26.368C240.446 23.456 243.324 21.2026 246.79 19.608C250.326 18.0133 254.174 17.216 258.334 17.216Z",fill:n}),f("path",{d:"M291.596 18.048H307.82V74H291.596V18.048Z",fill:n}),f("path",{d:"M345.758 74.832C339.795 74.832 334.422 73.6186 329.638 71.192C324.923 68.696 321.214 65.264 318.51 60.896C315.875 56.528 314.558 51.5706 314.558 46.0239C314.558 40.4773 315.875 35.52 318.51 31.152C321.214 26.784 324.923 23.3866 329.638 20.96C334.422 18.464 339.795 17.216 345.758 17.216C351.651 17.216 356.782 18.464 361.15 20.96C365.587 23.3866 368.811 26.888 370.822 31.464L358.238 38.224C355.326 33.0933 351.131 30.528 345.654 30.528C341.424 30.528 337.923 31.9146 335.15 34.688C332.376 37.4613 330.99 41.2399 330.99 46.0239C330.99 50.808 332.376 54.5866 335.15 57.36C337.923 60.1333 341.424 61.52 345.654 61.52C351.2 61.52 355.395 58.9546 358.238 53.824L370.822 60.688C368.811 65.1253 365.587 68.592 361.15 71.088C356.782 73.584 351.651 74.832 345.758 74.832Z",fill:n}),f("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.633 17.5725C139.483 22.4964 144.235 26 149.806 26C155.376 26 160.128 22.4964 161.979 17.5725C172.482 22.241 179.806 32.7652 179.806 45C179.806 61.5685 166.374 75 149.806 75C133.237 75 119.806 61.5685 119.806 45C119.806 32.7652 127.13 22.241 137.633 17.5725ZM141.39 16.1965C142.679 19.589 145.961 22 149.806 22C153.65 22 156.932 19.589 158.221 16.1965C155.551 15.4176 152.727 15 149.806 15C146.884 15 144.06 15.4176 141.39 16.1965ZM163.806 45C163.806 52.732 157.538 59 149.806 59C142.074 59 135.806 52.732 135.806 45C135.806 37.268 142.074 31 149.806 31C157.538 31 163.806 37.268 163.806 45Z",fill:n}),f("path",{d:"M143.442 19.364C139.927 15.8492 139.927 10.1508 143.442 6.63604C146.956 3.12132 152.655 3.12132 156.17 6.63604C157.784 8.25001 158.656 10.3245 158.788 12.4365C158.943 14.9238 158.07 17.4632 156.17 19.364C152.655 22.8787 146.956 22.8787 143.442 19.364Z",fill:"url(#paint0_linear)"}),f("path",{d:"M415.806 1.19995H448.878C456.782 1.19995 463.75 2.72528 469.782 5.77595C475.883 8.75729 480.598 12.9866 483.926 18.464C487.323 23.9413 489.022 30.32 489.022 37.6C489.022 44.88 487.323 51.2586 483.926 56.736C480.598 62.2133 475.883 66.4773 469.782 69.528C463.75 72.5093 456.782 74 448.878 74H415.806V1.19995ZM448.046 60.168C455.326 60.168 461.115 58.1573 465.414 54.136C469.782 50.0453 471.966 44.5333 471.966 37.6C471.966 30.6666 469.782 25.1893 465.414 21.168C461.115 17.0773 455.326 15.032 448.046 15.032H432.654V60.168H448.046Z",fill:n}),f("path",{d:"M518.992 17.216C527.658 17.216 534.314 19.296 538.96 23.456C543.605 27.5466 545.928 33.752 545.928 42.072V74H530.744V67.032C527.693 72.232 522.008 74.832 513.688 74.832C509.389 74.832 505.645 74.104 502.456 72.648C499.336 71.192 496.944 69.1813 495.28 66.616C493.616 64.0506 492.784 61.1386 492.784 57.88C492.784 52.68 494.725 48.5893 498.608 45.608C502.56 42.6266 508.626 41.136 516.808 41.136H529.704C529.704 37.6 528.629 34.896 526.48 33.024C524.33 31.0826 521.106 30.112 516.808 30.112C513.826 30.112 510.88 30.5973 507.968 31.568C505.125 32.4693 502.698 33.7173 500.688 35.312L494.864 23.976C497.914 21.8266 501.554 20.1626 505.784 18.9839C510.082 17.8053 514.485 17.216 518.992 17.216ZM517.744 63.912C520.517 63.912 522.978 63.288 525.128 62.04C527.277 60.7226 528.802 58.816 529.704 56.32V50.6H518.576C511.92 50.6 508.592 52.784 508.592 57.152C508.592 59.232 509.389 60.896 510.984 62.144C512.648 63.3226 514.901 63.912 517.744 63.912Z",fill:n}),f("path",{d:"M592.539 71.296C590.944 72.4746 588.968 73.376 586.611 74C584.323 74.5546 581.896 74.832 579.331 74.832C572.675 74.832 567.51 73.1333 563.835 69.736C560.23 66.3386 558.427 61.3466 558.427 54.76V31.776H549.795V19.296H558.427V5.67196H574.651V19.296H588.587V31.776H574.651V54.552C574.651 56.9093 575.24 58.7466 576.419 60.064C577.667 61.312 579.4 61.936 581.619 61.936C584.184 61.936 586.368 61.2426 588.171 59.856L592.539 71.296Z",fill:n}),f("path",{d:"M620.054 17.216C628.721 17.216 635.377 19.296 640.022 23.456C644.668 27.5466 646.99 33.752 646.99 42.072V74H631.806V67.032C628.756 72.232 623.07 74.832 614.75 74.832C610.452 74.832 606.708 74.104 603.518 72.648C600.398 71.192 598.006 69.1813 596.342 66.616C594.678 64.0506 593.846 61.1386 593.846 57.88C593.846 52.68 595.788 48.5893 599.67 45.608C603.622 42.6266 609.689 41.136 617.87 41.136H630.766C630.766 37.6 629.692 34.896 627.542 33.024C625.393 31.0826 622.169 30.112 617.87 30.112C614.889 30.112 611.942 30.5973 609.03 31.568C606.188 32.4693 603.761 33.7173 601.75 35.312L595.926 23.976C598.977 21.8266 602.617 20.1626 606.846 18.9839C611.145 17.8053 615.548 17.216 620.054 17.216ZM618.806 63.912C621.58 63.912 624.041 63.288 626.19 62.04C628.34 60.7226 629.865 58.816 630.766 56.32V50.6H619.638C612.982 50.6 609.654 52.784 609.654 57.152C609.654 59.232 610.452 60.896 612.046 62.144C613.71 63.3226 615.964 63.912 618.806 63.912Z",fill:n}),f("defs",{children:O("linearGradient",{id:"paint0_linear",x1:"156.17",y1:"19.364",x2:"143.442",y2:"6.63604",gradientUnits:"userSpaceOnUse",children:[f("stop",{stopColor:"#033049"}),f("stop",{offset:"1",stopColor:"#00C2FF"})]})})]})}const _M=[{icon:f(XL,{}),helper:"Github; View the source code for this application",href:"https://github.com/atomicdata-dev/atomic-data-browser"},{icon:f(YL,{}),helper:"Discord; Chat with the Atomic Data community",href:"https://discord.gg/a72Rv2P"},{icon:f(fx,{}),helper:"Docs; Read the Atomic Data documentation",href:"https://docs.atomicdata.dev"}];function EM(){return O(ye,{children:[f(Dy,{children:f(tC,{style:{height:"1.1rem",maxWidth:"100%"}})}),f(RM,{children:_M.map(({href:e,icon:t,helper:n})=>f(Iy,{target:"_blank",rel:"noreferrer",href:e,title:n,size:"1.2em",color:"textLight",children:t},e))})]})}const RM=B.div.withConfig({displayName:"AboutWrapper",componentId:"sc-1v67gcx-0"})(["--inner-padding:0.5rem;display:flex;align-items:center;gap:0.5rem;margin-left:calc(1rem - var(--inner-padding));"]);function Fu(e,t=!1){const[n,r]=w.useState(t);return w.useEffect(()=>{if(!window.matchMedia)return;const i=a=>{r(a.matches)},o=window.matchMedia(e);return r(o.matches),o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[]),n}const nC=600,AM=w.memo(lM);function TM(){const{drive:e,sideBarLocked:t,setSideBarLocked:n}=ot(),[r,i]=qL(t),o=Fu(`(min-width: ${nC}px)`,!0),{size:a,targetRef:s,dragAreaRef:u,isDragging:l}=gM(300,200,2e3),c=yM([r,s]),h=w.useCallback(()=>{o||n(!1)},[o]);return O(OM,{children:[O(PM,{ref:c,size:a,"data-test":"sidebar",locked:o&&t,exposed:t||i&&o,children:[f(bf,{position:"top"}),f(AM,{handleClickItem:h},e),O(IM,{children:[f(CM,{onItemClick:h}),f(EM,{})]}),f(bf,{baseMargin:"1rem",position:"bottom"}),f(DM,{ref:u,isDragging:l})]}),f(LM,{onClick:()=>n(!1),visible:t&&!o})]})}const PM=B("nav").attrs(e=>({style:{"--width":e.size}})).withConfig({displayName:"SideBarStyled",componentId:"sc-14wl40b-0"})(["z-index:",";box-sizing:border-box;background:",";border-right:solid 1px ",";transition:opacity 0.3s,left 0.3s;left:",";opacity:",";height:100vh;width:var(--width);position:",";display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;"],e=>e.theme.zIndex.sidebar,e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.exposed?"0":"calc(var(--width) * -1 + 0.5rem)",e=>e.exposed?1:0,e=>e.locked?"relative":"absolute"),IM=B.div.withConfig({displayName:"MenuWrapper",componentId:"sc-14wl40b-1"})(["margin-top:auto;flex-direction:column;justify-items:flex-end;display:flex;justify-content:end;"]),OM=B("div").withConfig({displayName:"SideBarContainer",componentId:"sc-14wl40b-2"})(["position:relative;"]),LM=B.div.withConfig({displayName:"SideBarOverlay",componentId:"sc-14wl40b-3"})(["position:absolute;left:0;top:0;bottom:0;right:0;width:100vw;transition:background-color 0.2s;background-color:",";pointer-events:",";height:100%;cursor:pointer;z-index:1;-webkit-tap-highlight-color:transparent;"],e=>e.visible?"rgba(0, 0, 0, .5)":"rgba(0, 0, 0, 0.0)",e=>e.visible?"auto":"none"),DM=B(vM).withConfig({displayName:"SideBarDragArea",componentId:"sc-14wl40b-4"})(["height:100%;width:12px;right:-6px;top:0;bottom:0;"]);var d1={},NM={get exports(){return d1},set exports(e){d1=e}},f1={},MM={get exports(){return f1},set exports(e){f1=e}};(function(e,t){(function(n){e.exports=n()})(function(){var n=["navigation","request","process","log","user","state","error","manual"],r=function(E,T,z){for(var M=z,H=0,Y=E.length;H=E&&z<=T}},h=function(E){return typeof E=="function"||a(E)&&i(E,function(T){return typeof T=="function"}).length===E.length},p=function(E){return typeof E=="string"&&!!E.length},y={},g=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};y.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:p},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(E){return E===void 0||p(E)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(E){return E===void 0||p(E)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(E){return E===!0||E===!1}},enabledErrorTypes:{defaultValue:function(){return g()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(E){if(typeof E!="object"||!E)return!1;var T=l(E),z=l(g());return!(i(T,function(M){return o(z,M)}).length0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:h},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:h},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:h},endpoints:{defaultValue:function(){return{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(E){return E&&typeof E=="object"&&p(E.notify)&&p(E.sessions)&&i(l(E),function(T){return!o(["notify","sessions"],T)}).length===0}},autoTrackSessions:{defaultValue:function(E){return!0},message:"should be true|false",validate:function(E){return E===!0||E===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(E){return E===null||a(E)&&i(E,function(T){return typeof T=="string"}).length===E.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(E){return typeof E=="string"&&E.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number ≤100",validate:function(E){return c(0,100)(E)}},enabledBreadcrumbTypes:{defaultValue:function(){return n},message:"should be null or a list of available breadcrumb types ("+n.join(",")+")",validate:function(E){return E===null||a(E)&&r(E,function(T,z){return T===!1?T:o(n,z)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(E){return E===void 0||typeof E=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(E){return E===null||E&&r(l(E),function(T,z){return T&&o(["id","email","name"],z)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(E){return typeof E=="object"&&E!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(E){return!E||E&&r(["debug","info","warn","error"],function(T,z){return T&&typeof E[z]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(E){return a(E)&&E.length===i(E,function(T){return typeof T=="string"||T&&typeof T.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(E){return a(E)&&E.length===i(E,function(T){return T&&typeof T=="object"&&typeof T.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(E){return a(E)&&E.length===i(E,function(T){return T&&typeof T=="object"&&typeof T.name=="string"}).length}}};var b=function(E){for(var T=1;T-1&&(ne=ne.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var Se=ne.replace(/^\s+/,"").replace(/\(eval code/g,"("),me=Se.match(/ (\((.+):(\d+):(\d+)\)$)/);Se=me?Se.replace(me[0],""):Se;var Pe=Se.split(/\s+/).slice(1),we=this.extractLocation(me?me[1]:Pe.pop()),Qe=Pe.join(" ")||void 0,Nt=["eval",""].indexOf(we[0])>-1?void 0:we[0];return new T({functionName:Qe,fileName:Nt,lineNumber:we[1],columnNumber:we[2],source:ne})},this)},parseFFOrSafari:function(J){var fe=J.stack.split(` +`).filter(function(ne){return!ne.match(H)},this);return fe.map(function(ne){if(ne.indexOf(" > eval")>-1&&(ne=ne.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),ne.indexOf("@")===-1&&ne.indexOf(":")===-1)return new T({functionName:ne});var Se=/((.*".+"[^@]*)?[^@]*)(?:@)/,me=ne.match(Se),Pe=me&&me[1]?me[1]:void 0,we=this.extractLocation(ne.replace(Se,""));return new T({functionName:Pe,fileName:we[0],lineNumber:we[1],columnNumber:we[2],source:ne})},this)},parseOpera:function(J){return!J.stacktrace||J.message.indexOf(` +`)>-1&&J.message.split(` +`).length>J.stacktrace.split(` +`).length?this.parseOpera9(J):J.stack?this.parseOpera11(J):this.parseOpera10(J)},parseOpera9:function(J){for(var fe=/Line (\d+).*script (?:in )?(\S+)/i,ne=J.message.split(` +`),Se=[],me=2,Pe=ne.length;me/,"$2").replace(/\([^\)]*\)/g,"")||void 0,Qe;Pe.match(/\(([^\)]*)\)/)&&(Qe=Pe.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var Nt=Qe===void 0||Qe==="[arguments not available]"?void 0:Qe.split(",");return new T({functionName:we,args:Nt,fileName:me[0],lineNumber:me[1],columnNumber:me[2],source:ne})},this)}}});var D=A,P=function(E,T,z,M){var H=M&&M.redactedKeys?M.redactedKeys:[],Y=M&&M.redactedPaths?M.redactedPaths:[];return JSON.stringify(I(E,H,Y),T,z)},L=20,W=25e3,U=8,j="...";function F(E){return E instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(E))}function R(E){return"[Throws: "+(E?E.message:"?")+"]"}function q(E,T){for(var z=0,M=E.length;zU&&H>W}if(H++,fe.length>L||ne())return j;if(J===null||typeof J!="object")return J;if(q(M,J))return"[Circular]";if(M.push(J),typeof J.toJSON=="function")try{H--;var Se=Y(J.toJSON(),fe);return M.pop(),Se}catch(ut){return R(ut)}var me=F(J);if(me){H--;var Pe=Y({name:J.name,message:J.message},fe);return M.pop(),Pe}if(ee(J)){for(var we=[],Qe=0,Nt=J.length;Qe-1&&!T.file&&!T.method&&(T.file="global code"),T},Re=function(E){return/^global code$/i.test(E)?"global code":E},nt=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},ze=function(E){return typeof E=="string"?E:""};Xe.getStacktrace=function(E,T,z){if(ge(E))return D.parse(E).slice(T);try{return i(De.backtrace(),function(M){return(M.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+z)}catch{return[]}},Xe.create=function(E,T,z,M,H,Y){H===void 0&&(H=0);var J=jt(E,T,M,Y),fe=J[0],ne=J[1],Se;try{var me=Xe.getStacktrace(fe,ne>0?1+ne+H:0,1+H);Se=new Xe(fe.name,fe.message,me,z,E)}catch{Se=new Xe(fe.name,fe.message,[],z,E)}return fe.name==="InvalidError"&&Se.addMetadata(""+M,"non-error parameter",gt(E)),Se};var gt=function(E){return E===null?"null":E===void 0?"undefined":E},jt=function(E,T,z,M){var H,Y=0,J=function(fe){M&&M.warn(z+' received a non-error: "'+fe+'"');var ne=new Error(z+' received a non-error. See "'+z+'" tab for more detail.');return ne.name="InvalidError",ne};if(!T)pe(E)?H=E:(H=J(typeof E),Y+=2);else switch(typeof E){case"string":case"number":case"boolean":H=new Error(String(E)),Y+=1;break;case"function":H=J("function"),Y+=2;break;case"object":E!==null&&pe(E)?H=E:E!==null&&wt(E)?(H=new Error(E.message||E.errorMessage),H.name=E.name||E.errorClass,Y+=1):(H=J(E===null?"null":"unsupported object"),Y+=2);break;default:H=J("nothing"),Y+=2}if(!ge(H))try{throw H}catch(fe){ge(fe)&&(H=fe,Y=1)}return[H,Y]};Xe.__type="browserjs";var wt=function(E){return(typeof E.name=="string"||typeof E.errorClass=="string")&&(typeof E.message=="string"||typeof E.errorMessage=="string")},Ee=Xe,rt=function(E,T,z){var M=0,H=function(){if(M>=E.length)return z(null,!0);T(E[M],function(Y,J){if(Y)return z(Y);if(J===!1)return z(null,!1);M++,H()})};H()},rr=function(E,T,z,M){var H=function(Y,J){if(typeof Y!="function")return J(null);try{if(Y.length!==2){var fe=Y(T);return fe&&typeof fe.then=="function"?fe.then(function(ne){return setTimeout(function(){return J(null,ne)})},function(ne){setTimeout(function(){return z(ne),J(null,!0)})}):J(null,fe)}Y(T,function(ne,Se){if(ne)return z(ne),J(null);J(null,Se)})}catch(ne){z(ne),J(null)}};rt(E,H,M)},Ut=function(E,T,z,M){for(var H=!1,Y=E.slice();!H&&Y.length;)try{H=Y.pop()(T)===!1}catch(J){M.error("Error occurred in "+z+" callback, continuing anyway…"),M.error(J)}return H},X=function(T,z){var M="000000000"+T;return M.substr(M.length-z)},ce=typeof window=="object"?window:self,Te=0;for(var Be in ce)Object.hasOwnProperty.call(ce,Be)&&Te++;var Xt=navigator.mimeTypes?navigator.mimeTypes.length:0,Ri=X((Xt+navigator.userAgent.length).toString(36)+Te.toString(36),4),at=function(){return Ri},vt=0,Cr=4,ir=36,yt=Math.pow(ir,Cr);function Yi(){return X((Math.random()*yt<<0).toString(ir),Cr)}function or(){return vt=vtthis._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},T._isBreadcrumbTypeEnabled=function(M){var H=this._config.enabledBreadcrumbTypes;return H===null||o(H,M)},T.notify=function(M,H,Y){Y===void 0&&(Y=Bt);var J=Ee.create(M,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(J,H,Y)},T._notify=function(M,H,Y){var J=this;if(Y===void 0&&(Y=Bt),M.app=b({},M.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),M.context=M.context||this._context,M._metadata=b({},M._metadata,this._metadata),M._features=b({},M._features,this._features),M._user=b({},M._user,this._user),M.breadcrumbs=this._breadcrumbs.slice(),this._config.enabledReleaseStages!==null&&!o(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),Y(null,M);var fe=M.severity,ne=function(me){J._logger.error("Error occurred in onError callback, continuing anyway…"),J._logger.error(me)},Se=[].concat(this._cbs.e).concat(H);rr(Se,M,ne,function(me,Pe){if(me&&ne(me),!Pe)return J._logger.debug("Event not sent due to onError callback"),Y(null,M);J._isBreadcrumbTypeEnabled("error")&&E.prototype.leaveBreadcrumb.call(J,M.errors[0].errorClass,{errorClass:M.errors[0].errorClass,errorMessage:M.errors[0].errorMessage,severity:M.severity},"error"),fe!==M.severity&&(M._handledState.severityReason={type:"userCallbackSetSeverity"}),M.unhandled!==M._handledState.unhandled&&(M._handledState.severityReason.unhandledOverridden=!0,M._handledState.unhandled=M.unhandled),J._session&&(J._session._track(M),M._session=J._session),J._delivery.sendEvent({apiKey:M.apiKey||J._config.apiKey,notifier:J._notifier,events:[M]},function(we){return Y(we,M)})})},E}(),Er=function(E,T){var z=new Error(`Invalid configuration +`+_(l(E),function(M){return" - "+M+" "+E[M]+", got "+Xi(T[M])}).join(` + +`));return z},Xi=function(E){switch(typeof E){case"string":case"number":case"object":return JSON.stringify(E);default:return String(E)}},Tn=ar,Rr={},Qi=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];Rr.event=function(E,T){var z=P(E,null,null,{redactedPaths:Qi,redactedKeys:T});if(z.length>1e6&&(E.events[0]._metadata={notifier:`WARNING! Serialized payload was `+z.length/1e6+`MB (limit = 1MB) -metadata was removed`},z=P(E,null,null,{redactedPaths:Xi,redactedKeys:T}),z.length>1e6))throw new Error("payload exceeded 1MB limit");return z},Cr.session=function(E,T){var z=P(E,null,null);if(z.length>1e6)throw new Error("payload exceeded 1MB limit");return z};var Qi={};Qi=function(E,T){return T===void 0&&(T=window),{sendEvent:function(z,N){N===void 0&&(N=function(){});var U=Fo(E._config,"notify","4",T),Y=new T.XDomainRequest;Y.onload=function(){N(null)},Y.open("POST",U),setTimeout(function(){try{Y.send(Cr.event(z,E._config.redactedKeys))}catch(Q){E._logger.error(Q),N(Q)}},0)},sendSession:function(z,N){N===void 0&&(N=function(){});var U=Fo(E._config,"sessions","1",T),Y=new T.XDomainRequest;Y.onload=function(){N(null)},Y.open("POST",U),setTimeout(function(){try{Y.send(Cr.session(z,E._config.redactedKeys))}catch(Q){E._logger.error(Q),N(Q)}},0)}}};var Fo=function(E,T,z,N){var U=JSON.parse(JSON.stringify(new Date)),Y=Yu(E.endpoints[T],N.location.protocol);return Y+"?apiKey="+encodeURIComponent(E.apiKey)+"&payloadVersion="+z+"&sentAt="+encodeURIComponent(U)},Yu=Qi._matchPageProtocol=function(E,T){return T==="http:"?E.replace(/^https:/,"http:"):E},$o=function(E,T){return T===void 0&&(T=window),{sendEvent:function(z,N){N===void 0&&(N=function(){});try{var U=E._config.endpoints.notify,Y=new T.XMLHttpRequest;Y.onreadystatechange=function(){Y.readyState===T.XMLHttpRequest.DONE&&N(null)},Y.open("POST",U),Y.setRequestHeader("Content-Type","application/json"),Y.setRequestHeader("Bugsnag-Api-Key",z.apiKey||E._config.apiKey),Y.setRequestHeader("Bugsnag-Payload-Version","4"),Y.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),Y.send(Cr.event(z,E._config.redactedKeys))}catch(Q){E._logger.error(Q)}},sendSession:function(z,N){N===void 0&&(N=function(){});try{var U=E._config.endpoints.sessions,Y=new T.XMLHttpRequest;Y.onreadystatechange=function(){Y.readyState===T.XMLHttpRequest.DONE&&N(null)},Y.open("POST",U),Y.setRequestHeader("Content-Type","application/json"),Y.setRequestHeader("Bugsnag-Api-Key",E._config.apiKey),Y.setRequestHeader("Bugsnag-Payload-Version","1"),Y.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),Y.send(Cr.session(z,E._config.redactedKeys))}catch(Q){E._logger.error(Q)}}}},Ji=new Date,Ns=function(){Ji=new Date},R9={name:"appDuration",load:function(E){return E.addOnError(function(T){var z=new Date;T.app.duration=z-Ji},!0),{reset:Ns}}},A9=function(E){return E===void 0&&(E=window),{load:function(T){T.addOnError(function(z){z.context===void 0&&(z.context=E.location.pathname)},!0)}}},Np=function(T,z){var N="000000000"+T;return N.substr(N.length-z)},z2=typeof window=="object"?window:self,j2=0;for(var T9 in z2)Object.hasOwnProperty.call(z2,T9)&&j2++;var P9=navigator.mimeTypes?navigator.mimeTypes.length:0,I9=Np((P9+navigator.userAgent.length).toString(36)+j2.toString(36),4),B2=function(){return I9},zs=0,zp=4,Xu=36,F2=Math.pow(Xu,zp);function $2(){return Np((Math.random()*F2<<0).toString(Xu),zp)}function O9(){return zs=zsdocument.documentElement.clientHeight?"landscape":"portrait",z._config.generateAnonymousId&&(N.id=D9()),z.addOnSession(function(U){U.device=b({},U.device,N),z._config.collectUserIp||W2(U)}),z.addOnError(function(U){U.device=b({},U.device,N,{time:new Date}),z._config.collectUserIp||W2(U)},!0)},configSchema:{generateAnonymousId:{validate:function(z){return z===!0||z===!1},defaultValue:function(){return!0},message:"should be true|false"}}}},W2=function(E){var T=E.getUser();(!T||!T.id)&&E.setUser(E.device.id)},N9=function(E){return E===void 0&&(E=window),{load:function(T){T.addOnError(function(z){z.request&&z.request.url||(z.request=b({},z.request,{url:E.location.href}))},!0)}}},z9={load:function(E){E._sessionDelegate=j9}},j9={startSession:function(E,T){var z=E;return z._session=T,z._pausedSession=null,z._config.enabledReleaseStages!==null&&!o(z._config.enabledReleaseStages,z._config.releaseStage)?(z._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration"),z):(z._delivery.sendSession({notifier:z._notifier,device:T.device,app:T.app,sessions:[{id:T.id,startedAt:T.startedAt,user:T._user}]}),z)},resumeSession:function(E){return E._session?E:E._pausedSession?(E._session=E._pausedSession,E._pausedSession=null,E):E.startSession()},pauseSession:function(E){E._pausedSession=E._session,E._session=null}},B9={load:function(E){E._config.collectUserIp||E.addOnError(function(T){T._user&&typeof T._user.id>"u"&&delete T._user.id,T._user=b({id:"[REDACTED]"},T._user),T.request=b({clientIp:"[REDACTED]"},T.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(E){return E===!0||E===!1}}}},V2={};V2.load=function(E){var T=/^(local-)?dev(elopment)?$/.test(E._config.releaseStage);T||!E._isBreadcrumbTypeEnabled("log")||_(F9,function(z){var N=console[z];console[z]=function(){for(var U=arguments.length,Y=new Array(U),Q=0;Q"].concat(U.split(` -`)),jn=Me-1,Qt=Math.max(jn-3,0),_r=Math.min(jn+3,ut.length);return r(ut.slice(Qt,_r),function(Vr,Bs,Up){return Vr[Qt+1+Up]=Bs.length<=q2?Bs:Bs.substr(0,q2),Vr},{})};z.addOnError(function(Me){Me.errors[0].stacktrace=i(Me.errors[0].stacktrace,function(_r){return!/__trace__$/.test(_r.method)});var ut=Me.errors[0].stacktrace[0];if(!(ut&&ut.file&&ut.file.replace(/#.*$/,"")!==N.replace(/#.*$/,""))){var jn=Pe();if(jn){var Qt=jn.innerHTML;Me.addMetadata("script","content",Qt.length<=K2?Qt:Qt.substr(0,K2)),ut&&ut.lineNumber&&(ut.code=we(ut.lineNumber))}}},!0);var Qe=_(["setTimeout","setInterval","setImmediate","requestAnimationFrame"],function(Me){return jp(T,Me,function(ut){return hn(ut,function(jn){return{get:function(){return jn[0]},replace:function(Qt){jn[0]=Qt}}})})}),Dt=Qe[0];_(["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],function(Me){!T[Me]||!T[Me].prototype||!Object.prototype.hasOwnProperty.call(T[Me].prototype,"addEventListener")||(jp(T[Me].prototype,"addEventListener",function(ut){return hn(ut,G2)}),jp(T[Me].prototype,"removeEventListener",function(ut){return hn(ut,G2,!0)}))});function hn(Me,ut,jn){return jn===void 0&&(jn=!1),function(){var Qt=[].slice.call(arguments);try{var _r=ut(Qt),Vr=_r.get();if(jn&&Me.apply(this,Qt),typeof Vr!="function")return Me.apply(this,Qt);if(Vr.__trace__)_r.replace(Vr.__trace__);else{var Bs=Pe();Vr.__trace__=function(){me(Bs),Dt(function(){me(null)},0);var nE=Vr.apply(this,arguments);return me(null),nE},Vr.__trace__.__trace__=Vr.__trace__,_r.replace(Vr.__trace__)}}catch{}if(Me.apply)return Me.apply(this,Qt);switch(Qt.length){case 1:return Me(Qt[0]);case 2:return Me(Qt[0],Qt[1]);default:return Me()}}}},configSchema:{trackInlineScripts:{validate:function(z){return z===!0||z===!1},defaultValue:function(){return!0},message:"should be true|false"}}}};function jp(E,T,z){var N=E[T];if(!N)return N;var U=z(N);return E[T]=U,N}function G2(E){var T=!!E[1]&&typeof E[1].handleEvent=="function";return{get:function(){return T?E[1].handleEvent:E[1]},replace:function(z){T?E[1].handleEvent=z:E[1]=z}}}var U9=function(E){return E===void 0&&(E=window),{load:function(T){"addEventListener"in E&&T._isBreadcrumbTypeEnabled("user")&&E.addEventListener("click",function(z){var N,U;try{N=H9(z.target),U=Y2(z.target,E)}catch{N="[hidden]",U="[hidden]",T._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z")}T.leaveBreadcrumb("UI click",{targetText:N,targetSelector:U},"user")},!0)}}},H9=function(E){var T=E.textContent||E.innerText||"";return!T&&(E.type==="submit"||E.type==="button")&&(T=E.value),T=T.replace(/^\s+|\s+$/g,""),W9(T,140)};function Y2(E,T){var z=[E.tagName];if(E.id&&z.push("#"+E.id),E.className&&E.className.length&&z.push("."+E.className.split(" ").join(".")),!T.document.querySelectorAll||!Array.prototype.indexOf)return z.join("");try{if(T.document.querySelectorAll(z.join("")).length===1)return z.join("")}catch{return z.join("")}if(E.parentNode.childNodes.length>1){var N=Array.prototype.indexOf.call(E.parentNode.childNodes,E)+1;z.push(":nth-child("+N+")")}return T.document.querySelectorAll(z.join("")).length===1?z.join(""):E.parentNode?Y2(E.parentNode,T)+" > "+z.join(""):z.join("")}function W9(E,T){var z="(...)";return E&&E.length<=T?E:E.slice(0,T-z.length)+z}var X2={};X2=function(E){E===void 0&&(E=window);var T={load:function(z){if("addEventListener"in E&&z._isBreadcrumbTypeEnabled("navigation")){var N=function(U){return function(){return z.leaveBreadcrumb(U,{},"navigation")}};E.addEventListener("pagehide",N("Page hidden"),!0),E.addEventListener("pageshow",N("Page shown"),!0),E.addEventListener("load",N("Page loaded"),!0),E.document.addEventListener("DOMContentLoaded",N("DOMContentLoaded"),!0),E.addEventListener("load",function(){return E.addEventListener("popstate",N("Navigated back"),!0)}),E.addEventListener("hashchange",function(U){var Y=U.oldURL?{from:Qu(U.oldURL,E),to:Qu(U.newURL,E),state:J2(E)}:{to:Qu(E.location.href,E)};z.leaveBreadcrumb("Hash changed",Y,"navigation")},!0),E.history.replaceState&&Q2(z,E.history,"replaceState",E),E.history.pushState&&Q2(z,E.history,"pushState",E)}}};return T};var Qu=function(E,T){var z=T.document.createElement("A");return z.href=E,""+z.pathname+z.search+z.hash},V9=function(E,T,z,N){var U=Qu(E.location.href,E);return{title:z,state:T,prevState:J2(E),to:N||U,from:U}},Q2=function(E,T,z,N){var U=T[z];T[z]=function(Y,Q,fe){E.leaveBreadcrumb("History "+z,V9(N,Y,Q,fe),"navigation"),typeof E.resetEventCount=="function"&&E.resetEventCount(),E._config.autoTrackSessions&&E.startSession(),U.apply(T,[Y,Q].concat(fe!==void 0?fe:[]))}},J2=function(E){try{return E.history.state}catch{}},Ea="request",Z2="BS~~S",js="BS~~U",Bp="BS~~M",q9=function(E,T){E===void 0&&(E=[]),T===void 0&&(T=window);var z={load:function(N){if(!N._isBreadcrumbTypeEnabled("request"))return;var U=[N._config.endpoints.notify,N._config.endpoints.sessions].concat(E);Y(),ne();function Y(){if("addEventListener"in T.XMLHttpRequest.prototype){var Pe=T.XMLHttpRequest.prototype.open;T.XMLHttpRequest.prototype.open=function(Qe,Dt){this[js]=Dt,this[Bp]=Qe,this[Z2]&&(this.removeEventListener("load",Q),this.removeEventListener("error",fe)),this.addEventListener("load",Q),this.addEventListener("error",fe),this[Z2]=!0,Pe.apply(this,arguments)}}}function Q(){var Pe=this[js];if(Pe===void 0){N._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}if(!(typeof Pe=="string"&&o(U,Pe.replace(/\?.*$/,"")))){var we={status:this.status,request:this[Bp]+" "+this[js]};this.status>=400?N.leaveBreadcrumb("XMLHttpRequest failed",we,Ea):N.leaveBreadcrumb("XMLHttpRequest succeeded",we,Ea)}}function fe(){var Pe=this[js];if(Pe===void 0){N._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}typeof Pe=="string"&&o(U,Pe.replace(/\?.*$/,""))||N.leaveBreadcrumb("XMLHttpRequest error",{request:this[Bp]+" "+this[js]},Ea)}function ne(){if(!(!("fetch"in T)||T.fetch.polyfill)){var Pe=T.fetch;T.fetch=function(){var Qe=arguments,Dt=arguments[0],hn=arguments[1],Me,ut=null;return Dt&&typeof Dt=="object"?(ut=Dt.url,hn&&"method"in hn?Me=hn.method:Dt&&"method"in Dt&&(Me=Dt.method)):(ut=Dt,hn&&"method"in hn&&(Me=hn.method)),Me===void 0&&(Me="GET"),new Promise(function(jn,Qt){Pe.apply(void 0,Qe).then(function(_r){Se(_r,Me,ut),jn(_r)}).catch(function(_r){me(Me,ut),Qt(_r)})})}}}var Se=function(Pe,we,Qe){var Dt={status:Pe.status,request:we+" "+Qe};Pe.status>=400?N.leaveBreadcrumb("fetch() failed",Dt,Ea):N.leaveBreadcrumb("fetch() succeeded",Dt,Ea)},me=function(Pe,we){N.leaveBreadcrumb("fetch() error",{request:Pe+" "+we},Ea)}}};return z},K9={load:function(E){var T=0;E.addOnError(function(z){if(T>=E._config.maxEvents)return E._logger.warn("Cancelling event send due to maxEvents per session limit of "+E._config.maxEvents+" being reached"),!1;T++}),E.resetEventCount=function(){T=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(E){return c(1,100)(E)}}}},Fp={};Fp={load:function(E){E.addOnError(function(T){var z=r(T.errors,function(N,U){return N.concat(U.stacktrace)},[]);_(z,function(N){N.file=G9(N.file)})})}};var G9=Fp._strip=function(E){return typeof E=="string"?E.replace(/\?.*$/,"").replace(/#.*$/,""):E},Y9=function(E){return E===void 0&&(E=window),{load:function(T){if(!T._config.autoDetectErrors||!T._config.enabledErrorTypes.unhandledExceptions)return;function z(U,Y,Q,fe,ne){if(Q===0&&/Script error\.?/.test(U))T._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z");else{var Se={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},me;if(ne)me=T.Event.create(ne,!0,Se,"window onerror",1),eb(me.errors[0].stacktrace,Y,Q,fe);else if(typeof U=="object"&&U!==null&&(!Y||typeof Y!="string")&&!Q&&!fe&&!ne){var Pe=U.type?"Event: "+U.type:"Error",we=U.message||U.detail||"";me=T.Event.create({name:Pe,message:we},!0,Se,"window onerror",1),me.originalError=U,me.addMetadata("window onerror",{event:U,extraParameters:Y})}else me=T.Event.create(U,!0,Se,"window onerror",1),eb(me.errors[0].stacktrace,Y,Q,fe);T._notify(me)}typeof N=="function"&&N.apply(this,arguments)}var N=E.onerror;E.onerror=z}}},eb=function(E,T,z,N){E[0]||E.push({});var U=E[0];!U.file&&typeof T=="string"&&(U.file=T),!U.lineNumber&&$p(z)&&(U.lineNumber=z),U.columnNumber||($p(N)?U.columnNumber=N:window.event&&$p(window.event.errorCharacter)&&(U.columnNumber=window.event.errorCharacter))},$p=function(E){return typeof E=="number"&&String.call(E)!=="NaN"},X9=function(E){E===void 0&&(E=window);var T={load:function(z){if(!(!z._config.autoDetectErrors||!z._config.enabledErrorTypes.unhandledRejections)){var N=function(U){var Y=U.reason,Q=!1;try{U.detail&&U.detail.reason&&(Y=U.detail.reason,Q=!0)}catch{}var fe=z.Event.create(Y,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}},"unhandledrejection handler",1,z._logger);Q&&_(fe.errors[0].stacktrace,Q9(Y)),z._notify(fe,function(ne){if(pe(ne.originalError)&&!ne.originalError.stack){var Se;ne.addMetadata("unhandledRejection handler",(Se={},Se[Object.prototype.toString.call(ne.originalError)]={name:ne.originalError.name,message:ne.originalError.message,code:ne.originalError.code},Se))}})};"addEventListener"in E?E.addEventListener("unhandledrejection",N):E.onunhandledrejection=function(U,Y){N({detail:{reason:U,promise:Y}})}}}};return T},Q9=function(E){return function(T){T.file!==E.toString()&&T.method&&(T.method=T.method.replace(/^\s+/,""))}},Uo={},J9="Bugsnag JavaScript",Z9="7.16.2",eE="https://github.com/bugsnag/bugsnag-js",tE=b({},y.schema,C),zn={_client:null,createClient:function(E){typeof E=="string"&&(E={apiKey:E}),E||(E={});var T=[R9,M9(),A9(),N9(),K9,z9,B9,Fp,Y9(),X9(),X2(),U9(),q9(),V2,$9()],z=new Tn(E,tE,T,{name:J9,version:Z9,url:eE});return z._setDelivery(window.XDomainRequest?Qi:$o),z._logger.debug("Loaded!"),z.leaveBreadcrumb("Bugsnag loaded",{},"state"),z._config.autoTrackSessions?z.startSession():z},start:function(E){return zn._client?(zn._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),zn._client):(zn._client=zn.createClient(E),zn._client)}};return _(["resetEventCount"].concat(l(Tn.prototype)),function(E){/^_/.test(E)||(zn[E]=function(){if(!zn._client)return console.log("Bugsnag."+E+"() was called before Bugsnag.start()");zn._client._depth+=1;var T=zn._client[E].apply(zn._client,arguments);return zn._client._depth-=1,T})}),Uo=zn,Uo.Client=Tn,Uo.Event=Ee,Uo.Session=kr,Uo.Breadcrumb=m,Uo.default=zn,Uo})})(EN);(function(e){e.exports=d1})(_N);const f1=eh(c1);var h1={},RN={get exports(){return h1},set exports(e){h1=e}};(function(e,t){(function(n){e.exports=n()})(function(){var n={};function r(){return r=Object.assign||function(l){for(var c=1;c1e6))throw new Error("payload exceeded 1MB limit");return z},Rr.session=function(E,T){var z=P(E,null,null);if(z.length>1e6)throw new Error("payload exceeded 1MB limit");return z};var Ji={};Ji=function(E,T){return T===void 0&&(T=window),{sendEvent:function(z,M){M===void 0&&(M=function(){});var H=Fo(E._config,"notify","4",T),Y=new T.XDomainRequest;Y.onload=function(){M(null)},Y.open("POST",H),setTimeout(function(){try{Y.send(Rr.event(z,E._config.redactedKeys))}catch(J){E._logger.error(J),M(J)}},0)},sendSession:function(z,M){M===void 0&&(M=function(){});var H=Fo(E._config,"sessions","1",T),Y=new T.XDomainRequest;Y.onload=function(){M(null)},Y.open("POST",H),setTimeout(function(){try{Y.send(Rr.session(z,E._config.redactedKeys))}catch(J){E._logger.error(J),M(J)}},0)}}};var Fo=function(E,T,z,M){var H=JSON.parse(JSON.stringify(new Date)),Y=Qu(E.endpoints[T],M.location.protocol);return Y+"?apiKey="+encodeURIComponent(E.apiKey)+"&payloadVersion="+z+"&sentAt="+encodeURIComponent(H)},Qu=Ji._matchPageProtocol=function(E,T){return T==="http:"?E.replace(/^https:/,"http:"):E},$o=function(E,T){return T===void 0&&(T=window),{sendEvent:function(z,M){M===void 0&&(M=function(){});try{var H=E._config.endpoints.notify,Y=new T.XMLHttpRequest;Y.onreadystatechange=function(){Y.readyState===T.XMLHttpRequest.DONE&&M(null)},Y.open("POST",H),Y.setRequestHeader("Content-Type","application/json"),Y.setRequestHeader("Bugsnag-Api-Key",z.apiKey||E._config.apiKey),Y.setRequestHeader("Bugsnag-Payload-Version","4"),Y.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),Y.send(Rr.event(z,E._config.redactedKeys))}catch(J){E._logger.error(J)}},sendSession:function(z,M){M===void 0&&(M=function(){});try{var H=E._config.endpoints.sessions,Y=new T.XMLHttpRequest;Y.onreadystatechange=function(){Y.readyState===T.XMLHttpRequest.DONE&&M(null)},Y.open("POST",H),Y.setRequestHeader("Content-Type","application/json"),Y.setRequestHeader("Bugsnag-Api-Key",E._config.apiKey),Y.setRequestHeader("Bugsnag-Payload-Version","1"),Y.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),Y.send(Rr.session(z,E._config.redactedKeys))}catch(J){E._logger.error(J)}}}},Zi=new Date,Bs=function(){Zi=new Date},L9={name:"appDuration",load:function(E){return E.addOnError(function(T){var z=new Date;T.app.duration=z-Zi},!0),{reset:Bs}}},D9=function(E){return E===void 0&&(E=window),{load:function(T){T.addOnError(function(z){z.context===void 0&&(z.context=E.location.pathname)},!0)}}},zp=function(T,z){var M="000000000"+T;return M.substr(M.length-z)},W2=typeof window=="object"?window:self,q2=0;for(var N9 in W2)Object.hasOwnProperty.call(W2,N9)&&q2++;var M9=navigator.mimeTypes?navigator.mimeTypes.length:0,z9=zp((M9+navigator.userAgent.length).toString(36)+q2.toString(36),4),K2=function(){return z9},Fs=0,jp=4,Ju=36,G2=Math.pow(Ju,jp);function Y2(){return zp((Math.random()*G2<<0).toString(Ju),jp)}function j9(){return Fs=Fsdocument.documentElement.clientHeight?"landscape":"portrait",z._config.generateAnonymousId&&(M.id=F9()),z.addOnSession(function(H){H.device=b({},H.device,M),z._config.collectUserIp||J2(H)}),z.addOnError(function(H){H.device=b({},H.device,M,{time:new Date}),z._config.collectUserIp||J2(H)},!0)},configSchema:{generateAnonymousId:{validate:function(z){return z===!0||z===!1},defaultValue:function(){return!0},message:"should be true|false"}}}},J2=function(E){var T=E.getUser();(!T||!T.id)&&E.setUser(E.device.id)},H9=function(E){return E===void 0&&(E=window),{load:function(T){T.addOnError(function(z){z.request&&z.request.url||(z.request=b({},z.request,{url:E.location.href}))},!0)}}},U9={load:function(E){E._sessionDelegate=V9}},V9={startSession:function(E,T){var z=E;return z._session=T,z._pausedSession=null,z._config.enabledReleaseStages!==null&&!o(z._config.enabledReleaseStages,z._config.releaseStage)?(z._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration"),z):(z._delivery.sendSession({notifier:z._notifier,device:T.device,app:T.app,sessions:[{id:T.id,startedAt:T.startedAt,user:T._user}]}),z)},resumeSession:function(E){return E._session?E:E._pausedSession?(E._session=E._pausedSession,E._pausedSession=null,E):E.startSession()},pauseSession:function(E){E._pausedSession=E._session,E._session=null}},W9={load:function(E){E._config.collectUserIp||E.addOnError(function(T){T._user&&typeof T._user.id>"u"&&delete T._user.id,T._user=b({id:"[REDACTED]"},T._user),T.request=b({clientIp:"[REDACTED]"},T.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(E){return E===!0||E===!1}}}},Z2={};Z2.load=function(E){var T=/^(local-)?dev(elopment)?$/.test(E._config.releaseStage);T||!E._isBreadcrumbTypeEnabled("log")||_(q9,function(z){var M=console[z];console[z]=function(){for(var H=arguments.length,Y=new Array(H),J=0;J"].concat(H.split(` +`)),Bn=Ne-1,Qt=Math.max(Bn-3,0),Ar=Math.min(Bn+3,ut.length);return r(ut.slice(Qt,Ar),function(Kr,Hs,Up){return Kr[Qt+1+Up]=Hs.length<=eb?Hs:Hs.substr(0,eb),Kr},{})};z.addOnError(function(Ne){Ne.errors[0].stacktrace=i(Ne.errors[0].stacktrace,function(Ar){return!/__trace__$/.test(Ar.method)});var ut=Ne.errors[0].stacktrace[0];if(!(ut&&ut.file&&ut.file.replace(/#.*$/,"")!==M.replace(/#.*$/,""))){var Bn=Pe();if(Bn){var Qt=Bn.innerHTML;Ne.addMetadata("script","content",Qt.length<=tb?Qt:Qt.substr(0,tb)),ut&&ut.lineNumber&&(ut.code=we(ut.lineNumber))}}},!0);var Qe=_(["setTimeout","setInterval","setImmediate","requestAnimationFrame"],function(Ne){return Bp(T,Ne,function(ut){return hn(ut,function(Bn){return{get:function(){return Bn[0]},replace:function(Qt){Bn[0]=Qt}}})})}),Nt=Qe[0];_(["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],function(Ne){!T[Ne]||!T[Ne].prototype||!Object.prototype.hasOwnProperty.call(T[Ne].prototype,"addEventListener")||(Bp(T[Ne].prototype,"addEventListener",function(ut){return hn(ut,nb)}),Bp(T[Ne].prototype,"removeEventListener",function(ut){return hn(ut,nb,!0)}))});function hn(Ne,ut,Bn){return Bn===void 0&&(Bn=!1),function(){var Qt=[].slice.call(arguments);try{var Ar=ut(Qt),Kr=Ar.get();if(Bn&&Ne.apply(this,Qt),typeof Kr!="function")return Ne.apply(this,Qt);if(Kr.__trace__)Ar.replace(Kr.__trace__);else{var Hs=Pe();Kr.__trace__=function(){me(Hs),Nt(function(){me(null)},0);var lE=Kr.apply(this,arguments);return me(null),lE},Kr.__trace__.__trace__=Kr.__trace__,Ar.replace(Kr.__trace__)}}catch{}if(Ne.apply)return Ne.apply(this,Qt);switch(Qt.length){case 1:return Ne(Qt[0]);case 2:return Ne(Qt[0],Qt[1]);default:return Ne()}}}},configSchema:{trackInlineScripts:{validate:function(z){return z===!0||z===!1},defaultValue:function(){return!0},message:"should be true|false"}}}};function Bp(E,T,z){var M=E[T];if(!M)return M;var H=z(M);return E[T]=H,M}function nb(E){var T=!!E[1]&&typeof E[1].handleEvent=="function";return{get:function(){return T?E[1].handleEvent:E[1]},replace:function(z){T?E[1].handleEvent=z:E[1]=z}}}var G9=function(E){return E===void 0&&(E=window),{load:function(T){"addEventListener"in E&&T._isBreadcrumbTypeEnabled("user")&&E.addEventListener("click",function(z){var M,H;try{M=Y9(z.target),H=rb(z.target,E)}catch{M="[hidden]",H="[hidden]",T._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z")}T.leaveBreadcrumb("UI click",{targetText:M,targetSelector:H},"user")},!0)}}},Y9=function(E){var T=E.textContent||E.innerText||"";return!T&&(E.type==="submit"||E.type==="button")&&(T=E.value),T=T.replace(/^\s+|\s+$/g,""),X9(T,140)};function rb(E,T){var z=[E.tagName];if(E.id&&z.push("#"+E.id),E.className&&E.className.length&&z.push("."+E.className.split(" ").join(".")),!T.document.querySelectorAll||!Array.prototype.indexOf)return z.join("");try{if(T.document.querySelectorAll(z.join("")).length===1)return z.join("")}catch{return z.join("")}if(E.parentNode.childNodes.length>1){var M=Array.prototype.indexOf.call(E.parentNode.childNodes,E)+1;z.push(":nth-child("+M+")")}return T.document.querySelectorAll(z.join("")).length===1?z.join(""):E.parentNode?rb(E.parentNode,T)+" > "+z.join(""):z.join("")}function X9(E,T){var z="(...)";return E&&E.length<=T?E:E.slice(0,T-z.length)+z}var ib={};ib=function(E){E===void 0&&(E=window);var T={load:function(z){if("addEventListener"in E&&z._isBreadcrumbTypeEnabled("navigation")){var M=function(H){return function(){return z.leaveBreadcrumb(H,{},"navigation")}};E.addEventListener("pagehide",M("Page hidden"),!0),E.addEventListener("pageshow",M("Page shown"),!0),E.addEventListener("load",M("Page loaded"),!0),E.document.addEventListener("DOMContentLoaded",M("DOMContentLoaded"),!0),E.addEventListener("load",function(){return E.addEventListener("popstate",M("Navigated back"),!0)}),E.addEventListener("hashchange",function(H){var Y=H.oldURL?{from:Zu(H.oldURL,E),to:Zu(H.newURL,E),state:ab(E)}:{to:Zu(E.location.href,E)};z.leaveBreadcrumb("Hash changed",Y,"navigation")},!0),E.history.replaceState&&ob(z,E.history,"replaceState",E),E.history.pushState&&ob(z,E.history,"pushState",E)}}};return T};var Zu=function(E,T){var z=T.document.createElement("A");return z.href=E,""+z.pathname+z.search+z.hash},Q9=function(E,T,z,M){var H=Zu(E.location.href,E);return{title:z,state:T,prevState:ab(E),to:M||H,from:H}},ob=function(E,T,z,M){var H=T[z];T[z]=function(Y,J,fe){E.leaveBreadcrumb("History "+z,Q9(M,Y,J,fe),"navigation"),typeof E.resetEventCount=="function"&&E.resetEventCount(),E._config.autoTrackSessions&&E.startSession(),H.apply(T,[Y,J].concat(fe!==void 0?fe:[]))}},ab=function(E){try{return E.history.state}catch{}},Ra="request",sb="BS~~S",$s="BS~~U",Fp="BS~~M",J9=function(E,T){E===void 0&&(E=[]),T===void 0&&(T=window);var z={load:function(M){if(!M._isBreadcrumbTypeEnabled("request"))return;var H=[M._config.endpoints.notify,M._config.endpoints.sessions].concat(E);Y(),ne();function Y(){if("addEventListener"in T.XMLHttpRequest.prototype){var Pe=T.XMLHttpRequest.prototype.open;T.XMLHttpRequest.prototype.open=function(Qe,Nt){this[$s]=Nt,this[Fp]=Qe,this[sb]&&(this.removeEventListener("load",J),this.removeEventListener("error",fe)),this.addEventListener("load",J),this.addEventListener("error",fe),this[sb]=!0,Pe.apply(this,arguments)}}}function J(){var Pe=this[$s];if(Pe===void 0){M._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}if(!(typeof Pe=="string"&&o(H,Pe.replace(/\?.*$/,"")))){var we={status:this.status,request:this[Fp]+" "+this[$s]};this.status>=400?M.leaveBreadcrumb("XMLHttpRequest failed",we,Ra):M.leaveBreadcrumb("XMLHttpRequest succeeded",we,Ra)}}function fe(){var Pe=this[$s];if(Pe===void 0){M._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}typeof Pe=="string"&&o(H,Pe.replace(/\?.*$/,""))||M.leaveBreadcrumb("XMLHttpRequest error",{request:this[Fp]+" "+this[$s]},Ra)}function ne(){if(!(!("fetch"in T)||T.fetch.polyfill)){var Pe=T.fetch;T.fetch=function(){var Qe=arguments,Nt=arguments[0],hn=arguments[1],Ne,ut=null;return Nt&&typeof Nt=="object"?(ut=Nt.url,hn&&"method"in hn?Ne=hn.method:Nt&&"method"in Nt&&(Ne=Nt.method)):(ut=Nt,hn&&"method"in hn&&(Ne=hn.method)),Ne===void 0&&(Ne="GET"),new Promise(function(Bn,Qt){Pe.apply(void 0,Qe).then(function(Ar){Se(Ar,Ne,ut),Bn(Ar)}).catch(function(Ar){me(Ne,ut),Qt(Ar)})})}}}var Se=function(Pe,we,Qe){var Nt={status:Pe.status,request:we+" "+Qe};Pe.status>=400?M.leaveBreadcrumb("fetch() failed",Nt,Ra):M.leaveBreadcrumb("fetch() succeeded",Nt,Ra)},me=function(Pe,we){M.leaveBreadcrumb("fetch() error",{request:Pe+" "+we},Ra)}}};return z},Z9={load:function(E){var T=0;E.addOnError(function(z){if(T>=E._config.maxEvents)return E._logger.warn("Cancelling event send due to maxEvents per session limit of "+E._config.maxEvents+" being reached"),!1;T++}),E.resetEventCount=function(){T=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(E){return c(1,100)(E)}}}},$p={};$p={load:function(E){E.addOnError(function(T){var z=r(T.errors,function(M,H){return M.concat(H.stacktrace)},[]);_(z,function(M){M.file=eE(M.file)})})}};var eE=$p._strip=function(E){return typeof E=="string"?E.replace(/\?.*$/,"").replace(/#.*$/,""):E},tE=function(E){return E===void 0&&(E=window),{load:function(T){if(!T._config.autoDetectErrors||!T._config.enabledErrorTypes.unhandledExceptions)return;function z(H,Y,J,fe,ne){if(J===0&&/Script error\.?/.test(H))T._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z");else{var Se={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},me;if(ne)me=T.Event.create(ne,!0,Se,"window onerror",1),lb(me.errors[0].stacktrace,Y,J,fe);else if(typeof H=="object"&&H!==null&&(!Y||typeof Y!="string")&&!J&&!fe&&!ne){var Pe=H.type?"Event: "+H.type:"Error",we=H.message||H.detail||"";me=T.Event.create({name:Pe,message:we},!0,Se,"window onerror",1),me.originalError=H,me.addMetadata("window onerror",{event:H,extraParameters:Y})}else me=T.Event.create(H,!0,Se,"window onerror",1),lb(me.errors[0].stacktrace,Y,J,fe);T._notify(me)}typeof M=="function"&&M.apply(this,arguments)}var M=E.onerror;E.onerror=z}}},lb=function(E,T,z,M){E[0]||E.push({});var H=E[0];!H.file&&typeof T=="string"&&(H.file=T),!H.lineNumber&&Hp(z)&&(H.lineNumber=z),H.columnNumber||(Hp(M)?H.columnNumber=M:window.event&&Hp(window.event.errorCharacter)&&(H.columnNumber=window.event.errorCharacter))},Hp=function(E){return typeof E=="number"&&String.call(E)!=="NaN"},nE=function(E){E===void 0&&(E=window);var T={load:function(z){if(!(!z._config.autoDetectErrors||!z._config.enabledErrorTypes.unhandledRejections)){var M=function(H){var Y=H.reason,J=!1;try{H.detail&&H.detail.reason&&(Y=H.detail.reason,J=!0)}catch{}var fe=z.Event.create(Y,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}},"unhandledrejection handler",1,z._logger);J&&_(fe.errors[0].stacktrace,rE(Y)),z._notify(fe,function(ne){if(pe(ne.originalError)&&!ne.originalError.stack){var Se;ne.addMetadata("unhandledRejection handler",(Se={},Se[Object.prototype.toString.call(ne.originalError)]={name:ne.originalError.name,message:ne.originalError.message,code:ne.originalError.code},Se))}})};"addEventListener"in E?E.addEventListener("unhandledrejection",M):E.onunhandledrejection=function(H,Y){M({detail:{reason:H,promise:Y}})}}}};return T},rE=function(E){return function(T){T.file!==E.toString()&&T.method&&(T.method=T.method.replace(/^\s+/,""))}},Ho={},iE="Bugsnag JavaScript",oE="7.16.2",aE="https://github.com/bugsnag/bugsnag-js",sE=b({},y.schema,C),jn={_client:null,createClient:function(E){typeof E=="string"&&(E={apiKey:E}),E||(E={});var T=[L9,$9(),D9(),H9(),Z9,U9,W9,$p,tE(),nE(),ib(),G9(),J9(),Z2,K9()],z=new Tn(E,sE,T,{name:iE,version:oE,url:aE});return z._setDelivery(window.XDomainRequest?Ji:$o),z._logger.debug("Loaded!"),z.leaveBreadcrumb("Bugsnag loaded",{},"state"),z._config.autoTrackSessions?z.startSession():z},start:function(E){return jn._client?(jn._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),jn._client):(jn._client=jn.createClient(E),jn._client)}};return _(["resetEventCount"].concat(l(Tn.prototype)),function(E){/^_/.test(E)||(jn[E]=function(){if(!jn._client)return console.log("Bugsnag."+E+"() was called before Bugsnag.start()");jn._client._depth+=1;var T=jn._client[E].apply(jn._client,arguments);return jn._client._depth-=1,T})}),Ho=jn,Ho.Client=Tn,Ho.Event=Ee,Ho.Session=_r,Ho.Breadcrumb=m,Ho.default=jn,Ho})})(MM);(function(e){e.exports=f1})(NM);const h1=nh(d1);var p1={},zM={get exports(){return p1},set exports(e){p1=e}};(function(e,t){(function(n){e.exports=n()})(function(){var n={};function r(){return r=Object.assign||function(l){for(var c=1;c{const[t,n,r]=GO(),[i,o]=yi("mainColor","#1b50d8"),[a,s]=yi("navbarTop",!1),[u,l]=yi("viewTransitionsEnabled",!0),[c,h]=yi("navbarFloating",!0),[p,y]=yi("sideBarOpen",window.innerWidth>Qx),[g,b]=_k(),[_,S]=iy(),[k,C]=yi("drive",_),d=w.useCallback(x=>{const A=new URL(x);C(x),S(A.origin)},[C,S]),v=w.useCallback(x=>{try{b(x),x!=null&&x.subject&&dt.success("Signed in!"),x===void 0&&dt.success("Signed out.")}catch(A){Jx(new Error("Agent setting failed: "+A.message))}},[b]),m=w.useMemo(()=>({drive:k,setDrive:d,darkMode:t,darkModeSetting:r,setDarkMode:n,mainColor:i,setMainColor:o,navbarTop:a,setNavbarTop:s,navbarFloating:c,setNavbarFloating:h,sideBarLocked:p,setSideBarLocked:y,agent:g,setAgent:v,viewTransitionsEnabled:u,setViewTransitionsEnabled:l}),[k,d,t,r,n,i,o,a,s,c,h,p,y,g,v,u,l]);return f(jy.Provider,{value:m,children:e.children})},IN={darkMode:!1,darkModeSetting:Rl.auto,setDarkMode:()=>{},mainColor:"",setMainColor:()=>{},drive:"",setDrive:()=>{},navbarTop:!1,setNavbarTop:()=>{},navbarFloating:!1,setNavbarFloating:()=>{},sideBarLocked:!1,setSideBarLocked:()=>{},agent:void 0,setAgent:()=>{},viewTransitionsEnabled:!0,setViewTransitionsEnabled:()=>{}},ot=()=>w.useContext(jy),jy=de.createContext(IN),ON=({children:e})=>{const{mainColor:t,darkMode:n}=w.useContext(jy);return f(be,{children:f(SO,{theme:DN(n,t),children:e},t)})},Zx={sidebar:10,dialog:100,dropdown:200,networkIndicator:300,toast:400},eC=100,vw="2.2rem",LN="4.2rem",DN=(e,t)=>{const n=e?gi(.2,t):t,r=e?"#000000":"#ffffff",i=e?"#fff":"#000",o=e?"rgba(255,255,255,.15)":"rgba(0,0,0,0.07)",a=e?"rgba(255,255,255,.3)":"rgba(0,0,0,0.2)";return{darkMode:e,fontFamilyHeader:"'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",fontFamily:"'Open Sans', 'Helvetica Neue', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",boxShadow:`0 0 10px 0px ${o}`,boxShadowIntense:`0 0 22px 0px ${a}`,boxShadowSoft:`0px 1.5px 2.2px rgba(0, 0, 0, 0.02), +`:"")+c[p]);return h},u=function(l,c){return function(h){o(p,h);function p(g){var b;return b=h.call(this,g)||this,b.state={error:null,info:null},b.handleClearError=b.handleClearError.bind(i(b)),b}var y=p.prototype;return y.handleClearError=function(){this.setState({error:null,info:null})},y.componentDidCatch=function(b,_){var S=this.props.onError,k={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},C=c.Event.create(b,!0,k,1);_&&_.componentStack&&(_.componentStack=s(_.componentStack)),C.addMetadata("react",_),c._notify(C,S),this.setState({error:b,info:_})},y.render=function(){var b=this.state.error;if(b){var _=this.props.FallbackComponent;return _?l.createElement(_,r({},this.state,{clearError:this.handleClearError})):null}return this.props.children},p}(l.Component)};return n.formatComponentStack=s,n.default=n,n})})(zM);const jM=p1;function rC(e){console.error(e),Kx||h1.notify(e)}function BM(e){return h1.start({apiKey:e,plugins:[new jM],releaseStage:"production",enabledReleaseStages:["production"],autoDetectErrors:!Kx()}),h1.getPlugin("react").createErrorBoundary(de)}const FM=e=>{const[t,n,r]=nL(),[i,o]=yi("mainColor","#1b50d8"),[a,s]=yi("navbarTop",!1),[u,l]=yi("viewTransitionsEnabled",!0),[c,h]=yi("navbarFloating",!0),[p,y]=yi("sideBarOpen",window.innerWidth>nC),[g,b]=Mk(),[_,S]=oy(),[k,C]=yi("drive",_),d=w.useCallback(x=>{const A=new URL(x);C(x),S(A.origin)},[C,S]),v=w.useCallback(x=>{try{b(x),x!=null&&x.subject&&dt.success("Signed in!"),x===void 0&&dt.success("Signed out.")}catch(A){rC(new Error("Agent setting failed: "+A.message))}},[b]),m=w.useMemo(()=>({drive:k,setDrive:d,darkMode:t,darkModeSetting:r,setDarkMode:n,mainColor:i,setMainColor:o,navbarTop:a,setNavbarTop:s,navbarFloating:c,setNavbarFloating:h,sideBarLocked:p,setSideBarLocked:y,agent:g,setAgent:v,viewTransitionsEnabled:u,setViewTransitionsEnabled:l}),[k,d,t,r,n,i,o,a,s,c,h,p,y,g,v,u,l]);return f(Vy.Provider,{value:m,children:e.children})},$M={darkMode:!1,darkModeSetting:Al.auto,setDarkMode:()=>{},mainColor:"",setMainColor:()=>{},drive:"",setDrive:()=>{},navbarTop:!1,setNavbarTop:()=>{},navbarFloating:!1,setNavbarFloating:()=>{},sideBarLocked:!1,setSideBarLocked:()=>{},agent:void 0,setAgent:()=>{},viewTransitionsEnabled:!0,setViewTransitionsEnabled:()=>{}},ot=()=>w.useContext(Vy),Vy=de.createContext($M),HM=({children:e})=>{const{mainColor:t,darkMode:n}=w.useContext(Vy);return f(ye,{children:f(TO,{theme:VM(n,t),children:e},t)})},iC={sidebar:10,dialog:100,dropdown:200,networkIndicator:300,toast:400},oC=100,Ew="2.2rem",UM="4.2rem",VM=(e,t)=>{const n=e?gi(.2,t):t,r=e?"#000000":"#ffffff",i=e?"#fff":"#000",o=e?"rgba(255,255,255,.15)":"rgba(0,0,0,0.07)",a=e?"rgba(255,255,255,.3)":"rgba(0,0,0,0.2)";return{darkMode:e,fontFamilyHeader:"'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",fontFamily:"'Open Sans', 'Helvetica Neue', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",boxShadow:`0 0 10px 0px ${o}`,boxShadowIntense:`0 0 22px 0px ${a}`,boxShadowSoft:`0px 1.5px 2.2px rgba(0, 0, 0, 0.02), 0px 3.5px 5.3px rgba(0, 0, 0, 0.028), 0px 6.6px 10px rgba(0, 0, 0, 0.035), 0px 11.8px 17.9px rgba(0, 0, 0, 0.042), - 0px 22.1px 33.4px rgba(0, 0, 0, 0.05), 0px 53px 80px rgba(0, 0, 0, 0.07);`,containerWidth:40,containerWidthWide:"900px",fontSizeBody:1,fontSizeH1:2,sideBarWidth:15,margin:1,radius:"9px",heights:{breadCrumbBar:vw,floatingSearchBarPadding:LN,fullPage:`calc(100% - ${vw})`},colors:{main:n,mainLight:gi(.08)(n),mainDark:ro(.08)(n),bg:r,bgBody:e?r:ro(.02)(r),bg1:e?gi(.1)(r):ro(.05)(r),bg2:e?gi(.3)(r):ro(.2)(r),text:i,text1:e?ro(.1)(i):gi(.1)(i),textLight:e?ro(.4)(i):gi(.4)(i),textLight2:e?ro(.8)(i):gi(.8)(i),alert:"#cf5b5b"},animation:{duration:`${eC}ms`},zIndex:Zx}},MN=xO([":root{--view-transition-duration:150ms;}*{box-sizing:border-box;}body{background-color:",";color:",";font-family:",";line-height:1.5em;word-wrap:break-word;overflow-wrap:anywhere;margin:0;transition:background .2s ease,border-color .2s ease,color .2s ease;}input,button,body{overflow-wrap:normal;}a{color:",";}h1{font-size:","rem;}h2{font-size:1.7rem;}h1,h2,h3,h4,h5,h6{margin-bottom:","rem;font-weight:bold;font-family:",";line-height:1em;margin-top:0;word-break:break-word;}i{font-style:italic;}p{margin-top:0;margin-bottom:","rem;}ul{margin-top:0;margin-bottom:","rem;padding:0;li{list-style-type:disc;margin-left:","rem;margin-bottom:","rem;}}code{background-color:",";padding:0rem 0.2rem;font-family:Monaco,monospace;font-size:.8em;display:inline-flex;white-space:nowrap;overflow:auto;max-width:100%;}b{font-weight:bold;}::view-transition-old(*),::view-transition-new(*){animation-duration:var(--view-transition-duration);}::view-transition-old(root),::view-transition-new(root){animation-duration:0ms;}@keyframes slide-in-from-right{from{transform:translateX(5rem);opacity:0;}to{transform:translateX(0);opacity:1;}}::view-transition-image-pair(download-button){mix-blend-mode:normal;}::view-transition-old(download-button):only-child,::view-transition-new(download-button):only-child{animation:slide-in-from-right var(--view-transition-duration) ease-in-out;animation-fill-mode:both;}::view-transition-old(download-button):only-child{animation-direction:reverse;}::view-transition-group(navbar){z-index:10;}@media (prefers-reduced-motion){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none !important;}}@keyframes toast-enter{0%{left:110%;}100%{left:0;}}@keyframes toast-exit{0%{left:0;}100%{left:110%;}}"],e=>e.theme.colors.bgBody,e=>e.theme.colors.text,e=>e.theme.fontFamily,e=>e.theme.colors.main,e=>e.theme.fontSizeH1,e=>e.theme.margin,e=>e.theme.fontFamilyHeader,e=>e.theme.margin,e=>e.theme.margin,e=>e.theme.margin*2,e=>e.theme.margin/2,e=>e.theme.colors.bg1),Ot=B.div.withConfig({displayName:"ContainerNarrow",componentId:"sc-kn6me8-0"})(["max-width:","rem;margin:auto;padding:","rem;padding-bottom:10rem;"],e=>e.theme.containerWidth,e=>e.theme.margin),ba=B.div.withConfig({displayName:"ContainerWide",componentId:"sc-kn6me8-1"})(["width:min(100%,",");margin:auto;padding:","rem;padding-bottom:10rem;"],e=>e.theme.containerWidthWide,e=>e.theme.margin),yf=B.div.withConfig({displayName:"ContainerFull",componentId:"sc-kn6me8-2"})(["padding:","rem;padding-bottom:10rem;"],e=>e.theme.margin),NN=()=>{const[e,t]=de.useState(window.innerWidth);return de.useEffect(()=>{const n=()=>t(window.innerWidth);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e},yw=["http","https","mailto","tel"];function zN(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}/*! + 0px 22.1px 33.4px rgba(0, 0, 0, 0.05), 0px 53px 80px rgba(0, 0, 0, 0.07);`,containerWidth:40,containerWidthWide:"900px",fontSizeBody:1,fontSizeH1:2,sideBarWidth:15,margin:1,radius:"9px",heights:{breadCrumbBar:Ew,floatingSearchBarPadding:UM,fullPage:`calc(100% - ${Ew})`},colors:{main:n,mainLight:gi(.08)(n),mainDark:io(.08)(n),bg:r,bgBody:e?r:io(.02)(r),bg1:e?gi(.1)(r):io(.05)(r),bg2:e?gi(.3)(r):io(.2)(r),text:i,text1:e?io(.1)(i):gi(.1)(i),textLight:e?io(.4)(i):gi(.4)(i),textLight2:e?io(.8)(i):gi(.8)(i),alert:"#cf5b5b"},animation:{duration:`${oC}ms`},zIndex:iC}},WM=IO([":root{--view-transition-duration:150ms;}*{box-sizing:border-box;}body{background-color:",";color:",";font-family:",";line-height:1.5em;word-wrap:break-word;overflow-wrap:anywhere;margin:0;transition:background .2s ease,border-color .2s ease,color .2s ease;}input,button,body{overflow-wrap:normal;}a{color:",";}h1{font-size:","rem;}h2{font-size:1.7rem;}h1,h2,h3,h4,h5,h6{margin-bottom:","rem;font-weight:bold;font-family:",";line-height:1em;margin-top:0;word-break:break-word;}i{font-style:italic;}p{margin-top:0;margin-bottom:","rem;}ul{margin-top:0;margin-bottom:","rem;padding:0;li{list-style-type:disc;margin-left:","rem;margin-bottom:","rem;}}code{background-color:",";padding:0rem 0.2rem;font-family:Monaco,monospace;font-size:.8em;display:inline-flex;white-space:nowrap;overflow:auto;max-width:100%;}b{font-weight:bold;}::view-transition-old(*),::view-transition-new(*){animation-duration:var(--view-transition-duration);}::view-transition-old(root),::view-transition-new(root){animation-duration:0ms;}@keyframes slide-in-from-right{from{transform:translateX(5rem);opacity:0;}to{transform:translateX(0);opacity:1;}}::view-transition-image-pair(download-button){mix-blend-mode:normal;}::view-transition-old(download-button):only-child,::view-transition-new(download-button):only-child{animation:slide-in-from-right var(--view-transition-duration) ease-in-out;animation-fill-mode:both;}::view-transition-old(download-button):only-child{animation-direction:reverse;}::view-transition-group(navbar){z-index:10;}@media (prefers-reduced-motion){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none !important;}}@keyframes toast-enter{0%{left:110%;}100%{left:0;}}@keyframes toast-exit{0%{left:0;}100%{left:110%;}}"],e=>e.theme.colors.bgBody,e=>e.theme.colors.text,e=>e.theme.fontFamily,e=>e.theme.colors.main,e=>e.theme.fontSizeH1,e=>e.theme.margin,e=>e.theme.fontFamilyHeader,e=>e.theme.margin,e=>e.theme.margin,e=>e.theme.margin*2,e=>e.theme.margin/2,e=>e.theme.colors.bg1),_t=B.div.withConfig({displayName:"ContainerNarrow",componentId:"sc-kn6me8-0"})(["max-width:","rem;margin:auto;padding:","rem;padding-bottom:10rem;"],e=>e.theme.containerWidth,e=>e.theme.margin),ba=B.div.withConfig({displayName:"ContainerWide",componentId:"sc-kn6me8-1"})(["width:min(100%,",");margin:auto;padding:","rem;padding-bottom:10rem;"],e=>e.theme.containerWidthWide,e=>e.theme.margin),wf=B.div.withConfig({displayName:"ContainerFull",componentId:"sc-kn6me8-2"})(["padding:","rem;padding-bottom:10rem;"],e=>e.theme.margin),qM=()=>{const[e,t]=de.useState(window.innerWidth);return de.useEffect(()=>{const n=()=>t(window.innerWidth);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e},Rw=["http","https","mailto","tel"];function KM(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let i=-1;for(;++ii||(i=t.indexOf("#"),i!==-1&&r>i)?t:"javascript:void(0)"}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT - */var tC=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};function Al(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bw(e.position):"start"in e||"end"in e?bw(e):"line"in e||"column"in e?p1(e):""}function p1(e){return ww(e&&e.line)+":"+ww(e&&e.column)}function bw(e){return p1(e&&e.start)+"-"+p1(e&&e.end)}function ww(e){return e&&typeof e=="number"?e:1}class Hr extends Error{constructor(t,n,r){const i=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const a=r.indexOf(":");a===-1?i[1]=r:(i[0]=r.slice(0,a),i[1]=r.slice(a+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=Al(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack=typeof t=="object"?t.stack:"",this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.source=i[0],this.ruleId=i[1],this.position=o,this.actual,this.expected,this.file,this.url,this.note}}Hr.prototype.file="";Hr.prototype.name="";Hr.prototype.reason="";Hr.prototype.message="";Hr.prototype.stack="";Hr.prototype.fatal=null;Hr.prototype.column=null;Hr.prototype.line=null;Hr.prototype.source=null;Hr.prototype.ruleId=null;Hr.prototype.position=null;const vi={basename:jN,dirname:BN,extname:FN,join:$N,sep:"/"};function jN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ju(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function BN(e){if(ju(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function FN(e){ju(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function $N(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function HN(e,t){let n="",r=0,i=-1,o=0,a=-1,s,u;for(;++a<=e.length;){if(a2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ju(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const WN={cwd:VN};function VN(){return"/"}function m1(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function qN(e){if(typeof e=="string")e=new URL(e);else if(!m1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return KN(e)}function KN(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||wd.call(t,i)},Rw=function(t,n){xw&&n.name==="__proto__"?xw(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Aw=function(t,n){if(n==="__proto__")if(wd.call(t,n)){if(Cw)return Cw(t,n).value}else return;return t[n]},Tw=function e(){var t,n,r,i,o,a,s=arguments[0],u=1,l=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});ua.length;let u;s&&a.push(i);try{u=e.apply(this,a)}catch(l){const c=l;if(s&&n)throw c;return i(c)}s||(u instanceof Promise?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const XN=oC().freeze(),iC={}.hasOwnProperty;function oC(){const e=GN(),t=[];let n={},r,i=-1;return o.data=a,o.Parser=void 0,o.Compiler=void 0,o.freeze=s,o.attachers=t,o.use=u,o.parse=l,o.stringify=c,o.run=h,o.runSync=p,o.process=y,o.processSync=g,o;function o(){const b=oC();let _=-1;for(;++_{if(m||!x||!A)v(m);else{const L=o.stringify(x,A);L==null||(ZN(L)?A.value=L:A.result=L),v(m,A)}});function v(m,x){m||!x?C(m):k?k(x):_(null,x)}}}function g(b){let _;o.freeze(),Zm("processSync",o.Parser),eg("processSync",o.Compiler);const S=Zs(b);return o.process(S,k),Ow("processSync","process",_),S;function k(C){_=!0,kw(C)}}}function Pw(e,t){return typeof e=="function"&&e.prototype&&(QN(e.prototype)||t in e.prototype)}function QN(e){let t;for(t in e)if(iC.call(e,t))return!0;return!1}function Zm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function eg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function tg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Iw(e){if(!g1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ow(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zs(e){return JN(e)?e:new nC(e)}function JN(e){return Boolean(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZN(e){return typeof e=="string"||tC(e)}function ez(e,t){var{includeImageAlt:n=!0}=t||{};return aC(e,n)}function aC(e,t){return e&&typeof e=="object"&&(e.value||(t?e.alt:"")||"children"in e&&Lw(e.children,t)||Array.isArray(e)&&Lw(e,t))||""}function Lw(e,t){for(var n=[],r=-1;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),[].splice.apply(e,a);else for(n&&[].splice.apply(e,[t,n]);o0?(mr(e,e.length,0,t),e):t}const Dw={}.hasOwnProperty;function sC(e){const t={};let n=-1;for(;++na))return;const x=t.events.length;let A=x,L,P;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(L){P=t.events[A][1].end;break}L=!0}for(S(r),m=x;mC;){const v=n[d];t.containerState=v[1],v[0].exit.call(t,e)}n.length=C}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function cz(e,t,n){return tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wf(e){if(e===null||Kt(e)||Jh(e))return 1;if(Zh(e))return 2}function ep(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);zw(h,-u),zw(p,u),a={type:u>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},o={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Or(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Or(l,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),l=Or(l,ep(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Or(l,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=Or(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,mr(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n=4?a(l):n(l)}function a(l){return l===null?u(l):Ae(l)?e.attempt(kz,a,u)(l):(e.enter("codeFlowValue"),s(l))}function s(l){return l===null||Ae(l)?(e.exit("codeFlowValue"),a(l)):(e.consume(l),s)}function u(l){return e.exit("codeIndented"),t(l)}}function Cz(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Ae(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):tt(e,o,"linePrefix",4+1)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):Ae(a)?i(a):n(a)}}const _z={name:"codeText",tokenize:Az,resolve:Ez,previous:Rz};function Ez(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function fC(e,t,n,r,i,o,a,s,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return h;function h(S){return S===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(S),e.exit(o),p):S===null||S===41||fu(S)?n(S):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),b(S))}function p(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(s),p(S)):S===null||S===60||Ae(S)?n(S):(e.consume(S),S===92?g:y)}function g(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function b(S){return S===40?++c>l?n(S):(e.consume(S),b):S===41?c--?(e.consume(S),b):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(S)):S===null||Kt(S)?c?n(S):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(S)):fu(S)?n(S):(e.consume(S),S===92?_:b)}function _(S){return S===40||S===41||S===92?(e.consume(S),b):b(S)}}function hC(e,t,n,r,i,o){const a=this;let s=0,u;return l;function l(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),c}function c(y){return y===null||y===91||y===93&&!u||y===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs||s>999?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):Ae(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||Ae(y)||s++>999?(e.exit("chunkString"),c(y)):(e.consume(y),u=u||!mt(y),y===92?p:h)}function p(y){return y===91||y===92||y===93?(e.consume(y),s++,h):h(y)}}function pC(e,t,n,r,i,o){let a;return s;function s(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,u}function u(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),l(p))}function l(p){return p===a?(e.exit(o),u(a)):p===null?n(p):Ae(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),tt(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||Ae(p)?(e.exit("chunkString"),l(p)):(e.consume(p),p===92?h:c)}function h(p){return p===a||p===92?(e.consume(p),c):c(p)}}function Tl(e,t){let n;return r;function r(i){return Ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mt(i)?tt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function ri(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mz={name:"definition",tokenize:zz},Nz={tokenize:jz,partial:!0};function zz(e,t,n){const r=this;let i;return o;function o(u){return e.enter("definition"),hC.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(u)}function a(u){return i=ri(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),Tl(e,fC(e,e.attempt(Nz,tt(e,s,"whitespace"),tt(e,s,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(u)}function s(u){return u===null||Ae(u)?(e.exit("definition"),r.parser.defined.includes(i)||r.parser.defined.push(i),t(u)):n(u)}}function jz(e,t,n){return r;function r(a){return Kt(a)?Tl(e,i)(a):n(a)}function i(a){return a===34||a===39||a===40?pC(e,tt(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a):n(a)}function o(a){return a===null||Ae(a)?t(a):n(a)}}const Bz={name:"hardBreakEscape",tokenize:Fz};function Fz(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(o),i}function i(o){return Ae(o)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(o)):n(o)}}const $z={name:"headingAtx",tokenize:Hz,resolve:Uz};function Uz(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Hz(e,t,n){const r=this;let i=0;return o;function o(c){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&i++<6?(e.consume(c),a):c===null||Kt(c)?(e.exit("atxHeadingSequence"),r.interrupt?t(c):s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||Ae(c)?(e.exit("atxHeading"),t(c)):mt(c)?tt(e,s,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),s(c))}function l(c){return c===null||c===35||Kt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),l)}}const Wz=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Fw=["pre","script","style","textarea"],Vz={name:"htmlFlow",tokenize:Gz,resolveTo:Kz,concrete:!0},qz={tokenize:Yz,partial:!0};function Kz(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Gz(e,t,n){const r=this;let i,o,a,s,u;return l;function l(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),g):I===63?(e.consume(I),i=3,r.interrupt?t:K):Dr(I)?(e.consume(I),a=String.fromCharCode(I),o=!0,b):n(I)}function h(I){return I===45?(e.consume(I),i=2,p):I===91?(e.consume(I),i=5,a="CDATA[",s=0,y):Dr(I)?(e.consume(I),i=4,r.interrupt?t:K):n(I)}function p(I){return I===45?(e.consume(I),r.interrupt?t:K):n(I)}function y(I){return I===a.charCodeAt(s++)?(e.consume(I),s===a.length?r.interrupt?t:O:y):n(I)}function g(I){return Dr(I)?(e.consume(I),a=String.fromCharCode(I),b):n(I)}function b(I){return I===null||I===47||I===62||Kt(I)?I!==47&&o&&Fw.includes(a.toLowerCase())?(i=1,r.interrupt?t(I):O(I)):Wz.includes(a.toLowerCase())?(i=6,I===47?(e.consume(I),_):r.interrupt?t(I):O(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?k(I):S(I)):I===45||Ln(I)?(e.consume(I),a+=String.fromCharCode(I),b):n(I)}function _(I){return I===62?(e.consume(I),r.interrupt?t:O):n(I)}function S(I){return mt(I)?(e.consume(I),S):L(I)}function k(I){return I===47?(e.consume(I),L):I===58||I===95||Dr(I)?(e.consume(I),C):mt(I)?(e.consume(I),k):L(I)}function C(I){return I===45||I===46||I===58||I===95||Ln(I)?(e.consume(I),C):d(I)}function d(I){return I===61?(e.consume(I),v):mt(I)?(e.consume(I),d):k(I)}function v(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),u=I,m):mt(I)?(e.consume(I),v):(u=null,x(I))}function m(I){return I===null||Ae(I)?n(I):I===u?(e.consume(I),A):(e.consume(I),m)}function x(I){return I===null||I===34||I===39||I===60||I===61||I===62||I===96||Kt(I)?d(I):(e.consume(I),x)}function A(I){return I===47||I===62||mt(I)?k(I):n(I)}function L(I){return I===62?(e.consume(I),P):n(I)}function P(I){return mt(I)?(e.consume(I),P):I===null||Ae(I)?O(I):n(I)}function O(I){return I===45&&i===2?(e.consume(I),F):I===60&&i===1?(e.consume(I),R):I===62&&i===4?(e.consume(I),ee):I===63&&i===3?(e.consume(I),K):I===93&&i===5?(e.consume(I),$):Ae(I)&&(i===6||i===7)?e.check(qz,ee,V)(I):I===null||Ae(I)?V(I):(e.consume(I),O)}function V(I){return e.exit("htmlFlowData"),H(I)}function H(I){return I===null?D(I):Ae(I)?e.attempt({tokenize:j,partial:!0},H,D)(I):(e.enter("htmlFlowData"),O(I))}function j(I,re,se){return he;function he(ge){return I.enter("lineEnding"),I.consume(ge),I.exit("lineEnding"),W}function W(ge){return r.parser.lazy[r.now().line]?se(ge):re(ge)}}function F(I){return I===45?(e.consume(I),K):O(I)}function R(I){return I===47?(e.consume(I),a="",q):O(I)}function q(I){return I===62&&Fw.includes(a.toLowerCase())?(e.consume(I),ee):Dr(I)&&a.length<8?(e.consume(I),a+=String.fromCharCode(I),q):O(I)}function $(I){return I===93?(e.consume(I),K):O(I)}function K(I){return I===62?(e.consume(I),ee):I===45&&i===2?(e.consume(I),K):O(I)}function ee(I){return I===null||Ae(I)?(e.exit("htmlFlowData"),D(I)):(e.consume(I),ee)}function D(I){return e.exit("htmlFlow"),t(I)}}function Yz(e,t,n){return r;function r(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(Bu,t,n)}}const Xz={name:"htmlText",tokenize:Qz};function Qz(e,t,n){const r=this;let i,o,a,s;return u;function u(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),x):D===63?(e.consume(D),v):Dr(D)?(e.consume(D),P):n(D)}function c(D){return D===45?(e.consume(D),h):D===91?(e.consume(D),o="CDATA[",a=0,_):Dr(D)?(e.consume(D),d):n(D)}function h(D){return D===45?(e.consume(D),p):n(D)}function p(D){return D===null||D===62?n(D):D===45?(e.consume(D),y):g(D)}function y(D){return D===null||D===62?n(D):g(D)}function g(D){return D===null?n(D):D===45?(e.consume(D),b):Ae(D)?(s=g,$(D)):(e.consume(D),g)}function b(D){return D===45?(e.consume(D),ee):g(D)}function _(D){return D===o.charCodeAt(a++)?(e.consume(D),a===o.length?S:_):n(D)}function S(D){return D===null?n(D):D===93?(e.consume(D),k):Ae(D)?(s=S,$(D)):(e.consume(D),S)}function k(D){return D===93?(e.consume(D),C):S(D)}function C(D){return D===62?ee(D):D===93?(e.consume(D),C):S(D)}function d(D){return D===null||D===62?ee(D):Ae(D)?(s=d,$(D)):(e.consume(D),d)}function v(D){return D===null?n(D):D===63?(e.consume(D),m):Ae(D)?(s=v,$(D)):(e.consume(D),v)}function m(D){return D===62?ee(D):v(D)}function x(D){return Dr(D)?(e.consume(D),A):n(D)}function A(D){return D===45||Ln(D)?(e.consume(D),A):L(D)}function L(D){return Ae(D)?(s=L,$(D)):mt(D)?(e.consume(D),L):ee(D)}function P(D){return D===45||Ln(D)?(e.consume(D),P):D===47||D===62||Kt(D)?O(D):n(D)}function O(D){return D===47?(e.consume(D),ee):D===58||D===95||Dr(D)?(e.consume(D),V):Ae(D)?(s=O,$(D)):mt(D)?(e.consume(D),O):ee(D)}function V(D){return D===45||D===46||D===58||D===95||Ln(D)?(e.consume(D),V):H(D)}function H(D){return D===61?(e.consume(D),j):Ae(D)?(s=H,$(D)):mt(D)?(e.consume(D),H):O(D)}function j(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,F):Ae(D)?(s=j,$(D)):mt(D)?(e.consume(D),j):(e.consume(D),i=void 0,q)}function F(D){return D===i?(e.consume(D),R):D===null?n(D):Ae(D)?(s=F,$(D)):(e.consume(D),F)}function R(D){return D===62||D===47||Kt(D)?O(D):n(D)}function q(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===62||Kt(D)?O(D):(e.consume(D),q)}function $(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),tt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function K(D){return e.enter("htmlTextData"),s(D)}function ee(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}}const Fy={name:"labelEnd",tokenize:rj,resolveTo:nj,resolveAll:tj},Jz={tokenize:ij},Zz={tokenize:oj},ej={tokenize:aj};function tj(e){let t=-1,n;for(;++t-1&&(a[0]=a[0].slice(r)),o>0&&a.push(e[i].slice(0,o))),a}function Pj(e,t){let n=-1;const r=[];let i;for(;++ne.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function YM(e){if($u(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function XM(e){$u(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function QM(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ZM(e,t){let n="",r=0,i=-1,o=0,a=-1,s,u;for(;++a<=e.length;){if(a2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function $u(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ez={cwd:tz};function tz(){return"/"}function g1(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function nz(e){if(typeof e=="string")e=new URL(e);else if(!g1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return rz(e)}function rz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||kd.call(t,i)},Mw=function(t,n){Ow&&n.name==="__proto__"?Ow(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},zw=function(t,n){if(n==="__proto__")if(kd.call(t,n)){if(Lw)return Lw(t,n).value}else return;return t[n]},jw=function e(){var t,n,r,i,o,a,s=arguments[0],u=1,l=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});ua.length;let u;s&&a.push(i);try{u=e.apply(this,a)}catch(l){const c=l;if(s&&n)throw c;return i(c)}s||(u instanceof Promise?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const az=cC().freeze(),uC={}.hasOwnProperty;function cC(){const e=iz(),t=[];let n={},r,i=-1;return o.data=a,o.Parser=void 0,o.Compiler=void 0,o.freeze=s,o.attachers=t,o.use=u,o.parse=l,o.stringify=c,o.run=h,o.runSync=p,o.process=y,o.processSync=g,o;function o(){const b=cC();let _=-1;for(;++_{if(m||!x||!A)v(m);else{const D=o.stringify(x,A);D==null||(uz(D)?A.value=D:A.result=D),v(m,A)}});function v(m,x){m||!x?C(m):k?k(x):_(null,x)}}}function g(b){let _;o.freeze(),eg("processSync",o.Parser),tg("processSync",o.Compiler);const S=el(b);return o.process(S,k),$w("processSync","process",_),S;function k(C){_=!0,Iw(C)}}}function Bw(e,t){return typeof e=="function"&&e.prototype&&(sz(e.prototype)||t in e.prototype)}function sz(e){let t;for(t in e)if(uC.call(e,t))return!0;return!1}function eg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function tg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function ng(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Fw(e){if(!v1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $w(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function el(e){return lz(e)?e:new sC(e)}function lz(e){return Boolean(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uz(e){return typeof e=="string"||aC(e)}function cz(e,t){var{includeImageAlt:n=!0}=t||{};return dC(e,n)}function dC(e,t){return e&&typeof e=="object"&&(e.value||(t?e.alt:"")||"children"in e&&Hw(e.children,t)||Array.isArray(e)&&Hw(e,t))||""}function Hw(e,t){for(var n=[],r=-1;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),[].splice.apply(e,a);else for(n&&[].splice.apply(e,[t,n]);o0?(gr(e,e.length,0,t),e):t}const Uw={}.hasOwnProperty;function fC(e){const t={};let n=-1;for(;++na))return;const x=t.events.length;let A=x,D,P;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(D){P=t.events[A][1].end;break}D=!0}for(S(r),m=x;mC;){const v=n[d];t.containerState=v[1],v[0].exit.call(t,e)}n.length=C}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function wz(e,t,n){return tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kf(e){if(e===null||Kt(e)||Zh(e))return 1;if(ep(e))return 2}function tp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);qw(h,-u),qw(p,u),a={type:u>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[r][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},o={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Nr(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Nr(l,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),l=Nr(l,tp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Nr(l,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=Nr(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,gr(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n=4?a(l):n(l)}function a(l){return l===null?u(l):Ae(l)?e.attempt(Oz,a,u)(l):(e.enter("codeFlowValue"),s(l))}function s(l){return l===null||Ae(l)?(e.exit("codeFlowValue"),a(l)):(e.consume(l),s)}function u(l){return e.exit("codeIndented"),t(l)}}function Dz(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Ae(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):tt(e,o,"linePrefix",4+1)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):Ae(a)?i(a):n(a)}}const Nz={name:"codeText",tokenize:jz,resolve:Mz,previous:zz};function Mz(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function vC(e,t,n,r,i,o,a,s,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return h;function h(S){return S===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(S),e.exit(o),p):S===null||S===41||hu(S)?n(S):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),b(S))}function p(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(s),p(S)):S===null||S===60||Ae(S)?n(S):(e.consume(S),S===92?g:y)}function g(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function b(S){return S===40?++c>l?n(S):(e.consume(S),b):S===41?c--?(e.consume(S),b):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(S)):S===null||Kt(S)?c?n(S):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(S)):hu(S)?n(S):(e.consume(S),S===92?_:b)}function _(S){return S===40||S===41||S===92?(e.consume(S),b):b(S)}}function yC(e,t,n,r,i,o){const a=this;let s=0,u;return l;function l(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),c}function c(y){return y===null||y===91||y===93&&!u||y===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs||s>999?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):Ae(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||Ae(y)||s++>999?(e.exit("chunkString"),c(y)):(e.consume(y),u=u||!mt(y),y===92?p:h)}function p(y){return y===91||y===92||y===93?(e.consume(y),s++,h):h(y)}}function bC(e,t,n,r,i,o){let a;return s;function s(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,u}function u(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),l(p))}function l(p){return p===a?(e.exit(o),u(a)):p===null?n(p):Ae(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),tt(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||Ae(p)?(e.exit("chunkString"),l(p)):(e.consume(p),p===92?h:c)}function h(p){return p===a||p===92?(e.consume(p),c):c(p)}}function Pl(e,t){let n;return r;function r(i){return Ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mt(i)?tt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function oi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wz={name:"definition",tokenize:Kz},qz={tokenize:Gz,partial:!0};function Kz(e,t,n){const r=this;let i;return o;function o(u){return e.enter("definition"),yC.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(u)}function a(u){return i=oi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),Pl(e,vC(e,e.attempt(qz,tt(e,s,"whitespace"),tt(e,s,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(u)}function s(u){return u===null||Ae(u)?(e.exit("definition"),r.parser.defined.includes(i)||r.parser.defined.push(i),t(u)):n(u)}}function Gz(e,t,n){return r;function r(a){return Kt(a)?Pl(e,i)(a):n(a)}function i(a){return a===34||a===39||a===40?bC(e,tt(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a):n(a)}function o(a){return a===null||Ae(a)?t(a):n(a)}}const Yz={name:"hardBreakEscape",tokenize:Xz};function Xz(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(o),i}function i(o){return Ae(o)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(o)):n(o)}}const Qz={name:"headingAtx",tokenize:Zz,resolve:Jz};function Jz(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},gr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zz(e,t,n){const r=this;let i=0;return o;function o(c){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&i++<6?(e.consume(c),a):c===null||Kt(c)?(e.exit("atxHeadingSequence"),r.interrupt?t(c):s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||Ae(c)?(e.exit("atxHeading"),t(c)):mt(c)?tt(e,s,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),s(c))}function l(c){return c===null||c===35||Kt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),l)}}const ej=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Yw=["pre","script","style","textarea"],tj={name:"htmlFlow",tokenize:ij,resolveTo:rj,concrete:!0},nj={tokenize:oj,partial:!0};function rj(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ij(e,t,n){const r=this;let i,o,a,s,u;return l;function l(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),g):I===63?(e.consume(I),i=3,r.interrupt?t:K):zr(I)?(e.consume(I),a=String.fromCharCode(I),o=!0,b):n(I)}function h(I){return I===45?(e.consume(I),i=2,p):I===91?(e.consume(I),i=5,a="CDATA[",s=0,y):zr(I)?(e.consume(I),i=4,r.interrupt?t:K):n(I)}function p(I){return I===45?(e.consume(I),r.interrupt?t:K):n(I)}function y(I){return I===a.charCodeAt(s++)?(e.consume(I),s===a.length?r.interrupt?t:L:y):n(I)}function g(I){return zr(I)?(e.consume(I),a=String.fromCharCode(I),b):n(I)}function b(I){return I===null||I===47||I===62||Kt(I)?I!==47&&o&&Yw.includes(a.toLowerCase())?(i=1,r.interrupt?t(I):L(I)):ej.includes(a.toLowerCase())?(i=6,I===47?(e.consume(I),_):r.interrupt?t(I):L(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?k(I):S(I)):I===45||Ln(I)?(e.consume(I),a+=String.fromCharCode(I),b):n(I)}function _(I){return I===62?(e.consume(I),r.interrupt?t:L):n(I)}function S(I){return mt(I)?(e.consume(I),S):D(I)}function k(I){return I===47?(e.consume(I),D):I===58||I===95||zr(I)?(e.consume(I),C):mt(I)?(e.consume(I),k):D(I)}function C(I){return I===45||I===46||I===58||I===95||Ln(I)?(e.consume(I),C):d(I)}function d(I){return I===61?(e.consume(I),v):mt(I)?(e.consume(I),d):k(I)}function v(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),u=I,m):mt(I)?(e.consume(I),v):(u=null,x(I))}function m(I){return I===null||Ae(I)?n(I):I===u?(e.consume(I),A):(e.consume(I),m)}function x(I){return I===null||I===34||I===39||I===60||I===61||I===62||I===96||Kt(I)?d(I):(e.consume(I),x)}function A(I){return I===47||I===62||mt(I)?k(I):n(I)}function D(I){return I===62?(e.consume(I),P):n(I)}function P(I){return mt(I)?(e.consume(I),P):I===null||Ae(I)?L(I):n(I)}function L(I){return I===45&&i===2?(e.consume(I),F):I===60&&i===1?(e.consume(I),R):I===62&&i===4?(e.consume(I),ee):I===63&&i===3?(e.consume(I),K):I===93&&i===5?(e.consume(I),$):Ae(I)&&(i===6||i===7)?e.check(nj,ee,W)(I):I===null||Ae(I)?W(I):(e.consume(I),L)}function W(I){return e.exit("htmlFlowData"),U(I)}function U(I){return I===null?N(I):Ae(I)?e.attempt({tokenize:j,partial:!0},U,N)(I):(e.enter("htmlFlowData"),L(I))}function j(I,re,se){return he;function he(ge){return I.enter("lineEnding"),I.consume(ge),I.exit("lineEnding"),V}function V(ge){return r.parser.lazy[r.now().line]?se(ge):re(ge)}}function F(I){return I===45?(e.consume(I),K):L(I)}function R(I){return I===47?(e.consume(I),a="",q):L(I)}function q(I){return I===62&&Yw.includes(a.toLowerCase())?(e.consume(I),ee):zr(I)&&a.length<8?(e.consume(I),a+=String.fromCharCode(I),q):L(I)}function $(I){return I===93?(e.consume(I),K):L(I)}function K(I){return I===62?(e.consume(I),ee):I===45&&i===2?(e.consume(I),K):L(I)}function ee(I){return I===null||Ae(I)?(e.exit("htmlFlowData"),N(I)):(e.consume(I),ee)}function N(I){return e.exit("htmlFlow"),t(I)}}function oj(e,t,n){return r;function r(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(Hu,t,n)}}const aj={name:"htmlText",tokenize:sj};function sj(e,t,n){const r=this;let i,o,a,s;return u;function u(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),l}function l(N){return N===33?(e.consume(N),c):N===47?(e.consume(N),x):N===63?(e.consume(N),v):zr(N)?(e.consume(N),P):n(N)}function c(N){return N===45?(e.consume(N),h):N===91?(e.consume(N),o="CDATA[",a=0,_):zr(N)?(e.consume(N),d):n(N)}function h(N){return N===45?(e.consume(N),p):n(N)}function p(N){return N===null||N===62?n(N):N===45?(e.consume(N),y):g(N)}function y(N){return N===null||N===62?n(N):g(N)}function g(N){return N===null?n(N):N===45?(e.consume(N),b):Ae(N)?(s=g,$(N)):(e.consume(N),g)}function b(N){return N===45?(e.consume(N),ee):g(N)}function _(N){return N===o.charCodeAt(a++)?(e.consume(N),a===o.length?S:_):n(N)}function S(N){return N===null?n(N):N===93?(e.consume(N),k):Ae(N)?(s=S,$(N)):(e.consume(N),S)}function k(N){return N===93?(e.consume(N),C):S(N)}function C(N){return N===62?ee(N):N===93?(e.consume(N),C):S(N)}function d(N){return N===null||N===62?ee(N):Ae(N)?(s=d,$(N)):(e.consume(N),d)}function v(N){return N===null?n(N):N===63?(e.consume(N),m):Ae(N)?(s=v,$(N)):(e.consume(N),v)}function m(N){return N===62?ee(N):v(N)}function x(N){return zr(N)?(e.consume(N),A):n(N)}function A(N){return N===45||Ln(N)?(e.consume(N),A):D(N)}function D(N){return Ae(N)?(s=D,$(N)):mt(N)?(e.consume(N),D):ee(N)}function P(N){return N===45||Ln(N)?(e.consume(N),P):N===47||N===62||Kt(N)?L(N):n(N)}function L(N){return N===47?(e.consume(N),ee):N===58||N===95||zr(N)?(e.consume(N),W):Ae(N)?(s=L,$(N)):mt(N)?(e.consume(N),L):ee(N)}function W(N){return N===45||N===46||N===58||N===95||Ln(N)?(e.consume(N),W):U(N)}function U(N){return N===61?(e.consume(N),j):Ae(N)?(s=U,$(N)):mt(N)?(e.consume(N),U):L(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,F):Ae(N)?(s=j,$(N)):mt(N)?(e.consume(N),j):(e.consume(N),i=void 0,q)}function F(N){return N===i?(e.consume(N),R):N===null?n(N):Ae(N)?(s=F,$(N)):(e.consume(N),F)}function R(N){return N===62||N===47||Kt(N)?L(N):n(N)}function q(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===62||Kt(N)?L(N):(e.consume(N),q)}function $(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),tt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function K(N){return e.enter("htmlTextData"),s(N)}function ee(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}}const qy={name:"labelEnd",tokenize:hj,resolveTo:fj,resolveAll:dj},lj={tokenize:pj},uj={tokenize:mj},cj={tokenize:gj};function dj(e){let t=-1,n;for(;++t-1&&(a[0]=a[0].slice(r)),o>0&&a.push(e[i].slice(0,o))),a}function Fj(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const Wj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yC(e){return e.replace(Wj,Vj)}function Vj(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return vC(n.slice(o?2:1),o?16:10)}return By(n)||e}const y1={}.hasOwnProperty,qj=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Kj(n)(Hj($j(n).document().write(Uj()(e,t,!0))))};function Kj(e={}){const t=bC({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(gt),autolinkProtocol:V,autolinkEmail:V,atxHeading:u(ae),blockQuote:u(xe),characterEscape:V,characterReference:V,codeFenced:u(Ge),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(Ge,l),codeText:u(Ve,l),codeTextData:V,data:V,codeFlowValue:V,definition:u(De),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(Ye),hardBreakEscape:u(Re),hardBreakTrailing:u(Re),htmlFlow:u(nt,l),htmlFlowData:V,htmlText:u(nt,l),htmlTextData:V,image:u(ze),label:l,link:u(gt),listItem:u(wt),listItemValue:b,listOrdered:u(zt,g),listUnordered:u(zt),paragraph:u(Ee),reference:W,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(ae),strong:u(rt),thematicBreak:u(Ht)},exit:{atxHeading:h(),atxHeadingSequence:A,autolink:h(),autolinkEmail:Ne,autolinkProtocol:pe,blockQuote:h(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:Oe,codeFenced:h(C),codeFencedFence:k,codeFencedFenceInfo:_,codeFencedFenceMeta:S,codeFlowValue:H,codeIndented:h(d),codeText:h($),codeTextData:H,data:H,definition:h(),definitionDestinationString:x,definitionLabelString:v,definitionTitleString:m,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h(R),htmlFlowData:H,htmlText:h(q),htmlTextData:H,image:h(ee),label:I,labelText:D,lineEnding:j,link:h(K),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ge,resourceDestinationString:re,resourceTitleString:se,resource:he,setextHeading:h(O),setextHeadingLineSequence:P,setextHeadingText:L,strong:h(),thematicBreak:h()}},e.mdastExtensions||[]),n={};return r;function r(X){let ce={type:"root",children:[]};const Te=[ce],Be=[],Xt=[],Ei={stack:Te,tokenStack:Be,config:t,enter:c,exit:p,buffer:l,resume:y,setData:o,getData:a};let at=-1;for(;++at0){const vt=Be[Be.length-1];(vt[1]||Hw).call(Ei,void 0,vt[0])}for(ce.position={start:s(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:s(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at{const r=this.data("settings");return qj(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}var rn=function(e,t,n){var r={type:String(e)};return n==null&&(typeof t=="string"||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r};const kd={}.hasOwnProperty;function Xj(e,t){const n=t.data||{};return"value"in t&&!(kd.call(n,"hName")||kd.call(n,"hProperties")||kd.call(n,"hChildren"))?e.augment(t,rn("text",t.value)):e(t,"div",En(e,t))}function wC(e,t,n){const r=t&&t.type;let i;if(!r)throw new Error("Expected node, got `"+t+"`");return kd.call(e.handlers,r)?i=e.handlers[r]:e.passThrough&&e.passThrough.includes(r)?i=Qj:i=e.unknownHandler,(typeof i=="function"?i:Xj)(e,t,n)}function Qj(e,t){return"children"in t?{...t,children:En(e,t)}:t}function En(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i":""))+")"})),p;function p(){let y=[],g,b,_;if((!t||i(s,u,l[l.length-1]||null))&&(y=iB(n(s,l)),y[0]===Ww))return y;if(s.children&&y[0]!==rB)for(b=(r?s.children.length:-1)+o,_=l.concat(s);b>-1&&b-1?r.offset:null}}}function oB(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const Vw={}.hasOwnProperty;function aB(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Uy(e,"definition",r=>{const i=qw(r.identifier);i&&!Vw.call(t,i)&&(t[i]=r)}),n;function n(r){const i=qw(r);return i&&Vw.call(t,i)?t[i]:null}}function qw(e){return String(e||"").toUpperCase()}const sB={'"':"quot","&":"amp","<":"lt",">":"gt"};function lB(e){return e.replace(/["&<>]/g,t);function t(n){return"&"+sB[n]+";"}}function _C(e,t){const n=lB(uB(e||""));if(!t)return n;const r=n.indexOf(":"),i=n.indexOf("?"),o=n.indexOf("#"),a=n.indexOf("/");return r<0||a>-1&&r>a||i>-1&&r>i||o>-1&&r>o||t.test(n.slice(0,r))?n:""}function uB(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function zi(e,t){const n=[];let r=-1;for(t&&n.push(rn("text",` +`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}const $j={[42]:Un,[43]:Un,[45]:Un,[48]:Un,[49]:Un,[50]:Un,[51]:Un,[52]:Un,[53]:Un,[54]:Un,[55]:Un,[56]:Un,[57]:Un,[62]:hC},Hj={[91]:Wz},Uj={[-2]:rg,[-1]:rg,[32]:rg},Vj={[35]:Qz,[42]:xd,[45]:[Xw,xd],[60]:tj,[61]:Xw,[95]:xd,[96]:Gw,[126]:Gw},Wj={[38]:mC,[92]:pC},qj={[-5]:ig,[-4]:ig,[-3]:ig,[33]:vj,[38]:mC,[42]:y1,[60]:[xz,aj],[91]:bj,[92]:[Yz,pC],[93]:qy,[95]:y1,[96]:Nz},Kj={null:[y1,Dj]},Gj={null:[42,95]},Yj={null:[]},Xj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Gj,contentInitial:Hj,disable:Yj,document:$j,flow:Vj,flowInitial:Uj,insideSpan:Kj,string:Wj,text:qj},Symbol.toStringTag,{value:"Module"}));function Qj(e={}){const t=fC([Xj].concat(e.extensions||[])),n={defined:[],lazy:{},constructs:t,content:r(gz),document:r(yz),flow:r(Oj),string:r(Nj),text:r(Mj)};return n;function r(i){return o;function o(a){return jj(n,i,a)}}}const Qw=/[\0\t\n\r]/g;function Jj(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const u=[];let l,c,h,p,y;for(o=t+o.toString(a),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const eB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xC(e){return e.replace(eB,tB)}function tB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return kC(n.slice(o?2:1),o?16:10)}return Wy(n)||e}const b1={}.hasOwnProperty,nB=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),rB(n)(Zj(Qj(n).document().write(Jj()(e,t,!0))))};function rB(e={}){const t=CC({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(gt),autolinkProtocol:W,autolinkEmail:W,atxHeading:u(ae),blockQuote:u(xe),characterEscape:W,characterReference:W,codeFenced:u(Ye),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(Ye,l),codeText:u(Ke,l),codeTextData:W,data:W,codeFlowValue:W,definition:u(De),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(Xe),hardBreakEscape:u(Re),hardBreakTrailing:u(Re),htmlFlow:u(nt,l),htmlFlowData:W,htmlText:u(nt,l),htmlTextData:W,image:u(ze),label:l,link:u(gt),listItem:u(wt),listItemValue:b,listOrdered:u(jt,g),listUnordered:u(jt),paragraph:u(Ee),reference:V,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(ae),strong:u(rt),thematicBreak:u(Ut)},exit:{atxHeading:h(),atxHeadingSequence:A,autolink:h(),autolinkEmail:Me,autolinkProtocol:pe,blockQuote:h(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:Oe,codeFenced:h(C),codeFencedFence:k,codeFencedFenceInfo:_,codeFencedFenceMeta:S,codeFlowValue:U,codeIndented:h(d),codeText:h($),codeTextData:U,data:U,definition:h(),definitionDestinationString:x,definitionLabelString:v,definitionTitleString:m,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h(R),htmlFlowData:U,htmlText:h(q),htmlTextData:U,image:h(ee),label:I,labelText:N,lineEnding:j,link:h(K),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ge,resourceDestinationString:re,resourceTitleString:se,resource:he,setextHeading:h(L),setextHeadingLineSequence:P,setextHeadingText:D,strong:h(),thematicBreak:h()}},e.mdastExtensions||[]),n={};return r;function r(X){let ce={type:"root",children:[]};const Te=[ce],Be=[],Xt=[],Ri={stack:Te,tokenStack:Be,config:t,enter:c,exit:p,buffer:l,resume:y,setData:o,getData:a};let at=-1;for(;++at0){const vt=Be[Be.length-1];(vt[1]||Jw).call(Ri,void 0,vt[0])}for(ce.position={start:s(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:s(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at{const r=this.data("settings");return nB(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}var rn=function(e,t,n){var r={type:String(e)};return n==null&&(typeof t=="string"||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r};const Cd={}.hasOwnProperty;function aB(e,t){const n=t.data||{};return"value"in t&&!(Cd.call(n,"hName")||Cd.call(n,"hProperties")||Cd.call(n,"hChildren"))?e.augment(t,rn("text",t.value)):e(t,"div",En(e,t))}function _C(e,t,n){const r=t&&t.type;let i;if(!r)throw new Error("Expected node, got `"+t+"`");return Cd.call(e.handlers,r)?i=e.handlers[r]:e.passThrough&&e.passThrough.includes(r)?i=sB:i=e.unknownHandler,(typeof i=="function"?i:aB)(e,t,n)}function sB(e,t){return"children"in t?{...t,children:En(e,t)}:t}function En(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i":""))+")"})),p;function p(){let y=[],g,b,_;if((!t||i(s,u,l[l.length-1]||null))&&(y=pB(n(s,l)),y[0]===Zw))return y;if(s.children&&y[0]!==hB)for(b=(r?s.children.length:-1)+o,_=l.concat(s);b>-1&&b-1?r.offset:null}}}function mB(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const e4={}.hasOwnProperty;function gB(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Gy(e,"definition",r=>{const i=t4(r.identifier);i&&!e4.call(t,i)&&(t[i]=r)}),n;function n(r){const i=t4(r);return i&&e4.call(t,i)?t[i]:null}}function t4(e){return String(e||"").toUpperCase()}const vB={'"':"quot","&":"amp","<":"lt",">":"gt"};function yB(e){return e.replace(/["&<>]/g,t);function t(n){return"&"+vB[n]+";"}}function PC(e,t){const n=yB(bB(e||""));if(!t)return n;const r=n.indexOf(":"),i=n.indexOf("?"),o=n.indexOf("#"),a=n.indexOf("/");return r<0||a>-1&&r>a||i>-1&&r>i||o>-1&&r>o||t.test(n.slice(0,r))?n:""}function bB(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ji(e,t){const n=[];let r=-1;for(t&&n.push(rn("text",` `));++r0&&n.push(rn("text",` -`)),n}function cB(e){let t=-1;const n=[];for(;++t1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&h.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),u.length>0&&u.push({type:"text",value:" "}),u.push(h)}const l=i[i.length-1];if(l&&l.type==="element"&&l.tagName==="p"){const h=l.children[l.children.length-1];h&&h.type==="text"?h.value+=" ":l.children.push({type:"text",value:" "}),l.children.push(...u)}else i.push(...u);const c={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+a},children:zi(i,!0)};r.position&&(c.position=r.position),n.push(c)}return n.length===0?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:"h2",properties:{id:"footnote-label",className:["sr-only"]},children:[rn("text",e.footnoteLabel)]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:zi(n,!0)},{type:"text",value:` -`}]}}function dB(e,t){return e(t,"blockquote",zi(En(e,t),!0))}function fB(e,t){return[e(t,"br"),rn("text",` -`)]}function hB(e,t){const n=t.value?t.value+` -`:"",r=t.lang&&t.lang.match(/^[^ \t]+(?=[ \t]|$)/),i={};r&&(i.className=["language-"+r]);const o=e(t,"code",i,[rn("text",n)]);return t.meta&&(o.data={meta:t.meta}),e(t.position,"pre",[o])}function pB(e,t){return e(t,"del",En(e,t))}function mB(e,t){return e(t,"em",En(e,t))}function EC(e,t){const n=String(t.identifier),r=_C(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let o;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,o=e.footnoteOrder.length):(e.footnoteCounts[n]++,o=i+1);const a=e.footnoteCounts[n];return e(t,"sup",[e(t.position,"a",{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[rn("text",String(o))])])}function gB(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},EC(e,{type:"footnoteReference",identifier:i,position:t.position})}function vB(e,t){return e(t,"h"+t.depth,En(e,t))}function yB(e,t){return e.dangerous?e.augment(t,rn("raw",t.value)):null}var Kw={};function bB(e){var t,n,r=Kw[e];if(r)return r;for(r=Kw[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t"u"&&(n=!0),s=bB(t),r=0,i=e.length;r=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1=56320&&a<=57343)){u+=encodeURIComponent(e[r]+e[r+1]),r++;continue}u+="%EF%BF%BD";continue}u+=encodeURIComponent(e[r])}return u}np.defaultChars=";/?:@&=+$,-_.!~*'()#";np.componentChars="-_.!~*'()";var rp=np;function RC(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return rn("text","!["+t.alt+r);const i=En(e,t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift(rn("text","["));const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push(rn("text",r)),i}function wB(e,t){const n=e.definition(t.identifier);if(!n)return RC(e,t);const r={src:rp(n.url||""),alt:t.alt};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"img",r)}function SB(e,t){const n={src:rp(t.url),alt:t.alt};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"img",n)}function kB(e,t){return e(t,"code",[rn("text",t.value.replace(/\r?\n|\r/g," "))])}function xB(e,t){const n=e.definition(t.identifier);if(!n)return RC(e,t);const r={href:rp(n.url||"")};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"a",r,En(e,t))}function CB(e,t){const n={href:rp(t.url)};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"a",n,En(e,t))}function _B(e,t,n){const r=En(e,t),i=n?EB(n):AC(t),o={},a=[];if(typeof t.checked=="boolean"){let l;r[0]&&r[0].type==="element"&&r[0].tagName==="p"?l=r[0]:(l=e(null,"p",[]),r.unshift(l)),l.children.length>0&&l.children.unshift(rn("text"," ")),l.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),o.className=["task-list-item"]}let s=-1;for(;++s1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&h.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),u.length>0&&u.push({type:"text",value:" "}),u.push(h)}const l=i[i.length-1];if(l&&l.type==="element"&&l.tagName==="p"){const h=l.children[l.children.length-1];h&&h.type==="text"?h.value+=" ":l.children.push({type:"text",value:" "}),l.children.push(...u)}else i.push(...u);const c={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+a},children:ji(i,!0)};r.position&&(c.position=r.position),n.push(c)}return n.length===0?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:"h2",properties:{id:"footnote-label",className:["sr-only"]},children:[rn("text",e.footnoteLabel)]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:ji(n,!0)},{type:"text",value:` +`}]}}function SB(e,t){return e(t,"blockquote",ji(En(e,t),!0))}function kB(e,t){return[e(t,"br"),rn("text",` +`)]}function xB(e,t){const n=t.value?t.value+` +`:"",r=t.lang&&t.lang.match(/^[^ \t]+(?=[ \t]|$)/),i={};r&&(i.className=["language-"+r]);const o=e(t,"code",i,[rn("text",n)]);return t.meta&&(o.data={meta:t.meta}),e(t.position,"pre",[o])}function CB(e,t){return e(t,"del",En(e,t))}function _B(e,t){return e(t,"em",En(e,t))}function IC(e,t){const n=String(t.identifier),r=PC(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let o;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,o=e.footnoteOrder.length):(e.footnoteCounts[n]++,o=i+1);const a=e.footnoteCounts[n];return e(t,"sup",[e(t.position,"a",{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[rn("text",String(o))])])}function EB(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},IC(e,{type:"footnoteReference",identifier:i,position:t.position})}function RB(e,t){return e(t,"h"+t.depth,En(e,t))}function AB(e,t){return e.dangerous?e.augment(t,rn("raw",t.value)):null}var n4={};function TB(e){var t,n,r=n4[e];if(r)return r;for(r=n4[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t"u"&&(n=!0),s=TB(t),r=0,i=e.length;r=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1=56320&&a<=57343)){u+=encodeURIComponent(e[r]+e[r+1]),r++;continue}u+="%EF%BF%BD";continue}u+=encodeURIComponent(e[r])}return u}rp.defaultChars=";/?:@&=+$,-_.!~*'()#";rp.componentChars="-_.!~*'()";var ip=rp;function OC(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return rn("text","!["+t.alt+r);const i=En(e,t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift(rn("text","["));const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push(rn("text",r)),i}function PB(e,t){const n=e.definition(t.identifier);if(!n)return OC(e,t);const r={src:ip(n.url||""),alt:t.alt};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"img",r)}function IB(e,t){const n={src:ip(t.url),alt:t.alt};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"img",n)}function OB(e,t){return e(t,"code",[rn("text",t.value.replace(/\r?\n|\r/g," "))])}function LB(e,t){const n=e.definition(t.identifier);if(!n)return OC(e,t);const r={href:ip(n.url||"")};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"a",r,En(e,t))}function DB(e,t){const n={href:ip(t.url)};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"a",n,En(e,t))}function NB(e,t,n){const r=En(e,t),i=n?MB(n):LC(t),o={},a=[];if(typeof t.checked=="boolean"){let l;r[0]&&r[0].type==="element"&&r[0].tagName==="p"?l=r[0]:(l=e(null,"p",[]),r.unshift(l)),l.children.length>0&&l.children.unshift(rn("text"," ")),l.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),o.className=["task-list-item"]}let s=-1;for(;++s1}function RB(e,t){const n={},r=t.ordered?"ol":"ul",i=En(e,t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Xw(t.slice(i),i>0,!1)),o.join("")}function Xw(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Gw||o===Yw;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Gw||o===Yw;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function LB(e,t){return e.augment(t,rn("text",OB(String(t.value))))}function DB(e,t){return e(t,"hr")}const MB={blockquote:dB,break:fB,code:hB,delete:pB,emphasis:mB,footnoteReference:EC,footnote:gB,heading:vB,html:yB,imageReference:wB,image:SB,inlineCode:kB,linkReference:xB,link:CB,listItem:_B,list:RB,paragraph:AB,root:TB,strong:PB,table:IB,text:LB,thematicBreak:DB,toml:Ac,yaml:Ac,definition:Ac,footnoteDefinition:Ac};function Ac(){return null}const NB={}.hasOwnProperty;function zB(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.definition=aB(e),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.augment=o,a.handlers={...MB,...n.handlers},a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,Uy(e,"footnoteDefinition",s=>{const u=String(s.identifier).toUpperCase();NB.call(i,u)||(i[u]=s)}),a;function o(s,u){if(s&&"data"in s&&s.data){const l=s.data;l.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=l.hName),u.type==="element"&&l.hProperties&&(u.properties={...u.properties,...l.hProperties}),"children"in u&&u.children&&l.hChildren&&(u.children=l.hChildren)}if(s){const l="type"in s?s:{position:s};oB(l)||(u.position={start:kC(l),end:xC(l)})}return u}function a(s,u,l,c){return Array.isArray(l)&&(c=l,l={}),o(s,{type:"element",tagName:u,properties:l||{},children:c||[]})}}function TC(e,t){const n=zB(e,t),r=wC(n,e,null),i=cB(n);return i&&r.children.push(rn("text",` -`),i),Array.isArray(r)?{type:"root",children:r}:r}const jB=function(e,t){return e&&"run"in e?FB(e,t):$B(e||t)},BB=jB;function FB(e,t){return(n,r,i)=>{e.run(TC(n,t),r,o=>{i(o)})}}function $B(e){return t=>TC(t,e)}class Fu{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Fu.prototype.property={};Fu.prototype.normal={};Fu.prototype.space=null;function PC(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&qB.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Jw,XB);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Jw.test(o)){let a=o.replace(KB,YB);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Hy}return new i(r,t)}function YB(e){return"-"+e.toLowerCase()}function XB(e){return e.charAt(1).toUpperCase()}const Zw={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},QB=PC([LC,OC,NC,zC,WB],"html"),JB=PC([LC,OC,NC,zC,VB],"svg");function ZB(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Uy(t,"element",(n,r,i)=>{const o=i;let a;if(e.allowedElements?a=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(a=e.disallowedElements.includes(n.tagName)),!a&&e.allowElement&&typeof r=="number"&&(a=!e.allowElement(n,r,o)),a&&typeof r=="number")return e.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}function eF(e){var t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function tF(e){return e.join(" ").trim()}function nF(e,t){var n=t||{};return e[e.length-1]===""&&(e=e.concat("")),e.join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var e4=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rF=/\n/g,iF=/^\s*/,oF=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,aF=/^:\s*/,sF=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,lF=/^[;\s]*/,uF=/^\s+|\s+$/g,cF=` -`,t4="/",n4="*",Xo="",dF="comment",fF="declaration",hF=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var b=g.match(rF);b&&(n+=b.length);var _=g.lastIndexOf(cF);r=~_?g.length-_:r+g.length}function o(){var g={line:n,column:r};return function(b){return b.position=new a(g),l(),b}}function a(g){this.start=g,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(g){var b=new Error(t.source+":"+n+":"+r+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function u(g){var b=g.exec(e);if(b){var _=b[0];return i(_),e=e.slice(_.length),b}}function l(){u(iF)}function c(g){var b;for(g=g||[];b=h();)b!==!1&&g.push(b);return g}function h(){var g=o();if(!(t4!=e.charAt(0)||n4!=e.charAt(1))){for(var b=2;Xo!=e.charAt(b)&&(n4!=e.charAt(b)||t4!=e.charAt(b+1));)++b;if(b+=2,Xo===e.charAt(b-1))return s("End of comment missing");var _=e.slice(2,b-2);return r+=2,i(_),e=e.slice(b),r+=2,g({type:dF,comment:_})}}function p(){var g=o(),b=u(oF);if(b){if(h(),!u(aF))return s("property missing ':'");var _=u(sF),S=g({type:fF,property:r4(b[0].replace(e4,Xo)),value:_?r4(_[0].replace(e4,Xo)):Xo});return u(lF),S}}function y(){var g=[];c(g);for(var b;b=p();)b!==!1&&(g.push(b),c(g));return g}return l(),y()};function r4(e){return e?e.replace(uF,Xo):Xo}var pF=hF;function mF(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=pF(e),o=typeof t=="function",a,s,u=0,l=i.length;u0?de.createElement(p,s,c):de.createElement(p,s)}function bF(e){let t=-1;for(;++tString(t)).join("")}const i4={}.hasOwnProperty,CF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tc={plugins:{to:"plugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function Wy(e){for(const o in Tc)if(i4.call(Tc,o)&&i4.call(e,o)){const a=Tc[o];console.warn(`[react-markdown] Warning: please ${a.to?`use \`${a.to}\` instead of`:"remove"} \`${o}\` (see <${CF}#${a.id}> for more info)`),delete Tc[o]}const t=XN().use(Yj).use(e.remarkPlugins||[]).use(BB,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(ZB,e),n=new nC;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=de.createElement(de.Fragment,{},jC({options:e,schema:QB,listDepth:0},r));return e.className&&(i=de.createElement("div",{className:e.className},i)),i}Wy.defaultProps={transformLinkUri:zN};Wy.propTypes={children:ie.string,className:ie.string,allowElement:ie.func,allowedElements:ie.arrayOf(ie.string),disallowedElements:ie.arrayOf(ie.string),unwrapDisallowed:ie.bool,remarkPlugins:ie.arrayOf(ie.oneOfType([ie.object,ie.func,ie.arrayOf(ie.oneOfType([ie.bool,ie.string,ie.object,ie.func,ie.arrayOf(ie.any)]))])),rehypePlugins:ie.arrayOf(ie.oneOfType([ie.object,ie.func,ie.arrayOf(ie.oneOfType([ie.bool,ie.string,ie.object,ie.func,ie.arrayOf(ie.any)]))])),sourcePos:ie.bool,rawSourcePos:ie.bool,skipHtml:ie.bool,includeElementIndex:ie.bool,transformLinkUri:ie.oneOfType([ie.func,ie.bool]),linkTarget:ie.oneOfType([ie.func,ie.string]),transformImageUri:ie.func,components:ie.object};const _F={tokenize:PF,partial:!0},BC={tokenize:IF,partial:!0},FC={tokenize:OF,partial:!0},as={tokenize:DF,partial:!0},$C={tokenize:LF,partial:!0},UC={tokenize:AF,previous:VC},HC={tokenize:TF,previous:qy},Vi={tokenize:RF,previous:qC},Ci={},EF={text:Ci};let Wo=48;for(;Wo<123;)Ci[Wo]=Vi,Wo++,Wo===58?Wo=65:Wo===91&&(Wo=97);Ci[43]=Vi;Ci[45]=Vi;Ci[46]=Vi;Ci[95]=Vi;Ci[72]=[Vi,HC];Ci[104]=[Vi,HC];Ci[87]=[Vi,UC];Ci[119]=[Vi,UC];function RF(e,t,n){const r=this;let i,o;return a;function a(y){return!o4(y)||!qC(r.previous)||Ky(r.events)?n(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(y))}function s(y){return o4(y)?(e.consume(y),s):y===64?(e.consume(y),u):n(y)}function u(y){return y===46?e.check(as,p,l)(y):y===45||y===95?e.check(as,n,c)(y):Ln(y)?(!o&&bf(y)&&(o=!0),e.consume(y),u):p(y)}function l(y){return e.consume(y),i=!0,o=void 0,u}function c(y){return e.consume(y),h}function h(y){return y===46?e.check(as,n,l)(y):u(y)}function p(y){return i&&!o?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):n(y)}}function AF(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!VC(r.previous)||Ky(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(_F,e.attempt(BC,e.attempt(FC,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function TF(e,t,n){const r=this;return i;function i(g){return g!==72&&g!==104||!qy(r.previous)||Ky(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),e.consume(g),o)}function o(g){return g===84||g===116?(e.consume(g),a):n(g)}function a(g){return g===84||g===116?(e.consume(g),s):n(g)}function s(g){return g===80||g===112?(e.consume(g),u):n(g)}function u(g){return g===83||g===115?(e.consume(g),l):l(g)}function l(g){return g===58?(e.consume(g),c):n(g)}function c(g){return g===47?(e.consume(g),h):n(g)}function h(g){return g===47?(e.consume(g),p):n(g)}function p(g){return g===null||fu(g)||Jh(g)||Zh(g)?n(g):e.attempt(BC,e.attempt(FC,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function PF(e,t,n){return r;function r(u){return e.consume(u),i}function i(u){return u===87||u===119?(e.consume(u),o):n(u)}function o(u){return u===87||u===119?(e.consume(u),a):n(u)}function a(u){return u===46?(e.consume(u),s):n(u)}function s(u){return u===null||Ae(u)?n(u):t(u)}}function IF(e,t,n){let r,i;return o;function o(u){return u===38?e.check($C,s,a)(u):u===46||u===95?e.check(as,s,a)(u):u===null||fu(u)||Jh(u)||u!==45&&Zh(u)?s(u):(e.consume(u),o)}function a(u){return u===46?(i=r,r=void 0,e.consume(u),o):(u===95&&(r=!0),e.consume(u),o)}function s(u){return!i&&!r?t(u):n(u)}}function OF(e,t){let n=0;return r;function r(a){return a===38?e.check($C,t,i)(a):(a===40&&n++,a===41?e.check(as,o,i)(a):Vy(a)?t(a):WC(a)?e.check(as,t,i)(a):(e.consume(a),r))}function i(a){return e.consume(a),r}function o(a){return n--,n<0?t(a):i(a)}}function LF(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Dr(a)?(e.consume(a),i):a===59?(e.consume(a),o):n(a)}function o(a){return Vy(a)?t(a):n(a)}}function DF(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return WC(o)?(e.consume(o),i):Vy(o)?t(o):n(o)}}function WC(e){return e===33||e===34||e===39||e===41||e===42||e===44||e===46||e===58||e===59||e===60||e===63||e===95||e===126}function Vy(e){return e===null||e===60||Kt(e)}function o4(e){return e===43||e===45||e===46||e===95||Ln(e)}function VC(e){return e===null||e===40||e===42||e===95||e===126||Kt(e)}function qy(e){return e===null||!Dr(e)}function qC(e){return e!==47&&qy(e)}function Ky(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const MF={tokenize:HF,partial:!0};function NF(){return{document:{[91]:{tokenize:FF,continuation:{tokenize:$F},exit:UF}},text:{[91]:{tokenize:BF},[93]:{add:"after",tokenize:zF,resolveTo:jF}}}}function zF(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return s;function s(u){if(!a||!a._balanced)return n(u);const l=ri(r.sliceSerialize({start:a.end,end:r.now()}));return l.charCodeAt(0)!==94||!o.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function jF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function BF(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(p){let y;return p===null||p===91||o++>999?n(p):p===93?a?(e.exit("chunkString"),y=e.exit("gfmFootnoteCallString"),i.includes(ri(r.sliceSerialize(y)))?h(p):n(p)):n(p):(e.consume(p),Kt(p)||(a=!0),p===92?c:l)}function c(p){return p===91||p===92||p===93?(e.consume(p),o++,l):l(p)}function h(p){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}}function FF(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),c):n(b)}function c(b){let _;return b===null||b===91||a>999?n(b):b===93?s?(_=e.exit("gfmFootnoteDefinitionLabelString"),o=ri(r.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y):n(b):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),a++,c):(e.enter("chunkString").contentType="string",h(b))}function h(b){return b===null||Ae(b)||b===91||b===93||a>999?(e.exit("chunkString"),c(b)):(Kt(b)||(s=!0),a++,e.consume(b),b===92?p:h)}function p(b){return b===91||b===92||b===93?(e.consume(b),a++,h):h(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),tt(e,g,"gfmFootnoteDefinitionWhitespace")):n(b)}function g(b){return i.includes(o)||i.push(o),t(b)}}function $F(e,t,n){return e.check(Bu,t,e.attempt(MF,t,n))}function UF(e){e.exit("gfmFootnoteDefinition")}function HF(e,t,n){const r=this;return tt(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function WF(e={}){let t=e.singleTilde;const n={tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{[126]:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(o,a){let s=-1;for(;++s1?s(y):(o.consume(y),c++,p);if(c<2&&!t)return s(y);const b=o.exit("strikethroughSequenceTemporary"),_=wf(y);return b._open=!_||_===2&&Boolean(g),b._close=!g||g===2&&Boolean(_),a(y)}}}const VF={flow:{null:{tokenize:KF,resolve:qF}}},a4={tokenize:GF,partial:!0};function qF(e,t){let n=-1,r,i,o,a,s,u,l;for(;++n=4?$(D):(r._gfmTableDynamicInterruptHack=!0,R.check(r.parser.constructs.flow,function(re){return r._gfmTableDynamicInterruptHack=!1,$(re)},function(re){return r._gfmTableDynamicInterruptHack=!1,q(re)})(D))}}}function GF(e,t,n){let r=0;return i;function i(a){return e.enter("check"),e.consume(a),o}function o(a){return a===-1||a===32?(e.consume(a),r++,r===4?t:o):a===null||Kt(a)?t(a):n(a)}}const YF={tokenize:QF},XF={text:{[91]:YF}};function QF(e,t,n){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return Kt(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),a):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),a):n(s)}function a(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),e.check({tokenize:JF},t,n)):n(s)}}function JF(e,t,n){const r=this;return tt(e,i,"whitespace");function i(o){const a=r.events[r.events.length-1];return(a&&a[1].type==="whitespace"||Ae(o))&&o!==null?t(o):n(o)}}function ZF(e){return sC([EF,NF(),WF(e),VF,XF])}function s4(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function e$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const t$={}.hasOwnProperty,n$=function(e,t,n,r){let i,o;typeof t=="string"||t instanceof RegExp?(o=[[t,n]],i=r):(o=t,i=n),i||(i={});const a=$y(i.ignore||[]),s=r$(o);let u=-1;for(;++u0?{type:"text",value:x}:void 0),x!==!1&&(_!==d&&C.push({type:"text",value:h.value.slice(_,d)}),Array.isArray(x)?C.push(...x):x&&C.push(x),_=d+v[0].length,k=!0),!g.global)break;v=g.exec(h.value)}return k?(_e}const ag="phrasing",sg=["autolink","link","image","label"],i$={transforms:[d$],enter:{literalAutolink:a$,literalAutolinkEmail:lg,literalAutolinkHttp:lg,literalAutolinkWww:lg},exit:{literalAutolink:c$,literalAutolinkEmail:u$,literalAutolinkHttp:s$,literalAutolinkWww:l$}},o$={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ag,notInConstruct:sg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ag,notInConstruct:sg},{character:":",before:"[ps]",after:"\\/",inConstruct:ag,notInConstruct:sg}]};function a$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function lg(e){this.config.enter.autolinkProtocol.call(this,e)}function s$(e){this.config.exit.autolinkProtocol.call(this,e)}function l$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function u$(e){this.config.exit.autolinkEmail.call(this,e)}function c$(e){this.exit(e)}function d$(e){n$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,f$],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,h$]],{ignore:["link","linkReference"]})}function f$(e,t,n,r,i){let o="";if(!KC(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!p$(n)))return!1;const a=m$(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function h$(e,t,n,r){return!KC(r,!0)||/[_-\d]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function p$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function m$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);let n,r,i,o;if(t)for(e=e.slice(0,t.index),o=t[0],n=o.indexOf(")"),r=s4(e,"("),i=s4(e,")");n!==-1&&r>i;)e+=o.slice(0,n+1),o=o.slice(n+1),n=o.indexOf(")"),i++;return[e,o]}function KC(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Jh(n)||Zh(n))&&(!t||n!==47)}function c4(e){return e.label||!e.identifier?e.label||"":yC(e.identifier)}function Io(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:u,current:a,shift:s};function a(){return{now:{line:i,column:o},lineShift:r}}function s(l){r+=l}function u(l=""){const c=l.split(/\r?\n|\r/g),h=c[c.length-1];return i+=c.length-1,o=c.length===1?o+h.length:1+h.length+r,l}}function GC(e,t,n){const r=t.indexStack,i=e.children||[],o=Io(n),a=[];let s=-1;for(r.push(-1);++s1}function zB(e,t){const n={},r=t.ordered?"ol":"ul",i=En(e,t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(o4(t.slice(i),i>0,!1)),o.join("")}function o4(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===r4||o===i4;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===r4||o===i4;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function UB(e,t){return e.augment(t,rn("text",HB(String(t.value))))}function VB(e,t){return e(t,"hr")}const WB={blockquote:SB,break:kB,code:xB,delete:CB,emphasis:_B,footnoteReference:IC,footnote:EB,heading:RB,html:AB,imageReference:PB,image:IB,inlineCode:OB,linkReference:LB,link:DB,listItem:NB,list:zB,paragraph:jB,root:BB,strong:FB,table:$B,text:UB,thematicBreak:VB,toml:Pc,yaml:Pc,definition:Pc,footnoteDefinition:Pc};function Pc(){return null}const qB={}.hasOwnProperty;function KB(e,t){const n=t||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.definition=gB(e),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.augment=o,a.handlers={...WB,...n.handlers},a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,Gy(e,"footnoteDefinition",s=>{const u=String(s.identifier).toUpperCase();qB.call(i,u)||(i[u]=s)}),a;function o(s,u){if(s&&"data"in s&&s.data){const l=s.data;l.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=l.hName),u.type==="element"&&l.hProperties&&(u.properties={...u.properties,...l.hProperties}),"children"in u&&u.children&&l.hChildren&&(u.children=l.hChildren)}if(s){const l="type"in s?s:{position:s};mB(l)||(u.position={start:RC(l),end:AC(l)})}return u}function a(s,u,l,c){return Array.isArray(l)&&(c=l,l={}),o(s,{type:"element",tagName:u,properties:l||{},children:c||[]})}}function DC(e,t){const n=KB(e,t),r=_C(n,e,null),i=wB(n);return i&&r.children.push(rn("text",` +`),i),Array.isArray(r)?{type:"root",children:r}:r}const GB=function(e,t){return e&&"run"in e?XB(e,t):QB(e||t)},YB=GB;function XB(e,t){return(n,r,i)=>{e.run(DC(n,t),r,o=>{i(o)})}}function QB(e){return t=>DC(t,e)}class Uu{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Uu.prototype.property={};Uu.prototype.normal={};Uu.prototype.space=null;function NC(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&nF.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(s4,aF);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!s4.test(o)){let a=o.replace(rF,oF);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Yy}return new i(r,t)}function oF(e){return"-"+e.toLowerCase()}function aF(e){return e.charAt(1).toUpperCase()}const l4={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sF=NC([jC,zC,$C,HC,eF],"html"),lF=NC([jC,zC,$C,HC,tF],"svg");function uF(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Gy(t,"element",(n,r,i)=>{const o=i;let a;if(e.allowedElements?a=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(a=e.disallowedElements.includes(n.tagName)),!a&&e.allowElement&&typeof r=="number"&&(a=!e.allowElement(n,r,o)),a&&typeof r=="number")return e.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}function cF(e){var t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function dF(e){return e.join(" ").trim()}function fF(e,t){var n=t||{};return e[e.length-1]===""&&(e=e.concat("")),e.join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var u4=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hF=/\n/g,pF=/^\s*/,mF=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gF=/^:\s*/,vF=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,yF=/^[;\s]*/,bF=/^\s+|\s+$/g,wF=` +`,c4="/",d4="*",Xo="",SF="comment",kF="declaration",xF=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var b=g.match(hF);b&&(n+=b.length);var _=g.lastIndexOf(wF);r=~_?g.length-_:r+g.length}function o(){var g={line:n,column:r};return function(b){return b.position=new a(g),l(),b}}function a(g){this.start=g,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(g){var b=new Error(t.source+":"+n+":"+r+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function u(g){var b=g.exec(e);if(b){var _=b[0];return i(_),e=e.slice(_.length),b}}function l(){u(pF)}function c(g){var b;for(g=g||[];b=h();)b!==!1&&g.push(b);return g}function h(){var g=o();if(!(c4!=e.charAt(0)||d4!=e.charAt(1))){for(var b=2;Xo!=e.charAt(b)&&(d4!=e.charAt(b)||c4!=e.charAt(b+1));)++b;if(b+=2,Xo===e.charAt(b-1))return s("End of comment missing");var _=e.slice(2,b-2);return r+=2,i(_),e=e.slice(b),r+=2,g({type:SF,comment:_})}}function p(){var g=o(),b=u(mF);if(b){if(h(),!u(gF))return s("property missing ':'");var _=u(vF),S=g({type:kF,property:f4(b[0].replace(u4,Xo)),value:_?f4(_[0].replace(u4,Xo)):Xo});return u(yF),S}}function y(){var g=[];c(g);for(var b;b=p();)b!==!1&&(g.push(b),c(g));return g}return l(),y()};function f4(e){return e?e.replace(bF,Xo):Xo}var CF=xF;function _F(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=CF(e),o=typeof t=="function",a,s,u=0,l=i.length;u0?de.createElement(p,s,c):de.createElement(p,s)}function TF(e){let t=-1;for(;++tString(t)).join("")}const h4={}.hasOwnProperty,DF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ic={plugins:{to:"plugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function Xy(e){for(const o in Ic)if(h4.call(Ic,o)&&h4.call(e,o)){const a=Ic[o];console.warn(`[react-markdown] Warning: please ${a.to?`use \`${a.to}\` instead of`:"remove"} \`${o}\` (see <${DF}#${a.id}> for more info)`),delete Ic[o]}const t=az().use(oB).use(e.remarkPlugins||[]).use(YB,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(uF,e),n=new sC;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=de.createElement(de.Fragment,{},UC({options:e,schema:sF,listDepth:0},r));return e.className&&(i=de.createElement("div",{className:e.className},i)),i}Xy.defaultProps={transformLinkUri:KM};Xy.propTypes={children:ie.string,className:ie.string,allowElement:ie.func,allowedElements:ie.arrayOf(ie.string),disallowedElements:ie.arrayOf(ie.string),unwrapDisallowed:ie.bool,remarkPlugins:ie.arrayOf(ie.oneOfType([ie.object,ie.func,ie.arrayOf(ie.oneOfType([ie.bool,ie.string,ie.object,ie.func,ie.arrayOf(ie.any)]))])),rehypePlugins:ie.arrayOf(ie.oneOfType([ie.object,ie.func,ie.arrayOf(ie.oneOfType([ie.bool,ie.string,ie.object,ie.func,ie.arrayOf(ie.any)]))])),sourcePos:ie.bool,rawSourcePos:ie.bool,skipHtml:ie.bool,includeElementIndex:ie.bool,transformLinkUri:ie.oneOfType([ie.func,ie.bool]),linkTarget:ie.oneOfType([ie.func,ie.string]),transformImageUri:ie.func,components:ie.object};const NF={tokenize:FF,partial:!0},VC={tokenize:$F,partial:!0},WC={tokenize:HF,partial:!0},us={tokenize:VF,partial:!0},qC={tokenize:UF,partial:!0},KC={tokenize:jF,previous:XC},GC={tokenize:BF,previous:Jy},qi={tokenize:zF,previous:QC},_i={},MF={text:_i};let Vo=48;for(;Vo<123;)_i[Vo]=qi,Vo++,Vo===58?Vo=65:Vo===91&&(Vo=97);_i[43]=qi;_i[45]=qi;_i[46]=qi;_i[95]=qi;_i[72]=[qi,GC];_i[104]=[qi,GC];_i[87]=[qi,KC];_i[119]=[qi,KC];function zF(e,t,n){const r=this;let i,o;return a;function a(y){return!p4(y)||!QC(r.previous)||Zy(r.events)?n(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(y))}function s(y){return p4(y)?(e.consume(y),s):y===64?(e.consume(y),u):n(y)}function u(y){return y===46?e.check(us,p,l)(y):y===45||y===95?e.check(us,n,c)(y):Ln(y)?(!o&&Sf(y)&&(o=!0),e.consume(y),u):p(y)}function l(y){return e.consume(y),i=!0,o=void 0,u}function c(y){return e.consume(y),h}function h(y){return y===46?e.check(us,n,l)(y):u(y)}function p(y){return i&&!o?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):n(y)}}function jF(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!XC(r.previous)||Zy(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(NF,e.attempt(VC,e.attempt(WC,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function BF(e,t,n){const r=this;return i;function i(g){return g!==72&&g!==104||!Jy(r.previous)||Zy(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),e.consume(g),o)}function o(g){return g===84||g===116?(e.consume(g),a):n(g)}function a(g){return g===84||g===116?(e.consume(g),s):n(g)}function s(g){return g===80||g===112?(e.consume(g),u):n(g)}function u(g){return g===83||g===115?(e.consume(g),l):l(g)}function l(g){return g===58?(e.consume(g),c):n(g)}function c(g){return g===47?(e.consume(g),h):n(g)}function h(g){return g===47?(e.consume(g),p):n(g)}function p(g){return g===null||hu(g)||Zh(g)||ep(g)?n(g):e.attempt(VC,e.attempt(WC,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function FF(e,t,n){return r;function r(u){return e.consume(u),i}function i(u){return u===87||u===119?(e.consume(u),o):n(u)}function o(u){return u===87||u===119?(e.consume(u),a):n(u)}function a(u){return u===46?(e.consume(u),s):n(u)}function s(u){return u===null||Ae(u)?n(u):t(u)}}function $F(e,t,n){let r,i;return o;function o(u){return u===38?e.check(qC,s,a)(u):u===46||u===95?e.check(us,s,a)(u):u===null||hu(u)||Zh(u)||u!==45&&ep(u)?s(u):(e.consume(u),o)}function a(u){return u===46?(i=r,r=void 0,e.consume(u),o):(u===95&&(r=!0),e.consume(u),o)}function s(u){return!i&&!r?t(u):n(u)}}function HF(e,t){let n=0;return r;function r(a){return a===38?e.check(qC,t,i)(a):(a===40&&n++,a===41?e.check(us,o,i)(a):Qy(a)?t(a):YC(a)?e.check(us,t,i)(a):(e.consume(a),r))}function i(a){return e.consume(a),r}function o(a){return n--,n<0?t(a):i(a)}}function UF(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return zr(a)?(e.consume(a),i):a===59?(e.consume(a),o):n(a)}function o(a){return Qy(a)?t(a):n(a)}}function VF(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return YC(o)?(e.consume(o),i):Qy(o)?t(o):n(o)}}function YC(e){return e===33||e===34||e===39||e===41||e===42||e===44||e===46||e===58||e===59||e===60||e===63||e===95||e===126}function Qy(e){return e===null||e===60||Kt(e)}function p4(e){return e===43||e===45||e===46||e===95||Ln(e)}function XC(e){return e===null||e===40||e===42||e===95||e===126||Kt(e)}function Jy(e){return e===null||!zr(e)}function QC(e){return e!==47&&Jy(e)}function Zy(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const WF={tokenize:ZF,partial:!0};function qF(){return{document:{[91]:{tokenize:XF,continuation:{tokenize:QF},exit:JF}},text:{[91]:{tokenize:YF},[93]:{add:"after",tokenize:KF,resolveTo:GF}}}}function KF(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return s;function s(u){if(!a||!a._balanced)return n(u);const l=oi(r.sliceSerialize({start:a.end,end:r.now()}));return l.charCodeAt(0)!==94||!o.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function GF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function YF(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(p){let y;return p===null||p===91||o++>999?n(p):p===93?a?(e.exit("chunkString"),y=e.exit("gfmFootnoteCallString"),i.includes(oi(r.sliceSerialize(y)))?h(p):n(p)):n(p):(e.consume(p),Kt(p)||(a=!0),p===92?c:l)}function c(p){return p===91||p===92||p===93?(e.consume(p),o++,l):l(p)}function h(p){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}}function XF(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),c):n(b)}function c(b){let _;return b===null||b===91||a>999?n(b):b===93?s?(_=e.exit("gfmFootnoteDefinitionLabelString"),o=oi(r.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y):n(b):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),a++,c):(e.enter("chunkString").contentType="string",h(b))}function h(b){return b===null||Ae(b)||b===91||b===93||a>999?(e.exit("chunkString"),c(b)):(Kt(b)||(s=!0),a++,e.consume(b),b===92?p:h)}function p(b){return b===91||b===92||b===93?(e.consume(b),a++,h):h(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),tt(e,g,"gfmFootnoteDefinitionWhitespace")):n(b)}function g(b){return i.includes(o)||i.push(o),t(b)}}function QF(e,t,n){return e.check(Hu,t,e.attempt(WF,t,n))}function JF(e){e.exit("gfmFootnoteDefinition")}function ZF(e,t,n){const r=this;return tt(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function e$(e={}){let t=e.singleTilde;const n={tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{[126]:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(o,a){let s=-1;for(;++s1?s(y):(o.consume(y),c++,p);if(c<2&&!t)return s(y);const b=o.exit("strikethroughSequenceTemporary"),_=kf(y);return b._open=!_||_===2&&Boolean(g),b._close=!g||g===2&&Boolean(_),a(y)}}}const t$={flow:{null:{tokenize:r$,resolve:n$}}},m4={tokenize:i$,partial:!0};function n$(e,t){let n=-1,r,i,o,a,s,u,l;for(;++n=4?$(N):(r._gfmTableDynamicInterruptHack=!0,R.check(r.parser.constructs.flow,function(re){return r._gfmTableDynamicInterruptHack=!1,$(re)},function(re){return r._gfmTableDynamicInterruptHack=!1,q(re)})(N))}}}function i$(e,t,n){let r=0;return i;function i(a){return e.enter("check"),e.consume(a),o}function o(a){return a===-1||a===32?(e.consume(a),r++,r===4?t:o):a===null||Kt(a)?t(a):n(a)}}const o$={tokenize:s$},a$={text:{[91]:o$}};function s$(e,t,n){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return Kt(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),a):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),a):n(s)}function a(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),e.check({tokenize:l$},t,n)):n(s)}}function l$(e,t,n){const r=this;return tt(e,i,"whitespace");function i(o){const a=r.events[r.events.length-1];return(a&&a[1].type==="whitespace"||Ae(o))&&o!==null?t(o):n(o)}}function u$(e){return fC([MF,qF(),e$(e),t$,a$])}function g4(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function c$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const d$={}.hasOwnProperty,f$=function(e,t,n,r){let i,o;typeof t=="string"||t instanceof RegExp?(o=[[t,n]],i=r):(o=t,i=n),i||(i={});const a=Ky(i.ignore||[]),s=h$(o);let u=-1;for(;++u0?{type:"text",value:x}:void 0),x!==!1&&(_!==d&&C.push({type:"text",value:h.value.slice(_,d)}),Array.isArray(x)?C.push(...x):x&&C.push(x),_=d+v[0].length,k=!0),!g.global)break;v=g.exec(h.value)}return k?(_e}const sg="phrasing",lg=["autolink","link","image","label"],p$={transforms:[S$],enter:{literalAutolink:g$,literalAutolinkEmail:ug,literalAutolinkHttp:ug,literalAutolinkWww:ug},exit:{literalAutolink:w$,literalAutolinkEmail:b$,literalAutolinkHttp:v$,literalAutolinkWww:y$}},m$={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sg,notInConstruct:lg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sg,notInConstruct:lg},{character:":",before:"[ps]",after:"\\/",inConstruct:sg,notInConstruct:lg}]};function g$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ug(e){this.config.enter.autolinkProtocol.call(this,e)}function v$(e){this.config.exit.autolinkProtocol.call(this,e)}function y$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function b$(e){this.config.exit.autolinkEmail.call(this,e)}function w$(e){this.exit(e)}function S$(e){f$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,k$],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,x$]],{ignore:["link","linkReference"]})}function k$(e,t,n,r,i){let o="";if(!JC(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!C$(n)))return!1;const a=_$(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function x$(e,t,n,r){return!JC(r,!0)||/[_-\d]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function C$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);let n,r,i,o;if(t)for(e=e.slice(0,t.index),o=t[0],n=o.indexOf(")"),r=g4(e,"("),i=g4(e,")");n!==-1&&r>i;)e+=o.slice(0,n+1),o=o.slice(n+1),n=o.indexOf(")"),i++;return[e,o]}function JC(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Zh(n)||ep(n))&&(!t||n!==47)}function b4(e){return e.label||!e.identifier?e.label||"":xC(e.identifier)}function Oo(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:u,current:a,shift:s};function a(){return{now:{line:i,column:o},lineShift:r}}function s(l){r+=l}function u(l=""){const c=l.split(/\r?\n|\r/g),h=c[c.length-1];return i+=c.length-1,o=c.length===1?o+h.length:1+h.length+r,l}}function ZC(e,t,n){const r=t.indexStack,i=e.children||[],o=Oo(n),a=[];let s=-1;for(r.push(-1);++s=l||c+10?" ":"")),s.shift(4),u+=s.move(YC(GC(r,o,s.current()),h)),l(),u;function h(p,y,g){return y?(g?"":" ")+p:p}}}function QC(e,t,n){const r=t.indexStack,i=e.children||[],o=[];let a=-1,s=n.before;r.push(-1);let u=Io(n);for(;++a0&&(s==="\r"||s===` -`)&&l.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),s=" ",u=Io(n),u.move(o.join(""))),o.push(u.move(t.handle(l,e,t,{...u.current(),before:s,after:c}))),s=o[o.length-1].slice(-1)}return r.pop(),o.join("")}const S$={canContainEols:["delete"],enter:{strikethrough:x$},exit:{strikethrough:C$}},k$={unsafe:[{character:"~",inConstruct:"phrasing"}],handlers:{delete:JC}};JC.peek=_$;function x$(e){this.enter({type:"delete",children:[]},e)}function C$(e){this.exit(e)}function JC(e,t,n,r){const i=Io(r),o=n.enter("emphasis");let a=i.move("~~");return a+=QC(e,n,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function _$(){return"~"}ZC.peek=E$;function ZC(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++ou&&(u=e[l].length);++_s[_])&&(s[_]=k)}g.push(S)}o[l]=g,a[l]=b}let c=-1;if(typeof n=="object"&&"length"in n)for(;++cs[c]&&(s[c]=S),p[c]=S),h[c]=k}o.splice(1,0,h),a.splice(1,0,p),l=-1;const y=[];for(;++ln==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function O$(e){this.exit(e),this.setData("inTable")}function L$(e){this.enter({type:"tableRow",children:[]},e)}function ug(e){this.exit(e)}function m4(e){this.enter({type:"tableCell",children:[]},e)}function D$(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,M$));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function M$(e,t){return t==="|"?t:e}function N$(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`}}const E$=/\r?\n|\r/g;function e_(e,t){const n=[];let r=0,i=0,o;for(;o=E$.exec(e);)a(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return a(e.slice(r)),n.join("");function a(s){n.push(t(s,i,!s))}}function t_(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function R$(e,t){return w4(e,t.inConstruct,!0)&&!w4(e,t.notInConstruct,!1)}function w4(e,t,n){if(!t)return n;typeof t=="string"&&(t=[t]);let r=-1;for(;++r=l||c+10?" ":"")),s.shift(4),u+=s.move(e_(ZC(r,o,s.current()),h)),l(),u;function h(p,y,g){return y?(g?"":" ")+p:p}}}function n_(e,t,n){const r=t.indexStack,i=e.children||[],o=[];let a=-1,s=n.before;r.push(-1);let u=Oo(n);for(;++a0&&(s==="\r"||s===` +`)&&l.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),s=" ",u=Oo(n),u.move(o.join(""))),o.push(u.move(t.handle(l,e,t,{...u.current(),before:s,after:c}))),s=o[o.length-1].slice(-1)}return r.pop(),o.join("")}const I$={canContainEols:["delete"],enter:{strikethrough:L$},exit:{strikethrough:D$}},O$={unsafe:[{character:"~",inConstruct:"phrasing"}],handlers:{delete:r_}};r_.peek=N$;function L$(e){this.enter({type:"delete",children:[]},e)}function D$(e){this.exit(e)}function r_(e,t,n,r){const i=Oo(r),o=n.enter("emphasis");let a=i.move("~~");return a+=n_(e,n,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function N$(){return"~"}i_.peek=M$;function i_(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++ou&&(u=e[l].length);++_s[_])&&(s[_]=k)}g.push(S)}o[l]=g,a[l]=b}let c=-1;if(typeof n=="object"&&"length"in n)for(;++cs[c]&&(s[c]=S),p[c]=S),h[c]=k}o.splice(1,0,h),a.splice(1,0,p),l=-1;const y=[];for(;++ln==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function H$(e){this.exit(e),this.setData("inTable")}function U$(e){this.enter({type:"tableRow",children:[]},e)}function cg(e){this.exit(e)}function C4(e){this.enter({type:"tableCell",children:[]},e)}function V$(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,W$));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function W$(e,t){return t==="|"?t:e}function q$(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:a,tableRow:s,tableCell:u,inlineCode:p}};function a(y,g,b,_){return l(c(y,b,_),y.align)}function s(y,g,b,_){const S=h(y,b,_),k=l([S]);return k.slice(0,k.indexOf(` -`))}function u(y,g,b,_){const S=b.enter("tableCell"),k=b.enter("phrasing"),C=QC(y,b,{..._,before:o,after:o});return k(),S(),C}function l(y,g){return R$(y,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function c(y,g,b){const _=y.children;let S=-1;const k=[],C=g.enter("table");for(;++S<_.length;)k[S]=h(_[S],g,b);return C(),k}function h(y,g,b){const _=y.children;let S=-1;const k=[],C=g.enter("tableRow");for(;++S<_.length;)k[S]=u(_[S],y,g,b);return C(),k}function p(y,g,b){let _=ZC(y,g,b);return b.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function z$(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function j$(e){const t=e.options.listItemIndent||"tab";if(t===1||t==="1")return"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function B$(e,t,n,r){const i=j$(n);let o=n.bulletCurrent||z$(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=Io(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const u=n.enter("listItem"),l=YC(GC(e,n,s.current()),c);return u(),l;function c(h,p,y){return p?(y?"":" ".repeat(a))+h:(y?o:o+" ".repeat(a-o.length))+h}}const F$={exit:{taskListCheckValueChecked:g4,taskListCheckValueUnchecked:g4,paragraph:U$}},$$={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:H$}};function g4(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function U$(e){const t=this.stack[this.stack.length-2],n=this.stack[this.stack.length-1],r=t.children,i=n.children[0];let o=-1,a;if(t&&t.type==="listItem"&&typeof t.checked=="boolean"&&i&&i.type==="text"){for(;++o-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=Oo(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const u=n.enter("listItem"),l=e_(ZC(e,n,s.current()),c);return u(),l;function c(h,p,y){return p?(y?"":" ".repeat(a))+h:(y?o:o+" ".repeat(a-o.length))+h}}const X$={exit:{taskListCheckValueChecked:_4,taskListCheckValueUnchecked:_4,paragraph:J$}},Q$={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Z$}};function _4(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function J$(e){const t=this.stack[this.stack.length-2],n=this.stack[this.stack.length-1],r=t.children,i=n.children[0];let o=-1,a;if(t&&t.type==="listItem"&&typeof t.checked=="boolean"&&i&&i.type==="text"){for(;++or&&i&&f(ve,{subtle:!0,onClick:()=>o(!1),children:"Read more "})]}):null}Gt.defaultProps={renderGFM:!0};const Y$=B.div.withConfig({displayName:"MarkdownWrapper",componentId:"sc-1p6qvwd-0"})(["margin-bottom:-","rem;width:100%;overflow-x:hidden;img{max-width:100%;}*{white-space:unset;}p,h1,h2,h3,h4,h5,h6{margin-bottom:1.5rem;}blockquote{margin-inline-start:0rem;padding-inline-start:1rem;border-inline-start:solid 3px ",";color:",";}pre code{white-space:pre-wrap;padding:1rem;width:100%;border-radius:",";}table{margin-bottom:1.5rem;width:100%;}table,thead,tbody,th,td{border-collapse:collapse;padding:0.5rem;border:1px solid ",";}"],e=>e.noMargin?e.theme.margin:0,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,e=>e.theme.radius,e=>e.theme.colors.bg2);var k1=new Map,Pc=new WeakMap,v4=0,X$=void 0;function Q$(e){return e?(Pc.has(e)||(v4+=1,Pc.set(e,v4.toString())),Pc.get(e)):"0"}function J$(e){return Object.keys(e).sort().filter(function(t){return e[t]!==void 0}).map(function(t){return t+"_"+(t==="root"?Q$(e.root):e[t])}).toString()}function Z$(e){var t=J$(e),n=k1.get(t);if(!n){var r=new Map,i,o=new IntersectionObserver(function(a){a.forEach(function(s){var u,l=s.isIntersecting&&i.some(function(c){return s.intersectionRatio>=c});e.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=l),(u=r.get(s.target))==null||u.forEach(function(c){c(l,s)})})},e);i=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:r},k1.set(t,n)}return n}function eU(e,t,n,r){if(n===void 0&&(n={}),r===void 0&&(r=X$),typeof window.IntersectionObserver>"u"&&r!==void 0){var i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),function(){}}var o=Z$(n),a=o.id,s=o.observer,u=o.elements,l=u.get(e)||[];return u.has(e)||u.set(e,l),l.push(t),s.observe(e),function(){l.splice(l.indexOf(t),1),l.length===0&&(u.delete(e),s.unobserve(e)),u.size===0&&(s.disconnect(),k1.delete(a))}}function tU(e){var t,n=e===void 0?{}:e,r=n.threshold,i=n.delay,o=n.trackVisibility,a=n.rootMargin,s=n.root,u=n.triggerOnce,l=n.skip,c=n.initialInView,h=n.fallbackInView,p=n.onChange,y=w.useState(null),g=y[0],b=y[1],_=w.useRef(),S=w.useState({inView:!!c,entry:void 0}),k=S[0],C=S[1];_.current=p,w.useEffect(function(){if(!(l||!g)){var m;return m=eU(g,function(x,A){C({inView:x,entry:A}),_.current&&_.current(x,A),A.isIntersecting&&u&&m&&(m(),m=void 0)},{root:s,rootMargin:a,threshold:r,trackVisibility:o,delay:i},h),function(){m&&m()}}},[Array.isArray(r)?r.toString():r,g,s,a,u,l,o,h,i]);var d=(t=k.entry)==null?void 0:t.target;w.useEffect(function(){!g&&d&&!u&&!l&&C({inView:!!c,entry:void 0})},[g,d,u,l,c]);var v=[b,k.inView,k.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}function Yt({subject:e,untabbable:t,className:n}){const r=Ce(e,{allowIncomplete:!0}),[i]=Xe(r),[o]=ye(r,J.properties.description);return e?r.error?f(We,{subject:e,untabbable:t,children:f(Nt,{about:e,title:r.error.message,children:"Unknown Resource"})}):r.loading?f(Dx,{about:e,title:`${e} is loading..`}):dn.isValidSubject(e)?f(We,{subject:e,untabbable:t,className:n,children:f("span",{title:o||"",children:i})}):M(Nt,{children:[e," is not a valid subject."]}):f(Nt,{children:"No subject passed"})}function e_({date:e}){return M("span",{title:e.toLocaleString(),children:[e.toLocaleDateString()," ",e.toLocaleTimeString()]})}function nU({resource:e}){return f(rU,{children:f(Ps,{resource:e})})}const rU=B.div.withConfig({displayName:"NestedWrapper",componentId:"sc-aouvx4-0"})(["margin-left:","rem;"],e=>e.theme.margin),cg=10;function iU({subjects:e}){const[t,n]=w.useState(!1),r=e.length>cg;let i=e;return!t&&r&&(i=i.slice(0,cg)),M(be,{children:[i.map((o,a)=>typeof o!="string"?(console.warn(`ResourceArray: subject ${o} isn't a string`,o),null):M(de.Fragment,{children:[f(Yt,{subject:o}),a!==i.length-1&&", "]},o)),r&&f(oU,{onClick:()=>n(!t),children:t?"show less":`show ${e.length-cg} more`})]})}const oU=B.span.withConfig({displayName:"ShowMoreButton",componentId:"sc-1skyo16-0"})(["cursor:pointer;margin-left:0.5em;&:hover{text-decoration:underline;}"]);function t_({value:e,datatype:t,noMargin:n}){try{switch(t){case Ie.ATOMIC_URL:{const r=gI(e);return typeof r=="string"?f(Yt,{subject:r}):f(nU,{resource:r})}case(Ie.DATE,Ie.TIMESTAMP):return f(e_,{date:vk(e)});case Ie.MARKDOWN:return f(Gt,{text:W0(e),noMargin:n});case Ie.RESOURCEARRAY:return f(iU,{subjects:_l(e)});default:return f("div",{children:W0(e)})}}catch(r){return M(xt,{children:[r.message," original value: ",e==null?void 0:e.toString()]})}}function dg({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=ye(e,t.subject,{handleValidationError:i});function s(u){const l=u.target.value;a(l)}return M(be,{children:[f(un,{children:f(Xn,{value:o===void 0?"":o,onChange:s,...n})}),o!==""&&r&&f(xt,{children:r.message}),o===""&&f(xt,{children:"Required"})]})}class Go{constructor(t,n){typeof t=="number"?(this.location=t,this.length=n):(this.location=-1,this.length=0)}max(t){return typeof t=="number"&&(this.length=t-this.location),this.location+this.length}isValid(){return this.location>-1}toArray(){return[this.location,this.max()]}toString(){return this.location==-1?"invalid range":"["+this.location+","+this.max()+")"}}const aU={wordSeparators:`-/\\:()<>%._=&[]+ -\r`,uppercaseLetters:(()=>{const e="A".charCodeAt(0),t=[];for(let n=0;n<26;n++)t.push(String.fromCharCode(e+n));return t.join("")})(),ignoredScore:.9,skippedScore:.15,emptyQueryScore:0},sU={longStringLength:150,maxMatchStartPct:.15,minMatchDensityPct:.75,maxMatchDensityPct:.95,beginningOfStringPct:.1};class ip{constructor(t){Object.assign(this,aU,t)}useSkipReduction(){return!0}adjustRemainingScore(t,n,r,i,o,a,s,u){return r*a.length}}class lU extends ip{constructor(t){super(Object.assign({},sU,t))}useSkipReduction(t,n,r,i,o,a,s){const u=t.length,l=u<=this.longStringLength,c=s.location/u;return l||c=this.minMatchDensityPct?1:h,p=h>=this.maxMatchDensityPct?1:p),r*Math.min(a.length,this.longStringLength)*h*p}}function n_(e){return e instanceof ip?e:new lU(e)}const uU=n_();new ip;new ip({emptyQueryScore:.9,adjustRemainingScore:function(e,t,n,r,i,o,a,s){let u=n*o.length;return r||(u+=(a.location-i.location)/2),u}});function r_(e="",t="",n,r=e.toLocaleLowerCase(),i=t.toLocaleLowerCase(),o=uU,a=new Go(0,e.length)){if(!t)return o.emptyQueryScore;return s(a,new Go(0,t.length),new Go);function s(u,l,c){if(!l.length)return o.ignoredScore;if(l.length>u.length)return 0;const h=n&&n.length;for(let p=l.length;p>0;p--){const y=i.substring(l.location,l.location+p),g=cU(r,y,new Go(u.location,u.length-l.length+p));if(!g.isValid())continue;c.isValid()?c.location=Math.min(c.location,g.location):c.location=g.location,c.max(g.max()),n&&n.push([g.location,g.max()]);const b=new Go(g.max(),u.max()-g.max()),_=new Go(l.location+p,l.length-p),S=s(b,_,c);if(S){let k=b.location-u.location,C=!0;const d=o.useSkipReduction(e,t,S,b,u,b,g,c);if(g.location>u.location)if(d&&o.wordSeparators.indexOf(e[g.location-1])>-1)for(let v=g.location-2;v>=u.location;v--)o.wordSeparators.indexOf(e[v])>-1?k--:k-=o.skippedScore;else if(d&&o.uppercaseLetters.indexOf(e[g.location])>-1)for(let v=g.location-1;v>=u.location;v--)o.uppercaseLetters.indexOf(e[v])>-1?k--:k-=o.skippedScore;else k-=g.location-u.location,C=!1;return k+=o.adjustRemainingScore(e,t,S,C,u,b,g,c),k/=u.length,k}else n&&(n.length=h)}return 0}}r_.createConfig=n_;function cU(e,t,n){const i=e.substring(n.location,n.max()).indexOf(t),o=new Go;return i>-1&&(o.location=i+n.location,o.length=t.length),o}class dU{constructor(t=[],n={}){let r=n;n instanceof Array&&(r={keys:n});const{scorer:i=r_,transformString:o=this.transformString,keys:a=[],minimumScore:s=0,config:u}=r;this.scorer=i,this.minimumScore=s,this.config=u,this.transformString=o,typeof i.createConfig=="function"&&(this.config=i.createConfig(u)),this.setKeys(a),this.setItems(t),this.compareScoredStrings=this.compareScoredStrings.bind(this)}search(t){const n=[],{items:r,transformedItems:i,keys:o,config:a}=this,s=t?this.minimumScore:-1,u=this.transformString(t);if(o.length)for(let l=0,c=r.length;lg&&(g=x,b=C)}}g>s&&(y.score=g,y.scoreKey=b,n.push(y))}else for(let l=0,c=r.length;ls&&n.push({item:h,score:g,matches:y,_:p})}return n.sort(this.compareScoredStrings),n}setKeys(t){if(this.keys=[].concat(t),this.keys.length){const{scorer:n}=this;this.keys=this.keys.map(r=>{const i=typeof r=="string"?{name:r,scorer:n}:r;return i.name.indexOf(".")>-1&&(i.path=i.name.split(".")),i}),this.defaultKeyName=this.keys[0].name}else this.defaultKeyName=null}setItems(t){const{keys:n}=this,r=[];if(this.items=[].concat(t),this.transformedItems=r,n.length)for(let i=0,o=t.length;io&&o[a],t):t[r]}transformString(t){return t.toLocaleLowerCase()}compareScoredStrings(t,n){const r=t._,i=n._,o=typeof r=="string"?r:r[this.defaultKeyName],a=typeof i=="string"?i:i[this.defaultKeyName];return t.score===n.score?o===void 0||a===void 0?o===void 0&&a===void 0?0:o===void 0?1:-1:o===a?0:o{n||i(hU(c))},[c,n]),de.useEffect(()=>{if(n||r===void 0||dn.isValidSubject(l))return;const h=r&&r.search(l);a(h)},[l,r,n]),o}function hU(e){const n=Array.from((e==null?void 0:e.values())||[]).reduce((o,a)=>{if(!a.isReady()||a.getSubject()===void 0||a.getClasses().includes(J.classes.commit))return o;const s=JSON.stringify(Array.from(a.getPropVals().values()).sort().join(` - `)),u={subject:a.getSubject(),valuesArray:s};return o.push(u),o},[]),r={keys:["subject","valuesArray"]};return new dU(n,r)}function pU({subject:e,clickable:t}){const n=Ce(e),[r]=Xe(n);let[i]=ye(n,J.properties.description);if(n.loading)return f("span",{about:e,children:"Loading..."});if(n.error)return M(Nt,{about:e,children:["Error: ",n.error.message]});const o=40;return i&&i.length>=o&&(i=i.slice(0,o)+"..."),M("span",{about:e,children:[t?f(Yt,{untabbable:!0,subject:e}):f("b",{children:r}),i?` - ${i}`:null]})}function y4(e){return(e==null?void 0:e.type)==="createOption"}const i_=({required:e,initial:t,placeholder:n,onRemove:r,onUpdate:i,options:o,disabled:a,classType:s,onCreateClick:u,onInputChange:l,onBlur:c,...h})=>{const[p,y]=w.useState(t||""),[g,b]=w.useState(t),[_,S]=w.useState(0),[k,C]=w.useState(!1),[d,v]=w.useState(!1),[m,x]=w.useState(!1),A=w.useRef(null),L=w.useRef(null),P=w.useRef(null),O=w.useCallback(()=>{C(!1),v(!1),c&&c(),b(p)},[c,p]);Tx([A,L,P],O,k),w.useEffect(()=>{v(!1),b(t)},[t]),je("esc",F=>{F.preventDefault(),C(!1)},{enabled:k,enableOnTags:["INPUT"]});const V=w.useCallback(F=>{const R=F.target.value;y(R),l&&l(R),x(!0),v(!0),C(!0),S(-1),b(R===""?void 0:R)},[l,y]);function H(){var F;y(""),b(void 0),i(void 0),(F=P.current)==null||F.focus()}function j(F){S(-1),v(!0),C(!0),F.target.select(),setTimeout(function(){F.target.select()},20)}return f(be,{children:M(vU,{children:[M(un,{children:[M(gU,{children:[g&&!d&&f(kU,{children:f(Yt,{subject:g,untabbable:!0})}),f(Xn,{onFocus:j,disabled:a,size:5,required:e,placeholder:n,value:p,onChange:V,ref:P,...h})]}),g?f(ta,{disabled:a,type:"button",onClick:H,title:"clear selection","aria-label":"clear selection",children:f(Mu,{})}):null,o.length>0&&g===void 0&&f(ta,{disabled:a,type:"button",onClick:()=>C(!k),title:"toggle menu",ref:L,"aria-label":"toggle menu",children:f(wy,{})}),r!==void 0&&f(ta,{disabled:a,type:"button",onClick:r,title:"remove item","aria-label":"remove item",children:f(Uh,{})})]})," ",f(yU,{onMouseEnter:()=>x(!1),children:k&&f(mU,{options:o,dropdownRef:A,selectedIndex:_,setSelectedIndex:S,setInputValue:y,setSelectedItem:b,onUpdate:i,onCreateClick:u,setIsOpen:C,isOpen:k,useKeys:m,setUseKeys:x,inputValue:p,classType:s})})]})})};function b4(e,t){var r;const n=(r=t==null?void 0:t.current)==null?void 0:r.children[e];n==null||n.scrollIntoView({block:"nearest"})}function mU({dropdownRef:e,inputValue:t,isOpen:n,onUpdate:r,onCreateClick:i,options:o,selectedIndex:a,setInputValue:s,setIsOpen:u,setSelectedIndex:l,setSelectedItem:c,setUseKeys:h,useKeys:p,classType:y}){const g=fU(t,o),_=[...i&&!t.startsWith("http")?[{type:"createOption"}]:[],...g],S=Ce(y),[k]=Xe(S);function C(d){s(d),c(d),r(d),u(!1)}return je("enter",d=>{d.preventDefault();const v=_[a];if(y4(v)){i&&i();return}a>0?C(v.item.subject):C(t)},{enabled:n,enableOnTags:["INPUT"]},[a]),je("up",d=>{d.preventDefault(),h(!0);const v=a<=0?_.length-1:a-1;l(v),b4(v,e)},{enabled:n,enableOnTags:["INPUT"]},[a]),je("down",d=>{d.preventDefault(),h(!0);const v=a===_.length-1?0:a+1;return l(v),b4(v,e),!1},{enabled:n,enableOnTags:["INPUT"]},[a]),!_||_.length===0?null:f(bU,{ref:e,children:_.map((d,v)=>y4(d)?M(w4,{onClick:i,useKeys:p,selected:v===a,children:["Create ",y?k:"new item",":"," ",f(SU,{children:t})]},t):f(w4,{onClick:()=>C(d.item.subject),selected:v===a,useKeys:p,children:f(pU,{subject:d.item.subject})},d.item.subject))})}const gU=B.div.withConfig({displayName:"ResourceInputOverlayWrapper",componentId:"sc-1ruz3jv-0"})(["position:relative;display:flex;flex:1;"]),vU=B.div.withConfig({displayName:"DropDownStyled",componentId:"sc-1ruz3jv-1"})(["position:relative;flex:1;"]),yU=B.ul.withConfig({displayName:"DropDownWrapperWrapper",componentId:"sc-1ruz3jv-2"})(["margin-bottom:0;"]),bU=B.div.withConfig({displayName:"DropDownWrapper",componentId:"sc-1ruz3jv-3"})(["display:flex;flex-direction:column;background-color:",";border:solid 1px ",";border-radius:",";box-shadow:",";position:absolute;z-index:",";max-height:30rem;overflow-y:auto;left:0;right:0;min-width:10rem;"],e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.theme.radius,e=>e.theme.boxShadowIntense,e=>e.theme.zIndex.dropdown),w4=B.li.withConfig({displayName:"DropDownItem",componentId:"sc-1ruz3jv-4"})(["display:flex;flex-direction:row;border-bottom:solid 1px ",";cursor:pointer;margin:0;padding:0.3rem;text-decoration:",";"," ",""],e=>e.theme.colors.bg2,e=>e.selected?"underline":"none",e=>e.selected&&Jn(["background-color:",";color:",";"],t=>t.theme.colors.main,t=>t.theme.colors.bg),e=>!e.useKeys&&Jn(["&:hover,&:active,&:focus{background-color:",";color:",";}"],t=>t.theme.colors.main,t=>t.theme.colors.bg)),wU=B.div.withConfig({displayName:"DropDownMini",componentId:"sc-1ruz3jv-5"})(["display:inline-flex;margin-bottom:1rem;flex:1;max-width:20rem;"]),SU=B.span.withConfig({displayName:"NewItemName",componentId:"sc-1ruz3jv-6"})(["font-style:italic;margin-left:1ch;"]),kU=B(UM).withConfig({displayName:"StyledInputOverlay",componentId:"sc-1ruz3jv-7"})(["a{width:100%;height:2rem;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"]);function o_(e){const t=w.useRef(!1);w.useEffect(()=>{if(!t.current)return t.current=!0,e()},[])}const a_=(e,t=()=>{})=>{const n=Ke(),[r,i]=w.useState(!1),[o,a]=w.useState(void 0);return[w.useCallback(async u=>{u.preventDefault(),i(!0),a(void 0);try{await e.save(n),i(!1),t(),dt.success("Resource saved"),e.new&&n.notifyResourceManuallyCreated(e)}catch(l){a(l),i(!1),dt.error("Could not save resource")}},[e,n]),r,o]};function xU(e){return e.error?e.subject.split("/").pop()||"error":e.shortname}function Rr({handleDelete:e,propertyURL:t,resource:n,required:r,autoFocus:i,disabled:o,label:a}){const s=Ou(t),[u,l]=w.useState(!0);if(s===null)return f(ni,{label:a||"loading...",children:f(un,{children:f(Xn,{disabled:o,placeholder:"loading property..."})})});const c=a||s.error?xU(s):s.shortname;return s.isDynamic&&u?M(ni,{helper:f(S4,{text:s.description,link:s.subject}),label:c,disabled:o,children:["This field is calculated server-side, edits will not be saved. ",f(ve,{subtle:!0,onClick:()=>l(!1),children:"edit anyway"})]}):f(ni,{helper:f(S4,{text:s.description,link:s.subject}),label:c,handleDelete:e,required:r,disabled:o,children:f(S7,{"data-test":`input-${s.shortname}`,resource:n,property:s,required:r,autoFocus:i,disabled:o},t+" input-switcher")})}const CU=B.div.withConfig({displayName:"HelperTextWraper",componentId:"sc-1m1no8k-0"})(["position:relative;margin-bottom:0rem;"]);function S4({text:e,link:t}){return M(CU,{children:[f(Gt,{text:e}),f(We,{subject:t,children:t})]})}/*! ***************************************************************************** +`);return e.slice(0,t+(i===-1?r.length:i))+"..."}function iH(e){let t=e.replace(/#+/g,"");return t=t.replace(/\*+/g,""),t=t.replace(/_+/g,""),t=t.replace(/`+/g,""),t=t.replace(/~+/g,""),t=t.replace(/\[(.*?)\]\((.*?)\)/g,"$1"),t}function Gt({text:e,noMargin:t,renderGFM:n,maxLength:r}){const[i,o]=de.useState(!0);return r=r||5e3,e?O(oH,{noMargin:t,children:[f(Xy,{remarkPlugins:n?[nH]:[],children:i?rH(e,r):e}),e.length>r&&i&&f(ve,{subtle:!0,onClick:()=>o(!1),children:"Read more "})]}):null}Gt.defaultProps={renderGFM:!0};const oH=B.div.withConfig({displayName:"MarkdownWrapper",componentId:"sc-1p6qvwd-0"})(["margin-bottom:-","rem;width:100%;overflow-x:hidden;img{max-width:100%;}*{white-space:unset;}p,h1,h2,h3,h4,h5,h6{margin-bottom:1.5rem;}blockquote{margin-inline-start:0rem;padding-inline-start:1rem;border-inline-start:solid 3px ",";color:",";}pre code{white-space:pre-wrap;padding:1rem;width:100%;border-radius:",";}table{margin-bottom:1.5rem;width:100%;}table,thead,tbody,th,td{border-collapse:collapse;padding:0.5rem;border:1px solid ",";}"],e=>e.noMargin?e.theme.margin:0,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,e=>e.theme.radius,e=>e.theme.colors.bg2);var x1=new Map,Oc=new WeakMap,E4=0,aH=void 0;function sH(e){return e?(Oc.has(e)||(E4+=1,Oc.set(e,E4.toString())),Oc.get(e)):"0"}function lH(e){return Object.keys(e).sort().filter(function(t){return e[t]!==void 0}).map(function(t){return t+"_"+(t==="root"?sH(e.root):e[t])}).toString()}function uH(e){var t=lH(e),n=x1.get(t);if(!n){var r=new Map,i,o=new IntersectionObserver(function(a){a.forEach(function(s){var u,l=s.isIntersecting&&i.some(function(c){return s.intersectionRatio>=c});e.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=l),(u=r.get(s.target))==null||u.forEach(function(c){c(l,s)})})},e);i=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:r},x1.set(t,n)}return n}function cH(e,t,n,r){if(n===void 0&&(n={}),r===void 0&&(r=aH),typeof window.IntersectionObserver>"u"&&r!==void 0){var i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),function(){}}var o=uH(n),a=o.id,s=o.observer,u=o.elements,l=u.get(e)||[];return u.has(e)||u.set(e,l),l.push(t),s.observe(e),function(){l.splice(l.indexOf(t),1),l.length===0&&(u.delete(e),s.unobserve(e)),u.size===0&&(s.disconnect(),x1.delete(a))}}function dH(e){var t,n=e===void 0?{}:e,r=n.threshold,i=n.delay,o=n.trackVisibility,a=n.rootMargin,s=n.root,u=n.triggerOnce,l=n.skip,c=n.initialInView,h=n.fallbackInView,p=n.onChange,y=w.useState(null),g=y[0],b=y[1],_=w.useRef(),S=w.useState({inView:!!c,entry:void 0}),k=S[0],C=S[1];_.current=p,w.useEffect(function(){if(!(l||!g)){var m;return m=cH(g,function(x,A){C({inView:x,entry:A}),_.current&&_.current(x,A),A.isIntersecting&&u&&m&&(m(),m=void 0)},{root:s,rootMargin:a,threshold:r,trackVisibility:o,delay:i},h),function(){m&&m()}}},[Array.isArray(r)?r.toString():r,g,s,a,u,l,o,h,i]);var d=(t=k.entry)==null?void 0:t.target;w.useEffect(function(){!g&&d&&!u&&!l&&C({inView:!!c,entry:void 0})},[g,d,u,l,c]);var v=[b,k.inView,k.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}function Yt({subject:e,untabbable:t,className:n}){const r=Ce(e,{allowIncomplete:!0}),[i]=qe(r),[o]=be(r,Q.properties.description);return e?r.error?f(Ve,{subject:e,untabbable:t,children:f(Lt,{about:e,title:r.error.message,children:"Unknown Resource"})}):r.loading?f(Vx,{about:e,title:`${e} is loading..`}):dn.isValidSubject(e)?f(Ve,{subject:e,untabbable:t,className:n,children:f("span",{title:o||"",children:i})}):O(Lt,{children:[e," is not a valid subject."]}):f(Lt,{children:"No subject passed"})}function e2({date:e}){return O("time",{dateTime:e.toISOString(),children:[e.toLocaleDateString()," ",e.toLocaleTimeString()]})}function fH({resource:e}){return f(hH,{children:f(Os,{resource:e})})}const hH=B.div.withConfig({displayName:"NestedWrapper",componentId:"sc-aouvx4-0"})(["margin-left:","rem;"],e=>e.theme.margin),dg=10;function pH({subjects:e}){const[t,n]=w.useState(!1),r=e.length>dg;let i=e;return!t&&r&&(i=i.slice(0,dg)),O(ye,{children:[i.map((o,a)=>typeof o!="string"?(console.warn(`ResourceArray: subject ${o} isn't a string`,o),null):O(de.Fragment,{children:[f(Yt,{subject:o}),a!==i.length-1&&", "]},o)),r&&f(mH,{onClick:()=>n(!t),children:t?"show less":`show ${e.length-dg} more`})]})}const mH=B.span.withConfig({displayName:"ShowMoreButton",componentId:"sc-1skyo16-0"})(["cursor:pointer;margin-left:0.5em;&:hover{text-decoration:underline;}"]);function o_({value:e,datatype:t,noMargin:n}){try{switch(t){case Ie.ATOMIC_URL:{const r=CI(e);return typeof r=="string"?f(Yt,{subject:r}):f(fH,{resource:r})}case(Ie.DATE,Ie.TIMESTAMP):return f(e2,{date:Ak(e)});case Ie.MARKDOWN:return f(Gt,{text:W0(e),noMargin:n});case Ie.RESOURCEARRAY:return f(pH,{subjects:El(e)});default:return f("div",{children:W0(e)})}}catch(r){return O(xt,{children:[r.message," original value: ",e==null?void 0:e.toString()]})}}function fg({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=be(e,t.subject,{handleValidationError:i});function s(u){const l=u.target.value;a(l)}return O(ye,{children:[f(un,{children:f(Jn,{value:o===void 0?"":o,onChange:s,...n})}),o!==""&&r&&f(xt,{children:r.message}),o===""&&f(xt,{children:"Required"})]})}class Go{constructor(t,n){typeof t=="number"?(this.location=t,this.length=n):(this.location=-1,this.length=0)}max(t){return typeof t=="number"&&(this.length=t-this.location),this.location+this.length}isValid(){return this.location>-1}toArray(){return[this.location,this.max()]}toString(){return this.location==-1?"invalid range":"["+this.location+","+this.max()+")"}}const gH={wordSeparators:`-/\\:()<>%._=&[]+ +\r`,uppercaseLetters:(()=>{const e="A".charCodeAt(0),t=[];for(let n=0;n<26;n++)t.push(String.fromCharCode(e+n));return t.join("")})(),ignoredScore:.9,skippedScore:.15,emptyQueryScore:0},vH={longStringLength:150,maxMatchStartPct:.15,minMatchDensityPct:.75,maxMatchDensityPct:.95,beginningOfStringPct:.1};class op{constructor(t){Object.assign(this,gH,t)}useSkipReduction(){return!0}adjustRemainingScore(t,n,r,i,o,a,s,u){return r*a.length}}class yH extends op{constructor(t){super(Object.assign({},vH,t))}useSkipReduction(t,n,r,i,o,a,s){const u=t.length,l=u<=this.longStringLength,c=s.location/u;return l||c=this.minMatchDensityPct?1:h,p=h>=this.maxMatchDensityPct?1:p),r*Math.min(a.length,this.longStringLength)*h*p}}function a_(e){return e instanceof op?e:new yH(e)}const bH=a_();new op;new op({emptyQueryScore:.9,adjustRemainingScore:function(e,t,n,r,i,o,a,s){let u=n*o.length;return r||(u+=(a.location-i.location)/2),u}});function s_(e="",t="",n,r=e.toLocaleLowerCase(),i=t.toLocaleLowerCase(),o=bH,a=new Go(0,e.length)){if(!t)return o.emptyQueryScore;return s(a,new Go(0,t.length),new Go);function s(u,l,c){if(!l.length)return o.ignoredScore;if(l.length>u.length)return 0;const h=n&&n.length;for(let p=l.length;p>0;p--){const y=i.substring(l.location,l.location+p),g=wH(r,y,new Go(u.location,u.length-l.length+p));if(!g.isValid())continue;c.isValid()?c.location=Math.min(c.location,g.location):c.location=g.location,c.max(g.max()),n&&n.push([g.location,g.max()]);const b=new Go(g.max(),u.max()-g.max()),_=new Go(l.location+p,l.length-p),S=s(b,_,c);if(S){let k=b.location-u.location,C=!0;const d=o.useSkipReduction(e,t,S,b,u,b,g,c);if(g.location>u.location)if(d&&o.wordSeparators.indexOf(e[g.location-1])>-1)for(let v=g.location-2;v>=u.location;v--)o.wordSeparators.indexOf(e[v])>-1?k--:k-=o.skippedScore;else if(d&&o.uppercaseLetters.indexOf(e[g.location])>-1)for(let v=g.location-1;v>=u.location;v--)o.uppercaseLetters.indexOf(e[v])>-1?k--:k-=o.skippedScore;else k-=g.location-u.location,C=!1;return k+=o.adjustRemainingScore(e,t,S,C,u,b,g,c),k/=u.length,k}else n&&(n.length=h)}return 0}}s_.createConfig=a_;function wH(e,t,n){const i=e.substring(n.location,n.max()).indexOf(t),o=new Go;return i>-1&&(o.location=i+n.location,o.length=t.length),o}class SH{constructor(t=[],n={}){let r=n;n instanceof Array&&(r={keys:n});const{scorer:i=s_,transformString:o=this.transformString,keys:a=[],minimumScore:s=0,config:u}=r;this.scorer=i,this.minimumScore=s,this.config=u,this.transformString=o,typeof i.createConfig=="function"&&(this.config=i.createConfig(u)),this.setKeys(a),this.setItems(t),this.compareScoredStrings=this.compareScoredStrings.bind(this)}search(t){const n=[],{items:r,transformedItems:i,keys:o,config:a}=this,s=t?this.minimumScore:-1,u=this.transformString(t);if(o.length)for(let l=0,c=r.length;lg&&(g=x,b=C)}}g>s&&(y.score=g,y.scoreKey=b,n.push(y))}else for(let l=0,c=r.length;ls&&n.push({item:h,score:g,matches:y,_:p})}return n.sort(this.compareScoredStrings),n}setKeys(t){if(this.keys=[].concat(t),this.keys.length){const{scorer:n}=this;this.keys=this.keys.map(r=>{const i=typeof r=="string"?{name:r,scorer:n}:r;return i.name.indexOf(".")>-1&&(i.path=i.name.split(".")),i}),this.defaultKeyName=this.keys[0].name}else this.defaultKeyName=null}setItems(t){const{keys:n}=this,r=[];if(this.items=[].concat(t),this.transformedItems=r,n.length)for(let i=0,o=t.length;io&&o[a],t):t[r]}transformString(t){return t.toLocaleLowerCase()}compareScoredStrings(t,n){const r=t._,i=n._,o=typeof r=="string"?r:r[this.defaultKeyName],a=typeof i=="string"?i:i[this.defaultKeyName];return t.score===n.score?o===void 0||a===void 0?o===void 0&&a===void 0?0:o===void 0?1:-1:o===a?0:o{n||i(xH(c))},[c,n]),de.useEffect(()=>{if(n||r===void 0||dn.isValidSubject(l))return;const h=r&&r.search(l);a(h)},[l,r,n]),o}function xH(e){const n=Array.from((e==null?void 0:e.values())||[]).reduce((o,a)=>{if(!a.isReady()||a.getSubject()===void 0||a.getClasses().includes(Q.classes.commit))return o;const s=JSON.stringify(Array.from(a.getPropVals().values()).sort().join(` + `)),u={subject:a.getSubject(),valuesArray:s};return o.push(u),o},[]),r={keys:["subject","valuesArray"]};return new SH(n,r)}function CH({subject:e,clickable:t}){const n=Ce(e),[r]=qe(n);let[i]=be(n,Q.properties.description);if(n.loading)return f("span",{about:e,children:"Loading..."});if(n.error)return O(Lt,{about:e,children:["Error: ",n.error.message]});const o=40;return i&&i.length>=o&&(i=i.slice(0,o)+"..."),O("span",{about:e,children:[t?f(Yt,{untabbable:!0,subject:e}):f("b",{children:r}),i?` - ${i}`:null]})}function R4(e){return(e==null?void 0:e.type)==="createOption"}const l_=({required:e,initial:t,placeholder:n,onRemove:r,onUpdate:i,options:o,disabled:a,classType:s,onCreateClick:u,onInputChange:l,onBlur:c,...h})=>{const[p,y]=w.useState(t||""),[g,b]=w.useState(t),[_,S]=w.useState(0),[k,C]=w.useState(!1),[d,v]=w.useState(!1),[m,x]=w.useState(!1),A=w.useRef(null),D=w.useRef(null),P=w.useRef(null),L=w.useCallback(()=>{C(!1),v(!1),c&&c(),b(p)},[c,p]);Bx([A,D,P],L,k),w.useEffect(()=>{v(!1),b(t)},[t]),je("esc",F=>{F.preventDefault(),C(!1)},{enabled:k,enableOnTags:["INPUT"]});const W=w.useCallback(F=>{const R=F.target.value;y(R),l&&l(R),x(!0),v(!0),C(!0),S(-1),b(R===""?void 0:R)},[l,y]);function U(){var F;y(""),b(void 0),i(void 0),(F=P.current)==null||F.focus()}function j(F){S(-1),v(!0),C(!0),F.target.select(),setTimeout(function(){F.target.select()},20)}return f(ye,{children:O(RH,{children:[O(un,{children:[O(EH,{children:[g&&!d&&f(OH,{children:f(Yt,{subject:g,untabbable:!0})}),f(Jn,{onFocus:j,disabled:a,size:5,required:e,placeholder:n,value:p,onChange:W,ref:P,...h})]}),g?f(ta,{disabled:a,type:"button",onClick:U,title:"clear selection","aria-label":"clear selection",children:f(Mu,{})}):null,o.length>0&&g===void 0&&f(ta,{disabled:a,type:"button",onClick:()=>C(!k),title:"toggle menu",ref:D,"aria-label":"toggle menu",children:f(Sy,{})}),r!==void 0&&f(ta,{disabled:a,type:"button",onClick:r,title:"remove item","aria-label":"remove item",children:f(Vh,{})})]})," ",f(AH,{onMouseEnter:()=>x(!1),children:k&&f(_H,{options:o,dropdownRef:A,selectedIndex:_,setSelectedIndex:S,setInputValue:y,setSelectedItem:b,onUpdate:i,onCreateClick:u,setIsOpen:C,isOpen:k,useKeys:m,setUseKeys:x,inputValue:p,classType:s})})]})})};function A4(e,t){var r;const n=(r=t==null?void 0:t.current)==null?void 0:r.children[e];n==null||n.scrollIntoView({block:"nearest"})}function _H({dropdownRef:e,inputValue:t,isOpen:n,onUpdate:r,onCreateClick:i,options:o,selectedIndex:a,setInputValue:s,setIsOpen:u,setSelectedIndex:l,setSelectedItem:c,setUseKeys:h,useKeys:p,classType:y}){const g=kH(t,o),_=[...i&&!t.startsWith("http")?[{type:"createOption"}]:[],...g],S=Ce(y),[k]=qe(S);function C(d){s(d),c(d),r(d),u(!1)}return je("enter",d=>{d.preventDefault();const v=_[a];if(R4(v)){i&&i();return}a>0?C(v.item.subject):C(t)},{enabled:n,enableOnTags:["INPUT"]},[a]),je("up",d=>{d.preventDefault(),h(!0);const v=a<=0?_.length-1:a-1;l(v),A4(v,e)},{enabled:n,enableOnTags:["INPUT"]},[a]),je("down",d=>{d.preventDefault(),h(!0);const v=a===_.length-1?0:a+1;return l(v),A4(v,e),!1},{enabled:n,enableOnTags:["INPUT"]},[a]),!_||_.length===0?null:f(TH,{ref:e,children:_.map((d,v)=>R4(d)?O(T4,{onClick:i,useKeys:p,selected:v===a,children:["Create ",y?k:"new item",":"," ",f(IH,{children:t})]},t):f(T4,{onClick:()=>C(d.item.subject),selected:v===a,useKeys:p,children:f(CH,{subject:d.item.subject})},d.item.subject))})}const EH=B.div.withConfig({displayName:"ResourceInputOverlayWrapper",componentId:"sc-1ruz3jv-0"})(["position:relative;display:flex;flex:1;"]),RH=B.div.withConfig({displayName:"DropDownStyled",componentId:"sc-1ruz3jv-1"})(["position:relative;flex:1;"]),AH=B.ul.withConfig({displayName:"DropDownWrapperWrapper",componentId:"sc-1ruz3jv-2"})(["margin-bottom:0;"]),TH=B.div.withConfig({displayName:"DropDownWrapper",componentId:"sc-1ruz3jv-3"})(["display:flex;flex-direction:column;background-color:",";border:solid 1px ",";border-radius:",";box-shadow:",";position:absolute;z-index:",";max-height:30rem;overflow-y:auto;left:0;right:0;min-width:10rem;"],e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.theme.radius,e=>e.theme.boxShadowIntense,e=>e.theme.zIndex.dropdown),T4=B.li.withConfig({displayName:"DropDownItem",componentId:"sc-1ruz3jv-4"})(["display:flex;flex-direction:row;border-bottom:solid 1px ",";cursor:pointer;margin:0;padding:0.3rem;text-decoration:",";"," ",""],e=>e.theme.colors.bg2,e=>e.selected?"underline":"none",e=>e.selected&&er(["background-color:",";color:",";"],t=>t.theme.colors.main,t=>t.theme.colors.bg),e=>!e.useKeys&&er(["&:hover,&:active,&:focus{background-color:",";color:",";}"],t=>t.theme.colors.main,t=>t.theme.colors.bg)),PH=B.div.withConfig({displayName:"DropDownMini",componentId:"sc-1ruz3jv-5"})(["display:inline-flex;margin-bottom:1rem;flex:1;max-width:20rem;"]),IH=B.span.withConfig({displayName:"NewItemName",componentId:"sc-1ruz3jv-6"})(["font-style:italic;margin-left:1ch;"]),OH=B(JN).withConfig({displayName:"StyledInputOverlay",componentId:"sc-1ruz3jv-7"})(["a{width:100%;height:2rem;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"]);function u_(e){const t=w.useRef(!1);w.useEffect(()=>{if(!t.current)return t.current=!0,e()},[])}const c_=(e,t=()=>{})=>{const n=We(),[r,i]=w.useState(!1),[o,a]=w.useState(void 0);return[w.useCallback(async u=>{u.preventDefault(),i(!0),a(void 0);try{await e.save(n),i(!1),t(),dt.success("Resource saved"),e.new&&n.notifyResourceManuallyCreated(e)}catch(l){a(l),i(!1),dt.error("Could not save resource")}},[e,n]),r,o]};function LH(e){return e.error?e.subject.split("/").pop()||"error":e.shortname}function Pr({handleDelete:e,propertyURL:t,resource:n,required:r,autoFocus:i,disabled:o,label:a}){const s=Lu(t),[u,l]=w.useState(!0);if(s===null)return f(ii,{label:a||"loading...",children:f(un,{children:f(Jn,{disabled:o,placeholder:"loading property..."})})});const c=a||s.error?LH(s):s.shortname;return s.isDynamic&&u?O(ii,{helper:f(P4,{text:s.description,link:s.subject}),label:c,disabled:o,children:["This field is calculated server-side, edits will not be saved. ",f(ve,{subtle:!0,onClick:()=>l(!1),children:"edit anyway"})]}):f(ii,{helper:f(P4,{text:s.description,link:s.subject}),label:c,handleDelete:e,required:r,disabled:o,children:f(_7,{"data-test":`input-${s.shortname}`,resource:n,property:s,required:r,autoFocus:i,disabled:o},t+" input-switcher")})}const DH=B.div.withConfig({displayName:"HelperTextWraper",componentId:"sc-1m1no8k-0"})(["position:relative;margin-bottom:0rem;"]);function P4({text:e,link:t}){return O(DH,{children:[f(Gt,{text:e}),f(Ve,{subject:t,children:t})]})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -351,23 +351,23 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */function $u(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})}function Uu(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function EU(){for(var e=[],t=0;t0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function AU(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=RU.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var TU=[".DS_Store","Thumbs.db"];function PU(e){return $u(this,void 0,void 0,function(){return Uu(this,function(t){return[2,IU(e)&&e.dataTransfer?DU(e.dataTransfer,e.type):OU(e)]})})}function IU(e){return!!e.dataTransfer}function OU(e){var t=LU(e.target)?e.target.files?x1(e.target.files):[]:[];return t.map(function(n){return op(n)})}function LU(e){return e!==null}function DU(e,t){return $u(this,void 0,void 0,function(){var n,r;return Uu(this,function(i){switch(i.label){case 0:return e.items?(n=x1(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(MU))]):[3,2];case 1:return r=i.sent(),[2,k4(s_(r))];case 2:return[2,k4(x1(e.files).map(function(o){return op(o)}))]}})})}function k4(e){return e.filter(function(t){return TU.indexOf(t.name)===-1})}function x1(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,E4(n)];if(e.sizen)return[!1,E4(n)]}return[!0,null]}function el(e){return e!=null}function YU(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(s){var u=u_(s,n),l=C4(u,1),c=l[0],h=c_(s,r,i),p=C4(h,1),y=p[0];return c&&y})}function Sf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ic(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function A4(e){e.preventDefault()}function XU(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function QU(e){return e.indexOf("Edge/")!==-1}function JU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return XU(e)||QU(e)}function hi(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cH(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Gy=w.forwardRef(function(e,t){var n=e.children,r=kf(e,ZU),i=ap(r),o=i.open,a=kf(i,eH);return w.useImperativeHandle(t,function(){return{open:o}},[o]),f(be,{children:n(Tt(Tt({},a),{},{open:o}))})});Gy.displayName="Dropzone";var f_={disabled:!1,getFilesFromEvent:PU,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null};Gy.defaultProps=f_;Gy.propTypes={children:ie.func,accept:ie.oneOfType([ie.string,ie.arrayOf(ie.string)]),multiple:ie.bool,preventDropOnDocument:ie.bool,noClick:ie.bool,noKeyboard:ie.bool,noDrag:ie.bool,noDragEventsBubbling:ie.bool,minSize:ie.number,maxSize:ie.number,maxFiles:ie.number,disabled:ie.bool,getFilesFromEvent:ie.func,onFileDialogCancel:ie.func,onDragEnter:ie.func,onDragLeave:ie.func,onDragOver:ie.func,onDrop:ie.func,onDropAccepted:ie.func,onDropRejected:ie.func,validator:ie.func};var h_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function ap(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Tt(Tt({},f_),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,u=t.maxFiles,l=t.onDragEnter,c=t.onDragLeave,h=t.onDragOver,p=t.onDrop,y=t.onDropAccepted,g=t.onDropRejected,b=t.onFileDialogCancel,_=t.preventDropOnDocument,S=t.noClick,k=t.noKeyboard,C=t.noDrag,d=t.noDragEventsBubbling,v=t.validator,m=w.useRef(null),x=w.useRef(null),A=w.useReducer(dH,h_),L=fg(A,2),P=L[0],O=L[1],V=P.isFocused,H=P.isFileDialogActive,j=P.draggedFiles,F=w.useCallback(function(){x.current&&(O({type:"openDialog"}),x.current.value=null,x.current.click())},[O]),R=function(){H&&setTimeout(function(){if(x.current){var Re=x.current.files;Re.length||(O({type:"closeDialog"}),typeof b=="function"&&b())}},300)};w.useEffect(function(){return window.addEventListener("focus",R,!1),function(){window.removeEventListener("focus",R,!1)}},[x,H,b]);var q=w.useCallback(function(ae){!m.current||!m.current.isEqualNode(ae.target)||(ae.keyCode===32||ae.keyCode===13)&&(ae.preventDefault(),F())},[m,x]),$=w.useCallback(function(){O({type:"focus"})},[]),K=w.useCallback(function(){O({type:"blur"})},[]),ee=w.useCallback(function(){S||(JU()?setTimeout(F,0):F())},[x,S]),D=w.useRef([]),I=function(Re){m.current&&m.current.contains(Re.target)||(Re.preventDefault(),D.current=[])};w.useEffect(function(){return _&&(document.addEventListener("dragover",A4,!1),document.addEventListener("drop",I,!1)),function(){_&&(document.removeEventListener("dragover",A4),document.removeEventListener("drop",I))}},[m,_]);var re=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae),D.current=[].concat(rH(D.current),[ae.target]),Ic(ae)&&Promise.resolve(i(ae)).then(function(Re){Sf(ae)&&!d||(O({draggedFiles:Re,isDragActive:!0,type:"setDraggedFiles"}),l&&l(ae))})},[i,l,d]),se=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae);var Re=Ic(ae);if(Re&&ae.dataTransfer)try{ae.dataTransfer.dropEffect="copy"}catch{}return Re&&h&&h(ae),!1},[h,d]),he=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae);var Re=D.current.filter(function(ze){return m.current&&m.current.contains(ze)}),nt=Re.indexOf(ae.target);nt!==-1&&Re.splice(nt,1),D.current=Re,!(Re.length>0)&&(O({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Ic(ae)&&c&&c(ae))},[m,c,d]),W=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae),D.current=[],Ic(ae)&&Promise.resolve(i(ae)).then(function(Re){if(!(Sf(ae)&&!d)){var nt=[],ze=[];Re.forEach(function(gt){var zt=u_(gt,n),wt=fg(zt,2),Ee=wt[0],rt=wt[1],tr=c_(gt,a,o),Ht=fg(tr,2),X=Ht[0],ce=Ht[1],Te=v?v(gt):null;if(Ee&&X&&!Te)nt.push(gt);else{var Be=[rt,ce];Te&&(Be=Be.concat(Te)),ze.push({file:gt,errors:Be.filter(function(Xt){return Xt})})}}),(!s&&nt.length>1||s&&u>=1&&nt.length>u)&&(nt.forEach(function(gt){ze.push({file:gt,errors:[GU]})}),nt.splice(0)),O({acceptedFiles:nt,fileRejections:ze,type:"setFiles"}),p&&p(nt,ze,ae),ze.length>0&&g&&g(ze,ae),nt.length>0&&y&&y(nt,ae)}}),O({type:"reset"})},[s,n,a,o,u,i,p,y,g,d,v]),ge=function(Re){return r?null:Re},te=function(Re){return k?null:ge(Re)},Oe=function(Re){return C?null:ge(Re)},pe=function(Re){d&&Re.stopPropagation()},Ne=w.useMemo(function(){return function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=ae.refKey,nt=Re===void 0?"ref":Re,ze=ae.onKeyDown,gt=ae.onFocus,zt=ae.onBlur,wt=ae.onClick,Ee=ae.onDragEnter,rt=ae.onDragOver,tr=ae.onDragLeave,Ht=ae.onDrop,X=kf(ae,tH);return Tt(Tt(_1({onKeyDown:te(hi(ze,q)),onFocus:te(hi(gt,$)),onBlur:te(hi(zt,K)),onClick:ge(hi(wt,ee)),onDragEnter:Oe(hi(Ee,re)),onDragOver:Oe(hi(rt,se)),onDragLeave:Oe(hi(tr,he)),onDrop:Oe(hi(Ht,W))},nt,m),!r&&!k?{tabIndex:0}:{}),X)}},[m,q,$,K,ee,re,se,he,W,k,C,r]),xe=w.useCallback(function(ae){ae.stopPropagation()},[]),Ge=w.useMemo(function(){return function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=ae.refKey,nt=Re===void 0?"ref":Re,ze=ae.onChange,gt=ae.onClick,zt=kf(ae,nH),wt=_1({accept:n,multiple:s,type:"file",style:{display:"none"},onChange:ge(hi(ze,W)),onClick:ge(hi(gt,xe)),autoComplete:"off",tabIndex:-1},nt,x);return Tt(Tt({},wt),zt)}},[x,n,s,W,r]),Ve=j.length,De=Ve>0&&YU({files:j,accept:n,minSize:a,maxSize:o,multiple:s,maxFiles:u}),Ye=Ve>0&&!De;return Tt(Tt({},P),{},{isDragAccept:De,isDragReject:Ye,isFocused:V&&!r,getRootProps:Ne,getInputProps:Ge,rootRef:m,inputRef:x,open:ge(F)})}function dH(e,t){switch(t.type){case"focus":return Tt(Tt({},e),{},{isFocused:!0});case"blur":return Tt(Tt({},e),{},{isFocused:!1});case"openDialog":return Tt(Tt({},e),{},{isFileDialogActive:!0});case"closeDialog":return Tt(Tt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return Tt(Tt({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return Tt(Tt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Tt({},h_);default:return e}}function fH({subject:e}){const t=Ce(e),[n]=Xe(t);return f(hH,{"data-test":"file-pill",children:f(We,{subject:t.getSubject(),children:f("span",{children:n})})})}const hH=B.div.withConfig({displayName:"FilePillStyled",componentId:"sc-9m28gh-0"})(["display:inline-flex;border:solid 1px ",";border-radius:",";padding:0.4rem;margin-bottom:","rem;margin-right:","rem;"],e=>e.theme.colors.main,e=>e.theme.radius,e=>e.theme.margin,e=>e.theme.margin),pH={commit:!0};function Yy(e){const t=Ke(),[n,r]=w.useState(!1),[i,o]=w.useState(void 0),[a,s]=it(e,G.subResources,pH);return{upload:w.useCallback(async l=>{try{o(void 0),r(!0);const h=[...await t.uploadFiles(l,e.getSubject())];return r(!1),s([...a,...h]),h}catch(c){return o(new ur(c==null?void 0:c.message)),r(!1),[]}},[e,t,s,a]),isUploading:n,error:i}}function p_({parentResource:e}){const[t,n]=w.useState([]),{upload:r,isUploading:i,error:o}=Yy(e),a=w.useCallback(async c=>{const h=await r(c);n(h)},[r]),{getRootProps:s,getInputProps:u,isDragActive:l}=ap({onDrop:a});return e.new?f("p",{children:"You can add attachments after saving the resource."}):M("div",{children:[M("div",{...s(),children:[f("input",{...u()}),l?f("p",{children:"Drop the files here ..."}):f(ve,{subtle:!0,onClick:()=>null,loading:i?"Uploading...":void 0,children:"Upload file(s)..."}),o&&f(xt,{children:o.message})]}),t.length>0&&t.map(c=>f(fH,{subject:c},c))]})}const mH=B.div.withConfig({displayName:"Gutter",componentId:"sc-j1ggz1-0"})(["height:","rem;"],e=>e.theme.margin);var m_=(e=>(e[e.Default=0]="Default",e[e.Dialog=1]="Dialog",e))(m_||{});const gH=[G.isA,G.parent,G.read,G.write];function sp({classSubject:e,resource:t,variant:n}){const[r]=it(t,G.isA);e===void 0&&(r==null?void 0:r.length)>0&&(e=r[0]);const i=Ce(e),[o]=it(i,G.requires),[a]=it(i,G.recommends),[s]=ye(i,G.isA),[u,l]=w.useState(void 0),c=_t(),[h,p]=w.useState(void 0),[y,g]=w.useState([]),[b,_]=w.useState([]),[S,k]=w.useState(!1),C=Ke(),d=t.new,[v,m,x]=a_(t,()=>{d&&C.notifyResourceManuallyCreated(t),c($t(t.getSubject()))}),A=iu(t,5e3),[L,P]=Wi(A);if(w.useEffect(()=>{const j=Array.from(t.getPropVals().keys()).filter(F=>{const R=!(o.includes(F)||a.includes(F)||y.includes(F)),q=!gH.includes(F);return R&&q});_(j.concat(y))},[t,y,o.length,a.length]),!t.new&&t.loading)return f(be,{children:"Loading resource..."});if(t.error)return f(xt,{children:t.error.message});if(i.loading)return f(be,{children:"Loading class..."});if(s&&s!==Ue.class)return M(xt,{children:[e," is not a Class. Only resources with valid classes can be created or edited at this moment."]});function O(){if(l(void 0),!dn.isValidSubject(h)){l(new Error("Invalid URL"));return}h&&(y.includes(h)||o.includes(h)||a.includes(h)?l(new Error("That property already exists in this resource. It can only be added once.")):g(y.concat(h)),p(void 0))}function V(H){t.removePropVal(H),g(y.filter(j=>j!==H))}return M("form",{about:t.getSubject(),onSubmit:v,children:[e&&i.error&&M(xt,{children:["Error in class, so this form could miss properties. You can still edit the resource, though. Error message: `",i.error.message,"`"]}),P&&M(xt,{children:["Cannot save edits: ",P]}),o.map(H=>f(Rr,{propertyURL:H,resource:t,required:!0},H+" field")),a.map(H=>f(Rr,{propertyURL:H,resource:t},H+" field")),b.map(H=>f(Rr,{propertyURL:H,resource:t,handleDelete:()=>V(H)},H+" field")),M(ni,{label:"add another property...",helper:"In Atomic Data, any Resource could have any single Property. Use this field to add new property-value combinations to your resource.",children:[M(vH,{children:[f(ve,{subtle:!0,disabled:!h,onClick:O,title:"Add this property",children:f(ui,{})}),f(Hu,{value:void 0,setSubject:(H,j)=>{p(H)},error:u,setError:l,classType:J.classes.property})]}),u&&f(xt,{children:u.message})]}),f(p_,{parentResource:t}),f(mH,{}),f(ve,{title:"show / hide advanced form fields",clean:!0,style:{display:"flex",marginBottom:"1rem",alignItems:"center"},onClick:()=>k(!S),children:M(Ut,{as:"strong",gap:"0.4rem",center:!0,children:[S?f(wy,{}):f(Sy,{})," Advanced Options"]})}),M(Ty,{open:S,children:[f(Rr,{propertyURL:G.isA,resource:t}),f(Rr,{propertyURL:G.parent,resource:t}),f(Rr,{propertyURL:G.write,resource:t}),f(Rr,{propertyURL:G.read,resource:t})]}),n!==1&&M(be,{children:[x&&f(xt,{children:x.message}),f(ve,{disabled:m,"data-test":"save",type:"submit",children:m?"wait...":"save"})]})]})}sp.defaultProps={variant:0};const vH=B.div.withConfig({displayName:"PropertyAdder",componentId:"sc-42hey8-0"})(["display:flex;flex-direction:row;"]);var g_=(e=>(e[e.FullPage=0]="FullPage",e[e.Dialog=1]="Dialog",e))(g_||{});const yH=new Map([[0,"h2"],[1,"h1"]]),v_=({classSubject:e,variant:t})=>{const n=Ce(e),[r]=Xe(n),[i]=ye(n,G.description),[o,a]=w.useState(!1),s=yH.get(t)??"h2";return M(be,{children:[M(s,{children:["new"," ",e?f(We,{subject:e,children:r}):"Resource",f(ve,{onClick:()=>a(!o),icon:!0,subtle:!o,title:"Toggle show Class details",children:f($h,{})})]}),o&&i&&f(Gt,{text:i})]})},y_=({error:e,value:t,onChange:n})=>f(ni,{error:e,label:"subject",helper:"The identifier of the resource. This also determines where the resource is saved, by default.",children:f(un,{children:f(Xn,{value:t,onChange:r=>n(r.target.value),placeholder:"URL of the new resource..."})})}),bH={newResource:!0},b_=e=>{const{klass:t,setSubject:n,initialSubject:r,parent:i}=e,o=Ke(),[a]=ye(t,G.shortname),[s,u]=w.useState(()=>r===void 0?o.createSubject(a):r),[l,c]=w.useState(void 0),h=Ce(s,bH),[p,y]=ye(h,G.parent),[g,b]=it(h,G.isA);w.useEffect(()=>{p!==i&&y(i),g.length===0&&b([t.getSubject()])},[h,i]);async function _(S){if(u(S),c(void 0),n(S),h.get(G.parent)===i)try{await o.renameSubject(h,S)}catch(k){c(k)}}return{subjectErr:l,subjectValue:s,setSubjectValue:_,resource:h}},wH=({classSubject:e,closeDialog:t,initialTitle:n,onSave:r,parent:i})=>{const o=Ce(e),[a]=Xe(o),s=Ke(),[u]=w.useState(n),[l,c]=w.useState(s.createSubject()),{subjectErr:h,subjectValue:p,setSubjectValue:y,resource:g}=b_({klass:o,setSubject:c,initialSubject:l,parent:i}),b=w.useCallback(()=>{r(g.getSubject()),t()},[r,t,g]);o_(()=>{s.buildUniqueSubjectFromParts(a,u).then(C=>{y(C)}),g.set(G.shortname,u,s)});const[_,S,k]=a_(g,b);return i?M(be,{children:[f(Ux,{children:f(v_,{classSubject:e,variant:g_.Dialog})}),M(Hx,{children:[f(y_,{error:h,value:p,onChange:y}),f(sp,{resource:g,classSubject:e,variant:m_.Dialog},`${e}+${p}`)]}),M(Wx,{children:[k&&f($M,{children:k.message}),f(ve,{subtle:!0,onClick:t,children:"Cancel"}),f(ve,{onClick:_,disabled:S,children:"Save"})]})]}):f(Nt,{children:"No parent set"})},Hu=de.memo(function({required:t,setSubject:n,value:r,handleRemove:i,error:o,setError:a,classType:s,disabled:u,parent:l,...c}){const h=Ce(SH(s));let[p]=it(h,J.properties.collection.members);const y=Ce(s),[g]=Xe(y),b=Ke(),[_,S,k,C]=Bx(),{drive:d}=ot(),[v,m]=w.useState(r||""),x=w.useCallback(O=>{n(O,a)},[n]),A=w.useCallback(()=>{r===void 0&&x(v)},[v,r]),L=w.useContext(jx);p.length===0&&(p=b.getAllSubjects());let P="Enter an Atomic URL...";return s&&(g==null?void 0:g.length)>0&&(P=`Select a ${g} or enter a ${g} URL...`),s&&!y.isReady()&&(P="Loading Class..."),M(kH,{children:[f(i_,{placeholder:P,required:t,onUpdate:x,options:p,onRemove:i,initial:r,disabled:u,classType:s,onCreateClick:S,onInputChange:m,onBlur:A,...c}),r&&r!==""&&o&&f(xt,{children:o==null?void 0:o.message}),!L&&f($x,{..._,children:C&&f(wH,{parent:l||d,classSubject:s,closeDialog:k,initialTitle:v,onSave:x})}),t&&r===""&&f(xt,{children:"Required"})]})});function SH(e){switch(e){case J.classes.property:return"https://atomicdata.dev/properties/?page_size=999";case J.classes.class:return"https://atomicdata.dev/classes/?page_size=999";case J.classes.agent:return"https://atomicdata.dev/agents/";case J.classes.commit:return"https://atomicdata.dev/commits";case J.classes.datatype:return"https://atomicdata.dev/datatypes";default:return}}const kH=B.div.withConfig({displayName:"Wrapper",componentId:"sc-wj1vxi-0"})(["flex:1;--radius:",";","{border-radius:0;}&:first-of-type ","{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius);}&:last-of-type ","{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius);}&:not(:last-of-type) ","{border-bottom:none;}"],e=>e.theme.radius,un,un,un,un);function xH({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=Po(e,t.subject,{handleValidationError:i});return o===kk?f(Nt,{children:"Sorry, there is no support for editing nested resources yet"}):f(Hu,{error:r,setError:i,classType:t.classType,setSubject:a,value:o,parent:e.getSubject(),...n})}function CH({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=it(e,t.subject,{handleValidationError:i}),[s,u]=w.useState(!1);function l(){a([...o,void 0]),u(!0)}function c(){a([]),u(!1)}function h(g){o.splice(g,1);const b=[...o];a(b)}function p(g,b,_){g&&(o[_]=g,a(o),u(!1))}function y(g){if(r&&r.index===g)return r}return M(ai,{children:[o.length>0&&f("div",{children:o.map((g,b)=>f(Hu,{value:g,setSubject:(_,S)=>p(_,S,b),error:y(b),setError:i,classType:t.classType,handleRemove:()=>h(b),parent:e.getSubject(),...n,autoFocus:s&&b===o.length-1},`${t.subject}${b}`))}),M(Ut,{justify:"space-between",children:[f(P4,{disabled:n.disabled,title:"Add an item to this list","data-test":`input-${t.shortname}-add-resource`,subtle:!0,type:"button",onClick:l,children:f(ui,{})}),o.length>1&&f(P4,{disabled:n.disabled,title:"Remove all items from this list","data-test":`input-${t.shortname}-clear`,subtle:!0,type:"button",onClick:c,children:M(Ut,{gap:".5rem",children:[f(Uh,{})," Clear"]})})]}),(r==null?void 0:r.index)&&f(xt,{children:r==null?void 0:r.message})]})}const P4=B(ve).withConfig({displayName:"StyledButton",componentId:"sc-1g11k6t-0"})(["align-self:flex-start;"]);var w_={};function lp(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var _H=!0;function I4(e,t){if(!_H){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var S_={};Object.defineProperty(S_,"__esModule",{value:!0});S_.default=EH;function EH(e){return e.displayName||e.name||(typeof e=="string"&&e.length>0?e:"Unknown")}function Oc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E1(){return E1=Object.assign||function(e){for(var t=1;t"u"?"undefined":O4(window))==="object"&&(typeof document>"u"?"undefined":O4(document))==="object"&&document.nodeType===9;function L4(e,t){for(var n=0;n<+~=|^:(),"'`\s])/g,M4=typeof CSS<"u"&&CSS.escape,Jy=function(e){return M4?M4(e):e.replace(MH,"\\$1")},x_=function(){function e(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,a=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:a&&(this.renderer=new a)}var t=e.prototype;return t.prop=function(r,i,o){if(i===void 0)return this.style[r];var a=o?o.force:!1;if(!a&&this.style[r]===i)return this;var s=i;(!o||o.process!==!1)&&(s=this.options.jss.plugins.onChangeValue(i,r,this));var u=s==null||s===!1,l=r in this.style;if(u&&!l&&!a)return this;var c=u&&l;if(c?delete this.style[r]:this.style[r]=s,this.renderable&&this.renderer)return c?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,s),this;var h=this.options.sheet;return h&&h.attached,this},e}(),A1=function(e){gy(t,e);function t(r,i,o){var a;a=e.call(this,r,i,o)||this;var s=o.selector,u=o.scoped,l=o.sheet,c=o.generateId;return s?a.selectorText=s:u!==!1&&(a.id=c(J0(J0(a)),l),a.selectorText="."+Jy(a.id)),a}var n=t.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var a=this.toJSON();for(var s in a)o.setProperty(i,s,a[s])}return this},n.toJSON=function(){var i={};for(var o in this.style){var a=this.style[o];typeof a!="object"?i[o]=a:Array.isArray(a)&&(i[o]=sa(a))}return i},n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?lt({},i,{allowEmpty:!0}):i;return hu(this.selectorText,this.style,s)},Qy(t,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,a=this.renderable;if(!(!a||!o)){var s=o.setSelector(a,i);s||o.replaceRule(a,this)}}},get:function(){return this.selectorText}}]),t}(x_),NH={onCreateRule:function(t,n,r){return t[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new A1(t,n,r)}},hg={indent:1,children:!0},zH=/@([\w-]+)/,jH=function(){function e(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(zH);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new dp(lt({},i,{parent:this}));for(var a in r)this.rules.add(a,r[a]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.indexOf=function(r){return this.rules.indexOf(r)},t.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a?(this.options.jss.plugins.onProcessRule(a),a):null},t.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},t.toString=function(r){r===void 0&&(r=hg);var i=Ts(r),o=i.linebreak;if(r.indent==null&&(r.indent=hg.indent),r.children==null&&(r.children=hg.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+o+a+o+"}":""},e}(),BH=/@media|@supports\s+/,FH={onCreateRule:function(t,n,r){return BH.test(t)?new jH(t,n,r):null}},pg={indent:1,children:!0},$H=/@keyframes\s+([\w-]+)/,T1=function(){function e(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match($H);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var a=i.scoped,s=i.sheet,u=i.generateId;this.id=a===!1?this.name:Jy(u(this,s)),this.rules=new dp(lt({},i,{parent:this}));for(var l in r)this.rules.add(l,r[l],lt({},i,{parent:this}));this.rules.process()}var t=e.prototype;return t.toString=function(r){r===void 0&&(r=pg);var i=Ts(r),o=i.linebreak;if(r.indent==null&&(r.indent=pg.indent),r.children==null&&(r.children=pg.children),r.children===!1)return this.at+" "+this.id+" {}";var a=this.rules.toString(r);return a&&(a=""+o+a+o),this.at+" "+this.id+" {"+a+"}"},e}(),UH=/@keyframes\s+/,HH=/\$([\w-]+)/g,P1=function(t,n){return typeof t=="string"?t.replace(HH,function(r,i){return i in n?n[i]:r}):t},N4=function(t,n,r){var i=t[n],o=P1(i,r);o!==i&&(t[n]=o)},WH={onCreateRule:function(t,n,r){return typeof t=="string"&&UH.test(t)?new T1(t,n,r):null},onProcessStyle:function(t,n,r){return n.type!=="style"||!r||("animation-name"in t&&N4(t,"animation-name",r.keyframes),"animation"in t&&N4(t,"animation",r.keyframes)),t},onChangeValue:function(t,n,r){var i=r.options.sheet;if(!i)return t;switch(n){case"animation":return P1(t,i.keyframes);case"animation-name":return P1(t,i.keyframes);default:return t}}},VH=function(e){gy(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?lt({},i,{allowEmpty:!0}):i;return hu(this.key,this.style,s)},t}(x_),qH={onCreateRule:function(t,n,r){return r.parent&&r.parent.type==="keyframes"?new VH(t,n,r):null}},KH=function(){function e(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var t=e.prototype;return t.toString=function(r){var i=Ts(r),o=i.linebreak;if(Array.isArray(this.style)){for(var a="",s=0;s=this.index){i.push(r);return}for(var a=0;ao){i.splice(a,0,r);return}}},t.reset=function(){this.registry=[]},t.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},t.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,a=lp(i,["attached"]),s=Ts(a),u=s.linebreak,l="",c=0;ct.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}function lW(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}function uW(e){for(var t=R_(),n=0;n0){var n=sW(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=lW(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&typeof r=="string"){var i=uW(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function dW(e,t){var n=t.insertionPoint,r=cW(t);if(r!==!1&&r.parent){r.parent.insertBefore(e,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling);return}R_().appendChild(e)}var fW=E_(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),F4=function(t,n,r){try{"insertRule"in t?t.insertRule(n,r):"appendRule"in t&&t.appendRule(n)}catch{return!1}return t.cssRules[r]},$4=function(t,n){var r=t.cssRules.length;return n===void 0||n>r?r:n},hW=function(){var t=document.createElement("style");return t.textContent=` -`,t},pW=function(){function e(n){this.getPropertyValue=rW,this.setProperty=iW,this.removeProperty=oW,this.setSelector=aW,this.hasInsertedRules=!1,this.cssRules=[],n&&Pl.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,a=r.element;this.element=a||hW(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=fW();s&&this.element.setAttribute("nonce",s)}var t=e.prototype;return t.attach=function(){if(!(this.element.parentNode||!this.sheet)){dW(this.element,this.sheet.options);var r=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` +***************************************************************************** */function Vu(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})}function Wu(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function MH(){for(var e=[],t=0;t0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function jH(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=zH.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var BH=[".DS_Store","Thumbs.db"];function FH(e){return Vu(this,void 0,void 0,function(){return Wu(this,function(t){return[2,$H(e)&&e.dataTransfer?VH(e.dataTransfer,e.type):HH(e)]})})}function $H(e){return!!e.dataTransfer}function HH(e){var t=UH(e.target)?e.target.files?C1(e.target.files):[]:[];return t.map(function(n){return ap(n)})}function UH(e){return e!==null}function VH(e,t){return Vu(this,void 0,void 0,function(){var n,r;return Wu(this,function(i){switch(i.label){case 0:return e.items?(n=C1(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(WH))]):[3,2];case 1:return r=i.sent(),[2,I4(d_(r))];case 2:return[2,I4(C1(e.files).map(function(o){return ap(o)}))]}})})}function I4(e){return e.filter(function(t){return BH.indexOf(t.name)===-1})}function C1(e){for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,N4(n)];if(e.sizen)return[!1,N4(n)]}return[!0,null]}function tl(e){return e!=null}function oU(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(s){var u=h_(s,n),l=L4(u,1),c=l[0],h=p_(s,r,i),p=L4(h,1),y=p[0];return c&&y})}function xf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Lc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function z4(e){e.preventDefault()}function aU(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function sU(e){return e.indexOf("Edge/")!==-1}function lU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return aU(e)||sU(e)}function hi(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wU(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var t2=w.forwardRef(function(e,t){var n=e.children,r=Cf(e,uU),i=sp(r),o=i.open,a=Cf(i,cU);return w.useImperativeHandle(t,function(){return{open:o}},[o]),f(ye,{children:n(Pt(Pt({},a),{},{open:o}))})});t2.displayName="Dropzone";var g_={disabled:!1,getFilesFromEvent:FH,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null};t2.defaultProps=g_;t2.propTypes={children:ie.func,accept:ie.oneOfType([ie.string,ie.arrayOf(ie.string)]),multiple:ie.bool,preventDropOnDocument:ie.bool,noClick:ie.bool,noKeyboard:ie.bool,noDrag:ie.bool,noDragEventsBubbling:ie.bool,minSize:ie.number,maxSize:ie.number,maxFiles:ie.number,disabled:ie.bool,getFilesFromEvent:ie.func,onFileDialogCancel:ie.func,onDragEnter:ie.func,onDragLeave:ie.func,onDragOver:ie.func,onDrop:ie.func,onDropAccepted:ie.func,onDropRejected:ie.func,validator:ie.func};var v_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function sp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pt(Pt({},g_),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,u=t.maxFiles,l=t.onDragEnter,c=t.onDragLeave,h=t.onDragOver,p=t.onDrop,y=t.onDropAccepted,g=t.onDropRejected,b=t.onFileDialogCancel,_=t.preventDropOnDocument,S=t.noClick,k=t.noKeyboard,C=t.noDrag,d=t.noDragEventsBubbling,v=t.validator,m=w.useRef(null),x=w.useRef(null),A=w.useReducer(SU,v_),D=hg(A,2),P=D[0],L=D[1],W=P.isFocused,U=P.isFileDialogActive,j=P.draggedFiles,F=w.useCallback(function(){x.current&&(L({type:"openDialog"}),x.current.value=null,x.current.click())},[L]),R=function(){U&&setTimeout(function(){if(x.current){var Re=x.current.files;Re.length||(L({type:"closeDialog"}),typeof b=="function"&&b())}},300)};w.useEffect(function(){return window.addEventListener("focus",R,!1),function(){window.removeEventListener("focus",R,!1)}},[x,U,b]);var q=w.useCallback(function(ae){!m.current||!m.current.isEqualNode(ae.target)||(ae.keyCode===32||ae.keyCode===13)&&(ae.preventDefault(),F())},[m,x]),$=w.useCallback(function(){L({type:"focus"})},[]),K=w.useCallback(function(){L({type:"blur"})},[]),ee=w.useCallback(function(){S||(lU()?setTimeout(F,0):F())},[x,S]),N=w.useRef([]),I=function(Re){m.current&&m.current.contains(Re.target)||(Re.preventDefault(),N.current=[])};w.useEffect(function(){return _&&(document.addEventListener("dragover",z4,!1),document.addEventListener("drop",I,!1)),function(){_&&(document.removeEventListener("dragover",z4),document.removeEventListener("drop",I))}},[m,_]);var re=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae),N.current=[].concat(hU(N.current),[ae.target]),Lc(ae)&&Promise.resolve(i(ae)).then(function(Re){xf(ae)&&!d||(L({draggedFiles:Re,isDragActive:!0,type:"setDraggedFiles"}),l&&l(ae))})},[i,l,d]),se=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae);var Re=Lc(ae);if(Re&&ae.dataTransfer)try{ae.dataTransfer.dropEffect="copy"}catch{}return Re&&h&&h(ae),!1},[h,d]),he=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae);var Re=N.current.filter(function(ze){return m.current&&m.current.contains(ze)}),nt=Re.indexOf(ae.target);nt!==-1&&Re.splice(nt,1),N.current=Re,!(Re.length>0)&&(L({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Lc(ae)&&c&&c(ae))},[m,c,d]),V=w.useCallback(function(ae){ae.preventDefault(),ae.persist(),pe(ae),N.current=[],Lc(ae)&&Promise.resolve(i(ae)).then(function(Re){if(!(xf(ae)&&!d)){var nt=[],ze=[];Re.forEach(function(gt){var jt=h_(gt,n),wt=hg(jt,2),Ee=wt[0],rt=wt[1],rr=p_(gt,a,o),Ut=hg(rr,2),X=Ut[0],ce=Ut[1],Te=v?v(gt):null;if(Ee&&X&&!Te)nt.push(gt);else{var Be=[rt,ce];Te&&(Be=Be.concat(Te)),ze.push({file:gt,errors:Be.filter(function(Xt){return Xt})})}}),(!s&&nt.length>1||s&&u>=1&&nt.length>u)&&(nt.forEach(function(gt){ze.push({file:gt,errors:[iU]})}),nt.splice(0)),L({acceptedFiles:nt,fileRejections:ze,type:"setFiles"}),p&&p(nt,ze,ae),ze.length>0&&g&&g(ze,ae),nt.length>0&&y&&y(nt,ae)}}),L({type:"reset"})},[s,n,a,o,u,i,p,y,g,d,v]),ge=function(Re){return r?null:Re},te=function(Re){return k?null:ge(Re)},Oe=function(Re){return C?null:ge(Re)},pe=function(Re){d&&Re.stopPropagation()},Me=w.useMemo(function(){return function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=ae.refKey,nt=Re===void 0?"ref":Re,ze=ae.onKeyDown,gt=ae.onFocus,jt=ae.onBlur,wt=ae.onClick,Ee=ae.onDragEnter,rt=ae.onDragOver,rr=ae.onDragLeave,Ut=ae.onDrop,X=Cf(ae,dU);return Pt(Pt(E1({onKeyDown:te(hi(ze,q)),onFocus:te(hi(gt,$)),onBlur:te(hi(jt,K)),onClick:ge(hi(wt,ee)),onDragEnter:Oe(hi(Ee,re)),onDragOver:Oe(hi(rt,se)),onDragLeave:Oe(hi(rr,he)),onDrop:Oe(hi(Ut,V))},nt,m),!r&&!k?{tabIndex:0}:{}),X)}},[m,q,$,K,ee,re,se,he,V,k,C,r]),xe=w.useCallback(function(ae){ae.stopPropagation()},[]),Ye=w.useMemo(function(){return function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=ae.refKey,nt=Re===void 0?"ref":Re,ze=ae.onChange,gt=ae.onClick,jt=Cf(ae,fU),wt=E1({accept:n,multiple:s,type:"file",style:{display:"none"},onChange:ge(hi(ze,V)),onClick:ge(hi(gt,xe)),autoComplete:"off",tabIndex:-1},nt,x);return Pt(Pt({},wt),jt)}},[x,n,s,V,r]),Ke=j.length,De=Ke>0&&oU({files:j,accept:n,minSize:a,maxSize:o,multiple:s,maxFiles:u}),Xe=Ke>0&&!De;return Pt(Pt({},P),{},{isDragAccept:De,isDragReject:Xe,isFocused:W&&!r,getRootProps:Me,getInputProps:Ye,rootRef:m,inputRef:x,open:ge(F)})}function SU(e,t){switch(t.type){case"focus":return Pt(Pt({},e),{},{isFocused:!0});case"blur":return Pt(Pt({},e),{},{isFocused:!1});case"openDialog":return Pt(Pt({},e),{},{isFileDialogActive:!0});case"closeDialog":return Pt(Pt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return Pt(Pt({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return Pt(Pt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Pt({},v_);default:return e}}function kU({subject:e}){const t=Ce(e),[n]=qe(t);return f(xU,{"data-test":"file-pill",children:f(Ve,{subject:t.getSubject(),children:f("span",{children:n})})})}const xU=B.div.withConfig({displayName:"FilePillStyled",componentId:"sc-9m28gh-0"})(["display:inline-flex;border:solid 1px ",";border-radius:",";padding:0.4rem;margin-bottom:","rem;margin-right:","rem;"],e=>e.theme.colors.main,e=>e.theme.radius,e=>e.theme.margin,e=>e.theme.margin),CU={commit:!0};function n2(e){const t=We(),[n,r]=w.useState(!1),[i,o]=w.useState(void 0),[a,s]=it(e,G.subResources,CU);return{upload:w.useCallback(async l=>{try{o(void 0),r(!0);const h=[...await t.uploadFiles(l,e.getSubject())];return r(!1),s([...a,...h]),h}catch(c){return o(new dr(c==null?void 0:c.message)),r(!1),[]}},[e,t,s,a]),isUploading:n,error:i}}function y_({parentResource:e}){const[t,n]=w.useState([]),{upload:r,isUploading:i,error:o}=n2(e),a=w.useCallback(async c=>{const h=await r(c);n(h)},[r]),{getRootProps:s,getInputProps:u,isDragActive:l}=sp({onDrop:a});return e.new?f("p",{children:"You can add attachments after saving the resource."}):O("div",{children:[O("div",{...s(),children:[f("input",{...u()}),l?f("p",{children:"Drop the files here ..."}):f(ve,{subtle:!0,onClick:()=>null,loading:i?"Uploading...":void 0,children:"Upload file(s)..."}),o&&f(xt,{children:o.message})]}),t.length>0&&t.map(c=>f(kU,{subject:c},c))]})}const _U=B.div.withConfig({displayName:"Gutter",componentId:"sc-j1ggz1-0"})(["height:","rem;"],e=>e.theme.margin);var b_=(e=>(e[e.Default=0]="Default",e[e.Dialog=1]="Dialog",e))(b_||{});const EU=[G.isA,G.parent,G.read,G.write];function lp({classSubject:e,resource:t,variant:n}){const[r]=it(t,G.isA);e===void 0&&(r==null?void 0:r.length)>0&&(e=r[0]);const i=Ce(e),[o]=it(i,G.requires),[a]=it(i,G.recommends),[s]=be(i,G.isA),[u,l]=w.useState(void 0),c=Et(),[h,p]=w.useState(void 0),[y,g]=w.useState([]),[b,_]=w.useState([]),[S,k]=w.useState(!1),C=We(),d=t.new,[v,m,x]=c_(t,()=>{d&&C.notifyResourceManuallyCreated(t),c(zt(t.getSubject()))}),A=ou(t,5e3),[D,P]=Wi(A);if(w.useEffect(()=>{const j=Array.from(t.getPropVals().keys()).filter(F=>{const R=!(o.includes(F)||a.includes(F)||y.includes(F)),q=!EU.includes(F);return R&&q});_(j.concat(y))},[t,y,o.length,a.length]),!t.new&&t.loading)return f(ye,{children:"Loading resource..."});if(t.error)return f(xt,{children:t.error.message});if(i.loading)return f(ye,{children:"Loading class..."});if(s&&s!==He.class)return O(xt,{children:[e," is not a Class. Only resources with valid classes can be created or edited at this moment."]});function L(){if(l(void 0),!dn.isValidSubject(h)){l(new Error("Invalid URL"));return}h&&(y.includes(h)||o.includes(h)||a.includes(h)?l(new Error("That property already exists in this resource. It can only be added once.")):g(y.concat(h)),p(void 0))}function W(U){t.removePropVal(U),g(y.filter(j=>j!==U))}return O("form",{about:t.getSubject(),onSubmit:v,children:[e&&i.error&&O(xt,{children:["Error in class, so this form could miss properties. You can still edit the resource, though. Error message: `",i.error.message,"`"]}),P&&O(xt,{children:["Cannot save edits: ",P]}),o.map(U=>f(Pr,{propertyURL:U,resource:t,required:!0},U+" field")),a.map(U=>f(Pr,{propertyURL:U,resource:t},U+" field")),b.map(U=>f(Pr,{propertyURL:U,resource:t,handleDelete:()=>W(U)},U+" field")),O(ii,{label:"add another property...",helper:"In Atomic Data, any Resource could have any single Property. Use this field to add new property-value combinations to your resource.",children:[O(RU,{children:[f(ve,{subtle:!0,disabled:!h,onClick:L,title:"Add this property",children:f(ui,{})}),f(qu,{value:void 0,setSubject:(U,j)=>{p(U)},error:u,setError:l,classType:Q.classes.property})]}),u&&f(xt,{children:u.message})]}),f(y_,{parentResource:t}),f(_U,{}),f(ve,{title:"show / hide advanced form fields",clean:!0,style:{display:"flex",marginBottom:"1rem",alignItems:"center"},onClick:()=>k(!S),children:O(Ht,{as:"strong",gap:"0.4rem",center:!0,children:[S?f(Sy,{}):f(ky,{})," Advanced Options"]})}),O(Py,{open:S,children:[f(Pr,{propertyURL:G.isA,resource:t}),f(Pr,{propertyURL:G.parent,resource:t}),f(Pr,{propertyURL:G.write,resource:t}),f(Pr,{propertyURL:G.read,resource:t})]}),n!==1&&O(ye,{children:[x&&f(xt,{children:x.message}),f(ve,{disabled:m,"data-test":"save",type:"submit",children:m?"wait...":"save"})]})]})}lp.defaultProps={variant:0};const RU=B.div.withConfig({displayName:"PropertyAdder",componentId:"sc-42hey8-0"})(["display:flex;flex-direction:row;"]);var w_=(e=>(e[e.FullPage=0]="FullPage",e[e.Dialog=1]="Dialog",e))(w_||{});const AU=new Map([[0,"h2"],[1,"h1"]]),S_=({classSubject:e,variant:t})=>{const n=Ce(e),[r]=qe(n),[i]=be(n,G.description),[o,a]=w.useState(!1),s=AU.get(t)??"h2";return O(ye,{children:[O(s,{children:["new"," ",e?f(Ve,{subject:e,children:r}):"Resource",f(ve,{onClick:()=>a(!o),icon:!0,subtle:!o,title:"Toggle show Class details",children:f(Uh,{})})]}),o&&i&&f(Gt,{text:i})]})},k_=({error:e,value:t,onChange:n})=>f(ii,{error:e,label:"subject",helper:"The identifier of the resource. This also determines where the resource is saved, by default.",children:f(un,{children:f(Jn,{value:t,onChange:r=>n(r.target.value),placeholder:"URL of the new resource..."})})}),TU={newResource:!0},x_=e=>{const{klass:t,setSubject:n,initialSubject:r,parent:i}=e,o=We(),[a]=be(t,G.shortname),[s,u]=w.useState(()=>r===void 0?o.createSubject(a):r),[l,c]=w.useState(void 0),h=Ce(s,TU),[p,y]=be(h,G.parent),[g,b]=it(h,G.isA);w.useEffect(()=>{p!==i&&y(i),g.length===0&&b([t.getSubject()])},[h,i]);async function _(S){if(u(S),c(void 0),n(S),h.get(G.parent)===i)try{await o.renameSubject(h,S)}catch(k){c(k)}}return{subjectErr:l,subjectValue:s,setSubjectValue:_,resource:h}},PU=({classSubject:e,closeDialog:t,initialTitle:n,onSave:r,parent:i})=>{const o=Ce(e),[a]=qe(o),s=We(),[u]=w.useState(n),[l,c]=w.useState(s.createSubject()),{subjectErr:h,subjectValue:p,setSubjectValue:y,resource:g}=x_({klass:o,setSubject:c,initialSubject:l,parent:i}),b=w.useCallback(()=>{r(g.getSubject()),t()},[r,t,g]);u_(()=>{s.buildUniqueSubjectFromParts(a,u).then(C=>{y(C)}),g.set(G.shortname,u,s)});const[_,S,k]=c_(g,b);return i?O(ye,{children:[f(By,{children:f(S_,{classSubject:e,variant:w_.Dialog})}),O(Fy,{children:[f(k_,{error:h,value:p,onChange:y}),f(lp,{resource:g,classSubject:e,variant:b_.Dialog},`${e}+${p}`)]}),O($y,{children:[k&&f(QN,{children:k.message}),f(ve,{subtle:!0,onClick:t,children:"Cancel"}),f(ve,{onClick:_,disabled:S,children:"Save"})]})]}):f(Lt,{children:"No parent set"})},qu=de.memo(function({required:t,setSubject:n,value:r,handleRemove:i,error:o,setError:a,classType:s,disabled:u,parent:l,...c}){const h=Ce(IU(s));let[p]=it(h,Q.properties.collection.members);const y=Ce(s),[g]=qe(y),b=We(),[_,S,k,C]=zy(),{drive:d}=ot(),[v,m]=w.useState(r||""),x=w.useCallback(L=>{n(L,a)},[n]),A=w.useCallback(()=>{r===void 0&&x(v)},[v,r]),D=w.useContext(Gx);p.length===0&&(p=b.getAllSubjects());let P="Enter an Atomic URL...";return s&&(g==null?void 0:g.length)>0&&(P=`Select a ${g} or enter a ${g} URL...`),s&&!y.isReady()&&(P="Loading Class..."),O(OU,{children:[f(l_,{placeholder:P,required:t,onUpdate:x,options:p,onRemove:i,initial:r,disabled:u,classType:s,onCreateClick:S,onInputChange:m,onBlur:A,...c}),r&&r!==""&&o&&f(xt,{children:o==null?void 0:o.message}),!D&&f(jy,{..._,children:C&&f(PU,{parent:l||d,classSubject:s,closeDialog:k,initialTitle:v,onSave:x})}),t&&r===""&&f(xt,{children:"Required"})]})});function IU(e){switch(e){case Q.classes.property:return"https://atomicdata.dev/properties/?page_size=999";case Q.classes.class:return"https://atomicdata.dev/classes/?page_size=999";case Q.classes.agent:return"https://atomicdata.dev/agents/";case Q.classes.commit:return"https://atomicdata.dev/commits";case Q.classes.datatype:return"https://atomicdata.dev/datatypes";default:return}}const OU=B.div.withConfig({displayName:"Wrapper",componentId:"sc-wj1vxi-0"})(["flex:1;--radius:",";","{border-radius:0;}&:first-of-type ","{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius);}&:last-of-type ","{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius);}&:not(:last-of-type) ","{border-bottom:none;}"],e=>e.theme.radius,un,un,un,un);function LU({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=Io(e,t.subject,{handleValidationError:i});return o===Lk?f(Lt,{children:"Sorry, there is no support for editing nested resources yet"}):f(qu,{error:r,setError:i,classType:t.classType,setSubject:a,value:o,parent:e.getSubject(),...n})}function DU({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=it(e,t.subject,{handleValidationError:i}),[s,u]=w.useState(!1);function l(){a([...o,void 0]),u(!0)}function c(){a([]),u(!1)}function h(g){o.splice(g,1);const b=[...o];a(b)}function p(g,b,_){g&&(o[_]=g,a(o),u(!1))}function y(g){if(r&&r.index===g)return r}return O(Nn,{children:[o.length>0&&f("div",{children:o.map((g,b)=>f(qu,{value:g,setSubject:(_,S)=>p(_,S,b),error:y(b),setError:i,classType:t.classType,handleRemove:()=>h(b),parent:e.getSubject(),...n,autoFocus:s&&b===o.length-1},`${t.subject}${b}`))}),O(Ht,{justify:"space-between",children:[f(B4,{disabled:n.disabled,title:"Add an item to this list","data-test":`input-${t.shortname}-add-resource`,subtle:!0,type:"button",onClick:l,children:f(ui,{})}),o.length>1&&f(B4,{disabled:n.disabled,title:"Remove all items from this list","data-test":`input-${t.shortname}-clear`,subtle:!0,type:"button",onClick:c,children:O(Ht,{gap:".5rem",children:[f(Vh,{})," Clear"]})})]}),(r==null?void 0:r.index)&&f(xt,{children:r==null?void 0:r.message})]})}const B4=B(ve).withConfig({displayName:"StyledButton",componentId:"sc-1g11k6t-0"})(["align-self:flex-start;"]);var C_={};function up(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var NU=!0;function F4(e,t){if(!NU){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var __={};Object.defineProperty(__,"__esModule",{value:!0});__.default=MU;function MU(e){return e.displayName||e.name||(typeof e=="string"&&e.length>0?e:"Unknown")}function Dc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R1(){return R1=Object.assign||function(e){for(var t=1;t"u"?"undefined":$4(window))==="object"&&(typeof document>"u"?"undefined":$4(document))==="object"&&document.nodeType===9;function H4(e,t){for(var n=0;n<+~=|^:(),"'`\s])/g,V4=typeof CSS<"u"&&CSS.escape,o2=function(e){return V4?V4(e):e.replace(WU,"\\$1")},R_=function(){function e(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,a=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:a&&(this.renderer=new a)}var t=e.prototype;return t.prop=function(r,i,o){if(i===void 0)return this.style[r];var a=o?o.force:!1;if(!a&&this.style[r]===i)return this;var s=i;(!o||o.process!==!1)&&(s=this.options.jss.plugins.onChangeValue(i,r,this));var u=s==null||s===!1,l=r in this.style;if(u&&!l&&!a)return this;var c=u&&l;if(c?delete this.style[r]:this.style[r]=s,this.renderable&&this.renderer)return c?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,s),this;var h=this.options.sheet;return h&&h.attached,this},e}(),T1=function(e){vy(t,e);function t(r,i,o){var a;a=e.call(this,r,i,o)||this;var s=o.selector,u=o.scoped,l=o.sheet,c=o.generateId;return s?a.selectorText=s:u!==!1&&(a.id=c(Z0(Z0(a)),l),a.selectorText="."+o2(a.id)),a}var n=t.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var a=this.toJSON();for(var s in a)o.setProperty(i,s,a[s])}return this},n.toJSON=function(){var i={};for(var o in this.style){var a=this.style[o];typeof a!="object"?i[o]=a:Array.isArray(a)&&(i[o]=sa(a))}return i},n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?lt({},i,{allowEmpty:!0}):i;return pu(this.selectorText,this.style,s)},i2(t,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,a=this.renderable;if(!(!a||!o)){var s=o.setSelector(a,i);s||o.replaceRule(a,this)}}},get:function(){return this.selectorText}}]),t}(R_),qU={onCreateRule:function(t,n,r){return t[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new T1(t,n,r)}},pg={indent:1,children:!0},KU=/@([\w-]+)/,GU=function(){function e(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(KU);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new fp(lt({},i,{parent:this}));for(var a in r)this.rules.add(a,r[a]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.indexOf=function(r){return this.rules.indexOf(r)},t.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a?(this.options.jss.plugins.onProcessRule(a),a):null},t.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},t.toString=function(r){r===void 0&&(r=pg);var i=Is(r),o=i.linebreak;if(r.indent==null&&(r.indent=pg.indent),r.children==null&&(r.children=pg.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+o+a+o+"}":""},e}(),YU=/@media|@supports\s+/,XU={onCreateRule:function(t,n,r){return YU.test(t)?new GU(t,n,r):null}},mg={indent:1,children:!0},QU=/@keyframes\s+([\w-]+)/,P1=function(){function e(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(QU);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var a=i.scoped,s=i.sheet,u=i.generateId;this.id=a===!1?this.name:o2(u(this,s)),this.rules=new fp(lt({},i,{parent:this}));for(var l in r)this.rules.add(l,r[l],lt({},i,{parent:this}));this.rules.process()}var t=e.prototype;return t.toString=function(r){r===void 0&&(r=mg);var i=Is(r),o=i.linebreak;if(r.indent==null&&(r.indent=mg.indent),r.children==null&&(r.children=mg.children),r.children===!1)return this.at+" "+this.id+" {}";var a=this.rules.toString(r);return a&&(a=""+o+a+o),this.at+" "+this.id+" {"+a+"}"},e}(),JU=/@keyframes\s+/,ZU=/\$([\w-]+)/g,I1=function(t,n){return typeof t=="string"?t.replace(ZU,function(r,i){return i in n?n[i]:r}):t},W4=function(t,n,r){var i=t[n],o=I1(i,r);o!==i&&(t[n]=o)},eV={onCreateRule:function(t,n,r){return typeof t=="string"&&JU.test(t)?new P1(t,n,r):null},onProcessStyle:function(t,n,r){return n.type!=="style"||!r||("animation-name"in t&&W4(t,"animation-name",r.keyframes),"animation"in t&&W4(t,"animation",r.keyframes)),t},onChangeValue:function(t,n,r){var i=r.options.sheet;if(!i)return t;switch(n){case"animation":return I1(t,i.keyframes);case"animation-name":return I1(t,i.keyframes);default:return t}}},tV=function(e){vy(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?lt({},i,{allowEmpty:!0}):i;return pu(this.key,this.style,s)},t}(R_),nV={onCreateRule:function(t,n,r){return r.parent&&r.parent.type==="keyframes"?new tV(t,n,r):null}},rV=function(){function e(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var t=e.prototype;return t.toString=function(r){var i=Is(r),o=i.linebreak;if(Array.isArray(this.style)){for(var a="",s=0;s=this.index){i.push(r);return}for(var a=0;ao){i.splice(a,0,r);return}}},t.reset=function(){this.registry=[]},t.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},t.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,a=up(i,["attached"]),s=Is(a),u=s.linebreak,l="",c=0;ct.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}function yV(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}function bV(e){for(var t=I_(),n=0;n0){var n=vV(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=yV(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&typeof r=="string"){var i=bV(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function SV(e,t){var n=t.insertionPoint,r=wV(t);if(r!==!1&&r.parent){r.parent.insertBefore(e,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling);return}I_().appendChild(e)}var kV=P_(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),Y4=function(t,n,r){try{"insertRule"in t?t.insertRule(n,r):"appendRule"in t&&t.appendRule(n)}catch{return!1}return t.cssRules[r]},X4=function(t,n){var r=t.cssRules.length;return n===void 0||n>r?r:n},xV=function(){var t=document.createElement("style");return t.textContent=` +`,t},CV=function(){function e(n){this.getPropertyValue=hV,this.setProperty=pV,this.removeProperty=mV,this.setSelector=gV,this.hasInsertedRules=!1,this.cssRules=[],n&&Il.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,a=r.element;this.element=a||xV(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=kV();s&&this.element.setAttribute("nonce",s)}var t=e.prototype;return t.attach=function(){if(!(this.element.parentNode||!this.sheet)){SV(this.element,this.sheet.options);var r=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` `)}},t.deploy=function(){var r=this.sheet;if(r){if(r.options.link){this.insertRules(r.rules);return}this.element.textContent=` `+r.toString()+` -`}},t.insertRules=function(r,i){for(var o=0;o0&&(i.refs--,i.refs===0&&i.sheet.detach()):I4(!1,"SheetsManager: can't find sheet to unmanage")},Qy(e,[{key:"size",get:function(){return this.length}}]),e}(),e2=typeof CSS=="object"&&CSS!=null&&"number"in CSS;function A_(e){var t=null;for(var n in e){var r=e[n],i=typeof r;if(i==="function")t||(t={}),t[n]=r;else if(i==="object"&&r!==null&&!Array.isArray(r)){var o=A_(r);o&&(t||(t={}),t[n]=o)}}return t}/** +`}},t.insertRules=function(r,i){for(var o=0;o0&&(i.refs--,i.refs===0&&i.sheet.detach()):F4(!1,"SheetsManager: can't find sheet to unmanage")},i2(e,[{key:"size",get:function(){return this.length}}]),e}(),s2=typeof CSS=="object"&&CSS!=null&&"number"in CSS;function O_(e){var t=null;for(var n in e){var r=e[n],i=typeof r;if(i==="function")t||(t={}),t[n]=r;else if(i==="object"&&r!==null&&!Array.isArray(r)){var o=O_(r);o&&(t||(t={}),t[n]=o)}}return t}/** * A better abstraction over CSS. * * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present * @website https://github.com/cssinjs/jss * @license MIT - */Zy();var T_=Date.now(),mg="fnValues"+T_,gg="fnStyle"+ ++T_,vW=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=cp(n,{},i);return o[gg]=r,o},onProcessStyle:function(n,r){if(mg in r||gg in r)return n;var i={};for(var o in n){var a=n[o];typeof a=="function"&&(delete n[o],i[o]=a)}return r[mg]=i,n},onUpdate:function(n,r,i,o){var a=r,s=a[gg];s&&(a.style=s(n)||{});var u=a[mg];if(u)for(var l in u)a.prop(l,u[l](n),o)}}};const yW=vW;function bW(e){var t,n=e.Symbol;return typeof n=="function"?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}var Da;typeof self<"u"?Da=self:typeof window<"u"?Da=window:typeof global<"u"?Da=global:typeof module<"u"?Da=module:Da=Function("return this")();var H4=bW(Da),W4=function(t){return t&&t[H4]&&t===t[H4]()},wW=function(t){return{onCreateRule:function(r,i,o){if(!W4(i))return null;var a=i,s=cp(r,{},o);return a.subscribe(function(u){for(var l in u)s.prop(l,u[l],t)}),s},onProcessRule:function(r){if(!(r&&r.type!=="style")){var i=r,o=i.style,a=function(c){var h=o[c];if(!W4(h))return"continue";delete o[c],h.subscribe({next:function(y){i.prop(c,y,t)}})};for(var s in o)var u=a(s)}}}};const SW=wW;var kW=/;\n/,xW=function(t){for(var n={},r=t.split(kW),i=0;i-1)return D1(e,t.split(" "));var i=e.options.parent;if(t[0]==="$"){var o=i.getRule(t.substr(1));return!o||o===e?!1:(i.classes[e.key]+=" "+i.classes[o.key],!0)}return i.classes[e.key]+=" "+t,!0}function jW(){function e(t,n){return"composes"in t&&(D1(n,t.composes),delete t.composes),t}return{onProcessStyle:e}}var BW=/[A-Z]/g,FW=/^ms-/,yg={};function $W(e){return"-"+e.toLowerCase()}function I_(e){if(yg.hasOwnProperty(e))return yg[e];var t=e.replace(BW,$W);return yg[e]=FW.test(t)?"-"+t:t}function Cf(e){var t={};for(var n in e){var r=n.indexOf("--")===0?n:I_(n);t[r]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(Cf):t.fallbacks=Cf(e.fallbacks)),t}function UW(){function e(n){if(Array.isArray(n)){for(var r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var o=z_[t];if(!Array.isArray(o))return Fe.js+Oo(o)in n?Fe.css+o:!1;if(!i)return!1;for(var a=0;ar?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(e),a=0;ajV)&&(i=t.createStyleSheet().attach()),i};function a(){var s=arguments,u=JSON.stringify(s),l=n.get(u);if(l)return l.className;var c=[];for(var h in s){var p=s[h];if(!Array.isArray(p)){c.push(p);continue}for(var y=0;y1&&(l.scd=function(h){for(var p={},y=0;y (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(d===!1)return JSON.parse(JSON.stringify(v));var m={};for(var x in v)v.hasOwnProperty(x)&&(m[x]=v[x].defaultValue);return m}function n(){var d=t(!0),v={};for(var m in d)d.hasOwnProperty(m)&&(v[m]=!0);return v}var r={},i={},o={},a=t(!0),s="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:n()};r.helper={},r.extensions={},r.setOption=function(d,v){return a[d]=v,this},r.getOption=function(d){return a[d]},r.getOptions=function(){return a},r.resetOptions=function(){a=t(!0)},r.setFlavor=function(d){if(!u.hasOwnProperty(d))throw Error(d+" flavor was not found");r.resetOptions();var v=u[d];s=d;for(var m in v)v.hasOwnProperty(m)&&(a[m]=v[m])},r.getFlavor=function(){return s},r.getFlavorOptions=function(d){if(u.hasOwnProperty(d))return u[d]},r.getDefaultOptions=function(d){return t(d)},r.subParser=function(d,v){if(r.helper.isString(d))if(typeof v<"u")i[d]=v;else{if(i.hasOwnProperty(d))return i[d];throw Error("SubParser named "+d+" not registered!")}},r.extension=function(d,v){if(!r.helper.isString(d))throw Error("Extension 'name' must be a string");if(d=r.helper.stdExtName(d),r.helper.isUndefined(v)){if(!o.hasOwnProperty(d))throw Error("Extension named "+d+" is not registered!");return o[d]}else{typeof v=="function"&&(v=v()),r.helper.isArray(v)||(v=[v]);var m=l(v,d);if(m.valid)o[d]=v;else throw Error(m.error)}},r.getAllExtensions=function(){return o},r.removeExtension=function(d){delete o[d]},r.resetExtensions=function(){o={}};function l(d,v){var m=v?"Error in "+v+" extension->":"Error in unnamed extension",x={valid:!0,error:""};r.helper.isArray(d)||(d=[d]);for(var A=0;A"u"},r.helper.forEach=function(d,v){if(r.helper.isUndefined(d))throw new Error("obj param is required");if(r.helper.isUndefined(v))throw new Error("callback param is required");if(!r.helper.isFunction(v))throw new Error("callback param must be a function/closure");if(typeof d.forEach=="function")d.forEach(v);else if(r.helper.isArray(d))for(var m=0;m").replace(/&/g,"&")};var h=function(d,v,m,x){var A=x||"",L=A.indexOf("g")>-1,P=new RegExp(v+"|"+m,"g"+A.replace(/g/g,"")),O=new RegExp(v,A.replace(/g/g,"")),V=[],H,j,F,R,q;do for(H=0;F=P.exec(d);)if(O.test(F[0]))H++||(j=P.lastIndex,R=j-F[0].length);else if(H&&!--H){q=F.index+F[0].length;var $={left:{start:R,end:j},match:{start:j,end:F.index},right:{start:F.index,end:q},wholeMatch:{start:R,end:q}};if(V.push($),!L)return V}while(H&&(P.lastIndex=j));return V};r.helper.matchRecursiveRegExp=function(d,v,m,x){for(var A=h(d,v,m,x),L=[],P=0;P0){var H=[];P[0].wholeMatch.start!==0&&H.push(d.slice(0,P[0].wholeMatch.start));for(var j=0;j=0?x+(m||0):x},r.helper.splitAtIndex=function(d,v){if(!r.helper.isString(d))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[d.substring(0,v),d.substring(v)]},r.helper.encodeEmailAddress=function(d){var v=[function(m){return"&#"+m.charCodeAt(0)+";"},function(m){return"&#x"+m.charCodeAt(0).toString(16)+";"},function(m){return m}];return d=d.replace(/./g,function(m){if(m==="@")m=v[Math.floor(Math.random()*2)](m);else{var x=Math.random();m=x>.9?v[2](m):x>.45?v[1](m):v[0](m)}return m}),d},r.helper.padEnd=function(v,m,x){return m=m>>0,x=String(x||" "),v.length>m?String(v):(m=m-v.length,m>x.length&&(x+=x.repeat(m/x.length)),String(v)+x.slice(0,m))},typeof console>"u"&&(console={warn:function(d){alert(d)},log:function(d){alert(d)},error:function(d){throw d}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},r.Converter=function(d){var v={},m=[],x=[],A={},L=s,P={parsed:{},raw:"",format:""};O();function O(){d=d||{};for(var R in a)a.hasOwnProperty(R)&&(v[R]=a[R]);if(typeof d=="object")for(var q in d)d.hasOwnProperty(q)&&(v[q]=d[q]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof d+" was passed instead.");v.extensions&&r.helper.forEach(v.extensions,V)}function V(R,q){if(q=q||null,r.helper.isString(R))if(R=r.helper.stdExtName(R),q=R,r.extensions[R]){console.warn("DEPRECATION WARNING: "+R+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),H(r.extensions[R],R);return}else if(!r.helper.isUndefined(o[R]))R=o[R];else throw Error('Extension "'+R+'" could not be loaded. It was either not found or is not a valid extension.');typeof R=="function"&&(R=R()),r.helper.isArray(R)||(R=[R]);var $=l(R,q);if(!$.valid)throw Error($.error);for(var K=0;K-1)return N1(e,t.split(" "));var i=e.options.parent;if(t[0]==="$"){var o=i.getRule(t.substr(1));return!o||o===e?!1:(i.classes[e.key]+=" "+i.classes[o.key],!0)}return i.classes[e.key]+=" "+t,!0}function GV(){function e(t,n){return"composes"in t&&(N1(n,t.composes),delete t.composes),t}return{onProcessStyle:e}}var YV=/[A-Z]/g,XV=/^ms-/,bg={};function QV(e){return"-"+e.toLowerCase()}function N_(e){if(bg.hasOwnProperty(e))return bg[e];var t=e.replace(YV,QV);return bg[e]=XV.test(t)?"-"+t:t}function Ef(e){var t={};for(var n in e){var r=n.indexOf("--")===0?n:N_(n);t[r]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(Ef):t.fallbacks=Ef(e.fallbacks)),t}function JV(){function e(n){if(Array.isArray(n)){for(var r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var o=$_[t];if(!Array.isArray(o))return $e.js+Lo(o)in n?$e.css+o:!1;if(!i)return!1;for(var a=0;ar?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(e),a=0;aGW)&&(i=t.createStyleSheet().attach()),i};function a(){var s=arguments,u=JSON.stringify(s),l=n.get(u);if(l)return l.className;var c=[];for(var h in s){var p=s[h];if(!Array.isArray(p)){c.push(p);continue}for(var y=0;y1&&(l.scd=function(h){for(var p={},y=0;y (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(d===!1)return JSON.parse(JSON.stringify(v));var m={};for(var x in v)v.hasOwnProperty(x)&&(m[x]=v[x].defaultValue);return m}function n(){var d=t(!0),v={};for(var m in d)d.hasOwnProperty(m)&&(v[m]=!0);return v}var r={},i={},o={},a=t(!0),s="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:n()};r.helper={},r.extensions={},r.setOption=function(d,v){return a[d]=v,this},r.getOption=function(d){return a[d]},r.getOptions=function(){return a},r.resetOptions=function(){a=t(!0)},r.setFlavor=function(d){if(!u.hasOwnProperty(d))throw Error(d+" flavor was not found");r.resetOptions();var v=u[d];s=d;for(var m in v)v.hasOwnProperty(m)&&(a[m]=v[m])},r.getFlavor=function(){return s},r.getFlavorOptions=function(d){if(u.hasOwnProperty(d))return u[d]},r.getDefaultOptions=function(d){return t(d)},r.subParser=function(d,v){if(r.helper.isString(d))if(typeof v<"u")i[d]=v;else{if(i.hasOwnProperty(d))return i[d];throw Error("SubParser named "+d+" not registered!")}},r.extension=function(d,v){if(!r.helper.isString(d))throw Error("Extension 'name' must be a string");if(d=r.helper.stdExtName(d),r.helper.isUndefined(v)){if(!o.hasOwnProperty(d))throw Error("Extension named "+d+" is not registered!");return o[d]}else{typeof v=="function"&&(v=v()),r.helper.isArray(v)||(v=[v]);var m=l(v,d);if(m.valid)o[d]=v;else throw Error(m.error)}},r.getAllExtensions=function(){return o},r.removeExtension=function(d){delete o[d]},r.resetExtensions=function(){o={}};function l(d,v){var m=v?"Error in "+v+" extension->":"Error in unnamed extension",x={valid:!0,error:""};r.helper.isArray(d)||(d=[d]);for(var A=0;A"u"},r.helper.forEach=function(d,v){if(r.helper.isUndefined(d))throw new Error("obj param is required");if(r.helper.isUndefined(v))throw new Error("callback param is required");if(!r.helper.isFunction(v))throw new Error("callback param must be a function/closure");if(typeof d.forEach=="function")d.forEach(v);else if(r.helper.isArray(d))for(var m=0;m").replace(/&/g,"&")};var h=function(d,v,m,x){var A=x||"",D=A.indexOf("g")>-1,P=new RegExp(v+"|"+m,"g"+A.replace(/g/g,"")),L=new RegExp(v,A.replace(/g/g,"")),W=[],U,j,F,R,q;do for(U=0;F=P.exec(d);)if(L.test(F[0]))U++||(j=P.lastIndex,R=j-F[0].length);else if(U&&!--U){q=F.index+F[0].length;var $={left:{start:R,end:j},match:{start:j,end:F.index},right:{start:F.index,end:q},wholeMatch:{start:R,end:q}};if(W.push($),!D)return W}while(U&&(P.lastIndex=j));return W};r.helper.matchRecursiveRegExp=function(d,v,m,x){for(var A=h(d,v,m,x),D=[],P=0;P0){var U=[];P[0].wholeMatch.start!==0&&U.push(d.slice(0,P[0].wholeMatch.start));for(var j=0;j=0?x+(m||0):x},r.helper.splitAtIndex=function(d,v){if(!r.helper.isString(d))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[d.substring(0,v),d.substring(v)]},r.helper.encodeEmailAddress=function(d){var v=[function(m){return"&#"+m.charCodeAt(0)+";"},function(m){return"&#x"+m.charCodeAt(0).toString(16)+";"},function(m){return m}];return d=d.replace(/./g,function(m){if(m==="@")m=v[Math.floor(Math.random()*2)](m);else{var x=Math.random();m=x>.9?v[2](m):x>.45?v[1](m):v[0](m)}return m}),d},r.helper.padEnd=function(v,m,x){return m=m>>0,x=String(x||" "),v.length>m?String(v):(m=m-v.length,m>x.length&&(x+=x.repeat(m/x.length)),String(v)+x.slice(0,m))},typeof console>"u"&&(console={warn:function(d){alert(d)},log:function(d){alert(d)},error:function(d){throw d}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},r.Converter=function(d){var v={},m=[],x=[],A={},D=s,P={parsed:{},raw:"",format:""};L();function L(){d=d||{};for(var R in a)a.hasOwnProperty(R)&&(v[R]=a[R]);if(typeof d=="object")for(var q in d)d.hasOwnProperty(q)&&(v[q]=d[q]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof d+" was passed instead.");v.extensions&&r.helper.forEach(v.extensions,W)}function W(R,q){if(q=q||null,r.helper.isString(R))if(R=r.helper.stdExtName(R),q=R,r.extensions[R]){console.warn("DEPRECATION WARNING: "+R+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),U(r.extensions[R],R);return}else if(!r.helper.isUndefined(o[R]))R=o[R];else throw Error('Extension "'+R+'" could not be loaded. It was either not found or is not a valid extension.');typeof R=="function"&&(R=R()),r.helper.isArray(R)||(R=[R]);var $=l(R,q);if(!$.valid)throw Error($.error);for(var K=0;K[ \t]+¨NBSP;<"),!q)if(window&&window.document)q=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var $=q.createElement("div");$.innerHTML=R;var K={preList:se($)};re($);for(var ee=$.childNodes,D="",I=0;I'}else ge.push(W[te].innerHTML),W[te].innerHTML="",W[te].setAttribute("prenum",te.toString());return ge}return D},this.setOption=function(R,q){v[R]=q},this.getOption=function(R){return v[R]},this.getOptions=function(){return v},this.addExtension=function(R,q){q=q||null,V(R,q)},this.useExtension=function(R){V(R)},this.setFlavor=function(R){if(!u.hasOwnProperty(R))throw Error(R+" flavor was not found");var q=u[R];L=R;for(var $ in q)q.hasOwnProperty($)&&(v[$]=q[$])},this.getFlavor=function(){return L},this.removeExtension=function(R){r.helper.isArray(R)||(R=[R]);for(var q=0;q? ?(['"].*['"])?\)$/m)>-1)O="";else if(!O)if(P||(P=L.toLowerCase().replace(/ ?\n/g," ")),O="#"+P,!r.helper.isUndefined(m.gUrls[P]))O=m.gUrls[P],r.helper.isUndefined(m.gTitles[P])||(j=m.gTitles[P]);else return A;O=O.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var F='",F};return d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,x),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,x),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,x),d=d.replace(/\[([^\[\]]+)]()()()()()/g,x),v.ghMentions&&(d=d.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(A,L,P,O,V){if(P==="\\")return L+O;if(!r.helper.isString(v.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var H=v.ghMentionsLink.replace(/\{u}/g,V),j="";return v.openLinksInNewWindow&&(j=' rel="noopener noreferrer" target="¨E95Eblank"'),L+'"+O+""})),d=m.converter._dispatch("anchors.after",d,v,m),d});var p=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,y=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,g=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,S=function(d){return function(v,m,x,A,L,P,O){x=x.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var V=x,H="",j="",F=m||"",R=O||"";return/^www\./i.test(x)&&(x=x.replace(/^www\./i,"http://www.")),d.excludeTrailingPunctuationFromURLs&&P&&(H=P),d.openLinksInNewWindow&&(j=' rel="noopener noreferrer" target="¨E95Eblank"'),F+'"+V+""+H+R}},k=function(d,v){return function(m,x,A){var L="mailto:";return x=x||"",A=r.subParser("unescapeSpecialChars")(A,d,v),d.encodeEmails?(L=r.helper.encodeEmailAddress(L+A),A=r.helper.encodeEmailAddress(A)):L=L+A,x+''+A+""}};r.subParser("autoLinks",function(d,v,m){return d=m.converter._dispatch("autoLinks.before",d,v,m),d=d.replace(g,S(v)),d=d.replace(_,k(v,m)),d=m.converter._dispatch("autoLinks.after",d,v,m),d}),r.subParser("simplifiedAutoLinks",function(d,v,m){return v.simplifiedAutoLink&&(d=m.converter._dispatch("simplifiedAutoLinks.before",d,v,m),v.excludeTrailingPunctuationFromURLs?d=d.replace(y,S(v)):d=d.replace(p,S(v)),d=d.replace(b,k(v,m)),d=m.converter._dispatch("simplifiedAutoLinks.after",d,v,m)),d}),r.subParser("blockGamut",function(d,v,m){return d=m.converter._dispatch("blockGamut.before",d,v,m),d=r.subParser("blockQuotes")(d,v,m),d=r.subParser("headers")(d,v,m),d=r.subParser("horizontalRule")(d,v,m),d=r.subParser("lists")(d,v,m),d=r.subParser("codeBlocks")(d,v,m),d=r.subParser("tables")(d,v,m),d=r.subParser("hashHTMLBlocks")(d,v,m),d=r.subParser("paragraphs")(d,v,m),d=m.converter._dispatch("blockGamut.after",d,v,m),d}),r.subParser("blockQuotes",function(d,v,m){d=m.converter._dispatch("blockQuotes.before",d,v,m),d=d+` +`),R=R.replace(/>[ \t]+¨NBSP;<"),!q)if(window&&window.document)q=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var $=q.createElement("div");$.innerHTML=R;var K={preList:se($)};re($);for(var ee=$.childNodes,N="",I=0;I'}else ge.push(V[te].innerHTML),V[te].innerHTML="",V[te].setAttribute("prenum",te.toString());return ge}return N},this.setOption=function(R,q){v[R]=q},this.getOption=function(R){return v[R]},this.getOptions=function(){return v},this.addExtension=function(R,q){q=q||null,W(R,q)},this.useExtension=function(R){W(R)},this.setFlavor=function(R){if(!u.hasOwnProperty(R))throw Error(R+" flavor was not found");var q=u[R];D=R;for(var $ in q)q.hasOwnProperty($)&&(v[$]=q[$])},this.getFlavor=function(){return D},this.removeExtension=function(R){r.helper.isArray(R)||(R=[R]);for(var q=0;q? ?(['"].*['"])?\)$/m)>-1)L="";else if(!L)if(P||(P=D.toLowerCase().replace(/ ?\n/g," ")),L="#"+P,!r.helper.isUndefined(m.gUrls[P]))L=m.gUrls[P],r.helper.isUndefined(m.gTitles[P])||(j=m.gTitles[P]);else return A;L=L.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var F='",F};return d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,x),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,x),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,x),d=d.replace(/\[([^\[\]]+)]()()()()()/g,x),v.ghMentions&&(d=d.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(A,D,P,L,W){if(P==="\\")return D+L;if(!r.helper.isString(v.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var U=v.ghMentionsLink.replace(/\{u}/g,W),j="";return v.openLinksInNewWindow&&(j=' rel="noopener noreferrer" target="¨E95Eblank"'),D+'"+L+""})),d=m.converter._dispatch("anchors.after",d,v,m),d});var p=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,y=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,g=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,S=function(d){return function(v,m,x,A,D,P,L){x=x.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var W=x,U="",j="",F=m||"",R=L||"";return/^www\./i.test(x)&&(x=x.replace(/^www\./i,"http://www.")),d.excludeTrailingPunctuationFromURLs&&P&&(U=P),d.openLinksInNewWindow&&(j=' rel="noopener noreferrer" target="¨E95Eblank"'),F+'"+W+""+U+R}},k=function(d,v){return function(m,x,A){var D="mailto:";return x=x||"",A=r.subParser("unescapeSpecialChars")(A,d,v),d.encodeEmails?(D=r.helper.encodeEmailAddress(D+A),A=r.helper.encodeEmailAddress(A)):D=D+A,x+''+A+""}};r.subParser("autoLinks",function(d,v,m){return d=m.converter._dispatch("autoLinks.before",d,v,m),d=d.replace(g,S(v)),d=d.replace(_,k(v,m)),d=m.converter._dispatch("autoLinks.after",d,v,m),d}),r.subParser("simplifiedAutoLinks",function(d,v,m){return v.simplifiedAutoLink&&(d=m.converter._dispatch("simplifiedAutoLinks.before",d,v,m),v.excludeTrailingPunctuationFromURLs?d=d.replace(y,S(v)):d=d.replace(p,S(v)),d=d.replace(b,k(v,m)),d=m.converter._dispatch("simplifiedAutoLinks.after",d,v,m)),d}),r.subParser("blockGamut",function(d,v,m){return d=m.converter._dispatch("blockGamut.before",d,v,m),d=r.subParser("blockQuotes")(d,v,m),d=r.subParser("headers")(d,v,m),d=r.subParser("horizontalRule")(d,v,m),d=r.subParser("lists")(d,v,m),d=r.subParser("codeBlocks")(d,v,m),d=r.subParser("tables")(d,v,m),d=r.subParser("hashHTMLBlocks")(d,v,m),d=r.subParser("paragraphs")(d,v,m),d=m.converter._dispatch("blockGamut.after",d,v,m),d}),r.subParser("blockQuotes",function(d,v,m){d=m.converter._dispatch("blockQuotes.before",d,v,m),d=d+` -`;var x=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return v.splitAdjacentBlockquotes&&(x=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),d=d.replace(x,function(A){return A=A.replace(/^[ \t]*>[ \t]?/gm,""),A=A.replace(/¨0/g,""),A=A.replace(/^[ \t]+$/gm,""),A=r.subParser("githubCodeBlocks")(A,v,m),A=r.subParser("blockGamut")(A,v,m),A=A.replace(/(^|\n)/g,"$1 "),A=A.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(L,P){var O=P;return O=O.replace(/^  /mg,"¨0"),O=O.replace(/¨0/g,""),O}),r.subParser("hashBlock")(`
+`;var x=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return v.splitAdjacentBlockquotes&&(x=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),d=d.replace(x,function(A){return A=A.replace(/^[ \t]*>[ \t]?/gm,""),A=A.replace(/¨0/g,""),A=A.replace(/^[ \t]+$/gm,""),A=r.subParser("githubCodeBlocks")(A,v,m),A=r.subParser("blockGamut")(A,v,m),A=A.replace(/(^|\n)/g,"$1 "),A=A.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(D,P){var L=P;return L=L.replace(/^  /mg,"¨0"),L=L.replace(/¨0/g,""),L}),r.subParser("hashBlock")(`
`+A+` -
`,v,m)}),d=m.converter._dispatch("blockQuotes.after",d,v,m),d}),r.subParser("codeBlocks",function(d,v,m){d=m.converter._dispatch("codeBlocks.before",d,v,m),d+="¨0";var x=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return d=d.replace(x,function(A,L,P){var O=L,V=P,H=` -`;return O=r.subParser("outdent")(O,v,m),O=r.subParser("encodeCode")(O,v,m),O=r.subParser("detab")(O,v,m),O=O.replace(/^\n+/g,""),O=O.replace(/\n+$/g,""),v.omitExtraWLInCodeBlocks&&(H=""),O="
"+O+H+"
",r.subParser("hashBlock")(O,v,m)+V}),d=d.replace(/¨0/,""),d=m.converter._dispatch("codeBlocks.after",d,v,m),d}),r.subParser("codeSpans",function(d,v,m){return d=m.converter._dispatch("codeSpans.before",d,v,m),typeof d>"u"&&(d=""),d=d.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(x,A,L,P){var O=P;return O=O.replace(/^([ \t]*)/g,""),O=O.replace(/[ \t]*$/g,""),O=r.subParser("encodeCode")(O,v,m),O=A+""+O+"",O=r.subParser("hashHTMLSpans")(O,v,m),O}),d=m.converter._dispatch("codeSpans.after",d,v,m),d}),r.subParser("completeHTMLDocument",function(d,v,m){if(!v.completeHTMLDocument)return d;d=m.converter._dispatch("completeHTMLDocument.before",d,v,m);var x="html",A=` -`,L="",P=` -`,O="",V="";typeof m.metadata.parsed.doctype<"u"&&(A=" -`,x=m.metadata.parsed.doctype.toString().toLowerCase(),(x==="html"||x==="html5")&&(P=''));for(var H in m.metadata.parsed)if(m.metadata.parsed.hasOwnProperty(H))switch(H.toLowerCase()){case"doctype":break;case"title":L=""+m.metadata.parsed.title+` +
`,v,m)}),d=m.converter._dispatch("blockQuotes.after",d,v,m),d}),r.subParser("codeBlocks",function(d,v,m){d=m.converter._dispatch("codeBlocks.before",d,v,m),d+="¨0";var x=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return d=d.replace(x,function(A,D,P){var L=D,W=P,U=` +`;return L=r.subParser("outdent")(L,v,m),L=r.subParser("encodeCode")(L,v,m),L=r.subParser("detab")(L,v,m),L=L.replace(/^\n+/g,""),L=L.replace(/\n+$/g,""),v.omitExtraWLInCodeBlocks&&(U=""),L="
"+L+U+"
",r.subParser("hashBlock")(L,v,m)+W}),d=d.replace(/¨0/,""),d=m.converter._dispatch("codeBlocks.after",d,v,m),d}),r.subParser("codeSpans",function(d,v,m){return d=m.converter._dispatch("codeSpans.before",d,v,m),typeof d>"u"&&(d=""),d=d.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(x,A,D,P){var L=P;return L=L.replace(/^([ \t]*)/g,""),L=L.replace(/[ \t]*$/g,""),L=r.subParser("encodeCode")(L,v,m),L=A+""+L+"",L=r.subParser("hashHTMLSpans")(L,v,m),L}),d=m.converter._dispatch("codeSpans.after",d,v,m),d}),r.subParser("completeHTMLDocument",function(d,v,m){if(!v.completeHTMLDocument)return d;d=m.converter._dispatch("completeHTMLDocument.before",d,v,m);var x="html",A=` +`,D="",P=` +`,L="",W="";typeof m.metadata.parsed.doctype<"u"&&(A=" +`,x=m.metadata.parsed.doctype.toString().toLowerCase(),(x==="html"||x==="html5")&&(P=''));for(var U in m.metadata.parsed)if(m.metadata.parsed.hasOwnProperty(U))switch(U.toLowerCase()){case"doctype":break;case"title":D=""+m.metadata.parsed.title+` `;break;case"charset":x==="html"||x==="html5"?P=' `:P=' -`;break;case"language":case"lang":O=' lang="'+m.metadata.parsed[H]+'"',V+=' -`;break;default:V+=' -`}return d=A+" +`;break;case"language":case"lang":L=' lang="'+m.metadata.parsed[U]+'"',W+=' +`;break;default:W+=' +`}return d=A+" -`+L+P+V+` +`+D+P+W+` `+d.trim()+` -`,d=m.converter._dispatch("completeHTMLDocument.after",d,v,m),d}),r.subParser("detab",function(d,v,m){return d=m.converter._dispatch("detab.before",d,v,m),d=d.replace(/\t(?=\t)/g," "),d=d.replace(/\t/g,"¨A¨B"),d=d.replace(/¨B(.+?)¨A/g,function(x,A){for(var L=A,P=4-L.length%4,O=0;O/g,">"),d=m.converter._dispatch("encodeAmpsAndAngles.after",d,v,m),d}),r.subParser("encodeBackslashEscapes",function(d,v,m){return d=m.converter._dispatch("encodeBackslashEscapes.before",d,v,m),d=d.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),d=d.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("encodeBackslashEscapes.after",d,v,m),d}),r.subParser("encodeCode",function(d,v,m){return d=m.converter._dispatch("encodeCode.before",d,v,m),d=d.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("encodeCode.after",d,v,m),d}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(d,v,m){d=m.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",d,v,m);var x=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,A=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return d=d.replace(x,function(L){return L.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=d.replace(A,function(L){return L.replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=m.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",d,v,m),d}),r.subParser("githubCodeBlocks",function(d,v,m){return v.ghCodeBlocks?(d=m.converter._dispatch("githubCodeBlocks.before",d,v,m),d+="¨0",d=d.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(x,A,L,P){var O=v.omitExtraWLInCodeBlocks?"":` -`;return P=r.subParser("encodeCode")(P,v,m),P=r.subParser("detab")(P,v,m),P=P.replace(/^\n+/g,""),P=P.replace(/\n+$/g,""),P="
"+P+O+"
",P=r.subParser("hashBlock")(P,v,m),` +`,d=m.converter._dispatch("completeHTMLDocument.after",d,v,m),d}),r.subParser("detab",function(d,v,m){return d=m.converter._dispatch("detab.before",d,v,m),d=d.replace(/\t(?=\t)/g," "),d=d.replace(/\t/g,"¨A¨B"),d=d.replace(/¨B(.+?)¨A/g,function(x,A){for(var D=A,P=4-D.length%4,L=0;L/g,">"),d=m.converter._dispatch("encodeAmpsAndAngles.after",d,v,m),d}),r.subParser("encodeBackslashEscapes",function(d,v,m){return d=m.converter._dispatch("encodeBackslashEscapes.before",d,v,m),d=d.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),d=d.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("encodeBackslashEscapes.after",d,v,m),d}),r.subParser("encodeCode",function(d,v,m){return d=m.converter._dispatch("encodeCode.before",d,v,m),d=d.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("encodeCode.after",d,v,m),d}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(d,v,m){d=m.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",d,v,m);var x=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,A=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return d=d.replace(x,function(D){return D.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=d.replace(A,function(D){return D.replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=m.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",d,v,m),d}),r.subParser("githubCodeBlocks",function(d,v,m){return v.ghCodeBlocks?(d=m.converter._dispatch("githubCodeBlocks.before",d,v,m),d+="¨0",d=d.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(x,A,D,P){var L=v.omitExtraWLInCodeBlocks?"":` +`;return P=r.subParser("encodeCode")(P,v,m),P=r.subParser("detab")(P,v,m),P=P.replace(/^\n+/g,""),P=P.replace(/\n+$/g,""),P="
"+P+L+"
",P=r.subParser("hashBlock")(P,v,m),` ¨G`+(m.ghCodeBlocks.push({text:x,codeblock:P})-1)+`G @@ -404,45 +404,45 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ¨K`+(m.gHtmlBlocks.push(d)-1)+`K -`,d=m.converter._dispatch("hashBlock.after",d,v,m),d}),r.subParser("hashCodeTags",function(d,v,m){d=m.converter._dispatch("hashCodeTags.before",d,v,m);var x=function(A,L,P,O){var V=P+r.subParser("encodeCode")(L,v,m)+O;return"¨C"+(m.gHtmlSpans.push(V)-1)+"C"};return d=r.helper.replaceRecursiveRegExp(d,x,"]*>","","gim"),d=m.converter._dispatch("hashCodeTags.after",d,v,m),d}),r.subParser("hashElement",function(d,v,m){return function(x,A){var L=A;return L=L.replace(/\n\n/g,` -`),L=L.replace(/^\n/,""),L=L.replace(/\n+$/g,""),L=` +`,d=m.converter._dispatch("hashBlock.after",d,v,m),d}),r.subParser("hashCodeTags",function(d,v,m){d=m.converter._dispatch("hashCodeTags.before",d,v,m);var x=function(A,D,P,L){var W=P+r.subParser("encodeCode")(D,v,m)+L;return"¨C"+(m.gHtmlSpans.push(W)-1)+"C"};return d=r.helper.replaceRecursiveRegExp(d,x,"]*>","","gim"),d=m.converter._dispatch("hashCodeTags.after",d,v,m),d}),r.subParser("hashElement",function(d,v,m){return function(x,A){var D=A;return D=D.replace(/\n\n/g,` +`),D=D.replace(/^\n/,""),D=D.replace(/\n+$/g,""),D=` -¨K`+(m.gHtmlBlocks.push(L)-1)+`K +¨K`+(m.gHtmlBlocks.push(D)-1)+`K -`,L}}),r.subParser("hashHTMLBlocks",function(d,v,m){d=m.converter._dispatch("hashHTMLBlocks.before",d,v,m);var x=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],A=function(R,q,$,K){var ee=R;return $.search(/\bmarkdown\b/)!==-1&&(ee=$+m.converter.makeHtml(q)+K),` +`,D}}),r.subParser("hashHTMLBlocks",function(d,v,m){d=m.converter._dispatch("hashHTMLBlocks.before",d,v,m);var x=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],A=function(R,q,$,K){var ee=R;return $.search(/\bmarkdown\b/)!==-1&&(ee=$+m.converter.makeHtml(q)+K),` ¨K`+(m.gHtmlBlocks.push(ee)-1)+`K -`};v.backslashEscapesHTMLTags&&(d=d.replace(/\\<(\/?[^>]+?)>/g,function(R,q){return"<"+q+">"}));for(var L=0;L]*>)","im"),V="<"+x[L]+"\\b[^>]*>",H="";(P=r.helper.regexIndexOf(d,O))!==-1;){var j=r.helper.splitAtIndex(d,P),F=r.helper.replaceRecursiveRegExp(j[1],A,V,H,"im");if(F===j[1])break;d=j[0].concat(F)}return d=d.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,v,m)),d=r.helper.replaceRecursiveRegExp(d,function(R){return` +`};v.backslashEscapesHTMLTags&&(d=d.replace(/\\<(\/?[^>]+?)>/g,function(R,q){return"<"+q+">"}));for(var D=0;D]*>)","im"),W="<"+x[D]+"\\b[^>]*>",U="";(P=r.helper.regexIndexOf(d,L))!==-1;){var j=r.helper.splitAtIndex(d,P),F=r.helper.replaceRecursiveRegExp(j[1],A,W,U,"im");if(F===j[1])break;d=j[0].concat(F)}return d=d.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,v,m)),d=r.helper.replaceRecursiveRegExp(d,function(R){return` ¨K`+(m.gHtmlBlocks.push(R)-1)+`K -`},"^ {0,3}","gm"),d=d.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,v,m)),d=m.converter._dispatch("hashHTMLBlocks.after",d,v,m),d}),r.subParser("hashHTMLSpans",function(d,v,m){d=m.converter._dispatch("hashHTMLSpans.before",d,v,m);function x(A){return"¨C"+(m.gHtmlSpans.push(A)-1)+"C"}return d=d.replace(/<[^>]+?\/>/gi,function(A){return x(A)}),d=d.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(A){return x(A)}),d=d.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(A){return x(A)}),d=d.replace(/<[^>]+?>/gi,function(A){return x(A)}),d=m.converter._dispatch("hashHTMLSpans.after",d,v,m),d}),r.subParser("unhashHTMLSpans",function(d,v,m){d=m.converter._dispatch("unhashHTMLSpans.before",d,v,m);for(var x=0;x","gm"),d=d.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,v,m)),d=m.converter._dispatch("hashHTMLBlocks.after",d,v,m),d}),r.subParser("hashHTMLSpans",function(d,v,m){d=m.converter._dispatch("hashHTMLSpans.before",d,v,m);function x(A){return"¨C"+(m.gHtmlSpans.push(A)-1)+"C"}return d=d.replace(/<[^>]+?\/>/gi,function(A){return x(A)}),d=d.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(A){return x(A)}),d=d.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(A){return x(A)}),d=d.replace(/<[^>]+?>/gi,function(A){return x(A)}),d=m.converter._dispatch("hashHTMLSpans.after",d,v,m),d}),r.subParser("unhashHTMLSpans",function(d,v,m){d=m.converter._dispatch("unhashHTMLSpans.before",d,v,m);for(var x=0;x]*>\\s*]*>","^ {0,3}\\s*
","gim"),d=m.converter._dispatch("hashPreCodeTags.after",d,v,m),d}),r.subParser("headers",function(d,v,m){d=m.converter._dispatch("headers.before",d,v,m);var x=isNaN(parseInt(v.headerLevelStart))?1:parseInt(v.headerLevelStart),A=v.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,L=v.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;d=d.replace(A,function(V,H){var j=r.subParser("spanGamut")(H,v,m),F=v.noHeaderId?"":' id="'+O(H)+'"',R=x,q=""+j+"";return r.subParser("hashBlock")(q,v,m)}),d=d.replace(L,function(V,H){var j=r.subParser("spanGamut")(H,v,m),F=v.noHeaderId?"":' id="'+O(H)+'"',R=x+1,q=""+j+"";return r.subParser("hashBlock")(q,v,m)});var P=v.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;d=d.replace(P,function(V,H,j){var F=j;v.customizedHeaderId&&(F=j.replace(/\s?\{([^{]+?)}\s*$/,""));var R=r.subParser("spanGamut")(F,v,m),q=v.noHeaderId?"":' id="'+O(j)+'"',$=x-1+H.length,K=""+R+"";return r.subParser("hashBlock")(K,v,m)});function O(V){var H,j;if(v.customizedHeaderId){var F=V.match(/\{([^{]+?)}\s*$/);F&&F[1]&&(V=F[1])}return H=V,r.helper.isString(v.prefixHeaderId)?j=v.prefixHeaderId:v.prefixHeaderId===!0?j="section-":j="",v.rawPrefixHeaderId||(H=j+H),v.ghCompatibleHeaderId?H=H.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():v.rawHeaderId?H=H.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():H=H.replace(/[^\w]/g,"").toLowerCase(),v.rawPrefixHeaderId&&(H=j+H),m.hashLinkCounts[H]?H=H+"-"+m.hashLinkCounts[H]++:m.hashLinkCounts[H]=1,H}return d=m.converter._dispatch("headers.after",d,v,m),d}),r.subParser("horizontalRule",function(d,v,m){d=m.converter._dispatch("horizontalRule.before",d,v,m);var x=r.subParser("hashBlock")("
",v,m);return d=d.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,x),d=d.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,x),d=d.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,x),d=m.converter._dispatch("horizontalRule.after",d,v,m),d}),r.subParser("images",function(d,v,m){d=m.converter._dispatch("images.before",d,v,m);var x=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,A=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,L=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,P=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,O=/!\[([^\[\]]+)]()()()()()/g;function V(j,F,R,q,$,K,ee,D){return q=q.replace(/\s/g,""),H(j,F,R,q,$,K,ee,D)}function H(j,F,R,q,$,K,ee,D){var I=m.gUrls,re=m.gTitles,se=m.gDimensions;if(R=R.toLowerCase(),D||(D=""),j.search(/\(? ?(['"].*['"])?\)$/m)>-1)q="";else if(q===""||q===null)if((R===""||R===null)&&(R=F.toLowerCase().replace(/ ?\n/g," ")),q="#"+R,!r.helper.isUndefined(I[R]))q=I[R],r.helper.isUndefined(re[R])||(D=re[R]),r.helper.isUndefined(se[R])||($=se[R].width,K=se[R].height);else return j;F=F.replace(/"/g,""").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),q=q.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var he=''+F+'","
")}),d=d.replace(/\b__(\S[\s\S]*?)__\b/g,function(A,L){return x(L,"","")}),d=d.replace(/\b_(\S[\s\S]*?)_\b/g,function(A,L){return x(L,"","")})):(d=d.replace(/___(\S[\s\S]*?)___/g,function(A,L){return/\S$/.test(L)?x(L,"",""):A}),d=d.replace(/__(\S[\s\S]*?)__/g,function(A,L){return/\S$/.test(L)?x(L,"",""):A}),d=d.replace(/_([^\s_][\s\S]*?)_/g,function(A,L){return/\S$/.test(L)?x(L,"",""):A})),v.literalMidWordAsterisks?(d=d.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(A,L,P){return x(P,L+"","")}),d=d.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(A,L,P){return x(P,L+"","")}),d=d.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(A,L,P){return x(P,L+"","")})):(d=d.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(A,L){return/\S$/.test(L)?x(L,"",""):A}),d=d.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(A,L){return/\S$/.test(L)?x(L,"",""):A}),d=d.replace(/\*([^\s*][\s\S]*?)\*/g,function(A,L){return/\S$/.test(L)?x(L,"",""):A})),d=m.converter._dispatch("italicsAndBold.after",d,v,m),d}),r.subParser("lists",function(d,v,m){function x(P,O){m.gListLevel++,P=P.replace(/\n{2,}$/,` -`),P+="¨0";var V=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,H=/\n[ \t]*\n(?!¨0)/.test(P);return v.disableForced4SpacesIndentedSublists&&(V=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),P=P.replace(V,function(j,F,R,q,$,K,ee){ee=ee&&ee.trim()!=="";var D=r.subParser("outdent")($,v,m),I="";return K&&v.tasklists&&(I=' class="task-list-item" style="list-style-type: none;"',D=D.replace(/^[ \t]*\[(x|X| )?]/m,function(){var re='-1?(D=r.subParser("githubCodeBlocks")(D,v,m),D=r.subParser("blockGamut")(D,v,m)):(D=r.subParser("lists")(D,v,m),D=D.replace(/\n$/,""),D=r.subParser("hashHTMLBlocks")(D,v,m),D=D.replace(/\n\n+/g,` +`};return d=r.helper.replaceRecursiveRegExp(d,x,"^ {0,3}]*>\\s*]*>","^ {0,3}\\s*","gim"),d=m.converter._dispatch("hashPreCodeTags.after",d,v,m),d}),r.subParser("headers",function(d,v,m){d=m.converter._dispatch("headers.before",d,v,m);var x=isNaN(parseInt(v.headerLevelStart))?1:parseInt(v.headerLevelStart),A=v.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,D=v.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;d=d.replace(A,function(W,U){var j=r.subParser("spanGamut")(U,v,m),F=v.noHeaderId?"":' id="'+L(U)+'"',R=x,q=""+j+"";return r.subParser("hashBlock")(q,v,m)}),d=d.replace(D,function(W,U){var j=r.subParser("spanGamut")(U,v,m),F=v.noHeaderId?"":' id="'+L(U)+'"',R=x+1,q=""+j+"";return r.subParser("hashBlock")(q,v,m)});var P=v.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;d=d.replace(P,function(W,U,j){var F=j;v.customizedHeaderId&&(F=j.replace(/\s?\{([^{]+?)}\s*$/,""));var R=r.subParser("spanGamut")(F,v,m),q=v.noHeaderId?"":' id="'+L(j)+'"',$=x-1+U.length,K=""+R+"";return r.subParser("hashBlock")(K,v,m)});function L(W){var U,j;if(v.customizedHeaderId){var F=W.match(/\{([^{]+?)}\s*$/);F&&F[1]&&(W=F[1])}return U=W,r.helper.isString(v.prefixHeaderId)?j=v.prefixHeaderId:v.prefixHeaderId===!0?j="section-":j="",v.rawPrefixHeaderId||(U=j+U),v.ghCompatibleHeaderId?U=U.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():v.rawHeaderId?U=U.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():U=U.replace(/[^\w]/g,"").toLowerCase(),v.rawPrefixHeaderId&&(U=j+U),m.hashLinkCounts[U]?U=U+"-"+m.hashLinkCounts[U]++:m.hashLinkCounts[U]=1,U}return d=m.converter._dispatch("headers.after",d,v,m),d}),r.subParser("horizontalRule",function(d,v,m){d=m.converter._dispatch("horizontalRule.before",d,v,m);var x=r.subParser("hashBlock")("
",v,m);return d=d.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,x),d=d.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,x),d=d.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,x),d=m.converter._dispatch("horizontalRule.after",d,v,m),d}),r.subParser("images",function(d,v,m){d=m.converter._dispatch("images.before",d,v,m);var x=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,A=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,D=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,P=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,L=/!\[([^\[\]]+)]()()()()()/g;function W(j,F,R,q,$,K,ee,N){return q=q.replace(/\s/g,""),U(j,F,R,q,$,K,ee,N)}function U(j,F,R,q,$,K,ee,N){var I=m.gUrls,re=m.gTitles,se=m.gDimensions;if(R=R.toLowerCase(),N||(N=""),j.search(/\(? ?(['"].*['"])?\)$/m)>-1)q="";else if(q===""||q===null)if((R===""||R===null)&&(R=F.toLowerCase().replace(/ ?\n/g," ")),q="#"+R,!r.helper.isUndefined(I[R]))q=I[R],r.helper.isUndefined(re[R])||(N=re[R]),r.helper.isUndefined(se[R])||($=se[R].width,K=se[R].height);else return j;F=F.replace(/"/g,""").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),q=q.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var he=''+F+'","
")}),d=d.replace(/\b__(\S[\s\S]*?)__\b/g,function(A,D){return x(D,"","")}),d=d.replace(/\b_(\S[\s\S]*?)_\b/g,function(A,D){return x(D,"","")})):(d=d.replace(/___(\S[\s\S]*?)___/g,function(A,D){return/\S$/.test(D)?x(D,"",""):A}),d=d.replace(/__(\S[\s\S]*?)__/g,function(A,D){return/\S$/.test(D)?x(D,"",""):A}),d=d.replace(/_([^\s_][\s\S]*?)_/g,function(A,D){return/\S$/.test(D)?x(D,"",""):A})),v.literalMidWordAsterisks?(d=d.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(A,D,P){return x(P,D+"","")}),d=d.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(A,D,P){return x(P,D+"","")}),d=d.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(A,D,P){return x(P,D+"","")})):(d=d.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(A,D){return/\S$/.test(D)?x(D,"",""):A}),d=d.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(A,D){return/\S$/.test(D)?x(D,"",""):A}),d=d.replace(/\*([^\s*][\s\S]*?)\*/g,function(A,D){return/\S$/.test(D)?x(D,"",""):A})),d=m.converter._dispatch("italicsAndBold.after",d,v,m),d}),r.subParser("lists",function(d,v,m){function x(P,L){m.gListLevel++,P=P.replace(/\n{2,}$/,` +`),P+="¨0";var W=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,U=/\n[ \t]*\n(?!¨0)/.test(P);return v.disableForced4SpacesIndentedSublists&&(W=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),P=P.replace(W,function(j,F,R,q,$,K,ee){ee=ee&&ee.trim()!=="";var N=r.subParser("outdent")($,v,m),I="";return K&&v.tasklists&&(I=' class="task-list-item" style="list-style-type: none;"',N=N.replace(/^[ \t]*\[(x|X| )?]/m,function(){var re='-1?(N=r.subParser("githubCodeBlocks")(N,v,m),N=r.subParser("blockGamut")(N,v,m)):(N=r.subParser("lists")(N,v,m),N=N.replace(/\n$/,""),N=r.subParser("hashHTMLBlocks")(N,v,m),N=N.replace(/\n\n+/g,` -`),H?D=r.subParser("paragraphs")(D,v,m):D=r.subParser("spanGamut")(D,v,m)),D=D.replace("¨A",""),D=""+D+` -`,D}),P=P.replace(/¨0/g,""),m.gListLevel--,O&&(P=P.replace(/\s+$/,"")),P}function A(P,O){if(O==="ol"){var V=P.match(/^ *(\d+)\./);if(V&&V[1]!=="1")return' start="'+V[1]+'"'}return""}function L(P,O,V){var H=v.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,j=v.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,F=O==="ul"?H:j,R="";if(P.search(F)!==-1)(function $(K){var ee=K.search(F),D=A(P,O);ee!==-1?(R+=` +`),U?N=r.subParser("paragraphs")(N,v,m):N=r.subParser("spanGamut")(N,v,m)),N=N.replace("¨A",""),N=""+N+` +`,N}),P=P.replace(/¨0/g,""),m.gListLevel--,L&&(P=P.replace(/\s+$/,"")),P}function A(P,L){if(L==="ol"){var W=P.match(/^ *(\d+)\./);if(W&&W[1]!=="1")return' start="'+W[1]+'"'}return""}function D(P,L,W){var U=v.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,j=v.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,F=L==="ul"?U:j,R="";if(P.search(F)!==-1)(function $(K){var ee=K.search(F),N=A(P,L);ee!==-1?(R+=` -<`+O+D+`> -`+x(K.slice(0,ee),!!V)+" -`,O=O==="ul"?"ol":"ul",F=O==="ul"?H:j,$(K.slice(ee))):R+=` +<`+L+N+`> +`+x(K.slice(0,ee),!!W)+" +`,L=L==="ul"?"ol":"ul",F=L==="ul"?U:j,$(K.slice(ee))):R+=` -<`+O+D+`> -`+x(K,!!V)+" -`})(P);else{var q=A(P,O);R=` +<`+L+N+`> +`+x(K,!!W)+" +`})(P);else{var q=A(P,L);R=` -<`+O+q+`> -`+x(P,!!V)+" -`}return R}return d=m.converter._dispatch("lists.before",d,v,m),d+="¨0",m.gListLevel?d=d.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(P,O,V){var H=V.search(/[*+-]/g)>-1?"ul":"ol";return L(O,H,!0)}):d=d.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(P,O,V,H){var j=H.search(/[*+-]/g)>-1?"ul":"ol";return L(V,j,!1)}),d=d.replace(/¨0/,""),d=m.converter._dispatch("lists.after",d,v,m),d}),r.subParser("metadata",function(d,v,m){if(!v.metadata)return d;d=m.converter._dispatch("metadata.before",d,v,m);function x(A){m.metadata.raw=A,A=A.replace(/&/g,"&").replace(/"/g,"""),A=A.replace(/\n {4}/g," "),A.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(L,P,O){return m.metadata.parsed[P]=O,""})}return d=d.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(A,L,P){return x(P),"¨M"}),d=d.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(A,L,P){return L&&(m.metadata.format=L),x(P),"¨M"}),d=d.replace(/¨M/g,""),d=m.converter._dispatch("metadata.after",d,v,m),d}),r.subParser("outdent",function(d,v,m){return d=m.converter._dispatch("outdent.before",d,v,m),d=d.replace(/^(\t|[ ]{1,4})/gm,"¨0"),d=d.replace(/¨0/g,""),d=m.converter._dispatch("outdent.after",d,v,m),d}),r.subParser("paragraphs",function(d,v,m){d=m.converter._dispatch("paragraphs.before",d,v,m),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,"");for(var x=d.split(/\n{2,}/g),A=[],L=x.length,P=0;P=0?A.push(O):O.search(/\S/)>=0&&(O=r.subParser("spanGamut")(O,v,m),O=O.replace(/^([ \t]*)/g,"

"),O+="

",A.push(O))}for(L=A.length,P=0;P]*>\s*]*>/.test(H)&&(j=!0)}A[P]=H}return d=A.join(` +<`+L+q+`> +`+x(P,!!W)+" +`}return R}return d=m.converter._dispatch("lists.before",d,v,m),d+="¨0",m.gListLevel?d=d.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(P,L,W){var U=W.search(/[*+-]/g)>-1?"ul":"ol";return D(L,U,!0)}):d=d.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(P,L,W,U){var j=U.search(/[*+-]/g)>-1?"ul":"ol";return D(W,j,!1)}),d=d.replace(/¨0/,""),d=m.converter._dispatch("lists.after",d,v,m),d}),r.subParser("metadata",function(d,v,m){if(!v.metadata)return d;d=m.converter._dispatch("metadata.before",d,v,m);function x(A){m.metadata.raw=A,A=A.replace(/&/g,"&").replace(/"/g,"""),A=A.replace(/\n {4}/g," "),A.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(D,P,L){return m.metadata.parsed[P]=L,""})}return d=d.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(A,D,P){return x(P),"¨M"}),d=d.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(A,D,P){return D&&(m.metadata.format=D),x(P),"¨M"}),d=d.replace(/¨M/g,""),d=m.converter._dispatch("metadata.after",d,v,m),d}),r.subParser("outdent",function(d,v,m){return d=m.converter._dispatch("outdent.before",d,v,m),d=d.replace(/^(\t|[ ]{1,4})/gm,"¨0"),d=d.replace(/¨0/g,""),d=m.converter._dispatch("outdent.after",d,v,m),d}),r.subParser("paragraphs",function(d,v,m){d=m.converter._dispatch("paragraphs.before",d,v,m),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,"");for(var x=d.split(/\n{2,}/g),A=[],D=x.length,P=0;P=0?A.push(L):L.search(/\S/)>=0&&(L=r.subParser("spanGamut")(L,v,m),L=L.replace(/^([ \t]*)/g,"

"),L+="

",A.push(L))}for(D=A.length,P=0;P]*>\s*]*>/.test(U)&&(j=!0)}A[P]=U}return d=A.join(` `),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,""),m.converter._dispatch("paragraphs.after",d,v,m)}),r.subParser("runExtension",function(d,v,m,x){if(d.filter)v=d.filter(v,x.converter,m);else if(d.regex){var A=d.regex;A instanceof RegExp||(A=new RegExp(A,"g")),v=v.replace(A,d.replace)}return v}),r.subParser("spanGamut",function(d,v,m){return d=m.converter._dispatch("spanGamut.before",d,v,m),d=r.subParser("codeSpans")(d,v,m),d=r.subParser("escapeSpecialCharsWithinTagAttributes")(d,v,m),d=r.subParser("encodeBackslashEscapes")(d,v,m),d=r.subParser("images")(d,v,m),d=r.subParser("anchors")(d,v,m),d=r.subParser("autoLinks")(d,v,m),d=r.subParser("simplifiedAutoLinks")(d,v,m),d=r.subParser("emoji")(d,v,m),d=r.subParser("underline")(d,v,m),d=r.subParser("italicsAndBold")(d,v,m),d=r.subParser("strikethrough")(d,v,m),d=r.subParser("ellipsis")(d,v,m),d=r.subParser("hashHTMLSpans")(d,v,m),d=r.subParser("encodeAmpsAndAngles")(d,v,m),v.simpleLineBreaks?/\n\n¨K/.test(d)||(d=d.replace(/\n+/g,`
`)):d=d.replace(/ +\n/g,`
-`),d=m.converter._dispatch("spanGamut.after",d,v,m),d}),r.subParser("strikethrough",function(d,v,m){function x(A){return v.simplifiedAutoLink&&(A=r.subParser("simplifiedAutoLinks")(A,v,m)),""+A+""}return v.strikethrough&&(d=m.converter._dispatch("strikethrough.before",d,v,m),d=d.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(A,L){return x(L)}),d=m.converter._dispatch("strikethrough.after",d,v,m)),d}),r.subParser("stripLinkDefinitions",function(d,v,m){var x=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,A=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;d+="¨0";var L=function(P,O,V,H,j,F,R){return O=O.toLowerCase(),V.match(/^data:.+?\/.+?;base64,/)?m.gUrls[O]=V.replace(/\s/g,""):m.gUrls[O]=r.subParser("encodeAmpsAndAngles")(V,v,m),F?F+R:(R&&(m.gTitles[O]=R.replace(/"|'/g,""")),v.parseImgDimensions&&H&&j&&(m.gDimensions[O]={width:H,height:j}),"")};return d=d.replace(A,L),d=d.replace(x,L),d=d.replace(/¨0/,""),d}),r.subParser("tables",function(d,v,m){if(!v.tables)return d;var x=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,A=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function L(j){return/^:[ \t]*--*$/.test(j)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(j)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(j)?' style="text-align:center;"':""}function P(j,F){var R="";return j=j.trim(),(v.tablesHeaderId||v.tableHeaderId)&&(R=' id="'+j.replace(/ /g,"_").toLowerCase()+'"'),j=r.subParser("spanGamut")(j,v,m),""+j+` -`}function O(j,F){var R=r.subParser("spanGamut")(j,v,m);return""+R+` -`}function V(j,F){for(var R=` +`),d=m.converter._dispatch("spanGamut.after",d,v,m),d}),r.subParser("strikethrough",function(d,v,m){function x(A){return v.simplifiedAutoLink&&(A=r.subParser("simplifiedAutoLinks")(A,v,m)),""+A+""}return v.strikethrough&&(d=m.converter._dispatch("strikethrough.before",d,v,m),d=d.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(A,D){return x(D)}),d=m.converter._dispatch("strikethrough.after",d,v,m)),d}),r.subParser("stripLinkDefinitions",function(d,v,m){var x=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,A=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;d+="¨0";var D=function(P,L,W,U,j,F,R){return L=L.toLowerCase(),W.match(/^data:.+?\/.+?;base64,/)?m.gUrls[L]=W.replace(/\s/g,""):m.gUrls[L]=r.subParser("encodeAmpsAndAngles")(W,v,m),F?F+R:(R&&(m.gTitles[L]=R.replace(/"|'/g,""")),v.parseImgDimensions&&U&&j&&(m.gDimensions[L]={width:U,height:j}),"")};return d=d.replace(A,D),d=d.replace(x,D),d=d.replace(/¨0/,""),d}),r.subParser("tables",function(d,v,m){if(!v.tables)return d;var x=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,A=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function D(j){return/^:[ \t]*--*$/.test(j)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(j)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(j)?' style="text-align:center;"':""}function P(j,F){var R="";return j=j.trim(),(v.tablesHeaderId||v.tableHeaderId)&&(R=' id="'+j.replace(/ /g,"_").toLowerCase()+'"'),j=r.subParser("spanGamut")(j,v,m),""+j+` +`}function L(j,F){var R=r.subParser("spanGamut")(j,v,m);return""+R+` +`}function W(j,F){for(var R=`
`,q=j.length,$=0;$ @@ -452,13 +452,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `;for(var K=0;K `}return R+=`
-`,R}function H(j){var F,R=j.split(` -`);for(F=0;F"+A+""}),d=d.replace(/\b__(\S[\s\S]*?)__\b/g,function(x,A){return""+A+""})):(d=d.replace(/___(\S[\s\S]*?)___/g,function(x,A){return/\S$/.test(A)?""+A+"":x}),d=d.replace(/__(\S[\s\S]*?)__/g,function(x,A){return/\S$/.test(A)?""+A+"":x})),d=d.replace(/(_)/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("underline.after",d,v,m)),d}),r.subParser("unescapeSpecialChars",function(d,v,m){return d=m.converter._dispatch("unescapeSpecialChars.before",d,v,m),d=d.replace(/¨E(\d+)E/g,function(x,A){var L=parseInt(A);return String.fromCharCode(L)}),d=m.converter._dispatch("unescapeSpecialChars.after",d,v,m),d}),r.subParser("makeMarkdown.blockquote",function(d,v){var m="";if(d.hasChildNodes())for(var x=d.childNodes,A=x.length,L=0;L "+m.split(` +`,R}function U(j){var F,R=j.split(` +`);for(F=0;F"+A+""}),d=d.replace(/\b__(\S[\s\S]*?)__\b/g,function(x,A){return""+A+""})):(d=d.replace(/___(\S[\s\S]*?)___/g,function(x,A){return/\S$/.test(A)?""+A+"":x}),d=d.replace(/__(\S[\s\S]*?)__/g,function(x,A){return/\S$/.test(A)?""+A+"":x})),d=d.replace(/(_)/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("underline.after",d,v,m)),d}),r.subParser("unescapeSpecialChars",function(d,v,m){return d=m.converter._dispatch("unescapeSpecialChars.before",d,v,m),d=d.replace(/¨E(\d+)E/g,function(x,A){var D=parseInt(A);return String.fromCharCode(D)}),d=m.converter._dispatch("unescapeSpecialChars.after",d,v,m),d}),r.subParser("makeMarkdown.blockquote",function(d,v){var m="";if(d.hasChildNodes())for(var x=d.childNodes,A=x.length,D=0;D "+m.split(` `).join(` > `),m}),r.subParser("makeMarkdown.codeBlock",function(d,v){var m=d.getAttribute("language"),x=d.getAttribute("precodenum");return"```"+m+` -`+v.preList[x]+"\n```"}),r.subParser("makeMarkdown.codeSpan",function(d){return"`"+d.innerHTML+"`"}),r.subParser("makeMarkdown.emphasis",function(d,v){var m="";if(d.hasChildNodes()){m+="*";for(var x=d.childNodes,A=x.length,L=0;L",d.hasAttribute("width")&&d.hasAttribute("height")&&(v+=" ="+d.getAttribute("width")+"x"+d.getAttribute("height")),d.hasAttribute("title")&&(v+=' "'+d.getAttribute("title")+'"'),v+=")"),v}),r.subParser("makeMarkdown.links",function(d,v){var m="";if(d.hasChildNodes()&&d.hasAttribute("href")){var x=d.childNodes,A=x.length;m="[";for(var L=0;L",d.hasAttribute("title")&&(m+=' "'+d.getAttribute("title")+'"'),m+=")"}return m}),r.subParser("makeMarkdown.list",function(d,v,m){var x="";if(!d.hasChildNodes())return"";for(var A=d.childNodes,L=A.length,P=d.getAttribute("start")||1,O=0;O"u"||A[O].tagName.toLowerCase()!=="li")){var V="";m==="ol"?V=P.toString()+". ":V="- ",x+=V+r.subParser("makeMarkdown.listItem")(A[O],v),++P}return x+=` +`+v.preList[x]+"\n```"}),r.subParser("makeMarkdown.codeSpan",function(d){return"`"+d.innerHTML+"`"}),r.subParser("makeMarkdown.emphasis",function(d,v){var m="";if(d.hasChildNodes()){m+="*";for(var x=d.childNodes,A=x.length,D=0;D",d.hasAttribute("width")&&d.hasAttribute("height")&&(v+=" ="+d.getAttribute("width")+"x"+d.getAttribute("height")),d.hasAttribute("title")&&(v+=' "'+d.getAttribute("title")+'"'),v+=")"),v}),r.subParser("makeMarkdown.links",function(d,v){var m="";if(d.hasChildNodes()&&d.hasAttribute("href")){var x=d.childNodes,A=x.length;m="[";for(var D=0;D",d.hasAttribute("title")&&(m+=' "'+d.getAttribute("title")+'"'),m+=")"}return m}),r.subParser("makeMarkdown.list",function(d,v,m){var x="";if(!d.hasChildNodes())return"";for(var A=d.childNodes,D=A.length,P=d.getAttribute("start")||1,L=0;L"u"||A[L].tagName.toLowerCase()!=="li")){var W="";m==="ol"?W=P.toString()+". ":W="- ",x+=W+r.subParser("makeMarkdown.listItem")(A[L],v),++P}return x+=` -`,x.trim()}),r.subParser("makeMarkdown.listItem",function(d,v){for(var m="",x=d.childNodes,A=x.length,L=0;L"+v.preList[m]+""}),r.subParser("makeMarkdown.strikethrough",function(d,v){var m="";if(d.hasChildNodes()){m+="~~";for(var x=d.childNodes,A=x.length,L=0;Ltr>th"),L=d.querySelectorAll("tbody>tr"),P,O;for(P=0;P$&&($=K)}for(P=0;P/g,"\\$1>"),v=v.replace(/^#/gm,"\\#"),v=v.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),v=v.replace(/^( {0,3}\d+)\./gm,"$1\\."),v=v.replace(/^( {0,3})([+-])/gm,"$1\\$2"),v=v.replace(/]([\s]*)\(/g,"\\]$1\\("),v=v.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),v});var C=this;e.exports?e.exports=r:C.showdown=r}).call(Qn)})(fq);var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.useStyles=void 0;var hq=q_;fp.useStyles=hq.createUseStyles(function(e){return{yamde:{margin:"16px 0",width:"100%",boxSizing:"initial","@media screen and (max-width: 767px)":{overflow:"hidden"}},toolbar:{display:"flex",marginBottom:"-1px",maxHeight:"36px",width:"100%"},buttons:{display:"flex","@media screen and (max-width: 767px)":{display:"none"}},mobileButton:{display:"none","@media screen and (max-width: 767px)":{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(34px, 1fr))",marginTop:"-1px"}},viewSwitch:{marginLeft:"auto",display:"flex",marginTop:"-1px"},viewButton:{cursor:"pointer",fontSize:"14px",backgroundColor:e.switchButtonBackgroundColor,display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid "+e.switchButtonBorderColor,transition:"background-color 0.2s ease",fontWeight:400,padding:"0 10px",width:"65px",height:"35px",color:e.switchButtonColorView,zIndex:1,fontFamily:"Helvetica, Arial, sans-serif","&:first-child":{borderRight:0},"&:hover":{color:e.switchButtonColorHover,backgroundColor:e.switchButtonBackgroundColorHover,transition:"background-color 0.2s ease"}},activeView:{borderBottom:"1px solid "+e.switchButtonBorderColorActiveView,color:e.switchButtonColorActiveView,backgroundColor:e.switchButtonBackgroundColorActiveView,"&:hover":{backgroundColor:e.switchButtonBackgroundColorActiveView}},contentArea:{marginTop:"-1px",display:"flex","& > textarea":{borderRadius:0,border:"1px solid "+e.textAreaBorderColor,width:"calc(100% - 34px)",padding:"16px",resize:"none",background:e.contentAreaBackgroundColor,color:e.textColor,"&::selection":{backgroundColor:e.textAreaSelectionBackgroundColor,color:e.textAreaSelectionColor},"&:active, &:focus":{border:"1px solid "+e.textAreaBorderColor,outline:"none"}}},preview:{background:e.contentAreaBackgroundColor,border:"1px solid "+e.previewAreaBorderColor,width:"calc(100% - 34px)",padding:"16px",minHeight:"50px",fontSize:"1rem",fontWeight:400,fontFamily:"Helvetica, Arial, sans-serif","& > p":{color:e.textColor+" !important",fontFamily:"inherit",textAlign:"left",fontSize:"16px",fontWeight:400,marginBottom:"1rem",marginTop:0,"& > img":{maxWidth:"100%"}},"& code":{fontFamily:'source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace',fontSize:"12px",background:e.codeBlockBackgroundColor,padding:"4px 8px"},"& pre":{width:"auto",background:e.codeBlockBackgroundColor,padding:"4px 8px"},"& > h1, & > h2, & > h3, & > h4, & > h5, & > h6":{color:e.textColor+" !important",fontFamily:"inherit",textAlign:"left"},"& a":{textDecoration:"underline !important",fontFamily:"inherit",color:e.linkColor+" !important"},"& > blockquote":{padding:"8px 24px",lineHeight:"1em",marginBlockStart:"1em",marginBlockEnd:"1em",marginInlineStart:0,marginInlineEnd:0,fontStyle:"italic",borderLeft:"5px solid "+e.quoteAdornmentColor,fontSize:"1.15em","& > p":{color:e.textColor+" !important"}},"& > table":{borderCollapse:"collapse","& th, & td":{border:"1px solid "+e.tableBorderColor,padding:"4px",color:e.textColor}},"& ul, & ol, & li":{color:e.textColor}},button:{cursor:"pointer",backgroundColor:e.buttonBackgroundColor,fontSize:"13px",fontFamily:"Courier, Helvetica, Arial, sans-serif",fontWeight:400,width:"34px",height:"34px",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid "+e.buttonBorderColor,transition:"background-color 0.2s ease",marginRight:"-1px",color:e.buttonColor,"&:hover":{backgroundColor:e.buttonBackgroundColorHover,transition:"background-color 0.2s ease"},"& > svg":{width:"16px",height:"16px"}}}});var hp={},Ef={},pq={get exports(){return Ef},set exports(e){Ef=e}},pp={},Zn={},mq={get exports(){return Zn},set exports(e){Zn=e}},Rf={},gq={get exports(){return Rf},set exports(e){Rf=e}};(function(e){function t(n){return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(gq);(function(e){var t=Rf.default;function n(i){if(typeof WeakMap!="function")return null;var o=new WeakMap,a=new WeakMap;return(n=function(u){return u?a:o})(i)}function r(i,o){if(!o&&i&&i.__esModule)return i;if(i===null||t(i)!=="object"&&typeof i!="function")return{default:i};var a=n(o);if(a&&a.has(i))return a.get(i);var s={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in i)if(l!=="default"&&Object.prototype.hasOwnProperty.call(i,l)){var c=u?Object.getOwnPropertyDescriptor(i,l):null;c&&(c.get||c.set)?Object.defineProperty(s,l,c):s[l]=i[l]}return s.default=i,a&&a.set(i,s),s}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(mq);var bn={},vq={get exports(){return bn},set exports(e){bn=e}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(vq);var Af={},yq={get exports(){return Af},set exports(e){Af=e}},Tf={},bq={get exports(){return Tf},set exports(e){Tf=e}},Q4;function K_(){return Q4||(Q4=1,function(e){function t(n,r,i){return r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(bq)),Tf}var J4;function wr(){return J4||(J4=1,function(e){var t=K_();function n(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);o&&(s=s.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),a.push.apply(a,s)}return a}function r(i){for(var o=1;on.length)&&(r=n.length);for(var i=0,o=new Array(r);i=0)&&(i[a]=n[a]);return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Lq)),zf}var s8;function Y_(){return s8||(s8=1,function(e){var t=Dq();function n(r,i){if(r==null)return{};var o=t(r,i),a,s;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(r,a)&&(o[a]=r[a])}return o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Oq)),Nf}var jf={},Mq={get exports(){return jf},set exports(e){jf=e}};/*! +`}return x}),r.subParser("makeMarkdown.paragraph",function(d,v){var m="";if(d.hasChildNodes())for(var x=d.childNodes,A=x.length,D=0;D"+v.preList[m]+""}),r.subParser("makeMarkdown.strikethrough",function(d,v){var m="";if(d.hasChildNodes()){m+="~~";for(var x=d.childNodes,A=x.length,D=0;Dtr>th"),D=d.querySelectorAll("tbody>tr"),P,L;for(P=0;P$&&($=K)}for(P=0;P/g,"\\$1>"),v=v.replace(/^#/gm,"\\#"),v=v.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),v=v.replace(/^( {0,3}\d+)\./gm,"$1\\."),v=v.replace(/^( {0,3})([+-])/gm,"$1\\$2"),v=v.replace(/]([\s]*)\(/g,"\\]$1\\("),v=v.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),v});var C=this;e.exports?e.exports=r:C.showdown=r}).call(Zn)})(kq);var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.useStyles=void 0;var xq=X_;hp.useStyles=xq.createUseStyles(function(e){return{yamde:{margin:"16px 0",width:"100%",boxSizing:"initial","@media screen and (max-width: 767px)":{overflow:"hidden"}},toolbar:{display:"flex",marginBottom:"-1px",maxHeight:"36px",width:"100%"},buttons:{display:"flex","@media screen and (max-width: 767px)":{display:"none"}},mobileButton:{display:"none","@media screen and (max-width: 767px)":{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(34px, 1fr))",marginTop:"-1px"}},viewSwitch:{marginLeft:"auto",display:"flex",marginTop:"-1px"},viewButton:{cursor:"pointer",fontSize:"14px",backgroundColor:e.switchButtonBackgroundColor,display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid "+e.switchButtonBorderColor,transition:"background-color 0.2s ease",fontWeight:400,padding:"0 10px",width:"65px",height:"35px",color:e.switchButtonColorView,zIndex:1,fontFamily:"Helvetica, Arial, sans-serif","&:first-child":{borderRight:0},"&:hover":{color:e.switchButtonColorHover,backgroundColor:e.switchButtonBackgroundColorHover,transition:"background-color 0.2s ease"}},activeView:{borderBottom:"1px solid "+e.switchButtonBorderColorActiveView,color:e.switchButtonColorActiveView,backgroundColor:e.switchButtonBackgroundColorActiveView,"&:hover":{backgroundColor:e.switchButtonBackgroundColorActiveView}},contentArea:{marginTop:"-1px",display:"flex","& > textarea":{borderRadius:0,border:"1px solid "+e.textAreaBorderColor,width:"calc(100% - 34px)",padding:"16px",resize:"none",background:e.contentAreaBackgroundColor,color:e.textColor,"&::selection":{backgroundColor:e.textAreaSelectionBackgroundColor,color:e.textAreaSelectionColor},"&:active, &:focus":{border:"1px solid "+e.textAreaBorderColor,outline:"none"}}},preview:{background:e.contentAreaBackgroundColor,border:"1px solid "+e.previewAreaBorderColor,width:"calc(100% - 34px)",padding:"16px",minHeight:"50px",fontSize:"1rem",fontWeight:400,fontFamily:"Helvetica, Arial, sans-serif","& > p":{color:e.textColor+" !important",fontFamily:"inherit",textAlign:"left",fontSize:"16px",fontWeight:400,marginBottom:"1rem",marginTop:0,"& > img":{maxWidth:"100%"}},"& code":{fontFamily:'source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace',fontSize:"12px",background:e.codeBlockBackgroundColor,padding:"4px 8px"},"& pre":{width:"auto",background:e.codeBlockBackgroundColor,padding:"4px 8px"},"& > h1, & > h2, & > h3, & > h4, & > h5, & > h6":{color:e.textColor+" !important",fontFamily:"inherit",textAlign:"left"},"& a":{textDecoration:"underline !important",fontFamily:"inherit",color:e.linkColor+" !important"},"& > blockquote":{padding:"8px 24px",lineHeight:"1em",marginBlockStart:"1em",marginBlockEnd:"1em",marginInlineStart:0,marginInlineEnd:0,fontStyle:"italic",borderLeft:"5px solid "+e.quoteAdornmentColor,fontSize:"1.15em","& > p":{color:e.textColor+" !important"}},"& > table":{borderCollapse:"collapse","& th, & td":{border:"1px solid "+e.tableBorderColor,padding:"4px",color:e.textColor}},"& ul, & ol, & li":{color:e.textColor}},button:{cursor:"pointer",backgroundColor:e.buttonBackgroundColor,fontSize:"13px",fontFamily:"Courier, Helvetica, Arial, sans-serif",fontWeight:400,width:"34px",height:"34px",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid "+e.buttonBorderColor,transition:"background-color 0.2s ease",marginRight:"-1px",color:e.buttonColor,"&:hover":{backgroundColor:e.buttonBackgroundColorHover,transition:"background-color 0.2s ease"},"& > svg":{width:"16px",height:"16px"}}}});var pp={},Af={},Cq={get exports(){return Af},set exports(e){Af=e}},mp={},tr={},_q={get exports(){return tr},set exports(e){tr=e}},Tf={},Eq={get exports(){return Tf},set exports(e){Tf=e}};(function(e){function t(n){return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Eq);(function(e){var t=Tf.default;function n(i){if(typeof WeakMap!="function")return null;var o=new WeakMap,a=new WeakMap;return(n=function(u){return u?a:o})(i)}function r(i,o){if(!o&&i&&i.__esModule)return i;if(i===null||t(i)!=="object"&&typeof i!="function")return{default:i};var a=n(o);if(a&&a.has(i))return a.get(i);var s={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in i)if(l!=="default"&&Object.prototype.hasOwnProperty.call(i,l)){var c=u?Object.getOwnPropertyDescriptor(i,l):null;c&&(c.get||c.set)?Object.defineProperty(s,l,c):s[l]=i[l]}return s.default=i,a&&a.set(i,s),s}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(_q);var wn={},Rq={get exports(){return wn},set exports(e){wn=e}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Rq);var Pf={},Aq={get exports(){return Pf},set exports(e){Pf=e}},If={},Tq={get exports(){return If},set exports(e){If=e}},a8;function Q_(){return a8||(a8=1,function(e){function t(n,r,i){return r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Tq)),If}var s8;function xr(){return s8||(s8=1,function(e){var t=Q_();function n(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);o&&(s=s.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),a.push.apply(a,s)}return a}function r(i){for(var o=1;on.length)&&(r=n.length);for(var i=0,o=new Array(r);i=0)&&(i[a]=n[a]);return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Uq)),Bf}var g8;function Z_(){return g8||(g8=1,function(e){var t=Vq();function n(r,i){if(r==null)return{};var o=t(r,i),a,s;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(r,a)&&(o[a]=r[a])}return o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Hq)),jf}var Ff={},Wq={get exports(){return Ff},set exports(e){Ff=e}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/var l8;function Nq(){return l8||(l8=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i1)&&(e=1),e}function Nc(e){return e<=1?Number(e)*100+"%":e}function Eg(e){return e.length===1?"0"+e:String(e)}function Fq(e,t,n){return{r:jr(e,255)*255,g:jr(t,255)*255,b:jr(n,255)*255}}function Rg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $q(e,t,n){var r,i,o;if(e=jr(e,360),t=jr(t,100),n=jr(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Rg(s,a,e+1/3),i=Rg(s,a,e),o=Rg(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function Uq(e,t,n){e=jr(e,255),t=jr(t,255),n=jr(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,u=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-zc*t:Math.round(e.h)+zc*t:r=n?Math.round(e.h)+zc*t:Math.round(e.h)-zc*t,r<0?r+=360:r>=360&&(r-=360),r}function m8(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-f8*t:t===J_?r=e.s+f8:r=e.s+Gq*t,r>1&&(r=1),n&&t===Q_&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function g8(e,t,n){var r;return n?r=e.v+Yq*t:r=e.v-Xq*t,r>1&&(r=1),Number(r.toFixed(2))}function B1(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=ol(e),i=Q_;i>0;i-=1){var o=h8(r),a=jc(ol({h:p8(o,i,!0),s:m8(o,i,!0),v:g8(o,i,!0)}));n.push(a)}n.push(jc(r));for(var s=1;s<=J_;s+=1){var u=h8(r),l=jc(ol({h:p8(u,s),s:m8(u,s),v:g8(u,s)}));n.push(l)}return t.theme==="dark"?Qq.map(function(c){var h=c.index,p=c.opacity,y=jc(Jq(ol(t.backgroundColor||"#141414"),ol(n[h]),p*100));return y}):n}var Cd={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},vn={},_d={};Object.keys(Cd).forEach(function(e){vn[e]=B1(Cd[e]),vn[e].primary=vn[e][5],_d[e]=B1(Cd[e],{theme:"dark",backgroundColor:"#141414"}),_d[e].primary=_d[e][5]});var Zq=vn.red,eK=vn.volcano,tK=vn.gold,nK=vn.orange,rK=vn.yellow,iK=vn.lime,oK=vn.green,aK=vn.cyan,sK=vn.blue,lK=vn.geekblue,uK=vn.purple,cK=vn.magenta,dK=vn.grey;const fK=Object.freeze(Object.defineProperty({__proto__:null,blue:sK,cyan:aK,geekblue:lK,generate:B1,gold:tK,green:oK,grey:dK,lime:iK,magenta:cK,orange:nK,presetDarkPalettes:_d,presetPalettes:vn,presetPrimaryColors:Cd,purple:uK,red:Zq,volcano:eK,yellow:rK},Symbol.toStringTag,{value:"Module"})),hK=A6(fK);var Kr={},v8;function pK(){if(v8)return Kr;v8=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.warning=t,Kr.note=n,Kr.resetWarned=r,Kr.call=i,Kr.warningOnce=o,Kr.noteOnce=a,Kr.default=void 0;var e={};function t(u,l){}function n(u,l){}function r(){e={}}function i(u,l,c){!l&&!e[c]&&(u(!1,c),e[c]=!0)}function o(u,l){i(t,u,l)}function a(u,l){i(n,u,l)}var s=o;return Kr.default=s,Kr}var al={},Bc={},y8;function mK(){if(y8)return Bc;y8=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.default=e;function e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}return Bc}var b8;function gK(){if(b8)return al;b8=1;var e=bn;Object.defineProperty(al,"__esModule",{value:!0}),al.injectCSS=i,al.updateCSS=a;var t=e(mK()),n="rc-util-key";function r(s){if(s.attachTo)return s.attachTo;var u=document.querySelector("head");return u||document.body}function i(s){var u,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,t.default)())return null;var c=document.createElement("style");if(!((u=l.csp)===null||u===void 0)&&u.nonce){var h;c.nonce=(h=l.csp)===null||h===void 0?void 0:h.nonce}c.innerHTML=s;var p=r(l),y=p.firstChild;return l.prepend&&p.prepend?p.prepend(c):l.prepend&&y?p.insertBefore(c,y):p.appendChild(c),c}var o=new Map;function a(s,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=r(l);if(!o.has(c)){var h=i("",l),p=h.parentNode;o.set(c,p),p.removeChild(h)}var y=Array.from(o.get(c).children).find(function(k){return k.tagName==="STYLE"&&k[n]===u});if(y){var g,b;if(!((g=l.csp)===null||g===void 0)&&g.nonce&&y.nonce!==((b=l.csp)===null||b===void 0?void 0:b.nonce)){var _;y.nonce=(_=l.csp)===null||_===void 0?void 0:_.nonce}return y.innerHTML!==s&&(y.innerHTML=s),y}var S=i(s,l);return S[n]=u,S}return al}var w8;function o2(){if(w8)return Pn;w8=1;var e=Zn,t=bn;Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.warning=l,Pn.isIconDefinition=c,Pn.normalizeAttrs=h,Pn.generate=p,Pn.getSecondaryColor=y,Pn.normalizeTwoToneColors=g,Pn.useInsertStyles=Pn.iconStyles=Pn.svgBaseProps=void 0;var n=t(wr()),r=t(Rf),i=hK,o=e(w),a=t(pK()),s=gK(),u=t(X_());function l(k,C){(0,a.default)(k,"[@ant-design/icons] ".concat(C))}function c(k){return(0,r.default)(k)==="object"&&typeof k.name=="string"&&typeof k.theme=="string"&&((0,r.default)(k.icon)==="object"||typeof k.icon=="function")}function h(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(k).reduce(function(C,d){var v=k[d];switch(d){case"class":C.className=v,delete C.class;break;default:C[d]=v}return C},{})}function p(k,C,d){return d?o.default.createElement(k.tag,(0,n.default)((0,n.default)({key:C},h(k.attrs)),d),(k.children||[]).map(function(v,m){return p(v,"".concat(C,"-").concat(k.tag,"-").concat(m))})):o.default.createElement(k.tag,(0,n.default)({key:C},h(k.attrs)),(k.children||[]).map(function(v,m){return p(v,"".concat(C,"-").concat(k.tag,"-").concat(m))}))}function y(k){return(0,i.generate)(k)[0]}function g(k){return k?Array.isArray(k)?k:[k]:[]}var b={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"};Pn.svgBaseProps=b;var _=` +*/var v8;function qq(){return v8||(v8=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i1)&&(e=1),e}function jc(e){return e<=1?Number(e)*100+"%":e}function Rg(e){return e.length===1?"0"+e:String(e)}function Xq(e,t,n){return{r:$r(e,255)*255,g:$r(t,255)*255,b:$r(n,255)*255}}function Ag(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Qq(e,t,n){var r,i,o;if(e=$r(e,360),t=$r(t,100),n=$r(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Ag(s,a,e+1/3),i=Ag(s,a,e),o=Ag(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function Jq(e,t,n){e=$r(e,255),t=$r(t,255),n=$r(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,u=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-Bc*t:Math.round(e.h)+Bc*t:r=n?Math.round(e.h)+Bc*t:Math.round(e.h)-Bc*t,r<0?r+=360:r>=360&&(r-=360),r}function C8(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-S8*t:t===n7?r=e.s+S8:r=e.s+iK*t,r>1&&(r=1),n&&t===t7&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function _8(e,t,n){var r;return n?r=e.v+oK*t:r=e.v-aK*t,r>1&&(r=1),Number(r.toFixed(2))}function F1(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=al(e),i=t7;i>0;i-=1){var o=k8(r),a=Fc(al({h:x8(o,i,!0),s:C8(o,i,!0),v:_8(o,i,!0)}));n.push(a)}n.push(Fc(r));for(var s=1;s<=n7;s+=1){var u=k8(r),l=Fc(al({h:x8(u,s),s:C8(u,s),v:_8(u,s)}));n.push(l)}return t.theme==="dark"?sK.map(function(c){var h=c.index,p=c.opacity,y=Fc(lK(al(t.backgroundColor||"#141414"),al(n[h]),p*100));return y}):n}var Ed={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},yn={},Rd={};Object.keys(Ed).forEach(function(e){yn[e]=F1(Ed[e]),yn[e].primary=yn[e][5],Rd[e]=F1(Ed[e],{theme:"dark",backgroundColor:"#141414"}),Rd[e].primary=Rd[e][5]});var uK=yn.red,cK=yn.volcano,dK=yn.gold,fK=yn.orange,hK=yn.yellow,pK=yn.lime,mK=yn.green,gK=yn.cyan,vK=yn.blue,yK=yn.geekblue,bK=yn.purple,wK=yn.magenta,SK=yn.grey;const kK=Object.freeze(Object.defineProperty({__proto__:null,blue:vK,cyan:gK,geekblue:yK,generate:F1,gold:dK,green:mK,grey:SK,lime:pK,magenta:wK,orange:fK,presetDarkPalettes:Rd,presetPalettes:yn,presetPrimaryColors:Ed,purple:bK,red:uK,volcano:cK,yellow:hK},Symbol.toStringTag,{value:"Module"})),xK=j6(kK);var Yr={},E8;function CK(){if(E8)return Yr;E8=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.warning=t,Yr.note=n,Yr.resetWarned=r,Yr.call=i,Yr.warningOnce=o,Yr.noteOnce=a,Yr.default=void 0;var e={};function t(u,l){}function n(u,l){}function r(){e={}}function i(u,l,c){!l&&!e[c]&&(u(!1,c),e[c]=!0)}function o(u,l){i(t,u,l)}function a(u,l){i(n,u,l)}var s=o;return Yr.default=s,Yr}var sl={},$c={},R8;function _K(){if(R8)return $c;R8=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.default=e;function e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}return $c}var A8;function EK(){if(A8)return sl;A8=1;var e=wn;Object.defineProperty(sl,"__esModule",{value:!0}),sl.injectCSS=i,sl.updateCSS=a;var t=e(_K()),n="rc-util-key";function r(s){if(s.attachTo)return s.attachTo;var u=document.querySelector("head");return u||document.body}function i(s){var u,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,t.default)())return null;var c=document.createElement("style");if(!((u=l.csp)===null||u===void 0)&&u.nonce){var h;c.nonce=(h=l.csp)===null||h===void 0?void 0:h.nonce}c.innerHTML=s;var p=r(l),y=p.firstChild;return l.prepend&&p.prepend?p.prepend(c):l.prepend&&y?p.insertBefore(c,y):p.appendChild(c),c}var o=new Map;function a(s,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=r(l);if(!o.has(c)){var h=i("",l),p=h.parentNode;o.set(c,p),p.removeChild(h)}var y=Array.from(o.get(c).children).find(function(k){return k.tagName==="STYLE"&&k[n]===u});if(y){var g,b;if(!((g=l.csp)===null||g===void 0)&&g.nonce&&y.nonce!==((b=l.csp)===null||b===void 0?void 0:b.nonce)){var _;y.nonce=(_=l.csp)===null||_===void 0?void 0:_.nonce}return y.innerHTML!==s&&(y.innerHTML=s),y}var S=i(s,l);return S[n]=u,S}return sl}var T8;function f2(){if(T8)return Pn;T8=1;var e=tr,t=wn;Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.warning=l,Pn.isIconDefinition=c,Pn.normalizeAttrs=h,Pn.generate=p,Pn.getSecondaryColor=y,Pn.normalizeTwoToneColors=g,Pn.useInsertStyles=Pn.iconStyles=Pn.svgBaseProps=void 0;var n=t(xr()),r=t(Tf),i=xK,o=e(w),a=t(CK()),s=EK(),u=t(e7());function l(k,C){(0,a.default)(k,"[@ant-design/icons] ".concat(C))}function c(k){return(0,r.default)(k)==="object"&&typeof k.name=="string"&&typeof k.theme=="string"&&((0,r.default)(k.icon)==="object"||typeof k.icon=="function")}function h(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(k).reduce(function(C,d){var v=k[d];switch(d){case"class":C.className=v,delete C.class;break;default:C[d]=v}return C},{})}function p(k,C,d){return d?o.default.createElement(k.tag,(0,n.default)((0,n.default)({key:C},h(k.attrs)),d),(k.children||[]).map(function(v,m){return p(v,"".concat(C,"-").concat(k.tag,"-").concat(m))})):o.default.createElement(k.tag,(0,n.default)({key:C},h(k.attrs)),(k.children||[]).map(function(v,m){return p(v,"".concat(C,"-").concat(k.tag,"-").concat(m))}))}function y(k){return(0,i.generate)(k)[0]}function g(k){return k?Array.isArray(k)?k:[k]:[]}var b={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"};Pn.svgBaseProps=b;var _=` .anticon { display: inline-block; color: inherit; @@ -555,16 +555,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(360deg); } } -`;Pn.iconStyles=_;var S=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_,d=(0,o.useContext)(u.default),v=d.csp;(0,o.useEffect)(function(){(0,s.updateCSS)(C,"@ant-design-icons",{prepend:!0,csp:v})},[])};return Pn.useInsertStyles=S,Pn}var S8;function Z_(){if(S8)return il;S8=1;var e=bn;Object.defineProperty(il,"__esModule",{value:!0}),il.default=void 0;var t=e(Y_()),n=e(wr()),r=o2(),i=["icon","className","onClick","style","primaryColor","secondaryColor"],o={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function a(c){var h=c.primaryColor,p=c.secondaryColor;o.primaryColor=h,o.secondaryColor=p||(0,r.getSecondaryColor)(h),o.calculated=!!p}function s(){return(0,n.default)({},o)}var u=function(h){var p=h.icon,y=h.className,g=h.onClick,b=h.style,_=h.primaryColor,S=h.secondaryColor,k=(0,t.default)(h,i),C=o;if(_&&(C={primaryColor:_,secondaryColor:S||(0,r.getSecondaryColor)(_)}),(0,r.useInsertStyles)(),(0,r.warning)((0,r.isIconDefinition)(p),"icon should be icon definiton, but got ".concat(p)),!(0,r.isIconDefinition)(p))return null;var d=p;return d&&typeof d.icon=="function"&&(d=(0,n.default)((0,n.default)({},d),{},{icon:d.icon(C.primaryColor,C.secondaryColor)})),(0,r.generate)(d.icon,"svg-".concat(d.name),(0,n.default)({className:y,onClick:g,style:b,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},k))};u.displayName="IconReact",u.getTwoToneColors=s,u.setTwoToneColors=a;var l=u;return il.default=l,il}var sl={},k8;function vK(){if(k8)return sl;k8=1;var e=bn;Object.defineProperty(sl,"__esModule",{value:!0}),sl.setTwoToneColor=i,sl.getTwoToneColor=o;var t=e(G_()),n=e(Z_()),r=o2();function i(a){var s=(0,r.normalizeTwoToneColors)(a),u=(0,t.default)(s,2),l=u[0],c=u[1];return n.default.setTwoToneColors({primaryColor:l,secondaryColor:c})}function o(){var a=n.default.getTwoToneColors();return a.calculated?[a.primaryColor,a.secondaryColor]:a.primaryColor}return sl}var x8;function _i(){if(x8)return nl;x8=1;var e=bn,t=Zn;Object.defineProperty(nl,"__esModule",{value:!0}),nl.default=void 0;var n=e(wr()),r=e(G_()),i=e(K_()),o=e(Y_()),a=t(w),s=e(Nq()),u=e(X_()),l=e(Z_()),c=vK(),h=o2(),p=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];(0,c.setTwoToneColor)("#1890ff");var y=a.forwardRef(function(b,_){var S,k=b.className,C=b.icon,d=b.spin,v=b.rotate,m=b.tabIndex,x=b.onClick,A=b.twoToneColor,L=(0,o.default)(b,p),P=a.useContext(u.default),O=P.prefixCls,V=O===void 0?"anticon":O,H=(0,s.default)(V,(S={},(0,i.default)(S,"".concat(V,"-").concat(C.name),!!C.name),(0,i.default)(S,"".concat(V,"-spin"),!!d||C.name==="loading"),S),k),j=m;j===void 0&&x&&(j=-1);var F=v?{msTransform:"rotate(".concat(v,"deg)"),transform:"rotate(".concat(v,"deg)")}:void 0,R=(0,h.normalizeTwoToneColors)(A),q=(0,r.default)(R,2),$=q[0],K=q[1];return a.createElement("span",(0,n.default)((0,n.default)({role:"img","aria-label":C.name},L),{},{ref:_,tabIndex:j,onClick:x,className:H}),a.createElement(l.default,{icon:C,primaryColor:$,secondaryColor:K,style:F}))});y.displayName="AntdIcon",y.getTwoToneColor=c.getTwoToneColor,y.setTwoToneColor=c.setTwoToneColor;var g=y;return nl.default=g,nl}var yK=Zn,a2=bn;Object.defineProperty(pp,"__esModule",{value:!0});pp.default=void 0;var C8=a2(wr()),e7=yK(w),bK=a2(wq()),wK=a2(_i()),t7=function(t,n){return e7.createElement(wK.default,(0,C8.default)((0,C8.default)({},t),{},{ref:n,icon:bK.default}))};t7.displayName="BoldOutlined";var SK=e7.forwardRef(t7);pp.default=SK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(pp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(pq,Ef);var Bf={},kK={get exports(){return Bf},set exports(e){Bf=e}},mp={},Fc={},_8;function xK(){if(_8)return Fc;_8=1,Object.defineProperty(Fc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M798 160H366c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h181.2l-156 544H229c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8H474.4l156-544H798c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"italic",theme:"outlined"};return Fc.default=e,Fc}var CK=Zn,s2=bn;Object.defineProperty(mp,"__esModule",{value:!0});mp.default=void 0;var E8=s2(wr()),n7=CK(w),_K=s2(xK()),EK=s2(_i()),r7=function(t,n){return n7.createElement(EK.default,(0,E8.default)((0,E8.default)({},t),{},{ref:n,icon:_K.default}))};r7.displayName="ItalicOutlined";var RK=n7.forwardRef(r7);mp.default=RK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(mp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(kK,Bf);var Ff={},AK={get exports(){return Ff},set exports(e){Ff=e}},gp={},$c={},R8;function TK(){if(R8)return $c;R8=1,Object.defineProperty($c,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M952 474H569.9c-10-2-20.5-4-31.6-6-15.9-2.9-22.2-4.1-30.8-5.8-51.3-10-82.2-20-106.8-34.2-35.1-20.5-52.2-48.3-52.2-85.1 0-37 15.2-67.7 44-89 28.4-21 68.8-32.1 116.8-32.1 54.8 0 97.1 14.4 125.8 42.8 14.6 14.4 25.3 32.1 31.8 52.6 1.3 4.1 2.8 10 4.3 17.8.9 4.8 5.2 8.2 9.9 8.2h72.8c5.6 0 10.1-4.6 10.1-10.1v-1c-.7-6.8-1.3-12.1-2-16-7.3-43.5-28-81.7-59.7-110.3-44.4-40.5-109.7-61.8-188.7-61.8-72.3 0-137.4 18.1-183.3 50.9-25.6 18.4-45.4 41.2-58.6 67.7-13.5 27.1-20.3 58.4-20.3 92.9 0 29.5 5.7 54.5 17.3 76.5 8.3 15.7 19.6 29.5 34.1 42H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h433.2c2.1.4 3.9.8 5.9 1.2 30.9 6.2 49.5 10.4 66.6 15.2 23 6.5 40.6 13.3 55.2 21.5 35.8 20.2 53.3 49.2 53.3 89 0 35.3-15.5 66.8-43.6 88.8-30.5 23.9-75.6 36.4-130.5 36.4-43.7 0-80.7-8.5-110.2-25-29.1-16.3-49.1-39.8-59.7-69.5-.8-2.2-1.7-5.2-2.7-9-1.2-4.4-5.3-7.5-9.7-7.5h-79.7c-5.6 0-10.1 4.6-10.1 10.1v1c.2 2.3.4 4.2.6 5.7 6.5 48.8 30.3 88.8 70.7 118.8 47.1 34.8 113.4 53.2 191.8 53.2 84.2 0 154.8-19.8 204.2-57.3 25-18.9 44.2-42.2 57.1-69 13-27.1 19.7-57.9 19.7-91.5 0-31.8-5.8-58.4-17.8-81.4-5.8-11.2-13.1-21.5-21.8-30.8H952c4.4 0 8-3.6 8-8v-60a8 8 0 00-8-7.9z"}}]},name:"strikethrough",theme:"outlined"};return $c.default=e,$c}var PK=Zn,l2=bn;Object.defineProperty(gp,"__esModule",{value:!0});gp.default=void 0;var A8=l2(wr()),i7=PK(w),IK=l2(TK()),OK=l2(_i()),o7=function(t,n){return i7.createElement(OK.default,(0,A8.default)((0,A8.default)({},t),{},{ref:n,icon:IK.default}))};o7.displayName="StrikethroughOutlined";var LK=i7.forwardRef(o7);gp.default=LK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(gp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(AK,Ff);var $f={},DK={get exports(){return $f},set exports(e){$f=e}},vp={},Uc={},T8;function MK(){if(T8)return Uc;T8=1,Object.defineProperty(Uc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"};return Uc.default=e,Uc}var NK=Zn,u2=bn;Object.defineProperty(vp,"__esModule",{value:!0});vp.default=void 0;var P8=u2(wr()),a7=NK(w),zK=u2(MK()),jK=u2(_i()),s7=function(t,n){return a7.createElement(jK.default,(0,P8.default)((0,P8.default)({},t),{},{ref:n,icon:zK.default}))};s7.displayName="UnorderedListOutlined";var BK=a7.forwardRef(s7);vp.default=BK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(vp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(DK,$f);var Uf={},FK={get exports(){return Uf},set exports(e){Uf=e}},yp={},Hc={},I8;function $K(){if(I8)return Hc;I8=1,Object.defineProperty(Hc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M920 760H336c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0-568H336c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H336c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM216 712H100c-2.2 0-4 1.8-4 4v34c0 2.2 1.8 4 4 4h72.4v20.5h-35.7c-2.2 0-4 1.8-4 4v34c0 2.2 1.8 4 4 4h35.7V838H100c-2.2 0-4 1.8-4 4v34c0 2.2 1.8 4 4 4h116c2.2 0 4-1.8 4-4V716c0-2.2-1.8-4-4-4zM100 188h38v120c0 2.2 1.8 4 4 4h40c2.2 0 4-1.8 4-4V152c0-4.4-3.6-8-8-8h-78c-2.2 0-4 1.8-4 4v36c0 2.2 1.8 4 4 4zm116 240H100c-2.2 0-4 1.8-4 4v36c0 2.2 1.8 4 4 4h68.4l-70.3 77.7a8.3 8.3 0 00-2.1 5.4V592c0 2.2 1.8 4 4 4h116c2.2 0 4-1.8 4-4v-36c0-2.2-1.8-4-4-4h-68.4l70.3-77.7a8.3 8.3 0 002.1-5.4V432c0-2.2-1.8-4-4-4z"}}]},name:"ordered-list",theme:"outlined"};return Hc.default=e,Hc}var UK=Zn,c2=bn;Object.defineProperty(yp,"__esModule",{value:!0});yp.default=void 0;var O8=c2(wr()),l7=UK(w),HK=c2($K()),WK=c2(_i()),u7=function(t,n){return l7.createElement(WK.default,(0,O8.default)((0,O8.default)({},t),{},{ref:n,icon:HK.default}))};u7.displayName="OrderedListOutlined";var VK=l7.forwardRef(u7);yp.default=VK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(yp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(FK,Uf);var Hf={},qK={get exports(){return Hf},set exports(e){Hf=e}},bp={},Wc={},L8;function KK(){if(L8)return Wc;L8=1,Object.defineProperty(Wc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 208H676V232h212v136zm0 224H676V432h212v160zM412 432h200v160H412V432zm200-64H412V232h200v136zm-476 64h212v160H136V432zm0-200h212v136H136V232zm0 424h212v136H136V656zm276 0h200v136H412V656zm476 136H676V656h212v136z"}}]},name:"table",theme:"outlined"};return Wc.default=e,Wc}var GK=Zn,d2=bn;Object.defineProperty(bp,"__esModule",{value:!0});bp.default=void 0;var D8=d2(wr()),c7=GK(w),YK=d2(KK()),XK=d2(_i()),d7=function(t,n){return c7.createElement(XK.default,(0,D8.default)((0,D8.default)({},t),{},{ref:n,icon:YK.default}))};d7.displayName="TableOutlined";var QK=c7.forwardRef(d7);bp.default=QK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(bp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(qK,Hf);var Wf={},JK={get exports(){return Wf},set exports(e){Wf=e}},wp={},Vc={},M8;function ZK(){if(M8)return Vc;M8=1,Object.defineProperty(Vc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"};return Vc.default=e,Vc}var eG=Zn,f2=bn;Object.defineProperty(wp,"__esModule",{value:!0});wp.default=void 0;var N8=f2(wr()),f7=eG(w),tG=f2(ZK()),nG=f2(_i()),h7=function(t,n){return f7.createElement(nG.default,(0,N8.default)((0,N8.default)({},t),{},{ref:n,icon:tG.default}))};h7.displayName="FileImageOutlined";var rG=f7.forwardRef(h7);wp.default=rG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(wp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(JK,Wf);var Vf={},iG={get exports(){return Vf},set exports(e){Vf=e}},Sp={},qc={},z8;function oG(){if(z8)return qc;z8=1,Object.defineProperty(qc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};return qc.default=e,qc}var aG=Zn,h2=bn;Object.defineProperty(Sp,"__esModule",{value:!0});Sp.default=void 0;var j8=h2(wr()),p7=aG(w),sG=h2(oG()),lG=h2(_i()),m7=function(t,n){return p7.createElement(lG.default,(0,j8.default)((0,j8.default)({},t),{},{ref:n,icon:sG.default}))};m7.displayName="LinkOutlined";var uG=p7.forwardRef(m7);Sp.default=uG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(Sp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(iG,Vf);var qf={},cG={get exports(){return qf},set exports(e){qf=e}},kp={},Kc={},B8;function dG(){if(B8)return Kc;B8=1,Object.defineProperty(Kc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};return Kc.default=e,Kc}var fG=Zn,p2=bn;Object.defineProperty(kp,"__esModule",{value:!0});kp.default=void 0;var F8=p2(wr()),g7=fG(w),hG=p2(dG()),pG=p2(_i()),v7=function(t,n){return g7.createElement(pG.default,(0,F8.default)((0,F8.default)({},t),{},{ref:n,icon:hG.default}))};v7.displayName="RightOutlined";var mG=g7.forwardRef(v7);kp.default=mG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(kp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(cG,qf);var Kf={},gG={get exports(){return Kf},set exports(e){Kf=e}},xp={},Gc={},$8;function vG(){if($8)return Gc;$8=1,Object.defineProperty(Gc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"};return Gc.default=e,Gc}var yG=Zn,m2=bn;Object.defineProperty(xp,"__esModule",{value:!0});xp.default=void 0;var U8=m2(wr()),y7=yG(w),bG=m2(vG()),wG=m2(_i()),b7=function(t,n){return y7.createElement(wG.default,(0,U8.default)((0,U8.default)({},t),{},{ref:n,icon:bG.default}))};b7.displayName="CodeOutlined";var SG=y7.forwardRef(b7);xp.default=SG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(xp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(gG,Kf);var ci=Qn&&Qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hp,"__esModule",{value:!0});hp.toolbarActions=void 0;var pi=ci(w),kG=ci(Ef),xG=ci(Bf),CG=ci(Ff),_G=ci($f),EG=ci(Uf),RG=ci(Hf),AG=ci(Wf),TG=ci(Vf),PG=ci(qf),IG=ci(Kf);hp.toolbarActions=[{name:"bold",icon:pi.default.createElement(kG.default,null),schema:{openingTag:"**",closingTag:"**"}},{name:"italic",icon:pi.default.createElement(xG.default,null),schema:{openingTag:"*",closingTag:"*"}},{name:"strikethrough",icon:pi.default.createElement(CG.default,null),schema:{openingTag:"~~",closingTag:"~~"}},{name:"heading1",icon:"H1",schema:{openingTag:"# ",closingTag:""}},{name:"heading2",icon:"H2",schema:{openingTag:"## ",closingTag:""}},{name:"heading3",icon:"H3",schema:{openingTag:"### ",closingTag:""}},{name:"ulist",icon:pi.default.createElement(_G.default,null),schema:{openingTag:"- ",closingTag:""}},{name:"olist",icon:pi.default.createElement(EG.default,null),schema:{openingTag:"1. ",closingTag:""}},{name:"table",icon:pi.default.createElement(RG.default,null),schema:{openingTag:`Column 1 | Column 2 | Column 3 +`;Pn.iconStyles=_;var S=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_,d=(0,o.useContext)(u.default),v=d.csp;(0,o.useEffect)(function(){(0,s.updateCSS)(C,"@ant-design-icons",{prepend:!0,csp:v})},[])};return Pn.useInsertStyles=S,Pn}var P8;function r7(){if(P8)return ol;P8=1;var e=wn;Object.defineProperty(ol,"__esModule",{value:!0}),ol.default=void 0;var t=e(Z_()),n=e(xr()),r=f2(),i=["icon","className","onClick","style","primaryColor","secondaryColor"],o={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function a(c){var h=c.primaryColor,p=c.secondaryColor;o.primaryColor=h,o.secondaryColor=p||(0,r.getSecondaryColor)(h),o.calculated=!!p}function s(){return(0,n.default)({},o)}var u=function(h){var p=h.icon,y=h.className,g=h.onClick,b=h.style,_=h.primaryColor,S=h.secondaryColor,k=(0,t.default)(h,i),C=o;if(_&&(C={primaryColor:_,secondaryColor:S||(0,r.getSecondaryColor)(_)}),(0,r.useInsertStyles)(),(0,r.warning)((0,r.isIconDefinition)(p),"icon should be icon definiton, but got ".concat(p)),!(0,r.isIconDefinition)(p))return null;var d=p;return d&&typeof d.icon=="function"&&(d=(0,n.default)((0,n.default)({},d),{},{icon:d.icon(C.primaryColor,C.secondaryColor)})),(0,r.generate)(d.icon,"svg-".concat(d.name),(0,n.default)({className:y,onClick:g,style:b,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},k))};u.displayName="IconReact",u.getTwoToneColors=s,u.setTwoToneColors=a;var l=u;return ol.default=l,ol}var ll={},I8;function RK(){if(I8)return ll;I8=1;var e=wn;Object.defineProperty(ll,"__esModule",{value:!0}),ll.setTwoToneColor=i,ll.getTwoToneColor=o;var t=e(J_()),n=e(r7()),r=f2();function i(a){var s=(0,r.normalizeTwoToneColors)(a),u=(0,t.default)(s,2),l=u[0],c=u[1];return n.default.setTwoToneColors({primaryColor:l,secondaryColor:c})}function o(){var a=n.default.getTwoToneColors();return a.calculated?[a.primaryColor,a.secondaryColor]:a.primaryColor}return ll}var O8;function Ei(){if(O8)return rl;O8=1;var e=wn,t=tr;Object.defineProperty(rl,"__esModule",{value:!0}),rl.default=void 0;var n=e(xr()),r=e(J_()),i=e(Q_()),o=e(Z_()),a=t(w),s=e(qq()),u=e(e7()),l=e(r7()),c=RK(),h=f2(),p=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];(0,c.setTwoToneColor)("#1890ff");var y=a.forwardRef(function(b,_){var S,k=b.className,C=b.icon,d=b.spin,v=b.rotate,m=b.tabIndex,x=b.onClick,A=b.twoToneColor,D=(0,o.default)(b,p),P=a.useContext(u.default),L=P.prefixCls,W=L===void 0?"anticon":L,U=(0,s.default)(W,(S={},(0,i.default)(S,"".concat(W,"-").concat(C.name),!!C.name),(0,i.default)(S,"".concat(W,"-spin"),!!d||C.name==="loading"),S),k),j=m;j===void 0&&x&&(j=-1);var F=v?{msTransform:"rotate(".concat(v,"deg)"),transform:"rotate(".concat(v,"deg)")}:void 0,R=(0,h.normalizeTwoToneColors)(A),q=(0,r.default)(R,2),$=q[0],K=q[1];return a.createElement("span",(0,n.default)((0,n.default)({role:"img","aria-label":C.name},D),{},{ref:_,tabIndex:j,onClick:x,className:U}),a.createElement(l.default,{icon:C,primaryColor:$,secondaryColor:K,style:F}))});y.displayName="AntdIcon",y.getTwoToneColor=c.getTwoToneColor,y.setTwoToneColor=c.setTwoToneColor;var g=y;return rl.default=g,rl}var AK=tr,h2=wn;Object.defineProperty(mp,"__esModule",{value:!0});mp.default=void 0;var L8=h2(xr()),i7=AK(w),TK=h2(Pq()),PK=h2(Ei()),o7=function(t,n){return i7.createElement(PK.default,(0,L8.default)((0,L8.default)({},t),{},{ref:n,icon:TK.default}))};o7.displayName="BoldOutlined";var IK=i7.forwardRef(o7);mp.default=IK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(mp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(Cq,Af);var $f={},OK={get exports(){return $f},set exports(e){$f=e}},gp={},Hc={},D8;function LK(){if(D8)return Hc;D8=1,Object.defineProperty(Hc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M798 160H366c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h181.2l-156 544H229c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8H474.4l156-544H798c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"italic",theme:"outlined"};return Hc.default=e,Hc}var DK=tr,p2=wn;Object.defineProperty(gp,"__esModule",{value:!0});gp.default=void 0;var N8=p2(xr()),a7=DK(w),NK=p2(LK()),MK=p2(Ei()),s7=function(t,n){return a7.createElement(MK.default,(0,N8.default)((0,N8.default)({},t),{},{ref:n,icon:NK.default}))};s7.displayName="ItalicOutlined";var zK=a7.forwardRef(s7);gp.default=zK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(gp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(OK,$f);var Hf={},jK={get exports(){return Hf},set exports(e){Hf=e}},vp={},Uc={},M8;function BK(){if(M8)return Uc;M8=1,Object.defineProperty(Uc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M952 474H569.9c-10-2-20.5-4-31.6-6-15.9-2.9-22.2-4.1-30.8-5.8-51.3-10-82.2-20-106.8-34.2-35.1-20.5-52.2-48.3-52.2-85.1 0-37 15.2-67.7 44-89 28.4-21 68.8-32.1 116.8-32.1 54.8 0 97.1 14.4 125.8 42.8 14.6 14.4 25.3 32.1 31.8 52.6 1.3 4.1 2.8 10 4.3 17.8.9 4.8 5.2 8.2 9.9 8.2h72.8c5.6 0 10.1-4.6 10.1-10.1v-1c-.7-6.8-1.3-12.1-2-16-7.3-43.5-28-81.7-59.7-110.3-44.4-40.5-109.7-61.8-188.7-61.8-72.3 0-137.4 18.1-183.3 50.9-25.6 18.4-45.4 41.2-58.6 67.7-13.5 27.1-20.3 58.4-20.3 92.9 0 29.5 5.7 54.5 17.3 76.5 8.3 15.7 19.6 29.5 34.1 42H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h433.2c2.1.4 3.9.8 5.9 1.2 30.9 6.2 49.5 10.4 66.6 15.2 23 6.5 40.6 13.3 55.2 21.5 35.8 20.2 53.3 49.2 53.3 89 0 35.3-15.5 66.8-43.6 88.8-30.5 23.9-75.6 36.4-130.5 36.4-43.7 0-80.7-8.5-110.2-25-29.1-16.3-49.1-39.8-59.7-69.5-.8-2.2-1.7-5.2-2.7-9-1.2-4.4-5.3-7.5-9.7-7.5h-79.7c-5.6 0-10.1 4.6-10.1 10.1v1c.2 2.3.4 4.2.6 5.7 6.5 48.8 30.3 88.8 70.7 118.8 47.1 34.8 113.4 53.2 191.8 53.2 84.2 0 154.8-19.8 204.2-57.3 25-18.9 44.2-42.2 57.1-69 13-27.1 19.7-57.9 19.7-91.5 0-31.8-5.8-58.4-17.8-81.4-5.8-11.2-13.1-21.5-21.8-30.8H952c4.4 0 8-3.6 8-8v-60a8 8 0 00-8-7.9z"}}]},name:"strikethrough",theme:"outlined"};return Uc.default=e,Uc}var FK=tr,m2=wn;Object.defineProperty(vp,"__esModule",{value:!0});vp.default=void 0;var z8=m2(xr()),l7=FK(w),$K=m2(BK()),HK=m2(Ei()),u7=function(t,n){return l7.createElement(HK.default,(0,z8.default)((0,z8.default)({},t),{},{ref:n,icon:$K.default}))};u7.displayName="StrikethroughOutlined";var UK=l7.forwardRef(u7);vp.default=UK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(vp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(jK,Hf);var Uf={},VK={get exports(){return Uf},set exports(e){Uf=e}},yp={},Vc={},j8;function WK(){if(j8)return Vc;j8=1,Object.defineProperty(Vc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"};return Vc.default=e,Vc}var qK=tr,g2=wn;Object.defineProperty(yp,"__esModule",{value:!0});yp.default=void 0;var B8=g2(xr()),c7=qK(w),KK=g2(WK()),GK=g2(Ei()),d7=function(t,n){return c7.createElement(GK.default,(0,B8.default)((0,B8.default)({},t),{},{ref:n,icon:KK.default}))};d7.displayName="UnorderedListOutlined";var YK=c7.forwardRef(d7);yp.default=YK;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(yp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(VK,Uf);var Vf={},XK={get exports(){return Vf},set exports(e){Vf=e}},bp={},Wc={},F8;function QK(){if(F8)return Wc;F8=1,Object.defineProperty(Wc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M920 760H336c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0-568H336c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H336c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM216 712H100c-2.2 0-4 1.8-4 4v34c0 2.2 1.8 4 4 4h72.4v20.5h-35.7c-2.2 0-4 1.8-4 4v34c0 2.2 1.8 4 4 4h35.7V838H100c-2.2 0-4 1.8-4 4v34c0 2.2 1.8 4 4 4h116c2.2 0 4-1.8 4-4V716c0-2.2-1.8-4-4-4zM100 188h38v120c0 2.2 1.8 4 4 4h40c2.2 0 4-1.8 4-4V152c0-4.4-3.6-8-8-8h-78c-2.2 0-4 1.8-4 4v36c0 2.2 1.8 4 4 4zm116 240H100c-2.2 0-4 1.8-4 4v36c0 2.2 1.8 4 4 4h68.4l-70.3 77.7a8.3 8.3 0 00-2.1 5.4V592c0 2.2 1.8 4 4 4h116c2.2 0 4-1.8 4-4v-36c0-2.2-1.8-4-4-4h-68.4l70.3-77.7a8.3 8.3 0 002.1-5.4V432c0-2.2-1.8-4-4-4z"}}]},name:"ordered-list",theme:"outlined"};return Wc.default=e,Wc}var JK=tr,v2=wn;Object.defineProperty(bp,"__esModule",{value:!0});bp.default=void 0;var $8=v2(xr()),f7=JK(w),ZK=v2(QK()),eG=v2(Ei()),h7=function(t,n){return f7.createElement(eG.default,(0,$8.default)((0,$8.default)({},t),{},{ref:n,icon:ZK.default}))};h7.displayName="OrderedListOutlined";var tG=f7.forwardRef(h7);bp.default=tG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(bp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(XK,Vf);var Wf={},nG={get exports(){return Wf},set exports(e){Wf=e}},wp={},qc={},H8;function rG(){if(H8)return qc;H8=1,Object.defineProperty(qc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 208H676V232h212v136zm0 224H676V432h212v160zM412 432h200v160H412V432zm200-64H412V232h200v136zm-476 64h212v160H136V432zm0-200h212v136H136V232zm0 424h212v136H136V656zm276 0h200v136H412V656zm476 136H676V656h212v136z"}}]},name:"table",theme:"outlined"};return qc.default=e,qc}var iG=tr,y2=wn;Object.defineProperty(wp,"__esModule",{value:!0});wp.default=void 0;var U8=y2(xr()),p7=iG(w),oG=y2(rG()),aG=y2(Ei()),m7=function(t,n){return p7.createElement(aG.default,(0,U8.default)((0,U8.default)({},t),{},{ref:n,icon:oG.default}))};m7.displayName="TableOutlined";var sG=p7.forwardRef(m7);wp.default=sG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(wp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(nG,Wf);var qf={},lG={get exports(){return qf},set exports(e){qf=e}},Sp={},Kc={},V8;function uG(){if(V8)return Kc;V8=1,Object.defineProperty(Kc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"};return Kc.default=e,Kc}var cG=tr,b2=wn;Object.defineProperty(Sp,"__esModule",{value:!0});Sp.default=void 0;var W8=b2(xr()),g7=cG(w),dG=b2(uG()),fG=b2(Ei()),v7=function(t,n){return g7.createElement(fG.default,(0,W8.default)((0,W8.default)({},t),{},{ref:n,icon:dG.default}))};v7.displayName="FileImageOutlined";var hG=g7.forwardRef(v7);Sp.default=hG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(Sp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(lG,qf);var Kf={},pG={get exports(){return Kf},set exports(e){Kf=e}},kp={},Gc={},q8;function mG(){if(q8)return Gc;q8=1,Object.defineProperty(Gc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};return Gc.default=e,Gc}var gG=tr,w2=wn;Object.defineProperty(kp,"__esModule",{value:!0});kp.default=void 0;var K8=w2(xr()),y7=gG(w),vG=w2(mG()),yG=w2(Ei()),b7=function(t,n){return y7.createElement(yG.default,(0,K8.default)((0,K8.default)({},t),{},{ref:n,icon:vG.default}))};b7.displayName="LinkOutlined";var bG=y7.forwardRef(b7);kp.default=bG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(kp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(pG,Kf);var Gf={},wG={get exports(){return Gf},set exports(e){Gf=e}},xp={},Yc={},G8;function SG(){if(G8)return Yc;G8=1,Object.defineProperty(Yc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};return Yc.default=e,Yc}var kG=tr,S2=wn;Object.defineProperty(xp,"__esModule",{value:!0});xp.default=void 0;var Y8=S2(xr()),w7=kG(w),xG=S2(SG()),CG=S2(Ei()),S7=function(t,n){return w7.createElement(CG.default,(0,Y8.default)((0,Y8.default)({},t),{},{ref:n,icon:xG.default}))};S7.displayName="RightOutlined";var _G=w7.forwardRef(S7);xp.default=_G;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(xp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(wG,Gf);var Yf={},EG={get exports(){return Yf},set exports(e){Yf=e}},Cp={},Xc={},X8;function RG(){if(X8)return Xc;X8=1,Object.defineProperty(Xc,"__esModule",{value:!0});var e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"};return Xc.default=e,Xc}var AG=tr,k2=wn;Object.defineProperty(Cp,"__esModule",{value:!0});Cp.default=void 0;var Q8=k2(xr()),k7=AG(w),TG=k2(RG()),PG=k2(Ei()),x7=function(t,n){return k7.createElement(PG.default,(0,Q8.default)((0,Q8.default)({},t),{},{ref:n,icon:TG.default}))};x7.displayName="CodeOutlined";var IG=k7.forwardRef(x7);Cp.default=IG;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(Cp);function r(o){return o&&o.__esModule?o:{default:o}}var i=n;t.default=i,e.exports=i})(EG,Yf);var ci=Zn&&Zn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pp,"__esModule",{value:!0});pp.toolbarActions=void 0;var pi=ci(w),OG=ci(Af),LG=ci($f),DG=ci(Hf),NG=ci(Uf),MG=ci(Vf),zG=ci(Wf),jG=ci(qf),BG=ci(Kf),FG=ci(Gf),$G=ci(Yf);pp.toolbarActions=[{name:"bold",icon:pi.default.createElement(OG.default,null),schema:{openingTag:"**",closingTag:"**"}},{name:"italic",icon:pi.default.createElement(LG.default,null),schema:{openingTag:"*",closingTag:"*"}},{name:"strikethrough",icon:pi.default.createElement(DG.default,null),schema:{openingTag:"~~",closingTag:"~~"}},{name:"heading1",icon:"H1",schema:{openingTag:"# ",closingTag:""}},{name:"heading2",icon:"H2",schema:{openingTag:"## ",closingTag:""}},{name:"heading3",icon:"H3",schema:{openingTag:"### ",closingTag:""}},{name:"ulist",icon:pi.default.createElement(NG.default,null),schema:{openingTag:"- ",closingTag:""}},{name:"olist",icon:pi.default.createElement(MG.default,null),schema:{openingTag:"1. ",closingTag:""}},{name:"table",icon:pi.default.createElement(zG.default,null),schema:{openingTag:`Column 1 | Column 2 | Column 3 ---|:---:|---: Left | Center | Right 1 | 2 | 3 -4 | 5 | 6`,closingTag:""}},{name:"image",icon:pi.default.createElement(AG.default,null),schema:{openingTag:"![",closingTag:"](https://example.com/image.png)"}},{name:"link",icon:pi.default.createElement(TG.default,null),schema:{openingTag:"[",closingTag:"](https://www.example.com)"}},{name:"quote",icon:pi.default.createElement(PG.default,null),schema:{openingTag:"> ",closingTag:""}},{name:"code",icon:pi.default.createElement(IG.default,null),schema:{openingTag:"`",closingTag:"`"}},{name:"hr",icon:"HR",schema:{openingTag:"",closingTag:` +4 | 5 | 6`,closingTag:""}},{name:"image",icon:pi.default.createElement(jG.default,null),schema:{openingTag:"![",closingTag:"](https://example.com/image.png)"}},{name:"link",icon:pi.default.createElement(BG.default,null),schema:{openingTag:"[",closingTag:"](https://www.example.com)"}},{name:"quote",icon:pi.default.createElement(FG.default,null),schema:{openingTag:"> ",closingTag:""}},{name:"code",icon:pi.default.createElement($G.default,null),schema:{openingTag:"`",closingTag:"`"}},{name:"hr",icon:"HR",schema:{openingTag:"",closingTag:` --- -`}}];var OG=Qn&&Qn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),LG=Qn&&Qn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),DG=Qn&&Qn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&OG(t,e,n);return LG(t,e),t},MG=Qn&&Qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i2,"__esModule",{value:!0});var $n=DG(w),NG=MG(j1),zG=fp,H8=hp,jG=new NG.default.Converter({tables:!0,simplifiedAutoLink:!1,strikethrough:!0,tasklists:!0,noHeaderId:!0}),BG=function(e){var t=e.value,n=e.handler,r=e.toolbar,i=e.required,o=i===void 0?!1:i,a=$n.useState(!1),s=a[0],u=a[1],l=$n.useRef(null),c=zG.useStyles(),h=jG.makeHtml(t),p=function(g){n(g.target.value)},y=function(g){var b=g.name,_=g.schema,S=_.openingTag,k=_.closingTag;if(l&&l.current){var C=l.current,d=C.value,v=C.selectionStart,m=C.selectionEnd,x=d.length,A=l.current.value.substring(v,m),L=/[^\n]+/g,P=A.match(L),O="",V=function(j,F,R,q){var $="";return j.forEach(function(K,ee){F==="olist"?$+=ee+1+". "+K+k+` +`}}];var HG=Zn&&Zn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),UG=Zn&&Zn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),VG=Zn&&Zn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&HG(t,e,n);return UG(t,e),t},WG=Zn&&Zn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d2,"__esModule",{value:!0});var Hn=VG(w),qG=WG(B1),KG=hp,J8=pp,GG=new qG.default.Converter({tables:!0,simplifiedAutoLink:!1,strikethrough:!0,tasklists:!0,noHeaderId:!0}),YG=function(e){var t=e.value,n=e.handler,r=e.toolbar,i=e.required,o=i===void 0?!1:i,a=Hn.useState(!1),s=a[0],u=a[1],l=Hn.useRef(null),c=KG.useStyles(),h=GG.makeHtml(t),p=function(g){n(g.target.value)},y=function(g){var b=g.name,_=g.schema,S=_.openingTag,k=_.closingTag;if(l&&l.current){var C=l.current,d=C.value,v=C.selectionStart,m=C.selectionEnd,x=d.length,A=l.current.value.substring(v,m),D=/[^\n]+/g,P=A.match(D),L="",W=function(j,F,R,q){var $="";return j.forEach(function(K,ee){F==="olist"?$+=ee+1+". "+K+k+` `:$+=""+R+K+q+` -`}),$};if(P&&P.length>0&&(b==="olist"||b==="ulist"))O=d.substring(0,v)+V(P,b,S,k)+d.substring(m,x);else{var H=""+S+A+k;O=d.substring(0,v)+H+d.substring(m,x)}n(O)}};return $n.default.createElement("div",{className:c.yamde},$n.default.createElement("div",{className:c.toolbar},$n.default.createElement("div",{className:c.buttons},H8.toolbarActions.filter(function(g){return r==null?void 0:r.includes(g.name)}).map(function(g){var b=g.name,_=g.icon,S=g.schema;return $n.default.createElement("div",{key:b,className:c.button,onClick:function(){return y({name:b,schema:S})}},_)})),$n.default.createElement("div",{className:c.viewSwitch},$n.default.createElement("div",{className:c.viewButton+" "+(s?"":c.activeView),onClick:function(){return u(!1)}},"Editor"),$n.default.createElement("div",{className:c.viewButton+" "+(s?c.activeView:""),onClick:function(){return u(!0)}},"Preview"))),$n.default.createElement("div",{className:c.contentArea},s?$n.default.createElement("div",{className:c.preview,dangerouslySetInnerHTML:{__html:h}}):$n.default.createElement("textarea",{rows:12,name:"yamdeContent",value:t,onChange:function(g){return p(g)},required:o,ref:l})),$n.default.createElement("div",{className:c.mobileButton},H8.toolbarActions.filter(function(g){return r==null?void 0:r.includes(g.name)}).map(function(g){var b=g.name,_=g.icon,S=g.schema;return $n.default.createElement("div",{key:b,className:c.button,onClick:function(){return y({name:b,schema:S})}},_)})))};i2.default=BG;var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.lightTheme=void 0;Cp.lightTheme={buttonBackgroundColor:"#fff",buttonBorderColor:"#ddd",buttonColor:"#212121",buttonBackgroundColorHover:"#dcdcdc",switchButtonBackgroundColor:"whitesmoke",switchButtonBorderColor:"#ddd",switchButtonColorHover:"#333",switchButtonBackgroundColorHover:"#dcdcdc",switchButtonColorView:" #a0a0a0",switchButtonColorActiveView:"#333",switchButtonBackgroundColorActiveView:"#fff",switchButtonBorderColorActiveView:"#fff",textColor:"#333",contentAreaBackgroundColor:"#fff",textAreaBorderColor:"#ddd",previewAreaBorderColor:"#ddd",codeBlockBackgroundColor:"#ececec",linkColor:"#4183c4",quoteAdornmentColor:"#b9b9b9",tableBorderColor:"#ddd",textAreaSelectionBackgroundColor:"#a2a2a2",textAreaSelectionColor:"#000"};var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.darkTheme=void 0;_p.darkTheme={buttonBackgroundColor:"#242424",buttonBorderColor:"#151515",buttonColor:"#777777",buttonBackgroundColorHover:"#1b1b1b",switchButtonBackgroundColor:"#242424",switchButtonBorderColor:"#151515",switchButtonColorHover:"#777777",switchButtonBackgroundColorHover:"#1b1b1b",switchButtonColorView:" #777777",switchButtonColorActiveView:"#777777",switchButtonBackgroundColorActiveView:"#1b1b1b",switchButtonBorderColorActiveView:"#1b1b1b",textColor:"#fff",contentAreaBackgroundColor:"#1b1b1b",textAreaBorderColor:"#151515",previewAreaBorderColor:"#151515",codeBlockBackgroundColor:"#383838",linkColor:"#4183c4",quoteAdornmentColor:"#b9b9b9",tableBorderColor:"#ddd",textAreaSelectionBackgroundColor:"#656565",textAreaSelectionColor:"#000"};var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.defaultToolbarAction=void 0;Ep.defaultToolbarAction=["bold","italic","strikethrough","heading1","heading2","heading3","ulist","olist","table","image","link","quote","code","hr"];var w7=Qn&&Qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(w_,"__esModule",{value:!0});var W8=w7(w),FG=q_,$G=w7(i2),UG=Cp,HG=_p,WG=Ep,VG=function(e){var t=e.value,n=e.handler,r=e.theme,i=r===void 0?"light":r,o=e.toolbar,a=o===void 0?WG.defaultToolbarAction:o;return W8.default.createElement(FG.ThemeProvider,{theme:i==="light"?UG.lightTheme:HG.darkTheme},W8.default.createElement($G.default,{value:t,handler:n,toolbar:a}))},qG=w_.default=VG;function KG({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=ye(e,t.subject,{handleValidationError:i}),{darkMode:s}=ot();return M(be,{children:[f(un,{children:f(GG,{children:f(qG,{value:o||"",handler:u=>a(u),theme:s?"dark":"light",required:!1,...n})})}),o!==""&&r&&f(xt,{children:r.message}),o===""&&f(xt,{children:"Required"})]})}const GG=B.div.withConfig({displayName:"YamdeStyling",componentId:"sc-1tdmev8-0"})(["display:flex;flex:1;.yamde-0-2-1{margin:0;}.contentArea-0-2-8 textarea,.preview-0-2-9{background:",";font-size:","rem;}"],e=>e.theme.colors.bg,e=>e.theme.fontSizeBody);function V8({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=ru(e,t.subject,{handleValidationError:i});function s(u){if(u.target.value===""){a(void 0);return}const l=+u.target.value;a(l)}return M(be,{children:[f(un,{children:f(Xn,{placeholder:"Enter a number...",type:"number",value:o===void 0||Number.isNaN(o)?"":o,onChange:s,...n})}),o!==void 0&&r&&f(xt,{children:r.message}),o===void 0&&f(xt,{children:"Required"})]})}function YG({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=xk(e,t.subject,{handleValidationError:i});function s(u){a(u.target.checked)}return M(be,{children:[f(Xn,{type:"checkbox",checked:!!o,onChange:s,...n}),r&&f(xt,{children:r.message})]})}function S7(e){switch(e.property.datatype){case Ie.STRING:return f(dg,{...e});case Ie.MARKDOWN:return f(KG,{...e});case Ie.SLUG:return f(dg,{...e});case Ie.INTEGER:return f(V8,{...e});case Ie.FLOAT:return f(V8,{...e});case Ie.ATOMIC_URL:return f(xH,{...e});case Ie.RESOURCEARRAY:return f(CH,{...e});case Ie.BOOLEAN:return f(YG,{...e});default:return f(dg,{...e})}}function qi({resource:e,noMargin:t,propertyURL:n,datatype:r}){const[i,o]=w.useState(!1),a=Ou(n),[s]=xa(e,n),u=Ke(),{agent:l}=ot();je("esc",()=>{o(!1)},{enableOnTags:["INPUT","TEXTAREA","SELECT"]});const[c,h]=w.useState(void 0),p=l!==void 0;if(s===void 0)return null;if(!a&&!r)return f("span",{title:`loading ${n}...`,children:"..."});if(!i)return M(F1,{children:[f(t_,{value:s,datatype:r||a.datatype,noMargin:t}),f(XG,{title:"Edit value",children:f(_s,{onClick:()=>o(!i)})})]});function y(){h(void 0),o(!1)}async function g(){try{await e.save(u),o(!1),dt.success("Resource saved")}catch(b){h(b),o(!0),dt.error("Could not save resource...")}}return M(F1,{children:[f(S7,{"data-test":`input-${a.subject}`,resource:e,property:a,autoFocus:!0}),c&&f(xt,{children:c.message}),f(ve,{disabled:!p,title:p?"Save the edits":"You cannot save - there is no Agent set. Go to settings.",onClick:g,children:"save"}),f(ve,{subtle:!0,onClick:y,children:"cancel"})]})}const F1=B.div.withConfig({displayName:"ValueFormWrapper",componentId:"sc-ikjnmu-0"})(["position:relative;flex:1;word-wrap:break-word;max-width:100%;"]),XG=B.div.withConfig({displayName:"EditButton",componentId:"sc-ikjnmu-1"})(["position:absolute;top:0;color:",";right:100%;cursor:pointer;opacity:0;@media (hover:hover) and (pointer:fine){",":hover &{opacity:0.5;&:hover{opacity:1;}}}"],e=>e.theme.colors.main,F1),Ed=B.div.withConfig({displayName:"PropValRow",componentId:"sc-6tojua-0"})(["word-break:break-word;margin-bottom:0.5rem;@media screen and (min-width:500px){margin-bottom:",";flex-direction:",";display:",";}"],e=>e.columns?0:"0.5rem",e=>e.columns?"row":"column",e=>e.columns?"flex":"block"),Rd=B.span.withConfig({displayName:"PropertyLabel",componentId:"sc-6tojua-1"})(["font-weight:bold;display:block;min-width:8rem;"]);function QG({propertyURL:e,resource:t,editable:n,columns:r}){const i=Ou(e),o=bk(e,10,!0);return i.loading?f(Ed,{columns:r,children:f(Rd,{title:e+" is loading",children:"loading..."})}):i.error?M(Ed,{columns:r,children:[f(Rd,{title:e+" could not be loaded",children:f(We,{subject:e,children:f(Nt,{children:o})})}),f("code",{children:JSON.stringify(t.get(e))})]}):M(Ed,{columns:r,children:[f(We,{subject:e,children:M(Rd,{title:i.description,children:[i.error?f(Nt,{children:o}):i.shortname||o,":"]})}),n?f(qi,{resource:t,propertyURL:e,noMargin:!0}):f(t_,{datatype:i.datatype,value:t.get(e)})]})}const JG=B.div.withConfig({displayName:"AllPropsWrapper",componentId:"sc-1c1krfz-0"})(["margin-bottom:","rem;"],e=>e.theme.margin);function Ps({resource:e,except:t=[],editable:n,columns:r}){return f(JG,{children:[...e.getPropVals()].map(([i,o])=>t.includes(i)?f(be,{}):f(QG,{columns:r,propertyURL:i,resource:e,editable:!!n},i))})}const ZG=(e,t=0)=>{let n=3735928559^t,r=1103547991^t;for(let i=0,o;i>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)};function g2(e,t){if(!t)throw new Error("Subject is required for transition name");return`${e}-${ZG(t??"")}`}function Rp(e,t){let n;try{n=g2(e,t)}catch{return"view-transition-name: none"}return`view-transition-name: ${n}`}const Lo=B.div.withConfig({displayName:"Card",componentId:"sc-nodwck-0"})(["background-color:",";border:solid 1px ",";box-shadow:",";padding:","rem;padding-bottom:0;border-radius:",";max-height:",";overflow:",";border-color:",";",";"],e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.theme.boxShadow,e=>e.theme.margin,e=>e.theme.radius,e=>e.small?"10rem":"none",e=>e.small?"hidden":"auto",e=>e.highlight?e.theme.colors.main:e.theme.colors.bg2,e=>Rp("resource-page",e.about)),Do=B.div.withConfig({displayName:"CardRow",componentId:"sc-nodwck-1"})(["--border:solid 1px ",";display:block;border-top:",";padding:","rem ","rem;"],e=>e.theme.colors.bg2,e=>e.noBorder?"none":"var(--border)",e=>e.theme.margin/3,e=>e.theme.margin),ys=B.div.withConfig({displayName:"CardInsideFull",componentId:"sc-nodwck-2"})(["margin-left:-","rem;margin-right:-","rem;"],e=>e.theme.margin,e=>e.theme.margin),eY=B.div.withConfig({displayName:"Margin",componentId:"sc-nodwck-3"})(["display:block;height:","rem;"],e=>e.theme.margin),Pg=5;function tY({resource:e,small:t}){const[n]=Xe(e),[r]=ye(e,G.description),[i]=it(e,G.collection.members),[o,a]=w.useState(!1),s=i.length>Pg;let u=i;return!o&&s&&(u=u.slice(0,Pg)),M(de.Fragment,{children:[f(We,{subject:e.getSubject(),children:f("h2",{children:n})}),r&&f(Gt,{text:r}),!t&&M(ys,{children:[u.map(l=>f(Do,{children:f(Yt,{subject:l})},l)),s&&f(Do,{children:f(ve,{clean:!0,onClick:()=>a(!o),children:o?"show less":`show ${i.length-Pg} more`})})]})]})}function Ap(e){const[t]=ye(e,G.file.downloadUrl),[n]=ye(e,G.file.mimetype),[r]=ru(e,G.file.filesize),i=w.useCallback(()=>{window.open(t)},[t]);if(t===void 0||n===void 0||r===void 0)throw new Error("File resource is missing properties");return{downloadFile:i,downloadUrl:t,bytes:r,mimeType:n}}const nY=["bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];function Gf(e){let t=0;for(;e>=1024&&++t;)e=e/1024;return e.toFixed(e<10&&t>0?1:0)+" "+nY[t]}function k7({downloadFile:e,fileSize:t}){return f(oi,{title:`Download file (${Gf(t??0)})`,onClick:e,children:f(rY,{})})}const rY=B(Cy).withConfig({displayName:"DownloadIcon",componentId:"sc-14ha1a2-0"})(["color:",";"],({theme:e})=>e.colors.main);function iY({downloadFile:e,fileSize:t}){return f(oY,{onClick:e,title:`Download file (${Gf(t??0)})`,children:M(Ut,{gap:"0.5rem",children:[f(Cy,{}),"Download"]})})}const oY=B(ve).withConfig({displayName:"StyledButton",componentId:"sc-14ha1a2-1"})(["view-transition-name:download-button;"]),aY="modulepreload",sY=function(e){return"/"+e},q8={},lY=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=sY(o),o in q8)return;q8[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const h=i[c];if(h.href===o&&(!a||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":aY,a||(l.as="script",l.crossOrigin=""),l.href=o,document.head.appendChild(l),a)return new Promise((c,h)=>{l.addEventListener("load",c),l.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())},uY=e=>{const t=document.getElementById(e);if(t)return t;const n=document.createElement("style");return n.id=e,document.head.appendChild(n),n};function cY(e){const t=w.useId();w.useEffect(()=>{const n=uY(t);return n.innerHTML=e,()=>{document.head.removeChild(n)}},[e])}function x7(e){const t=g2("file-image",e);return cY(` +`}),$};if(P&&P.length>0&&(b==="olist"||b==="ulist"))L=d.substring(0,v)+W(P,b,S,k)+d.substring(m,x);else{var U=""+S+A+k;L=d.substring(0,v)+U+d.substring(m,x)}n(L)}};return Hn.default.createElement("div",{className:c.yamde},Hn.default.createElement("div",{className:c.toolbar},Hn.default.createElement("div",{className:c.buttons},J8.toolbarActions.filter(function(g){return r==null?void 0:r.includes(g.name)}).map(function(g){var b=g.name,_=g.icon,S=g.schema;return Hn.default.createElement("div",{key:b,className:c.button,onClick:function(){return y({name:b,schema:S})}},_)})),Hn.default.createElement("div",{className:c.viewSwitch},Hn.default.createElement("div",{className:c.viewButton+" "+(s?"":c.activeView),onClick:function(){return u(!1)}},"Editor"),Hn.default.createElement("div",{className:c.viewButton+" "+(s?c.activeView:""),onClick:function(){return u(!0)}},"Preview"))),Hn.default.createElement("div",{className:c.contentArea},s?Hn.default.createElement("div",{className:c.preview,dangerouslySetInnerHTML:{__html:h}}):Hn.default.createElement("textarea",{rows:12,name:"yamdeContent",value:t,onChange:function(g){return p(g)},required:o,ref:l})),Hn.default.createElement("div",{className:c.mobileButton},J8.toolbarActions.filter(function(g){return r==null?void 0:r.includes(g.name)}).map(function(g){var b=g.name,_=g.icon,S=g.schema;return Hn.default.createElement("div",{key:b,className:c.button,onClick:function(){return y({name:b,schema:S})}},_)})))};d2.default=YG;var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.lightTheme=void 0;_p.lightTheme={buttonBackgroundColor:"#fff",buttonBorderColor:"#ddd",buttonColor:"#212121",buttonBackgroundColorHover:"#dcdcdc",switchButtonBackgroundColor:"whitesmoke",switchButtonBorderColor:"#ddd",switchButtonColorHover:"#333",switchButtonBackgroundColorHover:"#dcdcdc",switchButtonColorView:" #a0a0a0",switchButtonColorActiveView:"#333",switchButtonBackgroundColorActiveView:"#fff",switchButtonBorderColorActiveView:"#fff",textColor:"#333",contentAreaBackgroundColor:"#fff",textAreaBorderColor:"#ddd",previewAreaBorderColor:"#ddd",codeBlockBackgroundColor:"#ececec",linkColor:"#4183c4",quoteAdornmentColor:"#b9b9b9",tableBorderColor:"#ddd",textAreaSelectionBackgroundColor:"#a2a2a2",textAreaSelectionColor:"#000"};var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.darkTheme=void 0;Ep.darkTheme={buttonBackgroundColor:"#242424",buttonBorderColor:"#151515",buttonColor:"#777777",buttonBackgroundColorHover:"#1b1b1b",switchButtonBackgroundColor:"#242424",switchButtonBorderColor:"#151515",switchButtonColorHover:"#777777",switchButtonBackgroundColorHover:"#1b1b1b",switchButtonColorView:" #777777",switchButtonColorActiveView:"#777777",switchButtonBackgroundColorActiveView:"#1b1b1b",switchButtonBorderColorActiveView:"#1b1b1b",textColor:"#fff",contentAreaBackgroundColor:"#1b1b1b",textAreaBorderColor:"#151515",previewAreaBorderColor:"#151515",codeBlockBackgroundColor:"#383838",linkColor:"#4183c4",quoteAdornmentColor:"#b9b9b9",tableBorderColor:"#ddd",textAreaSelectionBackgroundColor:"#656565",textAreaSelectionColor:"#000"};var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.defaultToolbarAction=void 0;Rp.defaultToolbarAction=["bold","italic","strikethrough","heading1","heading2","heading3","ulist","olist","table","image","link","quote","code","hr"];var C7=Zn&&Zn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(C_,"__esModule",{value:!0});var Z8=C7(w),XG=X_,QG=C7(d2),JG=_p,ZG=Ep,eY=Rp,tY=function(e){var t=e.value,n=e.handler,r=e.theme,i=r===void 0?"light":r,o=e.toolbar,a=o===void 0?eY.defaultToolbarAction:o;return Z8.default.createElement(XG.ThemeProvider,{theme:i==="light"?JG.lightTheme:ZG.darkTheme},Z8.default.createElement(QG.default,{value:t,handler:n,toolbar:a}))},nY=C_.default=tY;function rY({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=be(e,t.subject,{handleValidationError:i}),{darkMode:s}=ot();return O(ye,{children:[f(un,{children:f(iY,{children:f(nY,{value:o||"",handler:u=>a(u),theme:s?"dark":"light",required:!1,...n})})}),o!==""&&r&&f(xt,{children:r.message}),o===""&&f(xt,{children:"Required"})]})}const iY=B.div.withConfig({displayName:"YamdeStyling",componentId:"sc-1tdmev8-0"})(["display:flex;flex:1;.yamde-0-2-1{margin:0;}.contentArea-0-2-8 textarea,.preview-0-2-9{background:",";font-size:","rem;}"],e=>e.theme.colors.bg,e=>e.theme.fontSizeBody);function e6({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=iu(e,t.subject,{handleValidationError:i});function s(u){if(u.target.value===""){a(void 0);return}const l=+u.target.value;a(l)}return O(ye,{children:[f(un,{children:f(Jn,{placeholder:"Enter a number...",type:"number",value:o===void 0||Number.isNaN(o)?"":o,onChange:s,...n})}),o!==void 0&&r&&f(xt,{children:r.message}),o===void 0&&f(xt,{children:"Required"})]})}function oY({resource:e,property:t,...n}){const[r,i]=w.useState(void 0),[o,a]=Dk(e,t.subject,{handleValidationError:i});function s(u){a(u.target.checked)}return O(ye,{children:[f(Jn,{type:"checkbox",checked:!!o,onChange:s,...n}),r&&f(xt,{children:r.message})]})}function _7(e){switch(e.property.datatype){case Ie.STRING:return f(fg,{...e});case Ie.MARKDOWN:return f(rY,{...e});case Ie.SLUG:return f(fg,{...e});case Ie.INTEGER:return f(e6,{...e});case Ie.FLOAT:return f(e6,{...e});case Ie.ATOMIC_URL:return f(LU,{...e});case Ie.RESOURCEARRAY:return f(DU,{...e});case Ie.BOOLEAN:return f(oY,{...e});default:return f(fg,{...e})}}function Ki({resource:e,noMargin:t,propertyURL:n,datatype:r}){const[i,o]=w.useState(!1),a=Lu(n),[s]=xa(e,n),u=We(),{agent:l}=ot();je("esc",()=>{o(!1)},{enableOnTags:["INPUT","TEXTAREA","SELECT"]});const[c,h]=w.useState(void 0),p=l!==void 0;if(s===void 0)return null;if(!a&&!r)return f("span",{title:`loading ${n}...`,children:"..."});if(!i)return O($1,{children:[f(o_,{value:s,datatype:r||a.datatype,noMargin:t}),f(aY,{title:"Edit value",children:f(As,{onClick:()=>o(!i)})})]});function y(){h(void 0),o(!1)}async function g(){try{await e.save(u),o(!1),dt.success("Resource saved")}catch(b){h(b),o(!0),dt.error("Could not save resource...")}}return O($1,{children:[f(_7,{"data-test":`input-${a.subject}`,resource:e,property:a,autoFocus:!0}),c&&f(xt,{children:c.message}),f(ve,{disabled:!p,title:p?"Save the edits":"You cannot save - there is no Agent set. Go to settings.",onClick:g,children:"save"}),f(ve,{subtle:!0,onClick:y,children:"cancel"})]})}const $1=B.div.withConfig({displayName:"ValueFormWrapper",componentId:"sc-ikjnmu-0"})(["position:relative;flex:1;word-wrap:break-word;max-width:100%;"]),aY=B.div.withConfig({displayName:"EditButton",componentId:"sc-ikjnmu-1"})(["position:absolute;top:0;color:",";right:100%;cursor:pointer;opacity:0;@media (hover:hover) and (pointer:fine){",":hover &{opacity:0.5;&:hover{opacity:1;}}}"],e=>e.theme.colors.main,$1),Ad=B.div.withConfig({displayName:"PropValRow",componentId:"sc-6tojua-0"})(["word-break:break-word;margin-bottom:0.5rem;@media screen and (min-width:500px){margin-bottom:",";flex-direction:",";display:",";}"],e=>e.columns?0:"0.5rem",e=>e.columns?"row":"column",e=>e.columns?"flex":"block"),Td=B.span.withConfig({displayName:"PropertyLabel",componentId:"sc-6tojua-1"})(["font-weight:bold;display:block;min-width:8rem;"]);function sY({propertyURL:e,resource:t,editable:n,columns:r}){const i=Lu(e),o=Pk(e,10,!0);return i.loading?f(Ad,{columns:r,children:f(Td,{title:e+" is loading",children:"loading..."})}):i.error?O(Ad,{columns:r,children:[f(Td,{title:e+" could not be loaded",children:f(Ve,{subject:e,children:f(Lt,{children:o})})}),f("code",{children:JSON.stringify(t.get(e))})]}):O(Ad,{columns:r,children:[f(Ve,{subject:e,children:O(Td,{title:i.description,children:[i.error?f(Lt,{children:o}):i.shortname||o,":"]})}),n?f(Ki,{resource:t,propertyURL:e,noMargin:!0}):f(o_,{datatype:i.datatype,value:t.get(e)})]})}const lY=B.div.withConfig({displayName:"AllPropsWrapper",componentId:"sc-1c1krfz-0"})(["margin-bottom:","rem;"],e=>e.theme.margin);function Os({resource:e,except:t=[],editable:n,columns:r}){return f(lY,{children:[...e.getPropVals()].map(([i,o])=>t.includes(i)?f(ye,{}):f(sY,{columns:r,propertyURL:i,resource:e,editable:!!n},i))})}const uY=(e,t=0)=>{let n=3735928559^t,r=1103547991^t;for(let i=0,o;i>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)};function x2(e,t){if(!t)throw new Error("Subject is required for transition name");return`${e}-${uY(t??"")}`}function Ap(e,t){let n;try{n=x2(e,t)}catch{return"view-transition-name: none"}return`view-transition-name: ${n}`}const Ci=B.div.withConfig({displayName:"Card",componentId:"sc-nodwck-0"})(["background-color:",";border:solid 1px ",";box-shadow:",";padding:","rem;padding-bottom:0;border-radius:",";max-height:",";overflow:",";border-color:",";",";"],e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.theme.boxShadow,e=>e.theme.margin,e=>e.theme.radius,e=>e.small?"10rem":"none",e=>e.small?"hidden":"visible",e=>e.highlight?e.theme.colors.main:e.theme.colors.bg2,e=>Ap("resource-page",e.about)),Do=B.div.withConfig({displayName:"CardRow",componentId:"sc-nodwck-1"})(["--border:solid 1px ",";display:block;border-top:",";padding:","rem ","rem;"],e=>e.theme.colors.bg2,e=>e.noBorder?"none":"var(--border)",e=>e.theme.margin/3,e=>e.theme.margin),Ss=B.div.withConfig({displayName:"CardInsideFull",componentId:"sc-nodwck-2"})(["margin-left:-","rem;margin-right:-","rem;"],e=>e.theme.margin,e=>e.theme.margin),cY=B.div.withConfig({displayName:"Margin",componentId:"sc-nodwck-3"})(["display:block;height:","rem;"],e=>e.theme.margin),Ig=5;function dY({resource:e,small:t}){const[n]=qe(e),[r]=be(e,G.description),[i]=it(e,G.collection.members),[o,a]=w.useState(!1),s=i.length>Ig;let u=i;return!o&&s&&(u=u.slice(0,Ig)),O(de.Fragment,{children:[f(Ve,{subject:e.getSubject(),children:f("h2",{children:n})}),r&&f(Gt,{text:r}),!t&&O(Ss,{children:[u.map(l=>f(Do,{children:f(Yt,{subject:l})},l)),s&&f(Do,{children:f(ve,{clean:!0,onClick:()=>a(!o),children:o?"show less":`show ${i.length-Ig} more`})})]})]})}function Tp(e){const[t]=be(e,G.file.downloadUrl),[n]=be(e,G.file.mimetype),[r]=iu(e,G.file.filesize),i=w.useCallback(()=>{window.open(t)},[t]);if(t===void 0||n===void 0||r===void 0)throw new Error("File resource is missing properties");return{downloadFile:i,downloadUrl:t,bytes:r,mimeType:n}}const fY=["bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];function Xf(e){let t=0;for(;e>=1024&&++t;)e=e/1024;return e.toFixed(e<10&&t>0?1:0)+" "+fY[t]}function E7({downloadFile:e,fileSize:t}){return f(yr,{title:`Download file (${Xf(t??0)})`,onClick:e,children:f(hY,{})})}const hY=B(_y).withConfig({displayName:"DownloadIcon",componentId:"sc-14ha1a2-0"})(["color:",";"],({theme:e})=>e.colors.main);function pY({downloadFile:e,fileSize:t}){return f(mY,{onClick:e,title:`Download file (${Xf(t??0)})`,children:O(Ht,{gap:"0.5rem",children:[f(_y,{}),"Download"]})})}const mY=B(ve).withConfig({displayName:"StyledButton",componentId:"sc-14ha1a2-1"})(["view-transition-name:download-button;"]),gY="modulepreload",vY=function(e){return"/"+e},t6={},yY=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=vY(o),o in t6)return;t6[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const h=i[c];if(h.href===o&&(!a||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":gY,a||(l.as="script",l.crossOrigin=""),l.href=o,document.head.appendChild(l),a)return new Promise((c,h)=>{l.addEventListener("load",c),l.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())},bY=e=>{const t=document.getElementById(e);if(t)return t;const n=document.createElement("style");return n.id=e,document.head.appendChild(n),n};function wY(e){const t=w.useId();w.useEffect(()=>{const n=bY(t);return n.innerHTML=e,()=>{document.head.removeChild(n)}},[e])}function R7(e){const t=x2("file-image",e);return wY(` ::view-transition-old(${t}), ::view-transition-new(${t}) { mix-blend-mode: normal; @@ -581,15 +581,15 @@ Left | Center | Right object-fit: cover; } - `),{viewTransitionName:t}}function dY({src:e,alt:t,className:n,subject:r}){const[i,o]=w.useState(!1),a=w.useContext(My),s=x7(r);return je("esc",()=>o(!1),{enabled:i}),a.current?M(fY,{showFull:i,title:"Click to enlarge",onClick:()=>o(u=>!u),children:[!i&&f("img",{src:e,alt:t??"",className:n,"data-test":"image-viewer",loading:"lazy",style:s}),i&&Lr.createPortal(f(hY,{children:f("img",{src:e,alt:t??"","data-test":"image-viewer"})}),a.current)]}):f(be,{})}const fY=B.button.withConfig({displayName:"WrapperButton",componentId:"sc-2er04y-0"})(["cursor:",";border:none;padding:0;width:fit-content;height:fit-content;user-select:none;border-radius:",";background-color:transparent;&:hover,&:focus{outline:2px solid ",";}& img{border-radius:",";vertical-align:sub;}"],e=>e.showFull?"zoom-out":"zoom-in",e=>e.theme.radius,e=>e.theme.colors.main,e=>e.theme.radius),hY=B.div.withConfig({displayName:"Viewer",componentId:"sc-2er04y-1"})(["position:fixed;inset:0;width:100vw;height:100%;max-height:100vh;max-height:100dvh;display:grid;place-items:center;padding:","rem;z-index:200;background-color:rgba(0,0,0,0.85);cursor:zoom-out;backdrop-filter:blur(5px);& img{height:90%;max-width:100%;max-height:100vh;object-fit:contain;border-radius:",";}"],e=>e.theme.margin,e=>e.theme.radius),pY=async(e,t,n)=>(await fetch(e,{credentials:"include",headers:{Accept:n},signal:t})).text();function C7({downloadUrl:e,mimeType:t,className:n}){const[r,i]=w.useState("");return w.useEffect(()=>{const o=new AbortController;return pY(e,o.signal,t).then(a=>i(a)),()=>o.abort()},[e]),t==="text/markdown"?f("div",{className:n,children:f(Gt,{text:r})}):f(mY,{className:n,children:r})}const mY=B.pre.withConfig({displayName:"Wrapper",componentId:"sc-m0pnpz-0"})(["white-space:pre-wrap;"]),_7=e=>e!=="application/pdf"&&((e==null?void 0:e.startsWith("text/"))||(e==null?void 0:e.startsWith("application/"))),K8=10*1024*1024,gY=1024*100;function v2(){const[e,t]=w.useState(K8),n=Qh("(prefers-reduced-data: reduce)");return w.useEffect(()=>{t(n?gY:K8)},[n]),e}const vY=de.lazy(()=>lY(()=>import("./index2.js"),["assets/index2.js","assets/index2.css"]));function E7({resource:e}){const{downloadUrl:t,mimeType:n,bytes:r}=Ap(e),[i,o]=w.useState(!1),a=v2();return r>a&&!i?f(wY,{bytes:r,onClick:()=>o(!0)}):n.startsWith("image/")?f(yY,{src:t,subject:e.getSubject()}):n.startsWith("video/")?M("video",{controls:!0,width:"100%",children:[f("source",{src:t,type:n}),"Sorry, your browser doesn't support embedded videos."]}):n.startsWith("audio/")?f("audio",{controls:!0,children:f("source",{src:t,type:n})}):_7(n)?f(bY,{downloadUrl:t,mimeType:n}):n==="application/pdf"?f(w.Suspense,{children:f(vY,{url:t})}):f(R7,{children:"No preview available"})}const yY=B(dY).withConfig({displayName:"StyledImageViewer",componentId:"sc-19bh7a9-0"})(["width:100%;"]),R7=B.div.withConfig({displayName:"NoPreview",componentId:"sc-19bh7a9-1"})(["display:grid;place-items:center;border:1px solid ",";border-radius:",";background-color:",";height:8rem;"],({theme:e})=>e.colors.bg2,({theme:e})=>e.radius,({theme:e})=>e.colors.bg1),bY=B(C7).withConfig({displayName:"StyledTextPreview",componentId:"sc-19bh7a9-2"})(["width:100%;border:1px solid ",";background-color:",";border-radius:",";padding:","rem;"],({theme:e})=>e.colors.bg2,({theme:e})=>e.colors.bg,({theme:e})=>e.radius,({theme:e})=>e.margin);function wY({bytes:e,onClick:t}){const n=v2();return M(R7,{children:[M("p",{children:["Preview hidden because the file is larger than"," ",Gf(n),"."]}),f("p",{children:M(ve,{onClick:t,children:["Load anyway (",Gf(e),")"]})})]})}function SY({resource:e}){const[t]=Xe(e),{downloadFile:n,bytes:r}=Ap(e);return M(de.Fragment,{children:[M(Ut,{justify:"space-between",children:[f(We,{subject:e.getSubject(),children:f("h2",{children:t})}),f(k7,{downloadFile:n,fileSize:r})]}),f(E7,{resource:e})]})}const mu=B.div.withConfig({displayName:"Detail",componentId:"sc-17iudlp-0"})(["display:inline-flex;align-items:center;gap:1ch;margin-right:2rem;"]),y2=B.div.withConfig({displayName:"Details",componentId:"sc-17iudlp-1"})(["font-style:italic;margin-bottom:0.5rem;margin-top:-0.5rem;"]);function b2({resource:e}){const[t]=ye(e,G.isA);return f(de.Fragment,{children:t&&f(mu,{children:M(be,{children:["is a ",zu(t),f(Yt,{subject:t})]})})})}function Is({commitSubject:e}){const t=Ce(e),[n]=ye(t,G.commit.signer),[r]=ye(t,G.commit.previousCommit),i=bI(t,G.commit.createdAt);return e?!e||!t.isReady?f(mu,{children:"loading..."}):M(mu,{children:[n&&f(Yt,{subject:n}),"-",M(We,{subject:e,children:[r?"edited ":"",i&&f(e_,{date:i})]})," "]}):null}const kY={commit:!0,validate:!1};function Ki({resource:e,parentRef:t,className:n,...r}){const[i,o]=Xe(e,1/0,kY),[a,s]=w.useState(!1),u=w.useRef(null),l=t||u,[c]=Wi(e);je("enter",()=>{s(!1)},{enableOnTags:["INPUT"]});function h(){s(!0)}const p=c?"set a title":"Untitled";return w.useEffect(()=>{var y,g;(y=l.current)==null||y.focus(),(g=l.current)==null||g.select()},[a]),c&&a?f(xY,{ref:l,"data-test":"editable-title",...r,onFocus:h,placeholder:p,onChange:y=>o(y.target.value),value:i||"",onBlur:()=>s(!1),className:n}):f(T7,{canEdit:!!c,title:c?"Edit title":"View title","data-test":"editable-title",onClick:h,subtle:!!c&&!i,subject:e.getSubject(),className:n,children:M(be,{children:[i||p,c&&f(CY,{})]})})}const A7=Jn(["line-height:1.1;"]),T7=B.h1.withConfig({displayName:"Title",componentId:"sc-1ha5zw9-0"})([""," display:flex;align-items:center;gap:","rem;justify-content:space-between;cursor:pointer;cursor:",";opacity:",";",";"],A7,e=>e.theme.margin,e=>e.canEdit?"pointer":"initial",e=>e.subtle?.5:1,e=>Rp("page-title",e.subject)),xY=B.input.withConfig({displayName:"TitleInput",componentId:"sc-1ha5zw9-1"})([""," margin-bottom:","rem;font-size:","rem;color:",";border:none;font-weight:bold;display:block;padding:0;margin-top:0;outline:none;background-color:transparent;margin-bottom:","rem;font-family:",";word-wrap:break-word;word-break:break-all;overflow:visible;&:focus{outline:none;}"],A7,e=>e.theme.margin,e=>e.theme.fontSizeH1,e=>e.theme.colors.text,e=>e.theme.margin,e=>e.theme.fontFamilyHeader),CY=B(_s).withConfig({displayName:"Icon",componentId:"sc-1ha5zw9-2"})(["opacity:0;font-size:0.8em;",":hover &{opacity:0.5;&:hover{opacity:1;}}"],T7),w2=[G.name,G.shortname,G.file.filename,G.description,G.isA,G.parent,G.write,G.read,G.commit.lastCommit];function _Y({resource:e}){const[t]=ye(e,G.commit.lastCommit);return M(Ot,{about:e.getSubject(),children:[f(Ki,{resource:e}),M(y2,{children:[f(b2,{resource:e}),f(Is,{commitSubject:t})]}),f(qi,{resource:e,propertyURL:G.description}),f(Ps,{resource:e,except:w2,editable:!0,columns:!0})]})}function EY({resource:e}){const[t]=ye(e,G.description),[n]=ye(e,G.parent),[r]=ye(e,G.commit.lastCommit);return M(be,{children:[M(y2,{children:[M(mu,{children:["Message in ",f(Yt,{subject:n})]}),f(Is,{commitSubject:r})]}),f(Gt,{text:t||""})]})}var S2=(e=>(e[e.Plain=0]="Plain",e[e.Button=1]="Button",e))(S2||{});function k2({to:e,children:t,variant:n}){return M(n===1?AY:RY,{href:e,target:"_blank",rel:"noreferrer",children:[t,f(ix,{})]})}k2.defaultProps={variant:0};const RY=B.a.withConfig({displayName:"ExternalLinkPlain",componentId:"sc-duirxt-0"})(["display:flex;align-items:center;gap:0.5rem;"]),AY=B.a.withConfig({displayName:"ExternalLinkButton",componentId:"sc-duirxt-1"})(["padding-inline:0.8rem;padding-block:0.4rem;width:fit-content;background-color:",";border:1.5px solid ",";border-radius:",";text-decoration:none;gap:1ch;display:flex;align-items:center;font-weight:600;justify-content:center;color:",";white-space:nowrap;transition:0.1s transform,0.1s background-color,0.1s box-shadow,0.1s color;&:hover,&:focus-within{background-color:",";color:white;}"],e=>e.theme.colors.bg,e=>e.theme.colors.main,e=>e.theme.radius,e=>e.theme.colors.main,e=>e.theme.colors.main);function TY({resource:e}){const[t]=Xe(e),[n]=ye(e,J.properties.bookmark.url),[r]=ye(e,J.properties.bookmark.preview);return M(be,{children:[f(We,{subject:e.getSubject(),children:f(PY,{children:t})}),f(k2,{to:n,variant:S2.Button,children:"Open site"}),r&&f(IY,{children:f(Gt,{maxLength:1e3,renderGFM:!0,text:r})})]})}const PY=B.h2.withConfig({displayName:"Title",componentId:"sc-1hrn0gr-0"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2;"]),IY=B.div.withConfig({displayName:"MarkdownWrapper",componentId:"sc-1hrn0gr-1"})(["margin-top:","rem;margin-inline:-","rem;padding:","rem;background-color:",";border-top:1px solid ",";img{border-radius:",";}"],e=>e.theme.margin,e=>e.theme.margin,e=>e.theme.margin,e=>e.theme.colors.bgBody,e=>e.theme.colors.bg2,e=>e.theme.radius);function OY({resource:e}){const[t]=ye(e,J.properties.parent),n=Ce(t),[r]=Xe(n),[i]=ye(e,J.properties.description);return M(be,{children:[f(We,{subject:n.getSubject(),children:f("h2",{children:r})}),f(Gt,{text:i??""})]})}const gu=B.div.withConfig({displayName:"GridCard",componentId:"sc-1a7sivg-0"})(["grid-area:card;background-color:",";border-radius:",";overflow:hidden;box-shadow:var(--shadow),var(--interaction-shadow);border:1px solid ",";transition:border 0.1s ease-in-out,box-shadow 0.1s ease-in-out;",";"],e=>e.theme.colors.bg1,e=>e.theme.radius,e=>e.theme.colors.bg2,e=>Rp("resource-page",e.subject)),vu=B.a.withConfig({displayName:"GridItemWrapper",componentId:"sc-1a7sivg-1"})(["--shadow:0px 0.7px 1.3px rgba(0,0,0,0.06),0px 1.8px 3.2px rgba(0,0,0,0.043),0px 3.4px 6px rgba(0,0,0,0.036),0px 6px 10.7px rgba(0,0,0,0.03),0px 11.3px 20.1px rgba(0,0,0,0.024),0px 27px 48px rgba(0,0,0,0.017);--interaction-shadow:0px 0px 0px 0px ",";--card-banner-padding:1rem;--card-banner-height:calc(var(--card-banner-padding) * 2 + 1.5em);outline:none;text-decoration:none;color:",";display:grid;grid-template-columns:1fr;grid-template-rows:1fr 2rem;grid-template-areas:'card' 'title';width:100%;aspect-ratio:1 / 1;cursor:pointer;gap:1rem;&:hover ",",&:focus ","{--interaction-shadow:0px 0px 0px 1px ",";border:1px solid ",";}&:hover,&:focus{color:",";}"],e=>e.theme.colors.main,e=>e.theme.colors.text1,gu,gu,e=>e.theme.colors.main,e=>e.theme.colors.main,e=>e.theme.colors.main),P7=B.div.withConfig({displayName:"GridItemTitle",componentId:"sc-1a7sivg-2"})(["grid-area:title;font-size:1rem;text-align:center;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;padding-inline:0.5rem;transition:color 0.1s ease-in-out;",";"],e=>Rp("page-title",e.subject)),x2=B.div.withConfig({displayName:"GridItemDescription",componentId:"sc-1a7sivg-3"})(["font-size:1.1rem;color:",";margin:","rem;overflow:hidden;height:calc(100% - ","rem);"],e=>e.theme.colors.textLight,e=>e.theme.margin,e=>e.theme.margin*2),Os=B.div.withConfig({displayName:"InnerWrapper",componentId:"sc-1a7sivg-4"})(["pointer-events:none;width:100%;height:calc(100% - var(--card-banner-height));"]);function LY({onClick:e}){return f(DY,{as:"button",onClick:e,children:f(ui,{})})}const DY=B(gu).withConfig({displayName:"Thing",componentId:"sc-1clqz58-0"})(["background-color:",";border:1px solid ",";cursor:pointer;display:grid;place-items:center;height:100%;width:100%;font-size:3rem;color:",";transition:color 0.1s ease-in-out,font-size 0.1s ease-out,border-color 0.1s ease-in-out;&:hover,&:focus{color:",";font-size:3.8rem;border-color:",";}:active{font-size:3rem;}"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,e=>e.theme.colors.main,e=>e.theme.colors.main);function C2({accept:e,parentResource:t,text:n,maxFiles:r,className:i,onFilesUploaded:o}){const{upload:a,isUploading:s,error:u}=Yy(t),l=w.useCallback(async p=>{const y=await a(p);o==null||o(y)},[a]),{getRootProps:c,getInputProps:h}=ap({onDrop:l,maxFiles:r,accept:e});return f(be,{children:M(MY,{...c(),className:i,children:[u&&f(xt,{children:u.message}),f("input",{...h()}),M(NY,{children:[f(lx,{})," ",s?"Uploading...":n??"Drop files or click here to upload."]})]})})}const MY=B.div.withConfig({displayName:"VisualDropZone",componentId:"sc-cb82zd-0"})(["background-color:",";backdrop-filter:blur(10px);border:2px dashed ",";border-radius:",";display:grid;place-items:center;font-size:1.3rem;color:",";min-height:10rem;cursor:pointer;&:hover,&:focus{color:",";border-color:",";}"],e=>e.theme.darkMode?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.8)",e=>e.theme.colors.bg2,e=>e.theme.radius,e=>e.theme.colors.textLight,e=>e.theme.colors.main,e=>e.theme.colors.main),NY=B.div.withConfig({displayName:"TextWrapper",componentId:"sc-cb82zd-1"})(["display:flex;align-items:center;padding:","rem;gap:1rem;"],e=>e.theme.margin),zY={properties:{coverImage:"https://atomicdata.dev/Folder/wp8ame4nqf/urHO7G8FKm"}},jY={commit:!0},G8={accept:["image/*"],maxFiles:1,text:"Click or drop image to use as a cover"};function BY({resource:e,canEdit:t}){const[n,r]=ye(e,zY.properties.coverImage,jY),i=Ce(n),[o]=ye(i,G.file.downloadUrl),a=w.useCallback(s=>{r(s[0])},[r]);return!o&&!t?f(be,{}):o?M($Y,{children:[f(FY,{src:o,alt:""}),t&&f($1,{children:f(UY,{...G8,parentResource:e,onFilesUploaded:a})})]}):f(C2,{...G8,parentResource:e,onFilesUploaded:a})}const FY=B.img.withConfig({displayName:"CoverImage",componentId:"sc-v8qaxg-0"})(["object-fit:cover;height:100%;width:100%;"]),$1=B.div.withConfig({displayName:"DropzoneWrapper",componentId:"sc-v8qaxg-1"})(["opacity:0;position:absolute;z-index:2;inset:0;height:100%;width:100%;",""],Nu("opacity")),$Y=B.div.withConfig({displayName:"CoverWrapper",componentId:"sc-v8qaxg-2"})(["&:hover ",",&:focus-within ","{opacity:1 !important;}position:relative;width:calc(100% + ","rem);margin-inline:-","rem;margin-top:-","rem;height:13rem;"],$1,$1,({theme:e})=>e.margin*2,({theme:e})=>e.margin,({theme:e})=>e.margin),UY=B(C2).withConfig({displayName:"StyledDropzone",componentId:"sc-v8qaxg-3"})(["height:100%;border-bottom-left-radius:0;border-bottom-right-radius:0;"]);function HY({resource:e,canEdit:t}){const n=Ke(),[r]=ye(e,G.description),[i,o]=de.useState(!1),a=async()=>{try{await e.save(n),o(!1),dt.success("Content saved")}catch{o(!0),dt.error("Could not save resource...")}};return!i&&t&&!r?M(qY,{onClick:()=>o(!0),children:[f(ui,{}),"Add Content"]}):i?M(be,{children:[f(Rr,{resource:e,propertyURL:G.description}),f("div",{children:f(ve,{onClick:a,children:"Save"})})]}):M(WY,{children:[t&&f(VY,{onClick:()=>o(!0),title:"Edit content",variant:uu.Colored,color:"main",children:f(_s,{})}),f(Gt,{text:r??""})]})}const WY=B.div.withConfig({displayName:"DescriptionWrapper",componentId:"sc-1gnhbjs-0"})(["position:relative;"]),VY=B(oi).withConfig({displayName:"EditButton",componentId:"sc-1gnhbjs-1"})(["position:absolute;top:0;right:0;"]),qY=B.button.withConfig({displayName:"AddContentButton",componentId:"sc-1gnhbjs-2"})(["width:100%;border:1px solid ",";background-color:",";border-radius:",";height:25rem;display:flex;align-items:center;justify-content:center;gap:1ch;color:",";cursor:pointer;",";&:hover,&:focus{border-color:",";color:",";}"],({theme:e})=>e.colors.bg2,({theme:e})=>e.colors.bgBody,({theme:e})=>e.radius,({theme:e})=>e.colors.textLight,Nu("border-color","color"),({theme:e})=>e.colors.main,({theme:e})=>e.colors.main);function KY({resource:e}){const[t]=ye(e,G.commit.lastCommit),[n]=Wi(e),r=Ek(e),i=zy(Ue.article,e.getSubject()),o=w.useCallback(()=>{i("article",{[G.isA]:[Ue.article],[G.name]:"New Article",[G.publishedAt]:Iu(),[G.description]:""})},[i]);return f(be,{children:M(ai,{gap:"2rem",children:[f(XY,{children:f(GY,{children:M(ai,{children:[f(BY,{resource:e,canEdit:n}),M(YY,{children:[f(Ki,{resource:e}),f(Is,{commitSubject:t})]}),f(HY,{resource:e,canEdit:n}),f(p_,{parentResource:e})]})})}),f(QY,{children:M(ZY,{children:[f("h2",{children:"Children"}),M(JY,{children:[r.map(a=>f(Y8,{children:f(Wu,{subject:a})},a)),n&&f(Y8,{children:f(LY,{onClick:o})})]})]})})]})})}const GY=B.div.withConfig({displayName:"Content",componentId:"sc-sf6of3-0"})(["position:relative;background-color:",";padding:","rem;border-radius:",";border:solid 1px ",";overflow:hidden;"],({theme:e})=>e.colors.bg,({theme:e})=>e.margin,({theme:e})=>e.radius,({theme:e})=>e.colors.bg2),YY=B.div.withConfig({displayName:"HeadingWrapper",componentId:"sc-sf6of3-1"})(["display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;h1{margin-bottom:0;}"]),XY=B(ba).withConfig({displayName:"ArticleContainer",componentId:"sc-sf6of3-2"})(["padding-bottom:0;&:last-child{padding-bottom:10rem;}"]),QY=B.section.withConfig({displayName:"ChildrenSection",componentId:"sc-sf6of3-3"})(["width:100%;background-color:",";padding-top:","rem;"],({theme:e})=>e.colors.bg,({theme:e})=>e.margin),JY=B.div.withConfig({displayName:"Grid",componentId:"sc-sf6of3-4"})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(20rem,1fr));gap:","rem;"],({theme:e})=>e.margin),ZY=B(ba).withConfig({displayName:"ContainerWider",componentId:"sc-sf6of3-5"})(["width:min(100%,80rem);"]),Y8=B.div.withConfig({displayName:"Height",componentId:"sc-sf6of3-6"})(["min-height:12rem;& > *{height:100%;}"]);function eX({resource:e}){const[t]=Xe(e),[n]=ye(e,G.description),r=G$(n??"").slice(0,200);return M("div",{children:[f(We,{subject:e.getSubject(),children:f(tX,{children:t})}),M("p",{children:[r,"..."]})]})}const tX=B.h2.withConfig({displayName:"Title",componentId:"sc-e9kun4-0"})(["white-space:nowrap;text-overflow:ellipsis;width:100%;overflow:hidden;font-size:1.3rem;"]);function Wu(e){const{subject:t,initialInView:n}=e,[r,i]=w.useState(!1),{ref:o,inView:a}=tU({threshold:0,initialInView:n});return w.useEffect(()=>{a&&!r&&i(!0)},[a,r]),f(w.Suspense,{children:f(Lo,{ref:o,...e,about:t,children:r?f(nX,{...e}):M(be,{children:[f("h2",{children:f(We,{subject:t,children:t})}),f("p",{children:"Resource is loading..."})]})})})}function nX(e){const{small:t,subject:n}=e,r=Ce(n),[i]=Xe(r),[o]=ye(r,G.isA);if(r.loading)return f("p",{children:"Loading..."});if(r.error)return M(Nt,{children:[f(We,{subject:n,children:f("h2",{children:i})}),r.error.message]});switch(o){case J.classes.collection:return f(tY,{resource:r,...e});case J.classes.file:return f(SY,{resource:r,...e});case J.classes.message:return f(EY,{resource:r,...e});case J.classes.bookmark:return f(TY,{resource:r,...e});case J.classes.elements.paragraph:return f(OY,{resource:r,...e});case J.classes.article:return f(eX,{resource:r,...e})}return M(de.Fragment,{children:[f(We,{subject:n,children:f("h2",{children:i})}),f(qi,{resource:r,propertyURL:J.properties.description}),!t&&f(Ps,{resource:r,except:w2,editable:!0})]})}function rX({resource:e,members:t,columns:n}){const r=n.filter(i=>i!==J.properties.shortname);return e===null?null:M(iX,{children:[f(oX,{columns:r}),t.length>0?f("tbody",{children:t.map(i=>f(sX,{propsArray:r,subject:i},i))}):f("p",{children:"This collection is empty"})]})}const iX=B.table.withConfig({displayName:"TableStyled",componentId:"sc-aorbls-0"})(["overflow-y:auto;border-collapse:collapse;margin-left:","rem;margin-right:","rem;margin-bottom:","rem;width:calc(100% + 2rem);"],e=>-e.theme.margin,e=>-e.theme.margin,e=>e.theme.margin);function oX({columns:e}){return f("thead",{children:M("tr",{children:[f(O7,{style:{minWidth:"10rem"},children:"subject"}),e.map(t=>f(aX,{subject:t},t))]})})}function aX({subject:e}){const[t,n]=gf("sort_by"),[r,i]=gf("sort_desc"),o=Ou(e),a=!o.isDynamic;function s(){t===e?i(r==="true"?void 0:"true"):n(e)}const u=t===e;let l="6rem";switch(o.datatype){case Ie.STRING:case Ie.RESOURCEARRAY:l="15rem";break;case Ie.MARKDOWN:l="25rem";break;case Ie.BOOLEAN:case Ie.INTEGER:l="6rem";break}return M(O7,{style:{minWidth:l},children:[f(Yt,{subject:e})," ",a&&f(ve,{onClick:s,subtle:!u,icon:!0,"data-test":`sort-${e}`,children:u?r==="true"?f(cD,{}):f(dD,{}):f(fD,{})})]})}const sX=de.memo(function({subject:t,propsArray:n}){const r=Ce(t,{allowIncomplete:!0});return r===null?null:M(lX,{about:t,children:[f(L7,{children:f(Yt,{subject:t})}),n.map(i=>f(cX,{resource:r,prop:i},i))]})}),lX=B.tr.withConfig({displayName:"RowStyled",componentId:"sc-aorbls-1"})(["background-color:",";border-top:solid 1px ",";&:last-child{border-bottom:solid 1px ",";}"],e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.theme.colors.bg2),uX=B.div.withConfig({displayName:"CellContainer",componentId:"sc-aorbls-2"})(["overflow:auto;max-height:5rem;max-width:40rem;"]);function cX({resource:e,prop:t}){return f(L7,{children:f(uX,{children:f(qi,{resource:e,propertyURL:t,noMargin:!0},t)})})}const I7=Jn(["padding:","rem;padding-left:","rem;vertical-align:top;&:last-child{width:100% !important;max-width:100% !important;}"],e=>e.theme.margin/2,e=>e.theme.margin),O7=B.th.withConfig({displayName:"CellHeaderStyled",componentId:"sc-aorbls-3"})(["text-align:left;"," font-weight:bold;white-space:nowrap;"],I7),L7=B.td.withConfig({displayName:"CellStyled",componentId:"sc-aorbls-4"})(["",""],I7),Ig=[{id:"cards",icon:f(mD,{})},{id:"table",icon:f(pD,{})}];function dX({resource:e}){const[t]=ye(e,G.description),r=NN()<700?0:1,[i,o]=yi("CollectionDisplayStyle",r),[a]=it(e,G.collection.members),[s]=ye(e,G.collection.value),[u]=ye(e,G.collection.property),[l]=ru(e,G.collection.currentPage),c=l||0,[h]=ru(e,G.collection.totalPages),p=h||1,[,y]=gf("current_page"),[g,b]=gf("sort_by"),_=Ce(s),[S]=it(_,G.requires),[k]=it(_,G.recommends),C=S.concat(k),[d]=ye(_,G.description),[v]=ye(_,G.shortname),[m,x]=w.useState(!1),A=s&&u===G.isA,L=Ke();o_(()=>{L.fetchResourceFromServer(e.getSubject())});function P(){o(O())}function O(){let $=i+1;return $>=Ig.length&&($=0),$}function V(){if(c!==0){const $=c-1;y($.toString())}}function H(){if(c!==p-1){const $=c+1;y($.toString())}}function j($){b($)}const F=Ig[i],R=Ig[O()];je("right",H,{},[c]),je("left",V,{},[c]);const q=()=>M(Ut,{children:[f(ve,{subtle:!0,onClick:V,title:"previous page (left arrow)",disabled:c===0,children:f(Zk,{})}),f(ve,{subtle:!0,onClick:H,title:"next page (right arrow)",disabled:c===p-1,"data-test":"next-page",children:f(ex,{})})]});return M(yf,{about:e.getSubject(),children:[f(Ki,{resource:e}),t&&f(Gt,{text:t}),M(pX,{children:[p>1&&f(q,{}),f(ve,{subtle:!0,onClick:P,title:`use ${R.id} view (v)`,children:R.icon}),A&&f(du,{subtle:!0,icon:!0,klass:s,parent:e.getSubjectNoParams()}),A&&f(ve,{subtle:!0,onClick:()=>x(!m),title:m?`Hide ${v} info`:`Show ${v} info`,children:f($h,{})}),A&&f(wU,{children:f(i_,{placeholder:"sort by...",initial:g,options:C,onUpdate:j})})]}),m&&s&&M(be,{children:[f(We,{subject:s,children:f("h3",{children:v})}),f(Gt,{text:d||""})]}),a.length===0?s?f(du,{klass:s,parent:e.getSubject()}):f(be,{children:"empty"}):M(be,{children:[F.id==="cards"&&f(fX,{members:a,subject:e.getSubject()}),F.id==="table"&&f(rX,{resource:e,members:a,columns:C})]}),p>1&&f(q,{})]})}function fX({members:e,subject:t}){return e.length===0?f("p",{children:"This collection is empty"}):f(mX,{children:e.map((n,r)=>f(hX,{children:f(Wu,{initialInView:r<10,subject:n},n)},t+" "+n+r))})}const hX=B.div.withConfig({displayName:"GridItem",componentId:"sc-ikp501-0"})(["margin:0;word-break:break-word;overflow:hidden;break-inside:avoid-column;margin-bottom:","rem;"],e=>e.theme.margin),pX=B.div.withConfig({displayName:"ButtonsBar",componentId:"sc-ikp501-1"})(["display:flex;flex-wrap:wrap;gap:","rem;"],e=>e.theme.margin),mX=B.div.withConfig({displayName:"Masonry",componentId:"sc-ikp501-2"})(["column-count:1;column-gap:","rem;overflow:visible;box-sizing:border-box;@supports (grid-template-rows:masonry){display:grid;grid-template-columns:repeat(1,1fr);grid-template-rows:masonry;grid-column-gap:","rem;}@media only screen and (min-width:600px){grid-template-columns:repeat(2,1fr);column-count:2;}@media only screen and (min-width:1000px){grid-template-columns:repeat(3,1fr);column-count:3;}@media only screen and (min-width:1400px){grid-template-columns:repeat(4,1fr);column-count:4;}"],e=>e.theme.margin,e=>e.theme.margin);function gX({resource:e}){const[t]=Xe(e),[n]=ye(e,G.description),[r]=it(e,G.endpoint.parameters),[i]=it(e,G.endpoint.results),o=Ce(void 0,{newResource:!0}),a=Ke(),s=_t();async function u(l){l&&l.preventDefault();const c=new URL(e.getSubject());await Promise.all(r.map(async h=>{const p=o.get(h);if(p!==void 0){const y=await a.getProperty(h);c.searchParams.set(y.shortname,p.toString())}})),s($t(c.href))}return M(Ot,{about:e.getSubject(),children:[M("h1",{children:[t," endpoint"]}),n&&f(Gt,{text:n}),f("form",{onSubmit:u,children:r.map(l=>f(Rr,{propertyURL:l,resource:o},l))}),f(ve,{onClick:u,children:"Go"}),i&&i.length===0?f("p",{children:"No hits"}):i.map(l=>f(Wu,{subject:l},l))]})}function vX({resource:e}){const[t]=it(e,G.subResources),{drive:n,setDrive:r}=ot();return n||r(e.getSubject()),M(Ot,{about:e.getSubject(),children:[M(Ut,{children:[f(Ki,{resource:e}),n!==e.getSubject()&&f(ve,{onClick:()=>r(e.getSubject()),children:"Set as current drive"})]}),f(qi,{resource:e,propertyURL:G.description,datatype:Ie.MARKDOWN}),M(Lo,{children:[f("h3",{children:"resources:"}),M(ys,{children:[t.map(i=>f(Do,{children:f(Yt,{subject:i})},i)),f(Do,{children:M(We,{path:$e.new,children:[f(ui,{})," Create new resource"]})})]})]}),n.startsWith("http://localhost")&&f("p",{children:"You are running Atomic-Server on `localhost`, which means that it will not be available from any other machine than your current local device. If you want your Atomic-Server to be available from the web, you should set this up at a Domain on a server."})]})}function yX({resource:e}){const[t]=ye(e,G.redirect.destination),[n]=ye(e,G.redirect.redirectAgent),r=_t(),{agent:i,setAgent:o}=ot(),a=Ke(),s=H5();return w.useEffect(()=>{n&&i&&!i.subject&&(i.subject=n,dt.success(M("div",{children:[f("p",{children:"New User created!"}),f(ve,{onClick:()=>r($e.agentSettings),children:"User Settings"})]}),{duration:6e3}),o(i)),t&&s!=="POP"&&(a.fetchResourceFromServer(t),r($t(t)))}),M(Ot,{about:e.getSubject(),children:[f(qi,{resource:e,propertyURL:G.description}),f("h1",{children:"Redirect"}),f("p",{children:"This page should redirect you automatically (unless you have just pressed the back button)"}),f(Ps,{resource:e,except:[G.isA]})]})}function bX({resource:e}){const[t]=ru(e,G.invite.usagesLeft),[n]=xk(e,G.invite.write),r=_t();H5();const{agent:i,setAgent:o}=ot(),a=Ce(i==null?void 0:i.subject),[s]=Xe(a,15),u=i==null?void 0:i.subject;async function l(){const h=await NP(),p=new of(h.privateKey);o(p);const y=await p.getPublicKey();c(y)}function c(h){const p=new URL(e.getSubject());h?p.searchParams.set("public-key",h):p.searchParams.set("agent",u),r($t(p.href))}return M(Ot,{about:e.getSubject(),children:[M("h1",{children:["Invite to ",n?"edit":"view"]}),f(qi,{resource:e,propertyURL:G.description}),t===0?f("em",{children:"Sorry, this Invite has no usages left. Ask for a new one."}):M(Ut,{children:[u?f(be,{children:M(ve,{"data-test":"accept-existing",onClick:()=>c(void 0),children:["Accept as ",s]})}):M(be,{children:[f(ve,{"data-test":"accept-new",onClick:l,children:"Accept as new user"}),f(ve,{"data-test":"accept-sign-in",onClick:()=>r($e.agentSettings),subtle:!0,children:"Sign in"})]}),!isNaN(t)&&M("p",{children:["(",t," usages left)"]})]})]})}function wX(...e){return w.useMemo(()=>t=>{e.forEach(n=>n(t))},e)}const Tp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ls(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _2(e){return"nodeType"in e}function er(e){var t,n;return e?Ls(e)?e:_2(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function E2(e){const{Document:t}=er(e);return e instanceof t}function Vu(e){return Ls(e)?!1:e instanceof er(e).HTMLElement}function SX(e){return e instanceof er(e).SVGElement}function Ds(e){return e?Ls(e)?e.document:_2(e)?E2(e)?e:Vu(e)?e.ownerDocument:document:document:document}const si=Tp?w.useLayoutEffect:w.useEffect;function R2(e){const t=w.useRef(e);return si(()=>{t.current=e}),w.useCallback(function(...n){return t.current==null?void 0:t.current(...n)},[])}function kX(){const e=w.useRef(null),t=w.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=w.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function yu(e,t=[e]){const n=w.useRef(e);return si(()=>{n.current!==e&&(n.current=e)},t),n}function qu(e,t){const n=w.useRef();return w.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Yf(e){const t=R2(e),n=w.useRef(null),r=w.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function U1(e){const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current}let Og={};function Ku(e,t){return w.useMemo(()=>{if(t)return t;const n=Og[e]==null?0:Og[e]+1;return Og[e]=n,`${e}-${n}`},[e,t])}function D7(e){return(t,...n)=>n.reduce((r,i)=>{const o=Object.entries(i);for(const[a,s]of o){const u=r[a];u!=null&&(r[a]=u+e*s)}return r},{...t})}const ss=D7(1),bu=D7(-1);function xX(e){return"clientX"in e&&"clientY"in e}function A2(e){if(!e)return!1;const{KeyboardEvent:t}=er(e.target);return t&&e instanceof t}function CX(e){if(!e)return!1;const{TouchEvent:t}=er(e.target);return t&&e instanceof t}function H1(e){if(CX(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return xX(e)?{x:e.clientX,y:e.clientY}:null}const wu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return`translate3d(${t?Math.round(t):0}px, ${n?Math.round(n):0}px, 0)`}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return`scaleX(${t}) scaleY(${n})`}},Transform:{toString(e){if(e)return[wu.Translate.toString(e),wu.Scale.toString(e)].join(" ")}},Transition:{toString({property:e,duration:t,easing:n}){return`${e} ${t}ms ${n}`}}}),X8="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _X(e){return e.matches(X8)?e:e.querySelector(X8)}const EX={display:"none"};function RX({id:e,value:t}){return f("div",{id:e,style:EX,children:t})}const AX={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function TX({id:e,announcement:t}){return f("div",{id:e,style:AX,role:"status","aria-live":"assertive","aria-atomic":!0,children:t})}function PX(){const[e,t]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const M7=w.createContext(null);function IX(e){const t=w.useContext(M7);w.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function OX(){const[e]=w.useState(()=>new Set),t=w.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[w.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const LX={draggable:` + `),{viewTransitionName:t}}function SY({src:e,alt:t,className:n,subject:r}){const[i,o]=w.useState(!1),a=w.useContext(My),s=R7(r);return je("esc",()=>o(!1),{enabled:i}),a.current?O(kY,{showFull:i,title:"Click to enlarge",onClick:()=>o(u=>!u),children:[!i&&f("img",{src:e,alt:t??"",className:n,"data-test":"image-viewer",loading:"lazy",style:s}),i&&Mr.createPortal(f(xY,{children:f("img",{src:e,alt:t??"","data-test":"image-viewer"})}),a.current)]}):f(ye,{})}const kY=B.button.withConfig({displayName:"WrapperButton",componentId:"sc-2er04y-0"})(["cursor:",";border:none;padding:0;width:fit-content;height:fit-content;user-select:none;border-radius:",";background-color:transparent;&:hover,&:focus{outline:2px solid ",";}& img{border-radius:",";vertical-align:sub;}"],e=>e.showFull?"zoom-out":"zoom-in",e=>e.theme.radius,e=>e.theme.colors.main,e=>e.theme.radius),xY=B.div.withConfig({displayName:"Viewer",componentId:"sc-2er04y-1"})(["position:fixed;inset:0;width:100vw;height:100%;max-height:100vh;max-height:100dvh;display:grid;place-items:center;padding:","rem;z-index:200;background-color:rgba(0,0,0,0.85);cursor:zoom-out;backdrop-filter:blur(5px);& img{height:90%;max-width:100%;max-height:100vh;object-fit:contain;border-radius:",";}"],e=>e.theme.margin,e=>e.theme.radius),CY=async(e,t,n)=>(await fetch(e,{credentials:"include",headers:{Accept:n},signal:t})).text();function A7({downloadUrl:e,mimeType:t,className:n}){const[r,i]=w.useState("");return w.useEffect(()=>{const o=new AbortController;return CY(e,o.signal,t).then(a=>i(a)),()=>o.abort()},[e]),t==="text/markdown"?f("div",{className:n,children:f(Gt,{text:r})}):f(_Y,{className:n,children:r})}const _Y=B.pre.withConfig({displayName:"Wrapper",componentId:"sc-m0pnpz-0"})(["white-space:pre-wrap;"]),T7=e=>e!=="application/pdf"&&((e==null?void 0:e.startsWith("text/"))||(e==null?void 0:e.startsWith("application/"))),n6=10*1024*1024,EY=1024*100;function C2(){const[e,t]=w.useState(n6),n=Fu("(prefers-reduced-data: reduce)");return w.useEffect(()=>{t(n?EY:n6)},[n]),e}const RY=de.lazy(()=>yY(()=>import("./index2.js"),["assets/index2.js","assets/index2.css"]));function P7({resource:e}){const{downloadUrl:t,mimeType:n,bytes:r}=Tp(e),[i,o]=w.useState(!1),a=C2();return r>a&&!i?f(PY,{bytes:r,onClick:()=>o(!0)}):n.startsWith("image/")?f(AY,{src:t,subject:e.getSubject()}):n.startsWith("video/")?O("video",{controls:!0,width:"100%",children:[f("source",{src:t,type:n}),"Sorry, your browser doesn't support embedded videos."]}):n.startsWith("audio/")?f("audio",{controls:!0,children:f("source",{src:t,type:n})}):T7(n)?f(TY,{downloadUrl:t,mimeType:n}):n==="application/pdf"?f(w.Suspense,{children:f(RY,{url:t})}):f(I7,{children:"No preview available"})}const AY=B(SY).withConfig({displayName:"StyledImageViewer",componentId:"sc-19bh7a9-0"})(["width:100%;"]),I7=B.div.withConfig({displayName:"NoPreview",componentId:"sc-19bh7a9-1"})(["display:grid;place-items:center;border:1px solid ",";border-radius:",";background-color:",";height:8rem;"],({theme:e})=>e.colors.bg2,({theme:e})=>e.radius,({theme:e})=>e.colors.bg1),TY=B(A7).withConfig({displayName:"StyledTextPreview",componentId:"sc-19bh7a9-2"})(["width:100%;border:1px solid ",";background-color:",";border-radius:",";padding:","rem;"],({theme:e})=>e.colors.bg2,({theme:e})=>e.colors.bg,({theme:e})=>e.radius,({theme:e})=>e.margin);function PY({bytes:e,onClick:t}){const n=C2();return O(I7,{children:[O("p",{children:["Preview hidden because the file is larger than"," ",Xf(n),"."]}),f("p",{children:O(ve,{onClick:t,children:["Load anyway (",Xf(e),")"]})})]})}function IY({resource:e}){const[t]=qe(e),{downloadFile:n,bytes:r}=Tp(e);return O(de.Fragment,{children:[O(Ht,{justify:"space-between",children:[f(Ve,{subject:e.getSubject(),children:f("h2",{children:t})}),f(E7,{downloadFile:n,fileSize:r})]}),f(P7,{resource:e})]})}const gu=B.div.withConfig({displayName:"Detail",componentId:"sc-17iudlp-0"})(["display:inline-flex;align-items:center;gap:1ch;margin-right:2rem;"]),_2=B.div.withConfig({displayName:"Details",componentId:"sc-17iudlp-1"})(["font-style:italic;margin-bottom:0.5rem;margin-top:-0.5rem;"]);function E2({resource:e}){const[t]=be(e,G.isA);return f(de.Fragment,{children:t&&f(gu,{children:O(ye,{children:["is a ",Bu(t),f(Yt,{subject:t})]})})})}function Ls({commitSubject:e}){const t=Ce(e),[n]=be(t,G.commit.signer),[r]=be(t,G.commit.previousCommit),i=RI(t,G.commit.createdAt);return e?!e||!t.isReady?f(gu,{children:"loading..."}):O(gu,{children:[n&&f(Yt,{subject:n}),"-",O(Ve,{subject:e,children:[r?"edited ":"",i&&f(e2,{date:i})]})," "]}):null}const OY={commit:!0,validate:!1};function Gi({resource:e,parentRef:t,className:n,...r}){const[i,o]=qe(e,1/0,OY),[a,s]=w.useState(!1),u=w.useRef(null),l=t||u,[c]=Wi(e);je("enter",()=>{s(!1)},{enableOnTags:["INPUT"]});function h(){s(!0)}const p=c?"set a title":"Untitled";return w.useEffect(()=>{var y,g;(y=l.current)==null||y.focus(),(g=l.current)==null||g.select()},[a]),c&&a?f(LY,{ref:l,"data-test":"editable-title",...r,onFocus:h,placeholder:p,onChange:y=>o(y.target.value),value:i||"",onBlur:()=>s(!1),className:n}):f(L7,{canEdit:!!c,title:c?"Edit title":"View title","data-test":"editable-title",onClick:h,subtle:!!c&&!i,subject:e.getSubject(),className:n,children:O(ye,{children:[i||p,c&&f(DY,{})]})})}const O7=er(["line-height:1.1;"]),L7=B.h1.withConfig({displayName:"Title",componentId:"sc-1ha5zw9-0"})([""," display:flex;align-items:center;gap:","rem;justify-content:space-between;cursor:pointer;cursor:",";opacity:",";",";"],O7,e=>e.theme.margin,e=>e.canEdit?"pointer":"initial",e=>e.subtle?.5:1,e=>Ap("page-title",e.subject)),LY=B.input.withConfig({displayName:"TitleInput",componentId:"sc-1ha5zw9-1"})([""," margin-bottom:","rem;font-size:","rem;color:",";border:none;font-weight:bold;display:block;padding:0;margin-top:0;outline:none;background-color:transparent;margin-bottom:","rem;font-family:",";word-wrap:break-word;word-break:break-all;overflow:visible;&:focus{outline:none;}"],O7,e=>e.theme.margin,e=>e.theme.fontSizeH1,e=>e.theme.colors.text,e=>e.theme.margin,e=>e.theme.fontFamilyHeader),DY=B(As).withConfig({displayName:"Icon",componentId:"sc-1ha5zw9-2"})(["opacity:0;font-size:0.8em;",":hover &{opacity:0.5;&:hover{opacity:1;}}"],L7),R2=[G.name,G.shortname,G.file.filename,G.description,G.isA,G.parent,G.write,G.read,G.commit.lastCommit];function NY({resource:e}){const[t]=be(e,G.commit.lastCommit);return O(_t,{about:e.getSubject(),children:[f(Gi,{resource:e}),O(_2,{children:[f(E2,{resource:e}),f(Ls,{commitSubject:t})]}),f(Ki,{resource:e,propertyURL:G.description}),f(Os,{resource:e,except:R2,editable:!0,columns:!0})]})}function MY({resource:e}){const[t]=be(e,G.description),[n]=be(e,G.parent),[r]=be(e,G.commit.lastCommit);return O(ye,{children:[O(_2,{children:[O(gu,{children:["Message in ",f(Yt,{subject:n})]}),f(Ls,{commitSubject:r})]}),f(Gt,{text:t||""})]})}var A2=(e=>(e[e.Plain=0]="Plain",e[e.Button=1]="Button",e))(A2||{});function T2({to:e,children:t,variant:n}){return O(n===1?jY:zY,{href:e,target:"_blank",rel:"noreferrer",children:[t,f(mx,{})]})}T2.defaultProps={variant:0};const zY=B.a.withConfig({displayName:"ExternalLinkPlain",componentId:"sc-duirxt-0"})(["display:flex;align-items:center;gap:0.5rem;"]),jY=B.a.withConfig({displayName:"ExternalLinkButton",componentId:"sc-duirxt-1"})(["padding-inline:0.8rem;padding-block:0.4rem;width:fit-content;background-color:",";border:1.5px solid ",";border-radius:",";text-decoration:none;gap:1ch;display:flex;align-items:center;font-weight:600;justify-content:center;color:",";white-space:nowrap;transition:0.1s transform,0.1s background-color,0.1s box-shadow,0.1s color;&:hover,&:focus-within{background-color:",";color:white;}"],e=>e.theme.colors.bg,e=>e.theme.colors.main,e=>e.theme.radius,e=>e.theme.colors.main,e=>e.theme.colors.main);function BY({resource:e}){const[t]=qe(e),[n]=be(e,Q.properties.bookmark.url),[r]=be(e,Q.properties.bookmark.preview);return O(ye,{children:[f(Ve,{subject:e.getSubject(),children:f(FY,{children:t})}),f(T2,{to:n,variant:A2.Button,children:"Open site"}),r&&f($Y,{children:f(Gt,{maxLength:1e3,renderGFM:!0,text:r})})]})}const FY=B.h2.withConfig({displayName:"Title",componentId:"sc-1hrn0gr-0"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2;"]),$Y=B.div.withConfig({displayName:"MarkdownWrapper",componentId:"sc-1hrn0gr-1"})(["margin-top:","rem;margin-inline:-","rem;padding:","rem;background-color:",";border-top:1px solid ",";img{border-radius:",";}"],e=>e.theme.margin,e=>e.theme.margin,e=>e.theme.margin,e=>e.theme.colors.bgBody,e=>e.theme.colors.bg2,e=>e.theme.radius);function HY({resource:e}){const[t]=be(e,Q.properties.parent),n=Ce(t),[r]=qe(n),[i]=be(e,Q.properties.description);return O(ye,{children:[f(Ve,{subject:n.getSubject(),children:f("h2",{children:r})}),f(Gt,{text:i??""})]})}const vu=B.div.withConfig({displayName:"GridCard",componentId:"sc-1a7sivg-0"})(["grid-area:card;background-color:",";border-radius:",";overflow:hidden;box-shadow:var(--shadow),var(--interaction-shadow);border:1px solid ",";transition:border 0.1s ease-in-out,box-shadow 0.1s ease-in-out;",";"],e=>e.theme.colors.bg1,e=>e.theme.radius,e=>e.theme.colors.bg2,e=>Ap("resource-page",e.subject)),yu=B.a.withConfig({displayName:"GridItemWrapper",componentId:"sc-1a7sivg-1"})(["--shadow:0px 0.7px 1.3px rgba(0,0,0,0.06),0px 1.8px 3.2px rgba(0,0,0,0.043),0px 3.4px 6px rgba(0,0,0,0.036),0px 6px 10.7px rgba(0,0,0,0.03),0px 11.3px 20.1px rgba(0,0,0,0.024),0px 27px 48px rgba(0,0,0,0.017);--interaction-shadow:0px 0px 0px 0px ",";--card-banner-padding:1rem;--card-banner-height:calc(var(--card-banner-padding) * 2 + 1.5em);outline:none;text-decoration:none;color:",";display:grid;grid-template-columns:1fr;grid-template-rows:1fr 2rem;grid-template-areas:'card' 'title';width:100%;aspect-ratio:1 / 1;cursor:pointer;gap:1rem;&:hover ",",&:focus ","{--interaction-shadow:0px 0px 0px 1px ",";border:1px solid ",";}&:hover,&:focus{color:",";}"],e=>e.theme.colors.main,e=>e.theme.colors.text1,vu,vu,e=>e.theme.colors.main,e=>e.theme.colors.main,e=>e.theme.colors.main),D7=B.div.withConfig({displayName:"GridItemTitle",componentId:"sc-1a7sivg-2"})(["grid-area:title;font-size:1rem;text-align:center;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;padding-inline:0.5rem;transition:color 0.1s ease-in-out;",";"],e=>Ap("page-title",e.subject)),P2=B.div.withConfig({displayName:"GridItemDescription",componentId:"sc-1a7sivg-3"})(["font-size:1.1rem;color:",";margin:","rem;overflow:hidden;height:calc(100% - ","rem);"],e=>e.theme.colors.textLight,e=>e.theme.margin,e=>e.theme.margin*2),Ds=B.div.withConfig({displayName:"InnerWrapper",componentId:"sc-1a7sivg-4"})(["pointer-events:none;width:100%;height:calc(100% - var(--card-banner-height));"]);function UY({onClick:e}){return f(VY,{as:"button",onClick:e,children:f(ui,{})})}const VY=B(vu).withConfig({displayName:"Thing",componentId:"sc-1clqz58-0"})(["background-color:",";border:1px solid ",";cursor:pointer;display:grid;place-items:center;height:100%;width:100%;font-size:3rem;color:",";transition:color 0.1s ease-in-out,font-size 0.1s ease-out,border-color 0.1s ease-in-out;&:hover,&:focus{color:",";font-size:3.8rem;border-color:",";}:active{font-size:3rem;}"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,e=>e.theme.colors.main,e=>e.theme.colors.main);function I2({accept:e,parentResource:t,text:n,maxFiles:r,className:i,onFilesUploaded:o}){const{upload:a,isUploading:s,error:u}=n2(t),l=w.useCallback(async p=>{const y=await a(p);o==null||o(y)},[a]),{getRootProps:c,getInputProps:h}=sp({onDrop:l,maxFiles:r,accept:e});return f(ye,{children:O(WY,{...c(),className:i,children:[u&&f(xt,{children:u.message}),f("input",{...h()}),O(qY,{children:[f(bx,{})," ",s?"Uploading...":n??"Drop files or click here to upload."]})]})})}const WY=B.div.withConfig({displayName:"VisualDropZone",componentId:"sc-cb82zd-0"})(["background-color:",";backdrop-filter:blur(10px);border:2px dashed ",";border-radius:",";display:grid;place-items:center;font-size:1.3rem;color:",";min-height:10rem;cursor:pointer;&:hover,&:focus{color:",";border-color:",";}"],e=>e.theme.darkMode?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.8)",e=>e.theme.colors.bg2,e=>e.theme.radius,e=>e.theme.colors.textLight,e=>e.theme.colors.main,e=>e.theme.colors.main),qY=B.div.withConfig({displayName:"TextWrapper",componentId:"sc-cb82zd-1"})(["display:flex;align-items:center;padding:","rem;gap:1rem;"],e=>e.theme.margin),KY={properties:{coverImage:"https://atomicdata.dev/Folder/wp8ame4nqf/urHO7G8FKm"}},GY={commit:!0},r6={accept:["image/*"],maxFiles:1,text:"Click or drop image to use as a cover"};function YY({resource:e,canEdit:t}){const[n,r]=be(e,KY.properties.coverImage,GY),i=Ce(n),[o]=be(i,G.file.downloadUrl),a=w.useCallback(s=>{r(s[0])},[r]);return!o&&!t?f(ye,{}):o?O(QY,{children:[f(XY,{src:o,alt:""}),t&&f(H1,{children:f(JY,{...r6,parentResource:e,onFilesUploaded:a})})]}):f(I2,{...r6,parentResource:e,onFilesUploaded:a})}const XY=B.img.withConfig({displayName:"CoverImage",componentId:"sc-v8qaxg-0"})(["object-fit:cover;height:100%;width:100%;"]),H1=B.div.withConfig({displayName:"DropzoneWrapper",componentId:"sc-v8qaxg-1"})(["opacity:0;position:absolute;z-index:2;inset:0;height:100%;width:100%;",""],zu("opacity")),QY=B.div.withConfig({displayName:"CoverWrapper",componentId:"sc-v8qaxg-2"})(["&:hover ",",&:focus-within ","{opacity:1 !important;}position:relative;width:calc(100% + ","rem);margin-inline:-","rem;margin-top:-","rem;height:13rem;"],H1,H1,({theme:e})=>e.margin*2,({theme:e})=>e.margin,({theme:e})=>e.margin),JY=B(I2).withConfig({displayName:"StyledDropzone",componentId:"sc-v8qaxg-3"})(["height:100%;border-bottom-left-radius:0;border-bottom-right-radius:0;"]);function ZY({resource:e,canEdit:t}){const n=We(),[r]=be(e,G.description),[i,o]=de.useState(!1),a=async()=>{try{await e.save(n),o(!1),dt.success("Content saved")}catch{o(!0),dt.error("Could not save resource...")}};return!i&&t&&!r?O(nX,{onClick:()=>o(!0),children:[f(ui,{}),"Add Content"]}):i?O(ye,{children:[f(Pr,{resource:e,propertyURL:G.description}),f("div",{children:f(ve,{onClick:a,children:"Save"})})]}):O(eX,{children:[t&&f(tX,{onClick:()=>o(!0),title:"Edit content",variant:cu.Colored,color:"main",children:f(As,{})}),f(Gt,{text:r??""})]})}const eX=B.div.withConfig({displayName:"DescriptionWrapper",componentId:"sc-1gnhbjs-0"})(["position:relative;"]),tX=B(yr).withConfig({displayName:"EditButton",componentId:"sc-1gnhbjs-1"})(["position:absolute;top:0;right:0;"]),nX=B.button.withConfig({displayName:"AddContentButton",componentId:"sc-1gnhbjs-2"})(["width:100%;border:1px solid ",";background-color:",";border-radius:",";height:25rem;display:flex;align-items:center;justify-content:center;gap:1ch;color:",";cursor:pointer;",";&:hover,&:focus{border-color:",";color:",";}"],({theme:e})=>e.colors.bg2,({theme:e})=>e.colors.bgBody,({theme:e})=>e.radius,({theme:e})=>e.colors.textLight,zu("border-color","color"),({theme:e})=>e.colors.main,({theme:e})=>e.colors.main);function rX({resource:e}){const[t]=be(e,G.commit.lastCommit),[n]=Wi(e),r=zk(e),i=Uy(He.article,e.getSubject()),o=w.useCallback(()=>{i("article",{[G.isA]:[He.article],[G.name]:"New Article",[G.publishedAt]:Ou(),[G.description]:""})},[i]);return f(ye,{children:O(Nn,{gap:"2rem",children:[f(aX,{children:f(iX,{children:O(Nn,{children:[f(YY,{resource:e,canEdit:n}),O(oX,{children:[f(Gi,{resource:e}),f(Ls,{commitSubject:t})]}),f(ZY,{resource:e,canEdit:n}),f(y_,{parentResource:e})]})})}),f(sX,{children:O(uX,{children:[f("h2",{children:"Children"}),O(lX,{children:[r.map(a=>f(i6,{children:f(Ku,{subject:a})},a)),n&&f(i6,{children:f(UY,{onClick:o})})]})]})})]})})}const iX=B.div.withConfig({displayName:"Content",componentId:"sc-sf6of3-0"})(["position:relative;background-color:",";padding:","rem;border-radius:",";border:solid 1px ",";overflow:hidden;"],({theme:e})=>e.colors.bg,({theme:e})=>e.margin,({theme:e})=>e.radius,({theme:e})=>e.colors.bg2),oX=B.div.withConfig({displayName:"HeadingWrapper",componentId:"sc-sf6of3-1"})(["display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;h1{margin-bottom:0;}"]),aX=B(ba).withConfig({displayName:"ArticleContainer",componentId:"sc-sf6of3-2"})(["padding-bottom:0;&:last-child{padding-bottom:10rem;}"]),sX=B.section.withConfig({displayName:"ChildrenSection",componentId:"sc-sf6of3-3"})(["width:100%;background-color:",";padding-top:","rem;"],({theme:e})=>e.colors.bg,({theme:e})=>e.margin),lX=B.div.withConfig({displayName:"Grid",componentId:"sc-sf6of3-4"})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(20rem,1fr));gap:","rem;"],({theme:e})=>e.margin),uX=B(ba).withConfig({displayName:"ContainerWider",componentId:"sc-sf6of3-5"})(["width:min(100%,80rem);"]),i6=B.div.withConfig({displayName:"Height",componentId:"sc-sf6of3-6"})(["min-height:12rem;& > *{height:100%;}"]);function cX({resource:e}){const[t]=qe(e),[n]=be(e,G.description),r=iH(n??"").slice(0,200);return O("div",{children:[f(Ve,{subject:e.getSubject(),children:f(dX,{children:t})}),O("p",{children:[r,"..."]})]})}const dX=B.h2.withConfig({displayName:"Title",componentId:"sc-e9kun4-0"})(["white-space:nowrap;text-overflow:ellipsis;width:100%;overflow:hidden;font-size:1.3rem;"]);function Ku(e){const{subject:t,initialInView:n}=e,[r,i]=w.useState(!1),{ref:o,inView:a}=dH({threshold:0,initialInView:n});return w.useEffect(()=>{a&&!r&&i(!0)},[a,r]),f(w.Suspense,{children:f(Ci,{ref:o,...e,about:t,children:r?f(fX,{...e}):O(ye,{children:[f("h2",{children:f(Ve,{subject:t,children:t})}),f("p",{children:"Resource is loading..."})]})})})}function fX(e){const{subject:t}=e,n=Ce(t),[r]=qe(n),[i]=be(n,G.isA);if(n.loading)return f("p",{children:"Loading..."});if(n.error)return O(Lt,{children:[f(Ve,{subject:t,children:f("h2",{children:r})}),n.error.message]});switch(i){case Q.classes.collection:return f(dY,{resource:n,...e});case Q.classes.file:return f(IY,{resource:n,...e});case Q.classes.message:return f(MY,{resource:n,...e});case Q.classes.bookmark:return f(BY,{resource:n,...e});case Q.classes.elements.paragraph:return f(HY,{resource:n,...e});case Q.classes.article:return f(cX,{resource:n,...e});default:return f(O2,{resource:n,...e})}}function O2({resource:e,small:t}){const[n]=qe(e);return O(de.Fragment,{children:[f(Ve,{subject:e.getSubject(),children:f("h2",{children:n})}),f(Ki,{resource:e,propertyURL:Q.properties.description}),!t&&f(Os,{resource:e,except:R2,editable:!0})]})}function hX({resource:e,members:t,columns:n}){const r=n.filter(i=>i!==Q.properties.shortname);return e===null?null:O(pX,{children:[f(mX,{columns:r}),t.length>0?f("tbody",{children:t.map(i=>f(vX,{propsArray:r,subject:i},i))}):f("p",{children:"This collection is empty"})]})}const pX=B.table.withConfig({displayName:"TableStyled",componentId:"sc-aorbls-0"})(["overflow-y:auto;border-collapse:collapse;margin-left:","rem;margin-right:","rem;margin-bottom:","rem;width:calc(100% + 2rem);"],e=>-e.theme.margin,e=>-e.theme.margin,e=>e.theme.margin);function mX({columns:e}){return f("thead",{children:O("tr",{children:[f(M7,{style:{minWidth:"10rem"},children:"subject"}),e.map(t=>f(gX,{subject:t},t))]})})}function gX({subject:e}){const[t,n]=yf("sort_by"),[r,i]=yf("sort_desc"),o=Lu(e),a=!o.isDynamic;function s(){t===e?i(r==="true"?void 0:"true"):n(e)}const u=t===e;let l="6rem";switch(o.datatype){case Ie.STRING:case Ie.RESOURCEARRAY:l="15rem";break;case Ie.MARKDOWN:l="25rem";break;case Ie.BOOLEAN:case Ie.INTEGER:l="6rem";break}return O(M7,{style:{minWidth:l},children:[f(Yt,{subject:e})," ",a&&f(ve,{onClick:s,subtle:!u,icon:!0,"data-test":`sort-${e}`,children:u?r==="true"?f(bD,{}):f(wD,{}):f(SD,{})})]})}const vX=de.memo(function({subject:t,propsArray:n}){const r=Ce(t,{allowIncomplete:!0});return r===null?null:O(yX,{about:t,children:[f(z7,{children:f(Yt,{subject:t})}),n.map(i=>f(wX,{resource:r,prop:i},i))]})}),yX=B.tr.withConfig({displayName:"RowStyled",componentId:"sc-aorbls-1"})(["background-color:",";border-top:solid 1px ",";&:last-child{border-bottom:solid 1px ",";}"],e=>e.theme.colors.bg,e=>e.theme.colors.bg2,e=>e.theme.colors.bg2),bX=B.div.withConfig({displayName:"CellContainer",componentId:"sc-aorbls-2"})(["overflow:auto;max-height:5rem;max-width:40rem;"]);function wX({resource:e,prop:t}){return f(z7,{children:f(bX,{children:f(Ki,{resource:e,propertyURL:t,noMargin:!0},t)})})}const N7=er(["padding:","rem;padding-left:","rem;vertical-align:top;&:last-child{width:100% !important;max-width:100% !important;}"],e=>e.theme.margin/2,e=>e.theme.margin),M7=B.th.withConfig({displayName:"CellHeaderStyled",componentId:"sc-aorbls-3"})(["text-align:left;"," font-weight:bold;white-space:nowrap;"],N7),z7=B.td.withConfig({displayName:"CellStyled",componentId:"sc-aorbls-4"})(["",""],N7),Og=[{id:"cards",icon:f(CD,{})},{id:"table",icon:f(xD,{})}];function SX({resource:e}){const[t]=be(e,G.description),r=qM()<700?0:1,[i,o]=yi("CollectionDisplayStyle",r),[a]=it(e,G.collection.members),[s]=be(e,G.collection.value),[u]=be(e,G.collection.property),[l]=iu(e,G.collection.currentPage),c=l||0,[h]=iu(e,G.collection.totalPages),p=h||1,[,y]=yf("current_page"),[g,b]=yf("sort_by"),_=Ce(s),[S]=it(_,G.requires),[k]=it(_,G.recommends),C=S.concat(k),[d]=be(_,G.description),[v]=be(_,G.shortname),[m,x]=w.useState(!1),A=s&&u===G.isA,D=We();u_(()=>{D.fetchResourceFromServer(e.getSubject())});function P(){o(L())}function L(){let $=i+1;return $>=Og.length&&($=0),$}function W(){if(c!==0){const $=c-1;y($.toString())}}function U(){if(c!==p-1){const $=c+1;y($.toString())}}function j($){b($)}const F=Og[i],R=Og[L()];je("right",U,{},[c]),je("left",W,{},[c]);const q=()=>O(Ht,{children:[f(ve,{subtle:!0,onClick:W,title:"previous page (left arrow)",disabled:c===0,children:f(cx,{})}),f(ve,{subtle:!0,onClick:U,title:"next page (right arrow)",disabled:c===p-1,"data-test":"next-page",children:f(dx,{})})]});return O(wf,{about:e.getSubject(),children:[f(Gi,{resource:e}),t&&f(Gt,{text:t}),O(CX,{children:[p>1&&f(q,{}),f(ve,{subtle:!0,onClick:P,title:`use ${R.id} view (v)`,children:R.icon}),A&&f(fu,{subtle:!0,icon:!0,klass:s,parent:e.getSubjectNoParams()}),A&&f(ve,{subtle:!0,onClick:()=>x(!m),title:m?`Hide ${v} info`:`Show ${v} info`,children:f(Uh,{})}),A&&f(PH,{children:f(l_,{placeholder:"sort by...",initial:g,options:C,onUpdate:j})})]}),m&&s&&O(ye,{children:[f(Ve,{subject:s,children:f("h3",{children:v})}),f(Gt,{text:d||""})]}),a.length===0?s?f(fu,{klass:s,parent:e.getSubject()}):f(ye,{children:"empty"}):O(ye,{children:[F.id==="cards"&&f(kX,{members:a,subject:e.getSubject()}),F.id==="table"&&f(hX,{resource:e,members:a,columns:C})]}),p>1&&f(q,{})]})}function kX({members:e,subject:t}){return e.length===0?f("p",{children:"This collection is empty"}):f(_X,{children:e.map((n,r)=>f(xX,{children:f(Ku,{initialInView:r<10,subject:n},n)},t+" "+n+r))})}const xX=B.div.withConfig({displayName:"GridItem",componentId:"sc-ikp501-0"})(["margin:0;word-break:break-word;overflow:hidden;break-inside:avoid-column;margin-bottom:","rem;"],e=>e.theme.margin),CX=B.div.withConfig({displayName:"ButtonsBar",componentId:"sc-ikp501-1"})(["display:flex;flex-wrap:wrap;gap:","rem;"],e=>e.theme.margin),_X=B.div.withConfig({displayName:"Masonry",componentId:"sc-ikp501-2"})(["column-count:1;column-gap:","rem;overflow:visible;box-sizing:border-box;@supports (grid-template-rows:masonry){display:grid;grid-template-columns:repeat(1,1fr);grid-template-rows:masonry;grid-column-gap:","rem;}@media only screen and (min-width:600px){grid-template-columns:repeat(2,1fr);column-count:2;}@media only screen and (min-width:1000px){grid-template-columns:repeat(3,1fr);column-count:3;}@media only screen and (min-width:1400px){grid-template-columns:repeat(4,1fr);column-count:4;}"],e=>e.theme.margin,e=>e.theme.margin);function EX({resource:e}){const[t]=qe(e),[n]=be(e,G.description),[r]=it(e,G.endpoint.parameters),[i]=it(e,G.endpoint.results),o=Ce(void 0,{newResource:!0}),a=We(),s=Et();async function u(l){l&&l.preventDefault();const c=new URL(e.getSubject());await Promise.all(r.map(async h=>{const p=o.get(h);if(p!==void 0){const y=await a.getProperty(h);c.searchParams.set(y.shortname,p.toString())}})),s(zt(c.href))}return O(_t,{about:e.getSubject(),children:[O("h1",{children:[t," endpoint"]}),n&&f(Gt,{text:n}),f("form",{onSubmit:u,children:r.map(l=>f(Pr,{propertyURL:l,resource:o},l))}),f(ve,{onClick:u,children:"Go"}),i&&i.length===0?f("p",{children:"No hits"}):i.map(l=>f(Ku,{subject:l},l))]})}function RX({resource:e}){const[t]=it(e,G.subResources),{drive:n,setDrive:r}=ot();return n||r(e.getSubject()),O(_t,{about:e.getSubject(),children:[O(Ht,{children:[f(Gi,{resource:e}),n!==e.getSubject()&&f(ve,{onClick:()=>r(e.getSubject()),children:"Set as current drive"})]}),f(Ki,{resource:e,propertyURL:G.description,datatype:Ie.MARKDOWN}),O(Ci,{children:[f("h3",{children:"resources:"}),O(Ss,{children:[t.map(i=>f(Do,{children:f(Yt,{subject:i})},i)),f(Do,{children:O(Ve,{path:Fe.new,children:[f(ui,{})," Create new resource"]})})]})]}),n.startsWith("http://localhost")&&f("p",{children:"You are running Atomic-Server on `localhost`, which means that it will not be available from any other machine than your current local device. If you want your Atomic-Server to be available from the web, you should set this up at a Domain on a server."})]})}function AX({resource:e}){const[t]=be(e,G.redirect.destination),[n]=be(e,G.redirect.redirectAgent),r=Et(),{agent:i,setAgent:o}=ot(),a=We(),s=Z5();return w.useEffect(()=>{n&&i&&!i.subject&&(i.subject=n,dt.success(O("div",{children:[f("p",{children:"New User created!"}),f(ve,{onClick:()=>r(Fe.agentSettings),children:"User Settings"})]}),{duration:6e3}),o(i)),t&&s!=="POP"&&(a.fetchResourceFromServer(t),r(zt(t)))}),O(_t,{about:e.getSubject(),children:[f(Ki,{resource:e,propertyURL:G.description}),f("h1",{children:"Redirect"}),f("p",{children:"This page should redirect you automatically (unless you have just pressed the back button)"}),f(Os,{resource:e,except:[G.isA]})]})}function TX({resource:e}){const[t]=iu(e,G.invite.usagesLeft),[n]=Dk(e,G.invite.write),r=Et();Z5();const{agent:i,setAgent:o}=ot(),a=Ce(i==null?void 0:i.subject),[s]=qe(a,15),u=i==null?void 0:i.subject;async function l(){const h=await HP(),p=new sf(h.privateKey);o(p);const y=await p.getPublicKey();c(y)}function c(h){const p=new URL(e.getSubject());h?p.searchParams.set("public-key",h):p.searchParams.set("agent",u),r(zt(p.href))}return O(_t,{about:e.getSubject(),children:[O("h1",{children:["Invite to ",n?"edit":"view"]}),f(Ki,{resource:e,propertyURL:G.description}),t===0?f("em",{children:"Sorry, this Invite has no usages left. Ask for a new one."}):O(Ht,{children:[u?f(ye,{children:O(ve,{"data-test":"accept-existing",onClick:()=>c(void 0),children:["Accept as ",s]})}):O(ye,{children:[f(ve,{"data-test":"accept-new",onClick:l,children:"Accept as new user"}),f(ve,{"data-test":"accept-sign-in",onClick:()=>r(Fe.agentSettings),subtle:!0,children:"Sign in"})]}),!isNaN(t)&&O("p",{children:["(",t," usages left)"]})]})]})}function PX(...e){return w.useMemo(()=>t=>{e.forEach(n=>n(t))},e)}const Pp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ns(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function L2(e){return"nodeType"in e}function nr(e){var t,n;return e?Ns(e)?e:L2(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function D2(e){const{Document:t}=nr(e);return e instanceof t}function Gu(e){return Ns(e)?!1:e instanceof nr(e).HTMLElement}function IX(e){return e instanceof nr(e).SVGElement}function Ms(e){return e?Ns(e)?e.document:L2(e)?D2(e)?e:Gu(e)?e.ownerDocument:document:document:document}const si=Pp?w.useLayoutEffect:w.useEffect;function N2(e){const t=w.useRef(e);return si(()=>{t.current=e}),w.useCallback(function(...n){return t.current==null?void 0:t.current(...n)},[])}function OX(){const e=w.useRef(null),t=w.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=w.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function bu(e,t=[e]){const n=w.useRef(e);return si(()=>{n.current!==e&&(n.current=e)},t),n}function Yu(e,t){const n=w.useRef();return w.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Qf(e){const t=N2(e),n=w.useRef(null),r=w.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function U1(e){const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current}let Lg={};function Xu(e,t){return w.useMemo(()=>{if(t)return t;const n=Lg[e]==null?0:Lg[e]+1;return Lg[e]=n,`${e}-${n}`},[e,t])}function j7(e){return(t,...n)=>n.reduce((r,i)=>{const o=Object.entries(i);for(const[a,s]of o){const u=r[a];u!=null&&(r[a]=u+e*s)}return r},{...t})}const cs=j7(1),wu=j7(-1);function LX(e){return"clientX"in e&&"clientY"in e}function M2(e){if(!e)return!1;const{KeyboardEvent:t}=nr(e.target);return t&&e instanceof t}function DX(e){if(!e)return!1;const{TouchEvent:t}=nr(e.target);return t&&e instanceof t}function V1(e){if(DX(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return LX(e)?{x:e.clientX,y:e.clientY}:null}const Su=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return`translate3d(${t?Math.round(t):0}px, ${n?Math.round(n):0}px, 0)`}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return`scaleX(${t}) scaleY(${n})`}},Transform:{toString(e){if(e)return[Su.Translate.toString(e),Su.Scale.toString(e)].join(" ")}},Transition:{toString({property:e,duration:t,easing:n}){return`${e} ${t}ms ${n}`}}}),o6="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function NX(e){return e.matches(o6)?e:e.querySelector(o6)}const MX={display:"none"};function zX({id:e,value:t}){return f("div",{id:e,style:MX,children:t})}const jX={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function BX({id:e,announcement:t}){return f("div",{id:e,style:jX,role:"status","aria-live":"assertive","aria-atomic":!0,children:t})}function FX(){const[e,t]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const B7=w.createContext(null);function $X(e){const t=w.useContext(B7);w.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function HX(){const[e]=w.useState(()=>new Set),t=w.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[w.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const UX={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. - `},DX={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function MX(e){let{announcements:t=DX,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=LX}=e;const{announce:o,announcement:a}=PX(),s=Ku("DndLiveRegion"),[u,l]=w.useState(!1);if(w.useEffect(()=>{l(!0)},[]),IX(w.useMemo(()=>({onDragStart(h){let{active:p}=h;o(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:y}=h;t.onDragMove&&o(t.onDragMove({active:p,over:y}))},onDragOver(h){let{active:p,over:y}=h;o(t.onDragOver({active:p,over:y}))},onDragEnd(h){let{active:p,over:y}=h;o(t.onDragEnd({active:p,over:y}))},onDragCancel(h){let{active:p,over:y}=h;o(t.onDragCancel({active:p,over:y}))}}),[o,t])),!u)return null;const c=M(be,{children:[f(RX,{id:r,value:i.draggable}),f(TX,{id:s,announcement:a})]});return n?Lr.createPortal(c,n):c}var Zt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Zt||(Zt={}));function Xf(){}function Q8(e,t){return w.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function NX(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter(r=>r!=null),[...t])}const li=Object.freeze({x:0,y:0});function N7(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function z7(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function zX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function J8(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function j7(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function Z8(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const jX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Z8(t,t.left,t.top),o=[];for(const a of r){const{id:s}=a,u=n.get(s);if(u){const l=N7(Z8(u),i);o.push({id:s,data:{droppableContainer:a,value:l}})}}return o.sort(z7)},BX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=J8(t),o=[];for(const a of r){const{id:s}=a,u=n.get(s);if(u){const l=J8(u),c=i.reduce((p,y,g)=>p+N7(l[g],y),0),h=Number((c/4).toFixed(4));o.push({id:s,data:{droppableContainer:a,value:h}})}}return o.sort(z7)};function FX(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const u=FX(s,t);u>0&&i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(zX)};function UX(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function B7(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:li}function HX(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o({...a,top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),{...n})}}const WX=HX(1);function VX(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function qX(e,t,n){const r=VX(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,u=e.left-a-(1-i)*parseFloat(n),l=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,h=o?e.height/o:e.height;return{width:c,height:h,top:l,right:u+c,bottom:l+h,left:u}}const KX={ignoreTransform:!1};function Ms(e,t){t===void 0&&(t=KX);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:l}=er(e),{transform:c,transformOrigin:h}=l(e);c&&(n=qX(n,c,h))}const{top:r,left:i,width:o,height:a,bottom:s,right:u}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:u}}function e6(e){return Ms(e,{ignoreTransform:!0})}function GX(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function YX(e,t){return t===void 0&&(t=er(e).getComputedStyle(e)),t.position==="fixed"}function XX(e,t){t===void 0&&(t=er(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function Pp(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(E2(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Vu(i)||SX(i)||n.includes(i))return n;const{getComputedStyle:o}=er(i),a=o(i);return i!==e&&XX(i,a)&&n.push(i),YX(i,a)?n:r(i.parentNode)}return e?r(e):n}function F7(e){const[t]=Pp(e,1);return t??null}function Lg(e){return!Tp||!e?null:Ls(e)?e:_2(e)?E2(e)||e===Ds(e).scrollingElement?window:Vu(e)?e:null:null}function $7(e){return Ls(e)?e.scrollX:e.scrollLeft}function U7(e){return Ls(e)?e.scrollY:e.scrollTop}function W1(e){return{x:$7(e),y:U7(e)}}var an;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(an||(an={}));function H7(e){return!Tp||!e?!1:e===document.scrollingElement}function W7(e){const t={x:0,y:0},n=H7(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const QX={x:.2,y:.2};function JX(e,t,n,r,i){let{top:o,left:a,right:s,bottom:u}=n;r===void 0&&(r=10),i===void 0&&(i=QX);const{isTop:l,isBottom:c,isLeft:h,isRight:p}=W7(e),y={x:0,y:0},g={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!l&&o<=t.top+b.height?(y.y=an.Backward,g.y=r*Math.abs((t.top+b.height-o)/b.height)):!c&&u>=t.bottom-b.height&&(y.y=an.Forward,g.y=r*Math.abs((t.bottom-b.height-u)/b.height)),!p&&s>=t.right-b.width?(y.x=an.Forward,g.x=r*Math.abs((t.right-b.width-s)/b.width)):!h&&a<=t.left+b.width&&(y.x=an.Backward,g.x=r*Math.abs((t.left+b.width-a)/b.width)),{direction:y,speed:g}}function ZX(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function V7(e){return e.reduce((t,n)=>ss(t,W1(n)),li)}function eQ(e){return e.reduce((t,n)=>t+$7(n),0)}function tQ(e){return e.reduce((t,n)=>t+U7(n),0)}function nQ(e,t){if(t===void 0&&(t=Ms),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);F7(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const rQ=[["x",["left","right"],eQ],["y",["top","bottom"],tQ]];class T2{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Pp(n),i=V7(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,s]of rQ)for(const u of a)Object.defineProperty(this,u,{get:()=>{const l=s(r),c=i[o]-l;return this.rect[u]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ol{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function iQ(e){const{EventTarget:t}=er(e);return e instanceof t?e:Ds(e)}function Dg(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ar;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ar||(Ar={}));function t6(e){e.preventDefault()}function oQ(e){e.stopPropagation()}var Je;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Je||(Je={}));const q7={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter]},aQ=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Je.Right:return{...n,x:n.x+25};case Je.Left:return{...n,x:n.x-25};case Je.Down:return{...n,y:n.y+25};case Je.Up:return{...n,y:n.y-25}}};class P2{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ol(Ds(n)),this.windowListeners=new Ol(er(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ar.Resize,this.handleCancel),this.windowListeners.add(Ar.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ar.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&nQ(r),n(li)}handleKeyDown(t){if(A2(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=q7,coordinateGetter:a=aQ,scrollBehavior:s="smooth"}=i,{code:u}=t;if(o.end.includes(u)){this.handleEnd(t);return}if(o.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:l}=r.current,c=l?{x:l.left,y:l.top}:li;this.referenceCoordinates||(this.referenceCoordinates=c);const h=a(t,{active:n,context:r.current,currentCoordinates:c});if(h){const p=bu(h,c),y={x:0,y:0},{scrollableAncestors:g}=r.current;for(const b of g){const _=t.code,{isTop:S,isRight:k,isLeft:C,isBottom:d,maxScroll:v,minScroll:m}=W7(b),x=ZX(b),A={x:Math.min(_===Je.Right?x.right-x.width/2:x.right,Math.max(_===Je.Right?x.left:x.left+x.width/2,h.x)),y:Math.min(_===Je.Down?x.bottom-x.height/2:x.bottom,Math.max(_===Je.Down?x.top:x.top+x.height/2,h.y))},L=_===Je.Right&&!k||_===Je.Left&&!C,P=_===Je.Down&&!d||_===Je.Up&&!S;if(L&&A.x!==h.x){const O=b.scrollLeft+p.x,V=_===Je.Right&&O<=v.x||_===Je.Left&&O>=m.x;if(V&&!p.y){b.scrollTo({left:O,behavior:s});return}V?y.x=b.scrollLeft-O:y.x=_===Je.Right?b.scrollLeft-v.x:b.scrollLeft-m.x,y.x&&b.scrollBy({left:-y.x,behavior:s});break}else if(P&&A.y!==h.y){const O=b.scrollTop+p.y,V=_===Je.Down&&O<=v.y||_===Je.Up&&O>=m.y;if(V&&!p.x){b.scrollTo({top:O,behavior:s});return}V?y.y=b.scrollTop-O:y.y=_===Je.Down?b.scrollTop-v.y:b.scrollTop-m.y,y.y&&b.scrollBy({top:-y.y,behavior:s});break}}this.handleMove(t,ss(bu(h,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}P2.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=q7,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function n6(e){return Boolean(e&&"distance"in e)}function r6(e){return Boolean(e&&"delay"in e)}class I2{constructor(t,n,r){var i;r===void 0&&(r=iQ(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Ds(a),this.documentListeners=new Ol(this.document),this.listeners=new Ol(r),this.windowListeners=new Ol(er(a)),this.initialCoordinates=(i=H1(o))!=null?i:li,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Ar.Resize,this.handleCancel),this.windowListeners.add(Ar.DragStart,t6),this.windowListeners.add(Ar.VisibilityChange,this.handleCancel),this.windowListeners.add(Ar.ContextMenu,t6),this.documentListeners.add(Ar.Keydown,this.handleKeydown),n){if(n6(n))return;if(r6(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ar.Click,oQ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ar.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const u=(n=H1(t))!=null?n:li,l=bu(i,u);if(!r&&s){if(r6(s))return Dg(l,s.tolerance)?this.handleCancel():void 0;if(n6(s))return s.tolerance!=null&&Dg(l,s.tolerance)?this.handleCancel():Dg(l,s.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),a(u)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const sQ={move:{name:"pointermove"},end:{name:"pointerup"}};class O2 extends I2{constructor(t){const{event:n}=t,r=Ds(n.target);super(t,sQ,r)}}O2.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const lQ={move:{name:"mousemove"},end:{name:"mouseup"}};var V1;(function(e){e[e.RightClick=2]="RightClick"})(V1||(V1={}));class uQ extends I2{constructor(t){super(t,lQ,Ds(t.event.target))}}uQ.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===V1.RightClick?!1:(r==null||r({event:n}),!0)}}];const Mg={move:{name:"touchmove"},end:{name:"touchend"}};class cQ extends I2{constructor(t){super(t,Mg)}static setup(){return window.addEventListener(Mg.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Mg.move.name,t)};function t(){}}}cQ.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Ll;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ll||(Ll={}));var Qf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Qf||(Qf={}));function dQ(e){let{acceleration:t,activator:n=Ll.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=Qf.TreeOrder,pointerCoordinates:u,scrollableAncestors:l,scrollableAncestorRects:c,delta:h,threshold:p}=e;const y=hQ({delta:h,disabled:!o}),[g,b]=kX(),_=w.useRef({x:0,y:0}),S=w.useRef({x:0,y:0}),k=w.useMemo(()=>{switch(n){case Ll.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Ll.DraggableRect:return i}},[n,i,u]),C=w.useRef(null),d=w.useCallback(()=>{const m=C.current;if(!m)return;const x=_.current.x*S.current.x,A=_.current.y*S.current.y;m.scrollBy(x,A)},[]),v=w.useMemo(()=>s===Qf.TreeOrder?[...l].reverse():l,[s,l]);w.useEffect(()=>{if(!o||!l.length||!k){b();return}for(const m of v){if((r==null?void 0:r(m))===!1)continue;const x=l.indexOf(m),A=c[x];if(!A)continue;const{direction:L,speed:P}=JX(m,A,k,t,p);for(const O of["x","y"])y[O][L[O]]||(P[O]=0,L[O]=0);if(P.x>0||P.y>0){b(),C.current=m,g(d,a),_.current=P,S.current=L;return}}_.current={x:0,y:0},S.current={x:0,y:0},b()},[t,d,r,b,o,a,JSON.stringify(k),JSON.stringify(y),g,l,v,c,JSON.stringify(p)])}const fQ={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};function hQ(e){let{delta:t,disabled:n}=e;const r=U1(t);return qu(i=>{if(n||!r||!i)return fQ;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[an.Backward]:i.x[an.Backward]||o.x===-1,[an.Forward]:i.x[an.Forward]||o.x===1},y:{[an.Backward]:i.y[an.Backward]||o.y===-1,[an.Forward]:i.y[an.Forward]||o.y===1}}},[n,t,r])}function pQ(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return qu(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function mQ(e,t){return w.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Su;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Su||(Su={}));var q1;(function(e){e.Optimized="optimized"})(q1||(q1={}));const i6=new Map;function gQ(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=w.useState(null),s=o!=null,{frequency:u,measure:l,strategy:c}=i,h=w.useRef(e),p=S(),y=yu(p),g=w.useCallback(function(k){k===void 0&&(k=[]),!y.current&&a(C=>C?C.concat(k):k)},[y]),b=w.useRef(null),_=qu(k=>{if(p&&!n)return i6;const C=o;if(!k||k===i6||h.current!==e||C!=null){const d=new Map;for(let v of e){if(!v)continue;if(C&&C.length>0&&!C.includes(v.id)&&v.rect.current){d.set(v.id,v.rect.current);continue}const m=v.node.current,x=m?new T2(l(m),m):null;v.rect.current=x,x&&d.set(v.id,x)}return d}return k},[e,o,n,p,l]);return w.useEffect(()=>{h.current=e},[e]),w.useEffect(()=>{p||requestAnimationFrame(()=>g())},[n,p]),w.useEffect(()=>{s&&a(null)},[s]),w.useEffect(()=>{p||typeof u!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},u))},[u,p,g,...r]),{droppableRects:_,measureDroppableContainers:g,measuringScheduled:s};function S(){switch(c){case Su.Always:return!1;case Su.BeforeDragging:return n;default:return!n}}}function K7(e,t){return qu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function vQ(e,t){return K7(e,t)}function yQ(e){let{callback:t,disabled:n}=e;const r=R2(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ip(e){let{callback:t,disabled:n}=e;const r=R2(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function bQ(e){return new T2(Ms(e),e)}function o6(e,t,n){t===void 0&&(t=bQ);const[r,i]=w.useReducer(s,null),o=yQ({callback(u){if(e)for(const l of u){const{type:c,target:h}=l;if(c==="childList"&&h instanceof HTMLElement&&h.contains(e)){i();break}}}}),a=Ip({callback:i});return si(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r;function s(u){if(!e)return null;if(e.isConnected===!1){var l;return(l=u??n)!=null?l:null}const c=t(e);return JSON.stringify(u)===JSON.stringify(c)?u:c}}function wQ(e){const t=K7(e);return B7(e,t)}const a6=[];function SQ(e){const t=w.useRef(e),n=qu(r=>e?r&&r!==a6&&e&&t.current&&e.parentNode===t.current.parentNode?r:Pp(e):a6,[e]);return w.useEffect(()=>{t.current=e},[e]),n}function kQ(e){const[t,n]=w.useState(null),r=w.useRef(e),i=w.useCallback(o=>{const a=Lg(o.target);a&&n(s=>s?(s.set(a,W1(a)),new Map(s)):null)},[]);return w.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(u=>{const l=Lg(u);return l?(l.addEventListener("scroll",i,{passive:!0}),[l,W1(l)]):null}).filter(u=>u!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(u=>{const l=Lg(u);l==null||l.removeEventListener("scroll",i)})}},[i,e]),w.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>ss(o,a),li):V7(e):li,[e,t])}function s6(e,t){t===void 0&&(t=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},t),w.useEffect(()=>{const r=e!==li;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bu(e,n.current):li}function xQ(e){w.useEffect(()=>{if(!Tp)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function CQ(e,t){return w.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function G7(e){return w.useMemo(()=>e?GX(e):null,[e])}const Ng=[];function _Q(e,t){t===void 0&&(t=Ms);const[n]=e,r=G7(n?er(n):null),[i,o]=w.useReducer(s,Ng),a=Ip({callback:o});return e.length>0&&i===Ng&&o(),si(()=>{e.length?e.forEach(u=>a==null?void 0:a.observe(u)):(a==null||a.disconnect(),o())},[e]),i;function s(){return e.length?e.map(u=>H7(u)?r:new T2(t(u),u)):Ng}}function EQ(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Vu(t)?t:e}function RQ(e){let{measure:t}=e;const[n,r]=w.useState(null),i=w.useCallback(l=>{for(const{target:c}of l)if(Vu(c)){r(h=>{const p=t(c);return h?{...h,width:p.width,height:p.height}:p});break}},[t]),o=Ip({callback:i}),a=w.useCallback(l=>{const c=EQ(l);o==null||o.disconnect(),c&&(o==null||o.observe(c)),r(c?t(c):null)},[t,o]),[s,u]=Yf(a);return w.useMemo(()=>({nodeRef:s,rect:n,setRef:u}),[n,s,u])}const AQ=[{sensor:O2,options:{}},{sensor:P2,options:{}}],TQ={current:{}},Ad={draggable:{measure:e6},droppable:{measure:e6,strategy:Su.WhileDragging,frequency:q1.Optimized},dragOverlay:{measure:Ms}};class Dl extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const PQ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Xf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ad,measureDroppableContainers:Xf,windowRect:null,measuringScheduled:!1},IQ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Xf,draggableNodes:new Map,over:null,measureDroppableContainers:Xf},Op=w.createContext(IQ),Y7=w.createContext(PQ);function OQ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dl}}}function LQ(e,t){switch(t.type){case Zt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Zt.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Zt.DragEnd:case Zt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Zt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Dl(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Zt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Dl(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case Zt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Dl(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function DQ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=w.useContext(Op),o=U1(r),a=U1(n==null?void 0:n.id);return w.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!A2(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:u,node:l}=s;if(!u.current&&!l.current)return;requestAnimationFrame(()=>{for(const c of[u.current,l.current]){if(!c)continue;const h=_X(c);if(h){h.focus();break}}})}},[r,t,i,a,o]),null}function MQ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function NQ(e){return w.useMemo(()=>({draggable:{...Ad.draggable,...e==null?void 0:e.draggable},droppable:{...Ad.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ad.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function zQ(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=w.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;si(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const l=t==null?void 0:t.node.current;if(!l||l.isConnected===!1)return;const c=n(l),h=B7(c,r);if(a||(h.x=0),s||(h.y=0),o.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const p=F7(l);p&&p.scrollBy({top:h.y,left:h.x})}},[t,a,s,r,n])}const X7=w.createContext({...li,scaleX:1,scaleY:1});var uo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(uo||(uo={}));const jQ=w.memo(function(t){var n,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:l,sensors:c=AQ,collisionDetection:h=$X,measuring:p,modifiers:y,...g}=t;const b=w.useReducer(LQ,void 0,OQ),[_,S]=b,[k,C]=OX(),[d,v]=w.useState(uo.Uninitialized),m=d===uo.Initialized,{draggable:{active:x,nodes:A,translate:L},droppable:{containers:P}}=_,O=x?A.get(x):null,V=w.useRef({initial:null,translated:null}),H=w.useMemo(()=>{var Wt;return x!=null?{id:x,data:(Wt=O==null?void 0:O.data)!=null?Wt:TQ,rect:V}:null},[x,O]),j=w.useRef(null),[F,R]=w.useState(null),[q,$]=w.useState(null),K=yu(g,Object.values(g)),ee=Ku("DndDescribedBy",a),D=w.useMemo(()=>P.getEnabled(),[P]),I=NQ(p),{droppableRects:re,measureDroppableContainers:se,measuringScheduled:he}=gQ(D,{dragging:m,dependencies:[L.x,L.y],config:I.droppable}),W=pQ(A,x),ge=w.useMemo(()=>q?H1(q):null,[q]),te=rr(),Oe=vQ(W,I.draggable.measure);zQ({activeNode:x?A.get(x):null,config:te.layoutShiftCompensation,initialRect:Oe,measure:I.draggable.measure});const pe=o6(W,I.draggable.measure,Oe),Ne=o6(W?W.parentElement:null),xe=w.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ge=P.getNodeFor((n=xe.current.over)==null?void 0:n.id),Ve=RQ({measure:I.dragOverlay.measure}),De=(r=Ve.nodeRef.current)!=null?r:W,Ye=m?(i=Ve.rect)!=null?i:pe:null,ae=Boolean(Ve.nodeRef.current&&Ve.rect),Re=wQ(ae?null:pe),nt=G7(De?er(De):null),ze=SQ(m?Ge??W:null),gt=_Q(ze),zt=MQ(y,{transform:{x:L.x-Re.x,y:L.y-Re.y,scaleX:1,scaleY:1},activatorEvent:q,active:H,activeNodeRect:pe,containerNodeRect:Ne,draggingNodeRect:Ye,over:xe.current.over,overlayNodeRect:Ve.rect,scrollableAncestors:ze,scrollableAncestorRects:gt,windowRect:nt}),wt=ge?ss(ge,L):null,Ee=kQ(ze),rt=s6(Ee),tr=s6(Ee,[pe]),Ht=ss(zt,rt),X=Ye?WX(Ye,zt):null,ce=H&&X?h({active:H,collisionRect:X,droppableRects:re,droppableContainers:D,pointerCoordinates:wt}):null,Te=j7(ce,"id"),[Be,Xt]=w.useState(null),Ei=ae?zt:ss(zt,tr),at=UX(Ei,(o=Be==null?void 0:Be.rect)!=null?o:null,pe),vt=w.useCallback((Wt,Rn)=>{let{sensor:An,options:kr}=Rn;if(j.current==null)return;const jt=A.get(j.current);if(!jt)return;const ir=Wt.nativeEvent,xr=new An({active:j.current,activeNode:jt,event:ir,options:kr,context:xe,onStart(Tn){const Cr=j.current;if(Cr==null)return;const Xi=A.get(Cr);if(!Xi)return;const{onDragStart:Qi}=K.current,Fo={active:{id:Cr,data:Xi.data,rect:V}};Lr.unstable_batchedUpdates(()=>{Qi==null||Qi(Fo),v(uo.Initializing),S({type:Zt.DragStart,initialCoordinates:Tn,active:Cr}),k({type:"onDragStart",event:Fo})})},onMove(Tn){S({type:Zt.DragMove,coordinates:Tn})},onEnd:Yi(Zt.DragEnd),onCancel:Yi(Zt.DragCancel)});Lr.unstable_batchedUpdates(()=>{R(xr),$(Wt.nativeEvent)});function Yi(Tn){return async function(){const{active:Xi,collisions:Qi,over:Fo,scrollAdjustedTranslate:Yu}=xe.current;let $o=null;if(Xi&&Yu){const{cancelDrop:Ji}=K.current;$o={activatorEvent:ir,active:Xi,collisions:Qi,delta:Yu,over:Fo},Tn===Zt.DragEnd&&typeof Ji=="function"&&await Promise.resolve(Ji($o))&&(Tn=Zt.DragCancel)}j.current=null,Lr.unstable_batchedUpdates(()=>{S({type:Tn}),v(uo.Uninitialized),Xt(null),R(null),$(null);const Ji=Tn===Zt.DragEnd?"onDragEnd":"onDragCancel";if($o){const Ns=K.current[Ji];Ns==null||Ns($o),k({type:Ji,event:$o})}})}}},[A]),Sr=w.useCallback((Wt,Rn)=>(An,kr)=>{const jt=An.nativeEvent,ir=A.get(kr);if(j.current!==null||!ir||jt.dndKit||jt.defaultPrevented)return;const xr={active:ir};Wt(An,Rn.options,xr)===!0&&(jt.dndKit={capturedBy:Rn.sensor},j.current=kr,vt(An,Rn))},[A,vt]),nr=mQ(c,Sr);xQ(c),si(()=>{pe&&d===uo.Initializing&&v(uo.Initialized)},[pe,d]),w.useEffect(()=>{const{onDragMove:Wt}=K.current,{active:Rn,activatorEvent:An,collisions:kr,over:jt}=xe.current;if(!Rn||!An)return;const ir={active:Rn,activatorEvent:An,collisions:kr,delta:{x:Ht.x,y:Ht.y},over:jt};Lr.unstable_batchedUpdates(()=>{Wt==null||Wt(ir),k({type:"onDragMove",event:ir})})},[Ht.x,Ht.y]),w.useEffect(()=>{const{active:Wt,activatorEvent:Rn,collisions:An,droppableContainers:kr,scrollAdjustedTranslate:jt}=xe.current;if(!Wt||j.current==null||!Rn||!jt)return;const{onDragOver:ir}=K.current,xr=kr.get(Te),Yi=xr&&xr.rect.current?{id:xr.id,rect:xr.rect.current,data:xr.data,disabled:xr.disabled}:null,Tn={active:Wt,activatorEvent:Rn,collisions:An,delta:{x:jt.x,y:jt.y},over:Yi};Lr.unstable_batchedUpdates(()=>{Xt(Yi),ir==null||ir(Tn),k({type:"onDragOver",event:Tn})})},[Te]),si(()=>{xe.current={activatorEvent:q,active:H,activeNode:W,collisionRect:X,collisions:ce,droppableRects:re,draggableNodes:A,draggingNode:De,draggingNodeRect:Ye,droppableContainers:P,over:Be,scrollableAncestors:ze,scrollAdjustedTranslate:Ht},V.current={initial:Ye,translated:X}},[H,W,ce,X,A,De,Ye,re,P,Be,ze,Ht]),dQ({...te,delta:L,draggingRect:X,pointerCoordinates:wt,scrollableAncestors:ze,scrollableAncestorRects:gt});const yt=w.useMemo(()=>({active:H,activeNode:W,activeNodeRect:pe,activatorEvent:q,collisions:ce,containerNodeRect:Ne,dragOverlay:Ve,draggableNodes:A,droppableContainers:P,droppableRects:re,over:Be,measureDroppableContainers:se,scrollableAncestors:ze,scrollableAncestorRects:gt,measuringConfiguration:I,measuringScheduled:he,windowRect:nt}),[H,W,pe,q,ce,Ne,Ve,A,P,re,Be,se,ze,gt,I,he,nt]),Gi=w.useMemo(()=>({activatorEvent:q,activators:nr,active:H,activeNodeRect:pe,ariaDescribedById:{draggable:ee},dispatch:S,draggableNodes:A,over:Be,measureDroppableContainers:se}),[q,nr,H,pe,S,ee,A,Be,se]);return M(M7.Provider,{value:C,children:[M(Op.Provider,{value:Gi,children:[f(Y7.Provider,{value:yt,children:f(X7.Provider,{value:at,children:l})}),f(DQ,{disabled:(s==null?void 0:s.restoreFocus)===!1})]}),f(MX,{...s,hiddenTextDescribedById:ee})]});function rr(){const Wt=(F==null?void 0:F.autoScrollEnabled)===!1,Rn=typeof u=="object"?u.enabled===!1:u===!1,An=m&&!Wt&&!Rn;return typeof u=="object"?{...u,enabled:An}:{enabled:An}}}),BQ=w.createContext(null),l6="button",FQ="Droppable";function $Q(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Ku(FQ),{activators:a,activatorEvent:s,active:u,activeNodeRect:l,ariaDescribedById:c,draggableNodes:h,over:p}=w.useContext(Op),{role:y=l6,roleDescription:g="draggable",tabIndex:b=0}=i??{},_=(u==null?void 0:u.id)===t,S=w.useContext(_?X7:BQ),[k,C]=Yf(),[d,v]=Yf(),m=CQ(a,t),x=yu(n);si(()=>(h.set(t,{id:t,key:o,node:k,activatorNode:d,data:x}),()=>{const L=h.get(t);L&&L.key===o&&h.delete(t)}),[h,t]);const A=w.useMemo(()=>({role:y,tabIndex:b,"aria-disabled":r,"aria-pressed":_&&y===l6?!0:void 0,"aria-roledescription":g,"aria-describedby":c.draggable}),[r,y,b,_,g,c.draggable]);return{active:u,activatorEvent:s,activeNodeRect:l,attributes:A,isDragging:_,listeners:r?void 0:m,node:k,over:p,setNodeRef:C,setActivatorNodeRef:v,transform:S}}function UQ(){return w.useContext(Y7)}const HQ="Droppable",WQ={timeout:25};function VQ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Ku(HQ),{active:a,dispatch:s,over:u,measureDroppableContainers:l}=w.useContext(Op),c=w.useRef({disabled:n}),h=w.useRef(!1),p=w.useRef(null),y=w.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:_}={...WQ,...i},S=yu(b??r),k=w.useCallback(()=>{if(!h.current){h.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{l(Array.isArray(S.current)?S.current:[S.current]),y.current=null},_)},[_]),C=Ip({callback:k,disabled:g||!a}),d=w.useCallback((A,L)=>{C&&(L&&(C.unobserve(L),h.current=!1),A&&C.observe(A))},[C]),[v,m]=Yf(d),x=yu(t);return w.useEffect(()=>{!C||!v.current||(C.disconnect(),h.current=!1,C.observe(v.current))},[v,C]),si(()=>(s({type:Zt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:v,rect:p,data:x}}),()=>s({type:Zt.UnregisterDroppable,key:o,id:r})),[r]),w.useEffect(()=>{n!==c.current.disabled&&(s({type:Zt.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:p,isOver:(u==null?void 0:u.id)===r,node:v,over:u,setNodeRef:m}}function Q7(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function qQ(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Yc(e){return e!==null&&e>=0}function KQ(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=Q7(t,r,n),a=t[i],s=o[i];return!s||!a?null:{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}},Xc={scaleX:1,scaleY:1},YQ=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:a}=e;const s=(t=o[n])!=null?t:r;if(!s)return null;if(i===n){const l=o[a];return l?{x:0,y:nn&&i<=a?{x:0,y:-s.height-u,...Xc}:i=a?{x:0,y:s.height+u,...Xc}:{x:0,y:0,...Xc}};function XQ(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?nr.map(x=>typeof x=="object"&&"id"in x?x.id:x),[r]),b=a!=null,_=a?g.indexOf(a.id):-1,S=l?g.indexOf(l.id):-1,k=w.useRef(g),C=!KQ(g,k.current),d=S!==-1&&_===-1||C,v=GQ(o);si(()=>{C&&b&&!h&&c(g)},[C,g,b,c,h]),w.useEffect(()=>{k.current=g},[g]);const m=w.useMemo(()=>({activeIndex:_,containerId:p,disabled:v,disableTransforms:d,items:g,overIndex:S,useDragOverlay:y,sortedRects:qQ(g,u),strategy:i}),[_,p,v.draggable,v.droppable,d,g,S,u,y,i]);return f(e9.Provider,{value:m,children:t})}const JQ=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Q7(n,r,i).indexOf(t)},ZQ=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:u,transition:l}=e;return!l||!r||s!==o&&i===a?!1:n?!0:a!==i&&t===u},eJ={duration:200,easing:"ease"},t9="transform",tJ=wu.Transition.toString({property:t9,duration:0,easing:"linear"}),nJ={roleDescription:"sortable"};function rJ(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=w.useState(null),s=w.useRef(n);return si(()=>{if(!t&&n!==s.current&&r.current){const u=i.current;if(u){const l=Ms(r.current,{ignoreTransform:!0}),c={x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height};(c.x||c.y)&&a(c)}}n!==s.current&&(s.current=n)},[t,n,r,i]),w.useEffect(()=>{o&&requestAnimationFrame(()=>{a(null)})},[o]),o}function iJ(e){let{animateLayoutChanges:t=ZQ,attributes:n,disabled:r,data:i,getNewIndex:o=JQ,id:a,strategy:s,resizeObserverConfig:u,transition:l=eJ}=e;const{items:c,containerId:h,activeIndex:p,disabled:y,disableTransforms:g,sortedRects:b,overIndex:_,useDragOverlay:S,strategy:k}=w.useContext(e9),C=oJ(r,y),d=c.indexOf(a),v=w.useMemo(()=>({sortable:{containerId:h,index:d,items:c},...i}),[h,i,d,c]),m=w.useMemo(()=>c.slice(c.indexOf(a)),[c,a]),{rect:x,node:A,isOver:L,setNodeRef:P}=VQ({id:a,data:v,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:m,...u}}),{active:O,activatorEvent:V,activeNodeRect:H,attributes:j,setNodeRef:F,listeners:R,isDragging:q,over:$,setActivatorNodeRef:K,transform:ee}=$Q({id:a,data:v,attributes:{...nJ,...n},disabled:C.draggable}),D=wX(P,F),I=Boolean(O),re=I&&!g&&Yc(p)&&Yc(_),se=!S&&q,he=se&&re?ee:null,ge=re?he??(s??k)({rects:b,activeNodeRect:H,activeIndex:p,overIndex:_,index:d}):null,te=Yc(p)&&Yc(_)?o({id:a,items:c,activeIndex:p,overIndex:_}):d,Oe=O==null?void 0:O.id,pe=w.useRef({activeId:Oe,items:c,newIndex:te,containerId:h}),Ne=c!==pe.current.items,xe=t({active:O,containerId:h,isDragging:q,isSorting:I,id:a,index:d,items:c,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:l,wasDragging:pe.current.activeId!=null}),Ge=rJ({disabled:!xe,index:d,node:A,rect:x});return w.useEffect(()=>{I&&pe.current.newIndex!==te&&(pe.current.newIndex=te),h!==pe.current.containerId&&(pe.current.containerId=h),c!==pe.current.items&&(pe.current.items=c)},[I,te,h,c]),w.useEffect(()=>{if(Oe===pe.current.activeId)return;if(Oe&&!pe.current.activeId){pe.current.activeId=Oe;return}const De=setTimeout(()=>{pe.current.activeId=Oe},50);return()=>clearTimeout(De)},[Oe]),{active:O,activeIndex:p,attributes:j,data:v,rect:x,index:d,newIndex:te,items:c,isOver:L,isSorting:I,isDragging:q,listeners:R,node:A,overIndex:_,over:$,setNodeRef:D,setActivatorNodeRef:K,setDroppableNodeRef:P,setDraggableNodeRef:F,transform:Ge??ge,transition:Ve()};function Ve(){if(Ge||Ne&&pe.current.newIndex===d)return tJ;if(!(se&&!A2(V)||!l)&&(I||xe))return wu.Transition.toString({...l,property:t9})}}function oJ(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Jf(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const aJ=[Je.Down,Je.Right,Je.Up,Je.Left],sJ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:s}}=t;if(aJ.includes(e.code)){if(e.preventDefault(),!n||!r)return;const u=[];o.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const p=i.get(h.id);if(p)switch(e.code){case Je.Down:r.topp.top&&u.push(h);break;case Je.Left:r.left>p.left&&u.push(h);break;case Je.Right:r.left1&&(c=l[1].id),c!=null){const h=o.get(n.id),p=o.get(c),y=p?i.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&y&&h&&p){const _=Pp(g).some((m,x)=>s[x]!==m),S=n9(h,p),k=lJ(h,p),C=_||!S?{x:0,y:0}:{x:k?r.width-y.width:0,y:k?r.height-y.height:0},d={x:y.left,y:y.top};return C.x&&C.y?d:bu(d,C)}}}};function n9(e,t){return!Jf(e)||!Jf(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function lJ(e,t){return!Jf(e)||!Jf(t)||!n9(e,t)?!1:e.data.current.sortable.index0&&!p.includes(Ue.elements.paragraph);function S(d){k(),l(void 0),h(d.target.value)}function k(){var d;(d=y.current)!=null&&d.style&&(y.current.style.height="0",y.current.style.height=y.current.scrollHeight+"px")}w.useEffect(()=>{k()},[y,c,o]),w.useEffect(()=>{var d,v;(d=y==null?void 0:y.current)==null||d.focus(),c&&((v=y==null?void 0:y.current)==null||v.setSelectionRange(c==null?void 0:c.length,c==null?void 0:c.length))},[o]),je("backspace",d=>{(o&&(c===""||c===void 0)||o&&_)&&(d.preventDefault(),t(n))},{enableOnTags:["TEXTAREA"],enabled:o},[n,c,o]),je(st.deleteLine,d=>{o&&(d.preventDefault(),t(n))},{enableOnTags:["TEXTAREA"],enabled:o},[n,o]);function C(){return u!=null&&u.message?f(Nt,{children:u.message}):o&&!g&&b?f(Nt,{children:b}):null}return _?M(Td,{canDrag:a,tabIndex:0,className:"element",active:o,onFocus:()=>r(n),onBlur:()=>r(-1),children:[f(Wu,{subject:e}),f(C,{})]}):o?M(Td,{canDrag:a,active:o,onClick:()=>n&&r(n),children:[f(hJ,{canDrag:a,"data-test":"element-input",className:"element",active:o,ref:y,onChange:S,onFocus:()=>r(n),onBlur:()=>r(-1),placeholder:`type something (try ${c6} or ${u6})`,autoFocus:o,value:c||""}),(c==null?void 0:c.startsWith(u6))&&f(pJ,{query:c.substring(1),setElement:d=>n&&i(n,d)}),(c==null?void 0:c.startsWith(c6))&&f(mJ,{query:c.substring(1),setElement:d=>n&&i(n,d)}),(c==null?void 0:c.startsWith(uJ))&&f(ls,{children:f("p",{children:"[link text](https://example.com)"})}),(c==null?void 0:c.startsWith(cJ))&&M(ls,{children:[f("p",{children:"# Big Header"}),f("p",{children:"## Header"}),f("p",{children:"### Smaller Header"})]}),f(C,{})]}):M(Td,{canDrag:a,tabIndex:0,active:o,onFocus:()=>r(n),onBlur:()=>r(-1),children:[f(Gt,{text:c||"",noMargin:!0}),f(C,{})]})}function fJ({subject:e}){const t=Ce(e),[n]=ye(t,G.description);return f(Td,{children:f(Gt,{text:n||"",noMargin:!0})})}const K1=Jn(["border-radius:5px;outline:none;"]),r9=Jn(["line-height:1.4rem;font-family:",";font-size:","rem;"],e=>e.theme.fontFamily,e=>e.theme.fontSizeBody),Td=B.div.withConfig({displayName:"ElementWrapper",componentId:"sc-pru0zy-0"})(["position:relative;display:block;width:100%;border:none;resize:none;padding:0.5rem;padding-left:0rem;cursor:text;white-space:pre-line;display:flex;flex-direction:column;min-height:2.7rem;"," "," &:focus{","}"],e=>e.active&&e.canDrag&&K1,r9,K1),hJ=B.textarea.withConfig({displayName:"ElementView",componentId:"sc-pru0zy-1"})([""," border:none;width:100%;resize:none;background-color:",";color:",";padding:0;margin-bottom:0.5rem;&:focus{outline:none;","}"],r9,e=>e.theme.colors.bg,e=>e.theme.colors.text,K1);function pJ({query:e,setElement:t}){const{results:n}=Rk(e),[r,i]=w.useState(0);return je("tab,enter",o=>{o.preventDefault(),n[r]&&t(n[r])},{enableOnTags:["TEXTAREA"]},[]),je("left",o=>{o.preventDefault();let a=r-1;a<0&&(a=n.length-1),i(r-1)},{enableOnTags:["TEXTAREA"]},[r]),je("right",o=>{o.preventDefault();let a=r+1;a>n.length-1&&(a=0),i(r+1)},{enableOnTags:["TEXTAREA"]},[r]),e===""?f(ls,{children:f("p",{children:"Search something..."})}):n.length===0?f(ls,{children:f("p",{children:"No results"})}):M(ls,{children:[f("p",{children:" (press tab to select, left / right to browse)"}),f("p",{children:f(Yt,{subject:n[r]})})]})}const ls=B.div.withConfig({displayName:"WidgetWrapper",componentId:"sc-pru0zy-2"})(["position:absolute;top:100%;right:0;left:-1rem;border-radius:",";border:solid 1px ",";padding:","rem;padding-bottom:0;background-color:",";backdrop-filter:blur(6px);opacity:0.9;z-index:1;"],e=>e.theme.radius,e=>e.theme.colors.bg2,e=>e.theme.margin,e=>e.theme.colors.bg1);function mJ({query:e}){return M(ls,{children:[e&&f(Gt,{text:e}),f("p",{children:"Try typing these:"}),M("p",{children:["links: ",f("code",{children:"[clickable link](https://example.com)"})]}),M("p",{children:["styling:",f("code",{children:"**bold** and _cursive_"})]}),M("p",{children:["headings:",f("code",{children:"## Header"})]})]})}function i9({parentResource:e,children:t,onFilesUploaded:n}){const{upload:r,isUploading:i,error:o}=Yy(e),a=de.useRef(null),s=w.useCallback(async c=>{const h=await r(c);n==null||n(h)},[r]),{getRootProps:u,isDragActive:l}=ap({onDrop:s});return w.useEffect(()=>{if(l&&a.current){const c=a.current.getBoundingClientRect();c.top<0&&(a.current.style.top=`calc(${Math.abs(c.top)}px + 1rem)`)}},[l]),M(gJ,{...u(),tabIndex:-1,children:[i&&f("p",{children:"Uploading..."}),o&&f(xt,{children:o.message}),t,l&&f(yJ,{ref:a,children:M(bJ,{children:[f(lx,{})," Drop files here to upload."]})})]})}const gJ=B.div.withConfig({displayName:"Root",componentId:"sc-1uc1ldy-0"})(["height:100%;position:relative;"]),vJ=Lu(["from{opacity:0;backdrop-filter:blur(0px);}to{opacity:1;backdrop-filter:blur(10px);}"]),yJ=B.div.withConfig({displayName:"VisualDropzone",componentId:"sc-1uc1ldy-1"})(["position:absolute;inset:0;height:90vh;background-color:",";backdrop-filter:blur(10px);border:3px dashed ",";border-radius:",";display:grid;place-items:center;font-size:1.8rem;color:",";animation:0.1s "," ease-in;"],e=>e.theme.darkMode?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.8)",e=>e.theme.colors.textLight,e=>e.theme.radius,e=>e.theme.colors.textLight,vJ),bJ=B.div.withConfig({displayName:"TextWrapper",componentId:"sc-1uc1ldy-2"})(["display:flex;align-items:center;gap:1rem;padding:","rem;"],e=>e.theme.margin);function wJ({resource:e}){const[t]=Wi(e),[n,r]=w.useState(t);return w.useEffect(()=>{r(t)},[t]),f(AJ,{children:f(CJ,{about:e.getSubject(),children:n?f(SJ,{resource:e,setEditMode:r}):f(kJ,{resource:e,setEditMode:r})})})}function SJ({resource:e,setEditMode:t}){const[n,r]=it(e,G.document.elements,{commit:!0,validate:!1,commitDebounce:0}),i=w.useRef(null),o=Ke(),a=w.useRef(null),[s,u]=w.useState(void 0),[l,c]=w.useState(0),h=NX(Q8(O2),Q8(P2,{coordinateGetter:sJ}));w.useEffect(()=>{c(n.length-1)},[]),w.useEffect(()=>{n.length===0&&p(0)},[JSON.stringify(n)]),je("enter",d=>{d.preventDefault(),p(l+1)},{enableOnTags:["TEXTAREA"]},[l]),je("enter",d=>{d.preventDefault(),p(0)},{enableOnTags:["INPUT"]},[l]),je("up",d=>{var v;d.preventDefault(),!l||l===0?(v=i.current)==null||v.focus():y(l-1)},{enableOnTags:["TEXTAREA"]},[l]),je("down",d=>{d.preventDefault(),document.activeElement===i.current?y(0):y(l+1)},{enableOnTags:["TEXTAREA","INPUT"]},[l]),je(st.moveLineUp,d=>{d.preventDefault(),_(l,l-1)},{enableOnTags:["TEXTAREA"]},[l]),je(st.moveLineDown,d=>{d.preventDefault(),_(l,l+1)},{enableOnTags:["TEXTAREA"]},[l]),je("esc",d=>{d.preventDefault(),c(-1)},{enableOnTags:["TEXTAREA"]});async function p(d){const v=o.createSubject("element",e.getSubject());n.splice(d,0,v);try{const m=new xi(v,!0);await Promise.all([m.set(G.isA,[Ue.elements.paragraph],o),m.set(G.parent,e.getSubject(),o),m.set(G.description,"",o)]),m.save(o),await r(n),y(d)}catch(m){u(m)}}function y(d){var m,x,A,L;d>n.length-1?d=n.length-1:d<0&&(d=0),c(d);let v=(x=(m=a==null?void 0:a.current)==null?void 0:m.children[d])==null?void 0:x.getElementsByClassName("element")[0];v||(v=(A=a==null?void 0:a.current)==null?void 0:A.children[d]),v?v.focus():(L=a.current)==null||L.focus()}async function g(d){if(n.length===1){r([]),y(0);return}n.splice(d,1),r(n),y(d-1)}async function b(d,v){n[d]=v,r(n),d===n.length-1?p(d+1):y(d+1)}function _(d,v){const m=n[d];n.splice(d,1),n.splice(v,0,m),r(n),y(v)}function S(d){const{active:v,over:m}=d;if(v.id!==(m==null?void 0:m.id)){const x=n.indexOf(v.id.toString());if(!(m!=null&&m.id))return;const A=n.indexOf(m.id.toString());_(x,A)}}function k(d){dt.success("Upload succeeded!"),d.map(v=>n.push(v)),r([...n])}async function C(){var m,x;const d=n[n.length-1];((x=(m=(await o.getResourceAsync(d)).get(G.description))==null?void 0:m.toString())==null?void 0:x.length)===0?y(n.length-1):p(n.length)}return M(be,{children:[M("div",{style:{display:"flex",flexDirection:"row"},children:[f(Ki,{parentRef:i,resource:e}),f(ve,{icon:!0,subtle:!0,onClick:()=>t(!1),title:"Read mode",children:f(a1,{})})]}),(s==null?void 0:s.message)&&f(Nt,{children:s.message}),f(i9,{onFilesUploaded:k,parentResource:e,children:M("div",{ref:a,children:[f(jQ,{sensors:h,collisionDetection:jX,onDragEnd:S,children:f(QQ,{items:[...n],strategy:YQ,children:n.map((d,v)=>f(xJ,{canDrag:!0,index:v,subject:d,deleteElement:g,setCurrent:c,current:l,setElementSubject:b,active:v===l},v+d))})}),f(_J,{onClick:C})]})})]})}function kJ({resource:e,setEditMode:t}){const[n]=it(e,G.document.elements),[r]=ye(e,G.name);return M(be,{children:[M("div",{style:{display:"flex",flexDirection:"row"},children:[f("h1",{style:{flex:1},children:r}),f(ve,{"data-test":"document-edit",icon:!0,subtle:!0,onClick:()=>t(!0),title:"Edit mode",children:f(_s,{})})]}),n.map(i=>f(fJ,{subject:i},i))]})}function xJ(e){const{subject:t,active:n}=e,{attributes:r,listeners:i,setNodeRef:o,transform:a,transition:s}=iJ({id:t}),u={transform:wu.Transform.toString(a),transition:s};return M(EJ,{ref:o,style:u,children:[f(RJ,{active:n,...r,...i}),f(dJ,{...e})]})}const CJ=B.div.withConfig({displayName:"DocumentContainer",componentId:"sc-13qv9sb-0"})(["width:min(100%,","rem);margin:auto;display:flex;flex:1;flex-direction:column;padding:2rem;@media (max-width:","rem){padding:","rem;}"],e=>e.theme.containerWidth,e=>e.theme.containerWidth,e=>e.theme.margin),_J=B.div.withConfig({displayName:"NewLine",componentId:"sc-13qv9sb-1"})(["height:20rem;flex:1;cursor:text;"]),EJ=B.div.withConfig({displayName:"SortableItemWrapper",componentId:"sc-13qv9sb-2"})(["display:flex;flex-direction:row;position:relative;"]),RJ=e=>f(TJ,{...e,title:"Grab to re-order",children:f(tD,{})}),AJ=B.div.withConfig({displayName:"FullPageWrapper",componentId:"sc-13qv9sb-3"})(["background-color:",";display:flex;flex:1;flex-direction:column;min-height:",";box-sizing:border-box;"],e=>e.theme.colors.bg,e=>e.theme.heights.fullPage),TJ=B.div.withConfig({displayName:"SortHandleStyled",componentId:"sc-13qv9sb-4"})(["width:1rem;flex:1;display:flex;align-items:center;opacity:",";position:absolute;left:-1rem;bottom:0;height:100%;cursor:grab;border:solid 1px transparent;border-radius:",";&:drop(active),&:focus,&:active{opacity:0.5;}&:hover{opacity:0.5;}"],e=>e.active?.3:0,e=>e.theme.radius);function o9({resource:e,children:t,error:n,clearError:r}){return f(ba,{resource:e==null?void 0:e.getSubject(),children:M(ai,{children:[t||f(s1,{error:n,showTrace:!0}),M(Ut,{children:[r&&f(ve,{onClick:r,children:"Clear error"}),f(ve,{onClick:()=>window.setTimeout(window.location.reload.bind(window.location),200),children:"Try Again"})]})]})})}function PJ({resource:e}){const{agent:t}=ot(),n=Ke(),r=e.getSubject();return uk(e.error)?f(ba,{children:M(ai,{children:[f("h1",{children:"Unauthorized"}),t?M(be,{children:[f(s1,{error:e.error}),f("span",{children:f(ve,{onClick:()=>n.fetchResourceFromServer(r),children:"Retry"})})]}):M(be,{children:[f("p",{children:"You don't have access to this, try signing in:"}),f(Nx,{})]})]})}):f(ba,{children:M(ai,{children:[M("h1",{children:["Could not open ",e.getSubject()]}),f(s1,{error:e.error}),M(Ut,{children:[f(ve,{onClick:()=>n.fetchResourceFromServer(r,{setLoading:!0}),children:"Retry"}),f(ve,{onClick:()=>n.fetchResourceFromServer(r,{fromProxy:!0,setLoading:!0}),title:`Fetches the URL from your current Atomic-Server (${n.getServerUrl()}), instead of from the actual URL itself. Can be useful if the URL is down, but the resource is cached in your server.`,children:"Use proxy"})]})]})})}class L2 extends w.Component{constructor(t){super(t),this.state={error:void 0}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error?this.props.FallBackComponent?f(this.props.FallBackComponent,{error:this.state.error}):f(o9,{error:this.state.error,clearError:()=>this.setState({error:void 0}),info:{}}):this.props.children}}function Lp({content:e,loading:t}){const[n,r]=w.useState(void 0);function i(){r(e),navigator.clipboard.writeText(e||""),dt.success("Copied to clipboard")}return f(IJ,{"data-code-content":e,children:t?"loading...":M(be,{children:[e,f(ve,{subtle:!0,style:{position:"absolute",bottom:0,top:0,margin:0,right:0},onClick:i,title:n===e?"Copied!":"Copy to clipboard","data-test":"copy-response",children:n===e?f(qL,{}):f(xy,{})})]})})}const IJ=B.pre.withConfig({displayName:"CodeBlockStyled",componentId:"sc-d2u0e2-0"})(["position:relative;background-color:",";border-radius:",";border:solid 1px ",";padding:0.3rem;font-family:monospace;width:100%;overflow-x:auto;"],e=>e.theme.colors.bg1,e=>e.theme.radius,e=>e.theme.colors.bg2);function Gu({resource:e,prefix:t,link:n}){const[r]=Xe(e);return M("h1",{children:[t&&`${t} `,n?f(We,{subject:e.getSubject(),children:r}):r]})}function OJ({resource:e}){const[t,n]=w.useState(void 0),r=Ke();return M(Ot,{about:e.getSubject(),children:[f(Gu,{resource:e}),f(b2,{resource:e}),f(qi,{resource:e,propertyURL:G.description}),f(Ps,{resource:e,except:w2,editable:!0,columns:!0}),M(Ut,{children:[f(du,{icon:!0,klass:e.getSubject()}),f(ve,{subtle:!0,onClick:async()=>n(await ZT(e,r)),children:"typescript interface"})]}),t&&f(Lp,{content:t})]})}function LJ({resource:e}){const{downloadFile:t,bytes:n}=Ap(e),r=Qh("(min-width: 600px)");return f(ba,{about:e.getSubject(),children:M(ai,{gap:"2rem",children:[M(Ut,{center:!0,justify:"space-between",children:[f(DJ,{resource:e}),r&&f(iY,{downloadFile:t,fileSize:n}),!r&&f(k7,{downloadFile:t,fileSize:n})]}),f(qi,{resource:e,propertyURL:G.description}),f(E7,{resource:e})]})})}const DJ=B(Ki).withConfig({displayName:"StyledEditableTitle",componentId:"sc-yaghyt-0"})(["margin:0;"]);function MJ({resource:e}){const[t]=it(e,G.chatRoom.messages),[n,r]=w.useState(""),i=Ke(),[o,a]=w.useState(void 0),s=w.useRef(null),u=w.useRef(null),[l,c]=w.useState(1);je("enter",S=>{S.preventDefault(),y()},{enableOnTags:["TEXTAREA"]},[]),je("escape",S=>{var k;(k=u==null?void 0:u.current)==null||k.blur()},{enableOnTags:["TEXTAREA"]},[]),w.useEffect(h,[t.length,e]);function h(){s.current&&(s.current.scrollTop=s.current.scrollHeight)}const p=n.length===0;async function y(S){const k=n;try{if(h(),r(""),S&&S.preventDefault(),!p){const C=i.createSubject("messages",e.getSubject()),d=new xi(C,!0);await d.set(G.parent,e.getSubject(),i,!1),await d.set(G.isA,[Ue.message],i,!1),await d.set(G.description,n,i,!1),await d.set(G.commit.createdAt,Iu(),i,!1),o&&await d.set(G.chatRoom.replyTo,o,i,!1),await d.save(i),a(void 0)}}catch(C){r(k),dt.error(C.message)}}const g=de.useCallback(b,[u]);function b(S){var k;a(S),(k=u==null?void 0:u.current)==null||k.focus()}function _(S){if(r(S.target.value),S.target.value===""){c(1);return}const k=S.target.style.overflow;S.target.style.overflow="scroll";const C=S.target.scrollHeight;S.target.style.overflow=k;const v=Math.ceil(C/30)-1;v!==l&&c(v)}return M(UJ,{about:e.getSubject(),children:[f(Ki,{resource:e}),f(HJ,{ref:s,children:f(u9,{subject:e.getSubject(),setReplyTo:g})}),o&&M(mu,{children:[f(a9,{subject:o}),f(ve,{icon:!0,subtle:!0,onClick:()=>a(void 0),children:f(Mu,{})})]}),M($J,{onSubmit:y,children:[f(FJ,{rows:l,ref:u,autoFocus:!0,value:n,onChange:_,placeholder:"type a message","data-test":"message-input"}),f(BJ,{title:"Send message [enter]",disabled:p,clean:!0,onClick:y,children:"Send"})]}),f(vf,{baseMargin:"2rem",position:"bottom"})]})}const NJ=500,zJ=de.memo(function({subject:t,setReplyTo:n}){const r=Ce(t),[i]=ye(r,G.description),[o]=Po(r,G.commit.lastCommit),[a]=Po(r,G.chatRoom.replyTo),s=_t();function u(){navigator.clipboard.writeText(t),dt.success("Copied message URL to clipboard")}function l(){navigator.clipboard.writeText(i||""),dt.success("Copied message text to clipboard")}return M(jJ,{about:t,children:[M(s9,{children:[f(Is,{commitSubject:o}),a&&f(a9,{subject:a}),M(l9,{children:[f(ve,{icon:!0,subtle:!0,onClick:()=>s(Hh(t)),title:"Edit message",children:f(aD,{})}),f(ve,{icon:!0,subtle:!0,onClick:()=>n(t),title:"Reply to this message",children:f(uD,{})}),f(ve,{icon:!0,subtle:!0,onClick:u,title:"Copy link to this message",children:f(rD,{})}),f(ve,{icon:!0,subtle:!0,onClick:l,title:"Copy message text",children:f(xy,{})})]})]}),f(Gt,{noMargin:!0,text:i||"",maxLength:NJ})]})}),d6=50;function a9({subject:e}){const t=Ce(e),[n]=ye(t,G.description),[r]=Po(t,G.commit.lastCommit),i=Ce(r),[o]=Po(i,G.commit.signer);if(!t.isReady()||!i.isReady())return f(f6,{children:"loading..."});const a=n==null?void 0:n.substring(0,d6),s=n&&n.length>d6?"...":"";return M(f6,{children:[f("span",{children:"to "}),f(Yt,{subject:o}),f(We,{subject:e,children:`: ${a}${s}`})]})}const f6=B.span.withConfig({displayName:"MessageLineStyled",componentId:"sc-1xeo7q5-0"})(["font-size:0.7rem;white-space:nowrap;overflow:hidden;flex:1;"]),s9=B.div.withConfig({displayName:"MessageDetails",componentId:"sc-1xeo7q5-1"})(["font-size:0.7rem;margin-bottom:0;opacity:0.4;display:flex;flex:1;"]),l9=B.div.withConfig({displayName:"MessageActions",componentId:"sc-1xeo7q5-2"})(["display:flex;align-self:flex-end;justify-content:flex-end;flex:1;opacity:0;margin-right:1rem;"]),jJ=B.div.withConfig({displayName:"MessageComponent",componentId:"sc-1xeo7q5-3"})(["min-height:1.5rem;padding-bottom:0.5rem;padding-left:1rem;&:hover{background:",";& ","{opacity:1;}& ","{opacity:1;}}"],e=>e.theme.colors.bg,s9,l9),BJ=B(ve).withConfig({displayName:"SendButton",componentId:"sc-1xeo7q5-4"})(["padding-left:1rem;padding-right:1rem;color:",";background:",";&:disabled{cursor:default;display:auto;opacity:0.5;}"],e=>e.theme.colors.bg,e=>e.theme.colors.main),FJ=B.textarea.withConfig({displayName:"MessageInput",componentId:"sc-1xeo7q5-5"})(["color:",";background:none;flex:1;padding:0.5rem 1rem;border:"," solid 1px;border-right:none;line-height:inherit;min-height:2rem;max-height:50vh;font-family:",";"],e=>e.theme.colors.text,e=>e.theme.colors.bg2,e=>e.theme.fontFamily),$J=B.form.withConfig({displayName:"MessageForm",componentId:"sc-1xeo7q5-6"})(["display:flex;flex-basis:3rem;flex-direction:row;border-radius:",";background:",";view-transition-name:chat-input;> :first-child{border-top-left-radius:",";border-bottom-left-radius:",";}> :last-child{border-top-right-radius:",";border-bottom-right-radius:",";}"],e=>e.theme.radius,e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius),UJ=B.div.withConfig({displayName:"FullPageWrapper",componentId:"sc-1xeo7q5-7"})(["display:flex;flex-direction:column;height:calc(100vh - 4rem);padding:1rem;flex:1;"]),HJ=B.div.withConfig({displayName:"ScrollingContent",componentId:"sc-1xeo7q5-8"})(["margin-left:-1rem;margin-right:-1rem;overflow-y:scroll;flex:1;"]);function u9({subject:e,setReplyTo:t}){const n=Ce(e),[r]=it(n,G.chatRoom.messages),[i]=ye(n,G.chatRoom.nextPage),[o]=w.useState(!0),a=w.useRef(null);return o?n.isReady()?M("div",{ref:a,children:[i&&f(u9,{subject:i,setReplyTo:t}),r.map(s=>f(zJ,{subject:s,setReplyTo:t},"message"+s))]}):f(be,{children:"loading..."}):f(be,{children:"Not in view..."})}function WJ({resource:e}){const[t]=ye(e,G.description),[n]=ye(e,G.parent),[r]=ye(e,G.commit.lastCommit);return M(Ot,{about:e.getSubject(),children:[M("h3",{children:["Message in ",f(Yt,{subject:n})]}),f(y2,{children:f(Is,{commitSubject:r})}),f(Gt,{text:t||""})]})}function VJ({preview:e,error:t,loading:n}){return n?f(G1,{children:"loading..."}):t?f(qJ,{error:t}):!e||e===""?f(G1,{children:"no preview..."}):f(KJ,{children:f(Gt,{renderGFM:!0,text:e})})}const qJ=({error:e})=>f(G1,{children:M("div",{children:[f("p",{children:"Could not load preview 😞"}),f(Nt,{style:{fontSize:"1rem"},children:e.message})]})}),G1=B.div.withConfig({displayName:"CenterGrid",componentId:"sc-300i91-0"})(["display:grid;height:min(80vh,1000px);width:100%;place-items:center;font-size:calc(clamp(1rem,5vw,2.4rem) + 0.1rem);"]),KJ=B(Ot).withConfig({displayName:"StyledContainerNarrow",componentId:"sc-300i91-1"})(["max-width:85ch;"]);Cs.sha512=e=>Promise.resolve(ok(e));const h6={children:"https://atomicdata.dev/properties/children",classType:"https://atomicdata.dev/properties/classtype",createdBy:"https://atomicdata.dev/properties/createdBy",datatype:"https://atomicdata.dev/properties/datatype",description:"https://atomicdata.dev/properties/description",drives:"https://atomicdata.dev/properties/drives",incomplete:"https://atomicdata.dev/properties/incomplete",isA:"https://atomicdata.dev/properties/isA",isDynamic:"https://atomicdata.dev/properties/isDynamic",name:"https://atomicdata.dev/properties/name",parent:"https://atomicdata.dev/properties/parent",paymentPointer:"https://atomicdata.dev/properties/paymentPointer",read:"https://atomicdata.dev/properties/read",recommends:"https://atomicdata.dev/properties/recommends",requires:"https://atomicdata.dev/properties/requires",shortname:"https://atomicdata.dev/properties/shortname",subResources:"https://atomicdata.dev/properties/subresources",write:"https://atomicdata.dev/properties/write",displayStyle:"https://atomicdata.dev/property/display-style",publishedAt:"https://atomicdata.dev/properties/published-at",agent:{publicKey:"https://atomicdata.dev/properties/publicKey"},collection:{members:"https://atomicdata.dev/properties/collection/members",currentPage:"https://atomicdata.dev/properties/collection/currentPage",pageSize:"https://atomicdata.dev/properties/collection/pageSize",property:"https://atomicdata.dev/properties/collection/property",totalMembers:"https://atomicdata.dev/properties/collection/totalMembers",totalPages:"https://atomicdata.dev/properties/collection/totalPages",value:"https://atomicdata.dev/properties/collection/value"},commit:{subject:"https://atomicdata.dev/properties/subject",createdAt:"https://atomicdata.dev/properties/createdAt",lastCommit:"https://atomicdata.dev/properties/lastCommit",previousCommit:"https://atomicdata.dev/properties/previousCommit",signer:"https://atomicdata.dev/properties/signer",set:"https://atomicdata.dev/properties/set",push:"https://atomicdata.dev/properties/push",remove:"https://atomicdata.dev/properties/remove",destroy:"https://atomicdata.dev/properties/destroy",signature:"https://atomicdata.dev/properties/signature"},document:{elements:"https://atomicdata.dev/properties/documents/elements"},endpoint:{parameters:"https://atomicdata.dev/properties/endpoint/parameters",results:"https://atomicdata.dev/properties/endpoint/results"},search:{query:"https://atomicdata.dev/properties/search/query",limit:"https://atomicdata.dev/properties/search/limit",property:"https://atomicdata.dev/properties/search/property"},redirect:{destination:"https://atomicdata.dev/properties/destination",redirectAgent:"https://atomicdata.dev/properties/invite/redirectAgent"},invite:{agent:"https://atomicdata.dev/properties/invite/agent",publicKey:"https://atomicdata.dev/properties/invite/publicKey",target:"https://atomicdata.dev/properties/invite/target",usagesLeft:"https://atomicdata.dev/properties/invite/usagesLeft",users:"https://atomicdata.dev/properties/invite/users",write:"https://atomicdata.dev/properties/invite/write"},file:{filename:"https://atomicdata.dev/properties/filename",filesize:"https://atomicdata.dev/properties/filesize",downloadUrl:"https://atomicdata.dev/properties/downloadURL",mimetype:"https://atomicdata.dev/properties/mimetype",attachments:"https://atomicdata.dev/properties/attachments"},chatRoom:{messages:"https://atomicdata.dev/properties/messages",nextPage:"https://atomicdata.dev/properties/nextPage",replyTo:"https://atomicdata.dev/properties/replyTo"},bookmark:{url:"https://atomicdata.dev/property/url",preview:"https://atomicdata.dev/property/preview",imageUrl:"https://atomicdata.dev/properties/imageUrl"}};var c9=(e=>(e.Unauthorized="Unauthorized",e.NotFound="NotFound",e.Server="Server",e.Client="Client",e))(c9||{});class Zf extends Error{constructor(t,n="Client"){super(t),Object.setPrototypeOf(this,Zf.prototype),this.type=n,this.message=t;try{const i=JSON.parse(t)[h6.description];i&&(this.message=i)}catch{}this.message||(this.message=this.createMessage())}static fromResource(t){return new Zf(t.get(h6.description).toString())}createMessage(){switch(this.type){case"Unauthorized":return"You don't have the rights to do this.";case"NotFound":return"404 Not found.";case"Server":return"500 Unknown server error.";default:return"Unknown error."}}}const p6=new Map;function GJ(e,t=500){return(...r)=>{const i=p6.get(e);i&&window.clearTimeout(i),p6.set(e,window.setTimeout(()=>e(...r),t))}}async function YJ(e,t="",n){const r=new URL($e.fetchBookmark,n.getServerUrl()),i=new URLSearchParams({name:t,url:e});r.search=i.toString();const o=await fetch(r.toString(),{headers:{Accept:"application/json"}});if(o.status!==200)throw new Zf(await o.text(),c9.Server);return await o.json()}const XJ=GJ((e,t,n,r,i,o,a,s,u,l)=>{w.startTransition(()=>{YJ(e,t,n).then(async c=>{await Promise.all([i(c.preview),o(c.name),u(c["image-url"]),l(c.description)]),a(void 0),s(!1),r.save(n)}).catch(c=>{console.error(c),a(c),s(!1)})})});function QJ(e){const t=Ke(),[n,r]=ye(e,J.properties.bookmark.preview),[i]=ye(e,J.properties.bookmark.url),[o,a]=ye(e,J.properties.name),[s,u]=ye(e,J.properties.bookmark.imageUrl),[l,c]=ye(e,J.properties.description),[h,p]=w.useState(void 0),[y,g]=w.useState(!1),b=w.useCallback(_=>{try{new URL(_)}catch(S){p(S);return}g(!0),XJ(_,o,t,e,r,a,p,g,u,c)},[o,e,t]);return w.useEffect(()=>{e.isReady()&&n===void 0&&i&&b(i)},[n,e.isReady()]),{preview:n,error:h,update:b,loading:y}}function JJ({resource:e}){const[t,n]=ye(e,J.properties.bookmark.url,{commit:!0}),{preview:r,error:i,update:o,loading:a}=QJ(e),s=w.useCallback(async u=>{await n(u.target.value),o(u.target.value)},[n,o]);return f(be,{children:M(ZJ,{children:[f(yf,{children:f(Ki,{resource:e})}),f(eZ,{children:f(yf,{children:M(nZ,{children:[f(tZ,{children:f(un,{children:f(Xn,{placeholder:"https://example.com",value:t,onChange:s})})}),t?M(k2,{to:t,variant:S2.Button,children:["Open site"," "]}):f(Nt,{children:"No url"})]})})}),f(rZ,{children:f(VJ,{preview:r||"",error:i,loading:a})})]})})}const ZJ=B.div.withConfig({displayName:"Wrapper",componentId:"sc-zxu7fx-0"})(["margin-top:","rem;position:relative;display:flex;flex-direction:column;min-height:100%;",",","{padding-bottom:unset;}"],e=>e.theme.margin,yf,Ot),eZ=B.div.withConfig({displayName:"ControlWrapper",componentId:"sc-zxu7fx-1"})(["position:sticky;top:0rem;background-color:",";border-bottom:solid 1px ",";padding:0rem;align-items:center;"],e=>e.theme.colors.bgBody,e=>e.theme.colors.bg2),tZ=B.div.withConfig({displayName:"FieldWrapper",componentId:"sc-zxu7fx-2"})(["flex:1;"]),nZ=B.div.withConfig({displayName:"ControlBar",componentId:"sc-zxu7fx-3"})(["display:flex;align-items:center;gap:","rem;margin-bottom:","rem;"],e=>e.theme.margin,e=>e.theme.margin),rZ=B.div.withConfig({displayName:"PreviewWrapper",componentId:"sc-zxu7fx-4"})(["background-color:",";flex:1;padding-bottom:",";"],e=>e.theme.colors.bg,e=>e.theme.heights.floatingSearchBarPadding);function d9({resource:e}){const[t,n]=w.useState(!1),[r,i]=Ur(),o=Ce(r),[a,s]=w.useState(!1);e=o||e;const u=Ke(),[l,c]=w.useState(""),h=w.useCallback(async()=>{try{s(!0),await GP(u,l,{overwriteOutside:t,parent:r}),dt.success("Imported!"),s(!1)}catch(p){dt.error(p.message),s(!1)}},[r,l,t,u]);return M(Ot,{about:e.getSubject(),children:[f(Gu,{resource:e,prefix:"Import to",link:!0}),M("p",{children:["Read more about how importing Atomic Data works"," ",f("a",{href:"https://docs.atomicdata.dev/create-json-ad.html",children:"in the docs"}),"."]}),M(ai,{children:[f(ni,{label:"JSON-AD",children:f(un,{children:f(FM,{rows:15,placeholder:"Paste your JSON-AD...",value:l,onChange:p=>c(p.target.value),children:l})})}),f(aZ,{children:"Options"}),M(oZ,{children:[M(iZ,{children:[f("input",{type:"checkbox",checked:t,onChange:p=>n(p.target.checked)}),"Overwrite resources that are outside the scope of the parent. Do this only if you trust the imported data."]}),f(ni,{label:"Target parent",helper:"This URL will be used as the default Parent for imported resources.",required:!0,children:f(un,{children:f(Xn,{required:!0,placeholder:"Enter subject",value:r,onChange:p=>i(p.target.value)})})})]}),l!==""&&f(ve,{"data-test":"import-post",disabled:!r,onClick:h,children:a?"Importing...":"Send JSON"})]})]})}const iZ=B.label.withConfig({displayName:"Label",componentId:"sc-cacnsf-0"})(["display:flex;gap:1ch;align-items:center;"]),oZ=B.div.withConfig({displayName:"Group",componentId:"sc-cacnsf-1"})(["display:flex;padding:1rem;flex-direction:column;gap:1rem;border:1px solid ",";border-radius:",";"],e=>e.theme.colors.bg2,e=>e.theme.radius),aZ=B.h2.withConfig({displayName:"Header",componentId:"sc-cacnsf-2"})(["font-size:1.2rem;"]),f9="0.2rem";function h9({resource:e}){const[t]=ye(e,G.parent),[n,r]=Xe(e),[i]=Wi(e),{enableScope:o}=Gh(e.getSubject());return f(sZ,{"aria-label":"Breadcrumbs",children:M(Ut,{fullWidth:!0,center:!0,gap:"initial",children:[t&&f(p9,{subject:t,depth:0}),i?M(fZ,{children:[f(dZ,{value:n,onChange:a=>r(a.target.value)}),f(_s,{})]}):f(cZ,{children:n}),f(hZ,{}),f(pZ,{onClick:o,title:`Search in ${n}`,color:"textLight",children:f(Ey,{})})]})})}const sZ=B.nav.withConfig({displayName:"ParentWrapper",componentId:"sc-2ov1y0-0"})(["height:",";padding-block:",";padding-inline:0.5rem;color:",";border-bottom:1px solid ",";background-color:",";display:flex;flex-direction:row;align-items:center;justify-content:flex-start;view-transition-name:breadcrumb-bar;"],e=>e.theme.heights.breadCrumbBar,f9,e=>e.theme.colors.textLight2,e=>e.theme.colors.bg2,e=>e.theme.colors.bg),lZ=4;function p9({subject:e,depth:t}){const n=Ce(e,{allowIncomplete:!0}),[r]=ye(n,G.parent),i=Vh(),[o]=Xe(n);if(t>lZ)return f(m6,{children:"..."});function a(s){s.preventDefault(),i($t(e))}return M(be,{children:[r&&f(p9,{subject:r,depth:t+1}),f(m6,{href:e,onClick:a,children:o}),f(uZ,{children:"/"})]})}const uZ=B.div.withConfig({displayName:"Divider",componentId:"sc-2ov1y0-1"})(["padding:0.1rem 0.2rem;"]),D2=Jn(["font-size:","rem;font-family:",";padding:0.1rem 0.5rem;color:",";"],e=>e.theme.fontSizeBody,e=>e.theme.fontFamily,e=>e.theme.colors.textLight),cZ=B.div.withConfig({displayName:"BreadCrumbCurrent",componentId:"sc-2ov1y0-2"})(["",""],D2),dZ=B.input.withConfig({displayName:"BreadCrumbInput",componentId:"sc-2ov1y0-3"})([""," background:none;outline:none;border:none;"],D2),fZ=B.div.withConfig({displayName:"BreadCrumbInputWrapper",componentId:"sc-2ov1y0-4"})(["display:flex;&:hover svg{display:flex;}svg{display:none;}"]),m6=B.a.withConfig({displayName:"Breadcrumb",componentId:"sc-2ov1y0-5"})([""," white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-self:center;cursor:'pointer';text-decoration:none;border-radius:",";&:hover{background:",";color:",";}&:active{background:",";}"],D2,e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.theme.colors.text,e=>e.theme.colors.bg2),hZ=B.span.withConfig({displayName:"Spacer",componentId:"sc-2ov1y0-6"})(["flex:1;"]),pZ=B(oi).withConfig({displayName:"ScopedSearchButton",componentId:"sc-2ov1y0-7"})(["justify-self:flex-end;"]);function mZ({options:e,name:t,onChange:n}){const[r,i]=w.useState(()=>{var a;return(a=e.find(s=>s.checked))==null?void 0:a.value}),o=w.useCallback((a,s)=>{a&&(n(s),i(s))},[n]);return f(vZ,{children:e.map(a=>w.createElement(gZ,{...a,key:a.value,onChange:o,checked:r===a.value,name:t}))})}function gZ({onChange:e,icon:t,label:n,name:r,value:i,checked:o}){const a=w.useId();return M(yZ,{children:[f(wZ,{id:a,type:"radio",onChange:u=>{e(u.target.checked,i)},name:r,value:i,checked:o}),f(bZ,{htmlFor:a,title:n,children:t})]})}const vZ=B.form.withConfig({displayName:"Group",componentId:"sc-hqcy88-0"})(["display:flex;height:2rem;gap:0.5rem;"]),yZ=B.div.withConfig({displayName:"Item",componentId:"sc-hqcy88-1"})(["position:relative;width:2rem;aspect-ratio:1/1;"]),bZ=B.label.withConfig({displayName:"Label",componentId:"sc-hqcy88-2"})(["position:absolute;inset:0;width:100%;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;border-radius:",";color:",";cursor:pointer;transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;input:checked + &{background-color:",";color:",";}:hover{background-color:",";}"],e=>e.theme.radius,e=>e.theme.colors.textLight,e=>e.theme.colors.bg1,e=>e.theme.colors.text,e=>e.theme.colors.bg1),wZ=B.input.withConfig({displayName:"Input",componentId:"sc-hqcy88-3"})(["position:absolute;inset:0;width:100%;aspect-ratio:1/1;visibility:hidden;"]),{grid:g6,list:v6}=Ue.displayStyles;function SZ({displayStyle:e,onClick:t}){const n=w.useMemo(()=>[{icon:f(oD,{}),label:"List View",value:v6,checked:e===v6},{icon:f(gD,{}),label:"Grid View",value:g6,checked:e===g6}],[e]);return f(mZ,{options:n,name:"display-style",onChange:t})}function Y1({resource:e}){const[t]=ye(e,G.description);return f(Os,{children:f(x2,{children:t})})}function kZ({resource:e}){const[t]=ye(e,G.bookmark.imageUrl);return t?f(Os,{children:f(xZ,{src:t,alt:""})}):f(Y1,{resource:e})}const xZ=B.img.withConfig({displayName:"Image",componentId:"sc-11y3cd7-0"})(["width:100%;height:100%;object-fit:cover;object-position:center;"]);function CZ({resource:e}){return f("ul",{children:[...e.getPropVals()].map(([t,n])=>f(_Z,{prop:t,val:n},t))})}function _Z({prop:e,val:t}){const n=Ce(e),[r]=Xe(n),[i]=Po(n,G.datatype),o=w.useMemo(()=>i===V0.atomicUrl?f(m9,{val:t}):i===V0.resourceArray?f(AZ,{val:t}):f(be,{children:t}),[t,i]);return M(RZ,{children:[f(EZ,{children:r}),": ",o]})}const EZ=B.span.withConfig({displayName:"Key",componentId:"sc-sffncw-0"})(["font-weight:bold;"]),RZ=B.ul.withConfig({displayName:"List",componentId:"sc-sffncw-1"})(["list-style:none;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:",";"],e=>e.theme.colors.textLight);function AZ({val:e}){return f(be,{children:e.map((t,n)=>M(be,{children:[f(m9,{val:t},t),n===e.length-1?"":", "]}))})}function m9({val:e}){const t=Ce(e),[n]=Xe(t);return f(be,{children:n})}function TZ({resource:e}){return f(PZ,{children:f(CZ,{resource:e})})}const PZ=B.div.withConfig({displayName:"DefaultGridWrapper",componentId:"sc-177c15f-0"})(["padding:","rem;pointer-events:none;"],e=>e.theme.margin);function IZ({resource:e}){const[t]=it(e,G.chatRoom.messages);return f(DZ,{children:t.length>0?M(be,{children:[f(y6,{subject:t[t.length-2]}),f(y6,{subject:t[t.length-1],alignment:"right"})]}):f(x2,{children:"Empty Chat"})})}const y6=({subject:e,alignment:t})=>{const n=Ce(e),[r]=Po(n,G.commit.lastCommit),i=Ce(r),[o]=Po(i,G.commit.signer),a=Ce(o),[s]=Xe(a),[u]=ye(n,G.description);return M(OZ,{alignment:t,children:[f(LZ,{children:s}),f(g9,{children:u})]})},g9=B.div.withConfig({displayName:"TextWrapper",componentId:"sc-zaco6u-0"})(["background-color:",";padding:0.5rem;border-radius:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:",";"],e=>e.theme.colors.bg,e=>e.theme.colors.text),OZ=B.div.withConfig({displayName:"MessageWrapper",componentId:"sc-zaco6u-1"})(["padding-inline:","rem;width:100%;text-align:",";","{border-bottom-left-radius:",";border-bottom-right-radius:",";}"],e=>e.theme.margin,e=>e.alignment??"left",g9,e=>e.alignment!=="right"?"0":"15px",e=>e.alignment==="right"?"0":"15px"),LZ=B.div.withConfig({displayName:"CommitWrapper",componentId:"sc-zaco6u-2"})(["color:",";padding-inline:0.5rem;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"],e=>e.theme.colors.textLight),DZ=B(Os).withConfig({displayName:"ChatWrapper",componentId:"sc-zaco6u-3"})(["display:flex;flex-direction:column;justify-content:space-evenly;"]);function MZ({resource:e}){const[t]=it(e,G.document.elements),n=Ce(t[0]),[r]=ye(n,G.description);return f(Os,{children:f(x2,{children:f(Gt,{text:r??""})})})}const NZ=new Set(["image/png","image/jpeg","image/gif","image/svg+xml","image/webp","image/avif"]);function zZ({resource:e}){const{downloadUrl:t,mimeType:n,bytes:r}=Ap(e),i=v2(),o=x7(e.getSubject());return r>=i?f(b6,{children:"To large for preview"}):NZ.has(n)?f(Os,{children:f(jZ,{src:t,alt:"",loading:"lazy",style:o})}):_7(n)?f(BZ,{downloadUrl:t,mimeType:n}):f(b6,{children:"No preview available"})}const jZ=B.img.withConfig({displayName:"Image",componentId:"sc-1doxiie-0"})(["width:100%;height:100%;object-fit:cover;object-position:center;"]),b6=B(Os).withConfig({displayName:"TextWrapper",componentId:"sc-1doxiie-1"})(["display:grid;place-items:center;color:",";"],e=>e.theme.colors.textLight),BZ=B(C7).withConfig({displayName:"StyledTextPreview",componentId:"sc-1doxiie-2"})(["padding:","rem;color:",";&:is(pre){padding:0;padding-inline:","rem;}"],e=>e.theme.margin,e=>e.theme.colors.textLight,e=>e.theme.margin),FZ=new Map([[Ue.bookmark,kZ],[Ue.class,Y1],[Ue.property,Y1],[Ue.chatRoom,IZ],[Ue.document,MZ],[Ue.file,zZ]]);function $Z(e){return FZ.get(e)??TZ}function UZ({subject:e}){const t=Vh(),n=Ce(e),[r]=Xe(n),[i]=ye(n,G.isA),o=Ce(i),[a]=Xe(o),s=zu(i??""),u=w.useCallback(p=>{p.preventDefault(),t($t(e))},[e,t]),l=w.useMemo(()=>$Z(i??""),[i]);if(i===void 0)return f(KZ,{});const c=i===Ue.folder,h=c?void 0:e;return M(vu,{onClick:u,href:e,children:[f(P7,{subject:h,children:r}),c?f(WZ,{}):M(gu,{subject:h,children:[M(HZ,{children:[f(s,{}),f("span",{children:a})]}),f(L2,{FallBackComponent:VZ,children:f(l,{resource:n})})]})]})}const HZ=B.div.withConfig({displayName:"ClassBanner",componentId:"sc-1qvdapf-0"})(["display:flex;background-color:",";border-top-left-radius:",";border-top-right-radius:",";align-items:center;gap:0.5rem;justify-content:center;padding-block:var(--card-banner-padding);color:",";border-bottom:1px solid ",";span{text-transform:capitalize;}"],e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.colors.textLight,e=>e.theme.colors.bg2),WZ=B(ox).withConfig({displayName:"FolderIcon",componentId:"sc-1qvdapf-1"})(["height:100%;width:100%;color:",";transition:color 0.1s ease-in-out;",":hover &{color:",";}"],e=>e.theme.colors.textLight,vu,e=>e.theme.colors.main),VZ=({error:e})=>f(qZ,{children:e.message}),qZ=B.div.withConfig({displayName:"GridItemErrorWrapper",componentId:"sc-1qvdapf-2"})(["color:",";text-align:center;"],e=>e.theme.colors.alert),KZ=B(xM).withConfig({displayName:"Loader",componentId:"sc-1qvdapf-3"})(["--loader-bg-to:",";height:unset;aspect-ratio:1/1;"],e=>e.theme.colors.bgBody);function GZ({subResources:e,onNewClick:t,showNewButton:n}){return M(YZ,{children:[Array.from(e.values()).map(r=>f(UZ,{subject:r.getSubject()},r.getSubject())),n&&M(vu,{children:[f(XZ,{as:"button",onClick:t,title:"Create new resource",children:f(ui,{})}),f(P7,{children:"New Resource"})]})]})}const YZ=B.div.withConfig({displayName:"Grid",componentId:"sc-e7hj1r-0"})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));width:var(--container-width);margin-inline:auto;gap:3rem;"]),XZ=B(gu).withConfig({displayName:"NewCard",componentId:"sc-e7hj1r-1"})(["background-color:",";border:1px solid ",";cursor:pointer;display:grid;place-items:center;font-size:3rem;color:",";transition:color 0.1s ease-in-out,font-size 0.1s ease-out,box-shadow 0.1s ease-in-out;",":hover &,",":focus &{color:",";font-size:3.8rem;}:active{font-size:3rem;}"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,vu,vu,e=>e.theme.colors.main);function v9({subResources:e,onNewClick:t,showNewButton:n}){return M(eee,{children:[f(tee,{"data-test":"folder-list",children:M(be,{children:[f("thead",{children:M("tr",{children:[f("th",{children:f(iee,{children:"Title"})}),f("th",{children:"Class"}),f(w6,{as:"th",children:"Last Modified"})]})}),f("tbody",{children:Array.from(e.values()).map(r=>M(oee,{children:[f("td",{children:f(QZ,{resource:r})}),f("td",{children:f(ZZ,{resource:r})}),f(w6,{children:f(JZ,{resource:r})})]},r.getSubject()))})]})}),n&&f(aee,{clean:!0,onClick:t,"data-test":"new-resource-folder",children:M("span",{children:[f(ui,{})," New Resource"]})})]})}function QZ({resource:e}){const[t]=Xe(e),[n]=ye(e,G.isA),r=zu(n??"");return M(ree,{children:[f(nee,{children:f(r,{})}),f(We,{subject:e.getSubject(),children:t})]})}function JZ({resource:e}){const[t]=ye(e,G.commit.lastCommit);return f(y9,{children:f(Is,{commitSubject:t})})}function ZZ({resource:e}){const[t]=ye(e,G.isA),n=Ce(t),[r]=Xe(n);return f(y9,{children:f(We,{subject:t,children:r})})}const eee=B.div.withConfig({displayName:"Wrapper",componentId:"sc-v3wz3w-0"})(["--icon-width:1rem;--icon-title-spacing:1rem;--cell-padding:0.4rem;width:var(--container-width);margin-inline:auto;"]),tee=B.table.withConfig({displayName:"StyledTable",componentId:"sc-v3wz3w-1"})(["text-align:left;border-collapse:collapse;width:100%;th{padding-bottom:1rem;}th:last-child{padding-right:2rem;}"]),nee=B.span.withConfig({displayName:"IconWrapper",componentId:"sc-v3wz3w-2"})(["width:var(--icon-width);display:inline-flex;align-items:center;"]),ree=B.div.withConfig({displayName:"TitleWrapper",componentId:"sc-v3wz3w-3"})(["display:flex;align-items:center;gap:var(--icon-title-spacing);svg{color:",";}"],e=>e.theme.colors.textLight),iee=B.span.withConfig({displayName:"TitleHeaderWrapper",componentId:"sc-v3wz3w-4"})(["margin-inline-start:calc( var(--icon-width) + var(--icon-title-spacing) + var(--cell-padding) );"]),w6=B.td.withConfig({displayName:"AlignRight",componentId:"sc-v3wz3w-5"})(["text-align:right;"]),y9=B.span.withConfig({displayName:"LinkWrapper",componentId:"sc-v3wz3w-6"})(["a{color:",";}"],e=>e.theme.colors.textLight),oee=B.tr.withConfig({displayName:"TableRow",componentId:"sc-v3wz3w-7"})([":nth-child(odd){td{background-color:",";}td:first-child{border-top-left-radius:",";border-bottom-left-radius:",";}td:last-child{border-top-right-radius:",";border-bottom-right-radius:",";}}td{padding:var(--cell-padding);}"],e=>e.theme.colors.bg1,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius),aee=B(ve).withConfig({displayName:"NewButton",componentId:"sc-v3wz3w-8"})(["margin-top:1rem;margin-inline-start:calc( var(--icon-width) + var(--icon-title-spacing) + var(--cell-padding) );> span{display:flex;align-items:center;gap:0.5rem;}"]),see={commit:!0},lee=new Map([[Ue.displayStyles.list,v9],[Ue.displayStyles.grid,GZ]]),uee={commit:!0};function cee({resource:e}){const[t]=it(e,G.subResources,uee),[n,r]=ye(e,G.displayStyle,see),i=w.useMemo(()=>lee.get(n)??v9,[n]),o=cf(t),a=bx(e.getSubject()),[s]=Wi(e);return M(pee,{view:n,children:[f(dee,{children:M(fee,{children:[f(Ki,{resource:e}),f(SZ,{onClick:r,displayStyle:n})]})}),f(hee,{children:f(i9,{parentResource:e,children:f(i,{subResources:o,onNewClick:a,showNewButton:s})})})]})}const dee=B.div.withConfig({displayName:"TitleBar",componentId:"sc-tnpuvy-0"})(["padding:","rem;"],e=>e.theme.margin),fee=B.div.withConfig({displayName:"TitleBarInner",componentId:"sc-tnpuvy-1"})(["display:flex;width:var(--container-width);margin-inline:auto;justify-content:space-between;"]),hee=B.div.withConfig({displayName:"Wrapper",componentId:"sc-tnpuvy-2"})(["width:100%;padding:","rem;flex:1;"],e=>e.theme.margin),pee=B.div.withConfig({displayName:"FullPageWrapper",componentId:"sc-tnpuvy-3"})(["--container-width:min(1300px,100%);min-height:",";padding-bottom:",";display:flex;flex-direction:column;"],e=>e.theme.heights.fullPage,e=>e.theme.heights.floatingSearchBarPadding);function M2({subject:e}){const t=Ce(e),[n]=ye(t,G.isA);if(t.loading)return M(Ot,{children:[f("p",{children:"Loading..."}),f(hx,{})]});if(t.error)return f(PJ,{resource:t});const r=gee(n);return M(be,{children:[f(h9,{resource:t}),f(mee,{subject:e,children:f(L2,{children:f(r,{resource:t})})})]})}const mee=de.memo(B.main.withConfig({displayName:"Main",componentId:"sc-2icz80-0"})(["height:calc( 100% - ("," + "," * 2) );view-transition-name:",";"],e=>e.theme.heights.breadCrumbBar,f9,e=>g2("resource-page",e.subject)));function gee(e){switch(e){case J.classes.collection:return dX;case J.classes.endpoint:return gX;case J.classes.drive:return vX;case J.classes.redirect:return yX;case J.classes.invite:return bX;case J.classes.document:return wJ;case J.classes.class:return OJ;case J.classes.file:return LJ;case J.classes.chatRoom:return MJ;case J.classes.message:return WJ;case J.classes.bookmark:return JJ;case J.classes.importer:return d9;case J.classes.folder:return cee;case J.classes.article:return KY;default:return _Y}}function vee({filters:e,setFilters:t}){const[n,r]=w.useState(void 0),i=Ce(n),[o]=it(i,J.properties.requires),[a]=it(i,J.properties.recommends),s=[...o,...a];return w.useEffect(()=>{t({...e,[J.properties.isA]:n})},[n,JSON.stringify(e)]),M("div",{children:[f(Hu,{setSubject:r,value:n,classType:J.classes.class}),s==null?void 0:s.map(u=>f(yee,{subject:u,filters:e,setFilters:t},u))]})}function yee({filters:e,setFilters:t,subject:n}){const r=Ou(n);function i(o){t({...e,[r.shortname]:o.target.value})}return M("div",{children:[f("label",{children:r.shortname}),f("input",{type:"text",value:e[r.shortname],onChange:i})]})}function b9(){const[e]=cx(),{drive:t}=ot(),{scope:n}=Gh(),[r,i]=w.useState({}),[o,a]=w.useState(!1);je("f12",k=>{k.preventDefault(),a(!o)},[o]);const[s,u]=w.useState(!1),[l,c]=w.useState(0),{results:h,loading:p,error:y}=Rk(e,{debounce:0,scope:n||t,filters:r}),g=_t(),b=w.useRef(null);function _(k){var d;c(k);const C=(d=b==null?void 0:b.current)==null?void 0:d.children[k];C==null||C.scrollIntoView({block:"nearest"})}je("enter",k=>{var d,v,m;k.preventDefault();const C=(v=(d=b==null?void 0:b.current)==null?void 0:d.children[l])==null?void 0:v.getAttribute("about");if(C){(m=document==null?void 0:document.activeElement)==null||m.blur();const x=$t(C);g(x)}},{enableOnTags:["INPUT"]}),je("up",k=>{k.preventDefault();const C=l>0?l-1:0;_(C)},{enableOnTags:["INPUT"]}),je("down",k=>{k.preventDefault();const C=l===h.length-1?h.length-1:l+1;_(C)},{enableOnTags:["INPUT"]});let S="No hits";return(e==null?void 0:e.length)===0&&(S="Enter a search query"),p&&(S="Loading results..."),h.length>0&&(S=void 0),f(Ot,{children:y?f(Nt,{children:y.message}):M(be,{children:[M("div",{style:{display:"flex",justifyContent:"space-between"},children:[M(bee,{children:[f(Ey,{}),f("span",{children:S||M(be,{children:[h.length," ",h.length>1?"Results":"Result"," ","for ",f(wee,{children:e})]})})]}),o&&M(ve,{onClick:()=>u(!s),children:[f(ZL,{}),"Filter"]})]}),s&&f(vee,{setFilters:i,filters:r}),f(ai,{ref:b,gap:"1rem",children:h.map((k,C)=>f(Wu,{initialInView:C<5,small:!0,subject:k,highlight:C===l},k))})]})})}const bee=B.h1.withConfig({displayName:"Heading",componentId:"sc-10hcihn-0"})(["color:",";display:flex;align-items:center;gap:0.7ch;white-space:nowrap;overflow:hidden;line-height:1.5;margin-bottom:","rem;> span{overflow:hidden;text-overflow:ellipsis;}"],e=>e.theme.colors.text,e=>e.theme.margin*3),wee=B.span.withConfig({displayName:"QueryText",componentId:"sc-10hcihn-1"})(["color:",";"],e=>e.theme.colors.textLight),w9=()=>M(Ot,{children:[f(Xx,{style:{width:"30rem",maxWidth:"100%",marginBottom:"1rem"}}),f("p",{children:M("em",{children:["The easiest way to ",f("b",{children:"create"}),", ",f("b",{children:"share"})," and ",f("b",{children:"model"})," linked data."]})}),f("p",{children:"Atomic Data is a modular specification for sharing, modifying and modeling graph data. It combines the ease of use of JSON, the connectivity of RDF (linked data) and the reliability of type-safety."}),M("p",{children:["Atomic Data is especially suitable for knowledge graphs, distributed datasets, semantic data, p2p applications, decentralized apps, and data that is meant to be shared. It is designed to be highly extensible, easy to use, and to make the process of domain specific standardization as simple as possible. Check out"," ",f("b",{children:f(We,{href:"https://docs.atomicdata.dev/",children:"the docs"})})," ","for more information about Atomic Data."]}),f("h2",{children:"About this app"}),M("p",{children:["You're looking at"," ",f(We,{href:"https://github.com/atomicdata-dev/atomic-data-browser",children:"atomic-data-browser"}),", an open-source client for viewing and editing data. Please add an issue if you encouter problems or have a feature request. Expect bugs and issues, because this stuff is pretty beta."]}),M("p",{children:["The back-end of this app is"," ",f(We,{href:"https://github.com/atomicdata-dev/atomic-data-rust",children:"atomic-server"}),", which you can think of as an open source, web-native database."]}),f("h2",{children:"Things to visit"}),M("ul",{children:[f("li",{children:f(We,{path:"/collections",children:"List of lists"})}),f("li",{children:f(We,{path:"/classes",children:"List of Classes"})}),f("li",{children:f(We,{path:"/properties",children:"List of Properties"})})]}),f("h2",{children:"Run your own server"}),M("p",{children:["The easiest way to run an"," ",f(We,{href:"https://github.com/atomicdata-dev/atomic-data-rust",children:"atomic-server"})," ","is by using Docker:"]}),f("p",{children:f("code",{children:"docker run -p 80:80 -p 443:443 -v atomic-storage:/atomic-storage joepmeneer/atomic-server"})}),M("p",{children:["...and visit"," ",f(We,{subject:"http://localhost",children:"localhost"}),"."]}),f("h2",{children:"Join the community"}),M("p",{children:["Atomic Data is open and fully powered by volunteers. We're looking for people who want to help discuss various design challenges and work on implmenentations. If you have any questions, or want to help out, feel free to join our"," ",f(We,{href:"https://discord.gg/a72Rv2P",children:"Discord"}),"! Sign up to"," ",f(We,{href:"https://docs.atomicdata.dev/newsletter.html",children:"our newsletter"})," ","if you","'","d like to get updated! ."]})]}),See=()=>{const[e]=Ur();return e===void 0||e===""?f(w9,{}):dn.isValidSubject(e)?f(M2,{subject:e},e):f(b9,{})},kee=({classSubject:e})=>{const t=Ce(e),[n,r]=va("newSubject"),[i]=va("parent"),{subjectErr:o,subjectValue:a,setSubjectValue:s,resource:u}=b_({klass:t,setSubject:r,initialSubject:n,parent:i});return M(be,{children:[f(v_,{classSubject:e}),f(y_,{error:o,value:a,onChange:s}),f(sp,{resource:u,classSubject:e},`${e}+${n}`)]})};function xee(){const[e]=va("classSubject");return f(Ot,{children:e?f(kee,{classSubject:e.toString()}):f(Cee,{})})}function Cee(){const[e]=va("parentSubject"),{drive:t}=ot(),n=e||t,r=Ce(n),[i,o]=w.useState(void 0),[a,s]=w.useState(),u=Ce(a),[l]=ye(u,J.properties.shortname),c=_t(),h=[J.classes.folder,J.classes.document,J.classes.chatRoom,J.classes.bookmark,J.classes.class,J.classes.property];function p(g){if(!a){o(new Error("Please select a class"));return}g.preventDefault(),c(Ry(a,n))}const y=w.useCallback(g=>{dt.success(`Uploaded ${g.length} files.`),e&&c($t(e))},[e,c]);return M(_ee,{onSubmit:p,children:[M("h1",{children:["Create new resource"," ",e&&M(be,{children:["under ",f(Yt,{subject:e})]})]}),f("div",{children:f(Hu,{setSubject:s,value:a,error:i,setError:o,classType:J.classes.class})}),M(Ut,{wrapItems:!0,children:[a&&M(ve,{onClick:p,children:["new ",l]}),!a&&f(be,{children:h.map(g=>f(Eee,{classType:g,parent:n},g))})]}),f(C2,{parentResource:r,onFilesUploaded:y})]})}const _ee=B.form.withConfig({displayName:"StyledForm",componentId:"sc-1l69bzo-0"})(["display:flex;flex-direction:column;gap:","rem;"],({theme:e})=>e.margin);function Eee({classType:e,parent:t}){const n=Ce(e),[r]=Xe(n);return f(du,{icon:!0,IconComponent:zu(e),klass:e,parent:t,label:r,subtle:!0})}function Dp(){return(Dp=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function X1(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var ku=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:_.buttons>0)&&i.current?o(S6(i.current,_,s.current)):b(!1)},g=function(){return b(!1)};function b(_){var S=u.current,k=_?self.addEventListener:self.removeEventListener;k(S?"touchmove":"mousemove",y),k(S?"touchend":"mouseup",g)}return[function(_){var S=_.nativeEvent,k=i.current;if(k&&(k6(S),!function(d,v){return v&&!Ml(d)}(S,u.current)&&k)){if(Ml(S)){u.current=!0;var C=S.changedTouches||[];C.length&&(s.current=C[0].identifier)}k.focus(),o(S6(k,S,s.current)),b(!0)}},function(_){var S=_.which||_.keyCode;S<37||S>40||(_.preventDefault(),a({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},b]},[a,o]),c=l[0],h=l[1],p=l[2];return w.useEffect(function(){return p},[p]),de.createElement("div",Dp({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),N2=function(e){return e.filter(Boolean).join(" ")},x9=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=N2(["react-colorful__pointer",e.className]);return de.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},de.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},qn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},zg=function(e){return e[0]==="#"&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}},Ree=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:qn(e.h),s:qn(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:qn(i/2),a:qn(r,2)}},Q1=function(e){var t=Ree(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Aee=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),u=r*(1-(1-t+o)*n),l=o%6;return{r:qn(255*[r,s,a,a,u,r][l]),g:qn(255*[u,r,r,s,a,a][l]),b:qn(255*[a,a,u,r,r,s][l]),a:qn(i,2)}},jg=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Tee=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:qn(60*(s<0?s+6:s)),s:qn(o?a/o*100:0),v:qn(o/255*100),a:i}},Pee=de.memo(function(e){var t=e.hue,n=e.onChange,r=N2(["react-colorful__hue",e.className]);return de.createElement("div",{className:r},de.createElement(k9,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:ku(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuetext":qn(t)},de.createElement(x9,{className:"react-colorful__hue-pointer",left:t/360,color:Q1({h:t,s:100,v:100,a:1})})))}),Iee=de.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Q1({h:t.h,s:100,v:100,a:1})};return de.createElement("div",{className:"react-colorful__saturation",style:r},de.createElement(k9,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:ku(t.s+100*i.left,0,100),v:ku(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+qn(t.s)+"%, Brightness "+qn(t.v)+"%"},de.createElement(x9,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Q1(t)})))}),C9=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Oee(e,t,n){var r=X1(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var l=e.toHsva(t);s.current={hsva:l,color:t},a(l)}},[t,e]),w.useEffect(function(){var l;C9(o,s.current.hsva)||e.equal(l=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:l},r(l))},[o,e,r]);var u=w.useCallback(function(l){a(function(c){return Object.assign({},c,l)})},[]);return[o,u]}var Qc,Lee=typeof window<"u"?w.useLayoutEffect:w.useEffect,Dee=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Mee=function(){Lee(function(){if(typeof document<"u"&&!Qc){(Qc=document.createElement("style")).innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var e=Dee();e&&Qc.setAttribute("nonce",e),document.head.appendChild(Qc)}},[])},Nee=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=S9(e,["className","colorModel","color","onChange"]);Mee();var s=Oee(n,i,o),u=s[0],l=s[1],c=N2(["react-colorful",t]);return de.createElement("div",Dp({},a,{className:c}),de.createElement(Iee,{hsva:u,onChange:l}),de.createElement(Pee,{hue:u.h,onChange:l,className:"react-colorful__last-control"}))},zee={defaultColor:"000",toHsva:function(e){return Tee(zg(e))},fromHsva:function(e){return n=(t=Aee(e)).g,r=t.b,"#"+jg(t.r)+jg(n)+jg(r);var t,n,r},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||C9(zg(e),zg(t))}},jee=function(e){return de.createElement(Nee,Dp({},e,{colorModel:zee}))};function Bg({top:e,floating:t,title:n}){const{navbarTop:r,setNavbarTop:i,navbarFloating:o,setNavbarFloating:a}=ot();return f(Bee,{title:n,current:r===e&&o===t,onClick:()=>{i(e),a(t)},children:f("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t?f("rect",{x:"10",y:"60",width:"60",height:"10",rx:"5"}):f("rect",{x:"0",y:e?"0":"70",width:"80",height:"10"})})})}const Bee=B.button.withConfig({displayName:"NavStyleButtonStyling",componentId:"sc-17dvmt7-0"})(["rect{fill:",";}&:hover{border-color:",";}&:active{border-color:",";}background-color:",";cursor:pointer;border:solid 1px ",";border-radius:",";padding:0;overflow:hidden;line-height:0;"],e=>e.current?e.theme.colors.main:e.theme.colors.bg2,e=>e.theme.colors.mainLight,e=>e.theme.colors.mainDark,e=>e.theme.colors.bg,e=>e.current?e.theme.colors.mainLight:e.theme.colors.bg2,e=>e.theme.radius);function Fee({checked:e,onChange:t,...n}){return f($ee,{type:"checkbox",checked:e,onChange:i=>{t(i.target.checked)},...n})}const $ee=B.input.withConfig({displayName:"InputCheckBox",componentId:"sc-1ojbznu-0"})(["--inset:1px;--size:calc(100% - (var(--inset) * 2));background-color:",";appearance:none;border:1px solid ",";width:1rem;height:1rem;border-radius:3px;position:relative;:checked{border:none;}:checked::before{content:'';position:absolute;inset:0;width:100%;height:100%;border-radius:2px;background-color:",";}:checked::after{--inset:3px;--size:calc(100% - (var(--inset) * 2));content:'';position:absolute;inset:var(--inset);width:var(--size);height:var(--size);background-color:",";clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0%,43% 62%);}"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.main,e=>e.theme.colors.bg),Uee=B.label.withConfig({displayName:"CheckboxLabel",componentId:"sc-1ojbznu-1"})(["display:flex;align-items:center;gap:0.5rem;cursor:pointer;"]),Hee=()=>{const{darkModeSetting:e,setDarkMode:t,viewTransitionsEnabled:n,setViewTransitionsEnabled:r}=ot();return M(Ot,{children:[f("h1",{children:"Theme Settings"}),M(ai,{children:[f(Jc,{children:"Dark mode"}),M(Ut,{children:[f(ve,{subtle:e!==Rl.auto,onClick:()=>t(void 0),title:"Use the browser's / OS dark mode settings",children:"🌓 auto"}),f(ve,{subtle:e!==Rl.always,onClick:()=>t(!0),children:"🌑 on"}),f(ve,{subtle:e!==Rl.never,onClick:()=>t(!1),children:"🌕 off"})]}),f(Jc,{children:"Navigation bar position"}),M(Ut,{children:[f(Bg,{floating:!0,top:!1,title:"Floating"}),f(Bg,{floating:!1,top:!1,title:"Bottom"}),f(Bg,{floating:!1,top:!0,title:"Top"})]}),f(Jc,{children:"Main color"}),f(Wee,{}),f(Jc,{children:"Animations"}),M(Uee,{children:[f(Fee,{checked:n,onChange:i=>r(i)})," ","Enable view transitions"]})]})]})},Wee=()=>{const{mainColor:e,setMainColor:t}=ot();return f(jee,{color:e,onChange:n=>t(n)})},Jc=B.h2.withConfig({displayName:"Heading",componentId:"sc-syovf1-0"})(["font-size:1em;margin:0;margin-top:1rem;"]);function Vee(){const[e]=Ur(),t=Ce(e),[n,r]=w.useState(void 0),i=_t();function o(a){if(a.preventDefault(),!n)throw new Error("No subject input");i(Ry(n))}return M(be,{children:[f(h9,{resource:t}),f(Ot,{children:e?M(be,{children:[f(Gu,{resource:t,prefix:"Edit"}),f(b2,{resource:t}),f(sp,{resource:t},e)]}):M("form",{onSubmit:o,children:[f("h1",{children:"edit a resource"}),f(Xn,{value:n||void 0,onChange:a=>r(a.target.value),placeholder:"Enter a Resource URL..."})]})})]})}function qee({resource:e}){const[t,n]=de.useState(!1);return M(be,{children:[M(ve,{onClick:()=>n(!t),children:[t?f(wy,{}):f(Sy,{})," children"]}),t&&f(Kee,{resource:e})]})}function Kee({resource:e}){const t=Ek(e);return f(Lo,{children:f(ys,{children:t.map(n=>f(Do,{children:f(Yt,{subject:n})},n))})})}function Gee(){const[e]=Ur(),t=Ce(e),[n,r]=w.useState(void 0),[i,o]=w.useState(!1),[a,s]=w.useState(void 0),{agent:u}=ot(),l=Ke();if(t.loading)return M(Ot,{children:["Loading ",e,"..."]});if(t.error)return f(Ot,{children:f(Nt,{children:t.error.message})});async function c(h){let p={};p.Accept=h,u&&(p=await $0(e,u,p)),o(!0);try{const g=await(await window.fetch(e,{headers:p})).text();o(!1),r(g),s(void 0)}catch(y){o(!1),s(y)}}return M(Ot,{about:e,children:[f(Gu,{resource:t,prefix:"Data for",link:!0}),M(Ed,{columns:!0,children:[f(Rd,{title:"The URL of the resource",children:"subject:"}),f(We,{subject:e,children:e})]}),f(Ps,{resource:t,editable:!0,columns:!0}),f(qee,{resource:t}),t.getCommitBuilder().hasUnsavedChanges()?M(be,{children:[f("h2",{children:"⚠️ contains uncommitted changes"}),f("p",{children:"This means that (some) of your local changes are not yet saved."}),t.commitError&&f(xt,{children:t.commitError.message}),f(ve,{onClick:()=>t.save(l),children:"save"})]}):null,M(Ut,{wrapItems:!0,children:[f(ve,{subtle:!0,onClick:()=>c("application/ad+json"),"data-test":"fetch-json-ad",children:"JSON-AD"}),f(ve,{subtle:!0,onClick:()=>c("application/json"),"data-test":"fetch-json",children:"JSON"}),f(ve,{subtle:!0,onClick:()=>c("application/ld+json"),"data-test":"fetch-json-ld",children:"JSON-LD"}),f(ve,{subtle:!0,onClick:()=>c("text/turtle"),"data-test":"fetch-turtle",children:"Turtle / N-triples / N3"})]}),a&&f(xt,{children:a.message}),!a&&n&&f(Lp,{content:n,loading:i})]})}const Yee=()=>M(Ot,{children:[f("h1",{children:"Keyboard shortcuts"}),f("h3",{children:"Global"}),M("p",{children:[f(or,{shortcut:st.search})," Search"]}),M("p",{children:[f(or,{shortcut:st.sidebarToggle})," Show or hide the sidebar"]}),M("p",{children:[f(or,{shortcut:"?"})," Show these keyboard shortcuts"]}),M("p",{children:[f(or,{shortcut:st.edit})," ",f("b",{children:"E"}),"dit resource"]}),M("p",{children:[f(or,{shortcut:st.data})," Show ",f("b",{children:"d"}),"ata for resource"]}),M("p",{children:[f(or,{shortcut:st.home})," Show ",f("b",{children:"h"}),"ome page"]}),M("p",{children:[f(or,{shortcut:st.new})," ",f("b",{children:"N"}),"ew resource"]}),M("p",{children:[f(or,{shortcut:st.menu})," Open ",f("b",{children:"m"}),"enu"]}),M("p",{children:[f(or,{shortcut:st.userSettings})," ",f("b",{children:"U"}),"ser settings"]}),M("p",{children:[f(or,{shortcut:st.themeSettings})," ",f("b",{children:"T"}),"heme settings"]}),f("h3",{children:"Document"}),M("p",{children:[f(or,{shortcut:st.moveLineUp})," Move line / section up"]}),M("p",{children:[f(or,{shortcut:st.moveLineDown})," Move line / section down"]}),M("p",{children:[f(or,{shortcut:st.deleteLine})," Delete line"]})]}),or=B(Px).withConfig({displayName:"Key",componentId:"sc-qpxn53-0"})(["font-size:1rem;"]);function Xee(){const{pathname:e,search:t}=ka(),n=window.location.origin+e+t;return f(M2,{subject:n},n)}const Qee=()=>{var m;const{agent:e,setAgent:t}=ot(),[n,r]=w.useState(void 0),[i,o]=w.useState(void 0),[a,s]=w.useState(void 0),[u,l]=w.useState(!1),[c,h]=w.useState(!1),[p,y]=w.useState(void 0),g=_t();w.useEffect(()=>{e!==void 0?_():y("")},[e]),w.useEffect(()=>{b()},[n,i]);function b(){e&&y(e.buildSecret())}function _(){try{if(!e)throw new Error("No agent set");r(e.subject),o(e.privateKey)}catch(x){const A=new Error("Cannot fill subject and privatekey fields."+x);s(A),r("")}}function S(){window.confirm("If you sign out, your secret will be removed. If you haven't saved your secret somewhere, you will lose access to this User. Are you sure you want to sign out?")&&(t(void 0),s(void 0),r(""),o(""))}function k(x,A){JSON.stringify(x)!==JSON.stringify(A)&&t(A)}async function C(){b(),s(void 0);try{const x=new of(i,n);await x.getPublicKey(),await x.verifyPublicKeyWithServer(),k(e,x)}catch(x){const A=new Error("Invalid Agent"+x);s(A)}}function d(){p&&navigator.clipboard.writeText(p)}async function v(x){if(y(x),x===""){y(""),s(void 0);return}s(void 0);try{const A=of.fromSecret(x);k(e,A),o(A.privateKey),r(A.subject)}catch(A){const L=new Error("Invalid secret. "+A);s(L)}}return f(Ot,{children:M("form",{children:[f("h1",{children:"User Settings"}),f("p",{children:"An Agent is a user, consisting of a Subject (its URL) and Private Key. Together, these can be used to edit data and sign Commits."}),e?M(be,{children:[((m=e.subject)==null?void 0:m.startsWith("http://localhost"))&&M("p",{children:[f(Nt,{children:"Warning:"}),"You're using a local Agent, which cannot authenticate on other domains, because its URL does not resolve."]}),M(Kx,{children:[f(ux,{})," You","'","re signed in as"]}),f("p",{children:f(Yt,{subject:e.subject})}),f(ve,{onClick:()=>g(Hh(e.subject)),children:"Edit profile"}),f(eY,{})]}):M("p",{children:["You can create your own Agent by hosting an"," ",f(We,{href:"https://github.com/atomicdata-dev/atomic-data-rust/tree/master/server",children:"atomic-server"}),". Alternatively, you can use"," ",f(We,{subject:"https://atomicdata.dev/invites",children:"an Invite"})," ","to get a guest Agent on someone else","'s"," Atomic Server."]}),f(ni,{label:e?"Agent Secret":"Enter your Agent Secret",helper:"The Agent Secret is a long string of characters that encodes both the Subject and the Private Key. You can think of it as a combined username + password. Store it safely, and don't share it with others.",error:a,children:M(un,{children:[f(Xn,{value:p,onChange:x=>v(x.target.value),type:u?"text":"password",disabled:e!==void 0,name:"secret",id:"current-password",autoComplete:"current-password",spellCheck:"false"}),f(ta,{type:"button",title:u?"Hide secret":"Show secret",onClick:()=>l(!u),children:u?f(aw,{}):f(a1,{})}),f(ta,{type:"button",title:c?"Hide advanced":"Show advanced",onClick:()=>h(!c),children:f(ky,{})}),e&&f(ta,{type:"button",onClick:d,children:"copy"})]})}),c?M(w.Fragment,{children:[f(ni,{label:"Subject URL",helper:"The link to your Agent, e.g. https://atomicdata.dev/agents/someAgent",children:f(un,{children:f(Xn,{disabled:e!==void 0,value:n,onChange:x=>{r(x.target.value),C()}})})}),f(ni,{label:"Private Key",helper:"The private key of the Agent, which is a Base64 encoded string.",children:M(un,{children:[f(Xn,{disabled:e!==void 0,type:u?"text":"password",value:i,onChange:x=>{o(x.target.value),C()}}),f(ta,{type:"button",title:u?"Hide private key":"Show private key",onClick:()=>l(!u),children:u?f(aw,{}):f(a1,{})})]})})]}):null,e&&f(ve,{subtle:!0,title:"Sign out with current Agent and reset this form",onClick:S,"data-test":"sign-out",children:"sign out"})]})})};function Jee(e){const t=document.getElementById(e);if(t)return t;const n=document.createElement("style");return n.setAttribute("id",e),document.head.appendChild(n),n}function Zee(e,t){const n=Jee(e);n.innerHTML=t}function ete(e,t,n){return i=>{const o=`cq-${e}`;if(w.useInsertionEffect(()=>{const u=` + `},VX={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function WX(e){let{announcements:t=VX,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=UX}=e;const{announce:o,announcement:a}=FX(),s=Xu("DndLiveRegion"),[u,l]=w.useState(!1);if(w.useEffect(()=>{l(!0)},[]),$X(w.useMemo(()=>({onDragStart(h){let{active:p}=h;o(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:y}=h;t.onDragMove&&o(t.onDragMove({active:p,over:y}))},onDragOver(h){let{active:p,over:y}=h;o(t.onDragOver({active:p,over:y}))},onDragEnd(h){let{active:p,over:y}=h;o(t.onDragEnd({active:p,over:y}))},onDragCancel(h){let{active:p,over:y}=h;o(t.onDragCancel({active:p,over:y}))}}),[o,t])),!u)return null;const c=O(ye,{children:[f(zX,{id:r,value:i.draggable}),f(BX,{id:s,announcement:a})]});return n?Mr.createPortal(c,n):c}var Zt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Zt||(Zt={}));function Jf(){}function a6(e,t){return w.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function qX(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter(r=>r!=null),[...t])}const li=Object.freeze({x:0,y:0});function F7(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $7(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function KX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function s6(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function H7(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function l6(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const GX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=l6(t,t.left,t.top),o=[];for(const a of r){const{id:s}=a,u=n.get(s);if(u){const l=F7(l6(u),i);o.push({id:s,data:{droppableContainer:a,value:l}})}}return o.sort($7)},YX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=s6(t),o=[];for(const a of r){const{id:s}=a,u=n.get(s);if(u){const l=s6(u),c=i.reduce((p,y,g)=>p+F7(l[g],y),0),h=Number((c/4).toFixed(4));o.push({id:s,data:{droppableContainer:a,value:h}})}}return o.sort($7)};function XX(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const u=XX(s,t);u>0&&i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(KX)};function JX(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function U7(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:li}function ZX(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o({...a,top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),{...n})}}const eQ=ZX(1);function tQ(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function nQ(e,t,n){const r=tQ(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,u=e.left-a-(1-i)*parseFloat(n),l=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,h=o?e.height/o:e.height;return{width:c,height:h,top:l,right:u+c,bottom:l+h,left:u}}const rQ={ignoreTransform:!1};function zs(e,t){t===void 0&&(t=rQ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:l}=nr(e),{transform:c,transformOrigin:h}=l(e);c&&(n=nQ(n,c,h))}const{top:r,left:i,width:o,height:a,bottom:s,right:u}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:u}}function u6(e){return zs(e,{ignoreTransform:!0})}function iQ(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function oQ(e,t){return t===void 0&&(t=nr(e).getComputedStyle(e)),t.position==="fixed"}function aQ(e,t){t===void 0&&(t=nr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function Ip(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(D2(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Gu(i)||IX(i)||n.includes(i))return n;const{getComputedStyle:o}=nr(i),a=o(i);return i!==e&&aQ(i,a)&&n.push(i),oQ(i,a)?n:r(i.parentNode)}return e?r(e):n}function V7(e){const[t]=Ip(e,1);return t??null}function Dg(e){return!Pp||!e?null:Ns(e)?e:L2(e)?D2(e)||e===Ms(e).scrollingElement?window:Gu(e)?e:null:null}function W7(e){return Ns(e)?e.scrollX:e.scrollLeft}function q7(e){return Ns(e)?e.scrollY:e.scrollTop}function W1(e){return{x:W7(e),y:q7(e)}}var an;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(an||(an={}));function K7(e){return!Pp||!e?!1:e===document.scrollingElement}function G7(e){const t={x:0,y:0},n=K7(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const sQ={x:.2,y:.2};function lQ(e,t,n,r,i){let{top:o,left:a,right:s,bottom:u}=n;r===void 0&&(r=10),i===void 0&&(i=sQ);const{isTop:l,isBottom:c,isLeft:h,isRight:p}=G7(e),y={x:0,y:0},g={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!l&&o<=t.top+b.height?(y.y=an.Backward,g.y=r*Math.abs((t.top+b.height-o)/b.height)):!c&&u>=t.bottom-b.height&&(y.y=an.Forward,g.y=r*Math.abs((t.bottom-b.height-u)/b.height)),!p&&s>=t.right-b.width?(y.x=an.Forward,g.x=r*Math.abs((t.right-b.width-s)/b.width)):!h&&a<=t.left+b.width&&(y.x=an.Backward,g.x=r*Math.abs((t.left+b.width-a)/b.width)),{direction:y,speed:g}}function uQ(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Y7(e){return e.reduce((t,n)=>cs(t,W1(n)),li)}function cQ(e){return e.reduce((t,n)=>t+W7(n),0)}function dQ(e){return e.reduce((t,n)=>t+q7(n),0)}function fQ(e,t){if(t===void 0&&(t=zs),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);V7(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const hQ=[["x",["left","right"],cQ],["y",["top","bottom"],dQ]];class z2{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ip(n),i=Y7(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,s]of hQ)for(const u of a)Object.defineProperty(this,u,{get:()=>{const l=s(r),c=i[o]-l;return this.rect[u]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ll{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function pQ(e){const{EventTarget:t}=nr(e);return e instanceof t?e:Ms(e)}function Ng(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ir;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ir||(Ir={}));function c6(e){e.preventDefault()}function mQ(e){e.stopPropagation()}var Je;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Je||(Je={}));const X7={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter]},gQ=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Je.Right:return{...n,x:n.x+25};case Je.Left:return{...n,x:n.x-25};case Je.Down:return{...n,y:n.y+25};case Je.Up:return{...n,y:n.y-25}}};class j2{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ll(Ms(n)),this.windowListeners=new Ll(nr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ir.Resize,this.handleCancel),this.windowListeners.add(Ir.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ir.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&fQ(r),n(li)}handleKeyDown(t){if(M2(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=X7,coordinateGetter:a=gQ,scrollBehavior:s="smooth"}=i,{code:u}=t;if(o.end.includes(u)){this.handleEnd(t);return}if(o.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:l}=r.current,c=l?{x:l.left,y:l.top}:li;this.referenceCoordinates||(this.referenceCoordinates=c);const h=a(t,{active:n,context:r.current,currentCoordinates:c});if(h){const p=wu(h,c),y={x:0,y:0},{scrollableAncestors:g}=r.current;for(const b of g){const _=t.code,{isTop:S,isRight:k,isLeft:C,isBottom:d,maxScroll:v,minScroll:m}=G7(b),x=uQ(b),A={x:Math.min(_===Je.Right?x.right-x.width/2:x.right,Math.max(_===Je.Right?x.left:x.left+x.width/2,h.x)),y:Math.min(_===Je.Down?x.bottom-x.height/2:x.bottom,Math.max(_===Je.Down?x.top:x.top+x.height/2,h.y))},D=_===Je.Right&&!k||_===Je.Left&&!C,P=_===Je.Down&&!d||_===Je.Up&&!S;if(D&&A.x!==h.x){const L=b.scrollLeft+p.x,W=_===Je.Right&&L<=v.x||_===Je.Left&&L>=m.x;if(W&&!p.y){b.scrollTo({left:L,behavior:s});return}W?y.x=b.scrollLeft-L:y.x=_===Je.Right?b.scrollLeft-v.x:b.scrollLeft-m.x,y.x&&b.scrollBy({left:-y.x,behavior:s});break}else if(P&&A.y!==h.y){const L=b.scrollTop+p.y,W=_===Je.Down&&L<=v.y||_===Je.Up&&L>=m.y;if(W&&!p.x){b.scrollTo({top:L,behavior:s});return}W?y.y=b.scrollTop-L:y.y=_===Je.Down?b.scrollTop-v.y:b.scrollTop-m.y,y.y&&b.scrollBy({top:-y.y,behavior:s});break}}this.handleMove(t,cs(wu(h,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}j2.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=X7,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function d6(e){return Boolean(e&&"distance"in e)}function f6(e){return Boolean(e&&"delay"in e)}class B2{constructor(t,n,r){var i;r===void 0&&(r=pQ(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Ms(a),this.documentListeners=new Ll(this.document),this.listeners=new Ll(r),this.windowListeners=new Ll(nr(a)),this.initialCoordinates=(i=V1(o))!=null?i:li,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Ir.Resize,this.handleCancel),this.windowListeners.add(Ir.DragStart,c6),this.windowListeners.add(Ir.VisibilityChange,this.handleCancel),this.windowListeners.add(Ir.ContextMenu,c6),this.documentListeners.add(Ir.Keydown,this.handleKeydown),n){if(d6(n))return;if(f6(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ir.Click,mQ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ir.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const u=(n=V1(t))!=null?n:li,l=wu(i,u);if(!r&&s){if(f6(s))return Ng(l,s.tolerance)?this.handleCancel():void 0;if(d6(s))return s.tolerance!=null&&Ng(l,s.tolerance)?this.handleCancel():Ng(l,s.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),a(u)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const vQ={move:{name:"pointermove"},end:{name:"pointerup"}};class F2 extends B2{constructor(t){const{event:n}=t,r=Ms(n.target);super(t,vQ,r)}}F2.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const yQ={move:{name:"mousemove"},end:{name:"mouseup"}};var q1;(function(e){e[e.RightClick=2]="RightClick"})(q1||(q1={}));class bQ extends B2{constructor(t){super(t,yQ,Ms(t.event.target))}}bQ.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===q1.RightClick?!1:(r==null||r({event:n}),!0)}}];const Mg={move:{name:"touchmove"},end:{name:"touchend"}};class wQ extends B2{constructor(t){super(t,Mg)}static setup(){return window.addEventListener(Mg.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Mg.move.name,t)};function t(){}}}wQ.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Dl;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Dl||(Dl={}));var Zf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zf||(Zf={}));function SQ(e){let{acceleration:t,activator:n=Dl.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=Zf.TreeOrder,pointerCoordinates:u,scrollableAncestors:l,scrollableAncestorRects:c,delta:h,threshold:p}=e;const y=xQ({delta:h,disabled:!o}),[g,b]=OX(),_=w.useRef({x:0,y:0}),S=w.useRef({x:0,y:0}),k=w.useMemo(()=>{switch(n){case Dl.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Dl.DraggableRect:return i}},[n,i,u]),C=w.useRef(null),d=w.useCallback(()=>{const m=C.current;if(!m)return;const x=_.current.x*S.current.x,A=_.current.y*S.current.y;m.scrollBy(x,A)},[]),v=w.useMemo(()=>s===Zf.TreeOrder?[...l].reverse():l,[s,l]);w.useEffect(()=>{if(!o||!l.length||!k){b();return}for(const m of v){if((r==null?void 0:r(m))===!1)continue;const x=l.indexOf(m),A=c[x];if(!A)continue;const{direction:D,speed:P}=lQ(m,A,k,t,p);for(const L of["x","y"])y[L][D[L]]||(P[L]=0,D[L]=0);if(P.x>0||P.y>0){b(),C.current=m,g(d,a),_.current=P,S.current=D;return}}_.current={x:0,y:0},S.current={x:0,y:0},b()},[t,d,r,b,o,a,JSON.stringify(k),JSON.stringify(y),g,l,v,c,JSON.stringify(p)])}const kQ={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};function xQ(e){let{delta:t,disabled:n}=e;const r=U1(t);return Yu(i=>{if(n||!r||!i)return kQ;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[an.Backward]:i.x[an.Backward]||o.x===-1,[an.Forward]:i.x[an.Forward]||o.x===1},y:{[an.Backward]:i.y[an.Backward]||o.y===-1,[an.Forward]:i.y[an.Forward]||o.y===1}}},[n,t,r])}function CQ(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Yu(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function _Q(e,t){return w.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var ku;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ku||(ku={}));var K1;(function(e){e.Optimized="optimized"})(K1||(K1={}));const h6=new Map;function EQ(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=w.useState(null),s=o!=null,{frequency:u,measure:l,strategy:c}=i,h=w.useRef(e),p=S(),y=bu(p),g=w.useCallback(function(k){k===void 0&&(k=[]),!y.current&&a(C=>C?C.concat(k):k)},[y]),b=w.useRef(null),_=Yu(k=>{if(p&&!n)return h6;const C=o;if(!k||k===h6||h.current!==e||C!=null){const d=new Map;for(let v of e){if(!v)continue;if(C&&C.length>0&&!C.includes(v.id)&&v.rect.current){d.set(v.id,v.rect.current);continue}const m=v.node.current,x=m?new z2(l(m),m):null;v.rect.current=x,x&&d.set(v.id,x)}return d}return k},[e,o,n,p,l]);return w.useEffect(()=>{h.current=e},[e]),w.useEffect(()=>{p||requestAnimationFrame(()=>g())},[n,p]),w.useEffect(()=>{s&&a(null)},[s]),w.useEffect(()=>{p||typeof u!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},u))},[u,p,g,...r]),{droppableRects:_,measureDroppableContainers:g,measuringScheduled:s};function S(){switch(c){case ku.Always:return!1;case ku.BeforeDragging:return n;default:return!n}}}function Q7(e,t){return Yu(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function RQ(e,t){return Q7(e,t)}function AQ(e){let{callback:t,disabled:n}=e;const r=N2(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Op(e){let{callback:t,disabled:n}=e;const r=N2(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function TQ(e){return new z2(zs(e),e)}function p6(e,t,n){t===void 0&&(t=TQ);const[r,i]=w.useReducer(s,null),o=AQ({callback(u){if(e)for(const l of u){const{type:c,target:h}=l;if(c==="childList"&&h instanceof HTMLElement&&h.contains(e)){i();break}}}}),a=Op({callback:i});return si(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r;function s(u){if(!e)return null;if(e.isConnected===!1){var l;return(l=u??n)!=null?l:null}const c=t(e);return JSON.stringify(u)===JSON.stringify(c)?u:c}}function PQ(e){const t=Q7(e);return U7(e,t)}const m6=[];function IQ(e){const t=w.useRef(e),n=Yu(r=>e?r&&r!==m6&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ip(e):m6,[e]);return w.useEffect(()=>{t.current=e},[e]),n}function OQ(e){const[t,n]=w.useState(null),r=w.useRef(e),i=w.useCallback(o=>{const a=Dg(o.target);a&&n(s=>s?(s.set(a,W1(a)),new Map(s)):null)},[]);return w.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(u=>{const l=Dg(u);return l?(l.addEventListener("scroll",i,{passive:!0}),[l,W1(l)]):null}).filter(u=>u!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(u=>{const l=Dg(u);l==null||l.removeEventListener("scroll",i)})}},[i,e]),w.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>cs(o,a),li):Y7(e):li,[e,t])}function g6(e,t){t===void 0&&(t=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},t),w.useEffect(()=>{const r=e!==li;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?wu(e,n.current):li}function LQ(e){w.useEffect(()=>{if(!Pp)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function DQ(e,t){return w.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function J7(e){return w.useMemo(()=>e?iQ(e):null,[e])}const zg=[];function NQ(e,t){t===void 0&&(t=zs);const[n]=e,r=J7(n?nr(n):null),[i,o]=w.useReducer(s,zg),a=Op({callback:o});return e.length>0&&i===zg&&o(),si(()=>{e.length?e.forEach(u=>a==null?void 0:a.observe(u)):(a==null||a.disconnect(),o())},[e]),i;function s(){return e.length?e.map(u=>K7(u)?r:new z2(t(u),u)):zg}}function MQ(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Gu(t)?t:e}function zQ(e){let{measure:t}=e;const[n,r]=w.useState(null),i=w.useCallback(l=>{for(const{target:c}of l)if(Gu(c)){r(h=>{const p=t(c);return h?{...h,width:p.width,height:p.height}:p});break}},[t]),o=Op({callback:i}),a=w.useCallback(l=>{const c=MQ(l);o==null||o.disconnect(),c&&(o==null||o.observe(c)),r(c?t(c):null)},[t,o]),[s,u]=Qf(a);return w.useMemo(()=>({nodeRef:s,rect:n,setRef:u}),[n,s,u])}const jQ=[{sensor:F2,options:{}},{sensor:j2,options:{}}],BQ={current:{}},Pd={draggable:{measure:u6},droppable:{measure:u6,strategy:ku.WhileDragging,frequency:K1.Optimized},dragOverlay:{measure:zs}};class Nl extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const FQ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Nl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Jf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Pd,measureDroppableContainers:Jf,windowRect:null,measuringScheduled:!1},$Q={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Jf,draggableNodes:new Map,over:null,measureDroppableContainers:Jf},Lp=w.createContext($Q),Z7=w.createContext(FQ);function HQ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Nl}}}function UQ(e,t){switch(t.type){case Zt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Zt.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Zt.DragEnd:case Zt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Zt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Nl(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Zt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Nl(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case Zt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Nl(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function VQ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=w.useContext(Lp),o=U1(r),a=U1(n==null?void 0:n.id);return w.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!M2(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:u,node:l}=s;if(!u.current&&!l.current)return;requestAnimationFrame(()=>{for(const c of[u.current,l.current]){if(!c)continue;const h=NX(c);if(h){h.focus();break}}})}},[r,t,i,a,o]),null}function WQ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function qQ(e){return w.useMemo(()=>({draggable:{...Pd.draggable,...e==null?void 0:e.draggable},droppable:{...Pd.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Pd.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function KQ(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=w.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;si(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const l=t==null?void 0:t.node.current;if(!l||l.isConnected===!1)return;const c=n(l),h=U7(c,r);if(a||(h.x=0),s||(h.y=0),o.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const p=V7(l);p&&p.scrollBy({top:h.y,left:h.x})}},[t,a,s,r,n])}const e9=w.createContext({...li,scaleX:1,scaleY:1});var co;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(co||(co={}));const GQ=w.memo(function(t){var n,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:l,sensors:c=jQ,collisionDetection:h=QX,measuring:p,modifiers:y,...g}=t;const b=w.useReducer(UQ,void 0,HQ),[_,S]=b,[k,C]=HX(),[d,v]=w.useState(co.Uninitialized),m=d===co.Initialized,{draggable:{active:x,nodes:A,translate:D},droppable:{containers:P}}=_,L=x?A.get(x):null,W=w.useRef({initial:null,translated:null}),U=w.useMemo(()=>{var Vt;return x!=null?{id:x,data:(Vt=L==null?void 0:L.data)!=null?Vt:BQ,rect:W}:null},[x,L]),j=w.useRef(null),[F,R]=w.useState(null),[q,$]=w.useState(null),K=bu(g,Object.values(g)),ee=Xu("DndDescribedBy",a),N=w.useMemo(()=>P.getEnabled(),[P]),I=qQ(p),{droppableRects:re,measureDroppableContainers:se,measuringScheduled:he}=EQ(N,{dragging:m,dependencies:[D.x,D.y],config:I.droppable}),V=CQ(A,x),ge=w.useMemo(()=>q?V1(q):null,[q]),te=or(),Oe=RQ(V,I.draggable.measure);KQ({activeNode:x?A.get(x):null,config:te.layoutShiftCompensation,initialRect:Oe,measure:I.draggable.measure});const pe=p6(V,I.draggable.measure,Oe),Me=p6(V?V.parentElement:null),xe=w.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=P.getNodeFor((n=xe.current.over)==null?void 0:n.id),Ke=zQ({measure:I.dragOverlay.measure}),De=(r=Ke.nodeRef.current)!=null?r:V,Xe=m?(i=Ke.rect)!=null?i:pe:null,ae=Boolean(Ke.nodeRef.current&&Ke.rect),Re=PQ(ae?null:pe),nt=J7(De?nr(De):null),ze=IQ(m?Ye??V:null),gt=NQ(ze),jt=WQ(y,{transform:{x:D.x-Re.x,y:D.y-Re.y,scaleX:1,scaleY:1},activatorEvent:q,active:U,activeNodeRect:pe,containerNodeRect:Me,draggingNodeRect:Xe,over:xe.current.over,overlayNodeRect:Ke.rect,scrollableAncestors:ze,scrollableAncestorRects:gt,windowRect:nt}),wt=ge?cs(ge,D):null,Ee=OQ(ze),rt=g6(Ee),rr=g6(Ee,[pe]),Ut=cs(jt,rt),X=Xe?eQ(Xe,jt):null,ce=U&&X?h({active:U,collisionRect:X,droppableRects:re,droppableContainers:N,pointerCoordinates:wt}):null,Te=H7(ce,"id"),[Be,Xt]=w.useState(null),Ri=ae?jt:cs(jt,rr),at=JX(Ri,(o=Be==null?void 0:Be.rect)!=null?o:null,pe),vt=w.useCallback((Vt,Rn)=>{let{sensor:An,options:_r}=Rn;if(j.current==null)return;const Bt=A.get(j.current);if(!Bt)return;const ar=Vt.nativeEvent,Er=new An({active:j.current,activeNode:Bt,event:ar,options:_r,context:xe,onStart(Tn){const Rr=j.current;if(Rr==null)return;const Qi=A.get(Rr);if(!Qi)return;const{onDragStart:Ji}=K.current,Fo={active:{id:Rr,data:Qi.data,rect:W}};Mr.unstable_batchedUpdates(()=>{Ji==null||Ji(Fo),v(co.Initializing),S({type:Zt.DragStart,initialCoordinates:Tn,active:Rr}),k({type:"onDragStart",event:Fo})})},onMove(Tn){S({type:Zt.DragMove,coordinates:Tn})},onEnd:Xi(Zt.DragEnd),onCancel:Xi(Zt.DragCancel)});Mr.unstable_batchedUpdates(()=>{R(Er),$(Vt.nativeEvent)});function Xi(Tn){return async function(){const{active:Qi,collisions:Ji,over:Fo,scrollAdjustedTranslate:Qu}=xe.current;let $o=null;if(Qi&&Qu){const{cancelDrop:Zi}=K.current;$o={activatorEvent:ar,active:Qi,collisions:Ji,delta:Qu,over:Fo},Tn===Zt.DragEnd&&typeof Zi=="function"&&await Promise.resolve(Zi($o))&&(Tn=Zt.DragCancel)}j.current=null,Mr.unstable_batchedUpdates(()=>{S({type:Tn}),v(co.Uninitialized),Xt(null),R(null),$(null);const Zi=Tn===Zt.DragEnd?"onDragEnd":"onDragCancel";if($o){const Bs=K.current[Zi];Bs==null||Bs($o),k({type:Zi,event:$o})}})}}},[A]),Cr=w.useCallback((Vt,Rn)=>(An,_r)=>{const Bt=An.nativeEvent,ar=A.get(_r);if(j.current!==null||!ar||Bt.dndKit||Bt.defaultPrevented)return;const Er={active:ar};Vt(An,Rn.options,Er)===!0&&(Bt.dndKit={capturedBy:Rn.sensor},j.current=_r,vt(An,Rn))},[A,vt]),ir=_Q(c,Cr);LQ(c),si(()=>{pe&&d===co.Initializing&&v(co.Initialized)},[pe,d]),w.useEffect(()=>{const{onDragMove:Vt}=K.current,{active:Rn,activatorEvent:An,collisions:_r,over:Bt}=xe.current;if(!Rn||!An)return;const ar={active:Rn,activatorEvent:An,collisions:_r,delta:{x:Ut.x,y:Ut.y},over:Bt};Mr.unstable_batchedUpdates(()=>{Vt==null||Vt(ar),k({type:"onDragMove",event:ar})})},[Ut.x,Ut.y]),w.useEffect(()=>{const{active:Vt,activatorEvent:Rn,collisions:An,droppableContainers:_r,scrollAdjustedTranslate:Bt}=xe.current;if(!Vt||j.current==null||!Rn||!Bt)return;const{onDragOver:ar}=K.current,Er=_r.get(Te),Xi=Er&&Er.rect.current?{id:Er.id,rect:Er.rect.current,data:Er.data,disabled:Er.disabled}:null,Tn={active:Vt,activatorEvent:Rn,collisions:An,delta:{x:Bt.x,y:Bt.y},over:Xi};Mr.unstable_batchedUpdates(()=>{Xt(Xi),ar==null||ar(Tn),k({type:"onDragOver",event:Tn})})},[Te]),si(()=>{xe.current={activatorEvent:q,active:U,activeNode:V,collisionRect:X,collisions:ce,droppableRects:re,draggableNodes:A,draggingNode:De,draggingNodeRect:Xe,droppableContainers:P,over:Be,scrollableAncestors:ze,scrollAdjustedTranslate:Ut},W.current={initial:Xe,translated:X}},[U,V,ce,X,A,De,Xe,re,P,Be,ze,Ut]),SQ({...te,delta:D,draggingRect:X,pointerCoordinates:wt,scrollableAncestors:ze,scrollableAncestorRects:gt});const yt=w.useMemo(()=>({active:U,activeNode:V,activeNodeRect:pe,activatorEvent:q,collisions:ce,containerNodeRect:Me,dragOverlay:Ke,draggableNodes:A,droppableContainers:P,droppableRects:re,over:Be,measureDroppableContainers:se,scrollableAncestors:ze,scrollableAncestorRects:gt,measuringConfiguration:I,measuringScheduled:he,windowRect:nt}),[U,V,pe,q,ce,Me,Ke,A,P,re,Be,se,ze,gt,I,he,nt]),Yi=w.useMemo(()=>({activatorEvent:q,activators:ir,active:U,activeNodeRect:pe,ariaDescribedById:{draggable:ee},dispatch:S,draggableNodes:A,over:Be,measureDroppableContainers:se}),[q,ir,U,pe,S,ee,A,Be,se]);return O(B7.Provider,{value:C,children:[O(Lp.Provider,{value:Yi,children:[f(Z7.Provider,{value:yt,children:f(e9.Provider,{value:at,children:l})}),f(VQ,{disabled:(s==null?void 0:s.restoreFocus)===!1})]}),f(WX,{...s,hiddenTextDescribedById:ee})]});function or(){const Vt=(F==null?void 0:F.autoScrollEnabled)===!1,Rn=typeof u=="object"?u.enabled===!1:u===!1,An=m&&!Vt&&!Rn;return typeof u=="object"?{...u,enabled:An}:{enabled:An}}}),YQ=w.createContext(null),v6="button",XQ="Droppable";function QQ(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Xu(XQ),{activators:a,activatorEvent:s,active:u,activeNodeRect:l,ariaDescribedById:c,draggableNodes:h,over:p}=w.useContext(Lp),{role:y=v6,roleDescription:g="draggable",tabIndex:b=0}=i??{},_=(u==null?void 0:u.id)===t,S=w.useContext(_?e9:YQ),[k,C]=Qf(),[d,v]=Qf(),m=DQ(a,t),x=bu(n);si(()=>(h.set(t,{id:t,key:o,node:k,activatorNode:d,data:x}),()=>{const D=h.get(t);D&&D.key===o&&h.delete(t)}),[h,t]);const A=w.useMemo(()=>({role:y,tabIndex:b,"aria-disabled":r,"aria-pressed":_&&y===v6?!0:void 0,"aria-roledescription":g,"aria-describedby":c.draggable}),[r,y,b,_,g,c.draggable]);return{active:u,activatorEvent:s,activeNodeRect:l,attributes:A,isDragging:_,listeners:r?void 0:m,node:k,over:p,setNodeRef:C,setActivatorNodeRef:v,transform:S}}function JQ(){return w.useContext(Z7)}const ZQ="Droppable",eJ={timeout:25};function tJ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Xu(ZQ),{active:a,dispatch:s,over:u,measureDroppableContainers:l}=w.useContext(Lp),c=w.useRef({disabled:n}),h=w.useRef(!1),p=w.useRef(null),y=w.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:_}={...eJ,...i},S=bu(b??r),k=w.useCallback(()=>{if(!h.current){h.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{l(Array.isArray(S.current)?S.current:[S.current]),y.current=null},_)},[_]),C=Op({callback:k,disabled:g||!a}),d=w.useCallback((A,D)=>{C&&(D&&(C.unobserve(D),h.current=!1),A&&C.observe(A))},[C]),[v,m]=Qf(d),x=bu(t);return w.useEffect(()=>{!C||!v.current||(C.disconnect(),h.current=!1,C.observe(v.current))},[v,C]),si(()=>(s({type:Zt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:v,rect:p,data:x}}),()=>s({type:Zt.UnregisterDroppable,key:o,id:r})),[r]),w.useEffect(()=>{n!==c.current.disabled&&(s({type:Zt.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:p,isOver:(u==null?void 0:u.id)===r,node:v,over:u,setNodeRef:m}}function t9(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function nJ(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Qc(e){return e!==null&&e>=0}function rJ(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=t9(t,r,n),a=t[i],s=o[i];return!s||!a?null:{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}},Jc={scaleX:1,scaleY:1},oJ=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:a}=e;const s=(t=o[n])!=null?t:r;if(!s)return null;if(i===n){const l=o[a];return l?{x:0,y:nn&&i<=a?{x:0,y:-s.height-u,...Jc}:i=a?{x:0,y:s.height+u,...Jc}:{x:0,y:0,...Jc}};function aJ(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?nr.map(x=>typeof x=="object"&&"id"in x?x.id:x),[r]),b=a!=null,_=a?g.indexOf(a.id):-1,S=l?g.indexOf(l.id):-1,k=w.useRef(g),C=!rJ(g,k.current),d=S!==-1&&_===-1||C,v=iJ(o);si(()=>{C&&b&&!h&&c(g)},[C,g,b,c,h]),w.useEffect(()=>{k.current=g},[g]);const m=w.useMemo(()=>({activeIndex:_,containerId:p,disabled:v,disableTransforms:d,items:g,overIndex:S,useDragOverlay:y,sortedRects:nJ(g,u),strategy:i}),[_,p,v.draggable,v.droppable,d,g,S,u,y,i]);return f(i9.Provider,{value:m,children:t})}const lJ=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return t9(n,r,i).indexOf(t)},uJ=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:u,transition:l}=e;return!l||!r||s!==o&&i===a?!1:n?!0:a!==i&&t===u},cJ={duration:200,easing:"ease"},o9="transform",dJ=Su.Transition.toString({property:o9,duration:0,easing:"linear"}),fJ={roleDescription:"sortable"};function hJ(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=w.useState(null),s=w.useRef(n);return si(()=>{if(!t&&n!==s.current&&r.current){const u=i.current;if(u){const l=zs(r.current,{ignoreTransform:!0}),c={x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height};(c.x||c.y)&&a(c)}}n!==s.current&&(s.current=n)},[t,n,r,i]),w.useEffect(()=>{o&&requestAnimationFrame(()=>{a(null)})},[o]),o}function pJ(e){let{animateLayoutChanges:t=uJ,attributes:n,disabled:r,data:i,getNewIndex:o=lJ,id:a,strategy:s,resizeObserverConfig:u,transition:l=cJ}=e;const{items:c,containerId:h,activeIndex:p,disabled:y,disableTransforms:g,sortedRects:b,overIndex:_,useDragOverlay:S,strategy:k}=w.useContext(i9),C=mJ(r,y),d=c.indexOf(a),v=w.useMemo(()=>({sortable:{containerId:h,index:d,items:c},...i}),[h,i,d,c]),m=w.useMemo(()=>c.slice(c.indexOf(a)),[c,a]),{rect:x,node:A,isOver:D,setNodeRef:P}=tJ({id:a,data:v,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:m,...u}}),{active:L,activatorEvent:W,activeNodeRect:U,attributes:j,setNodeRef:F,listeners:R,isDragging:q,over:$,setActivatorNodeRef:K,transform:ee}=QQ({id:a,data:v,attributes:{...fJ,...n},disabled:C.draggable}),N=PX(P,F),I=Boolean(L),re=I&&!g&&Qc(p)&&Qc(_),se=!S&&q,he=se&&re?ee:null,ge=re?he??(s??k)({rects:b,activeNodeRect:U,activeIndex:p,overIndex:_,index:d}):null,te=Qc(p)&&Qc(_)?o({id:a,items:c,activeIndex:p,overIndex:_}):d,Oe=L==null?void 0:L.id,pe=w.useRef({activeId:Oe,items:c,newIndex:te,containerId:h}),Me=c!==pe.current.items,xe=t({active:L,containerId:h,isDragging:q,isSorting:I,id:a,index:d,items:c,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:l,wasDragging:pe.current.activeId!=null}),Ye=hJ({disabled:!xe,index:d,node:A,rect:x});return w.useEffect(()=>{I&&pe.current.newIndex!==te&&(pe.current.newIndex=te),h!==pe.current.containerId&&(pe.current.containerId=h),c!==pe.current.items&&(pe.current.items=c)},[I,te,h,c]),w.useEffect(()=>{if(Oe===pe.current.activeId)return;if(Oe&&!pe.current.activeId){pe.current.activeId=Oe;return}const De=setTimeout(()=>{pe.current.activeId=Oe},50);return()=>clearTimeout(De)},[Oe]),{active:L,activeIndex:p,attributes:j,data:v,rect:x,index:d,newIndex:te,items:c,isOver:D,isSorting:I,isDragging:q,listeners:R,node:A,overIndex:_,over:$,setNodeRef:N,setActivatorNodeRef:K,setDroppableNodeRef:P,setDraggableNodeRef:F,transform:Ye??ge,transition:Ke()};function Ke(){if(Ye||Me&&pe.current.newIndex===d)return dJ;if(!(se&&!M2(W)||!l)&&(I||xe))return Su.Transition.toString({...l,property:o9})}}function mJ(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function eh(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const gJ=[Je.Down,Je.Right,Je.Up,Je.Left],vJ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:s}}=t;if(gJ.includes(e.code)){if(e.preventDefault(),!n||!r)return;const u=[];o.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const p=i.get(h.id);if(p)switch(e.code){case Je.Down:r.topp.top&&u.push(h);break;case Je.Left:r.left>p.left&&u.push(h);break;case Je.Right:r.left1&&(c=l[1].id),c!=null){const h=o.get(n.id),p=o.get(c),y=p?i.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&y&&h&&p){const _=Ip(g).some((m,x)=>s[x]!==m),S=a9(h,p),k=yJ(h,p),C=_||!S?{x:0,y:0}:{x:k?r.width-y.width:0,y:k?r.height-y.height:0},d={x:y.left,y:y.top};return C.x&&C.y?d:wu(d,C)}}}};function a9(e,t){return!eh(e)||!eh(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function yJ(e,t){return!eh(e)||!eh(t)||!a9(e,t)?!1:e.data.current.sortable.index0&&!p.includes(He.elements.paragraph);function S(d){k(),l(void 0),h(d.target.value)}function k(){var d;(d=y.current)!=null&&d.style&&(y.current.style.height="0",y.current.style.height=y.current.scrollHeight+"px")}w.useEffect(()=>{k()},[y,c,o]),w.useEffect(()=>{var d,v;(d=y==null?void 0:y.current)==null||d.focus(),c&&((v=y==null?void 0:y.current)==null||v.setSelectionRange(c==null?void 0:c.length,c==null?void 0:c.length))},[o]),je("backspace",d=>{(o&&(c===""||c===void 0)||o&&_)&&(d.preventDefault(),t(n))},{enableOnTags:["TEXTAREA"],enabled:o},[n,c,o]),je(st.deleteLine,d=>{o&&(d.preventDefault(),t(n))},{enableOnTags:["TEXTAREA"],enabled:o},[n,o]);function C(){return u!=null&&u.message?f(Lt,{children:u.message}):o&&!g&&b?f(Lt,{children:b}):null}return _?O(Id,{canDrag:a,tabIndex:0,className:"element",active:o,onFocus:()=>r(n),onBlur:()=>r(-1),children:[f(Ku,{subject:e}),f(C,{})]}):o?O(Id,{canDrag:a,active:o,onClick:()=>n&&r(n),children:[f(xJ,{canDrag:a,"data-test":"element-input",className:"element",active:o,ref:y,onChange:S,onFocus:()=>r(n),onBlur:()=>r(-1),placeholder:`type something (try ${b6} or ${y6})`,autoFocus:o,value:c||""}),(c==null?void 0:c.startsWith(y6))&&f(CJ,{query:c.substring(1),setElement:d=>n&&i(n,d)}),(c==null?void 0:c.startsWith(b6))&&f(_J,{query:c.substring(1),setElement:d=>n&&i(n,d)}),(c==null?void 0:c.startsWith(bJ))&&f(ds,{children:f("p",{children:"[link text](https://example.com)"})}),(c==null?void 0:c.startsWith(wJ))&&O(ds,{children:[f("p",{children:"# Big Header"}),f("p",{children:"## Header"}),f("p",{children:"### Smaller Header"})]}),f(C,{})]}):O(Id,{canDrag:a,tabIndex:0,active:o,onFocus:()=>r(n),onBlur:()=>r(-1),children:[f(Gt,{text:c||"",noMargin:!0}),f(C,{})]})}function kJ({subject:e}){const t=Ce(e),[n]=be(t,G.description);return f(Id,{children:f(Gt,{text:n||"",noMargin:!0})})}const G1=er(["border-radius:5px;outline:none;"]),s9=er(["line-height:1.4rem;font-family:",";font-size:","rem;"],e=>e.theme.fontFamily,e=>e.theme.fontSizeBody),Id=B.div.withConfig({displayName:"ElementWrapper",componentId:"sc-pru0zy-0"})(["position:relative;display:block;width:100%;border:none;resize:none;padding:0.5rem;padding-left:0rem;cursor:text;white-space:pre-line;display:flex;flex-direction:column;min-height:2.7rem;"," "," &:focus{","}"],e=>e.active&&e.canDrag&&G1,s9,G1),xJ=B.textarea.withConfig({displayName:"ElementView",componentId:"sc-pru0zy-1"})([""," border:none;width:100%;resize:none;background-color:",";color:",";padding:0;margin-bottom:0.5rem;&:focus{outline:none;","}"],s9,e=>e.theme.colors.bg,e=>e.theme.colors.text,G1);function CJ({query:e,setElement:t}){const{results:n}=jk(e),[r,i]=w.useState(0);return je("tab,enter",o=>{o.preventDefault(),n[r]&&t(n[r])},{enableOnTags:["TEXTAREA"]},[]),je("left",o=>{o.preventDefault();let a=r-1;a<0&&(a=n.length-1),i(r-1)},{enableOnTags:["TEXTAREA"]},[r]),je("right",o=>{o.preventDefault();let a=r+1;a>n.length-1&&(a=0),i(r+1)},{enableOnTags:["TEXTAREA"]},[r]),e===""?f(ds,{children:f("p",{children:"Search something..."})}):n.length===0?f(ds,{children:f("p",{children:"No results"})}):O(ds,{children:[f("p",{children:" (press tab to select, left / right to browse)"}),f("p",{children:f(Yt,{subject:n[r]})})]})}const ds=B.div.withConfig({displayName:"WidgetWrapper",componentId:"sc-pru0zy-2"})(["position:absolute;top:100%;right:0;left:-1rem;border-radius:",";border:solid 1px ",";padding:","rem;padding-bottom:0;background-color:",";backdrop-filter:blur(6px);opacity:0.9;z-index:1;"],e=>e.theme.radius,e=>e.theme.colors.bg2,e=>e.theme.margin,e=>e.theme.colors.bg1);function _J({query:e}){return O(ds,{children:[e&&f(Gt,{text:e}),f("p",{children:"Try typing these:"}),O("p",{children:["links: ",f("code",{children:"[clickable link](https://example.com)"})]}),O("p",{children:["styling:",f("code",{children:"**bold** and _cursive_"})]}),O("p",{children:["headings:",f("code",{children:"## Header"})]})]})}function l9({parentResource:e,children:t,onFilesUploaded:n}){const{upload:r,isUploading:i,error:o}=n2(e),a=de.useRef(null),s=w.useCallback(async c=>{const h=await r(c);n==null||n(h)},[r]),{getRootProps:u,isDragActive:l}=sp({onDrop:s});return w.useEffect(()=>{if(l&&a.current){const c=a.current.getBoundingClientRect();c.top<0&&(a.current.style.top=`calc(${Math.abs(c.top)}px + 1rem)`)}},[l]),O(EJ,{...u(),tabIndex:-1,children:[i&&f("p",{children:"Uploading..."}),o&&f(xt,{children:o.message}),t,l&&f(AJ,{ref:a,children:O(TJ,{children:[f(bx,{})," Drop files here to upload."]})})]})}const EJ=B.div.withConfig({displayName:"Root",componentId:"sc-1uc1ldy-0"})(["height:100%;position:relative;"]),RJ=Du(["from{opacity:0;backdrop-filter:blur(0px);}to{opacity:1;backdrop-filter:blur(10px);}"]),AJ=B.div.withConfig({displayName:"VisualDropzone",componentId:"sc-1uc1ldy-1"})(["position:absolute;inset:0;height:90vh;background-color:",";backdrop-filter:blur(10px);border:3px dashed ",";border-radius:",";display:grid;place-items:center;font-size:1.8rem;color:",";animation:0.1s "," ease-in;"],e=>e.theme.darkMode?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.8)",e=>e.theme.colors.textLight,e=>e.theme.radius,e=>e.theme.colors.textLight,RJ),TJ=B.div.withConfig({displayName:"TextWrapper",componentId:"sc-1uc1ldy-2"})(["display:flex;align-items:center;gap:1rem;padding:","rem;"],e=>e.theme.margin);function PJ({resource:e}){const[t]=Wi(e),[n,r]=w.useState(t);return w.useEffect(()=>{r(t)},[t]),f(jJ,{children:f(DJ,{about:e.getSubject(),children:n?f(IJ,{resource:e,setEditMode:r}):f(OJ,{resource:e,setEditMode:r})})})}function IJ({resource:e,setEditMode:t}){const[n,r]=it(e,G.document.elements,{commit:!0,validate:!1,commitDebounce:0}),i=w.useRef(null),o=We(),a=w.useRef(null),[s,u]=w.useState(void 0),[l,c]=w.useState(0),h=qX(a6(F2),a6(j2,{coordinateGetter:vJ}));w.useEffect(()=>{c(n.length-1)},[]),w.useEffect(()=>{n.length===0&&p(0)},[JSON.stringify(n)]),je("enter",d=>{d.preventDefault(),p(l+1)},{enableOnTags:["TEXTAREA"]},[l]),je("enter",d=>{d.preventDefault(),p(0)},{enableOnTags:["INPUT"]},[l]),je("up",d=>{var v;d.preventDefault(),!l||l===0?(v=i.current)==null||v.focus():y(l-1)},{enableOnTags:["TEXTAREA"]},[l]),je("down",d=>{d.preventDefault(),document.activeElement===i.current?y(0):y(l+1)},{enableOnTags:["TEXTAREA","INPUT"]},[l]),je(st.moveLineUp,d=>{d.preventDefault(),_(l,l-1)},{enableOnTags:["TEXTAREA"]},[l]),je(st.moveLineDown,d=>{d.preventDefault(),_(l,l+1)},{enableOnTags:["TEXTAREA"]},[l]),je("esc",d=>{d.preventDefault(),c(-1)},{enableOnTags:["TEXTAREA"]});async function p(d){const v=o.createSubject("element",e.getSubject());n.splice(d,0,v);try{const m=new xi(v,!0);await Promise.all([m.set(G.isA,[He.elements.paragraph],o),m.set(G.parent,e.getSubject(),o),m.set(G.description,"",o)]),m.save(o),await r(n),y(d)}catch(m){u(m)}}function y(d){var m,x,A,D;d>n.length-1?d=n.length-1:d<0&&(d=0),c(d);let v=(x=(m=a==null?void 0:a.current)==null?void 0:m.children[d])==null?void 0:x.getElementsByClassName("element")[0];v||(v=(A=a==null?void 0:a.current)==null?void 0:A.children[d]),v?v.focus():(D=a.current)==null||D.focus()}async function g(d){if(n.length===1){r([]),y(0);return}n.splice(d,1),r(n),y(d-1)}async function b(d,v){n[d]=v,r(n),d===n.length-1?p(d+1):y(d+1)}function _(d,v){const m=n[d];n.splice(d,1),n.splice(v,0,m),r(n),y(v)}function S(d){const{active:v,over:m}=d;if(v.id!==(m==null?void 0:m.id)){const x=n.indexOf(v.id.toString());if(!(m!=null&&m.id))return;const A=n.indexOf(m.id.toString());_(x,A)}}function k(d){dt.success("Upload succeeded!"),d.map(v=>n.push(v)),r([...n])}async function C(){var m,x;const d=n[n.length-1];((x=(m=(await o.getResourceAsync(d)).get(G.description))==null?void 0:m.toString())==null?void 0:x.length)===0?y(n.length-1):p(n.length)}return O(ye,{children:[O("div",{style:{display:"flex",flexDirection:"row"},children:[f(Gi,{parentRef:i,resource:e}),f(ve,{icon:!0,subtle:!0,onClick:()=>t(!1),title:"Read mode",children:f(s1,{})})]}),(s==null?void 0:s.message)&&f(Lt,{children:s.message}),f(l9,{onFilesUploaded:k,parentResource:e,children:O("div",{ref:a,children:[f(GQ,{sensors:h,collisionDetection:GX,onDragEnd:S,children:f(sJ,{items:[...n],strategy:oJ,children:n.map((d,v)=>f(LJ,{canDrag:!0,index:v,subject:d,deleteElement:g,setCurrent:c,current:l,setElementSubject:b,active:v===l},v+d))})}),f(NJ,{onClick:C})]})})]})}function OJ({resource:e,setEditMode:t}){const[n]=it(e,G.document.elements),[r]=be(e,G.name);return O(ye,{children:[O("div",{style:{display:"flex",flexDirection:"row"},children:[f("h1",{style:{flex:1},children:r}),f(ve,{"data-test":"document-edit",icon:!0,subtle:!0,onClick:()=>t(!0),title:"Edit mode",children:f(As,{})})]}),n.map(i=>f(kJ,{subject:i},i))]})}function LJ(e){const{subject:t,active:n}=e,{attributes:r,listeners:i,setNodeRef:o,transform:a,transition:s}=pJ({id:t}),u={transform:Su.Transform.toString(a),transition:s};return O(MJ,{ref:o,style:u,children:[f(zJ,{active:n,...r,...i}),f(SJ,{...e})]})}const DJ=B.div.withConfig({displayName:"DocumentContainer",componentId:"sc-13qv9sb-0"})(["width:min(100%,","rem);margin:auto;display:flex;flex:1;flex-direction:column;padding:2rem;@media (max-width:","rem){padding:","rem;}"],e=>e.theme.containerWidth,e=>e.theme.containerWidth,e=>e.theme.margin),NJ=B.div.withConfig({displayName:"NewLine",componentId:"sc-13qv9sb-1"})(["height:20rem;flex:1;cursor:text;"]),MJ=B.div.withConfig({displayName:"SortableItemWrapper",componentId:"sc-13qv9sb-2"})(["display:flex;flex-direction:row;position:relative;"]),zJ=e=>f(BJ,{...e,title:"Grab to re-order",children:f(cD,{})}),jJ=B.div.withConfig({displayName:"FullPageWrapper",componentId:"sc-13qv9sb-3"})(["background-color:",";display:flex;flex:1;flex-direction:column;min-height:",";box-sizing:border-box;"],e=>e.theme.colors.bg,e=>e.theme.heights.fullPage),BJ=B.div.withConfig({displayName:"SortHandleStyled",componentId:"sc-13qv9sb-4"})(["width:1rem;flex:1;display:flex;align-items:center;opacity:",";position:absolute;left:-1rem;bottom:0;height:100%;cursor:grab;border:solid 1px transparent;border-radius:",";&:drop(active),&:focus,&:active{opacity:0.5;}&:hover{opacity:0.5;}"],e=>e.active?.3:0,e=>e.theme.radius);function u9({resource:e,children:t,error:n,clearError:r}){return f(ba,{resource:e==null?void 0:e.getSubject(),children:O(Nn,{children:[t||f(l1,{error:n,showTrace:!0}),O(Ht,{children:[r&&f(ve,{onClick:r,children:"Clear error"}),f(ve,{onClick:()=>window.setTimeout(window.location.reload.bind(window.location),200),children:"Try Again"})]})]})})}function FJ({resource:e}){const{agent:t}=ot(),n=We(),r=e.getSubject();return wk(e.error)?f(ba,{children:O(Nn,{children:[f("h1",{children:"Unauthorized"}),t?O(ye,{children:[f(l1,{error:e.error}),f("span",{children:f(ve,{onClick:()=>n.fetchResourceFromServer(r),children:"Retry"})})]}):O(ye,{children:[f("p",{children:"You don't have access to this, try signing in:"}),f(qx,{})]})]})}):f(ba,{children:O(Nn,{children:[O("h1",{children:["Could not open ",e.getSubject()]}),f(l1,{error:e.error}),O(Ht,{children:[f(ve,{onClick:()=>n.fetchResourceFromServer(r,{setLoading:!0}),children:"Retry"}),f(ve,{onClick:()=>n.fetchResourceFromServer(r,{fromProxy:!0,setLoading:!0}),title:`Fetches the URL from your current Atomic-Server (${n.getServerUrl()}), instead of from the actual URL itself. Can be useful if the URL is down, but the resource is cached in your server.`,children:"Use proxy"})]})]})})}class $2 extends w.Component{constructor(t){super(t),this.state={error:void 0}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error?this.props.FallBackComponent?f(this.props.FallBackComponent,{error:this.state.error}):f(u9,{error:this.state.error,clearError:()=>this.setState({error:void 0}),info:{}}):this.props.children}}function Dp({content:e,loading:t}){const[n,r]=w.useState(void 0);function i(){r(e),navigator.clipboard.writeText(e||""),dt.success("Copied to clipboard")}return f($J,{"data-code-content":e,children:t?"loading...":O(ye,{children:[e,f(ve,{subtle:!0,style:{position:"absolute",bottom:0,top:0,margin:0,right:0},onClick:i,title:n===e?"Copied!":"Copy to clipboard","data-test":"copy-response",children:n===e?f(eD,{}):f(Cy,{})})]})})}const $J=B.pre.withConfig({displayName:"CodeBlockStyled",componentId:"sc-d2u0e2-0"})(["position:relative;background-color:",";border-radius:",";border:solid 1px ",";padding:0.3rem;font-family:monospace;width:100%;overflow-x:auto;"],e=>e.theme.colors.bg1,e=>e.theme.radius,e=>e.theme.colors.bg2);function js({resource:e,prefix:t,link:n}){const[r]=qe(e);return O("h1",{children:[t&&`${t} `,n?f(Ve,{subject:e.getSubject(),children:r}):r]})}function HJ({resource:e}){const[t,n]=w.useState(void 0),r=We();return O(_t,{about:e.getSubject(),children:[f(js,{resource:e}),f(E2,{resource:e}),f(Ki,{resource:e,propertyURL:G.description}),f(Os,{resource:e,except:R2,editable:!0,columns:!0}),O(Ht,{children:[f(fu,{icon:!0,klass:e.getSubject()}),f(ve,{subtle:!0,onClick:async()=>n(await oP(e,r)),children:"typescript interface"})]}),t&&f(Dp,{content:t})]})}function UJ({resource:e}){const{downloadFile:t,bytes:n}=Tp(e),r=Fu("(min-width: 600px)");return f(ba,{about:e.getSubject(),children:O(Nn,{gap:"2rem",children:[O(Ht,{center:!0,justify:"space-between",children:[f(VJ,{resource:e}),r&&f(pY,{downloadFile:t,fileSize:n}),!r&&f(E7,{downloadFile:t,fileSize:n})]}),f(Ki,{resource:e,propertyURL:G.description}),f(P7,{resource:e})]})})}const VJ=B(Gi).withConfig({displayName:"StyledEditableTitle",componentId:"sc-yaghyt-0"})(["margin:0;"]);function WJ({resource:e}){const[t]=it(e,G.chatRoom.messages),[n,r]=w.useState(""),i=We(),[o,a]=w.useState(void 0),s=w.useRef(null),u=w.useRef(null),[l,c]=w.useState(1);je("enter",S=>{S.preventDefault(),y()},{enableOnTags:["TEXTAREA"]},[]),je("escape",S=>{var k;(k=u==null?void 0:u.current)==null||k.blur()},{enableOnTags:["TEXTAREA"]},[]),w.useEffect(h,[t.length,e]);function h(){s.current&&(s.current.scrollTop=s.current.scrollHeight)}const p=n.length===0;async function y(S){const k=n;try{if(h(),r(""),S&&S.preventDefault(),!p){const C=i.createSubject("messages",e.getSubject()),d=new xi(C,!0);await d.set(G.parent,e.getSubject(),i,!1),await d.set(G.isA,[He.message],i,!1),await d.set(G.description,n,i,!1),await d.set(G.commit.createdAt,Ou(),i,!1),o&&await d.set(G.chatRoom.replyTo,o,i,!1),await d.save(i),a(void 0)}}catch(C){r(k),dt.error(C.message)}}const g=de.useCallback(b,[u]);function b(S){var k;a(S),(k=u==null?void 0:u.current)==null||k.focus()}function _(S){if(r(S.target.value),S.target.value===""){c(1);return}const k=S.target.style.overflow;S.target.style.overflow="scroll";const C=S.target.scrollHeight;S.target.style.overflow=k;const v=Math.ceil(C/30)-1;v!==l&&c(v)}return O(JJ,{about:e.getSubject(),children:[f(Gi,{resource:e}),f(ZJ,{ref:s,children:f(h9,{subject:e.getSubject(),setReplyTo:g})}),o&&O(gu,{children:[f(c9,{subject:o}),f(ve,{icon:!0,subtle:!0,onClick:()=>a(void 0),children:f(Mu,{})})]}),O(QJ,{onSubmit:y,children:[f(XJ,{rows:l,ref:u,autoFocus:!0,value:n,onChange:_,placeholder:"type a message","data-test":"message-input"}),f(YJ,{title:"Send message [enter]",disabled:p,clean:!0,onClick:y,children:"Send"})]}),f(bf,{baseMargin:"2rem",position:"bottom"})]})}const qJ=500,KJ=de.memo(function({subject:t,setReplyTo:n}){const r=Ce(t),[i]=be(r,G.description),[o]=Io(r,G.commit.lastCommit),[a]=Io(r,G.chatRoom.replyTo),s=Et();function u(){navigator.clipboard.writeText(t),dt.success("Copied message URL to clipboard")}function l(){navigator.clipboard.writeText(i||""),dt.success("Copied message text to clipboard")}return O(GJ,{about:t,children:[O(d9,{children:[f(Ls,{commitSubject:o}),a&&f(c9,{subject:a}),O(f9,{children:[f(ve,{icon:!0,subtle:!0,onClick:()=>s(Wh(t)),title:"Edit message",children:f(mD,{})}),f(ve,{icon:!0,subtle:!0,onClick:()=>n(t),title:"Reply to this message",children:f(yD,{})}),f(ve,{icon:!0,subtle:!0,onClick:u,title:"Copy link to this message",children:f(fD,{})}),f(ve,{icon:!0,subtle:!0,onClick:l,title:"Copy message text",children:f(Cy,{})})]})]}),f(Gt,{noMargin:!0,text:i||"",maxLength:qJ})]})}),w6=50;function c9({subject:e}){const t=Ce(e),[n]=be(t,G.description),[r]=Io(t,G.commit.lastCommit),i=Ce(r),[o]=Io(i,G.commit.signer);if(!t.isReady()||!i.isReady())return f(S6,{children:"loading..."});const a=n==null?void 0:n.substring(0,w6),s=n&&n.length>w6?"...":"";return O(S6,{children:[f("span",{children:"to "}),f(Yt,{subject:o}),f(Ve,{subject:e,children:`: ${a}${s}`})]})}const S6=B.span.withConfig({displayName:"MessageLineStyled",componentId:"sc-1xeo7q5-0"})(["font-size:0.7rem;white-space:nowrap;overflow:hidden;flex:1;"]),d9=B.div.withConfig({displayName:"MessageDetails",componentId:"sc-1xeo7q5-1"})(["font-size:0.7rem;margin-bottom:0;opacity:0.4;display:flex;flex:1;"]),f9=B.div.withConfig({displayName:"MessageActions",componentId:"sc-1xeo7q5-2"})(["display:flex;align-self:flex-end;justify-content:flex-end;flex:1;opacity:0;margin-right:1rem;"]),GJ=B.div.withConfig({displayName:"MessageComponent",componentId:"sc-1xeo7q5-3"})(["min-height:1.5rem;padding-bottom:0.5rem;padding-left:1rem;&:hover{background:",";& ","{opacity:1;}& ","{opacity:1;}}"],e=>e.theme.colors.bg,d9,f9),YJ=B(ve).withConfig({displayName:"SendButton",componentId:"sc-1xeo7q5-4"})(["padding-left:1rem;padding-right:1rem;color:",";background:",";&:disabled{cursor:default;display:auto;opacity:0.5;}"],e=>e.theme.colors.bg,e=>e.theme.colors.main),XJ=B.textarea.withConfig({displayName:"MessageInput",componentId:"sc-1xeo7q5-5"})(["color:",";background:none;flex:1;padding:0.5rem 1rem;border:"," solid 1px;border-right:none;line-height:inherit;min-height:2rem;max-height:50vh;font-family:",";"],e=>e.theme.colors.text,e=>e.theme.colors.bg2,e=>e.theme.fontFamily),QJ=B.form.withConfig({displayName:"MessageForm",componentId:"sc-1xeo7q5-6"})(["display:flex;flex-basis:3rem;flex-direction:row;border-radius:",";background:",";view-transition-name:chat-input;> :first-child{border-top-left-radius:",";border-bottom-left-radius:",";}> :last-child{border-top-right-radius:",";border-bottom-right-radius:",";}"],e=>e.theme.radius,e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius),JJ=B.div.withConfig({displayName:"FullPageWrapper",componentId:"sc-1xeo7q5-7"})(["display:flex;flex-direction:column;height:calc(100vh - 4rem);padding:1rem;flex:1;"]),ZJ=B.div.withConfig({displayName:"ScrollingContent",componentId:"sc-1xeo7q5-8"})(["margin-left:-1rem;margin-right:-1rem;overflow-y:scroll;flex:1;"]);function h9({subject:e,setReplyTo:t}){const n=Ce(e),[r]=it(n,G.chatRoom.messages),[i]=be(n,G.chatRoom.nextPage),[o]=w.useState(!0),a=w.useRef(null);return o?n.isReady()?O("div",{ref:a,children:[i&&f(h9,{subject:i,setReplyTo:t}),r.map(s=>f(KJ,{subject:s,setReplyTo:t},"message"+s))]}):f(ye,{children:"loading..."}):f(ye,{children:"Not in view..."})}function eZ({resource:e}){const[t]=be(e,G.description),[n]=be(e,G.parent),[r]=be(e,G.commit.lastCommit);return O(_t,{about:e.getSubject(),children:[O("h3",{children:["Message in ",f(Yt,{subject:n})]}),f(_2,{children:f(Ls,{commitSubject:r})}),f(Gt,{text:t||""})]})}function tZ({preview:e,error:t,loading:n}){return n?f(Y1,{children:"loading..."}):t?f(nZ,{error:t}):!e||e===""?f(Y1,{children:"no preview..."}):f(rZ,{children:f(Gt,{renderGFM:!0,text:e})})}const nZ=({error:e})=>f(Y1,{children:O("div",{children:[f("p",{children:"Could not load preview 😞"}),f(Lt,{style:{fontSize:"1rem"},children:e.message})]})}),Y1=B.div.withConfig({displayName:"CenterGrid",componentId:"sc-300i91-0"})(["display:grid;height:min(80vh,1000px);width:100%;place-items:center;font-size:calc(clamp(1rem,5vw,2.4rem) + 0.1rem);"]),rZ=B(_t).withConfig({displayName:"StyledContainerNarrow",componentId:"sc-300i91-1"})(["max-width:85ch;"]);Rs.sha512=e=>Promise.resolve(mk(e));const k6={children:"https://atomicdata.dev/properties/children",classType:"https://atomicdata.dev/properties/classtype",createdBy:"https://atomicdata.dev/properties/createdBy",datatype:"https://atomicdata.dev/properties/datatype",description:"https://atomicdata.dev/properties/description",drives:"https://atomicdata.dev/properties/drives",incomplete:"https://atomicdata.dev/properties/incomplete",isA:"https://atomicdata.dev/properties/isA",isDynamic:"https://atomicdata.dev/properties/isDynamic",name:"https://atomicdata.dev/properties/name",parent:"https://atomicdata.dev/properties/parent",paymentPointer:"https://atomicdata.dev/properties/paymentPointer",read:"https://atomicdata.dev/properties/read",recommends:"https://atomicdata.dev/properties/recommends",requires:"https://atomicdata.dev/properties/requires",shortname:"https://atomicdata.dev/properties/shortname",subResources:"https://atomicdata.dev/properties/subresources",write:"https://atomicdata.dev/properties/write",displayStyle:"https://atomicdata.dev/property/display-style",publishedAt:"https://atomicdata.dev/properties/published-at",agent:{publicKey:"https://atomicdata.dev/properties/publicKey"},collection:{members:"https://atomicdata.dev/properties/collection/members",currentPage:"https://atomicdata.dev/properties/collection/currentPage",pageSize:"https://atomicdata.dev/properties/collection/pageSize",property:"https://atomicdata.dev/properties/collection/property",totalMembers:"https://atomicdata.dev/properties/collection/totalMembers",totalPages:"https://atomicdata.dev/properties/collection/totalPages",value:"https://atomicdata.dev/properties/collection/value"},commit:{subject:"https://atomicdata.dev/properties/subject",createdAt:"https://atomicdata.dev/properties/createdAt",lastCommit:"https://atomicdata.dev/properties/lastCommit",previousCommit:"https://atomicdata.dev/properties/previousCommit",signer:"https://atomicdata.dev/properties/signer",set:"https://atomicdata.dev/properties/set",push:"https://atomicdata.dev/properties/push",remove:"https://atomicdata.dev/properties/remove",destroy:"https://atomicdata.dev/properties/destroy",signature:"https://atomicdata.dev/properties/signature"},document:{elements:"https://atomicdata.dev/properties/documents/elements"},endpoint:{parameters:"https://atomicdata.dev/properties/endpoint/parameters",results:"https://atomicdata.dev/properties/endpoint/results"},search:{query:"https://atomicdata.dev/properties/search/query",limit:"https://atomicdata.dev/properties/search/limit",property:"https://atomicdata.dev/properties/search/property"},redirect:{destination:"https://atomicdata.dev/properties/destination",redirectAgent:"https://atomicdata.dev/properties/invite/redirectAgent"},invite:{agent:"https://atomicdata.dev/properties/invite/agent",publicKey:"https://atomicdata.dev/properties/invite/publicKey",target:"https://atomicdata.dev/properties/invite/target",usagesLeft:"https://atomicdata.dev/properties/invite/usagesLeft",users:"https://atomicdata.dev/properties/invite/users",write:"https://atomicdata.dev/properties/invite/write"},file:{filename:"https://atomicdata.dev/properties/filename",filesize:"https://atomicdata.dev/properties/filesize",downloadUrl:"https://atomicdata.dev/properties/downloadURL",mimetype:"https://atomicdata.dev/properties/mimetype",attachments:"https://atomicdata.dev/properties/attachments"},chatRoom:{messages:"https://atomicdata.dev/properties/messages",nextPage:"https://atomicdata.dev/properties/nextPage",replyTo:"https://atomicdata.dev/properties/replyTo"},bookmark:{url:"https://atomicdata.dev/property/url",preview:"https://atomicdata.dev/property/preview",imageUrl:"https://atomicdata.dev/properties/imageUrl"}};var p9=(e=>(e.Unauthorized="Unauthorized",e.NotFound="NotFound",e.Server="Server",e.Client="Client",e))(p9||{});class th extends Error{constructor(t,n="Client"){super(t),Object.setPrototypeOf(this,th.prototype),this.type=n,this.message=t;try{const i=JSON.parse(t)[k6.description];i&&(this.message=i)}catch{}this.message||(this.message=this.createMessage())}static fromResource(t){return new th(t.get(k6.description).toString())}createMessage(){switch(this.type){case"Unauthorized":return"You don't have the rights to do this.";case"NotFound":return"404 Not found.";case"Server":return"500 Unknown server error.";default:return"Unknown error."}}}const x6=new Map;function iZ(e,t=500){return(...r)=>{const i=x6.get(e);i&&window.clearTimeout(i),x6.set(e,window.setTimeout(()=>e(...r),t))}}async function oZ(e,t="",n){const r=new URL(Fe.fetchBookmark,n.getServerUrl()),i=new URLSearchParams({name:t,url:e});r.search=i.toString();const o=await fetch(r.toString(),{headers:{Accept:"application/json"}});if(o.status!==200)throw new th(await o.text(),p9.Server);return await o.json()}const aZ=iZ((e,t,n,r,i,o,a,s,u,l)=>{w.startTransition(()=>{oZ(e,t,n).then(async c=>{await Promise.all([i(c.preview),o(c.name),u(c["image-url"]),l(c.description)]),a(void 0),s(!1),r.save(n)}).catch(c=>{console.error(c),a(c),s(!1)})})});function sZ(e){const t=We(),[n,r]=be(e,Q.properties.bookmark.preview),[i]=be(e,Q.properties.bookmark.url),[o,a]=be(e,Q.properties.name),[s,u]=be(e,Q.properties.bookmark.imageUrl),[l,c]=be(e,Q.properties.description),[h,p]=w.useState(void 0),[y,g]=w.useState(!1),b=w.useCallback(_=>{try{new URL(_)}catch(S){p(S);return}g(!0),aZ(_,o,t,e,r,a,p,g,u,c)},[o,e,t]);return w.useEffect(()=>{e.isReady()&&n===void 0&&i&&b(i)},[n,e.isReady()]),{preview:n,error:h,update:b,loading:y}}function lZ({resource:e}){const[t,n]=be(e,Q.properties.bookmark.url,{commit:!0}),{preview:r,error:i,update:o,loading:a}=sZ(e),s=w.useCallback(async u=>{await n(u.target.value),o(u.target.value)},[n,o]);return f(ye,{children:O(uZ,{children:[f(wf,{children:f(Gi,{resource:e})}),f(cZ,{children:f(wf,{children:O(fZ,{children:[f(dZ,{children:f(un,{children:f(Jn,{placeholder:"https://example.com",value:t,onChange:s})})}),t?O(T2,{to:t,variant:A2.Button,children:["Open site"," "]}):f(Lt,{children:"No url"})]})})}),f(hZ,{children:f(tZ,{preview:r||"",error:i,loading:a})})]})})}const uZ=B.div.withConfig({displayName:"Wrapper",componentId:"sc-zxu7fx-0"})(["margin-top:","rem;position:relative;display:flex;flex-direction:column;min-height:100%;",",","{padding-bottom:unset;}"],e=>e.theme.margin,wf,_t),cZ=B.div.withConfig({displayName:"ControlWrapper",componentId:"sc-zxu7fx-1"})(["position:sticky;top:0rem;background-color:",";border-bottom:solid 1px ",";padding:0rem;align-items:center;"],e=>e.theme.colors.bgBody,e=>e.theme.colors.bg2),dZ=B.div.withConfig({displayName:"FieldWrapper",componentId:"sc-zxu7fx-2"})(["flex:1;"]),fZ=B.div.withConfig({displayName:"ControlBar",componentId:"sc-zxu7fx-3"})(["display:flex;align-items:center;gap:","rem;margin-bottom:","rem;"],e=>e.theme.margin,e=>e.theme.margin),hZ=B.div.withConfig({displayName:"PreviewWrapper",componentId:"sc-zxu7fx-4"})(["background-color:",";flex:1;padding-bottom:",";"],e=>e.theme.colors.bg,e=>e.theme.heights.floatingSearchBarPadding);function m9({resource:e}){const[t,n]=w.useState(!1),[r,i]=kr(),o=Ce(r),[a,s]=w.useState(!1);e=o||e;const u=We(),[l,c]=w.useState(""),h=w.useCallback(async()=>{try{s(!0),await tI(u,l,{overwriteOutside:t,parent:r}),dt.success("Imported!"),s(!1)}catch(p){dt.error(p.message),s(!1)}},[r,l,t,u]);return O(_t,{about:e.getSubject(),children:[f(js,{resource:e,prefix:"Import to",link:!0}),O("p",{children:["Read more about how importing Atomic Data works"," ",f("a",{href:"https://docs.atomicdata.dev/create-json-ad.html",children:"in the docs"}),"."]}),O(Nn,{children:[f(ii,{label:"JSON-AD",children:f(un,{children:f(XN,{rows:15,placeholder:"Paste your JSON-AD...",value:l,onChange:p=>c(p.target.value),children:l})})}),f(gZ,{children:"Options"}),O(mZ,{children:[O(pZ,{children:[f("input",{type:"checkbox",checked:t,onChange:p=>n(p.target.checked)}),"Overwrite resources that are outside the scope of the parent. Do this only if you trust the imported data."]}),f(ii,{label:"Target parent",helper:"This URL will be used as the default Parent for imported resources.",required:!0,children:f(un,{children:f(Jn,{required:!0,placeholder:"Enter subject",value:r,onChange:p=>i(p.target.value)})})})]}),l!==""&&f(ve,{"data-test":"import-post",disabled:!r,onClick:h,children:a?"Importing...":"Send JSON"})]})]})}const pZ=B.label.withConfig({displayName:"Label",componentId:"sc-cacnsf-0"})(["display:flex;gap:1ch;align-items:center;"]),mZ=B.div.withConfig({displayName:"Group",componentId:"sc-cacnsf-1"})(["display:flex;padding:1rem;flex-direction:column;gap:1rem;border:1px solid ",";border-radius:",";"],e=>e.theme.colors.bg2,e=>e.theme.radius),gZ=B.h2.withConfig({displayName:"Header",componentId:"sc-cacnsf-2"})(["font-size:1.2rem;"]),g9="0.2rem";function v9({resource:e}){const[t]=be(e,G.parent),[n,r]=qe(e),[i]=Wi(e),{enableScope:o}=Xh(e.getSubject());return f(vZ,{"aria-label":"Breadcrumbs",children:O(Ht,{fullWidth:!0,center:!0,gap:"initial",children:[t&&f(y9,{subject:t,depth:0}),i?O(kZ,{children:[f(SZ,{value:n,onChange:a=>r(a.target.value)}),f(As,{})]}):f(wZ,{children:n}),f(xZ,{}),f(CZ,{onClick:o,title:`Search in ${n}`,color:"textLight",children:f(Ry,{})})]})})}const vZ=B.nav.withConfig({displayName:"ParentWrapper",componentId:"sc-2ov1y0-0"})(["height:",";padding-block:",";padding-inline:0.5rem;color:",";border-bottom:1px solid ",";background-color:",";display:flex;flex-direction:row;align-items:center;justify-content:flex-start;view-transition-name:breadcrumb-bar;"],e=>e.theme.heights.breadCrumbBar,g9,e=>e.theme.colors.textLight2,e=>e.theme.colors.bg2,e=>e.theme.colors.bg),yZ=4;function y9({subject:e,depth:t}){const n=Ce(e,{allowIncomplete:!0}),[r]=be(n,G.parent),i=ju(),[o]=qe(n);if(t>yZ)return f(C6,{children:"..."});function a(s){s.preventDefault(),i(zt(e))}return O(ye,{children:[r&&f(y9,{subject:r,depth:t+1}),f(C6,{href:e,onClick:a,children:o}),f(bZ,{children:"/"})]})}const bZ=B.div.withConfig({displayName:"Divider",componentId:"sc-2ov1y0-1"})(["padding:0.1rem 0.2rem;"]),H2=er(["font-size:","rem;font-family:",";padding:0.1rem 0.5rem;color:",";"],e=>e.theme.fontSizeBody,e=>e.theme.fontFamily,e=>e.theme.colors.textLight),wZ=B.div.withConfig({displayName:"BreadCrumbCurrent",componentId:"sc-2ov1y0-2"})(["",""],H2),SZ=B.input.withConfig({displayName:"BreadCrumbInput",componentId:"sc-2ov1y0-3"})([""," background:none;outline:none;border:none;"],H2),kZ=B.div.withConfig({displayName:"BreadCrumbInputWrapper",componentId:"sc-2ov1y0-4"})(["display:flex;&:hover svg{display:flex;}svg{display:none;}"]),C6=B.a.withConfig({displayName:"Breadcrumb",componentId:"sc-2ov1y0-5"})([""," white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-self:center;cursor:'pointer';text-decoration:none;border-radius:",";&:hover{background:",";color:",";}&:active{background:",";}"],H2,e=>e.theme.radius,e=>e.theme.colors.bg1,e=>e.theme.colors.text,e=>e.theme.colors.bg2),xZ=B.span.withConfig({displayName:"Spacer",componentId:"sc-2ov1y0-6"})(["flex:1;"]),CZ=B(yr).withConfig({displayName:"ScopedSearchButton",componentId:"sc-2ov1y0-7"})(["justify-self:flex-end;"]);function _Z({options:e,name:t,onChange:n}){const[r,i]=w.useState(()=>{var a;return(a=e.find(s=>s.checked))==null?void 0:a.value}),o=w.useCallback((a,s)=>{a&&(n(s),i(s))},[n]);return f(RZ,{children:e.map(a=>w.createElement(EZ,{...a,key:a.value,onChange:o,checked:r===a.value,name:t}))})}function EZ({onChange:e,icon:t,label:n,name:r,value:i,checked:o}){const a=w.useId();return O(AZ,{children:[f(PZ,{id:a,type:"radio",onChange:u=>{e(u.target.checked,i)},name:r,value:i,checked:o}),f(TZ,{htmlFor:a,title:n,children:t})]})}const RZ=B.form.withConfig({displayName:"Group",componentId:"sc-hqcy88-0"})(["display:flex;height:2rem;gap:0.5rem;"]),AZ=B.div.withConfig({displayName:"Item",componentId:"sc-hqcy88-1"})(["position:relative;width:2rem;aspect-ratio:1/1;"]),TZ=B.label.withConfig({displayName:"Label",componentId:"sc-hqcy88-2"})(["position:absolute;inset:0;width:100%;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;border-radius:",";color:",";cursor:pointer;transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;input:checked + &{background-color:",";color:",";}:hover{background-color:",";}"],e=>e.theme.radius,e=>e.theme.colors.textLight,e=>e.theme.colors.bg1,e=>e.theme.colors.text,e=>e.theme.colors.bg1),PZ=B.input.withConfig({displayName:"Input",componentId:"sc-hqcy88-3"})(["position:absolute;inset:0;width:100%;aspect-ratio:1/1;visibility:hidden;"]),{grid:_6,list:E6}=He.displayStyles;function IZ({displayStyle:e,onClick:t}){const n=w.useMemo(()=>[{icon:f(pD,{}),label:"List View",value:E6,checked:e===E6},{icon:f(_D,{}),label:"Grid View",value:_6,checked:e===_6}],[e]);return f(_Z,{options:n,name:"display-style",onChange:t})}function X1({resource:e}){const[t]=be(e,G.description);return f(Ds,{children:f(P2,{children:t})})}function OZ({resource:e}){const[t]=be(e,G.bookmark.imageUrl);return t?f(Ds,{children:f(LZ,{src:t,alt:""})}):f(X1,{resource:e})}const LZ=B.img.withConfig({displayName:"Image",componentId:"sc-11y3cd7-0"})(["width:100%;height:100%;object-fit:cover;object-position:center;"]);function DZ({resource:e}){return f("ul",{children:[...e.getPropVals()].map(([t,n])=>f(NZ,{prop:t,val:n},t))})}function NZ({prop:e,val:t}){const n=Ce(e),[r]=qe(n),[i]=Io(n,G.datatype),o=w.useMemo(()=>i===q0.atomicUrl?f(b9,{val:t}):i===q0.resourceArray?f(jZ,{val:t}):f(ye,{children:t}),[t,i]);return O(zZ,{children:[f(MZ,{children:r}),": ",o]})}const MZ=B.span.withConfig({displayName:"Key",componentId:"sc-sffncw-0"})(["font-weight:bold;"]),zZ=B.ul.withConfig({displayName:"List",componentId:"sc-sffncw-1"})(["list-style:none;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:",";"],e=>e.theme.colors.textLight);function jZ({val:e}){return f(ye,{children:e.map((t,n)=>O(ye,{children:[f(b9,{val:t},t),n===e.length-1?"":", "]}))})}function b9({val:e}){const t=Ce(e),[n]=qe(t);return f(ye,{children:n})}function BZ({resource:e}){return f(FZ,{children:f(DZ,{resource:e})})}const FZ=B.div.withConfig({displayName:"DefaultGridWrapper",componentId:"sc-177c15f-0"})(["padding:","rem;pointer-events:none;"],e=>e.theme.margin);function $Z({resource:e}){const[t]=it(e,G.chatRoom.messages);return f(VZ,{children:t.length>0?O(ye,{children:[f(R6,{subject:t[t.length-2]}),f(R6,{subject:t[t.length-1],alignment:"right"})]}):f(P2,{children:"Empty Chat"})})}const R6=({subject:e,alignment:t})=>{const n=Ce(e),[r]=Io(n,G.commit.lastCommit),i=Ce(r),[o]=Io(i,G.commit.signer),a=Ce(o),[s]=qe(a),[u]=be(n,G.description);return O(HZ,{alignment:t,children:[f(UZ,{children:s}),f(w9,{children:u})]})},w9=B.div.withConfig({displayName:"TextWrapper",componentId:"sc-zaco6u-0"})(["background-color:",";padding:0.5rem;border-radius:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:",";"],e=>e.theme.colors.bg,e=>e.theme.colors.text),HZ=B.div.withConfig({displayName:"MessageWrapper",componentId:"sc-zaco6u-1"})(["padding-inline:","rem;width:100%;text-align:",";","{border-bottom-left-radius:",";border-bottom-right-radius:",";}"],e=>e.theme.margin,e=>e.alignment??"left",w9,e=>e.alignment!=="right"?"0":"15px",e=>e.alignment==="right"?"0":"15px"),UZ=B.div.withConfig({displayName:"CommitWrapper",componentId:"sc-zaco6u-2"})(["color:",";padding-inline:0.5rem;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"],e=>e.theme.colors.textLight),VZ=B(Ds).withConfig({displayName:"ChatWrapper",componentId:"sc-zaco6u-3"})(["display:flex;flex-direction:column;justify-content:space-evenly;"]);function WZ({resource:e}){const[t]=it(e,G.document.elements),n=Ce(t[0]),[r]=be(n,G.description);return f(Ds,{children:f(P2,{children:f(Gt,{text:r??""})})})}const qZ=new Set(["image/png","image/jpeg","image/gif","image/svg+xml","image/webp","image/avif"]);function KZ({resource:e}){const{downloadUrl:t,mimeType:n,bytes:r}=Tp(e),i=C2(),o=R7(e.getSubject());return r>=i?f(A6,{children:"To large for preview"}):qZ.has(n)?f(Ds,{children:f(GZ,{src:t,alt:"",loading:"lazy",style:o})}):T7(n)?f(YZ,{downloadUrl:t,mimeType:n}):f(A6,{children:"No preview available"})}const GZ=B.img.withConfig({displayName:"Image",componentId:"sc-1doxiie-0"})(["width:100%;height:100%;object-fit:cover;object-position:center;"]),A6=B(Ds).withConfig({displayName:"TextWrapper",componentId:"sc-1doxiie-1"})(["display:grid;place-items:center;color:",";"],e=>e.theme.colors.textLight),YZ=B(A7).withConfig({displayName:"StyledTextPreview",componentId:"sc-1doxiie-2"})(["padding:","rem;color:",";&:is(pre){padding:0;padding-inline:","rem;}"],e=>e.theme.margin,e=>e.theme.colors.textLight,e=>e.theme.margin),XZ=new Map([[He.bookmark,OZ],[He.class,X1],[He.property,X1],[He.chatRoom,$Z],[He.document,WZ],[He.file,KZ]]);function QZ(e){return XZ.get(e)??BZ}function JZ({subject:e}){const t=ju(),n=Ce(e),[r]=qe(n),[i]=be(n,G.isA),o=Ce(i),[a]=qe(o),s=Bu(i??""),u=w.useCallback(p=>{p.preventDefault(),t(zt(e))},[e,t]),l=w.useMemo(()=>QZ(i??""),[i]);if(i===void 0)return f(ree,{});const c=i===He.folder,h=c?void 0:e;return O(yu,{onClick:u,href:e,children:[f(D7,{subject:h,children:r}),c?f(eee,{}):O(vu,{subject:h,children:[O(ZZ,{children:[f(s,{}),f("span",{children:a})]}),f($2,{FallBackComponent:tee,children:f(l,{resource:n})})]})]})}const ZZ=B.div.withConfig({displayName:"ClassBanner",componentId:"sc-1qvdapf-0"})(["display:flex;background-color:",";border-top-left-radius:",";border-top-right-radius:",";align-items:center;gap:0.5rem;justify-content:center;padding-block:var(--card-banner-padding);color:",";border-bottom:1px solid ",";span{text-transform:capitalize;}"],e=>e.theme.colors.bg,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.colors.textLight,e=>e.theme.colors.bg2),eee=B(gx).withConfig({displayName:"FolderIcon",componentId:"sc-1qvdapf-1"})(["height:100%;width:100%;color:",";transition:color 0.1s ease-in-out;",":hover &{color:",";}"],e=>e.theme.colors.textLight,yu,e=>e.theme.colors.main),tee=({error:e})=>f(nee,{children:e.message}),nee=B.div.withConfig({displayName:"GridItemErrorWrapper",componentId:"sc-1qvdapf-2"})(["color:",";text-align:center;"],e=>e.theme.colors.alert),ree=B(LN).withConfig({displayName:"Loader",componentId:"sc-1qvdapf-3"})(["--loader-bg-to:",";height:unset;aspect-ratio:1/1;"],e=>e.theme.colors.bgBody);function iee({subResources:e,onNewClick:t,showNewButton:n}){return O(oee,{children:[Array.from(e.values()).map(r=>f(JZ,{subject:r.getSubject()},r.getSubject())),n&&O(yu,{children:[f(aee,{as:"button",onClick:t,title:"Create new resource",children:f(ui,{})}),f(D7,{children:"New Resource"})]})]})}const oee=B.div.withConfig({displayName:"Grid",componentId:"sc-e7hj1r-0"})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));width:var(--container-width);margin-inline:auto;gap:3rem;"]),aee=B(vu).withConfig({displayName:"NewCard",componentId:"sc-e7hj1r-1"})(["background-color:",";border:1px solid ",";cursor:pointer;display:grid;place-items:center;font-size:3rem;color:",";transition:color 0.1s ease-in-out,font-size 0.1s ease-out,box-shadow 0.1s ease-in-out;",":hover &,",":focus &{color:",";font-size:3.8rem;}:active{font-size:3rem;}"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight,yu,yu,e=>e.theme.colors.main);function S9({subResources:e,onNewClick:t,showNewButton:n}){return O(cee,{children:[f(dee,{"data-test":"folder-list",children:O(ye,{children:[f("thead",{children:O("tr",{children:[f("th",{children:f(pee,{children:"Title"})}),f("th",{children:"Class"}),f(T6,{as:"th",children:"Last Modified"})]})}),f("tbody",{children:Array.from(e.values()).map(r=>O(mee,{children:[f("td",{children:f(see,{resource:r})}),f("td",{children:f(uee,{resource:r})}),f(T6,{children:f(lee,{resource:r})})]},r.getSubject()))})]})}),n&&f(gee,{clean:!0,onClick:t,"data-test":"new-resource-folder",children:O("span",{children:[f(ui,{})," New Resource"]})})]})}function see({resource:e}){const[t]=qe(e),[n]=be(e,G.isA),r=Bu(n??"");return O(hee,{children:[f(fee,{children:f(r,{})}),f(Ve,{subject:e.getSubject(),children:t})]})}function lee({resource:e}){const[t]=be(e,G.commit.lastCommit);return f(k9,{children:f(Ls,{commitSubject:t})})}function uee({resource:e}){const[t]=be(e,G.isA),n=Ce(t),[r]=qe(n);return f(k9,{children:f(Ve,{subject:t,children:r})})}const cee=B.div.withConfig({displayName:"Wrapper",componentId:"sc-v3wz3w-0"})(["--icon-width:1rem;--icon-title-spacing:1rem;--cell-padding:0.4rem;width:var(--container-width);margin-inline:auto;"]),dee=B.table.withConfig({displayName:"StyledTable",componentId:"sc-v3wz3w-1"})(["text-align:left;border-collapse:collapse;width:100%;th{padding-bottom:1rem;}th:last-child{padding-right:2rem;}"]),fee=B.span.withConfig({displayName:"IconWrapper",componentId:"sc-v3wz3w-2"})(["width:var(--icon-width);display:inline-flex;align-items:center;"]),hee=B.div.withConfig({displayName:"TitleWrapper",componentId:"sc-v3wz3w-3"})(["display:flex;align-items:center;gap:var(--icon-title-spacing);svg{color:",";}"],e=>e.theme.colors.textLight),pee=B.span.withConfig({displayName:"TitleHeaderWrapper",componentId:"sc-v3wz3w-4"})(["margin-inline-start:calc( var(--icon-width) + var(--icon-title-spacing) + var(--cell-padding) );"]),T6=B.td.withConfig({displayName:"AlignRight",componentId:"sc-v3wz3w-5"})(["text-align:right;"]),k9=B.span.withConfig({displayName:"LinkWrapper",componentId:"sc-v3wz3w-6"})(["a{color:",";}"],e=>e.theme.colors.textLight),mee=B.tr.withConfig({displayName:"TableRow",componentId:"sc-v3wz3w-7"})([":nth-child(odd){td{background-color:",";}td:first-child{border-top-left-radius:",";border-bottom-left-radius:",";}td:last-child{border-top-right-radius:",";border-bottom-right-radius:",";}}td{padding:var(--cell-padding);}"],e=>e.theme.colors.bg1,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius,e=>e.theme.radius),gee=B(ve).withConfig({displayName:"NewButton",componentId:"sc-v3wz3w-8"})(["margin-top:1rem;margin-inline-start:calc( var(--icon-width) + var(--icon-title-spacing) + var(--cell-padding) );> span{display:flex;align-items:center;gap:0.5rem;}"]),vee={commit:!0},yee=new Map([[He.displayStyles.list,S9],[He.displayStyles.grid,iee]]),bee={commit:!0};function wee({resource:e}){const[t]=it(e,G.subResources,bee),[n,r]=be(e,G.displayStyle,vee),i=w.useMemo(()=>yee.get(n)??S9,[n]),o=ff(t),a=Tx(e.getSubject()),[s]=Wi(e);return O(Cee,{view:n,children:[f(See,{children:O(kee,{children:[f(Gi,{resource:e}),f(IZ,{onClick:r,displayStyle:n})]})}),f(xee,{children:f(l9,{parentResource:e,children:f(i,{subResources:o,onNewClick:a,showNewButton:s})})})]})}const See=B.div.withConfig({displayName:"TitleBar",componentId:"sc-tnpuvy-0"})(["padding:","rem;"],e=>e.theme.margin),kee=B.div.withConfig({displayName:"TitleBarInner",componentId:"sc-tnpuvy-1"})(["display:flex;width:var(--container-width);margin-inline:auto;justify-content:space-between;"]),xee=B.div.withConfig({displayName:"Wrapper",componentId:"sc-tnpuvy-2"})(["width:100%;padding:","rem;flex:1;"],e=>e.theme.margin),Cee=B.div.withConfig({displayName:"FullPageWrapper",componentId:"sc-tnpuvy-3"})(["--container-width:min(1300px,100%);min-height:",";padding-bottom:",";display:flex;flex-direction:column;"],e=>e.theme.heights.fullPage,e=>e.theme.heights.floatingSearchBarPadding);function U2({subject:e}){const t=Ce(e),[n]=be(t,G.isA);if(t.loading)return O(_t,{children:[f("p",{children:"Loading..."}),f(Cx,{})]});if(t.error)return f(FJ,{resource:t});const r=Eee(n);return O(ye,{children:[f(v9,{resource:t}),f(_ee,{subject:e,children:f($2,{children:f(r,{resource:t})})})]})}const _ee=de.memo(B.main.withConfig({displayName:"Main",componentId:"sc-2icz80-0"})(["height:calc( 100% - ("," + "," * 2) );view-transition-name:",";"],e=>e.theme.heights.breadCrumbBar,g9,e=>x2("resource-page",e.subject)));function Eee(e){switch(e){case Q.classes.collection:return SX;case Q.classes.endpoint:return EX;case Q.classes.drive:return RX;case Q.classes.redirect:return AX;case Q.classes.invite:return TX;case Q.classes.document:return PJ;case Q.classes.class:return HJ;case Q.classes.file:return UJ;case Q.classes.chatRoom:return WJ;case Q.classes.message:return eZ;case Q.classes.bookmark:return lZ;case Q.classes.importer:return m9;case Q.classes.folder:return wee;case Q.classes.article:return rX;default:return NY}}function Ree({filters:e,setFilters:t}){const[n,r]=w.useState(void 0),i=Ce(n),[o]=it(i,Q.properties.requires),[a]=it(i,Q.properties.recommends),s=[...o,...a];return w.useEffect(()=>{t({...e,[Q.properties.isA]:n})},[n,JSON.stringify(e)]),O("div",{children:[f(qu,{setSubject:r,value:n,classType:Q.classes.class}),s==null?void 0:s.map(u=>f(Aee,{subject:u,filters:e,setFilters:t},u))]})}function Aee({filters:e,setFilters:t,subject:n}){const r=Lu(n);function i(o){t({...e,[r.shortname]:o.target.value})}return O("div",{children:[f("label",{children:r.shortname}),f("input",{type:"text",value:e[r.shortname],onChange:i})]})}function x9(){const[e]=Sx(),{drive:t}=ot(),{scope:n}=Xh(),[r,i]=w.useState({}),[o,a]=w.useState(!1);je("f12",k=>{k.preventDefault(),a(!o)},[o]);const[s,u]=w.useState(!1),[l,c]=w.useState(0),{results:h,loading:p,error:y}=jk(e,{debounce:0,scope:n||t,filters:r}),g=Et(),b=w.useRef(null);function _(k){var d;c(k);const C=(d=b==null?void 0:b.current)==null?void 0:d.children[k];C==null||C.scrollIntoView({block:"nearest"})}je("enter",k=>{var d,v,m;k.preventDefault();const C=(v=(d=b==null?void 0:b.current)==null?void 0:d.children[l])==null?void 0:v.getAttribute("about");if(C){(m=document==null?void 0:document.activeElement)==null||m.blur();const x=zt(C);g(x)}},{enableOnTags:["INPUT"]}),je("up",k=>{k.preventDefault();const C=l>0?l-1:0;_(C)},{enableOnTags:["INPUT"]}),je("down",k=>{k.preventDefault();const C=l===h.length-1?h.length-1:l+1;_(C)},{enableOnTags:["INPUT"]});let S="No hits";return(e==null?void 0:e.length)===0&&(S="Enter a search query"),p&&(S="Loading results..."),h.length>0&&(S=void 0),f(_t,{children:y?f(Lt,{children:y.message}):O(ye,{children:[O("div",{style:{display:"flex",justifyContent:"space-between"},children:[O(Tee,{children:[f(Ry,{}),f("span",{children:S||O(ye,{children:[h.length," ",h.length>1?"Results":"Result"," ","for ",f(Pee,{children:e})]})})]}),o&&O(ve,{onClick:()=>u(!s),children:[f(lD,{}),"Filter"]})]}),s&&f(Ree,{setFilters:i,filters:r}),f(Nn,{ref:b,gap:"1rem",children:h.map((k,C)=>f(Ku,{initialInView:C<5,small:!0,subject:k,highlight:C===l},k))})]})})}const Tee=B.h1.withConfig({displayName:"Heading",componentId:"sc-10hcihn-0"})(["color:",";display:flex;align-items:center;gap:0.7ch;white-space:nowrap;overflow:hidden;line-height:1.5;margin-bottom:","rem;> span{overflow:hidden;text-overflow:ellipsis;}"],e=>e.theme.colors.text,e=>e.theme.margin*3),Pee=B.span.withConfig({displayName:"QueryText",componentId:"sc-10hcihn-1"})(["color:",";"],e=>e.theme.colors.textLight),C9=()=>O(_t,{children:[f(tC,{style:{width:"30rem",maxWidth:"100%",marginBottom:"1rem"}}),f("p",{children:O("em",{children:["The easiest way to ",f("b",{children:"create"}),", ",f("b",{children:"share"})," and ",f("b",{children:"model"})," linked data."]})}),f("p",{children:"Atomic Data is a modular specification for sharing, modifying and modeling graph data. It combines the ease of use of JSON, the connectivity of RDF (linked data) and the reliability of type-safety."}),O("p",{children:["Atomic Data is especially suitable for knowledge graphs, distributed datasets, semantic data, p2p applications, decentralized apps, and data that is meant to be shared. It is designed to be highly extensible, easy to use, and to make the process of domain specific standardization as simple as possible. Check out"," ",f("b",{children:f(Ve,{href:"https://docs.atomicdata.dev/",children:"the docs"})})," ","for more information about Atomic Data."]}),f("h2",{children:"About this app"}),O("p",{children:["You're looking at"," ",f(Ve,{href:"https://github.com/atomicdata-dev/atomic-data-browser",children:"atomic-data-browser"}),", an open-source client for viewing and editing data. Please add an issue if you encouter problems or have a feature request. Expect bugs and issues, because this stuff is pretty beta."]}),O("p",{children:["The back-end of this app is"," ",f(Ve,{href:"https://github.com/atomicdata-dev/atomic-data-rust",children:"atomic-server"}),", which you can think of as an open source, web-native database."]}),f("h2",{children:"Things to visit"}),O("ul",{children:[f("li",{children:f(Ve,{path:"/collections",children:"List of lists"})}),f("li",{children:f(Ve,{path:"/classes",children:"List of Classes"})}),f("li",{children:f(Ve,{path:"/properties",children:"List of Properties"})})]}),f("h2",{children:"Run your own server"}),O("p",{children:["The easiest way to run an"," ",f(Ve,{href:"https://github.com/atomicdata-dev/atomic-data-rust",children:"atomic-server"})," ","is by using Docker:"]}),f("p",{children:f("code",{children:"docker run -p 80:80 -p 443:443 -v atomic-storage:/atomic-storage joepmeneer/atomic-server"})}),O("p",{children:["...and visit"," ",f(Ve,{subject:"http://localhost",children:"localhost"}),"."]}),f("h2",{children:"Join the community"}),O("p",{children:["Atomic Data is open and fully powered by volunteers. We're looking for people who want to help discuss various design challenges and work on implmenentations. If you have any questions, or want to help out, feel free to join our"," ",f(Ve,{href:"https://discord.gg/a72Rv2P",children:"Discord"}),"! Sign up to"," ",f(Ve,{href:"https://docs.atomicdata.dev/newsletter.html",children:"our newsletter"})," ","if you","'","d like to get updated! ."]})]}),Iee=()=>{const[e]=kr();return e===void 0||e===""?f(C9,{}):dn.isValidSubject(e)?f(U2,{subject:e},e):f(x9,{})},Oee=({classSubject:e})=>{const t=Ce(e),[n,r]=va("newSubject"),[i]=va("parent"),{subjectErr:o,subjectValue:a,setSubjectValue:s,resource:u}=x_({klass:t,setSubject:r,initialSubject:n,parent:i});return O(ye,{children:[f(S_,{classSubject:e}),f(k_,{error:o,value:a,onChange:s}),f(lp,{resource:u,classSubject:e},`${e}+${n}`)]})};function Lee(){const[e]=va("classSubject");return f(_t,{children:e?f(Oee,{classSubject:e.toString()}):f(Dee,{})})}function Dee(){const[e]=va("parentSubject"),{drive:t}=ot(),n=e||t,r=Ce(n),[i,o]=w.useState(void 0),[a,s]=w.useState(),u=Ce(a),[l]=be(u,Q.properties.shortname),c=Et(),h=[Q.classes.folder,Q.classes.document,Q.classes.chatRoom,Q.classes.bookmark,Q.classes.class,Q.classes.property];function p(g){if(!a){o(new Error("Please select a class"));return}g.preventDefault(),c(Ay(a,n))}const y=w.useCallback(g=>{dt.success(`Uploaded ${g.length} files.`),e&&c(zt(e))},[e,c]);return O(Nee,{onSubmit:p,children:[O("h1",{children:["Create new resource"," ",e&&O(ye,{children:["under ",f(Yt,{subject:e})]})]}),f("div",{children:f(qu,{setSubject:s,value:a,error:i,setError:o,classType:Q.classes.class})}),O(Ht,{wrapItems:!0,children:[a&&O(ve,{onClick:p,children:["new ",l]}),!a&&f(ye,{children:h.map(g=>f(Mee,{classType:g,parent:n},g))})]}),f(I2,{parentResource:r,onFilesUploaded:y})]})}const Nee=B.form.withConfig({displayName:"StyledForm",componentId:"sc-1l69bzo-0"})(["display:flex;flex-direction:column;gap:","rem;"],({theme:e})=>e.margin);function Mee({classType:e,parent:t}){const n=Ce(e),[r]=qe(n);return f(fu,{icon:!0,IconComponent:Bu(e),klass:e,parent:t,label:r,subtle:!0})}function Np(){return(Np=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function Q1(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var xu=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:_.buttons>0)&&i.current?o(P6(i.current,_,s.current)):b(!1)},g=function(){return b(!1)};function b(_){var S=u.current,k=_?self.addEventListener:self.removeEventListener;k(S?"touchmove":"mousemove",y),k(S?"touchend":"mouseup",g)}return[function(_){var S=_.nativeEvent,k=i.current;if(k&&(I6(S),!function(d,v){return v&&!Ml(d)}(S,u.current)&&k)){if(Ml(S)){u.current=!0;var C=S.changedTouches||[];C.length&&(s.current=C[0].identifier)}k.focus(),o(P6(k,S,s.current)),b(!0)}},function(_){var S=_.which||_.keyCode;S<37||S>40||(_.preventDefault(),a({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},b]},[a,o]),c=l[0],h=l[1],p=l[2];return w.useEffect(function(){return p},[p]),de.createElement("div",Np({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),V2=function(e){return e.filter(Boolean).join(" ")},R9=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=V2(["react-colorful__pointer",e.className]);return de.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},de.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Gn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},jg=function(e){return e[0]==="#"&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}},zee=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Gn(e.h),s:Gn(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Gn(i/2),a:Gn(r,2)}},J1=function(e){var t=zee(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},jee=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),u=r*(1-(1-t+o)*n),l=o%6;return{r:Gn(255*[r,s,a,a,u,r][l]),g:Gn(255*[u,r,r,s,a,a][l]),b:Gn(255*[a,a,u,r,r,s][l]),a:Gn(i,2)}},Bg=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Bee=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Gn(60*(s<0?s+6:s)),s:Gn(o?a/o*100:0),v:Gn(o/255*100),a:i}},Fee=de.memo(function(e){var t=e.hue,n=e.onChange,r=V2(["react-colorful__hue",e.className]);return de.createElement("div",{className:r},de.createElement(E9,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:xu(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuetext":Gn(t)},de.createElement(R9,{className:"react-colorful__hue-pointer",left:t/360,color:J1({h:t,s:100,v:100,a:1})})))}),$ee=de.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:J1({h:t.h,s:100,v:100,a:1})};return de.createElement("div",{className:"react-colorful__saturation",style:r},de.createElement(E9,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:xu(t.s+100*i.left,0,100),v:xu(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Gn(t.s)+"%, Brightness "+Gn(t.v)+"%"},de.createElement(R9,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:J1(t)})))}),A9=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Hee(e,t,n){var r=Q1(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var l=e.toHsva(t);s.current={hsva:l,color:t},a(l)}},[t,e]),w.useEffect(function(){var l;A9(o,s.current.hsva)||e.equal(l=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:l},r(l))},[o,e,r]);var u=w.useCallback(function(l){a(function(c){return Object.assign({},c,l)})},[]);return[o,u]}var Zc,Uee=typeof window<"u"?w.useLayoutEffect:w.useEffect,Vee=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Wee=function(){Uee(function(){if(typeof document<"u"&&!Zc){(Zc=document.createElement("style")).innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var e=Vee();e&&Zc.setAttribute("nonce",e),document.head.appendChild(Zc)}},[])},qee=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=_9(e,["className","colorModel","color","onChange"]);Wee();var s=Hee(n,i,o),u=s[0],l=s[1],c=V2(["react-colorful",t]);return de.createElement("div",Np({},a,{className:c}),de.createElement($ee,{hsva:u,onChange:l}),de.createElement(Fee,{hue:u.h,onChange:l,className:"react-colorful__last-control"}))},Kee={defaultColor:"000",toHsva:function(e){return Bee(jg(e))},fromHsva:function(e){return n=(t=jee(e)).g,r=t.b,"#"+Bg(t.r)+Bg(n)+Bg(r);var t,n,r},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||A9(jg(e),jg(t))}},Gee=function(e){return de.createElement(qee,Np({},e,{colorModel:Kee}))};function Fg({top:e,floating:t,title:n}){const{navbarTop:r,setNavbarTop:i,navbarFloating:o,setNavbarFloating:a}=ot();return f(Yee,{title:n,current:r===e&&o===t,onClick:()=>{i(e),a(t)},children:f("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t?f("rect",{x:"10",y:"60",width:"60",height:"10",rx:"5"}):f("rect",{x:"0",y:e?"0":"70",width:"80",height:"10"})})})}const Yee=B.button.withConfig({displayName:"NavStyleButtonStyling",componentId:"sc-17dvmt7-0"})(["rect{fill:",";}&:hover{border-color:",";}&:active{border-color:",";}background-color:",";cursor:pointer;border:solid 1px ",";border-radius:",";padding:0;overflow:hidden;line-height:0;"],e=>e.current?e.theme.colors.main:e.theme.colors.bg2,e=>e.theme.colors.mainLight,e=>e.theme.colors.mainDark,e=>e.theme.colors.bg,e=>e.current?e.theme.colors.mainLight:e.theme.colors.bg2,e=>e.theme.radius);function Xee({checked:e,onChange:t,...n}){return f(Qee,{type:"checkbox",checked:e,onChange:i=>{t(i.target.checked)},...n})}const Qee=B.input.withConfig({displayName:"InputCheckBox",componentId:"sc-1ojbznu-0"})(["--inset:1px;--size:calc(100% - (var(--inset) * 2));background-color:",";appearance:none;border:1px solid ",";width:1rem;height:1rem;border-radius:3px;position:relative;:checked{border:none;}:checked::before{content:'';position:absolute;inset:0;width:100%;height:100%;border-radius:2px;background-color:",";}:checked::after{--inset:3px;--size:calc(100% - (var(--inset) * 2));content:'';position:absolute;inset:var(--inset);width:var(--size);height:var(--size);background-color:",";clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0%,43% 62%);}"],e=>e.theme.colors.bg1,e=>e.theme.colors.bg2,e=>e.theme.colors.main,e=>e.theme.colors.bg),Jee=B.label.withConfig({displayName:"CheckboxLabel",componentId:"sc-1ojbznu-1"})(["display:flex;align-items:center;gap:0.5rem;cursor:pointer;"]),Zee=()=>{const{darkModeSetting:e,setDarkMode:t,viewTransitionsEnabled:n,setViewTransitionsEnabled:r}=ot();return O(_t,{children:[f("h1",{children:"Theme Settings"}),O(Nn,{children:[f(ed,{children:"Dark mode"}),O(Ht,{children:[f(ve,{subtle:e!==Al.auto,onClick:()=>t(void 0),title:"Use the browser's / OS dark mode settings",children:"🌓 auto"}),f(ve,{subtle:e!==Al.always,onClick:()=>t(!0),children:"🌑 on"}),f(ve,{subtle:e!==Al.never,onClick:()=>t(!1),children:"🌕 off"})]}),f(ed,{children:"Navigation bar position"}),O(Ht,{children:[f(Fg,{floating:!0,top:!1,title:"Floating"}),f(Fg,{floating:!1,top:!1,title:"Bottom"}),f(Fg,{floating:!1,top:!0,title:"Top"})]}),f(ed,{children:"Main color"}),f(ete,{}),f(ed,{children:"Animations"}),O(Jee,{children:[f(Xee,{checked:n,onChange:i=>r(i)})," ","Enable view transitions"]})]})]})},ete=()=>{const{mainColor:e,setMainColor:t}=ot();return f(Gee,{color:e,onChange:n=>t(n)})},ed=B.h2.withConfig({displayName:"Heading",componentId:"sc-syovf1-0"})(["font-size:1em;margin:0;margin-top:1rem;"]);function tte(){const[e]=kr(),t=Ce(e),[n,r]=w.useState(void 0),i=Et();function o(a){if(a.preventDefault(),!n)throw new Error("No subject input");i(Ay(n))}return O(ye,{children:[f(v9,{resource:t}),f(_t,{children:e?O(ye,{children:[f(js,{resource:t,prefix:"Edit"}),f(E2,{resource:t}),f(lp,{resource:t},e)]}):O("form",{onSubmit:o,children:[f("h1",{children:"edit a resource"}),f(Jn,{value:n||void 0,onChange:a=>r(a.target.value),placeholder:"Enter a Resource URL..."})]})})]})}function nte({resource:e}){const[t,n]=de.useState(!1);return O(ye,{children:[O(ve,{onClick:()=>n(!t),children:[t?f(Sy,{}):f(ky,{})," children"]}),t&&f(rte,{resource:e})]})}function rte({resource:e}){const t=zk(e);return f(Ci,{children:f(Ss,{children:t.map(n=>f(Do,{children:f(Yt,{subject:n})},n))})})}function ite(){const[e]=kr(),t=Ce(e),[n,r]=w.useState(void 0),[i,o]=w.useState(!1),[a,s]=w.useState(void 0),{agent:u}=ot(),l=We();if(t.loading)return O(_t,{children:["Loading ",e,"..."]});if(t.error)return f(_t,{children:f(Lt,{children:t.error.message})});async function c(h){let p={};p.Accept=h,u&&(p=await H0(e,u,p)),o(!0);try{const g=await(await window.fetch(e,{headers:p})).text();o(!1),r(g),s(void 0)}catch(y){o(!1),s(y)}}return O(_t,{about:e,children:[f(js,{resource:t,prefix:"Data for",link:!0}),O(Ad,{columns:!0,children:[f(Td,{title:"The URL of the resource",children:"subject:"}),f(Ve,{subject:e,children:e})]}),f(Os,{resource:t,editable:!0,columns:!0}),f(nte,{resource:t}),t.getCommitBuilder().hasUnsavedChanges()?O(ye,{children:[f("h2",{children:"⚠️ contains uncommitted changes"}),f("p",{children:"This means that (some) of your local changes are not yet saved."}),t.commitError&&f(xt,{children:t.commitError.message}),f(ve,{onClick:()=>t.save(l),children:"save"})]}):null,O(Ht,{wrapItems:!0,children:[f(ve,{subtle:!0,onClick:()=>c("application/ad+json"),"data-test":"fetch-json-ad",children:"JSON-AD"}),f(ve,{subtle:!0,onClick:()=>c("application/json"),"data-test":"fetch-json",children:"JSON"}),f(ve,{subtle:!0,onClick:()=>c("application/ld+json"),"data-test":"fetch-json-ld",children:"JSON-LD"}),f(ve,{subtle:!0,onClick:()=>c("text/turtle"),"data-test":"fetch-turtle",children:"Turtle / N-triples / N3"})]}),a&&f(xt,{children:a.message}),!a&&n&&f(Dp,{content:n,loading:i})]})}const ote=()=>O(_t,{children:[f("h1",{children:"Keyboard shortcuts"}),f("h3",{children:"Global"}),O("p",{children:[f(sr,{shortcut:st.search})," Search"]}),O("p",{children:[f(sr,{shortcut:st.sidebarToggle})," Show or hide the sidebar"]}),O("p",{children:[f(sr,{shortcut:"?"})," Show these keyboard shortcuts"]}),O("p",{children:[f(sr,{shortcut:st.edit})," ",f("b",{children:"E"}),"dit resource"]}),O("p",{children:[f(sr,{shortcut:st.data})," Show ",f("b",{children:"d"}),"ata for resource"]}),O("p",{children:[f(sr,{shortcut:st.home})," Show ",f("b",{children:"h"}),"ome page"]}),O("p",{children:[f(sr,{shortcut:st.new})," ",f("b",{children:"N"}),"ew resource"]}),O("p",{children:[f(sr,{shortcut:st.menu})," Open ",f("b",{children:"m"}),"enu"]}),O("p",{children:[f(sr,{shortcut:st.userSettings})," ",f("b",{children:"U"}),"ser settings"]}),O("p",{children:[f(sr,{shortcut:st.themeSettings})," ",f("b",{children:"T"}),"heme settings"]}),f("h3",{children:"Document"}),O("p",{children:[f(sr,{shortcut:st.moveLineUp})," Move line / section up"]}),O("p",{children:[f(sr,{shortcut:st.moveLineDown})," Move line / section down"]}),O("p",{children:[f(sr,{shortcut:st.deleteLine})," Delete line"]})]}),sr=B(Fx).withConfig({displayName:"Key",componentId:"sc-qpxn53-0"})(["font-size:1rem;"]);function ate(){const{pathname:e,search:t}=ka(),n=window.location.origin+e+t;return f(U2,{subject:n},n)}const ste=()=>{var m;const{agent:e,setAgent:t}=ot(),[n,r]=w.useState(void 0),[i,o]=w.useState(void 0),[a,s]=w.useState(void 0),[u,l]=w.useState(!1),[c,h]=w.useState(!1),[p,y]=w.useState(void 0),g=Et();w.useEffect(()=>{e!==void 0?_():y("")},[e]),w.useEffect(()=>{b()},[n,i]);function b(){e&&y(e.buildSecret())}function _(){try{if(!e)throw new Error("No agent set");r(e.subject),o(e.privateKey)}catch(x){const A=new Error("Cannot fill subject and privatekey fields."+x);s(A),r("")}}function S(){window.confirm("If you sign out, your secret will be removed. If you haven't saved your secret somewhere, you will lose access to this User. Are you sure you want to sign out?")&&(t(void 0),s(void 0),r(""),o(""))}function k(x,A){JSON.stringify(x)!==JSON.stringify(A)&&t(A)}async function C(){b(),s(void 0);try{const x=new sf(i,n);await x.getPublicKey(),await x.verifyPublicKeyWithServer(),k(e,x)}catch(x){const A=new Error("Invalid Agent"+x);s(A)}}function d(){p&&navigator.clipboard.writeText(p)}async function v(x){if(y(x),x===""){y(""),s(void 0);return}s(void 0);try{const A=sf.fromSecret(x);k(e,A),o(A.privateKey),r(A.subject)}catch(A){const D=new Error("Invalid secret. "+A);s(D)}}return f(_t,{children:O("form",{children:[f("h1",{children:"User Settings"}),f("p",{children:"An Agent is a user, consisting of a Subject (its URL) and Private Key. Together, these can be used to edit data and sign Commits."}),e?O(ye,{children:[((m=e.subject)==null?void 0:m.startsWith("http://localhost"))&&O("p",{children:[f(Lt,{children:"Warning:"}),"You're using a local Agent, which cannot authenticate on other domains, because its URL does not resolve."]}),O(Jx,{children:[f(wx,{})," You","'","re signed in as"]}),f("p",{children:f(Yt,{subject:e.subject})}),f(ve,{onClick:()=>g(Wh(e.subject)),children:"Edit profile"}),f(cY,{})]}):O("p",{children:["You can create your own Agent by hosting an"," ",f(Ve,{href:"https://github.com/atomicdata-dev/atomic-data-rust/tree/master/server",children:"atomic-server"}),". Alternatively, you can use"," ",f(Ve,{subject:"https://atomicdata.dev/invites",children:"an Invite"})," ","to get a guest Agent on someone else","'s"," Atomic Server."]}),f(ii,{label:e?"Agent Secret":"Enter your Agent Secret",helper:"The Agent Secret is a long string of characters that encodes both the Subject and the Private Key. You can think of it as a combined username + password. Store it safely, and don't share it with others.",error:a,children:O(un,{children:[f(Jn,{value:p,onChange:x=>v(x.target.value),type:u?"text":"password",disabled:e!==void 0,name:"secret",id:"current-password",autoComplete:"current-password",spellCheck:"false"}),f(ta,{type:"button",title:u?"Hide secret":"Show secret",onClick:()=>l(!u),children:u?f(mw,{}):f(s1,{})}),f(ta,{type:"button",title:c?"Hide advanced":"Show advanced",onClick:()=>h(!c),children:f(xy,{})}),e&&f(ta,{type:"button",onClick:d,children:"copy"})]})}),c?O(w.Fragment,{children:[f(ii,{label:"Subject URL",helper:"The link to your Agent, e.g. https://atomicdata.dev/agents/someAgent",children:f(un,{children:f(Jn,{disabled:e!==void 0,value:n,onChange:x=>{r(x.target.value),C()}})})}),f(ii,{label:"Private Key",helper:"The private key of the Agent, which is a Base64 encoded string.",children:O(un,{children:[f(Jn,{disabled:e!==void 0,type:u?"text":"password",value:i,onChange:x=>{o(x.target.value),C()}}),f(ta,{type:"button",title:u?"Hide private key":"Show private key",onClick:()=>l(!u),children:u?f(mw,{}):f(s1,{})})]})})]}):null,e&&f(ve,{subtle:!0,title:"Sign out with current Agent and reset this form",onClick:S,"data-test":"sign-out",children:"sign out"})]})})};function lte(e){const t=document.getElementById(e);if(t)return t;const n=document.createElement("style");return n.setAttribute("id",e),document.head.appendChild(n),n}function ute(e,t){const n=lte(e);n.innerHTML=t}function cte(e,t,n){return i=>{const o=`cq-${e}`;if(w.useInsertionEffect(()=>{const u=` @${CSS.supports("container-type","inline-size")?"container":"media"} (${t}) { ${e} { ${n} } } - `;Zee(o,u)},[]),!i)throw new Error("Props are required");return f(e,{...i,children:i.children})}}var ra=(e=>(e[e.CONNECTING=WebSocket.CONNECTING]="CONNECTING",e[e.OPEN=WebSocket.OPEN]="OPEN",e[e.CLOSING=WebSocket.CLOSING]="CLOSING",e[e.CLOSED=WebSocket.CLOSED]="CLOSED",e))(ra||{});function tte(e){switch(e){case ra.OPEN:return[f(Fm,{color:"#3AA55D",title:"Websocket Connected"},"connected"),"green"];case ra.CLOSING:return[f(Fm,{color:"orange",title:"Websocket Closing"},"closing"),"#FAA81A"];case ra.CLOSED:return[f(rx,{color:"red",title:"Websocket Closed"},"closed"),"#ED4245"];case ra.CONNECTING:default:return[f(Fm,{color:"gray",title:"Websocket Connecting..."},"connecting"),"gray"]}}function nte({subject:e,className:t}){var u;const n=Ke(),{drive:r}=ot(),[i,o]=w.useState(((u=n.getWebSocketForSubject(e))==null?void 0:u.readyState)??ra.CONNECTING);w.useEffect(()=>{const l=n.getWebSocketForSubject(e);if(!l)return o(ra.CONNECTING);o(l==null?void 0:l.readyState);const c=setInterval(()=>{l.readyState!==i&&o(l.readyState)},1e3);return()=>{clearInterval(c)}},[r,n]);const[a,s]=tte(i);return f(rte,{color:s,className:t,children:a})}const rte=B.div.withConfig({displayName:"IconWrapper",componentId:"sc-17ggfk4-0"})(["display:contents;color:",";font-size:1rem;"],e=>e.color);function ite({subject:e,className:t}){const[n,r,i]=Yh(),[o,a,s]=Dy(),u=n.includes(e),l=u?hD:vD,c=w.useCallback(()=>{u?(i(e),a(e)):(r(e),s(e))},[e,n,s,a,r,i]);return f(ote,{className:t,onClick:c,title:u?"Remove from favorites":"Add to favorites",children:f(l,{})})}const ote=B.button.withConfig({displayName:"StyledButton",componentId:"sc-1w6hm3s-0"})(["background:none;border:none;cursor:pointer;color:",";width:1.3rem;display:flex;align-items:center;padding:0;"],e=>e.theme.colors.main);function ate({subject:e,onClick:t,disabled:n}){return M(ste,{children:[f(fte,{subject:e}),f(ute,{children:e}),f(cte,{onClick:()=>t(e),disabled:n,children:"Select"}),f(lte,{subject:e}),f(dte,{subject:e})]})}const ste=ete(B.div.withConfig({displayName:"DriveRowWrapper",componentId:"sc-k2ynk0-0"})(["--title-font-weight:500;display:grid;grid-template-areas:'title ws subject button icon';grid-template-columns:20ch 1.3rem auto 10ch 1.3rem;gap:","rem;align-items:center;padding-block:0.3rem;"],e=>e.theme.margin),"max-width: 500px",Jn(["grid-template-areas:'ws title icon' 'subject subject subject' 'button button button';grid-template-columns:1.3rem auto 1rem;padding-block:1rem;--title-font-weight:bold;"])),lte=B(ite).withConfig({displayName:"StyledFavoriteButton",componentId:"sc-k2ynk0-1"})(["grid-area:icon;"]),ute=B.span.withConfig({displayName:"Subject",componentId:"sc-k2ynk0-2"})(["grid-area:subject;color:",";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"],e=>e.theme.colors.textLight),cte=B(ve).withConfig({displayName:"SelectButton",componentId:"sc-k2ynk0-3"})(["grid-area:button;background-color:",";color:",";align-self:flex-end;"],e=>e.disabled?e.theme.colors.main:"transparent",e=>e.disabled?"white":e.theme.colors.main),dte=B(nte).withConfig({displayName:"StyledWSIndicator",componentId:"sc-k2ynk0-4"})(["grid-area:ws;"]),fte=B(Yt).withConfig({displayName:"Title",componentId:"sc-k2ynk0-5"})(["grid-area:title;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--title-font-weight);"]);function x6({drives:e,onDriveSelect:t,showNewOption:n}){const{drive:r}=ot();return e.length===0?f("span",{children:"Nothing to show"}):f(hte,{children:M(ys,{children:[e.map((i,o)=>f(Do,{noBorder:o===0,children:f(ate,{subject:i,onClick:t,disabled:i===r})},i)),n&&f(Do,{children:f(pte,{klass:J.classes.drive,subtle:!0,icon:!0,label:"New Drive"})})]})})}const hte=B(Lo).withConfig({displayName:"ContainerCard",componentId:"sc-y1wkzd-0"})(["container-type:inline-size;padding-top:0;"]),pte=B(du).withConfig({displayName:"StyledNewInstanceButton",componentId:"sc-y1wkzd-1"})(["border:none;box-shadow:none;padding:0;&&:hover,&&:focus{box-shadow:none;}"]);function mte(){const{drive:e,setDrive:t}=ot(),n=_t(),[r,i]=w.useState(e),[o,a]=w.useState(),[s]=Yh(),[u,l]=Dy(s);function c(h){try{t(h),i(h),l(h),n($t(h))}catch(p){a(p)}}return M(ba,{children:[f(Fg,{children:"Drive Configuration"}),M(qx,{children:[f(Kx,{children:"Current Drive"}),M(Ut,{children:[f(un,{children:f(Xn,{"data-test":"server-url-input",value:r,onChange:h=>i(h.target.value)})}),f(ve,{onClick:()=>c(r),disabled:e===r,"data-test":"server-url-save",children:"Save"})]})]}),f(xt,{children:o==null?void 0:o.message}),f(Fg,{as:"h2",children:"Saved"}),f(x6,{showNewOption:!0,drives:s,onDriveSelect:h=>c(h)}),f(Fg,{as:"h2",children:"Other"}),f(x6,{drives:u,onDriveSelect:h=>c(h)})]})}const Fg=B.h1.withConfig({displayName:"Heading",componentId:"sc-1s49c6h-0"})(["margin:0;margin-bottom:1rem;"]);function gte({target:e}){const t=Ce(void 0,{newResource:!0}),n=Ke(),[r,i]=w.useState(void 0),[o]=_k(),[a,s]=w.useState(void 0);async function u(){await t.set(G.isA,[J.classes.invite],n),await t.set(G.read,[J.instances.publicAgent],n),await t.set(G.invite.target,e.getSubject(),n),t.setSubject(n.createSubject("invite"));try{if(!o)throw new Error("No agent found");await t.set(G.parent,o.subject,n),await t.save(n),navigator.clipboard.writeText(t.getSubject()),dt.success("Copied to clipboard"),s(t.getSubject())}catch(l){i(l)}}return t.new?M(Lo,{children:[f(Rr,{label:"Give edit rights",propertyURL:J.properties.invite.write,resource:t}),f(Rr,{label:"Invite text (optional)",propertyURL:J.properties.description,resource:t}),f(Rr,{label:"How many times this link can be used. No value = no limit.",propertyURL:J.properties.invite.usagesLeft,resource:t}),f(ve,{onClick:u,children:"Create Invite"}),r&&f("p",{children:f(Nt,{children:r.message})})]}):M(Lo,{children:[f("p",{children:"Invite created and copied to clipboard! Send it to your buddy:"}),f(Lp,{content:a,"data-test":"invite-code"})]})}function vte(){const[e]=Ur(),t=Ce(e),n=Ke(),[r]=Wi(t),[i,o]=w.useState(!1),[a,s]=w.useState(void 0),u=_t(),l={commit:!1,handleValidationError:s},[c,h]=it(t,J.properties.write,l),[p,y]=it(t,J.properties.read,l),[g,b]=w.useState([]);if(w.useEffect(()=>{async function C(){const m=(await t.getRights(n)).filter(x=>x.setIn!==e).sort((x,A)=>x.for===J.instances.publicAgent?-1:1);b(m)}C()},[t]),!e)return f(be,{children:"No subject passed"});function _(C,d,v){let m=d?c:p;v?(m=m.filter(x=>x!==C),m.push(C)):m=m.filter(x=>x!==C),d?h(m):y(m)}function S(){const C=new Map;C.set(J.instances.publicAgent,{read:!1,write:!1}),p.map(m=>{C.set(m,{read:!0,write:!1})}),c.map(m=>{const x=C.get(m);C.set(m,{read:x?x.read:!1,write:!0})});const d=[];return C.forEach((m,x)=>{d.push({agentSubject:x,read:m.read,write:m.write})}),d.sort(m=>m.agentSubject===J.instances.publicAgent?-1:1)}async function k(){try{await t.save(n),dt.success("Share settings saved"),u($t(e))}catch(C){dt.error(C.message)}}return M(Ot,{children:[f(Gu,{resource:t,prefix:"Share settings",link:!0}),r&&!i&&f(ve,{onClick:()=>o(!0),children:"Send Invite..."}),i&&f(gte,{target:t}),M(Lo,{children:[f(E6,{text:"rights set here:"}),f(ys,{children:S().map(C=>f(C6,{...C,handleSetRight:r&&t.isReady()?_:void 0},JSON.stringify(C)))})]}),r&&f(ve,{disabled:!t.getCommitBuilder().hasUnsavedChanges(),onClick:k,children:"Save"}),a&&f(Nt,{children:a.message}),g.length>0&&M(Lo,{children:[f(E6,{text:"inherited rights:"}),f(ys,{children:g.map(C=>f(C6,{inheritedFrom:C.setIn,read:C.type==="read",write:C.type==="write",agentSubject:C.for},C.for+C.type))})]})]})}function C6({handleSetRight:e,agentSubject:t,inheritedFrom:n,read:r,write:i}){const o=t===J.instances.publicAgent,s=!Ce(t).isReady()||!e;return f(Do,{children:M("div",{style:{display:"flex"},"data-test":o?"right-public":null,children:[M("div",{style:{flex:1},children:[o?M(be,{children:[f(eD,{})," Public (anyone)"," "]}):f(Yt,{subject:t}),n&&M(be,{children:[" (via ",f(Yt,{subject:n}),") "]})]}),M("div",{style:{alignSelf:"flex-end"},children:[f(_6,{type:"checkbox",disabled:s,onChange:u=>e&&e(t,!1,u.target.checked),checked:r,title:r?"Read access. Toggle to remove access.":"No read access. Toggle to give read access."}),f(_6,{type:"checkbox",disabled:s,onChange:u=>e&&e(t,!0,u.target.checked),checked:i,title:i?"Write access. Toggle to remove access.":"No write access. Toggle to give write access."})]})]})})}const _6=B.input.withConfig({displayName:"StyledCheckbox",componentId:"sc-o8zyz7-0"})(["width:2rem;"]);function E6({text:e}){return M("div",{style:{display:"flex",flexDirection:"row",flex:1,marginBottom:"1rem"},children:[f("div",{style:{flex:1,fontWeight:"bold"},children:e}),M("div",{style:{alignSelf:"flex-end",justifyContent:"center"},children:[f("span",{children:"read "}),f("span",{children:"write"})]})]})}const yte=()=>{const[e,t]=w.useState(""),{agent:n}=ot(),[r]=iy();return w.useEffect(()=>{async function i(){if(n){const o=await Jv(r,n);t(btoa(JSON.stringify(o)))}}i()},[n]),f(Ot,{children:f(Lp,{content:e})})},bte=window.location.origin,wte=!1;function Ste(){return M(vT,{children:[f(kn,{path:$e.new,element:f(xee,{})}),f(kn,{path:$e.themeSettings,element:f(Hee,{})}),f(kn,{path:$e.agentSettings,element:f(Qee,{})}),f(kn,{path:$e.serverSettings,element:f(mte,{})}),f(kn,{path:$e.shortcuts,element:f(Yee,{})}),f(kn,{path:$e.data,element:f(Gee,{})}),f(kn,{path:$e.edit,element:f(Vee,{})}),f(kn,{path:$e.import,element:f(d9,{})}),f(kn,{path:$e.share,element:f(vte,{})}),f(kn,{path:$e.show,element:f(See,{})}),f(kn,{path:$e.about,element:f(w9,{})}),f(kn,{path:$e.search,element:f(b9,{})}),f(kn,{path:$e.token,element:f(yte,{})}),wte,f(kn,{path:"/",element:f(M2,{subject:bte})}),f(kn,{path:"*",element:f(Xee,{})})]})}const _9=({onClick:e,isActive:t,menuId:n},r)=>f(yd,{"aria-controls":n,selected:t,ref:r,title:`Open menu (${st.menu})`,type:"button","data-test":"context-menu",onClick:e,rightPadding:!0,children:f(_y,{})});_9.displayName="MenuBarDropdownTrigger";const kte=()=>{const e=w.useRef(null);return[e,()=>{e.current&&e.current.focus()}]};function xte({onFocus:e,onBlur:t,subject:n}){const[r,i]=w.useState(""),[o]=cx(),{scope:a,clearScope:s}=Gh(),[u,l]=kte(),c=_t();function h(g){g.target.select()}function p(g){i(g.target.value);try{dn.tryValidSubject(g.target.value),c($t(g.target.value),{replace:!0})}catch{c(yD(g.target.value,a),{replace:!0})}}const y=g=>{n&&(g.preventDefault(),u.current.blur(),document.activeElement.blur(),c($t(n)))};return je(st.search,g=>{g.preventDefault(),u.current.select(),l()}),je("esc",g=>{g.preventDefault(),u.current.blur()},{enableOnTags:["INPUT"]}),je("backspace",g=>{(r===void 0||r.length===0)&&a&&s()},{enableOnTags:["INPUT"]}),w.useEffect(()=>{i(o||n),(o||a)&&l()},[o,a,n]),M(_te,{onSubmit:y,autoComplete:"off",children:[a&&f(Cte,{subject:a,onClick:s}),f(J1,{autoComplete:"false",ref:u,type:"search","data-test":"address-bar",name:"search","aria-label":"Search",onClick:h,onFocus:e,onBlur:t,value:r||"",onChange:p,placeholder:'Enter an Atomic URL or search (press "/" )'})]})}function Cte({subject:e,onClick:t}){const n=Ce(e),[r]=Xe(n);return M(Ete,{children:[M("span",{children:["in:",r," "]}),f(oi,{onClick:t,title:"Clear scope",variant:uu.Fill,color:"textLight",size:"0.8rem",children:f(Mu,{})})]})}const J1=B.input.withConfig({displayName:"Input",componentId:"sc-1fr6pcx-0"})(["border:none;font-size:0.9rem;padding:0.4rem 1.2rem;color:",";width:100%;flex:1;min-width:1rem;background-color:",";outline:0;color:",";"],e=>e.theme.colors.text,e=>e.theme.colors.bg,e=>e.theme.colors.textLight),_te=B.form.withConfig({displayName:"Form",componentId:"sc-1fr6pcx-1"})(["flex:1;height:100%;display:flex;align-items:center;padding-inline:1rem;border-radius:999px;:hover{box-shadow:inset 0 0 0 2px ",";","{color:",";}}:focus-within{","{color:",";}outline:none;box-shadow:inset 0 0 0 2px ",";}"],e=>KO(.6,e.theme.colors.main),J1,e=>e.theme.colors.text,J1,e=>e.theme.colors.text,e=>e.theme.colors.main),Ete=B.span.withConfig({displayName:"Tag",componentId:"sc-1fr6pcx-2"})(["background-color:",";border-radius:",";padding:0.2rem 0.5rem;display:flex;flex-direction:row;align-items:center;gap:0.3rem;span{max-width:15ch;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}"],e=>e.theme.colors.bg1,e=>e.theme.radius);function Rte({children:e}){const{navbarTop:t,navbarFloating:n}=ot(),r=w.useRef(null),i=ka();return w.useEffect(()=>{var o;(o=r==null?void 0:r.current)==null||o.scrollTo(0,0)},[i]),M(be,{children:[t&&f(R6,{}),M(Ite,{children:[f(bN,{}),M(Ate,{ref:r,navbarTop:t,navbarFloating:n,children:[f(vf,{position:"top"}),e]})]}),!t&&f(R6,{})]})}const Ate=B.div.withConfig({displayName:"Content",componentId:"sc-1oh1dv8-0"})(["display:block;flex:1;overflow-y:auto;"]);function R6(){const[e]=Ur(),t=Vh(),{navbarTop:n,navbarFloating:r,sideBarLocked:i,setSideBarLocked:o}=ot(),[a,s]=w.useState(!0),u=Qh("(display-mode: standalone) or (display-mode: fullscreen)"),l=w.useMemo(()=>u||window.navigator.standalone||document.referrer.includes("android-app://")||gx(),[u]);function c(p){p.target.getBoundingClientRect().width<280&&s(!1)}return M(r?Tte:Pte,{top:n,"aria-label":"search",floating:r,children:[a&&M(w.Fragment,{children:[f(yd,{leftPadding:!0,type:"button",onClick:()=>o(!i),title:`Show / hide sidebar (${st.sidebarToggle})`,"data-test":"sidebar-toggle",children:f(VL,{})}),l&&M(be,{children:[f(yd,{type:"button",title:"Go back",onClick:()=>t(-1),children:f(Zk,{})})," ",f(yd,{type:"button",title:"Go forward",onClick:()=>t(1),children:f(ex,{})})]})]}),f(xte,{subject:e,onFocus:c,onBlur:()=>s(!0)}),a&&e&&f(Ox,{isMainMenu:!0,subject:e,trigger:_9})]})}const E9=B.div.withConfig({displayName:"NavBarBase",componentId:"sc-1oh1dv8-1"})(["position:fixed;z-index:",";height:2.5rem;display:flex;border:solid 1px ",";background-color:",";view-transition-name:navbar;"],e=>e.theme.zIndex.sidebar,e=>e.theme.colors.bg2,e=>e.theme.colors.bg),Tte=B(E9).withConfig({displayName:"NavBarFloating",componentId:"sc-1oh1dv8-2"})(["box-shadow:",";box-sizing:border-box;border-radius:999px;overflow:hidden;max-width:calc(100% - 2rem);width:","rem;margin:auto;left:50%;margin-left:-","rem;margin-right:-","rem;top:",";bottom:",";@media (max-width:","rem){max-width:calc(100% - 1rem);left:auto;right:auto;margin-left:0.5rem;bottom:0.5rem;}"],e=>e.theme.boxShadow,e=>e.theme.containerWidth+1,e=>(e.theme.containerWidth+1)/2,e=>(e.theme.containerWidth+1)/2,e=>e.top?"2rem":"auto",e=>e.top?"auto":"1rem",e=>e.theme.containerWidth),Pte=B(E9).withConfig({displayName:"NavBarFixed",componentId:"sc-1oh1dv8-3"})(["top:",";bottom:",";left:0;right:0;border-width:0;border-bottom:",";border-top:",";"],e=>e.top?"0":"auto",e=>e.top?"auto":"0",e=>e.top?"solid 1px "+e.theme.colors.bg2:"none",e=>e.top?"none":"solid 1px "+e.theme.colors.bg2),Ite=B("div").withConfig({displayName:"SideBarWrapper",componentId:"sc-1oh1dv8-4"})(["display:flex;height:100vh;position:fixed;top:0;bottom:0;left:0;right:0;"]);function Ote(){const{mainColor:e,darkMode:t}=ot(),[n]=Ur(),r=Ce(n);let[i]=Xe(r),[o]=ye(r,G.description);const a=r.isReady()&&r.getSubject()!==Li;return i=a&&i?i:"Atomic Data",o=a&&o?o:"The easiest way to create and share linked data.",M(fd,{children:[f("title",{children:i}),f("meta",{name:"theme-color",content:t?"black":"white"}),f("meta",{name:"theme-color",content:t?"black":"white"}),f("meta",{name:"apple-mobile-web-app-status-bar-style",content:t?"black":"default"}),f("meta",{name:"msapplication-TileColor",content:e}),f("meta",{name:"description",content:o}),f("meta",{property:"og:title",content:i}),f("meta",{property:"og:description",content:o}),f("meta",{property:"og:url",content:n})]})}function Lte(){const e=CO();return f(zL,{position:"bottom-right",toastOptions:{style:{zIndex:Zx.toast,background:e.colors.bg,color:e.colors.text,wordBreak:"break-word"}},children:t=>f(Xk,{toast:t,style:{...t.style,border:`solid 1px ${e.colors.bg2}`,position:"relative",animation:t.visible?"toast-enter .5s ease":"toast-exit 1s ease"},children:({icon:n,message:r})=>f(Dte,{icon:n,message:r,t})})})}function Dte({icon:e,message:t,t:n}){let r=t.props.children;function i(){dt.success("Copied error to clipboard"),navigator.clipboard.writeText(t.props.children),dt.dismiss(n.id)}return r.length>100&&(r=r.substring(0,100)+"..."),M(be,{children:[e,r,n.type!=="loading"&&M("div",{style:{flex:1,flexDirection:"column"},children:[f(ve,{title:"Clear",subtle:!0,onClick:()=>dt.dismiss(n.id),children:f(Mu,{})}),n.type!=="success"&&f(ve,{title:"Copy",subtle:!0,onClick:i,children:f(xy,{})})]})]})}const Mte=({children:e})=>{const t=w.useRef(null);return M(My.Provider,{value:t,children:[e,f(Nte,{ref:t})]})},Nte=B.div.withConfig({displayName:"StyledDiv",componentId:"sc-3rziwd-0"})(["display:contents;"]),Z1="agent";function zte(){const e=localStorage.getItem(Z1);if(e)try{return of.fromSecret(e)}catch(t){console.error(t);return}}function jte(e){e?localStorage.setItem(Z1,e.buildSecret()):localStorage.removeItem(Z1)}const Bte=e=>{Jx(e);const t=e.message;dt.error(t)};function Fte(e){return async t=>{const n=t.get(J.properties.parent);if(!Ya(n))throw new Error(`Resource doesn't have a parent: ${t.getSubject()} `);const r=await e.getResourceAsync(n);r.getSubjects(J.properties.subResources).includes(t.getSubject())||(await r.pushPropVal(J.properties.subResources,t.getSubject()),await r.save(e))}}function $te(e){return async t=>{const n=t.get(J.properties.parent);if(!Ya(n))throw new Error(`Resource doesn't have a parent: ${t.getSubject()} `);const r=await e.getResourceAsync(n),i=r.getSubjects(J.properties.subResources);await r.set(J.properties.subResources,i.filter(o=>o!==t.getSubject()),e),r.save(e)}}function Ute(e){e.on(dr.ResourceManuallyCreated,Fte(e)),e.on(dr.ResourceRemoved,$te(e)),e.on(dr.Error,Bte),e.on(dr.AgentChanged,jte)}function Hte(e){return _e({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23.64 7c-.45-.34-4.93-4-11.64-4-1.5 0-2.89.19-4.15.48L18.18 13.8 23.64 7zm-6.6 8.22L3.27 1.44 2 2.72l2.05 2.06C1.91 5.76.59 6.82.36 7l11.63 14.49.01.01.01-.01 3.9-4.86 3.32 3.32 1.27-1.27-3.46-3.46z"}}]})(e)}function Wte(){const[e,t]=w.useState(navigator.onLine);return w.useEffect(()=>{const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}},[]),e}function Vte(){const e=Wte();return w.useEffect(()=>{e||dt.error("You are offline, changes might not be persisted.")},[e]),f(Kte,{shown:!e,children:f(Hte,{title:"No Internet Connection."})})}const qte=Lu(["0%{opacity:1;filter:drop-shadow(0 0 5px var(--shadow-color));}100%{opacity:0.8;filter:drop-shadow(0 0 0 var(--shadow-color));}"]),Kte=B.div.withConfig({displayName:"Wrapper",componentId:"sc-1pc77w9-0"})(["--shadow-color:",";position:fixed;bottom:1.2rem;right:2rem;z-index:",";font-size:1.5rem;color:",";pointer-events:",";transition:opacity 0.1s ease-in-out;opacity:",";background-color:",";border:1px solid ",";border-radius:50%;display:grid;place-items:center;box-shadow:",";padding:0.5rem;svg{animation:"," 1.5s alternate ease-in-out infinite;animation-play-state:",";}"],e=>gi(.15,e.theme.colors.alert),({theme:e})=>e.zIndex.networkIndicator,e=>e.theme.colors.alert,e=>e.shown?"auto":"none",e=>e.shown?1:0,e=>e.theme.colors.bg,e=>e.theme.colors.alert,e=>e.theme.boxShadowSoft,qte,e=>e.shown?"running":"paused");const Gte=window.location.origin,Yte=zte(),Mp=new gk({agent:Yte,serverUrl:Gte});Mp.parseMetaTags();const Xte=window.bugsnagApiKey?TN(window.bugsnagApiKey):L2;Mp.preloadPropsAndClasses();Ute(Mp);function Qte(){return f(Ck.Provider,{value:Mp,children:f(PN,{children:f(Ka,{children:f(bT,{basename:"/",children:f(sM,{children:M(ON,{children:[f(MN,{}),M(Xte,{FallbackComponent:o9,children:[f(Lte,{}),f(Ote,{}),M(Mte,{children:[f(Rte,{children:f(Ste,{})}),f(Vte,{})]})]})]})})})})})})}const Jte=M5(document.getElementById("root"));Jte.render(f(de.StrictMode,{children:f(Qte,{})}));export{de as R,Zte as _,lp as a,au as b,J0 as c,Qy as d,ZW as e,tV as f,A6 as g,Z0 as h,M as i,f as j,ie as p,w as r,B as s,I4 as w}; + `;ute(o,u)},[]),!i)throw new Error("Props are required");return f(e,{...i,children:i.children})}}var ra=(e=>(e[e.CONNECTING=WebSocket.CONNECTING]="CONNECTING",e[e.OPEN=WebSocket.OPEN]="OPEN",e[e.CLOSING=WebSocket.CLOSING]="CLOSING",e[e.CLOSED=WebSocket.CLOSED]="CLOSED",e))(ra||{});function dte(e){switch(e){case ra.OPEN:return[f($m,{color:"#3AA55D",title:"Websocket Connected"},"connected"),"green"];case ra.CLOSING:return[f($m,{color:"orange",title:"Websocket Closing"},"closing"),"#FAA81A"];case ra.CLOSED:return[f(px,{color:"red",title:"Websocket Closed"},"closed"),"#ED4245"];case ra.CONNECTING:default:return[f($m,{color:"gray",title:"Websocket Connecting..."},"connecting"),"gray"]}}function fte({subject:e,className:t}){var u;const n=We(),{drive:r}=ot(),[i,o]=w.useState(((u=n.getWebSocketForSubject(e))==null?void 0:u.readyState)??ra.CONNECTING);w.useEffect(()=>{const l=n.getWebSocketForSubject(e);if(!l)return o(ra.CONNECTING);o(l==null?void 0:l.readyState);const c=setInterval(()=>{l.readyState!==i&&o(l.readyState)},1e3);return()=>{clearInterval(c)}},[r,n]);const[a,s]=dte(i);return f(hte,{color:s,className:t,children:a})}const hte=B.div.withConfig({displayName:"IconWrapper",componentId:"sc-17ggfk4-0"})(["display:contents;color:",";font-size:1rem;"],e=>e.color);function pte({subject:e,className:t}){const[n,r,i]=Qh(),[o,a,s]=Ny(),u=n.includes(e),l=u?kD:ED,c=w.useCallback(()=>{u?(i(e),a(e)):(r(e),s(e))},[e,n,s,a,r,i]);return f(mte,{className:t,onClick:c,title:u?"Remove from favorites":"Add to favorites",children:f(l,{})})}const mte=B.button.withConfig({displayName:"StyledButton",componentId:"sc-1w6hm3s-0"})(["background:none;border:none;cursor:pointer;color:",";width:1.3rem;display:flex;align-items:center;padding:0;"],e=>e.theme.colors.main);function gte({subject:e,onClick:t,disabled:n}){return O(vte,{children:[f(kte,{subject:e}),f(bte,{children:e}),f(wte,{onClick:()=>t(e),disabled:n,children:"Select"}),f(yte,{subject:e}),f(Ste,{subject:e})]})}const vte=cte(B.div.withConfig({displayName:"DriveRowWrapper",componentId:"sc-k2ynk0-0"})(["--title-font-weight:500;display:grid;grid-template-areas:'title ws subject button icon';grid-template-columns:20ch 1.3rem auto 10ch 1.3rem;gap:","rem;align-items:center;padding-block:0.3rem;"],e=>e.theme.margin),"max-width: 500px",er(["grid-template-areas:'ws title icon' 'subject subject subject' 'button button button';grid-template-columns:1.3rem auto 1rem;padding-block:1rem;--title-font-weight:bold;"])),yte=B(pte).withConfig({displayName:"StyledFavoriteButton",componentId:"sc-k2ynk0-1"})(["grid-area:icon;"]),bte=B.span.withConfig({displayName:"Subject",componentId:"sc-k2ynk0-2"})(["grid-area:subject;color:",";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"],e=>e.theme.colors.textLight),wte=B(ve).withConfig({displayName:"SelectButton",componentId:"sc-k2ynk0-3"})(["grid-area:button;background-color:",";color:",";align-self:flex-end;"],e=>e.disabled?e.theme.colors.main:"transparent",e=>e.disabled?"white":e.theme.colors.main),Ste=B(fte).withConfig({displayName:"StyledWSIndicator",componentId:"sc-k2ynk0-4"})(["grid-area:ws;"]),kte=B(Yt).withConfig({displayName:"Title",componentId:"sc-k2ynk0-5"})(["grid-area:title;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--title-font-weight);"]);function O6({drives:e,onDriveSelect:t,showNewOption:n}){const{drive:r}=ot();return e.length===0?f("span",{children:"Nothing to show"}):f(xte,{children:O(Ss,{children:[e.map((i,o)=>f(Do,{noBorder:o===0,children:f(gte,{subject:i,onClick:t,disabled:i===r})},i)),n&&f(Do,{children:f(Cte,{klass:Q.classes.drive,subtle:!0,icon:!0,label:"New Drive"})})]})})}const xte=B(Ci).withConfig({displayName:"ContainerCard",componentId:"sc-y1wkzd-0"})(["container-type:inline-size;padding-top:0;"]),Cte=B(fu).withConfig({displayName:"StyledNewInstanceButton",componentId:"sc-y1wkzd-1"})(["border:none;box-shadow:none;padding:0;&&:hover,&&:focus{box-shadow:none;}"]);function _te(){const{drive:e,setDrive:t}=ot(),n=Et(),[r,i]=w.useState(e),[o,a]=w.useState(),[s]=Qh(),[u,l]=Ny(s);function c(h){try{t(h),i(h),l(h),n(zt(h))}catch(p){a(p)}}return O(ba,{children:[f($g,{children:"Drive Configuration"}),O(Qx,{children:[f(Jx,{children:"Current Drive"}),O(Ht,{children:[f(un,{children:f(Jn,{"data-test":"server-url-input",value:r,onChange:h=>i(h.target.value)})}),f(ve,{onClick:()=>c(r),disabled:e===r,"data-test":"server-url-save",children:"Save"})]})]}),f(xt,{children:o==null?void 0:o.message}),f($g,{as:"h2",children:"Saved"}),f(O6,{showNewOption:!0,drives:s,onDriveSelect:h=>c(h)}),f($g,{as:"h2",children:"Other"}),f(O6,{drives:u,onDriveSelect:h=>c(h)})]})}const $g=B.h1.withConfig({displayName:"Heading",componentId:"sc-1s49c6h-0"})(["margin:0;margin-bottom:1rem;"]);function Ete({target:e}){const t=Ce(void 0,{newResource:!0}),n=We(),[r,i]=w.useState(void 0),[o]=Mk(),[a,s]=w.useState(void 0);async function u(){await t.set(G.isA,[Q.classes.invite],n),await t.set(G.read,[Q.instances.publicAgent],n),await t.set(G.invite.target,e.getSubject(),n),t.setSubject(n.createSubject("invite"));try{if(!o)throw new Error("No agent found");await t.set(G.parent,o.subject,n),await t.save(n),navigator.clipboard.writeText(t.getSubject()),dt.success("Copied to clipboard"),s(t.getSubject())}catch(l){i(l)}}return t.new?O(Ci,{children:[f(Pr,{label:"Give edit rights",propertyURL:Q.properties.invite.write,resource:t}),f(Pr,{label:"Invite text (optional)",propertyURL:Q.properties.description,resource:t}),f(Pr,{label:"How many times this link can be used. No value = no limit.",propertyURL:Q.properties.invite.usagesLeft,resource:t}),f(ve,{onClick:u,children:"Create Invite"}),r&&f("p",{children:f(Lt,{children:r.message})})]}):O(Ci,{children:[f("p",{children:"Invite created and copied to clipboard! Send it to your buddy:"}),f(Dp,{content:a,"data-test":"invite-code"})]})}function Rte(){const[e]=kr(),t=Ce(e),n=We(),[r]=Wi(t),[i,o]=w.useState(!1),[a,s]=w.useState(void 0),u=Et(),l={commit:!1,handleValidationError:s},[c,h]=it(t,Q.properties.write,l),[p,y]=it(t,Q.properties.read,l),[g,b]=w.useState([]);if(w.useEffect(()=>{async function C(){const m=(await t.getRights(n)).filter(x=>x.setIn!==e).sort((x,A)=>x.for===Q.instances.publicAgent?-1:1);b(m)}C()},[t]),!e)return f(ye,{children:"No subject passed"});function _(C,d,v){let m=d?c:p;v?(m=m.filter(x=>x!==C),m.push(C)):m=m.filter(x=>x!==C),d?h(m):y(m)}function S(){const C=new Map;C.set(Q.instances.publicAgent,{read:!1,write:!1}),p.map(m=>{C.set(m,{read:!0,write:!1})}),c.map(m=>{const x=C.get(m);C.set(m,{read:x?x.read:!1,write:!0})});const d=[];return C.forEach((m,x)=>{d.push({agentSubject:x,read:m.read,write:m.write})}),d.sort(m=>m.agentSubject===Q.instances.publicAgent?-1:1)}async function k(){try{await t.save(n),dt.success("Share settings saved"),u(zt(e))}catch(C){dt.error(C.message)}}return O(_t,{children:[f(js,{resource:t,prefix:"Share settings",link:!0}),O(Nn,{children:[r&&!i&&f(ve,{onClick:()=>o(!0),children:"Send Invite..."}),i&&f(Ete,{target:t}),O(Ci,{children:[f(N6,{text:"rights set here:"}),f(Ss,{children:S().map(C=>f(L6,{...C,handleSetRight:r&&t.isReady()?_:void 0},JSON.stringify(C)))})]}),r&&f(ve,{disabled:!t.getCommitBuilder().hasUnsavedChanges(),onClick:k,children:"Save"}),a&&f(Lt,{children:a.message}),g.length>0&&O(Ci,{children:[f(N6,{text:"inherited rights:"}),f(Ss,{children:g.map(C=>f(L6,{inheritedFrom:C.setIn,read:C.type==="read",write:C.type==="write",agentSubject:C.for},C.for+C.type))})]})]})]})}function L6({handleSetRight:e,agentSubject:t,inheritedFrom:n,read:r,write:i}){const o=t===Q.instances.publicAgent,s=!Ce(t).isReady()||!e;return f(Do,{children:O("div",{style:{display:"flex"},"data-test":o?"right-public":null,children:[O("div",{style:{flex:1},children:[o?O(ye,{children:[f(uD,{})," Public (anyone)"," "]}):f(Yt,{subject:t}),n&&O(ye,{children:[" (via ",f(Yt,{subject:n}),") "]})]}),O("div",{style:{alignSelf:"flex-end"},children:[f(D6,{type:"checkbox",disabled:s,onChange:u=>e&&e(t,!1,u.target.checked),checked:r,title:r?"Read access. Toggle to remove access.":"No read access. Toggle to give read access."}),f(D6,{type:"checkbox",disabled:s,onChange:u=>e&&e(t,!0,u.target.checked),checked:i,title:i?"Write access. Toggle to remove access.":"No write access. Toggle to give write access."})]})]})})}const D6=B.input.withConfig({displayName:"StyledCheckbox",componentId:"sc-o8zyz7-0"})(["width:2rem;"]);function N6({text:e}){return O("div",{style:{display:"flex",flexDirection:"row",flex:1,marginBottom:"1rem"},children:[f("div",{style:{flex:1,fontWeight:"bold"},children:e}),O("div",{style:{alignSelf:"flex-end",justifyContent:"center"},children:[f("span",{children:"read "}),f("span",{children:"write"})]})]})}const Ate=()=>{const[e,t]=w.useState(""),{agent:n}=ot(),[r]=oy();return w.useEffect(()=>{async function i(){if(n){const o=await Zv(r,n);t(btoa(JSON.stringify(o)))}}i()},[n]),f(_t,{children:f(Dp,{content:e})})},Tte=new Intl.DateTimeFormat("default",{month:"long",year:"numeric"});function Pte(e){return e.filter((t,n)=>{if(n===0)return!0;const r=e[n-1];return t.commit.signer!==r.commit.signer?!0:M6(t.resource)!==M6(r.resource)})}async function Ite(e,t,n){const r=t.resource.getPropVals();for(const i of e.getPropVals().keys())r.has(i)||e.removePropVal(i);for(const[i,o]of r.entries())await e.set(i,o,n);await e.save(n)}function Ote(e){return e.reduceRight((t,n)=>{const r=new Date(n.commit.createdAt),i=Tte.format(r),o=t[i]??[];return{...t,[i]:[...o,n]}},{})}function M6(e){const t={};for(const[n,r]of e.getPropVals().entries())t[n]=r;return JSON.stringify(t)}function Lte(e){const[t,n]=w.useState([]),r=We(),[i,o]=w.useState(!0),[a,s]=w.useState(void 0);return w.useEffect(()=>{e.getHistory(r).then(u=>{n(Pte(u))}).catch(u=>{s(u)}).finally(()=>{o(!1)})},[e.getSubject()]),{versions:t,loading:i,error:a}}const Dte=new Intl.DateTimeFormat("default",{month:"long",year:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});function T9({version:e}){const t=Ce(e.commit.signer),[n]=qe(t),r=new Date(e.commit.createdAt),i=Dte.format(r);return O("span",{children:["Editted ",f("time",{dateTime:r.toISOString(),children:i})," by"," ",f(Ve,{subject:e.commit.signer,children:n})]})}function Nte({version:e,selected:t,onClick:n}){return f(Mte,{selected:t,onClick:n,about:e.commit.id,"data-testid":"version-button",children:f(e2,{date:new Date(e.commit.createdAt)})},e.commit.signature)}const Mte=B(Kh).withConfig({displayName:"VersionRow",componentId:"sc-6sx5uf-0"})(["padding:1rem;background-color:",";color:",";border-radius:",";:hover,:focus-visible{background:",";}"],e=>e.selected?e.theme.colors.main:"transparent",e=>e.selected?"white":e.theme.colors.text,e=>e.theme.radius,e=>e.selected?e.theme.colors.main:e.theme.colors.bg1);function P9({groupedVersions:e,selectedVersion:t,title:n,className:r,subject:i,persistSelection:o=!1,onNextItem:a,onPreviousItem:s,onSelectVersion:u}){const l=We(),c=w.useId();return O(zte,{className:r,children:[f(Fte,{id:c,children:n}),f(Bte,{"aria-labelledby":c,children:f(Nn,{children:Object.entries(e).map(([h,p])=>O(de.Fragment,{children:[f(Hte,{children:h}),[...p].map(y=>f(Nte,{onClick:()=>u(y),version:y,selected:o&&(t==null?void 0:t.commit.id)===y.commit.id},y.commit.id))]},h))})}),s&&s&&O($te,{children:[f(yr,{color:"main",title:"Previous item",onClick:s,children:f(tD,{})}),f(yr,{title:"Next item",color:"main",onClick:a,children:f(pw,{})})]}),O(jte,{path:OD(i,l.getServerUrl()),children:["All versions",f(pw,{size:"0.9rem"})]})]})}const zte=B.section.withConfig({displayName:"ScrollerSection",componentId:"sc-1j6decu-0"})(["border:1px solid ",";border-radius:",";background-color:",";min-width:12rem;max-width:20rem;display:grid;grid-template-rows:auto 1fr auto;position:relative;"],e=>e.theme.colors.bg2,e=>e.theme.radius,e=>e.theme.colors.bg),jte=B(Ve).withConfig({displayName:"AllVersionsLink",componentId:"sc-1j6decu-1"})(["position:absolute;bottom:-2rem;width:100%;display:flex;align-items:center;justify-content:center;gap:0.5ch;vertical-align:middle;line-height:1;"]),Bte=B.div.withConfig({displayName:"Scroller",componentId:"sc-1j6decu-2"})(["padding:1rem;overflow:auto;"]),Fte=B.h2.withConfig({displayName:"ScrollerTitle",componentId:"sc-1j6decu-3"})(["padding:","rem;margin-bottom:0;text-align:center;"],e=>e.theme.margin),$te=B.div.withConfig({displayName:"ButtonWrapper",componentId:"sc-1j6decu-4"})(["padding:","rem;display:flex;justify-content:space-between;"],e=>e.theme.margin),Hte=B.h3.withConfig({displayName:"GroupHeading",componentId:"sc-1j6decu-5"})(["&::before{content:'';display:block;height:1px;background-color:",";}&::after{content:'';display:block;height:1px;background-color:",";}display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:0.5rem;text-align:center;color:",";"],e=>e.theme.colors.bg2,e=>e.theme.colors.bg2,e=>e.theme.colors.textLight);function Ute({resource:e,groupedVersions:t,selectedVersion:n,isCurrentVersion:r,onNextVersion:i,onPreviousVersion:o,onSelectVersion:a,onVersionAccept:s}){return O(ye,{children:[f(Wte,{children:O(Nn,{fullHeight:!0,children:[f(js,{resource:e,prefix:"History of",link:!0}),n&&(n==null?void 0:n.resource)&&O(ye,{children:[f(T9,{version:n}),f(Vte,{children:f(O2,{resource:n.resource})}),f(ve,{onClick:s,disabled:r,children:"Make current version"})]})]})}),f(P9,{persistSelection:!0,subject:e.getSubject(),groupedVersions:t,onNextItem:o,onPreviousItem:i,selectedVersion:n,onSelectVersion:a,title:"Versions"})]})}const Vte=B(Ci).withConfig({displayName:"StyledCard",componentId:"sc-1j5titj-0"})(["flex:1;overflow:auto;width:100%;"]),Wte=B.div.withConfig({displayName:"CurrentItem",componentId:"sc-1j5titj-1"})(["flex:1;& h1{margin-bottom:0;}"]);function qte({resource:e,groupedVersions:t,selectedVersion:n,onSelectVersion:r,onVersionAccept:i}){const[o,a,s]=zy(),u=w.useCallback(l=>{r(l),a()},[]);return O(ye,{children:[f(Gte,{title:`History of ${e.title}`,subject:e.getSubject(),groupedVersions:t,selectedVersion:n,onSelectVersion:u}),O(jy,{...o,children:[f(By,{children:f("h1",{children:"Version"})}),f(Fy,{children:f(Nn,{fullHeight:!0,children:n&&(n==null?void 0:n.resource)&&O(ye,{children:[f(T9,{version:n}),f(Kte,{children:f(O2,{resource:n.resource})})]})})}),O($y,{children:[f(ve,{onClick:s,subtle:!0,children:"Cancel"}),f(ve,{onClick:i,children:"Make current version"})]})]})]})}const Kte=B(Ci).withConfig({displayName:"StyledCard",componentId:"sc-1c55cmv-0"})(["overflow:auto;"]),Gte=B(P9).withConfig({displayName:"CenteredScroller",componentId:"sc-1c55cmv-1"})(["margin-inline:auto;"]);function Yte(){const e=We(),t=ju(),n=Fu("(max-width: 500px)"),[r]=kr(),i=Ce(r),{versions:o,loading:a,error:s}=Lte(i),[u,l]=w.useState(),c=w.useMemo(()=>Ote(o),[o]);w.useEffect(()=>{o.length>0&&l(o[o.length-1])},[o]);const h=async()=>{u&&r&&(await Ite(i,u,e),Kn.success("Resource version updated"),t(zt(r)))},p=w.useCallback(()=>{const _=o.findIndex(S=>S===u);_===-1||_===o.length-1||l(o[_+1])},[o,u]),y=w.useCallback(()=>{const _=o.findIndex(S=>S===u);_===-1||_===0||l(o[_-1])},[o,u]),g=n?qte:Ute,b=u===o[o.length-1];return a?O(_t,{children:["Loading history of ",r,"..."]}):s?f(_t,{children:f(Lt,{children:s.message})}):f(Xte,{about:r,children:f(g,{resource:i,groupedVersions:c,selectedVersion:u,isCurrentVersion:b,onNextVersion:p,onPreviousVersion:y,onSelectVersion:l,onVersionAccept:h})})}const Xte=B.main.withConfig({displayName:"SplitView",componentId:"sc-1s1bw2l-0"})(["display:flex;width:100%;height:100%;height:calc(100vh - 6rem);padding:","rem;gap:","rem;& code{word-break:break-word;}"],e=>e.theme.margin,e=>e.theme.margin),Qte=window.location.origin,Jte=!1;function Zte(){return O(xT,{children:[f(pn,{path:Fe.new,element:f(Lee,{})}),f(pn,{path:Fe.themeSettings,element:f(Zee,{})}),f(pn,{path:Fe.agentSettings,element:f(ste,{})}),f(pn,{path:Fe.serverSettings,element:f(_te,{})}),f(pn,{path:Fe.shortcuts,element:f(ote,{})}),f(pn,{path:Fe.data,element:f(ite,{})}),f(pn,{path:Fe.edit,element:f(tte,{})}),f(pn,{path:Fe.import,element:f(m9,{})}),f(pn,{path:Fe.share,element:f(Rte,{})}),f(pn,{path:Fe.show,element:f(Iee,{})}),f(pn,{path:Fe.about,element:f(C9,{})}),f(pn,{path:Fe.search,element:f(x9,{})}),f(pn,{path:Fe.token,element:f(Ate,{})}),f(pn,{path:Fe.history,element:f(Yte,{})}),Jte,f(pn,{path:"/",element:f(U2,{subject:Qte})}),f(pn,{path:"*",element:f(ate,{})})]})}const I9=({onClick:e,isActive:t,menuId:n},r)=>f(wd,{"aria-controls":n,selected:t,ref:r,title:`Open menu (${st.menu})`,type:"button","data-test":"context-menu",onClick:e,rightPadding:!0,children:f(Ey,{})});I9.displayName="MenuBarDropdownTrigger";const ene=()=>{const e=w.useRef(null);return[e,()=>{e.current&&e.current.focus()}]};function tne({onFocus:e,onBlur:t,subject:n}){const[r,i]=w.useState(""),[o]=Sx(),{scope:a,clearScope:s}=Xh(),[u,l]=ene(),c=Et();function h(g){g.target.select()}function p(g){i(g.target.value);try{dn.tryValidSubject(g.target.value),c(zt(g.target.value),{replace:!0})}catch{c(RD(g.target.value,a),{replace:!0})}}const y=g=>{n&&(g.preventDefault(),u.current.blur(),document.activeElement.blur(),c(zt(n)))};return je(st.search,g=>{g.preventDefault(),u.current.select(),l()}),je("esc",g=>{g.preventDefault(),u.current.blur()},{enableOnTags:["INPUT"]}),je("backspace",g=>{(r===void 0||r.length===0)&&a&&s()},{enableOnTags:["INPUT"]}),w.useEffect(()=>{i(o||n),(o||a)&&l()},[o,a,n]),O(rne,{onSubmit:y,autoComplete:"off",children:[a&&f(nne,{subject:a,onClick:s}),f(Z1,{autoComplete:"false",ref:u,type:"search","data-test":"address-bar",name:"search","aria-label":"Search",onClick:h,onFocus:e,onBlur:t,value:r||"",onChange:p,placeholder:'Enter an Atomic URL or search (press "/" )'})]})}function nne({subject:e,onClick:t}){const n=Ce(e),[r]=qe(n);return O(ine,{children:[O("span",{children:["in:",r," "]}),f(yr,{onClick:t,title:"Clear scope",variant:cu.Fill,color:"textLight",size:"0.8rem",children:f(Mu,{})})]})}const Z1=B.input.withConfig({displayName:"Input",componentId:"sc-1fr6pcx-0"})(["border:none;font-size:0.9rem;padding:0.4rem 1.2rem;color:",";width:100%;flex:1;min-width:1rem;background-color:",";outline:0;color:",";"],e=>e.theme.colors.text,e=>e.theme.colors.bg,e=>e.theme.colors.textLight),rne=B.form.withConfig({displayName:"Form",componentId:"sc-1fr6pcx-1"})(["flex:1;height:100%;display:flex;align-items:center;padding-inline:1rem;border-radius:999px;:hover{box-shadow:inset 0 0 0 2px ",";","{color:",";}}:focus-within{","{color:",";}outline:none;box-shadow:inset 0 0 0 2px ",";}"],e=>tL(.6,e.theme.colors.main),Z1,e=>e.theme.colors.text,Z1,e=>e.theme.colors.text,e=>e.theme.colors.main),ine=B.span.withConfig({displayName:"Tag",componentId:"sc-1fr6pcx-2"})(["background-color:",";border-radius:",";padding:0.2rem 0.5rem;display:flex;flex-direction:row;align-items:center;gap:0.3rem;span{max-width:15ch;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}"],e=>e.theme.colors.bg1,e=>e.theme.radius);function one({children:e}){const{navbarTop:t,navbarFloating:n}=ot(),r=w.useRef(null),i=ka();return w.useEffect(()=>{var o;(o=r==null?void 0:r.current)==null||o.scrollTo(0,0)},[i]),O(ye,{children:[t&&f(z6,{}),O(une,{children:[f(TM,{}),O(ane,{ref:r,navbarTop:t,navbarFloating:n,children:[f(bf,{position:"top"}),e]})]}),!t&&f(z6,{})]})}const ane=B.div.withConfig({displayName:"Content",componentId:"sc-1oh1dv8-0"})(["display:block;flex:1;overflow-y:auto;"]);function z6(){const[e]=kr(),t=ju(),{navbarTop:n,navbarFloating:r,sideBarLocked:i,setSideBarLocked:o}=ot(),[a,s]=w.useState(!0),u=Fu("(display-mode: standalone) or (display-mode: fullscreen)"),l=w.useMemo(()=>u||window.navigator.standalone||document.referrer.includes("android-app://")||Ex(),[u]);function c(p){p.target.getBoundingClientRect().width<280&&s(!1)}return O(r?sne:lne,{top:n,"aria-label":"search",floating:r,children:[a&&O(w.Fragment,{children:[f(wd,{leftPadding:!0,type:"button",onClick:()=>o(!i),title:`Show / hide sidebar (${st.sidebarToggle})`,"data-test":"sidebar-toggle",children:f(ZL,{})}),l&&O(ye,{children:[f(wd,{type:"button",title:"Go back",onClick:()=>t(-1),children:f(cx,{})})," ",f(wd,{type:"button",title:"Go forward",onClick:()=>t(1),children:f(dx,{})})]})]}),f(tne,{subject:e,onFocus:c,onBlur:()=>s(!0)}),a&&e&&f(Hx,{isMainMenu:!0,subject:e,trigger:I9})]})}const O9=B.div.withConfig({displayName:"NavBarBase",componentId:"sc-1oh1dv8-1"})(["position:fixed;z-index:",";height:2.5rem;display:flex;border:solid 1px ",";background-color:",";view-transition-name:navbar;"],e=>e.theme.zIndex.sidebar,e=>e.theme.colors.bg2,e=>e.theme.colors.bg),sne=B(O9).withConfig({displayName:"NavBarFloating",componentId:"sc-1oh1dv8-2"})(["box-shadow:",";box-sizing:border-box;border-radius:999px;overflow:hidden;max-width:calc(100% - 2rem);width:","rem;margin:auto;left:50%;margin-left:-","rem;margin-right:-","rem;top:",";bottom:",";@media (max-width:","rem){max-width:calc(100% - 1rem);left:auto;right:auto;margin-left:0.5rem;bottom:0.5rem;}"],e=>e.theme.boxShadow,e=>e.theme.containerWidth+1,e=>(e.theme.containerWidth+1)/2,e=>(e.theme.containerWidth+1)/2,e=>e.top?"2rem":"auto",e=>e.top?"auto":"1rem",e=>e.theme.containerWidth),lne=B(O9).withConfig({displayName:"NavBarFixed",componentId:"sc-1oh1dv8-3"})(["top:",";bottom:",";left:0;right:0;border-width:0;border-bottom:",";border-top:",";"],e=>e.top?"0":"auto",e=>e.top?"auto":"0",e=>e.top?"solid 1px "+e.theme.colors.bg2:"none",e=>e.top?"none":"solid 1px "+e.theme.colors.bg2),une=B("div").withConfig({displayName:"SideBarWrapper",componentId:"sc-1oh1dv8-4"})(["display:flex;height:100vh;position:fixed;top:0;bottom:0;left:0;right:0;"]);function cne(){const{mainColor:e,darkMode:t}=ot(),[n]=kr(),r=Ce(n);let[i]=qe(r),[o]=be(r,G.description);const a=r.isReady()&&r.getSubject()!==Di;return i=a&&i?i:"Atomic Data",o=a&&o?o:"The easiest way to create and share linked data.",O(pd,{children:[f("title",{children:i}),f("meta",{name:"theme-color",content:t?"black":"white"}),f("meta",{name:"theme-color",content:t?"black":"white"}),f("meta",{name:"apple-mobile-web-app-status-bar-style",content:t?"black":"default"}),f("meta",{name:"msapplication-TileColor",content:e}),f("meta",{name:"description",content:o}),f("meta",{property:"og:title",content:i}),f("meta",{property:"og:description",content:o}),f("meta",{property:"og:url",content:n})]})}function dne(){const e=OO();return f(WL,{position:"bottom-right",toastOptions:{style:{zIndex:iC.toast,background:e.colors.bg,color:e.colors.text,wordBreak:"break-word"}},children:t=>f(sx,{toast:t,style:{...t.style,border:`solid 1px ${e.colors.bg2}`,position:"relative",animation:t.visible?"toast-enter .5s ease":"toast-exit 1s ease"},children:({icon:n,message:r})=>f(fne,{icon:n,message:r,t})})})}function fne({icon:e,message:t,t:n}){let r=t.props.children;function i(){dt.success("Copied error to clipboard"),navigator.clipboard.writeText(t.props.children),dt.dismiss(n.id)}return r.length>100&&(r=r.substring(0,100)+"..."),O(ye,{children:[e,r,n.type!=="loading"&&O("div",{style:{flex:1,flexDirection:"column"},children:[f(ve,{title:"Clear",subtle:!0,onClick:()=>dt.dismiss(n.id),children:f(Mu,{})}),n.type!=="success"&&f(ve,{title:"Copy",subtle:!0,onClick:i,children:f(Cy,{})})]})]})}const hne=({children:e})=>{const t=w.useRef(null);return O(My.Provider,{value:t,children:[e,f(pne,{ref:t})]})},pne=B.div.withConfig({displayName:"StyledDiv",componentId:"sc-3rziwd-0"})(["display:contents;"]),ev="agent";function mne(){const e=localStorage.getItem(ev);if(e)try{return sf.fromSecret(e)}catch(t){console.error(t);return}}function gne(e){e?localStorage.setItem(ev,e.buildSecret()):localStorage.removeItem(ev)}const vne=e=>{rC(e);const t=e.message;dt.error(t)};function yne(e){return async t=>{const n=t.get(Q.properties.parent);if(!Ja(n))throw new Error(`Resource doesn't have a parent: ${t.getSubject()} `);const r=await e.getResourceAsync(n);r.getSubjects(Q.properties.subResources).includes(t.getSubject())||(await r.pushPropVal(Q.properties.subResources,t.getSubject()),await r.save(e))}}function bne(e){return async t=>{const n=t.get(Q.properties.parent);if(!Ja(n))throw new Error(`Resource doesn't have a parent: ${t.getSubject()} `);const r=await e.getResourceAsync(n),i=r.getSubjects(Q.properties.subResources);await r.set(Q.properties.subResources,i.filter(o=>o!==t.getSubject()),e),r.save(e)}}function wne(e){e.on(hr.ResourceManuallyCreated,yne(e)),e.on(hr.ResourceRemoved,bne(e)),e.on(hr.Error,vne),e.on(hr.AgentChanged,gne)}function Sne(e){return _e({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23.64 7c-.45-.34-4.93-4-11.64-4-1.5 0-2.89.19-4.15.48L18.18 13.8 23.64 7zm-6.6 8.22L3.27 1.44 2 2.72l2.05 2.06C1.91 5.76.59 6.82.36 7l11.63 14.49.01.01.01-.01 3.9-4.86 3.32 3.32 1.27-1.27-3.46-3.46z"}}]})(e)}function kne(){const[e,t]=w.useState(navigator.onLine);return w.useEffect(()=>{const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}},[]),e}function xne(){const e=kne();return w.useEffect(()=>{e||dt.error("You are offline, changes might not be persisted.")},[e]),f(_ne,{shown:!e,children:f(Sne,{title:"No Internet Connection."})})}const Cne=Du(["0%{opacity:1;filter:drop-shadow(0 0 5px var(--shadow-color));}100%{opacity:0.8;filter:drop-shadow(0 0 0 var(--shadow-color));}"]),_ne=B.div.withConfig({displayName:"Wrapper",componentId:"sc-1pc77w9-0"})(["--shadow-color:",";position:fixed;bottom:1.2rem;right:2rem;z-index:",";font-size:1.5rem;color:",";pointer-events:",";transition:opacity 0.1s ease-in-out;opacity:",";background-color:",";border:1px solid ",";border-radius:50%;display:grid;place-items:center;box-shadow:",";padding:0.5rem;svg{animation:"," 1.5s alternate ease-in-out infinite;animation-play-state:",";}"],e=>gi(.15,e.theme.colors.alert),({theme:e})=>e.zIndex.networkIndicator,e=>e.theme.colors.alert,e=>e.shown?"auto":"none",e=>e.shown?1:0,e=>e.theme.colors.bg,e=>e.theme.colors.alert,e=>e.theme.boxShadowSoft,Cne,e=>e.shown?"running":"paused");const Ene=window.location.origin,Rne=mne(),Mp=new Rk({agent:Rne,serverUrl:Ene});Mp.parseMetaTags();const Ane=window.bugsnagApiKey?BM(window.bugsnagApiKey):$2;Mp.preloadPropsAndClasses();wne(Mp);function Tne(){return f(Nk.Provider,{value:Mp,children:f(FM,{children:f(Xa,{children:f(_T,{basename:"/",children:f(vN,{children:O(HM,{children:[f(WM,{}),O(Ane,{FallbackComponent:u9,children:[f(dne,{}),f(cne,{}),O(hne,{children:[f(one,{children:f(Zte,{})}),f(xne,{})]})]})]})})})})})})}const Pne=W5(document.getElementById("root"));Pne.render(f(de.StrictMode,{children:f(Tne,{})}));export{de as R,Ine as _,up as a,su as b,Z0 as c,i2 as d,uW as e,dW as f,j6 as g,e1 as h,O as i,f as j,ie as p,w as r,B as s,F4 as w}; //# sourceMappingURL=index.js.map diff --git a/server/app_assets/assets/index.js.map b/server/app_assets/assets/index.js.map index 7c471b1f2..3a54f8839 100644 --- a/server/app_assets/assets/index.js.map +++ b/server/app_assets/assets/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/react@18.1.0/node_modules/react/cjs/react.production.min.js","../../../node_modules/.pnpm/react@18.1.0/node_modules/react/index.js","../../../node_modules/.pnpm/scheduler@0.22.0/node_modules/scheduler/cjs/scheduler.production.min.js","../../../node_modules/.pnpm/scheduler@0.22.0/node_modules/scheduler/index.js","../../../node_modules/.pnpm/react-dom@18.1.0_react@18.1.0/node_modules/react-dom/cjs/react-dom.production.min.js","../../../node_modules/.pnpm/react-dom@18.1.0_react@18.1.0/node_modules/react-dom/index.js","../../../node_modules/.pnpm/react-dom@18.1.0_react@18.1.0/node_modules/react-dom/client.js","../../../node_modules/.pnpm/@remix-run+router@1.4.0/node_modules/@remix-run/router/dist/router.js","../../../node_modules/.pnpm/react-router@6.9.0_react@18.1.0/node_modules/react-router/dist/index.js","../../../node_modules/.pnpm/react-router-dom@6.9.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/react-router-dom/dist/index.js","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js","../../../node_modules/.pnpm/react-fast-compare@3.2.0/node_modules/react-fast-compare/index.js","../../../node_modules/.pnpm/invariant@2.2.4/node_modules/invariant/browser.js","../../../node_modules/.pnpm/shallowequal@1.1.0/node_modules/shallowequal/index.js","../../../node_modules/.pnpm/react-helmet-async@1.3.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/react-helmet-async/lib/index.module.js","../../../lib/dist/src/agent.js","../../../lib/dist/src/authentication.js","../../../lib/dist/src/class.js","../../../node_modules/.pnpm/cross-fetch@3.1.4/node_modules/cross-fetch/dist/browser-ponyfill.js","../../../lib/dist/src/client.js","../../__vite-browser-external","../../../node_modules/.pnpm/@noble+ed25519@1.6.0/node_modules/@noble/ed25519/lib/esm/index.js","../../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js","../../../node_modules/.pnpm/base64-arraybuffer@1.0.2/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js","../../../node_modules/.pnpm/@noble+hashes@0.5.9/node_modules/@noble/hashes/esm/utils.js","../../../node_modules/.pnpm/@noble+hashes@0.5.9/node_modules/@noble/hashes/esm/_sha2.js","../../../node_modules/.pnpm/@noble+hashes@0.5.9/node_modules/@noble/hashes/esm/_u64.js","../../../node_modules/.pnpm/@noble+hashes@0.5.9/node_modules/@noble/hashes/esm/sha512.js","../../../lib/dist/src/commit.js","../../../lib/dist/src/error.js","../../../lib/dist/src/endpoints.js","../../../lib/dist/src/datatypes.js","../../../lib/dist/src/parse.js","../../../lib/dist/src/search.js","../../../lib/dist/src/resource.js","../../../lib/dist/src/EventManager.js","../../../lib/dist/src/websockets.js","../../../lib/dist/src/store.js","../../../lib/dist/src/value.js","../../../lib/dist/src/urls.js","../../../lib/dist/src/truncate.js","../../../react/dist/src/hooks.js","../../../react/dist/src/useServerURL.js","../../../react/dist/src/useCurrentAgent.js","../../../react/dist/src/useChildren.js","../../../react/dist/src/useDebounce.js","../../../react/dist/src/useLocalStorage.js","../../../react/dist/src/useMarkdown.js","../../../react/dist/src/useServerSearch.js","../../../node_modules/.pnpm/react-is@18.2.0/node_modules/react-is/cjs/react-is.production.min.js","../../../node_modules/.pnpm/react-is@18.2.0/node_modules/react-is/index.js","../../../node_modules/.pnpm/@emotion+stylis@0.8.5/node_modules/@emotion/stylis/dist/stylis.browser.esm.js","../../../node_modules/.pnpm/@emotion+unitless@0.7.5/node_modules/@emotion/unitless/dist/unitless.browser.esm.js","../../../node_modules/.pnpm/@emotion+memoize@0.7.4/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","../../../node_modules/.pnpm/@emotion+is-prop-valid@0.8.8/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js","../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js","../../../node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../../node_modules/.pnpm/styled-components@5.3.3_uuaz5p7xzfmtjacf6iqf7idnby/node_modules/styled-components/dist/styled-components.browser.esm.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/extends.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/construct.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","../../../node_modules/.pnpm/polished@4.1.3/node_modules/polished/dist/polished.esm.js","../../src/helpers/useDarkMode.tsx","../../../node_modules/.pnpm/goober@2.1.11_csstype@3.1.1/node_modules/goober/dist/goober.modern.js","../../../node_modules/.pnpm/react-hot-toast@2.4.0_xb3noawg3grui6hzaob7jwa63y/node_modules/react-hot-toast/dist/index.mjs","../../src/helpers/useHover.tsx","../../../node_modules/.pnpm/react-icons@4.3.1_react@18.1.0/node_modules/react-icons/lib/esm/iconContext.js","../../../node_modules/.pnpm/react-icons@4.3.1_react@18.1.0/node_modules/react-icons/lib/esm/iconBase.js","../../../node_modules/.pnpm/react-icons@4.3.1_react@18.1.0/node_modules/react-icons/fa/index.esm.js","../../src/routes/paths.tsx","../../src/helpers/navigation.tsx","../../src/helpers/transition.ts","../../../node_modules/.pnpm/react@18.1.0/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../node_modules/.pnpm/react@18.1.0/node_modules/react/jsx-runtime.js","../../react/jsx-runtime","../../src/components/Spinner.tsx","../../src/components/Button.tsx","../../src/helpers/useCurrentSubject.tsx","../../src/components/SideBar/SideBarItem.ts","../../src/components/ErrorLook.tsx","../../src/helpers/tauri.tsx","../../src/hooks/useNavigateWithTransition.ts","../../src/components/AtomicLink.tsx","../../src/helpers/timeoutEffect.ts","../../src/components/Collapse.tsx","../../src/components/Details/index.tsx","../../src/helpers/useNewRoute.ts","../../src/components/IconButton/IconButton.tsx","../../src/components/Dropdown/DefaultTrigger.tsx","../../../node_modules/.pnpm/hotkeys-js@3.8.7/node_modules/hotkeys-js/dist/hotkeys.esm.js","../../../node_modules/.pnpm/react-hotkeys-hook@3.4.4_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js","../../src/hooks/useClickAwayListener.ts","../../src/components/HotKeyWrapper.tsx","../../src/components/Shortcut.tsx","../../src/components/Dropdown/index.tsx","../../src/hooks/useQueryScope.ts","../../src/components/ResourceContextMenu/index.tsx","../../src/components/SideBar/ResourceSideBar/FloatingActions.tsx","../../src/components/Loader.tsx","../../src/views/FolderPage/iconMap.ts","../../src/components/SideBar/ResourceSideBar/ResourceSideBar.tsx","../../src/components/SignInButton.tsx","../../src/components/SideBar/SideBarHeader.ts","../../src/config.ts","../../src/hooks/useSavedDrives.ts","../../src/hooks/useDriveHistory.ts","../../src/helpers/effectTimeout.ts","../../src/components/Slot.tsx","../../src/components/Dialog/dialogContext.ts","../../src/components/Dialog/useDialog.tsx","../../src/components/Dialog/index.tsx","../../src/components/Row.tsx","../../src/components/forms/InputStyles.tsx","../../src/components/forms/Field.tsx","../../src/components/NewInstanceButton/Base.tsx","../../src/components/NewInstanceButton/useCreateAndNavigate.ts","../../src/components/NewInstanceButton/NewBookmarkButton.tsx","../../src/components/NewInstanceButton/useDefaultNewInstanceHandler.tsx","../../src/components/NewInstanceButton/NewInstanceButtonDefault.tsx","../../src/components/NewInstanceButton/index.tsx","../../src/components/SideBar/DriveSwitcher.tsx","../../src/components/SideBar/SideBarDrive.tsx","../../src/hooks/useResizable.ts","../../src/hooks/useCombineRefs.ts","../../src/components/NavBarSpacer.tsx","../../src/components/SideBar/menuItems.tsx","../../src/components/SideBar/SideBarMenuItem.tsx","../../src/components/SideBar/AppMenu.tsx","../../src/components/Logo.tsx","../../src/components/SideBar/About.tsx","../../src/hooks/useMediaQuery.ts","../../src/components/SideBar/index.tsx","../../../node_modules/.pnpm/@bugsnag+browser@7.16.5/node_modules/@bugsnag/browser/dist/bugsnag.js","../../../node_modules/.pnpm/@bugsnag+js@7.16.5/node_modules/@bugsnag/js/browser/notifier.js","../../../node_modules/.pnpm/@bugsnag+plugin-react@7.16.5_@bugsnag+core@7.16.1/node_modules/@bugsnag/plugin-react/dist/bugsnag-react.js","../../src/helpers/loggingHandlers.tsx","../../src/helpers/AppSettings.tsx","../../src/styling.tsx","../../src/components/Containers.tsx","../../src/helpers/useMedia.tsx","../../../node_modules/.pnpm/react-markdown@8.0.3_cweqlka2zkiirfe2jqsmqzgzhu/node_modules/react-markdown/lib/uri-transformer.js","../../../node_modules/.pnpm/is-buffer@2.0.5/node_modules/is-buffer/index.js","../../../node_modules/.pnpm/unist-util-stringify-position@3.0.2/node_modules/unist-util-stringify-position/index.js","../../../node_modules/.pnpm/vfile-message@3.1.2/node_modules/vfile-message/index.js","../../../node_modules/.pnpm/vfile@5.3.4/node_modules/vfile/lib/minpath.browser.js","../../../node_modules/.pnpm/vfile@5.3.4/node_modules/vfile/lib/minproc.browser.js","../../../node_modules/.pnpm/vfile@5.3.4/node_modules/vfile/lib/minurl.shared.js","../../../node_modules/.pnpm/vfile@5.3.4/node_modules/vfile/lib/minurl.browser.js","../../../node_modules/.pnpm/vfile@5.3.4/node_modules/vfile/lib/index.js","../../../node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.js","../../../node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js","../../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js","../../../node_modules/.pnpm/trough@2.1.0/node_modules/trough/index.js","../../../node_modules/.pnpm/unified@10.1.2/node_modules/unified/lib/index.js","../../../node_modules/.pnpm/mdast-util-to-string@3.1.0/node_modules/mdast-util-to-string/index.js","../../../node_modules/.pnpm/micromark-util-chunked@1.0.0/node_modules/micromark-util-chunked/index.js","../../../node_modules/.pnpm/micromark-util-combine-extensions@1.0.0/node_modules/micromark-util-combine-extensions/index.js","../../../node_modules/.pnpm/micromark-util-character@1.1.0/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js","../../../node_modules/.pnpm/micromark-util-character@1.1.0/node_modules/micromark-util-character/index.js","../../../node_modules/.pnpm/micromark-factory-space@1.0.0/node_modules/micromark-factory-space/index.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/initialize/content.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/initialize/document.js","../../../node_modules/.pnpm/micromark-util-classify-character@1.0.0/node_modules/micromark-util-classify-character/index.js","../../../node_modules/.pnpm/micromark-util-resolve-all@1.0.0/node_modules/micromark-util-resolve-all/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/attention.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/autolink.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/blank-line.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/block-quote.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/character-escape.js","../../../node_modules/.pnpm/decode-named-character-reference@1.0.2/node_modules/decode-named-character-reference/index.dom.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/character-reference.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/code-fenced.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/code-indented.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/code-text.js","../../../node_modules/.pnpm/micromark-util-subtokenize@1.0.2/node_modules/micromark-util-subtokenize/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/content.js","../../../node_modules/.pnpm/micromark-factory-destination@1.0.0/node_modules/micromark-factory-destination/index.js","../../../node_modules/.pnpm/micromark-factory-label@1.0.2/node_modules/micromark-factory-label/index.js","../../../node_modules/.pnpm/micromark-factory-title@1.0.2/node_modules/micromark-factory-title/index.js","../../../node_modules/.pnpm/micromark-factory-whitespace@1.0.0/node_modules/micromark-factory-whitespace/index.js","../../../node_modules/.pnpm/micromark-util-normalize-identifier@1.0.0/node_modules/micromark-util-normalize-identifier/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/definition.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/heading-atx.js","../../../node_modules/.pnpm/micromark-util-html-tag-name@1.1.0/node_modules/micromark-util-html-tag-name/index.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/html-flow.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/html-text.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/label-end.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/label-start-image.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/label-start-link.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/line-ending.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/thematic-break.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/list.js","../../../node_modules/.pnpm/micromark-core-commonmark@1.0.6/node_modules/micromark-core-commonmark/lib/setext-underline.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/initialize/flow.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/initialize/text.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/create-tokenizer.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/constructs.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/parse.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/preprocess.js","../../../node_modules/.pnpm/micromark@3.0.10/node_modules/micromark/lib/postprocess.js","../../../node_modules/.pnpm/micromark-util-decode-numeric-character-reference@1.0.0/node_modules/micromark-util-decode-numeric-character-reference/index.js","../../../node_modules/.pnpm/micromark-util-decode-string@1.0.2/node_modules/micromark-util-decode-string/index.js","../../../node_modules/.pnpm/mdast-util-from-markdown@1.2.0/node_modules/mdast-util-from-markdown/lib/index.js","../../../node_modules/.pnpm/remark-parse@10.0.1/node_modules/remark-parse/lib/index.js","../../../node_modules/.pnpm/unist-builder@3.0.0/node_modules/unist-builder/index.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/traverse.js","../../../node_modules/.pnpm/unist-util-is@5.1.1/node_modules/unist-util-is/index.js","../../../node_modules/.pnpm/unist-util-visit-parents@5.1.0/node_modules/unist-util-visit-parents/index.js","../../../node_modules/.pnpm/unist-util-visit@4.1.0/node_modules/unist-util-visit/index.js","../../../node_modules/.pnpm/unist-util-position@4.0.3/node_modules/unist-util-position/index.js","../../../node_modules/.pnpm/unist-util-generated@2.0.0/node_modules/unist-util-generated/index.js","../../../node_modules/.pnpm/mdast-util-definitions@5.1.1/node_modules/mdast-util-definitions/index.js","../../../node_modules/.pnpm/micromark-util-encode@1.0.1/node_modules/micromark-util-encode/index.js","../../../node_modules/.pnpm/micromark-util-sanitize-uri@1.0.0/node_modules/micromark-util-sanitize-uri/index.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/wrap.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/footer.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/break.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/code.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/delete.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/footnote.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/heading.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/html.js","../../../node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/encode.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/revert.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/image.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/link.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/list.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/root.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/strong.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/table.js","../../../node_modules/.pnpm/trim-lines@3.0.1/node_modules/trim-lines/index.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/text.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/handlers/index.js","../../../node_modules/.pnpm/mdast-util-to-hast@12.1.2/node_modules/mdast-util-to-hast/lib/index.js","../../../node_modules/.pnpm/remark-rehype@10.1.0/node_modules/remark-rehype/lib/index.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/schema.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/merge.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/normalize.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/info.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/types.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/defined-info.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/create.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/xlink.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/xml.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/case-sensitive-transform.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/util/case-insensitive-transform.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/xmlns.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/aria.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/html.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/svg.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/find.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/lib/hast-to-react.js","../../../node_modules/.pnpm/property-information@6.1.1/node_modules/property-information/index.js","../../../node_modules/.pnpm/react-markdown@8.0.3_cweqlka2zkiirfe2jqsmqzgzhu/node_modules/react-markdown/lib/rehype-filter.js","../../../node_modules/.pnpm/hast-util-whitespace@2.0.0/node_modules/hast-util-whitespace/index.js","../../../node_modules/.pnpm/space-separated-tokens@2.0.1/node_modules/space-separated-tokens/index.js","../../../node_modules/.pnpm/comma-separated-tokens@2.0.2/node_modules/comma-separated-tokens/index.js","../../../node_modules/.pnpm/inline-style-parser@0.1.1/node_modules/inline-style-parser/index.js","../../../node_modules/.pnpm/style-to-object@0.3.0/node_modules/style-to-object/index.js","../../../node_modules/.pnpm/react-markdown@8.0.3_cweqlka2zkiirfe2jqsmqzgzhu/node_modules/react-markdown/lib/ast-to-react.js","../../../node_modules/.pnpm/react-markdown@8.0.3_cweqlka2zkiirfe2jqsmqzgzhu/node_modules/react-markdown/lib/react-markdown.js","../../../node_modules/.pnpm/micromark-extension-gfm-autolink-literal@1.0.3/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js","../../../node_modules/.pnpm/micromark-extension-gfm-footnote@1.0.4/node_modules/micromark-extension-gfm-footnote/lib/syntax.js","../../../node_modules/.pnpm/micromark-extension-gfm-strikethrough@1.0.4/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js","../../../node_modules/.pnpm/micromark-extension-gfm-table@1.0.5/node_modules/micromark-extension-gfm-table/lib/syntax.js","../../../node_modules/.pnpm/micromark-extension-gfm-task-list-item@1.0.3/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js","../../../node_modules/.pnpm/micromark-extension-gfm@2.0.1/node_modules/micromark-extension-gfm/index.js","../../../node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.js","../../../node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js","../../../node_modules/.pnpm/mdast-util-find-and-replace@2.2.1/node_modules/mdast-util-find-and-replace/lib/index.js","../../../node_modules/.pnpm/mdast-util-gfm-autolink-literal@1.0.2/node_modules/mdast-util-gfm-autolink-literal/index.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/association.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/track.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/container-flow.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/safe.js","../../../node_modules/.pnpm/mdast-util-gfm-footnote@1.0.1/node_modules/mdast-util-gfm-footnote/index.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js","../../../node_modules/.pnpm/mdast-util-gfm-strikethrough@1.0.1/node_modules/mdast-util-gfm-strikethrough/index.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js","../../../node_modules/.pnpm/markdown-table@3.0.2/node_modules/markdown-table/index.js","../../../node_modules/.pnpm/mdast-util-gfm-table@1.0.4/node_modules/mdast-util-gfm-table/lib/index.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js","../../../node_modules/.pnpm/mdast-util-to-markdown@1.3.0/node_modules/mdast-util-to-markdown/lib/handle/list-item.js","../../../node_modules/.pnpm/mdast-util-gfm-task-list-item@1.0.1/node_modules/mdast-util-gfm-task-list-item/index.js","../../../node_modules/.pnpm/mdast-util-gfm@2.0.1/node_modules/mdast-util-gfm/lib/index.js","../../../node_modules/.pnpm/remark-gfm@3.0.1/node_modules/remark-gfm/index.js","../../src/helpers/markdown.ts","../../src/components/datatypes/Markdown.tsx","../../../node_modules/.pnpm/react-intersection-observer@9.4.1_react@18.1.0/node_modules/react-intersection-observer/react-intersection-observer.esm.js","../../src/views/ResourceInline.tsx","../../src/components/datatypes/DateTime.tsx","../../src/components/datatypes/NestedResource.tsx","../../src/components/datatypes/ResourceArray.tsx","../../src/components/ValueComp.tsx","../../src/components/forms/InputString.tsx","../../../node_modules/.pnpm/quick-score@0.0.10/node_modules/quick-score/lib/index.esm.js","../../src/helpers/useLocalSearch.tsx","../../src/views/ResourceLine.tsx","../../src/components/forms/DropdownInput.tsx","../../src/hooks/useEffectOnce.ts","../../src/components/forms/hooks/useSaveResource.ts","../../src/components/forms/ResourceField.tsx","../../../node_modules/.pnpm/tslib@2.3.1/node_modules/tslib/tslib.es6.js","../../../node_modules/.pnpm/file-selector@0.2.4/node_modules/file-selector/dist/es5/file.js","../../../node_modules/.pnpm/file-selector@0.2.4/node_modules/file-selector/dist/es5/file-selector.js","../../../node_modules/.pnpm/attr-accept@2.2.2/node_modules/attr-accept/dist/es/index.js","../../../node_modules/.pnpm/react-dropzone@11.4.2_react@18.1.0/node_modules/react-dropzone/dist/es/utils/index.js","../../../node_modules/.pnpm/react-dropzone@11.4.2_react@18.1.0/node_modules/react-dropzone/dist/es/index.js","../../src/components/FilePill.tsx","../../src/hooks/useUpload.ts","../../src/components/forms/UploadForm.tsx","../../src/components/Gutter.tsx","../../src/components/forms/ResourceForm.tsx","../../src/components/forms/NewForm/NewFormTitle.tsx","../../src/components/forms/NewForm/SubjectField.tsx","../../src/components/forms/NewForm/useNewForm.ts","../../src/components/forms/NewForm/NewFormDialog.tsx","../../src/components/forms/ResourceSelector.tsx","../../src/components/forms/InputResource.tsx","../../src/components/forms/InputResourceArray.tsx","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","../../../node_modules/.pnpm/react-display-name@0.2.5/node_modules/react-display-name/lib/getDisplayName.js","../../../node_modules/.pnpm/theming@3.3.0_react@18.1.0/node_modules/theming/dist/theming.esm.js","../../../node_modules/.pnpm/is-in-browser@1.1.3/node_modules/is-in-browser/dist/module.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/createClass.js","../../../node_modules/.pnpm/jss@10.8.1/node_modules/jss/dist/jss.esm.js","../../../node_modules/.pnpm/jss-plugin-rule-value-function@10.8.1/node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js","../../../node_modules/.pnpm/symbol-observable@1.2.0/node_modules/symbol-observable/es/ponyfill.js","../../../node_modules/.pnpm/symbol-observable@1.2.0/node_modules/symbol-observable/es/index.js","../../../node_modules/.pnpm/jss-plugin-rule-value-observable@10.8.1/node_modules/jss-plugin-rule-value-observable/dist/jss-plugin-rule-value-observable.esm.js","../../../node_modules/.pnpm/jss-plugin-template@10.8.1/node_modules/jss-plugin-template/dist/jss-plugin-template.esm.js","../../../node_modules/.pnpm/jss-plugin-global@10.8.1/node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js","../../../node_modules/.pnpm/jss-plugin-extend@10.8.1/node_modules/jss-plugin-extend/dist/jss-plugin-extend.esm.js","../../../node_modules/.pnpm/jss-plugin-nested@10.8.1/node_modules/jss-plugin-nested/dist/jss-plugin-nested.esm.js","../../../node_modules/.pnpm/jss-plugin-compose@10.8.1/node_modules/jss-plugin-compose/dist/jss-plugin-compose.esm.js","../../../node_modules/.pnpm/hyphenate-style-name@1.0.4/node_modules/hyphenate-style-name/index.js","../../../node_modules/.pnpm/jss-plugin-camel-case@10.8.1/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js","../../../node_modules/.pnpm/jss-plugin-default-unit@10.8.1/node_modules/jss-plugin-default-unit/dist/jss-plugin-default-unit.esm.js","../../../node_modules/.pnpm/jss-plugin-expand@10.8.1/node_modules/jss-plugin-expand/dist/jss-plugin-expand.esm.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../../node_modules/.pnpm/css-vendor@2.0.8/node_modules/css-vendor/dist/css-vendor.esm.js","../../../node_modules/.pnpm/jss-plugin-vendor-prefixer@10.8.1/node_modules/jss-plugin-vendor-prefixer/dist/jss-plugin-vendor-prefixer.esm.js","../../../node_modules/.pnpm/jss-plugin-props-sort@10.8.1/node_modules/jss-plugin-props-sort/dist/jss-plugin-props-sort.esm.js","../../../node_modules/.pnpm/jss-preset-default@10.8.1/node_modules/jss-preset-default/dist/jss-preset-default.esm.js","../../../node_modules/.pnpm/shallow-equal@1.2.1/node_modules/shallow-equal/dist/index.esm.js","../../../node_modules/.pnpm/@emotion+memoize@0.7.1/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","../../../node_modules/.pnpm/@emotion+is-prop-valid@0.7.3/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","../../../node_modules/.pnpm/css-jss@10.8.1/node_modules/css-jss/dist/css-jss.esm.js","../../../node_modules/.pnpm/react-jss@10.8.1_react@18.1.0/node_modules/react-jss/dist/react-jss.esm.js","../../../node_modules/.pnpm/showdown@1.9.1/node_modules/showdown/dist/showdown.js","../../../node_modules/.pnpm/yamde@1.7.1_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/yamde/dist/Yamde.styles.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/typeof.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/interopRequireWildcard.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/interopRequireDefault.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/defineProperty.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/objectSpread2.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/BoldOutlined.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/nonIterableRest.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/slicedToArray.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../../../node_modules/.pnpm/@babel+runtime@7.19.0/node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/components/Context.js","../../../node_modules/.pnpm/@ctrl+tinycolor@3.4.0/node_modules/@ctrl/tinycolor/dist/module/util.js","../../../node_modules/.pnpm/@ctrl+tinycolor@3.4.0/node_modules/@ctrl/tinycolor/dist/module/conversion.js","../../../node_modules/.pnpm/@ctrl+tinycolor@3.4.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js","../../../node_modules/.pnpm/@ctrl+tinycolor@3.4.0/node_modules/@ctrl/tinycolor/dist/module/format-input.js","../../../node_modules/.pnpm/@ant-design+colors@6.0.0/node_modules/@ant-design/colors/dist/index.esm.js","../../../node_modules/.pnpm/rc-util@5.14.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/rc-util/lib/warning.js","../../../node_modules/.pnpm/rc-util@5.14.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/rc-util/lib/Dom/canUseDom.js","../../../node_modules/.pnpm/rc-util@5.14.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/rc-util/lib/Dom/dynamicCSS.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/utils.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/components/IconBase.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/components/twoTonePrimaryColor.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/components/AntdIcon.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/BoldOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/BoldOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/ItalicOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/ItalicOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/ItalicOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/StrikethroughOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/StrikethroughOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/StrikethroughOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/UnorderedListOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/UnorderedListOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/UnorderedListOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/OrderedListOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/OrderedListOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/OrderedListOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/TableOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/TableOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/TableOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/FileImageOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/FileImageOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/FileImageOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/LinkOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/LinkOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/LinkOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/RightOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/RightOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/RightOutlined.js","../../../node_modules/.pnpm/@ant-design+icons-svg@4.2.1/node_modules/@ant-design/icons-svg/lib/asn/CodeOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/lib/icons/CodeOutlined.js","../../../node_modules/.pnpm/@ant-design+icons@4.7.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@ant-design/icons/CodeOutlined.js","../../../node_modules/.pnpm/yamde@1.7.1_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/yamde/dist/utils/toolbarActions.js","../../../node_modules/.pnpm/yamde@1.7.1_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/yamde/dist/Yamde.js","../../../node_modules/.pnpm/yamde@1.7.1_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/yamde/dist/themes/light.js","../../../node_modules/.pnpm/yamde@1.7.1_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/yamde/dist/themes/dark.js","../../../node_modules/.pnpm/yamde@1.7.1_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/yamde/dist/utils/defaultToolbarActions.js","../../../node_modules/.pnpm/yamde@1.7.1_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/yamde/dist/index.js","../../src/components/forms/InputMarkdown.tsx","../../src/components/forms/InputNumber.tsx","../../src/components/forms/InputBoolean.tsx","../../src/components/forms/InputSwitcher.tsx","../../src/components/forms/ValueForm.tsx","../../src/components/PropVal.tsx","../../src/components/AllProps.tsx","../../src/helpers/transitionName.ts","../../src/components/Card.tsx","../../src/views/Card/CollectionCard.tsx","../../src/hooks/useFile.ts","../../src/views/File/displayFileSize.ts","../../src/views/File/DownloadButton.tsx","../../src/hooks/useGlobalStylesWhileMounted.ts","../../src/views/File/useFileImageTransitionStyles.ts","../../src/components/ImageViewer.tsx","../../src/views/File/TextPreview.tsx","../../src/views/File/isTextFile.ts","../../src/hooks/useFilePreviewSizeLimit.ts","../../src/views/File/FilePreview.tsx","../../src/views/File/FileCard.tsx","../../src/components/Detail.tsx","../../src/components/ClassDetail.tsx","../../src/components/CommitDetail.tsx","../../src/components/EditableTitle.tsx","../../src/views/ResourcePageDefault.tsx","../../src/views/Card/MessageCard.tsx","../../src/components/ExternalLink.tsx","../../src/views/Card/BookmarkCard.tsx","../../src/views/Card/ElementCard.tsx","../../src/views/FolderPage/GridItem/components.tsx","../../src/components/NewCard.tsx","../../src/components/forms/FileDropzone/FileDropzoneInput.tsx","../../src/ontologies/atomic-argu.ts","../../src/views/Article/ArticleCover.tsx","../../src/views/Article/ArticleDescription.tsx","../../src/views/Article/ArticlePage.tsx","../../src/views/Article/ArticleCard.tsx","../../src/views/Card/ResourceCard.tsx","../../src/components/Table.tsx","../../src/views/CollectionPage.tsx","../../src/views/EndpointPage.tsx","../../src/views/DrivePage.tsx","../../src/views/RedirectPage.tsx","../../src/views/InvitePage.tsx","../../../node_modules/.pnpm/@dnd-kit+utilities@3.2.0_react@18.1.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.js","../../../node_modules/.pnpm/@dnd-kit+accessibility@3.0.0_react@18.1.0/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js","../../../node_modules/.pnpm/@dnd-kit+core@6.0.5_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@dnd-kit/core/dist/core.esm.js","../../../node_modules/.pnpm/@dnd-kit+sortable@7.0.1_xfa4xoyyoay3waoakt6v5w3n4i/node_modules/@dnd-kit/sortable/dist/sortable.esm.js","../../src/views/Element.tsx","../../src/components/forms/FileDropzone/FileDropzone.tsx","../../src/views/DocumentPage.tsx","../../src/views/CrashPage.tsx","../../src/views/ErrorPage.tsx","../../src/components/CodeBlock.tsx","../../src/components/Title.tsx","../../src/views/ClassPage.tsx","../../src/views/File/FilePage.tsx","../../src/views/ChatRoomPage.tsx","../../src/views/MessagePage.tsx","../../src/views/BookmarkPage/BookmarkPreview.tsx","../../../lib/src/commit.ts","../../../lib/src/urls.ts","../../../lib/src/error.ts","../../src/helpers/debounce.ts","../../src/views/BookmarkPage/usePreview.ts","../../src/views/BookmarkPage/BookmarkPage.tsx","../../src/views/ImporterPage.tsx","../../src/components/Parent.tsx","../../src/components/ButtonGroup.tsx","../../src/views/FolderPage/DisplayStyleButton.tsx","../../src/views/FolderPage/GridItem/BasicGridItem.tsx","../../src/views/FolderPage/GridItem/BookmarkGridItem.tsx","../../src/components/AllPropsSimple.tsx","../../src/views/FolderPage/GridItem/DefaultGridItem.tsx","../../src/views/FolderPage/GridItem/ChatRoomGridItem.tsx","../../src/views/FolderPage/GridItem/DocumentGridItem.tsx","../../src/views/FolderPage/GridItem/FileGridItem.tsx","../../src/views/FolderPage/GridItem/ResourceGridItem.tsx","../../src/views/FolderPage/GridView.tsx","../../src/views/FolderPage/ListView.tsx","../../src/views/FolderPage/index.tsx","../../src/views/ResourcePage.tsx","../../src/components/SearchFilter.tsx","../../src/routes/SearchRoute.tsx","../../src/routes/AboutRoute.tsx","../../src/routes/ShowRoute.tsx","../../src/components/forms/NewForm/NewFormPage.tsx","../../src/routes/NewRoute.tsx","../../../node_modules/.pnpm/react-colorful@5.5.0_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/react-colorful/dist/index.module.js","../../src/components/NavStyleButton.tsx","../../src/components/forms/Checkbox.tsx","../../src/routes/SettingsTheme.tsx","../../src/routes/EditRoute.tsx","../../src/components/ChildrenList.tsx","../../src/routes/DataRoute.tsx","../../src/routes/ShortcutsRoute.tsx","../../src/routes/LocalRoute.tsx","../../src/routes/SettingsAgent.tsx","../../src/components/CQWrapper.tsx","../../src/routes/SettingsServer/WSIndicator.tsx","../../src/routes/SettingsServer/FavoriteButton.tsx","../../src/routes/SettingsServer/DriveRow.tsx","../../src/routes/SettingsServer/DrivesCard.tsx","../../src/routes/SettingsServer/index.tsx","../../src/components/InviteForm.tsx","../../src/routes/ShareRoute.tsx","../../src/routes/TokenRoute.tsx","../../src/routes/Routes.tsx","../../src/components/ResourceContextMenu/MenuBarDropdownTrigger.tsx","../../src/helpers/useFocus.tsx","../../src/components/Searchbar.tsx","../../src/components/Navigation.tsx","../../src/components/MetaSetter.tsx","../../src/components/Toaster.tsx","../../src/components/Dialog/DialogContainer.tsx","../../src/helpers/agentStorage.tsx","../../src/handlers/errorHandler.ts","../../src/handlers/sideBarHandler.ts","../../src/handlers/index.ts","../../../node_modules/.pnpm/react-icons@4.3.1_react@18.1.0/node_modules/react-icons/md/index.esm.js","../../src/hooks/useOnline.ts","../../src/components/NetworkIndicator.tsx","../../src/App.tsx","../../src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ba=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function t(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new t(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new t(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new t(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new t(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new t(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new t(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new t(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new t(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new t(a,5,!1,a.toLowerCase(),null,!1,!1)});var qa=/[\\-:]([a-z])/g;function ra(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(qa,\nra);z[b]=new t(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(qa,ra);z[b]=new t(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(qa,ra);z[b]=new t(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new t(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new t(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new t(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction sa(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Ma=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?La(a):\"\"}\nfunction Oa(a){switch(a.tag){case 5:return La(a.type);case 16:return La(\"Lazy\");case 13:return La(\"Suspense\");case 19:return La(\"SuspenseList\");case 0:case 2:case 15:return a=Na(a.type,!1),a;case 11:return a=Na(a.type.render,!1),a;case 1:return a=Na(a.type,!0),a;default:return\"\"}}\nfunction Pa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case wa:return\"Fragment\";case va:return\"Portal\";case za:return\"Profiler\";case xa:return\"StrictMode\";case Da:return\"Suspense\";case Ea:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ba:return(a.displayName||\"Context\")+\".Consumer\";case Aa:return(a._context.displayName||\"Context\")+\".Provider\";case Ca:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Fa:return b=a.displayName||null,null!==b?b:Pa(a.type)||\"Memo\";case Ga:b=a._payload;a=a._init;try{return Pa(a(b))}catch(c){}}return null}\nfunction Qa(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Pa(b);case 8:return b===xa?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Ra(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Sa(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ta(a){var b=Sa(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Ua(a){a._valueTracker||(a._valueTracker=Ta(a))}function Va(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Sa(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Wa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Xa(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Ya(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Ra(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function Za(a,b){b=b.checked;null!=b&&sa(a,\"checked\",b,!1)}\nfunction $a(a,b){Za(a,b);var c=Ra(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?bb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&bb(a,b.type,Ra(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction cb(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction bb(a,b,c){if(\"number\"!==b||Wa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var db=Array.isArray;\nfunction eb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=lb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction nb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar ob={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(ob).forEach(function(a){pb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);ob[b]=ob[a]})});function qb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||ob.hasOwnProperty(a)&&ob[a]?(\"\"+b).trim():b+\"px\"}\nfunction rb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=qb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var sb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction tb(a,b){if(b){if(sb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction ub(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var vb=null;function wb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var xb=null,yb=null,zb=null;\nfunction Ab(a){if(a=Bb(a)){if(\"function\"!==typeof xb)throw Error(p(280));var b=a.stateNode;b&&(b=Cb(b),xb(a.stateNode,a.type,b))}}function Db(a){yb?zb?zb.push(a):zb=[a]:yb=a}function Eb(){if(yb){var a=yb,b=zb;zb=yb=null;Ab(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(oc(a)/pc|0)|0}var qc=64,rc=4194304;\nfunction sc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function tc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=sc(h):(f&=g,0!==f&&(d=sc(f)))}else g=c&~e,0!==g?d=sc(g):0!==f&&(d=sc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction zc(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-nc(b);a[b]=c}function Ac(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=ae),de=String.fromCharCode(32),ee=!1;\nfunction fe(a,b){switch(a){case \"keyup\":return-1!==Zd.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function ge(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var he=!1;function ie(a,b){switch(a){case \"compositionend\":return ge(b);case \"keypress\":if(32!==b.which)return null;ee=!0;return de;case \"textInput\":return a=b.data,a===de&&ee?null:a;default:return null}}\nfunction je(a,b){if(he)return\"compositionend\"===a||!$d&&fe(a,b)?(a=md(),ld=kd=jd=null,he=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Ie(c)}}function Ke(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Ke(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Le(){for(var a=window,b=Wa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Wa(a.document)}return b}function Me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Ne(a){var b=Le(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Ke(c.ownerDocument.documentElement,c)){if(null!==d&&Me(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Je(c,f);var g=Je(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Pe=null,Qe=null,Re=null,Se=!1;\nfunction Te(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Se||null==Pe||Pe!==Wa(d)||(d=Pe,\"selectionStart\"in d&&Me(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Re&&He(Re,d)||(Re=d,d=ne(Qe,\"onSelect\"),0Sf||(a.current=Rf[Sf],Rf[Sf]=null,Sf--)}function G(a,b){Sf++;Rf[Sf]=a.current;a.current=b}var Uf={},H=Tf(Uf),Vf=Tf(!1),Wf=Uf;function Xf(a,b){var c=a.type.contextTypes;if(!c)return Uf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Yf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Zf(){E(Vf);E(H)}function $f(a,b,c){if(H.current!==Uf)throw Error(p(168));G(H,b);G(Vf,c)}function ag(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Qa(a)||\"Unknown\",e));return A({},c,d)}\nfunction bg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Uf;Wf=H.current;G(H,a);G(Vf,Vf.current);return!0}function cg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=ag(a,b,Wf),d.__reactInternalMemoizedMergedChildContext=a,E(Vf),E(H),G(H,a)):E(Vf);G(Vf,c)}var dg=null,eg=!1,fg=!1;function gg(a){null===dg?dg=[a]:dg.push(a)}function hg(a){eg=!0;gg(a)}\nfunction ig(){if(!fg&&null!==dg){fg=!0;var a=0,b=C;try{var c=dg;for(C=1;a>=g;e-=g;Yg=1<<32-nc(b)+e|c<m?(x=r,r=null):x=r.sibling;var v=q(e,r,h[m],k);if(null===v){null===r&&(r=x);break}a&&r&&null===v.alternate&&b(e,r);g=f(v,g,m);null===n?l=v:n.sibling=v;n=v;r=x}if(m===h.length)return c(e,r),I&&$g(e,m),l;if(null===r){for(;mr?(x=m,m=null):x=m.sibling;var w=q(e,m,v.value,k);if(null===w){null===m&&(m=x);break}a&&m&&null===w.alternate&&b(e,m);g=f(w,g,r);null===n?l=w:n.sibling=w;n=w;m=x}if(v.done)return c(e,\nm),I&&$g(e,r),l;if(null===m){for(;!v.done;r++,v=h.next())v=u(e,v.value,k),null!==v&&(g=f(v,g,r),null===n?l=v:n.sibling=v,n=v);I&&$g(e,r);return l}for(m=d(e,m);!v.done;r++,v=h.next())v=y(m,e,r,v.value,k),null!==v&&(a&&null!==v.alternate&&m.delete(null===v.key?r:v.key),g=f(v,g,r),null===n?l=v:n.sibling=v,n=v);a&&m.forEach(function(a){return b(e,a)});I&&$g(e,r);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===wa&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case ua:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===wa){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ga&&rh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=ph(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===wa?(d=xh(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=vh(f.type,f.key,f.props,null,a.mode,h),h.ref=ph(a,d,f),h.return=a,a=h)}return g(a);case va:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=wh(f,a.mode,h);d.return=a;a=d}return g(a);case Ga:return l=f._init,J(a,d,l(f._payload),h)}if(db(f))return m(a,d,f,h);if(Ja(f))return w(a,d,f,h);qh(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=uh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var yh=sh(!0),zh=sh(!1),Ah={},Bh=Tf(Ah),Ch=Tf(Ah),Dh=Tf(Ah);function Eh(a){if(a===Ah)throw Error(p(174));return a}function Fh(a,b){G(Dh,b);G(Ch,a);G(Bh,Ah);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:kb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=kb(b,a)}E(Bh);G(Bh,b)}function Gh(){E(Bh);E(Ch);E(Dh)}\nfunction Hh(a){Eh(Dh.current);var b=Eh(Bh.current);var c=kb(b,a.type);b!==c&&(G(Ch,a),G(Bh,c))}function Ih(a){Ch.current===a&&(E(Bh),E(Ch))}var K=Tf(0);\nfunction Jh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Kh=[];\nfunction Lh(){for(var a=0;ac?c:4;a(!0);var d=Nh.transition;Nh.transition={};try{a(!1),b()}finally{C=c,Nh.transition=d}}function Bi(){return ai().memoizedState}\nfunction Ci(a,b,c){var d=Kg(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};Di(a)?Ei(b,c):(Fi(a,b,c),c=Jg(),a=Lg(a,d,c),null!==a&&Gi(a,b,d))}\nfunction ni(a,b,c){var d=Kg(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Di(a))Ei(b,e);else{Fi(a,b,e);var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(Ge(h,g))return}catch(k){}finally{}c=Jg();a=Lg(a,d,c);null!==a&&Gi(a,b,d)}}function Di(a){var b=a.alternate;return a===L||null!==b&&b===L}\nfunction Ei(a,b){Qh=Ph=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Fi(a,b,c){Bg(a)?(a=b.interleaved,null===a?(c.next=c,null===vg?vg=[b]:vg.push(b)):(c.next=a.next,a.next=c),b.interleaved=c):(a=b.pending,null===a?c.next=c:(c.next=a.next,a.next=c),b.pending=c)}function Gi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Bc(a,c)}}\nvar Yh={readContext:ug,useCallback:O,useContext:O,useEffect:O,useImperativeHandle:O,useInsertionEffect:O,useLayoutEffect:O,useMemo:O,useReducer:O,useRef:O,useState:O,useDebugValue:O,useDeferredValue:O,useTransition:O,useMutableSource:O,useSyncExternalStore:O,useId:O,unstable_isNewReconciler:!1},Vh={readContext:ug,useCallback:function(a,b){$h().memoizedState=[a,void 0===b?null:b];return a},useContext:ug,useEffect:ri,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return pi(4194308,\n4,ui.bind(null,b,a),c)},useLayoutEffect:function(a,b){return pi(4194308,4,a,b)},useInsertionEffect:function(a,b){return pi(4,2,a,b)},useMemo:function(a,b){var c=$h();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=$h();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Ci.bind(null,L,a);return[d.memoizedState,a]},useRef:function(a){var b=\n$h();a={current:a};return b.memoizedState=a},useState:mi,useDebugValue:wi,useDeferredValue:function(a){return $h().memoizedState=a},useTransition:function(){var a=mi(!1),b=a[0];a=Ai.bind(null,a[1]);$h().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=L,e=$h();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===P)throw Error(p(349));0!==(Oh&30)||ki(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;ri(hi.bind(null,d,\nf,a),[a]);d.flags|=2048;ii(9,ji.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=$h(),b=P.identifierPrefix;if(I){var c=Zg;var d=Yg;c=(d&~(1<<32-nc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Rh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Nf]=b;a[Of]=d;Ti(a,b,!1,!1);b.stateNode=a;a:{g=ub(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eaj&&(b.flags|=\n128,d=!0,Xi(f,!1),b.lanes=4194304)}else{if(!d)if(a=Jh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Xi(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return Q(b),null}else 2*B()-f.renderingStartTime>aj&&1073741824!==c&&(b.flags|=128,d=!0,Xi(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=b,f.tail=b.sibling,f.renderingStartTime=\nB(),b.sibling=null,c=K.current,G(K,d?c&1|2:c&1),b;Q(b);return null;case 22:case 23:return bj(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(cj&1073741824)&&(Q(b),b.subtreeFlags&6&&(b.flags|=8192)):Q(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}var dj=ta.ReactCurrentOwner,tg=!1;function ej(a,b,c,d){b.child=null===a?zh(b,null,c,d):yh(b,a.child,c,d)}\nfunction fj(a,b,c,d,e){c=c.render;var f=b.ref;sg(b,e);d=Uh(a,b,c,d,f,e);c=Zh();if(null!==a&&!tg)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,gj(a,b,e);I&&c&&bh(b);b.flags|=1;ej(a,b,d,e);return b.child}\nfunction hj(a,b,c,d,e){if(null===a){var f=c.type;if(\"function\"===typeof f&&!ij(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,jj(a,b,f,d,e);a=vh(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:He;if(c(g,d)&&a.ref===b.ref)return gj(a,b,e)}b.flags|=1;a=th(f,d);a.ref=b.ref;a.return=b;return b.child=a}\nfunction jj(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(He(f,d)&&a.ref===b.ref)if(tg=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(tg=!0);else return b.lanes=a.lanes,gj(a,b,e)}return kj(a,b,c,d,e)}\nfunction lj(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if(\"hidden\"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(mj,cj),cj|=c;else if(0!==(c&1073741824))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=null!==f?f.baseLanes:c,G(mj,cj),cj|=d;else return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,G(mj,cj),cj|=a,null;\nelse null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,G(mj,cj),cj|=d;ej(a,b,e,c);return b.child}function nj(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function kj(a,b,c,d,e){var f=Yf(c)?Wf:H.current;f=Xf(b,f);sg(b,e);c=Uh(a,b,c,d,f,e);d=Zh();if(null!==a&&!tg)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,gj(a,b,e);I&&d&&bh(b);b.flags|=1;ej(a,b,c,e);return b.child}\nfunction oj(a,b,c,d,e){if(Yf(c)){var f=!0;bg(b)}else f=!1;sg(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),Og(b,c,d),Qg(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;\"object\"===typeof l&&null!==l?l=ug(l):(l=Yf(c)?Wf:H.current,l=Xf(b,l));var n=c.getDerivedStateFromProps,u=\"function\"===typeof n||\"function\"===typeof g.getSnapshotBeforeUpdate;u||\"function\"!==typeof g.UNSAFE_componentWillReceiveProps&&\n\"function\"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Pg(b,g,d,l);wg=!1;var q=b.memoizedState;g.state=q;Eg(b,d,g,e);k=b.memoizedState;h!==d||q!==k||Vf.current||wg?(\"function\"===typeof n&&(Ig(b,c,n,d),k=b.memoizedState),(h=wg||Ng(b,c,h,d,q,k,l))?(u||\"function\"!==typeof g.UNSAFE_componentWillMount&&\"function\"!==typeof g.componentWillMount||(\"function\"===typeof g.componentWillMount&&g.componentWillMount(),\"function\"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),\"function\"===\ntypeof g.componentDidMount&&(b.flags|=4194308)):(\"function\"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):(\"function\"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;yg(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:kg(b.type,h);g.props=l;u=b.pendingProps;q=g.context;k=c.contextType;\"object\"===typeof k&&null!==k?k=ug(k):(k=Yf(c)?Wf:H.current,k=Xf(b,k));var y=c.getDerivedStateFromProps;(n=\"function\"===\ntypeof y||\"function\"===typeof g.getSnapshotBeforeUpdate)||\"function\"!==typeof g.UNSAFE_componentWillReceiveProps&&\"function\"!==typeof g.componentWillReceiveProps||(h!==u||q!==k)&&Pg(b,g,d,k);wg=!1;q=b.memoizedState;g.state=q;Eg(b,d,g,e);var m=b.memoizedState;h!==u||q!==m||Vf.current||wg?(\"function\"===typeof y&&(Ig(b,c,y,d),m=b.memoizedState),(l=wg||Ng(b,c,l,d,q,m,k)||!1)?(n||\"function\"!==typeof g.UNSAFE_componentWillUpdate&&\"function\"!==typeof g.componentWillUpdate||(\"function\"===typeof g.componentWillUpdate&&\ng.componentWillUpdate(d,m,k),\"function\"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,m,k)),\"function\"===typeof g.componentDidUpdate&&(b.flags|=4),\"function\"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):(\"function\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&q===a.memoizedState||(b.flags|=4),\"function\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&q===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=m),g.props=d,g.state=m,g.context=\nk,d=l):(\"function\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&q===a.memoizedState||(b.flags|=4),\"function\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&q===a.memoizedState||(b.flags|=1024),d=!1)}return pj(a,b,c,d,f,e)}\nfunction pj(a,b,c,d,e,f){nj(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&cg(b,c,!1),gj(a,b,f);d=b.stateNode;dj.current=b;var h=g&&\"function\"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=yh(b,a.child,null,f),b.child=yh(b,null,h,f)):ej(a,b,h,f);b.memoizedState=d.state;e&&cg(b,c,!0);return b.child}function qj(a){var b=a.stateNode;b.pendingContext?$f(a,b.pendingContext,b.pendingContext!==b.context):b.context&&$f(a,b.context,!1);Fh(a,b.containerInfo)}\nfunction rj(a,b,c,d,e){nh();oh(e);b.flags|=256;ej(a,b,c,d);return b.child}var sj={dehydrated:null,treeContext:null,retryLane:0};function tj(a){return{baseLanes:a,cachePool:null,transitions:null}}function uj(a,b){return{baseLanes:a.baseLanes|b,cachePool:null,transitions:a.transitions}}\nfunction vj(a,b,c){var d=b.pendingProps,e=K.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;G(K,e&1);if(null===a){kh(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:\"$!\"===a.data?b.lanes=8:b.lanes=1073741824,null;e=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,e={mode:\"hidden\",children:e},0===(d&1)&&null!==f?(f.childLanes=0,f.pendingProps=\ne):f=wj(e,d,0,null),a=xh(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=tj(c),b.memoizedState=sj,a):xj(b,e)}e=a.memoizedState;if(null!==e){h=e.dehydrated;if(null!==h){if(g){if(b.flags&256)return b.flags&=-257,yj(a,b,c,Error(p(422)));if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=wj({mode:\"visible\",children:d.children},e,0,null);f=xh(f,e,c,null);f.flags|=2;d.return=b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&yh(b,a.child,\nnull,c);b.child.memoizedState=tj(c);b.memoizedState=sj;return f}if(0===(b.mode&1))b=yj(a,b,c,null);else if(\"$!\"===h.data)b=yj(a,b,c,Error(p(419)));else if(d=0!==(c&a.childLanes),tg||d){d=P;if(null!==d){switch(c&-c){case 4:f=2;break;case 16:f=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=\n268435456;break;default:f=0}d=0!==(f&(d.suspendedLanes|c))?0:f;0!==d&&d!==e.retryLane&&(e.retryLane=d,Lg(a,d,-1))}$i();b=yj(a,b,c,Error(p(421)))}else\"$?\"===h.data?(b.flags|=128,b.child=a.child,b=zj.bind(null,a),h._reactRetry=b,b=null):(c=e.treeContext,eh=Kf(h.nextSibling),dh=b,I=!0,fh=null,null!==c&&(Vg[Wg++]=Yg,Vg[Wg++]=Zg,Vg[Wg++]=Xg,Yg=c.id,Zg=c.overflow,Xg=b),b=xj(b,b.pendingProps.children),b.flags|=4096);return b}if(f)return d=Aj(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,\nf.memoizedState=null===e?tj(c):uj(e,c),f.childLanes=a.childLanes&~c,b.memoizedState=sj,d;c=Bj(a,b,d.children,c);b.memoizedState=null;return c}if(f)return d=Aj(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?tj(c):uj(e,c),f.childLanes=a.childLanes&~c,b.memoizedState=sj,d;c=Bj(a,b,d.children,c);b.memoizedState=null;return c}function xj(a,b){b=wj({mode:\"visible\",children:b},a.mode,0,null);b.return=a;return a.child=b}\nfunction Bj(a,b,c,d){var e=a.child;a=e.sibling;c=th(e,{mode:\"visible\",children:c});0===(b.mode&1)&&(c.lanes=d);c.return=b;c.sibling=null;null!==a&&(d=b.deletions,null===d?(b.deletions=[a],b.flags|=16):d.push(a));return b.child=c}\nfunction Aj(a,b,c,d,e){var f=b.mode;a=a.child;var g=a.sibling,h={mode:\"hidden\",children:c};0===(f&1)&&b.child!==a?(c=b.child,c.childLanes=0,c.pendingProps=h,b.deletions=null):(c=th(a,h),c.subtreeFlags=a.subtreeFlags&14680064);null!==g?d=th(g,d):(d=xh(d,f,e,null),d.flags|=2);d.return=b;c.return=b;c.sibling=d;b.child=c;return d}function yj(a,b,c,d){null!==d&&oh(d);yh(b,a.child,null,c);a=xj(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}\nfunction Cj(a,b,c){a.lanes|=b;var d=a.alternate;null!==d&&(d.lanes|=b);rg(a.return,b,c)}function Dj(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}\nfunction Ej(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;ej(a,b,d.children,c);d=K.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&Cj(a,c,b);else if(19===a.tag)Cj(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}G(K,d);if(0===(b.mode&1))b.memoizedState=\nnull;else switch(e){case \"forwards\":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===Jh(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Dj(b,!1,e,c,f);break;case \"backwards\":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===Jh(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Dj(b,!0,c,null,f);break;case \"together\":Dj(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}\nfunction gj(a,b,c){null!==a&&(b.dependencies=a.dependencies);Fg|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(p(153));if(null!==b.child){a=b.child;c=th(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=th(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}\nfunction Fj(a,b,c){switch(b.tag){case 3:qj(b);nh();break;case 5:Hh(b);break;case 1:Yf(b.type)&&bg(b);break;case 4:Fh(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;G(lg,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return G(K,K.current&1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return vj(a,b,c);G(K,K.current&1);a=gj(a,b,c);return null!==a?a.sibling:null}G(K,K.current&1);break;case 19:d=0!==(c&\nb.childLanes);if(0!==(a.flags&128)){if(d)return Ej(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);G(K,K.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,lj(a,b,c)}return gj(a,b,c)}\nfunction Gj(a,b){ch(b);switch(b.tag){case 1:return Yf(b.type)&&Zf(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Gh(),E(Vf),E(H),Lh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Ih(b),null;case 13:E(K);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));nh()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(K),null;case 4:return Gh(),null;case 10:return qg(b.type._context),null;case 22:case 23:return bj(),\nnull;case 24:return null;default:return null}}var Hj=!1,S=!1,Ij=\"function\"===typeof WeakSet?WeakSet:Set,T=null;function Jj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){U(a,b,d)}else c.current=null}function Kj(a,b,c){try{c()}catch(d){U(a,b,d)}}var Lj=!1;\nfunction Mj(a,b){Bf=cd;a=Le();if(Me(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(Z){c=null;break a}var g=0,h=-1,k=-1,l=0,n=0,u=a,q=null;b:for(;;){for(var y;;){u!==c||0!==e&&3!==u.nodeType||(h=g+e);u!==f||0!==d&&3!==u.nodeType||(k=g+d);3===u.nodeType&&(g+=\nu.nodeValue.length);if(null===(y=u.firstChild))break;q=u;u=y}for(;;){if(u===a)break b;q===c&&++l===e&&(h=g);q===f&&++n===d&&(k=g);if(null!==(y=u.nextSibling))break;u=q;q=u.parentNode}u=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Cf={focusedElem:a,selectionRange:c};cd=!1;for(T=b;null!==T;)if(b=T,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,T=a;else for(;null!==T;){b=T;try{var m=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==m){var w=m.memoizedProps,J=m.memoizedState,v=b.stateNode,x=v.getSnapshotBeforeUpdate(b.elementType===b.type?w:kg(b.type,w),J);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var r=b.stateNode.containerInfo;if(1===r.nodeType)r.textContent=\"\";else if(9===r.nodeType){var F=r.body;null!=F&&(F.textContent=\"\")}break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(Z){U(b,b.return,Z)}a=b.sibling;if(null!==a){a.return=b.return;T=a;break}T=b.return}m=Lj;Lj=!1;return m}\nfunction Nj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Kj(b,c,f)}e=e.next}while(e!==d)}}function Oj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Pj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Qj(a){var b=a.alternate;null!==b&&(a.alternate=null,Qj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Nf],delete b[Of],delete b[nf],delete b[Pf],delete b[Qf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Rj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Sj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Rj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Tj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Af));else if(4!==d&&(a=a.child,null!==a))for(Tj(a,b,c),a=a.sibling;null!==a;)Tj(a,b,c),a=a.sibling}\nfunction Uj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Uj(a,b,c),a=a.sibling;null!==a;)Uj(a,b,c),a=a.sibling}var V=null,Vj=!1;function Wj(a,b,c){for(c=c.child;null!==c;)Xj(a,b,c),c=c.sibling}\nfunction Xj(a,b,c){if(kc&&\"function\"===typeof kc.onCommitFiberUnmount)try{kc.onCommitFiberUnmount(jc,c)}catch(h){}switch(c.tag){case 5:S||Jj(c,b);case 6:var d=V,e=Vj;V=null;Wj(a,b,c);V=d;Vj=e;null!==V&&(Vj?(a=V,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):V.removeChild(c.stateNode));break;case 18:null!==V&&(Vj?(a=V,c=c.stateNode,8===a.nodeType?Jf(a.parentNode,c):1===a.nodeType&&Jf(a,c),ad(a)):Jf(V,c.stateNode));break;case 4:d=V;e=Vj;V=c.stateNode.containerInfo;Vj=!0;\nWj(a,b,c);V=d;Vj=e;break;case 0:case 11:case 14:case 15:if(!S&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Kj(c,b,g):0!==(f&4)&&Kj(c,b,g));e=e.next}while(e!==d)}Wj(a,b,c);break;case 1:if(!S&&(Jj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){U(c,b,h)}Wj(a,b,c);break;case 21:Wj(a,b,c);break;case 22:c.mode&1?(S=(d=S)||null!==\nc.memoizedState,Wj(a,b,c),S=d):Wj(a,b,c);break;default:Wj(a,b,c)}}function Yj(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Ij);b.forEach(function(b){var d=Zj.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction ak(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*jk(d/1960))-d;if(10a?16:a;if(null===uk)var d=!1;else{a=uk;uk=null;vk=0;if(0!==(W&6))throw Error(p(331));var e=W;W|=4;for(T=a.current;null!==T;){var f=T,g=f.child;if(0!==(T.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-dk?Jk(a,0):pk|=c);Ck(a,b)}function Xk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=rc,rc<<=1,0===(rc&130023424)&&(rc=4194304)));var c=Jg();a=Ak(a,b);null!==a&&(zc(a,b,c),Ck(a,c))}function zj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Xk(a,c)}\nfunction Zj(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Xk(a,c)}var Uk;\nUk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Vf.current)tg=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return tg=!1,Fj(a,b,c);tg=0!==(a.flags&131072)?!0:!1}else tg=!1,I&&0!==(b.flags&1048576)&&ah(b,Ug,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;var e=Xf(b,H.current);sg(b,c);e=Uh(null,b,d,a,e,c);var f=Zh();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?\n(b.tag=1,b.memoizedState=null,b.updateQueue=null,Yf(d)?(f=!0,bg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,xg(b),e.updater=Mg,b.stateNode=e,e._reactInternals=b,Qg(b,d,a,c),b=pj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&bh(b),ej(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Yk(d);a=kg(d,a);switch(e){case 0:b=kj(null,b,d,a,c);break a;case 1:b=oj(null,b,\nd,a,c);break a;case 11:b=fj(null,b,d,a,c);break a;case 14:b=hj(null,b,d,kg(d.type,a),c);break a}throw Error(p(306,d,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:kg(d,e),kj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:kg(d,e),oj(a,b,d,e,c);case 3:a:{qj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;yg(a,b);Eg(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,\ncache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=f,b.memoizedState=f,b.flags&256){e=Error(p(423));b=rj(a,b,d,c,e);break a}else if(d!==e){e=Error(p(424));b=rj(a,b,d,c,e);break a}else for(eh=Kf(b.stateNode.containerInfo.firstChild),dh=b,I=!0,fh=null,c=zh(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{nh();if(d===e){b=gj(a,b,c);break a}ej(a,b,d,c)}b=b.child}return b;case 5:return Hh(b),null===a&&kh(b),d=b.type,e=\nb.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Df(d,e)?g=null:null!==f&&Df(d,f)&&(b.flags|=32),nj(a,b),ej(a,b,g,c),b.child;case 6:return null===a&&kh(b),null;case 13:return vj(a,b,c);case 4:return Fh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=yh(b,null,d,c):ej(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:kg(d,e),fj(a,b,d,e,c);case 7:return ej(a,b,b.pendingProps,c),b.child;case 8:return ej(a,b,b.pendingProps.children,c),b.child;case 12:return ej(a,\nb,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;g=e.value;G(lg,d._currentValue);d._currentValue=g;if(null!==f)if(Ge(f.value,g)){if(f.children===e.children&&!Vf.current){b=gj(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=zg(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var n=l.pending;null===n?k.next=\nk:(k.next=n.next,n.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);rg(f.return,c,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);rg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}ej(a,b,e.children,c);b=b.child}return b;\ncase 9:return e=b.type,d=b.pendingProps.children,sg(b,c),e=ug(e),d=d(e),b.flags|=1,ej(a,b,d,c),b.child;case 14:return d=b.type,e=kg(d,b.pendingProps),e=kg(d.type,e),hj(a,b,d,e,c);case 15:return jj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:kg(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),b.tag=1,Yf(d)?(a=!0,bg(b)):a=!1,sg(b,c),Og(b,d,e),Qg(b,d,e,c),pj(null,b,d,!0,a,c);case 19:return Ej(a,b,c);case 22:return lj(a,b,c)}throw Error(p(156,\nb.tag));};function Ek(a,b){return $b(a,b)}function Zk(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function hh(a,b,c,d){return new Zk(a,b,c,d)}\nfunction ij(a){a=a.prototype;return!(!a||!a.isReactComponent)}function Yk(a){if(\"function\"===typeof a)return ij(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Ca)return 11;if(a===Fa)return 14}return 2}\nfunction th(a,b){var c=a.alternate;null===c?(c=hh(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction vh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)ij(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case wa:return xh(c.children,e,f,b);case xa:g=8;e|=8;break;case za:return a=hh(12,c,b,e|2),a.elementType=za,a.lanes=f,a;case Da:return a=hh(13,c,b,e),a.elementType=Da,a.lanes=f,a;case Ea:return a=hh(19,c,b,e),a.elementType=Ea,a.lanes=f,a;case Ha:return wj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Aa:g=10;break a;case Ba:g=9;break a;case Ca:g=11;\nbreak a;case Fa:g=14;break a;case Ga:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=hh(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function xh(a,b,c,d){a=hh(7,a,d,b);a.lanes=c;return a}function wj(a,b,c,d){a=hh(22,a,d,b);a.elementType=Ha;a.lanes=c;a.stateNode={};return a}function uh(a,b,c){a=hh(6,a,null,b);a.lanes=c;return a}\nfunction wh(a,b,c){b=hh(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction $k(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=yc(0);this.expirationTimes=yc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=yc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function al(a,b,c,d,e,f,g,h,k){a=new $k(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=hh(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};xg(f);return a}function bl(a,b,c){var d=3 createMemoryLocation(entry, typeof entry === \"string\" ? null : entry.state, index === 0 ? \"default\" : undefined));\n let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex);\n let action = Action.Pop;\n let listener = null;\n\n function clampIndex(n) {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n\n function getCurrentLocation() {\n return entries[index];\n }\n\n function createMemoryLocation(to, state, key) {\n if (state === void 0) {\n state = null;\n }\n\n let location = createLocation(entries ? getCurrentLocation().pathname : \"/\", to, state, key);\n warning(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in memory history: \" + JSON.stringify(to));\n return location;\n }\n\n function createHref(to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n let history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return getCurrentLocation();\n },\n\n createHref,\n\n createURL(to) {\n return new URL(createHref(to), \"http://localhost\");\n },\n\n encodeLocation(to) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\"\n };\n },\n\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation,\n delta: 1\n });\n }\n },\n\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation,\n delta: 0\n });\n }\n },\n\n go(delta) {\n action = Action.Pop;\n let nextIndex = clampIndex(index + delta);\n let nextLocation = entries[nextIndex];\n index = nextIndex;\n\n if (listener) {\n listener({\n action,\n location: nextLocation,\n delta\n });\n }\n },\n\n listen(fn) {\n listener = fn;\n return () => {\n listener = null;\n };\n }\n\n };\n return history;\n}\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n function createBrowserLocation(window, globalHistory) {\n let {\n pathname,\n search,\n hash\n } = window.location;\n return createLocation(\"\", {\n pathname,\n search,\n hash\n }, // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n\n function createBrowserHref(window, to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);\n}\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n function createHashLocation(window, globalHistory) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = parsePath(window.location.hash.substr(1));\n return createLocation(\"\", {\n pathname,\n search,\n hash\n }, // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n\n function createHashHref(window, to) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n\n function validateHashLocation(location, to) {\n warning(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\");\n }\n\n return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options);\n}\nfunction invariant(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\n * For browser-based histories, we combine the state and key into an object\n */\n\n\nfunction getHistoryState(location, index) {\n return {\n usr: location.state,\n key: location.key,\n idx: index\n };\n}\n/**\n * Creates a Location object with a unique key from the given Path\n */\n\n\nfunction createLocation(current, to, state, key) {\n if (state === void 0) {\n state = null;\n }\n\n let location = _extends({\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\"\n }, typeof to === \"string\" ? parsePath(to) : to, {\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: to && to.key || key || createKey()\n });\n\n return location;\n}\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\n\nfunction createPath(_ref) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = _ref;\n if (search && search !== \"?\") pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\") pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\n\nfunction parsePath(path) {\n let parsedPath = {};\n\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n let searchIndex = path.indexOf(\"?\");\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nfunction getUrlBasedHistory(getLocation, createHref, validateLocation, options) {\n if (options === void 0) {\n options = {};\n }\n\n let {\n window = document.defaultView,\n v5Compat = false\n } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener = null;\n let index = getIndex(); // Index should only be null when we initialize. If not, it's because the\n // user called history.pushState or history.replaceState directly, in which\n // case we should log a warning as it will result in bugs.\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), \"\");\n }\n\n function getIndex() {\n let state = globalHistory.state || {\n idx: null\n };\n return state.idx;\n }\n\n function handlePop() {\n action = Action.Pop;\n let nextIndex = getIndex();\n let delta = nextIndex == null ? null : nextIndex - index;\n index = nextIndex;\n\n if (listener) {\n listener({\n action,\n location: history.location,\n delta\n });\n }\n }\n\n function push(to, state) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location); // try...catch because iOS limits us to 100 pushState calls :/\n\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location,\n delta: 1\n });\n }\n }\n\n function replace(to, state) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location,\n delta: 0\n });\n }\n }\n\n function createURL(to) {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base = window.location.origin !== \"null\" ? window.location.origin : window.location.href;\n let href = typeof to === \"string\" ? to : createPath(to);\n invariant(base, \"No window.location.(origin|href) available to create URL for href: \" + href);\n return new URL(href, base);\n }\n\n let history = {\n get action() {\n return action;\n },\n\n get location() {\n return getLocation(window, globalHistory);\n },\n\n listen(fn) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n\n createHref(to) {\n return createHref(window, to);\n },\n\n createURL,\n\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createURL(to);\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash\n };\n },\n\n push,\n replace,\n\n go(n) {\n return globalHistory.go(n);\n }\n\n };\n return history;\n} //#endregion\n\nvar ResultType;\n\n(function (ResultType) {\n ResultType[\"data\"] = \"data\";\n ResultType[\"deferred\"] = \"deferred\";\n ResultType[\"redirect\"] = \"redirect\";\n ResultType[\"error\"] = \"error\";\n})(ResultType || (ResultType = {}));\n\nconst immutableRouteKeys = new Set([\"lazy\", \"caseSensitive\", \"path\", \"id\", \"index\", \"children\"]);\n\nfunction isIndexRoute(route) {\n return route.index === true;\n} // Walk the route tree generating unique IDs where necessary so we are working\n// solely with AgnosticDataRouteObject's within the Router\n\n\nfunction convertRoutesToDataRoutes(routes, detectErrorBoundary, parentPath, manifest) {\n if (parentPath === void 0) {\n parentPath = [];\n }\n\n if (manifest === void 0) {\n manifest = {};\n }\n\n return routes.map((route, index) => {\n let treePath = [...parentPath, index];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(route.index !== true || !route.children, \"Cannot specify children on an index route\");\n invariant(!manifest[id], \"Found a route id collision on id \\\"\" + id + \"\\\". Route \" + \"id's must be globally unique within Data Router usages\");\n\n if (isIndexRoute(route)) {\n let indexRoute = _extends({}, route, {\n hasErrorBoundary: detectErrorBoundary(route),\n id\n });\n\n manifest[id] = indexRoute;\n return indexRoute;\n } else {\n let pathOrLayoutRoute = _extends({}, route, {\n id,\n hasErrorBoundary: detectErrorBoundary(route),\n children: undefined\n });\n\n manifest[id] = pathOrLayoutRoute;\n\n if (route.children) {\n pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, detectErrorBoundary, treePath, manifest);\n }\n\n return pathOrLayoutRoute;\n }\n });\n}\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/utils/match-routes\n */\n\nfunction matchRoutes(routes, locationArg, basename) {\n if (basename === void 0) {\n basename = \"/\";\n }\n\n let location = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n let matches = null;\n\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch(branches[i], // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n safelyDecodeURI(pathname));\n }\n\n return matches;\n}\n\nfunction flattenRoutes(routes, branches, parentsMeta, parentPath) {\n if (branches === void 0) {\n branches = [];\n }\n\n if (parentsMeta === void 0) {\n parentsMeta = [];\n }\n\n if (parentPath === void 0) {\n parentPath = \"\";\n }\n\n let flattenRoute = (route, index, relativePath) => {\n let meta = {\n relativePath: relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(meta.relativePath.startsWith(parentPath), \"Absolute route path \\\"\" + meta.relativePath + \"\\\" nested under path \" + (\"\\\"\" + parentPath + \"\\\" is not valid. An absolute child route path \") + \"must start with the combined path of all its parent routes.\");\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n\n if (route.children && route.children.length > 0) {\n invariant( // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true, \"Index routes must not have child routes. Please remove \" + (\"all child routes from route path \\\"\" + path + \"\\\".\"));\n flattenRoutes(route.children, branches, routesMeta, path);\n } // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n\n\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta\n });\n };\n\n routes.forEach((route, index) => {\n var _route$path;\n\n // coarse-grain check for optional params\n if (route.path === \"\" || !((_route$path = route.path) != null && _route$path.includes(\"?\"))) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n return branches;\n}\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\n\n\nfunction explodeOptionalSegments(path) {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n let [first, ...rest] = segments; // Optional path segments are denoted by a trailing `?`\n\n let isOptional = first.endsWith(\"?\"); // Compute the corresponding required segment: `foo?` -> `foo`\n\n let required = first.replace(/\\?$/, \"\");\n\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n let result = []; // All child paths with the prefix. Do this for all children before the\n // optional version for all children so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explodes _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n\n result.push(...restExploded.map(subpath => subpath === \"\" ? required : [required, subpath].join(\"/\"))); // Then if this is an optional value, add all child versions without\n\n if (isOptional) {\n result.push(...restExploded);\n } // for absolute paths, ensure `/` instead of empty segment\n\n\n return result.map(exploded => path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded);\n}\n\nfunction rankRouteBranches(branches) {\n branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first\n : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\n\nconst isSplat = s => s === \"*\";\n\nfunction computeScore(path, index) {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === \"\" ? emptySegmentValue : staticSegmentValue), initialScore);\n}\n\nfunction compareIndexes(a, b) {\n let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n return siblings ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch(branch, pathname) {\n let {\n routesMeta\n } = branch;\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches = [];\n\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname = matchedPathname === \"/\" ? pathname : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath({\n path: meta.relativePath,\n caseSensitive: meta.caseSensitive,\n end\n }, remainingPathname);\n if (!match) return null;\n Object.assign(matchedParams, match.params);\n let route = meta.route;\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),\n route\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/utils/generate-path\n */\n\n\nfunction generatePath(originalPath, params) {\n if (params === void 0) {\n params = {};\n }\n\n let path = originalPath;\n\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(false, \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n path = path.replace(/\\*$/, \"/*\");\n } // ensure `/` is added at the beginning if the path is absolute\n\n\n const prefix = path.startsWith(\"/\") ? \"/\" : \"\";\n const segments = path.split(/\\/+/).map((segment, index, array) => {\n const isLastSegment = index === array.length - 1; // only apply the splat if it's the last segment\n\n if (isLastSegment && segment === \"*\") {\n const star = \"*\";\n const starParam = params[star]; // Apply the splat\n\n return starParam;\n }\n\n const keyMatch = segment.match(/^:(\\w+)(\\??)$/);\n\n if (keyMatch) {\n const [, key, optional] = keyMatch;\n let param = params[key];\n\n if (optional === \"?\") {\n return param == null ? \"\" : param;\n }\n\n if (param == null) {\n invariant(false, \"Missing \\\":\" + key + \"\\\" param\");\n }\n\n return param;\n } // Remove any optional markers from optional static segments\n\n\n return segment.replace(/\\?$/g, \"\");\n }) // Remove empty segments\n .filter(segment => !!segment);\n return prefix + segments.join(\"/\");\n}\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/utils/match-path\n */\n\nfunction matchPath(pattern, pathname) {\n if (typeof pattern === \"string\") {\n pattern = {\n path: pattern,\n caseSensitive: false,\n end: true\n };\n }\n\n let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);\n let match = pathname.match(matcher);\n if (!match) return null;\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params = paramNames.reduce((memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || \"\", paramName);\n return memo;\n }, {});\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern\n };\n}\n\nfunction compilePath(path, caseSensitive, end) {\n if (caseSensitive === void 0) {\n caseSensitive = false;\n }\n\n if (end === void 0) {\n end = true;\n }\n\n warning(path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"), \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n let paramNames = [];\n let regexpSource = \"^\" + path.replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:(\\w+)/g, (_, paramName) => {\n paramNames.push(paramName);\n return \"/([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource += path === \"*\" || path === \"/*\" ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else ;\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURI(value) {\n try {\n return decodeURI(value);\n } catch (error) {\n warning(false, \"The URL path \\\"\" + value + \"\\\" could not be decoded because it is is a \" + \"malformed URL segment. This is probably due to a bad percent \" + (\"encoding (\" + error + \").\"));\n return value;\n }\n}\n\nfunction safelyDecodeURIComponent(value, paramName) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(false, \"The value for the URL param \\\"\" + paramName + \"\\\" will not be decoded because\" + (\" the string \\\"\" + value + \"\\\" is a malformed URL segment. This is probably\") + (\" due to a bad percent encoding (\" + error + \").\"));\n return value;\n }\n}\n/**\n * @private\n */\n\n\nfunction stripBasename(pathname, basename) {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n } // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n\n\n let startIndex = basename.endsWith(\"/\") ? basename.length - 1 : basename.length;\n let nextChar = pathname.charAt(startIndex);\n\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(startIndex) || \"/\";\n}\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/utils/resolve-path\n */\n\nfunction resolvePath(to, fromPathname) {\n if (fromPathname === void 0) {\n fromPathname = \"/\";\n }\n\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\"\n } = typeof to === \"string\" ? parsePath(to) : to;\n let pathname = toPathname ? toPathname.startsWith(\"/\") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash)\n };\n}\n\nfunction resolvePathname(relativePath, fromPathname) {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n relativeSegments.forEach(segment => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nfunction getInvalidPathError(char, field, dest, path) {\n return \"Cannot include a '\" + char + \"' character in a manually specified \" + (\"`to.\" + field + \"` field [\" + JSON.stringify(path) + \"]. Please separate it out to the \") + (\"`to.\" + dest + \"` field. Alternatively you may provide the full path as \") + \"a string in and the router will parse it for you.\";\n}\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * \n * \n * \n *\n * \n * \n * }> // <-- Does not contribute\n * // <-- Does not contribute\n * \n * \n */\n\n\nfunction getPathContributingMatches(matches) {\n return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);\n}\n/**\n * @private\n */\n\nfunction resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {\n if (isPathRelative === void 0) {\n isPathRelative = false;\n }\n\n let to;\n\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = _extends({}, toArg);\n invariant(!to.pathname || !to.pathname.includes(\"?\"), getInvalidPathError(\"?\", \"pathname\", \"search\", to));\n invariant(!to.pathname || !to.pathname.includes(\"#\"), getInvalidPathError(\"#\", \"pathname\", \"hash\", to));\n invariant(!to.search || !to.search.includes(\"#\"), getInvalidPathError(\"#\", \"search\", \"hash\", to));\n }\n\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n let from; // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n\n if (isPathRelative || toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\"); // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n } // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n\n\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original \"to\" had one\n\n let hasExplicitTrailingSlash = toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\"); // Or if this was a link to the current path which has a trailing slash\n\n let hasCurrentTrailingSlash = (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n\n if (!path.pathname.endsWith(\"/\") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n/**\n * @private\n */\n\nfunction getToPathname(to) {\n // Empty strings should be treated the same as / paths\n return to === \"\" || to.pathname === \"\" ? \"/\" : typeof to === \"string\" ? parsePath(to).pathname : to.pathname;\n}\n/**\n * @private\n */\n\nconst joinPaths = paths => paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n/**\n * @private\n */\n\nconst normalizePathname = pathname => pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n/**\n * @private\n */\n\nconst normalizeSearch = search => !search || search === \"?\" ? \"\" : search.startsWith(\"?\") ? search : \"?\" + search;\n/**\n * @private\n */\n\nconst normalizeHash = hash => !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n */\n\nconst json = function json(data, init) {\n if (init === void 0) {\n init = {};\n }\n\n let responseInit = typeof init === \"number\" ? {\n status: init\n } : init;\n let headers = new Headers(responseInit.headers);\n\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n\n return new Response(JSON.stringify(data), _extends({}, responseInit, {\n headers\n }));\n};\nclass AbortedDeferredError extends Error {}\nclass DeferredData {\n constructor(data, responseInit) {\n this.pendingKeysSet = new Set();\n this.subscribers = new Set();\n this.deferredKeys = [];\n invariant(data && typeof data === \"object\" && !Array.isArray(data), \"defer() only accepts plain objects\"); // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n\n let reject;\n this.abortPromise = new Promise((_, r) => reject = r);\n this.controller = new AbortController();\n\n let onAbort = () => reject(new AbortedDeferredError(\"Deferred data aborted\"));\n\n this.unlistenAbortSignal = () => this.controller.signal.removeEventListener(\"abort\", onAbort);\n\n this.controller.signal.addEventListener(\"abort\", onAbort);\n this.data = Object.entries(data).reduce((acc, _ref) => {\n let [key, value] = _ref;\n return Object.assign(acc, {\n [key]: this.trackPromise(key, value)\n });\n }, {});\n\n if (this.done) {\n // All incoming values were resolved\n this.unlistenAbortSignal();\n }\n\n this.init = responseInit;\n }\n\n trackPromise(key, value) {\n if (!(value instanceof Promise)) {\n return value;\n }\n\n this.deferredKeys.push(key);\n this.pendingKeysSet.add(key); // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n\n let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, null, data), error => this.onSettle(promise, key, error)); // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n\n promise.catch(() => {});\n Object.defineProperty(promise, \"_tracked\", {\n get: () => true\n });\n return promise;\n }\n\n onSettle(promise, key, error, data) {\n if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n return Promise.reject(error);\n }\n\n this.pendingKeysSet.delete(key);\n\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n\n if (error) {\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n this.emit(false, key);\n return Promise.reject(error);\n }\n\n Object.defineProperty(promise, \"_data\", {\n get: () => data\n });\n this.emit(false, key);\n return data;\n }\n\n emit(aborted, settledKey) {\n this.subscribers.forEach(subscriber => subscriber(aborted, settledKey));\n }\n\n subscribe(fn) {\n this.subscribers.add(fn);\n return () => this.subscribers.delete(fn);\n }\n\n cancel() {\n this.controller.abort();\n this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n this.emit(true);\n }\n\n async resolveData(signal) {\n let aborted = false;\n\n if (!this.done) {\n let onAbort = () => this.cancel();\n\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise(resolve => {\n this.subscribe(aborted => {\n signal.removeEventListener(\"abort\", onAbort);\n\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n\n return aborted;\n }\n\n get done() {\n return this.pendingKeysSet.size === 0;\n }\n\n get unwrappedData() {\n invariant(this.data !== null && this.done, \"Can only unwrap data on initialized and settled deferreds\");\n return Object.entries(this.data).reduce((acc, _ref2) => {\n let [key, value] = _ref2;\n return Object.assign(acc, {\n [key]: unwrapTrackedPromise(value)\n });\n }, {});\n }\n\n get pendingKeys() {\n return Array.from(this.pendingKeysSet);\n }\n\n}\n\nfunction isTrackedPromise(value) {\n return value instanceof Promise && value._tracked === true;\n}\n\nfunction unwrapTrackedPromise(value) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n\n if (value._error) {\n throw value._error;\n }\n\n return value._data;\n}\n\nconst defer = function defer(data, init) {\n if (init === void 0) {\n init = {};\n }\n\n let responseInit = typeof init === \"number\" ? {\n status: init\n } : init;\n return new DeferredData(data, responseInit);\n};\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\n\nconst redirect = function redirect(url, init) {\n if (init === void 0) {\n init = 302;\n }\n\n let responseInit = init;\n\n if (typeof responseInit === \"number\") {\n responseInit = {\n status: responseInit\n };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n return new Response(null, _extends({}, responseInit, {\n headers\n }));\n};\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n */\n\nclass ErrorResponse {\n constructor(status, statusText, data, internal) {\n if (internal === void 0) {\n internal = false;\n }\n\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n\n}\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\n\nfunction isRouteErrorResponse(error) {\n return error != null && typeof error.status === \"number\" && typeof error.statusText === \"string\" && typeof error.internal === \"boolean\" && \"data\" in error;\n}\n\nconst validMutationMethodsArr = [\"post\", \"put\", \"patch\", \"delete\"];\nconst validMutationMethods = new Set(validMutationMethodsArr);\nconst validRequestMethodsArr = [\"get\", ...validMutationMethodsArr];\nconst validRequestMethods = new Set(validRequestMethodsArr);\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\nconst IDLE_NAVIGATION = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n};\nconst IDLE_FETCHER = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n};\nconst IDLE_BLOCKER = {\n state: \"unblocked\",\n proceed: undefined,\n reset: undefined,\n location: undefined\n};\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\";\nconst isServer = !isBrowser;\n\nconst defaultDetectErrorBoundary = route => Boolean(route.hasErrorBoundary); //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a router and listen to history POP navigations\n */\n\n\nfunction createRouter(init) {\n invariant(init.routes.length > 0, \"You must provide a non-empty routes array to createRouter\");\n let detectErrorBoundary = init.detectErrorBoundary || defaultDetectErrorBoundary; // Routes keyed by ID\n\n let manifest = {}; // Routes in tree format for matching\n\n let dataRoutes = convertRoutesToDataRoutes(init.routes, detectErrorBoundary, undefined, manifest);\n let inFlightDataRoutes; // Cleanup function for history\n\n let unlistenHistory = null; // Externally-provided functions to call on all state changes\n\n let subscribers = new Set(); // Externally-provided object to hold scroll restoration locations during routing\n\n let savedScrollPositions = null; // Externally-provided function to get scroll restoration keys\n\n let getScrollRestorationKey = null; // Externally-provided function to get current scroll position\n\n let getScrollPosition = null; // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n\n let initialScrollRestored = init.hydrationData != null;\n let initialMatches = matchRoutes(dataRoutes, init.history.location, init.basename);\n let initialErrors = null;\n\n if (initialMatches == null) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname\n });\n let {\n matches,\n route\n } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = {\n [route.id]: error\n };\n }\n\n let initialized = // All initialMatches need to be loaded before we're ready. If we have lazy\n // functions around still then we'll need to run them in initialize()\n !initialMatches.some(m => m.route.lazy) && ( // And we have to either have no loaders or have been provided hydrationData\n !initialMatches.some(m => m.route.loader) || init.hydrationData != null);\n let router;\n let state = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: init.hydrationData && init.hydrationData.loaderData || {},\n actionData: init.hydrationData && init.hydrationData.actionData || null,\n errors: init.hydrationData && init.hydrationData.errors || initialErrors,\n fetchers: new Map(),\n blockers: new Map()\n }; // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n\n let pendingAction = Action.Pop; // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n\n let pendingPreventScrollReset = false; // AbortController for the active navigation\n\n let pendingNavigationController; // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n\n let isUninterruptedRevalidation = false; // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidate()\n // - X-Remix-Revalidate (from redirect)\n\n let isRevalidationRequired = false; // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n\n let cancelledDeferredRoutes = []; // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n\n let cancelledFetcherLoads = []; // AbortControllers for any in-flight fetchers\n\n let fetchControllers = new Map(); // Track loads based on the order in which they started\n\n let incrementingLoadId = 0; // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n\n let pendingNavigationLoadId = -1; // Fetchers that triggered data reloads as a result of their actions\n\n let fetchReloadIds = new Map(); // Fetchers that triggered redirect navigations from their actions\n\n let fetchRedirectIds = new Set(); // Most recent href/match for fetcher.load calls for fetchers\n\n let fetchLoadMatches = new Map(); // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n\n let activeDeferreds = new Map(); // Store blocker functions in a separate Map outside of router state since\n // we don't need to update UI state if they change\n\n let blockerFunctions = new Map(); // Flag to ignore the next history update, so we can revert the URL change on\n // a POP navigation that was blocked by the user without touching router state\n\n let ignoreNextHistoryUpdate = false; // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(_ref => {\n let {\n action: historyAction,\n location,\n delta\n } = _ref;\n\n // Ignore this event if it was just us resetting the URL from a\n // blocked POP navigation\n if (ignoreNextHistoryUpdate) {\n ignoreNextHistoryUpdate = false;\n return;\n }\n\n warning(blockerFunctions.size === 0 || delta != null, \"You are trying to use a blocker on a POP navigation to a location \" + \"that was not created by @remix-run/router. This will fail silently in \" + \"production. This can happen if you are navigating outside the router \" + \"via `window.history.pushState`/`window.location.hash` instead of using \" + \"router navigation APIs. This can also happen if you are using \" + \"createHashRouter and the user manually changes the URL.\");\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction\n });\n\n if (blockerKey && delta != null) {\n // Restore the URL to match the current UI, but don't update router state\n ignoreNextHistoryUpdate = true;\n init.history.go(delta * -1); // Put the blocker into a blocked state\n\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location\n }); // Re-do the same POP navigation we just blocked\n\n init.history.go(delta);\n },\n\n reset() {\n deleteBlocker(blockerKey);\n updateState({\n blockers: new Map(router.state.blockers)\n });\n }\n\n });\n return;\n }\n\n return startNavigation(historyAction, location);\n });\n\n if (state.initialized) {\n return router;\n }\n\n let lazyMatches = state.matches.filter(m => m.route.lazy);\n\n if (lazyMatches.length === 0) {\n // Kick off initial data load if needed. Use Pop to avoid modifying history\n startNavigation(Action.Pop, state.location);\n return router;\n } // Load lazy modules, then kick off initial data load if needed\n\n\n let lazyPromises = lazyMatches.map(m => loadLazyRouteModule(m.route, detectErrorBoundary, manifest));\n Promise.all(lazyPromises).then(() => {\n let initialized = !state.matches.some(m => m.route.loader) || init.hydrationData != null;\n\n if (initialized) {\n // We already have required loaderData so we can just set initialized\n updateState({\n initialized: true\n });\n } else {\n // We still need to kick off initial data loads\n startNavigation(Action.Pop, state.location);\n }\n });\n return router;\n } // Clean up a router and it's side effects\n\n\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n } // Subscribe to state updates for the router\n\n\n function subscribe(fn) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n } // Update our state and notify the calling context of the change\n\n\n function updateState(newState) {\n state = _extends({}, state, newState);\n subscribers.forEach(subscriber => subscriber(state));\n } // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n\n\n function completeNavigation(location, newState) {\n var _location$state, _location$state2;\n\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === \"loading\" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;\n let actionData;\n\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n } // Always preserve any existing loaderData from re-used routes\n\n\n let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData; // On a successful navigation we can assume we got through all blockers\n // so we can start fresh\n\n for (let [key] of blockerFunctions) {\n deleteBlocker(key);\n } // Always respect the user flag. Otherwise don't reset on mutation\n // submission navigations unless they redirect\n\n\n let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true;\n\n if (inFlightDataRoutes) {\n dataRoutes = inFlightDataRoutes;\n inFlightDataRoutes = undefined;\n }\n\n updateState(_extends({}, newState, {\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches),\n preventScrollReset,\n blockers: new Map(state.blockers)\n }));\n\n if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === Action.Replace) {\n init.history.replace(location, location.state);\n } // Reset stateful navigation vars\n\n\n pendingAction = Action.Pop;\n pendingPreventScrollReset = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n cancelledFetcherLoads = [];\n } // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n\n\n async function navigate(to, opts) {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n\n let {\n path,\n submission,\n error\n } = normalizeNavigateOptions(to, opts);\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state); // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n\n nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation));\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n let historyAction = Action.Push;\n\n if (userReplace === true) {\n historyAction = Action.Replace;\n } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = Action.Replace;\n }\n\n let preventScrollReset = opts && \"preventScrollReset\" in opts ? opts.preventScrollReset === true : undefined;\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction\n });\n\n if (blockerKey) {\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location: nextLocation\n }); // Send the same navigation through\n\n navigate(to, opts);\n },\n\n reset() {\n deleteBlocker(blockerKey);\n updateState({\n blockers: new Map(state.blockers)\n });\n }\n\n });\n return;\n }\n\n return await startNavigation(historyAction, nextLocation, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace\n });\n } // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n\n\n function revalidate() {\n interruptActiveLoads();\n updateState({\n revalidation: \"loading\"\n }); // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n\n if (state.navigation.state === \"submitting\") {\n return;\n } // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n\n\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true\n });\n return;\n } // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n\n\n startNavigation(pendingAction || state.historyAction, state.navigation.location, {\n overrideNavigation: state.navigation\n });\n } // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n\n\n async function startNavigation(historyAction, location, opts) {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(routesToUse, location, init.basename); // Short circuit with a 404 on the root error boundary if we match nothing\n\n if (!matches) {\n let error = getInternalRouterError(404, {\n pathname: location.pathname\n });\n let {\n matches: notFoundMatches,\n route\n } = getShortCircuitMatches(routesToUse); // Cancel all pending deferred on 404s since we don't keep any routes\n\n cancelActiveDeferreds();\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error\n }\n });\n return;\n } // Short circuit if it's only a hash change and not a mutation submission\n // For example, on /page#hash and submit a
which will\n // default to a navigation to /page\n\n\n if (isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {\n completeNavigation(location, {\n matches\n });\n return;\n } // Create a controller/Request for this navigation\n\n\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);\n let pendingActionData;\n let pendingError;\n\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingError = {\n [findNearestBoundary(matches).route.id]: opts.pendingError\n };\n } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {\n // Call action if we received an action submission\n let actionOutput = await handleAction(request, location, opts.submission, matches, {\n replace: opts.replace\n });\n\n if (actionOutput.shortCircuited) {\n return;\n }\n\n pendingActionData = actionOutput.pendingActionData;\n pendingError = actionOutput.pendingActionError;\n\n let navigation = _extends({\n state: \"loading\",\n location\n }, opts.submission);\n\n loadingNavigation = navigation; // Create a GET request for the loaders\n\n request = new Request(request.url, {\n signal: request.signal\n });\n } // Call loaders\n\n\n let {\n shortCircuited,\n loaderData,\n errors\n } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.replace, pendingActionData, pendingError);\n\n if (shortCircuited) {\n return;\n } // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n\n\n pendingNavigationController = null;\n completeNavigation(location, _extends({\n matches\n }, pendingActionData ? {\n actionData: pendingActionData\n } : {}, {\n loaderData,\n errors\n }));\n } // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n\n\n async function handleAction(request, location, submission, matches, opts) {\n interruptActiveLoads(); // Put us in a submitting state\n\n let navigation = _extends({\n state: \"submitting\",\n location\n }, submission);\n\n updateState({\n navigation\n }); // Call our action and get the result\n\n let result;\n let actionMatch = getTargetMatch(matches, location);\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id\n })\n };\n } else {\n result = await callLoaderOrAction(\"action\", request, actionMatch, matches, manifest, detectErrorBoundary, router.basename);\n\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n }\n }\n\n if (isRedirectResult(result)) {\n let replace;\n\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n replace = result.location === state.location.pathname + state.location.search;\n }\n\n await startRedirectNavigation(state, result, {\n submission,\n replace\n });\n return {\n shortCircuited: true\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); // By default, all submissions are REPLACE navigations, but if the\n // action threw an error that'll be rendered in an errorElement, we fall\n // back to PUSH so that the user can use the back button to get back to\n // the pre-submission form location to try again\n\n if ((opts && opts.replace) !== true) {\n pendingAction = Action.Push;\n }\n\n return {\n // Send back an empty object we can use to clear out any prior actionData\n pendingActionData: {},\n pendingActionError: {\n [boundaryMatch.route.id]: result.error\n }\n };\n }\n\n if (isDeferredResult(result)) {\n throw getInternalRouterError(400, {\n type: \"defer-action\"\n });\n }\n\n return {\n pendingActionData: {\n [actionMatch.route.id]: result.data\n }\n };\n } // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n\n\n async function handleLoaders(request, location, matches, overrideNavigation, submission, replace, pendingActionData, pendingError) {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation = overrideNavigation;\n\n if (!loadingNavigation) {\n let navigation = _extends({\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n }, submission);\n\n loadingNavigation = navigation;\n } // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n\n\n let activeSubmission = submission ? submission : loadingNavigation.formMethod && loadingNavigation.formAction && loadingNavigation.formData && loadingNavigation.formEncType ? {\n formMethod: loadingNavigation.formMethod,\n formAction: loadingNavigation.formAction,\n formData: loadingNavigation.formData,\n formEncType: loadingNavigation.formEncType\n } : undefined;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, routesToUse, init.basename, pendingActionData, pendingError); // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n\n cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); // Short circuit if we have no loaders to run\n\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n completeNavigation(location, _extends({\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingError || null\n }, pendingActionData ? {\n actionData: pendingActionData\n } : {}));\n return {\n shortCircuited: true\n };\n } // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n\n\n if (!isUninterruptedRevalidation) {\n revalidatingFetchers.forEach(rf => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher = {\n state: \"loading\",\n data: fetcher && fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n let actionData = pendingActionData || state.actionData;\n updateState(_extends({\n navigation: loadingNavigation\n }, actionData ? Object.keys(actionData).length === 0 ? {\n actionData: null\n } : {\n actionData\n } : {}, revalidatingFetchers.length > 0 ? {\n fetchers: new Map(state.fetchers)\n } : {}));\n }\n\n pendingNavigationLoadId = ++incrementingLoadId;\n revalidatingFetchers.forEach(rf => fetchControllers.set(rf.key, pendingNavigationController));\n let {\n results,\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request);\n\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n } // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n\n\n revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key)); // If any loaders returned a redirect Response, start a new REPLACE navigation\n\n let redirect = findRedirect(results);\n\n if (redirect) {\n await startRedirectNavigation(state, redirect, {\n replace\n });\n return {\n shortCircuited: true\n };\n } // Process and commit output from loaders\n\n\n let {\n loaderData,\n errors\n } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds); // Wire up subscribers to update loaderData as promises settle\n\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe(aborted => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n return _extends({\n loaderData,\n errors\n }, didAbortFetchLoads || revalidatingFetchers.length > 0 ? {\n fetchers: new Map(state.fetchers)\n } : {});\n }\n\n function getFetcher(key) {\n return state.fetchers.get(key) || IDLE_FETCHER;\n } // Trigger a fetcher load/submit for the given fetcher key\n\n\n function fetch(key, routeId, href, opts) {\n if (isServer) {\n throw new Error(\"router.fetch() was called during the server render, but it shouldn't be. \" + \"You are likely calling a useFetcher() method in the body of your component. \" + \"Try moving it to a useEffect or a callback.\");\n }\n\n if (fetchControllers.has(key)) abortFetcher(key);\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let matches = matchRoutes(routesToUse, href, init.basename);\n\n if (!matches) {\n setFetcherError(key, routeId, getInternalRouterError(404, {\n pathname: href\n }));\n return;\n }\n\n let {\n path,\n submission\n } = normalizeNavigateOptions(href, opts, true);\n let match = getTargetMatch(matches, path);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, submission);\n return;\n } // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n\n\n fetchLoadMatches.set(key, {\n routeId,\n path\n });\n handleFetcherLoader(key, routeId, path, match, matches, submission);\n } // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n\n\n async function handleFetcherAction(key, routeId, path, match, requestMatches, submission) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n\n if (!match.route.action && !match.route.lazy) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId\n });\n setFetcherError(key, routeId, error);\n return;\n } // Put this fetcher into it's submitting state\n\n\n let existingFetcher = state.fetchers.get(key);\n\n let fetcher = _extends({\n state: \"submitting\"\n }, submission, {\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, fetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n }); // Call the action for the fetcher\n\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);\n fetchControllers.set(key, abortController);\n let actionResult = await callLoaderOrAction(\"action\", fetchRequest, match, requestMatches, manifest, detectErrorBoundary, router.basename);\n\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n return;\n }\n\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n fetchRedirectIds.add(key);\n\n let loadingFetcher = _extends({\n state: \"loading\"\n }, submission, {\n data: undefined,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadingFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n });\n return startRedirectNavigation(state, actionResult, {\n isFetchActionRedirect: true\n });\n } // Process any non-redirect errors thrown\n\n\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n\n if (isDeferredResult(actionResult)) {\n throw getInternalRouterError(400, {\n type: \"defer-action\"\n });\n } // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n\n\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let matches = state.navigation.state !== \"idle\" ? matchRoutes(routesToUse, state.navigation.location, init.basename) : state.matches;\n invariant(matches, \"Didn't find any matches after fetcher action\");\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n\n let loadFetcher = _extends({\n state: \"loading\",\n data: actionResult.data\n }, submission, {\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadFetcher);\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, routesToUse, init.basename, {\n [match.route.id]: actionResult.data\n }, undefined // No need to send through errors since we short circuit above\n ); // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n\n revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => {\n let staleKey = rf.key;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher = {\n state: \"loading\",\n data: existingFetcher && existingFetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(staleKey, revalidatingFetcher);\n fetchControllers.set(staleKey, abortController);\n });\n updateState({\n fetchers: new Map(state.fetchers)\n });\n let {\n results,\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);\n\n if (abortController.signal.aborted) {\n return;\n }\n\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach(r => fetchControllers.delete(r.key));\n let redirect = findRedirect(results);\n\n if (redirect) {\n return startRedirectNavigation(state, redirect);\n } // Process and commit output from loaders\n\n\n let {\n loaderData,\n errors\n } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds);\n let doneFetcher = {\n state: \"idle\",\n data: actionResult.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n let didAbortFetchLoads = abortStaleFetchLoads(loadId); // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n\n if (state.navigation.state === \"loading\" && loadId > pendingNavigationLoadId) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers)\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState(_extends({\n errors,\n loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors)\n }, didAbortFetchLoads ? {\n fetchers: new Map(state.fetchers)\n } : {}));\n isRevalidationRequired = false;\n }\n } // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n\n\n async function handleFetcherLoader(key, routeId, path, match, matches, submission) {\n let existingFetcher = state.fetchers.get(key); // Put this fetcher into it's loading state\n\n let loadingFetcher = _extends({\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n }, submission, {\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadingFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n }); // Call the loader for this fetcher route match\n\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);\n fetchControllers.set(key, abortController);\n let result = await callLoaderOrAction(\"loader\", fetchRequest, match, matches, manifest, detectErrorBoundary, router.basename); // Deferred isn't supported for fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n\n if (isDeferredResult(result)) {\n result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result;\n } // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n\n\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n if (fetchRequest.signal.aborted) {\n return;\n } // If the loader threw a redirect Response, start a new REPLACE navigation\n\n\n if (isRedirectResult(result)) {\n await startRedirectNavigation(state, result);\n return;\n } // Process any non-redirect errors thrown\n\n\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n state.fetchers.delete(key); // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -\n // do we need to behave any differently with our non-redirect errors?\n // What if it was a non-redirect Response?\n\n updateState({\n fetchers: new Map(state.fetchers),\n errors: {\n [boundaryMatch.route.id]: result.error\n }\n });\n return;\n }\n\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\"); // Put the fetcher back into an idle state\n\n let doneFetcher = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n });\n }\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n\n\n async function startRedirectNavigation(state, redirect, _temp) {\n var _window;\n\n let {\n submission,\n replace,\n isFetchActionRedirect\n } = _temp === void 0 ? {} : _temp;\n\n if (redirect.revalidate) {\n isRevalidationRequired = true;\n }\n\n let redirectLocation = createLocation(state.location, redirect.location, // TODO: This can be removed once we get rid of useTransition in Remix v2\n _extends({\n _isRedirect: true\n }, isFetchActionRedirect ? {\n _isFetchActionRedirect: true\n } : {}));\n invariant(redirectLocation, \"Expected a location on the redirect navigation\"); // Check if this an absolute external redirect that goes to a new origin\n\n if (ABSOLUTE_URL_REGEX.test(redirect.location) && isBrowser && typeof ((_window = window) == null ? void 0 : _window.location) !== \"undefined\") {\n let url = init.history.createURL(redirect.location);\n let isDifferentBasename = stripBasename(url.pathname, init.basename || \"/\") == null;\n\n if (window.location.origin !== url.origin || isDifferentBasename) {\n if (replace) {\n window.location.replace(redirect.location);\n } else {\n window.location.assign(redirect.location);\n }\n\n return;\n }\n } // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n\n\n pendingNavigationController = null;\n let redirectHistoryAction = replace === true ? Action.Replace : Action.Push; // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n\n let {\n formMethod,\n formAction,\n formEncType,\n formData\n } = state.navigation;\n\n if (!submission && formMethod && formAction && formData && formEncType) {\n submission = {\n formMethod,\n formAction,\n formEncType,\n formData\n };\n } // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n\n\n if (redirectPreserveMethodStatusCodes.has(redirect.status) && submission && isMutationMethod(submission.formMethod)) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: _extends({}, submission, {\n formAction: redirect.location\n }),\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset\n });\n } else {\n // Otherwise, we kick off a new loading navigation, preserving the\n // submission info for the duration of this navigation\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: {\n state: \"loading\",\n location: redirectLocation,\n formMethod: submission ? submission.formMethod : undefined,\n formAction: submission ? submission.formAction : undefined,\n formEncType: submission ? submission.formEncType : undefined,\n formData: submission ? submission.formData : undefined\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset\n });\n }\n }\n\n async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) {\n // Call all navigation loaders and revalidating fetcher loaders in parallel,\n // then slice off the results into separate arrays so we can handle them\n // accordingly\n let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction(\"loader\", request, match, matches, manifest, detectErrorBoundary, router.basename)), ...fetchersToLoad.map(f => {\n if (f.matches && f.match) {\n return callLoaderOrAction(\"loader\", createClientSideRequest(init.history, f.path, request.signal), f.match, f.matches, manifest, detectErrorBoundary, router.basename);\n } else {\n let error = {\n type: ResultType.error,\n error: getInternalRouterError(404, {\n pathname: f.path\n })\n };\n return error;\n }\n })]);\n let loaderResults = results.slice(0, matchesToLoad.length);\n let fetcherResults = results.slice(matchesToLoad.length);\n await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, request.signal, false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map(f => f.match), fetcherResults, request.signal, true)]);\n return {\n results,\n loaderResults,\n fetcherResults\n };\n }\n\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true; // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n\n cancelledDeferredRoutes.push(...cancelActiveDeferreds()); // Abort in-flight fetcher loads\n\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.push(key);\n abortFetcher(key);\n }\n });\n }\n\n function setFetcherError(key, routeId, error) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error\n },\n fetchers: new Map(state.fetchers)\n });\n }\n\n function deleteFetcher(key) {\n if (fetchControllers.has(key)) abortFetcher(key);\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n state.fetchers.delete(key);\n }\n\n function abortFetcher(key) {\n let controller = fetchControllers.get(key);\n invariant(controller, \"Expected fetch controller: \" + key);\n controller.abort();\n fetchControllers.delete(key);\n }\n\n function markFetchersDone(keys) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher = {\n state: \"idle\",\n data: fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n function markFetchRedirectsDone() {\n let doneKeys = [];\n\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n }\n }\n\n markFetchersDone(doneKeys);\n }\n\n function abortStaleFetchLoads(landedId) {\n let yeetedKeys = [];\n\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n\n function getBlocker(key, fn) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n }\n\n return blocker;\n }\n\n function deleteBlocker(key) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n } // Utility function to update blockers, ensuring valid state transitions\n\n\n function updateBlocker(key, newBlocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER; // Poor mans state machine :)\n // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n\n invariant(blocker.state === \"unblocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"proceeding\" || blocker.state === \"blocked\" && newBlocker.state === \"unblocked\" || blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\", \"Invalid blocker state transition: \" + blocker.state + \" -> \" + newBlocker.state);\n state.blockers.set(key, newBlocker);\n updateState({\n blockers: new Map(state.blockers)\n });\n }\n\n function shouldBlockNavigation(_ref2) {\n let {\n currentLocation,\n nextLocation,\n historyAction\n } = _ref2;\n\n if (blockerFunctions.size === 0) {\n return;\n } // We ony support a single active blocker at the moment since we don't have\n // any compelling use cases for multi-blocker yet\n\n\n if (blockerFunctions.size > 1) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n\n let entries = Array.from(blockerFunctions.entries());\n let [blockerKey, blockerFunction] = entries[entries.length - 1];\n let blocker = state.blockers.get(blockerKey);\n\n if (blocker && blocker.state === \"proceeding\") {\n // If the blocker is currently proceeding, we don't need to re-check\n // it and can let this navigation continue\n return;\n } // At this point, we know we're unblocked/blocked so we need to check the\n // user-provided blocker function\n\n\n if (blockerFunction({\n currentLocation,\n nextLocation,\n historyAction\n })) {\n return blockerKey;\n }\n }\n\n function cancelActiveDeferreds(predicate) {\n let cancelledRouteIds = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n } // Opt in to capturing and reporting scroll positions during navigations,\n // used by the component\n\n\n function enableScrollRestoration(positions, getPosition, getKey) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n\n getScrollRestorationKey = getKey || (location => location.key); // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered \n // and therefore have no savedScrollPositions available\n\n\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n\n if (y != null) {\n updateState({\n restoreScrollPosition: y\n });\n }\n }\n\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n\n function saveScrollPosition(location, matches) {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n\n function getSavedScrollPosition(location, matches) {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n let y = savedScrollPositions[key];\n\n if (typeof y === \"number\") {\n return y;\n }\n }\n\n return null;\n }\n\n function _internalSetRoutes(newRoutes) {\n inFlightDataRoutes = newRoutes;\n }\n\n router = {\n get basename() {\n return init.basename;\n },\n\n get state() {\n return state;\n },\n\n get routes() {\n return dataRoutes;\n },\n\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: to => init.history.createHref(to),\n encodeLocation: to => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher,\n dispose,\n getBlocker,\n deleteBlocker,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds,\n // TODO: Remove setRoutes, it's temporary to avoid dealing with\n // updating the tree while validating the update algorithm.\n _internalSetRoutes\n };\n return router;\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\n\nconst UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\nfunction createStaticHandler(routes, opts) {\n invariant(routes.length > 0, \"You must provide a non-empty routes array to createStaticHandler\");\n let manifest = {};\n let detectErrorBoundary = (opts == null ? void 0 : opts.detectErrorBoundary) || defaultDetectErrorBoundary;\n let dataRoutes = convertRoutesToDataRoutes(routes, detectErrorBoundary, undefined, manifest);\n let basename = (opts ? opts.basename : null) || \"/\";\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n */\n\n async function query(request, _temp2) {\n let {\n requestContext\n } = _temp2 === void 0 ? {} : _temp2;\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't\n\n if (!isValidMethod(method) && method !== \"head\") {\n let error = getInternalRouterError(405, {\n method\n });\n let {\n matches: methodNotAllowedMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, {\n pathname: location.pathname\n });\n let {\n matches: notFoundMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n }\n\n let result = await queryImpl(request, location, matches, requestContext);\n\n if (isResponse(result)) {\n return result;\n } // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n\n\n return _extends({\n location,\n basename\n }, result);\n }\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n */\n\n\n async function queryRoute(request, _temp3) {\n let {\n routeId,\n requestContext\n } = _temp3 === void 0 ? {} : _temp3;\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't\n\n if (!isValidMethod(method) && method !== \"head\" && method !== \"options\") {\n throw getInternalRouterError(405, {\n method\n });\n } else if (!matches) {\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n\n let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location);\n\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n\n let result = await queryImpl(request, location, matches, requestContext, match);\n\n if (isResponse(result)) {\n return result;\n }\n\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n } // Pick off the right state value to return\n\n\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n\n if (result.loaderData) {\n var _result$activeDeferre;\n\n let data = Object.values(result.loaderData)[0];\n\n if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) {\n data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n }\n\n return data;\n }\n\n return undefined;\n }\n\n async function queryImpl(request, location, matches, requestContext, routeMatch) {\n invariant(request.signal, \"query()/queryRoute() requests must contain an AbortController signal\");\n\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, routeMatch != null);\n return result;\n }\n\n let result = await loadRouteData(request, matches, requestContext, routeMatch);\n return isResponse(result) ? result : _extends({}, result, {\n actionData: null,\n actionHeaders: {}\n });\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction, we throw\n // it to bail out and then return or throw here based on whether the user\n // returned or threw\n if (isQueryRouteResponse(e)) {\n if (e.type === ResultType.error && !isRedirectResponse(e.response)) {\n throw e.response;\n }\n\n return e.response;\n } // Redirects are always returned since they don't propagate to catch\n // boundaries\n\n\n if (isRedirectResponse(e)) {\n return e;\n }\n\n throw e;\n }\n }\n\n async function submit(request, matches, actionMatch, requestContext, isRouteRequest) {\n let result;\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id\n });\n\n if (isRouteRequest) {\n throw error;\n }\n\n result = {\n type: ResultType.error,\n error\n };\n } else {\n result = await callLoaderOrAction(\"action\", request, actionMatch, matches, manifest, detectErrorBoundary, basename, true, isRouteRequest, requestContext);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(method + \"() call aborted\");\n }\n }\n\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.status,\n headers: {\n Location: result.location\n }\n });\n }\n\n if (isDeferredResult(result)) {\n let error = getInternalRouterError(400, {\n type: \"defer-action\"\n });\n\n if (isRouteRequest) {\n throw error;\n }\n\n result = {\n type: ResultType.error,\n error\n };\n }\n\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: {\n [actionMatch.route.id]: result.data\n },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(request, matches, requestContext, undefined, {\n [boundaryMatch.route.id]: result.error\n }); // action status codes take precedence over loader status codes\n\n return _extends({}, context, {\n statusCode: isRouteErrorResponse(result.error) ? result.error.status : 500,\n actionData: null,\n actionHeaders: _extends({}, result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {})\n });\n } // Create a GET request for the loaders\n\n\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal\n });\n let context = await loadRouteData(loaderRequest, matches, requestContext);\n return _extends({}, context, result.statusCode ? {\n statusCode: result.statusCode\n } : {}, {\n actionData: {\n [actionMatch.route.id]: result.data\n },\n actionHeaders: _extends({}, result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {})\n });\n }\n\n async function loadRouteData(request, matches, requestContext, routeMatch, pendingActionError) {\n let isRouteRequest = routeMatch != null; // Short circuit if we have no loaders to run (queryRoute())\n\n if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader) && !(routeMatch != null && routeMatch.route.lazy)) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch == null ? void 0 : routeMatch.route.id\n });\n }\n\n let requestMatches = routeMatch ? [routeMatch] : getLoaderMatchesUntilBoundary(matches, Object.keys(pendingActionError || {})[0]);\n let matchesToLoad = requestMatches.filter(m => m.route.loader || m.route.lazy); // Short circuit if we have no loaders to run (query())\n\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce((acc, m) => Object.assign(acc, {\n [m.route.id]: null\n }), {}),\n errors: pendingActionError || null,\n statusCode: 200,\n loaderHeaders: {},\n activeDeferreds: null\n };\n }\n\n let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction(\"loader\", request, match, matches, manifest, detectErrorBoundary, basename, true, isRouteRequest, requestContext))]);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(method + \"() call aborted\");\n } // Process and commit output from loaders\n\n\n let activeDeferreds = new Map();\n let context = processRouteLoaderData(matches, matchesToLoad, results, pendingActionError, activeDeferreds); // Add a null for any non-loader matches for proper revalidation on the client\n\n let executedLoaders = new Set(matchesToLoad.map(match => match.route.id));\n matches.forEach(match => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n return _extends({}, context, {\n matches,\n activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null\n });\n }\n\n return {\n dataRoutes,\n query,\n queryRoute\n };\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\n\nfunction getStaticContextFromError(routes, context, error) {\n let newContext = _extends({}, context, {\n statusCode: 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error\n }\n });\n\n return newContext;\n}\n\nfunction isSubmissionNavigation(opts) {\n return opts != null && \"formData\" in opts;\n} // Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\n\n\nfunction normalizeNavigateOptions(to, opts, isFetcher) {\n if (isFetcher === void 0) {\n isFetcher = false;\n }\n\n let path = typeof to === \"string\" ? to : createPath(to); // Return location verbatim on non-submission navigations\n\n if (!opts || !isSubmissionNavigation(opts)) {\n return {\n path\n };\n }\n\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, {\n method: opts.formMethod\n })\n };\n } // Create a Submission on non-GET navigations\n\n\n let submission;\n\n if (opts.formData) {\n submission = {\n formMethod: opts.formMethod || \"get\",\n formAction: stripHashFromPath(path),\n formEncType: opts && opts.formEncType || \"application/x-www-form-urlencoded\",\n formData: opts.formData\n };\n\n if (isMutationMethod(submission.formMethod)) {\n return {\n path,\n submission\n };\n }\n } // Flatten submission onto URLSearchParams for GET submissions\n\n\n let parsedPath = parsePath(path);\n let searchParams = convertFormDataToSearchParams(opts.formData); // Since fetcher GET submissions only run a single loader (as opposed to\n // navigation GET submissions which run all loaders), we need to preserve\n // any incoming ?index params\n\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n\n parsedPath.search = \"?\" + searchParams;\n return {\n path: createPath(parsedPath),\n submission\n };\n} // Filter out all routes below any caught error as they aren't going to\n// render so we don't need to load them\n\n\nfunction getLoaderMatchesUntilBoundary(matches, boundaryId) {\n let boundaryMatches = matches;\n\n if (boundaryId) {\n let index = matches.findIndex(m => m.route.id === boundaryId);\n\n if (index >= 0) {\n boundaryMatches = matches.slice(0, index);\n }\n }\n\n return boundaryMatches;\n}\n\nfunction getMatchesToLoad(history, state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, routesToUse, basename, pendingActionData, pendingError) {\n let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : undefined;\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n let defaultShouldRevalidate = // Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate\n isRevalidationRequired || // Clicked the same link, resubmitted a GET form\n currentUrl.toString() === nextUrl.toString() || // Search params affect all loaders\n currentUrl.search !== nextUrl.search; // Pick navigation matches that are net-new or qualify for revalidation\n\n let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;\n let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);\n let navigationMatches = boundaryMatches.filter((match, index) => {\n if (match.route.lazy) {\n // We haven't loaded this route yet so we don't know if it's got a loader!\n return true;\n }\n\n if (match.route.loader == null) {\n return false;\n } // Always call the loader on new route instances and pending defer cancellations\n\n\n if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) {\n return true;\n } // This is the default implementation for when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n\n\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n return shouldRevalidateLoader(match, _extends({\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params\n }, submission, {\n actionResult,\n defaultShouldRevalidate: defaultShouldRevalidate || isNewRouteInstance(currentRouteMatch, nextRouteMatch)\n }));\n }); // Pick fetcher.loads that need to be revalidated\n\n let revalidatingFetchers = [];\n fetchLoadMatches.forEach((f, key) => {\n // Don't revalidate if fetcher won't be present in the subsequent render\n if (!matches.some(m => m.route.id === f.routeId)) {\n return;\n }\n\n let fetcherMatches = matchRoutes(routesToUse, f.path, basename); // If the fetcher path no longer matches, push it in with null matches so\n // we can trigger a 404 in callLoadersAndMaybeResolveData\n\n if (!fetcherMatches) {\n revalidatingFetchers.push(_extends({\n key\n }, f, {\n matches: null,\n match: null\n }));\n return;\n }\n\n let fetcherMatch = getTargetMatch(fetcherMatches, f.path);\n\n if (cancelledFetcherLoads.includes(key)) {\n revalidatingFetchers.push(_extends({\n key,\n matches: fetcherMatches,\n match: fetcherMatch\n }, f));\n return;\n } // Revalidating fetchers are decoupled from the route matches since they\n // hit a static href, so they _always_ check shouldRevalidate and the\n // default is strictly if a revalidation is explicitly required (action\n // submissions, useRevalidator, X-Remix-Revalidate).\n\n\n let shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends({\n currentUrl,\n currentParams: state.matches[state.matches.length - 1].params,\n nextUrl,\n nextParams: matches[matches.length - 1].params\n }, submission, {\n actionResult,\n defaultShouldRevalidate\n }));\n\n if (shouldRevalidate) {\n revalidatingFetchers.push(_extends({\n key,\n matches: fetcherMatches,\n match: fetcherMatch\n }, f));\n }\n });\n return [navigationMatches, revalidatingFetchers];\n}\n\nfunction isNewLoader(currentLoaderData, currentMatch, match) {\n let isNew = // [a] -> [a, b]\n !currentMatch || // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id; // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n\n let isMissingData = currentLoaderData[match.route.id] === undefined; // Always load if this is a net-new route or we don't yet have data\n\n return isNew || isMissingData;\n}\n\nfunction isNewRouteInstance(currentMatch, match) {\n let currentPath = currentMatch.route.path;\n return (// param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n currentPath != null && currentPath.endsWith(\"*\") && currentMatch.params[\"*\"] !== match.params[\"*\"]\n );\n}\n\nfunction shouldRevalidateLoader(loaderMatch, arg) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n\n return arg.defaultShouldRevalidate;\n}\n/**\n * Execute route.lazy() methods to lazily load route modules (loader, action,\n * shouldRevalidate) and update the routeManifest in place which shares objects\n * with dataRoutes so those get updated as well.\n */\n\n\nasync function loadLazyRouteModule(route, detectErrorBoundary, manifest) {\n if (!route.lazy) {\n return;\n }\n\n let lazyRoute = await route.lazy(); // If the lazy route function was executed and removed by another parallel\n // call then we can return - first lazy() to finish wins because the return\n // value of lazy is expected to be static\n\n if (!route.lazy) {\n return;\n }\n\n let routeToUpdate = manifest[route.id];\n invariant(routeToUpdate, \"No route found in manifest\"); // Update the route in place. This should be safe because there's no way\n // we could yet be sitting on this route as we can't get there without\n // resolving lazy() first.\n //\n // This is different than the HMR \"update\" use-case where we may actively be\n // on the route being updated. The main concern boils down to \"does this\n // mutation affect any ongoing navigations or any current state.matches\n // values?\". If not, it should be safe to update in place.\n\n let routeUpdates = {};\n\n for (let lazyRouteProperty in lazyRoute) {\n let staticRouteValue = routeToUpdate[lazyRouteProperty];\n let isPropertyStaticallyDefined = staticRouteValue !== undefined && // This property isn't static since it should always be updated based\n // on the route updates\n lazyRouteProperty !== \"hasErrorBoundary\";\n warning(!isPropertyStaticallyDefined, \"Route \\\"\" + routeToUpdate.id + \"\\\" has a static property \\\"\" + lazyRouteProperty + \"\\\" \" + \"defined but its lazy function is also returning a value for this property. \" + (\"The lazy route property \\\"\" + lazyRouteProperty + \"\\\" will be ignored.\"));\n\n if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) {\n routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty];\n }\n } // Mutate the route with the provided updates. Do this first so we pass\n // the updated version to detectErrorBoundary\n\n\n Object.assign(routeToUpdate, routeUpdates); // Mutate the `hasErrorBoundary` property on the route based on the route\n // updates and remove the `lazy` function so we don't resolve the lazy\n // route again.\n\n Object.assign(routeToUpdate, {\n // To keep things framework agnostic, we use the provided\n // `detectErrorBoundary` function to set the `hasErrorBoundary` route\n // property since the logic will differ between frameworks.\n hasErrorBoundary: detectErrorBoundary(_extends({}, routeToUpdate)),\n lazy: undefined\n });\n}\n\nasync function callLoaderOrAction(type, request, match, matches, manifest, detectErrorBoundary, basename, isStaticRequest, isRouteRequest, requestContext) {\n if (basename === void 0) {\n basename = \"/\";\n }\n\n if (isStaticRequest === void 0) {\n isStaticRequest = false;\n }\n\n if (isRouteRequest === void 0) {\n isRouteRequest = false;\n }\n\n let resultType;\n let result;\n let onReject;\n\n let runHandler = handler => {\n // Setup a promise we can race against so that abort signals short circuit\n let reject;\n let abortPromise = new Promise((_, r) => reject = r);\n\n onReject = () => reject();\n\n request.signal.addEventListener(\"abort\", onReject);\n return Promise.race([handler({\n request,\n params: match.params,\n context: requestContext\n }), abortPromise]);\n };\n\n try {\n let handler = match.route[type];\n\n if (match.route.lazy) {\n if (handler) {\n // Run statically defined handler in parallel with lazy()\n let values = await Promise.all([runHandler(handler), loadLazyRouteModule(match.route, detectErrorBoundary, manifest)]);\n result = values[0];\n } else {\n // Load lazy route module, then run any returned handler\n await loadLazyRouteModule(match.route, detectErrorBoundary, manifest);\n handler = match.route[type];\n\n if (handler) {\n // Handler still run even if we got interrupted to maintain consistency\n // with un-abortable behavior of handler execution on non-lazy or\n // previously-lazy-loaded routes\n result = await runHandler(handler);\n } else if (type === \"action\") {\n throw getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: match.route.id\n });\n } else {\n // lazy() route has no loader to run. Short circuit here so we don't\n // hit the invariant below that errors on returning undefined.\n return {\n type: ResultType.data,\n data: undefined\n };\n }\n }\n } else {\n invariant(handler, \"Could not find the \" + type + \" to run on the \\\"\" + match.route.id + \"\\\" route\");\n result = await runHandler(handler);\n }\n\n invariant(result !== undefined, \"You defined \" + (type === \"action\" ? \"an action\" : \"a loader\") + \" for route \" + (\"\\\"\" + match.route.id + \"\\\" but didn't return anything from your `\" + type + \"` \") + \"function. Please return a value or `null`.\");\n } catch (e) {\n resultType = ResultType.error;\n result = e;\n } finally {\n if (onReject) {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n }\n\n if (isResponse(result)) {\n let status = result.status; // Process redirects\n\n if (redirectStatusCodes.has(status)) {\n let location = result.headers.get(\"Location\");\n invariant(location, \"Redirects returned/thrown from loaders/actions must have a Location header\"); // Support relative routing in internal redirects\n\n if (!ABSOLUTE_URL_REGEX.test(location)) {\n let activeMatches = matches.slice(0, matches.indexOf(match) + 1);\n let routePathnames = getPathContributingMatches(activeMatches).map(match => match.pathnameBase);\n let resolvedLocation = resolveTo(location, routePathnames, new URL(request.url).pathname);\n invariant(createPath(resolvedLocation), \"Unable to resolve redirect location: \" + location); // Prepend the basename to the redirect location if we have one\n\n if (basename) {\n let path = resolvedLocation.pathname;\n resolvedLocation.pathname = path === \"/\" ? basename : joinPaths([basename, path]);\n }\n\n location = createPath(resolvedLocation);\n } else if (!isStaticRequest) {\n // Strip off the protocol+origin for same-origin + same-basename absolute\n // redirects. If this is a static request, we can let it go back to the\n // browser as-is\n let currentUrl = new URL(request.url);\n let url = location.startsWith(\"//\") ? new URL(currentUrl.protocol + location) : new URL(location);\n let isSameBasename = stripBasename(url.pathname, basename) != null;\n\n if (url.origin === currentUrl.origin && isSameBasename) {\n location = url.pathname + url.search + url.hash;\n }\n } // Don't process redirects in the router during static requests requests.\n // Instead, throw the Response and let the server handle it with an HTTP\n // redirect. We also update the Location header in place in this flow so\n // basename and relative routing is taken into account\n\n\n if (isStaticRequest) {\n result.headers.set(\"Location\", location);\n throw result;\n }\n\n return {\n type: ResultType.redirect,\n status,\n location,\n revalidate: result.headers.get(\"X-Remix-Revalidate\") !== null\n };\n } // For SSR single-route requests, we want to hand Responses back directly\n // without unwrapping. We do this with the QueryRouteResponse wrapper\n // interface so we can know whether it was returned or thrown\n\n\n if (isRouteRequest) {\n // eslint-disable-next-line no-throw-literal\n throw {\n type: resultType || ResultType.data,\n response: result\n };\n }\n\n let data;\n let contentType = result.headers.get(\"Content-Type\"); // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n data = await result.json();\n } else {\n data = await result.text();\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: new ErrorResponse(status, result.statusText, data),\n headers: result.headers\n };\n }\n\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers\n };\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: result\n };\n }\n\n if (result instanceof DeferredData) {\n var _result$init, _result$init2;\n\n return {\n type: ResultType.deferred,\n deferredData: result,\n statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status,\n headers: ((_result$init2 = result.init) == null ? void 0 : _result$init2.headers) && new Headers(result.init.headers)\n };\n }\n\n return {\n type: ResultType.data,\n data: result\n };\n} // Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\n\n\nfunction createClientSideRequest(history, location, signal, submission) {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init = {\n signal\n };\n\n if (submission && isMutationMethod(submission.formMethod)) {\n let {\n formMethod,\n formEncType,\n formData\n } = submission;\n init.method = formMethod.toUpperCase();\n init.body = formEncType === \"application/x-www-form-urlencoded\" ? convertFormDataToSearchParams(formData) : formData;\n } // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n\n\n return new Request(url, init);\n}\n\nfunction convertFormDataToSearchParams(formData) {\n let searchParams = new URLSearchParams();\n\n for (let [key, value] of formData.entries()) {\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n searchParams.append(key, value instanceof File ? value.name : value);\n }\n\n return searchParams;\n}\n\nfunction processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) {\n // Fill in loaderData/errors from our loaders\n let loaderData = {};\n let errors = null;\n let statusCode;\n let foundError = false;\n let loaderHeaders = {}; // Process loader results into state.loaderData/state.errors\n\n results.forEach((result, index) => {\n let id = matchesToLoad[index].route.id;\n invariant(!isRedirectResult(result), \"Cannot handle redirect results in processLoaderData\");\n\n if (isErrorResult(result)) {\n // Look upwards from the matched route for the closest ancestor\n // error boundary, defaulting to the root match\n let boundaryMatch = findNearestBoundary(matches, id);\n let error = result.error; // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n\n if (pendingError) {\n error = Object.values(pendingError)[0];\n pendingError = undefined;\n }\n\n errors = errors || {}; // Prefer higher error values if lower errors bubble to the same boundary\n\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n } // Clear our any prior loaderData for the throwing route\n\n\n loaderData[id] = undefined; // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;\n }\n\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n if (isDeferredResult(result)) {\n activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data;\n } else {\n loaderData[id] = result.data;\n } // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n\n\n if (result.statusCode != null && result.statusCode !== 200 && !foundError) {\n statusCode = result.statusCode;\n }\n\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n }); // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n\n if (pendingError) {\n errors = pendingError;\n loaderData[Object.keys(pendingError)[0]] = undefined;\n }\n\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders\n };\n}\n\nfunction processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) {\n let {\n loaderData,\n errors\n } = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds); // Process results from our revalidating fetchers\n\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let {\n key,\n match\n } = revalidatingFetchers[index];\n invariant(fetcherResults !== undefined && fetcherResults[index] !== undefined, \"Did not find corresponding fetcher result\");\n let result = fetcherResults[index]; // Process fetcher non-redirect errors\n\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id);\n\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = _extends({}, errors, {\n [boundaryMatch.route.id]: result.error\n });\n }\n\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n invariant(false, \"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n return {\n loaderData,\n errors\n };\n}\n\nfunction mergeLoaderData(loaderData, newLoaderData, matches, errors) {\n let mergedLoaderData = _extends({}, newLoaderData);\n\n for (let match of matches) {\n let id = match.route.id;\n\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n }\n } else if (loaderData[id] !== undefined && match.route.loader) {\n // Preserve existing keys not included in newLoaderData and where a loader\n // wasn't removed by HMR\n mergedLoaderData[id] = loaderData[id];\n }\n\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n\n return mergedLoaderData;\n} // Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\n\n\nfunction findNearestBoundary(matches, routeId) {\n let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches];\n return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0];\n}\n\nfunction getShortCircuitMatches(routes) {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.find(r => r.index || !r.path || r.path === \"/\") || {\n id: \"__shim-error-route__\"\n };\n return {\n matches: [{\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route\n }],\n route\n };\n}\n\nfunction getInternalRouterError(status, _temp4) {\n let {\n pathname,\n routeId,\n method,\n type\n } = _temp4 === void 0 ? {} : _temp4;\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n\n if (status === 400) {\n statusText = \"Bad Request\";\n\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide a `loader` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else if (type === \"defer-action\") {\n errorMessage = \"defer() is not supported in actions\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = \"Route \\\"\" + routeId + \"\\\" does not match URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = \"No route matches URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method.toUpperCase() + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide an `action` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else if (method) {\n errorMessage = \"Invalid request method \\\"\" + method.toUpperCase() + \"\\\"\";\n }\n }\n\n return new ErrorResponse(status || 500, statusText, new Error(errorMessage), true);\n} // Find any returned redirect errors, starting from the lowest match\n\n\nfunction findRedirect(results) {\n for (let i = results.length - 1; i >= 0; i--) {\n let result = results[i];\n\n if (isRedirectResult(result)) {\n return result;\n }\n }\n}\n\nfunction stripHashFromPath(path) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath(_extends({}, parsedPath, {\n hash: \"\"\n }));\n}\n\nfunction isHashChangeOnly(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash !== b.hash;\n}\n\nfunction isDeferredResult(result) {\n return result.type === ResultType.deferred;\n}\n\nfunction isErrorResult(result) {\n return result.type === ResultType.error;\n}\n\nfunction isRedirectResult(result) {\n return (result && result.type) === ResultType.redirect;\n}\n\nfunction isResponse(value) {\n return value != null && typeof value.status === \"number\" && typeof value.statusText === \"string\" && typeof value.headers === \"object\" && typeof value.body !== \"undefined\";\n}\n\nfunction isRedirectResponse(result) {\n if (!isResponse(result)) {\n return false;\n }\n\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\n\nfunction isQueryRouteResponse(obj) {\n return obj && isResponse(obj.response) && (obj.type === ResultType.data || ResultType.error);\n}\n\nfunction isValidMethod(method) {\n return validRequestMethods.has(method);\n}\n\nfunction isMutationMethod(method) {\n return validMutationMethods.has(method);\n}\n\nasync function resolveDeferredResults(currentMatches, matchesToLoad, results, signal, isFetcher, currentLoaderData) {\n for (let index = 0; index < results.length; index++) {\n let result = results[index];\n let match = matchesToLoad[index]; // If we don't have a match, then we can have a deferred result to do\n // anything with. This is for revalidating fetchers where the route was\n // removed during HMR\n\n if (!match) {\n continue;\n }\n\n let currentMatch = currentMatches.find(m => m.route.id === match.route.id);\n let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n\n if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n await resolveDeferredData(result, signal, isFetcher).then(result => {\n if (result) {\n results[index] = result || results[index];\n }\n });\n }\n }\n}\n\nasync function resolveDeferredData(result, signal, unwrap) {\n if (unwrap === void 0) {\n unwrap = false;\n }\n\n let aborted = await result.deferredData.resolveData(signal);\n\n if (aborted) {\n return;\n }\n\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e\n };\n }\n }\n\n return {\n type: ResultType.data,\n data: result.deferredData.data\n };\n}\n\nfunction hasNakedIndexQuery(search) {\n return new URLSearchParams(search).getAll(\"index\").some(v => v === \"\");\n} // Note: This should match the format exported by useMatches, so if you change\n// this please also change that :) Eventually we'll DRY this up\n\n\nfunction createUseMatchesMatch(match, loaderData) {\n let {\n route,\n pathname,\n params\n } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id],\n handle: route.handle\n };\n}\n\nfunction getTargetMatch(matches, location) {\n let search = typeof location === \"string\" ? parsePath(location).search : location.search;\n\n if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || \"\")) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n } // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n\n\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n} //#endregion\n\nexport { AbortedDeferredError, Action, ErrorResponse, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, DeferredData as UNSAFE_DeferredData, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, invariant as UNSAFE_invariant, warning as UNSAFE_warning, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, createStaticHandler, defer, generatePath, getStaticContextFromError, getToPathname, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, resolvePath, resolveTo, stripBasename };\n//# sourceMappingURL=router.js.map\n","/**\n * React Router v6.9.0\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_getPathContributingMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, isRouteErrorResponse, createMemoryHistory, stripBasename, AbortedDeferredError, createRouter } from '@remix-run/router';\nexport { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from '@remix-run/router';\nimport * as React from 'react';\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n\nfunction isPolyfill(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nconst is = typeof Object.is === \"function\" ? Object.is : isPolyfill; // Intentionally not using named imports because Rollup uses dynamic\n// dispatch for CommonJS interop named imports.\n\nconst {\n useState,\n useEffect,\n useLayoutEffect,\n useDebugValue\n} = React;\nlet didWarnOld18Alpha = false;\nlet didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works\n// because of a very particular set of implementation details and assumptions\n// -- change any one of them and it will break. The most important assumption\n// is that updates are always synchronous, because concurrent rendering is\n// only available in versions of React that also have a built-in\n// useSyncExternalStore API. And we only use this shim when the built-in API\n// does not exist.\n//\n// Do not assume that the clever hacks used by this hook also work in general.\n// The point of this shim is to replace the need for hacks by other libraries.\n\nfunction useSyncExternalStore$2(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n// React do not expose a way to check if we're hydrating. So users of the shim\n// will need to track that themselves and return the correct value\n// from `getSnapshot`.\ngetServerSnapshot) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!didWarnOld18Alpha) {\n if (\"startTransition\" in React) {\n didWarnOld18Alpha = true;\n console.error(\"You are using an outdated, pre-release alpha of React 18 that \" + \"does not support useSyncExternalStore. The \" + \"use-sync-external-store shim will not work correctly. Upgrade \" + \"to a newer pre-release.\");\n }\n }\n } // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n\n\n const value = getSnapshot();\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!didWarnUncachedGetSnapshot) {\n const cachedValue = getSnapshot();\n\n if (!is(value, cachedValue)) {\n console.error(\"The result of getSnapshot should be cached to avoid an infinite loop\");\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n\n\n const [{\n inst\n }, forceUpdate] = useState({\n inst: {\n value,\n getSnapshot\n }\n }); // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing check that\n // happens on subscribe.\n\n useLayoutEffect(() => {\n inst.value = value;\n inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, [subscribe, value, getSnapshot]);\n useEffect(() => {\n // Check for changes right before subscribing. Subsequent changes will be\n // detected in the subscription handler.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n }\n\n const handleStoreChange = () => {\n // TODO: Because there is no cross-renderer API for batching updates, it's\n // up to the consumer of this library to wrap their subscription event\n // with unstable_batchedUpdates. Should we try to detect when this isn't\n // the case and print a warning in development?\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange); // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [subscribe]);\n useDebugValue(value);\n return value;\n}\n\nfunction checkIfSnapshotChanged(inst) {\n const latestGetSnapshot = inst.getSnapshot;\n const prevValue = inst.value;\n\n try {\n const nextValue = latestGetSnapshot();\n return !is(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\nfunction useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {\n // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n // React do not expose a way to check if we're hydrating. So users of the shim\n // will need to track that themselves and return the correct value\n // from `getSnapshot`.\n return getSnapshot();\n}\n\n/**\n * Inlined into the react-router repo since use-sync-external-store does not\n * provide a UMD-compatible package, so we need this to be able to distribute\n * UMD react-router bundles\n */\nconst canUseDOM = !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nconst isServerEnvironment = !canUseDOM;\nconst shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2;\nconst useSyncExternalStore = \"useSyncExternalStore\" in React ? (module => module.useSyncExternalStore)(React) : shim;\n\nconst DataRouterContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterContext.displayName = \"DataRouter\";\n}\n\nconst DataRouterStateContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterStateContext.displayName = \"DataRouterState\";\n}\n\nconst AwaitContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n AwaitContext.displayName = \"Await\";\n}\n\nconst NavigationContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n NavigationContext.displayName = \"Navigation\";\n}\n\nconst LocationContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n LocationContext.displayName = \"Location\";\n}\n\nconst RouteContext = /*#__PURE__*/React.createContext({\n outlet: null,\n matches: []\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n RouteContext.displayName = \"Route\";\n}\n\nconst RouteErrorContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n RouteErrorContext.displayName = \"RouteError\";\n}\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/hooks/use-href\n */\n\nfunction useHref(to, _temp) {\n let {\n relative\n } = _temp === void 0 ? {} : _temp;\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useHref() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let {\n basename,\n navigator\n } = React.useContext(NavigationContext);\n let {\n hash,\n pathname,\n search\n } = useResolvedPath(to, {\n relative\n });\n let joinedPathname = pathname; // If we're operating within a basename, prepend it to the pathname prior\n // to creating the href. If this is a root navigation, then just use the raw\n // basename which allows the basename to have full control over the presence\n // of a trailing slash on root links\n\n if (basename !== \"/\") {\n joinedPathname = pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n\n return navigator.createHref({\n pathname: joinedPathname,\n search,\n hash\n });\n}\n/**\n * Returns true if this component is a descendant of a .\n *\n * @see https://reactrouter.com/hooks/use-in-router-context\n */\n\nfunction useInRouterContext() {\n return React.useContext(LocationContext) != null;\n}\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/hooks/use-location\n */\n\nfunction useLocation() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useLocation() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n return React.useContext(LocationContext).location;\n}\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/hooks/use-navigation-type\n */\n\nfunction useNavigationType() {\n return React.useContext(LocationContext).navigationType;\n}\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * .\n *\n * @see https://reactrouter.com/hooks/use-match\n */\n\nfunction useMatch(pattern) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useMatch() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let {\n pathname\n } = useLocation();\n return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);\n}\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\n\n/**\n * Returns an imperative method for changing the location. Used by s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/hooks/use-navigate\n */\nfunction useNavigate() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useNavigate() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let {\n basename,\n navigator\n } = React.useContext(NavigationContext);\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));\n let activeRef = React.useRef(false);\n React.useEffect(() => {\n activeRef.current = true;\n });\n let navigate = React.useCallback(function (to, options) {\n if (options === void 0) {\n options = {};\n }\n\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(activeRef.current, \"You should call navigate() in a React.useEffect(), not when \" + \"your component is first rendered.\") : void 0;\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n\n let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === \"path\"); // If we're operating within a basename, prepend it to the pathname prior\n // to handing off to history. If this is a root navigation, then we\n // navigate to the raw basename which allows the basename to have full\n // control over the presence of a trailing slash on root links\n\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);\n }, [basename, navigator, routePathnamesJson, locationPathname]);\n return navigate;\n}\nconst OutletContext = /*#__PURE__*/React.createContext(null);\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/hooks/use-outlet-context\n */\n\nfunction useOutletContext() {\n return React.useContext(OutletContext);\n}\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by to render child routes.\n *\n * @see https://reactrouter.com/hooks/use-outlet\n */\n\nfunction useOutlet(context) {\n let outlet = React.useContext(RouteContext).outlet;\n\n if (outlet) {\n return /*#__PURE__*/React.createElement(OutletContext.Provider, {\n value: context\n }, outlet);\n }\n\n return outlet;\n}\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/hooks/use-params\n */\n\nfunction useParams() {\n let {\n matches\n } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? routeMatch.params : {};\n}\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/hooks/use-resolved-path\n */\n\nfunction useResolvedPath(to, _temp2) {\n let {\n relative\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));\n return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === \"path\"), [to, routePathnamesJson, locationPathname, relative]);\n}\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an to render their child route's\n * element.\n *\n * @see https://reactrouter.com/hooks/use-routes\n */\n\nfunction useRoutes(routes, locationArg) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useRoutes() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let {\n navigator\n } = React.useContext(NavigationContext);\n let dataRouterStateContext = React.useContext(DataRouterStateContext);\n let {\n matches: parentMatches\n } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n\n if (process.env.NODE_ENV !== \"production\") {\n // You won't get a warning about 2 different under a \n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // \n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // } />\n // } />\n // \n //\n // function Blog() {\n // return (\n // \n // } />\n // \n // );\n // }\n let parentPath = parentRoute && parentRoute.path || \"\";\n warningOnce(parentPathname, !parentRoute || parentPath.endsWith(\"*\"), \"You rendered descendant (or called `useRoutes()`) at \" + (\"\\\"\" + parentPathname + \"\\\" (under ) but the \") + \"parent route path has no trailing \\\"*\\\". This means if you navigate \" + \"deeper, the parent won't match anymore and therefore the child \" + \"routes will never render.\\n\\n\" + (\"Please change the parent to .\"));\n }\n\n let locationFromContext = useLocation();\n let location;\n\n if (locationArg) {\n var _parsedLocationArg$pa;\n\n let parsedLocationArg = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n !(parentPathnameBase === \"/\" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"When overriding the location using `` or `useRoutes(routes, location)`, \" + \"the location pathname must begin with the portion of the URL pathname that was \" + (\"matched by all parent routes. The current pathname base is \\\"\" + parentPathnameBase + \"\\\" \") + (\"but pathname \\\"\" + parsedLocationArg.pathname + \"\\\" was given in the `location` prop.\")) : UNSAFE_invariant(false) : void 0;\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n\n let pathname = location.pathname || \"/\";\n let remainingPathname = parentPathnameBase === \"/\" ? pathname : pathname.slice(parentPathnameBase.length) || \"/\";\n let matches = matchRoutes(routes, {\n pathname: remainingPathname\n });\n\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(parentRoute || matches != null, \"No routes matched location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \") : void 0;\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined, \"Matched leaf route at location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \" + \"does not have an element or Component. This means it will render an with a \" + \"null value by default resulting in an \\\"empty\\\" page.\") : void 0;\n }\n\n let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]),\n pathnameBase: match.pathnameBase === \"/\" ? parentPathnameBase : joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase])\n })), parentMatches, dataRouterStateContext || undefined); // When a user passes in a `locationArg`, the associated routes need to\n // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n // to use the scoped location instead of the global location.\n\n\n if (locationArg && renderedMatches) {\n return /*#__PURE__*/React.createElement(LocationContext.Provider, {\n value: {\n location: _extends({\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n state: null,\n key: \"default\"\n }, location),\n navigationType: Action.Pop\n }\n }, renderedMatches);\n }\n\n return renderedMatches;\n}\n\nfunction DefaultErrorComponent() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error) ? error.status + \" \" + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);\n let stack = error instanceof Error ? error.stack : null;\n let lightgrey = \"rgba(200,200,200, 0.5)\";\n let preStyles = {\n padding: \"0.5rem\",\n backgroundColor: lightgrey\n };\n let codeStyles = {\n padding: \"2px 4px\",\n backgroundColor: lightgrey\n };\n let devInfo = null;\n\n if (process.env.NODE_ENV !== \"production\") {\n devInfo = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", null, \"\\uD83D\\uDCBF Hey developer \\uD83D\\uDC4B\"), /*#__PURE__*/React.createElement(\"p\", null, \"You can provide a way better UX than this when your app throws errors by providing your own\\xA0\", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"ErrorBoundary\"), \" prop on\\xA0\", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"\")));\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"h2\", null, \"Unexpected Application Error!\"), /*#__PURE__*/React.createElement(\"h3\", {\n style: {\n fontStyle: \"italic\"\n }\n }, message), stack ? /*#__PURE__*/React.createElement(\"pre\", {\n style: preStyles\n }, stack) : null, devInfo);\n}\n\nclass RenderErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n location: props.location,\n error: props.error\n };\n }\n\n static getDerivedStateFromError(error) {\n return {\n error: error\n };\n }\n\n static getDerivedStateFromProps(props, state) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application, that will have no effect--the error page continues to display.\n // This gives us a mechanism to recover from the error when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (state.location !== props.location) {\n return {\n error: props.error,\n location: props.location\n };\n } // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n\n\n return {\n error: props.error || state.error,\n location: state.location\n };\n }\n\n componentDidCatch(error, errorInfo) {\n console.error(\"React Router caught the following error during render\", error, errorInfo);\n }\n\n render() {\n return this.state.error ? /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: this.props.routeContext\n }, /*#__PURE__*/React.createElement(RouteErrorContext.Provider, {\n value: this.state.error,\n children: this.props.component\n })) : this.props.children;\n }\n\n}\n\nfunction RenderedRoute(_ref) {\n let {\n routeContext,\n match,\n children\n } = _ref;\n let dataRouterContext = React.useContext(DataRouterContext); // Track how deep we got in our render pass to emulate SSR componentDidCatch\n // in a DataStaticRouter\n\n if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n\n return /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: routeContext\n }, children);\n}\n\nfunction _renderMatches(matches, parentMatches, dataRouterState) {\n if (parentMatches === void 0) {\n parentMatches = [];\n }\n\n if (matches == null) {\n if (dataRouterState != null && dataRouterState.errors) {\n // Don't bail if we have data router errors so we can render them in the\n // boundary. Use the pre-matched (or shimmed) matches\n matches = dataRouterState.matches;\n } else {\n return null;\n }\n }\n\n let renderedMatches = matches; // If we have data errors, trim matches to the highest error boundary\n\n let errors = dataRouterState == null ? void 0 : dataRouterState.errors;\n\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));\n !(errorIndex >= 0) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"Could not find a matching route for the current errors: \" + errors) : UNSAFE_invariant(false) : void 0;\n renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));\n }\n\n return renderedMatches.reduceRight((outlet, match, index) => {\n let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null; // Only data routers handle errors\n\n let errorElement = null;\n\n if (dataRouterState) {\n if (match.route.ErrorBoundary) {\n errorElement = /*#__PURE__*/React.createElement(match.route.ErrorBoundary, null);\n } else if (match.route.errorElement) {\n errorElement = match.route.errorElement;\n } else {\n errorElement = /*#__PURE__*/React.createElement(DefaultErrorComponent, null);\n }\n }\n\n let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n\n let getChildren = () => {\n let children = outlet;\n\n if (error) {\n children = errorElement;\n } else if (match.route.Component) {\n children = /*#__PURE__*/React.createElement(match.route.Component, null);\n } else if (match.route.element) {\n children = match.route.element;\n }\n\n return /*#__PURE__*/React.createElement(RenderedRoute, {\n match: match,\n routeContext: {\n outlet,\n matches\n },\n children: children\n });\n }; // Only wrap in an error boundary within data router usages when we have an\n // ErrorBoundary/errorElement on this route. Otherwise let it bubble up to\n // an ancestor ErrorBoundary/errorElement\n\n\n return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /*#__PURE__*/React.createElement(RenderErrorBoundary, {\n location: dataRouterState.location,\n component: errorElement,\n error: error,\n children: getChildren(),\n routeContext: {\n outlet: null,\n matches\n }\n }) : getChildren();\n }, null);\n}\nvar DataRouterHook;\n\n(function (DataRouterHook) {\n DataRouterHook[\"UseBlocker\"] = \"useBlocker\";\n DataRouterHook[\"UseRevalidator\"] = \"useRevalidator\";\n})(DataRouterHook || (DataRouterHook = {}));\n\nvar DataRouterStateHook;\n\n(function (DataRouterStateHook) {\n DataRouterStateHook[\"UseBlocker\"] = \"useBlocker\";\n DataRouterStateHook[\"UseLoaderData\"] = \"useLoaderData\";\n DataRouterStateHook[\"UseActionData\"] = \"useActionData\";\n DataRouterStateHook[\"UseRouteError\"] = \"useRouteError\";\n DataRouterStateHook[\"UseNavigation\"] = \"useNavigation\";\n DataRouterStateHook[\"UseRouteLoaderData\"] = \"useRouteLoaderData\";\n DataRouterStateHook[\"UseMatches\"] = \"useMatches\";\n DataRouterStateHook[\"UseRevalidator\"] = \"useRevalidator\";\n})(DataRouterStateHook || (DataRouterStateHook = {}));\n\nfunction getDataRouterConsoleError(hookName) {\n return hookName + \" must be used within a data router. See https://reactrouter.com/routers/picking-a-router.\";\n}\n\nfunction useDataRouterContext(hookName) {\n let ctx = React.useContext(DataRouterContext);\n !ctx ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return ctx;\n}\n\nfunction useDataRouterState(hookName) {\n let state = React.useContext(DataRouterStateContext);\n !state ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return state;\n}\n\nfunction useRouteContext(hookName) {\n let route = React.useContext(RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return route;\n}\n\nfunction useCurrentRouteId(hookName) {\n let route = useRouteContext(hookName);\n let thisRoute = route.matches[route.matches.length - 1];\n !thisRoute.route.id ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, hookName + \" can only be used on routes that contain a unique \\\"id\\\"\") : UNSAFE_invariant(false) : void 0;\n return thisRoute.route.id;\n}\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\n\n\nfunction useNavigation() {\n let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n return state.navigation;\n}\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\n\nfunction useRevalidator() {\n let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n return {\n revalidate: dataRouterContext.router.revalidate,\n state: state.revalidation\n };\n}\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\n\nfunction useMatches() {\n let {\n matches,\n loaderData\n } = useDataRouterState(DataRouterStateHook.UseMatches);\n return React.useMemo(() => matches.map(match => {\n let {\n pathname,\n params\n } = match; // Note: This structure matches that created by createUseMatchesMatch\n // in the @remix-run/router , so if you change this please also change\n // that :) Eventually we'll DRY this up\n\n return {\n id: match.route.id,\n pathname,\n params,\n data: loaderData[match.route.id],\n handle: match.route.handle\n };\n }), [matches, loaderData]);\n}\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\n\nfunction useLoaderData() {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n\n if (state.errors && state.errors[routeId] != null) {\n console.error(\"You cannot `useLoaderData` in an errorElement (routeId: \" + routeId + \")\");\n return undefined;\n }\n\n return state.loaderData[routeId];\n}\n/**\n * Returns the loaderData for the given routeId\n */\n\nfunction useRouteLoaderData(routeId) {\n let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n return state.loaderData[routeId];\n}\n/**\n * Returns the action data for the nearest ancestor Route action\n */\n\nfunction useActionData() {\n let state = useDataRouterState(DataRouterStateHook.UseActionData);\n let route = React.useContext(RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useActionData must be used inside a RouteContext\") : UNSAFE_invariant(false) : void 0;\n return Object.values((state == null ? void 0 : state.actionData) || {})[0];\n}\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error. This is intended to be called from your\n * ErrorBoundary/errorElement to display a proper error message.\n */\n\nfunction useRouteError() {\n var _state$errors;\n\n let error = React.useContext(RouteErrorContext);\n let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError); // If this was a render error, we put it in a RouteError context inside\n // of RenderErrorBoundary\n\n if (error) {\n return error;\n } // Otherwise look for errors from our data router state\n\n\n return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];\n}\n/**\n * Returns the happy-path data from the nearest ancestor value\n */\n\nfunction useAsyncValue() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._data;\n}\n/**\n * Returns the error from the nearest ancestor value\n */\n\nfunction useAsyncError() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._error;\n}\nlet blockerId = 0;\n/**\n * Allow the application to block navigations within the SPA and present the\n * user a confirmation dialog to confirm the navigation. Mostly used to avoid\n * using half-filled form data. This does not handle hard-reloads or\n * cross-origin navigations.\n */\n\nfunction useBlocker(shouldBlock) {\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseBlocker);\n let state = useDataRouterState(DataRouterStateHook.UseBlocker);\n let [blockerKey] = React.useState(() => String(++blockerId));\n let blockerFunction = React.useCallback(args => {\n return typeof shouldBlock === \"function\" ? !!shouldBlock(args) : !!shouldBlock;\n }, [shouldBlock]);\n let blocker = router.getBlocker(blockerKey, blockerFunction); // Cleanup on unmount\n\n React.useEffect(() => () => router.deleteBlocker(blockerKey), [router, blockerKey]); // Prefer the blocker from state since DataRouterContext is memoized so this\n // ensures we update on blocker state updates\n\n return state.blockers.get(blockerKey) || blocker;\n}\nconst alreadyWarned = {};\n\nfunction warningOnce(key, cond, message) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, message) : void 0;\n }\n}\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n let {\n fallbackElement,\n router\n } = _ref;\n let getState = React.useCallback(() => router.state, [router]); // Sync router state to our component state to force re-renders\n\n let state = useSyncExternalStore(router.subscribe, getState, // We have to provide this so React@18 doesn't complain during hydration,\n // but we pass our serialized hydration data into the router so state here\n // is already synced with what the server saw\n getState);\n let navigator = React.useMemo(() => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: n => router.navigate(n),\n push: (to, state, opts) => router.navigate(to, {\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n }),\n replace: (to, state, opts) => router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n })\n };\n }, [router]);\n let basename = router.basename || \"/\";\n let dataRouterContext = React.useMemo(() => ({\n router,\n navigator,\n static: false,\n basename\n }), [router, navigator, basename]); // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a \n * ```\n *\n * Elements by their ID are made available in browsers on the `window` object.\n * Using a prefix prevents this from being a problem.\n * @property {string} [footnoteLabel='Footnotes']\n * Label to use for the footnotes section.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {string} [footnoteBackLabel='Back to content']\n * Label to use from backreferences back to their footnote call.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {Handlers} [handlers]\n * Object mapping mdast nodes to functions handling them\n * @property {Array} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast\n * @property {Handler} [unknownHandler]\n * Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n * Map of node types to handlers\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} H\n * Handle context\n */\n\nimport {u} from 'unist-builder'\nimport {visit} from 'unist-util-visit'\nimport {pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {one} from './traverse.js'\nimport {footer} from './footer.js'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Factory to transform.\n * @param {MdastNode} tree mdast node\n * @param {Options} [options] Configuration\n * @returns {H} `h` function\n */\nfunction factory(tree, options) {\n const settings = options || {}\n const dangerous = settings.allowDangerousHtml || false\n /** @type {Record} */\n const footnoteById = {}\n\n h.dangerous = dangerous\n h.clobberPrefix =\n settings.clobberPrefix === undefined || settings.clobberPrefix === null\n ? 'user-content-'\n : settings.clobberPrefix\n h.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n h.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n h.definition = definitions(tree)\n h.footnoteById = footnoteById\n /** @type {Array} */\n h.footnoteOrder = []\n /** @type {Record} */\n h.footnoteCounts = {}\n h.augment = augment\n h.handlers = {...handlers, ...settings.handlers}\n h.unknownHandler = settings.unknownHandler\n h.passThrough = settings.passThrough\n\n visit(tree, 'footnoteDefinition', (definition) => {\n const id = String(definition.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: .\n if (!own.call(footnoteById, id)) {\n footnoteById[id] = definition\n }\n })\n\n // @ts-expect-error Hush, it’s fine!\n return h\n\n /**\n * Finalise the created `right`, a hast node, from `left`, an mdast node.\n * @param {(NodeWithData|PositionLike)?} left\n * @param {Content} right\n * @returns {Content}\n */\n function augment(left, right) {\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (left && 'data' in left && left.data) {\n /** @type {Data} */\n const data = left.data\n\n if (data.hName) {\n if (right.type !== 'element') {\n right = {\n type: 'element',\n tagName: '',\n properties: {},\n children: []\n }\n }\n\n right.tagName = data.hName\n }\n\n if (right.type === 'element' && data.hProperties) {\n right.properties = {...right.properties, ...data.hProperties}\n }\n\n if ('children' in right && right.children && data.hChildren) {\n right.children = data.hChildren\n }\n }\n\n if (left) {\n const ctx = 'type' in left ? left : {position: left}\n\n if (!generated(ctx)) {\n // @ts-expect-error: fine.\n right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n }\n }\n\n return right\n }\n\n /**\n * Create an element for `node`.\n *\n * @type {HFunctionProps}\n */\n function h(node, tagName, props, children) {\n if (Array.isArray(props)) {\n children = props\n props = {}\n }\n\n // @ts-expect-error augmenting an element yields an element.\n return augment(node, {\n type: 'element',\n tagName,\n properties: props || {},\n children: children || []\n })\n }\n}\n\n/**\n * Transform `tree` (an mdast node) to a hast node.\n *\n * @param {MdastNode} tree mdast node\n * @param {Options} [options] Configuration\n * @returns {HastNode|null|undefined} hast node\n */\nexport function toHast(tree, options) {\n const h = factory(tree, options)\n const node = one(h, tree, null)\n const foot = footer(h)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push(u('text', '\\n'), foot)\n }\n\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n\nexport {handlers as defaultHandlers} from './handlers/index.js'\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","/**\n * @typedef {import('./info.js').Info} Info\n * @typedef {Record} Properties\n * @typedef {Record} Normal\n */\n\nexport class Schema {\n /**\n * @constructor\n * @param {Properties} property\n * @param {Normal} normal\n * @param {string} [space]\n */\n constructor(property, normal, space) {\n this.property = property\n this.normal = normal\n if (space) {\n this.space = space\n }\n }\n}\n\n/** @type {Properties} */\nSchema.prototype.property = {}\n/** @type {Normal} */\nSchema.prototype.normal = {}\n/** @type {string|null} */\nSchema.prototype.space = null\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {Schema[]} definitions\n * @param {string} [space]\n * @returns {Schema}\n */\nexport function merge(definitions, space) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n let index = -1\n\n while (++index < definitions.length) {\n Object.assign(property, definitions[index].property)\n Object.assign(normal, definitions[index].normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * @param {string} value\n * @returns {string}\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","export class Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n */\n constructor(property, attribute) {\n /** @type {string} */\n this.property = property\n /** @type {string} */\n this.attribute = attribute\n }\n}\n\n/** @type {string|null} */\nInfo.prototype.space = null\nInfo.prototype.boolean = false\nInfo.prototype.booleanish = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.number = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.spaceSeparated = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.defined = false\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","import {Info} from './info.js'\nimport * as types from './types.js'\n\n/** @type {Array} */\n// @ts-expect-error: hush.\nconst checks = Object.keys(types)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n * @param {number|null} [mask]\n * @param {string} [space]\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @param {DefinedInfo} values\n * @param {string} key\n * @param {unknown} value\n */\nfunction mark(values, key, value) {\n if (value) {\n // @ts-expect-error: assume `value` matches the expected value of `key`.\n values[key] = value\n }\n}\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n *\n * @typedef {Record} Attributes\n *\n * @typedef {Object} Definition\n * @property {Record} properties\n * @property {(attributes: Attributes, property: string) => string} transform\n * @property {string} [space]\n * @property {Attributes} [attributes]\n * @property {Array} [mustUseProperty]\n */\n\nimport {normalize} from '../normalize.js'\nimport {Schema} from './schema.js'\nimport {DefinedInfo} from './defined-info.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param {Definition} definition\n * @returns {Schema}\n */\nexport function create(definition) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n /** @type {string} */\n let prop\n\n for (prop in definition.properties) {\n if (own.call(definition.properties, prop)) {\n const value = definition.properties[prop]\n const info = new DefinedInfo(\n prop,\n definition.transform(definition.attributes || {}, prop),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(prop)\n ) {\n info.mustUseProperty = true\n }\n\n property[prop] = info\n\n normal[normalize(prop)] = prop\n normal[normalize(info.attribute)] = prop\n }\n }\n\n return new Schema(property, normal, definition.space)\n}\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n space: 'xlink',\n transform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase()\n },\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n space: 'xml',\n transform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase()\n },\n properties: {xmlLang: null, xmlBase: null, xmlSpace: null}\n})\n","/**\n * @param {Record} attributes\n * @param {string} attribute\n * @returns {string}\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record} attributes\n * @param {string} property\n * @returns {string}\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n space: 'xmlns',\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n transform: caseInsensitiveTransform,\n properties: {xmlns: null, xmlnsXLink: null}\n})\n","import {booleanish, number, spaceSeparated} from './util/types.js'\nimport {create} from './util/create.js'\n\nexport const aria = create({\n transform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()\n },\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n})\n","import {\n boolean,\n overloadedBoolean,\n booleanish,\n number,\n spaceSeparated,\n commaSeparated\n} from './util/types.js'\nimport {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const html = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n capture: boolean,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforePrint: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // ``. List of URIs to archives\n axis: null, // `` and ``. Use `scope` on ``\n background: null, // ``. Use CSS `background-image` instead\n bgColor: null, // `` and table elements. Use CSS `background-color` instead\n border: number, // ``. Use CSS `border-width` instead,\n borderColor: null, // `
`. Use CSS `border-color` instead,\n bottomMargin: number, // ``\n cellPadding: null, // `
`\n cellSpacing: null, // `
`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // ``\n clear: null, // `
`. Use CSS `clear` instead\n code: null, // ``\n codeBase: null, // ``\n codeType: null, // ``\n color: null, // `` and `
`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // ``\n event: null, // `\n * ```\n *\n * Elements by their ID are made available in browsers on the `window` object.\n * Using a prefix prevents this from being a problem.\n * @property {string} [footnoteLabel='Footnotes']\n * Label to use for the footnotes section.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {string} [footnoteBackLabel='Back to content']\n * Label to use from backreferences back to their footnote call.\n * Affects screen reader users.\n * Change it if you’re authoring in a different language.\n * @property {Handlers} [handlers]\n * Object mapping mdast nodes to functions handling them\n * @property {Array} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast\n * @property {Handler} [unknownHandler]\n * Handler for all unknown nodes.\n *\n * @typedef {Record} Handlers\n * Map of node types to handlers\n * @typedef {HFunctionProps & HFunctionNoProps & HFields} H\n * Handle context\n */\n\nimport {u} from 'unist-builder'\nimport {visit} from 'unist-util-visit'\nimport {pointStart, pointEnd} from 'unist-util-position'\nimport {generated} from 'unist-util-generated'\nimport {definitions} from 'mdast-util-definitions'\nimport {one} from './traverse.js'\nimport {footer} from './footer.js'\nimport {handlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Factory to transform.\n * @param {MdastNode} tree mdast node\n * @param {Options} [options] Configuration\n * @returns {H} `h` function\n */\nfunction factory(tree, options) {\n const settings = options || {}\n const dangerous = settings.allowDangerousHtml || false\n /** @type {Record} */\n const footnoteById = {}\n\n h.dangerous = dangerous\n h.clobberPrefix =\n settings.clobberPrefix === undefined || settings.clobberPrefix === null\n ? 'user-content-'\n : settings.clobberPrefix\n h.footnoteLabel = settings.footnoteLabel || 'Footnotes'\n h.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'\n h.definition = definitions(tree)\n h.footnoteById = footnoteById\n /** @type {Array} */\n h.footnoteOrder = []\n /** @type {Record} */\n h.footnoteCounts = {}\n h.augment = augment\n h.handlers = {...handlers, ...settings.handlers}\n h.unknownHandler = settings.unknownHandler\n h.passThrough = settings.passThrough\n\n visit(tree, 'footnoteDefinition', (definition) => {\n const id = String(definition.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: .\n if (!own.call(footnoteById, id)) {\n footnoteById[id] = definition\n }\n })\n\n // @ts-expect-error Hush, it’s fine!\n return h\n\n /**\n * Finalise the created `right`, a hast node, from `left`, an mdast node.\n * @param {(NodeWithData|PositionLike)?} left\n * @param {Content} right\n * @returns {Content}\n */\n function augment(left, right) {\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (left && 'data' in left && left.data) {\n /** @type {Data} */\n const data = left.data\n\n if (data.hName) {\n if (right.type !== 'element') {\n right = {\n type: 'element',\n tagName: '',\n properties: {},\n children: []\n }\n }\n\n right.tagName = data.hName\n }\n\n if (right.type === 'element' && data.hProperties) {\n right.properties = {...right.properties, ...data.hProperties}\n }\n\n if ('children' in right && right.children && data.hChildren) {\n right.children = data.hChildren\n }\n }\n\n if (left) {\n const ctx = 'type' in left ? left : {position: left}\n\n if (!generated(ctx)) {\n // @ts-expect-error: fine.\n right.position = {start: pointStart(ctx), end: pointEnd(ctx)}\n }\n }\n\n return right\n }\n\n /**\n * Create an element for `node`.\n *\n * @type {HFunctionProps}\n */\n function h(node, tagName, props, children) {\n if (Array.isArray(props)) {\n children = props\n props = {}\n }\n\n // @ts-expect-error augmenting an element yields an element.\n return augment(node, {\n type: 'element',\n tagName,\n properties: props || {},\n children: children || []\n })\n }\n}\n\n/**\n * Transform `tree` (an mdast node) to a hast node.\n *\n * @param {MdastNode} tree mdast node\n * @param {Options} [options] Configuration\n * @returns {HastNode|null|undefined} hast node\n */\nexport function toHast(tree, options) {\n const h = factory(tree, options)\n const node = one(h, tree, null)\n const foot = footer(h)\n\n if (foot) {\n // @ts-expect-error If there’s a footer, there were definitions, meaning block\n // content.\n // So assume `node` is a parent node.\n node.children.push(u('text', '\\n'), foot)\n }\n\n return Array.isArray(node) ? {type: 'root', children: node} : node\n}\n\nexport {handlers as defaultHandlers} from './handlers/index.js'\n","/**\n * @typedef {import('hast').Root} HastRoot\n * @typedef {import('mdast').Root} MdastRoot\n * @typedef {import('mdast-util-to-hast').Options} Options\n * @typedef {import('unified').Processor} Processor\n *\n * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n// Note: the `` overload doesn’t seem to work :'(\n\n/**\n * Plugin that turns markdown into HTML to support rehype.\n *\n * * If a destination processor is given, that processor runs with a new HTML\n * (hast) tree (bridge-mode).\n * As the given processor runs with a hast tree, and rehype plugins support\n * hast, that means rehype plugins can be used with the given processor.\n * The hast tree is discarded in the end.\n * It’s highly unlikely that you want to do this.\n * * The common case is to not pass a destination processor, in which case the\n * current processor continues running with a new HTML (hast) tree\n * (mutate-mode).\n * As the current processor continues with a hast tree, and rehype plugins\n * support hast, that means rehype plugins can be used after\n * `remark-rehype`.\n * It’s likely that this is what you want to do.\n *\n * @param destination\n * Optional unified processor.\n * @param options\n * Options passed to `mdast-util-to-hast`.\n */\nconst remarkRehype =\n /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */\n (\n function (destination, options) {\n return destination && 'run' in destination\n ? bridge(destination, options)\n : mutate(destination || options)\n }\n )\n\nexport default remarkRehype\n\n/**\n * Bridge-mode.\n * Runs the destination with the new hast tree.\n *\n * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>}\n */\nfunction bridge(destination, options) {\n return (node, file, next) => {\n destination.run(toHast(node, options), file, (error) => {\n next(error)\n })\n }\n}\n\n/**\n * Mutate-mode.\n * Further plugins run on the hast tree.\n *\n * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>}\n */\nfunction mutate(options) {\n // @ts-expect-error: assume a corresponding node is returned by `toHast`.\n return (node) => toHast(node, options)\n}\n","/**\n * @typedef {import('./info.js').Info} Info\n * @typedef {Record} Properties\n * @typedef {Record} Normal\n */\n\nexport class Schema {\n /**\n * @constructor\n * @param {Properties} property\n * @param {Normal} normal\n * @param {string} [space]\n */\n constructor(property, normal, space) {\n this.property = property\n this.normal = normal\n if (space) {\n this.space = space\n }\n }\n}\n\n/** @type {Properties} */\nSchema.prototype.property = {}\n/** @type {Normal} */\nSchema.prototype.normal = {}\n/** @type {string|null} */\nSchema.prototype.space = null\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {Schema[]} definitions\n * @param {string} [space]\n * @returns {Schema}\n */\nexport function merge(definitions, space) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n let index = -1\n\n while (++index < definitions.length) {\n Object.assign(property, definitions[index].property)\n Object.assign(normal, definitions[index].normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * @param {string} value\n * @returns {string}\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","export class Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n */\n constructor(property, attribute) {\n /** @type {string} */\n this.property = property\n /** @type {string} */\n this.attribute = attribute\n }\n}\n\n/** @type {string|null} */\nInfo.prototype.space = null\nInfo.prototype.boolean = false\nInfo.prototype.booleanish = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.number = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.spaceSeparated = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.defined = false\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","import {Info} from './info.js'\nimport * as types from './types.js'\n\n/** @type {Array} */\n// @ts-expect-error: hush.\nconst checks = Object.keys(types)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * @param {string} attribute\n * @param {number|null} [mask]\n * @param {string} [space]\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @param {DefinedInfo} values\n * @param {string} key\n * @param {unknown} value\n */\nfunction mark(values, key, value) {\n if (value) {\n // @ts-expect-error: assume `value` matches the expected value of `key`.\n values[key] = value\n }\n}\n","/**\n * @typedef {import('./schema.js').Properties} Properties\n * @typedef {import('./schema.js').Normal} Normal\n *\n * @typedef {Record} Attributes\n *\n * @typedef {Object} Definition\n * @property {Record} properties\n * @property {(attributes: Attributes, property: string) => string} transform\n * @property {string} [space]\n * @property {Attributes} [attributes]\n * @property {Array} [mustUseProperty]\n */\n\nimport {normalize} from '../normalize.js'\nimport {Schema} from './schema.js'\nimport {DefinedInfo} from './defined-info.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * @param {Definition} definition\n * @returns {Schema}\n */\nexport function create(definition) {\n /** @type {Properties} */\n const property = {}\n /** @type {Normal} */\n const normal = {}\n /** @type {string} */\n let prop\n\n for (prop in definition.properties) {\n if (own.call(definition.properties, prop)) {\n const value = definition.properties[prop]\n const info = new DefinedInfo(\n prop,\n definition.transform(definition.attributes || {}, prop),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(prop)\n ) {\n info.mustUseProperty = true\n }\n\n property[prop] = info\n\n normal[normalize(prop)] = prop\n normal[normalize(info.attribute)] = prop\n }\n }\n\n return new Schema(property, normal, definition.space)\n}\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n space: 'xlink',\n transform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase()\n },\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n space: 'xml',\n transform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase()\n },\n properties: {xmlLang: null, xmlBase: null, xmlSpace: null}\n})\n","/**\n * @param {Record} attributes\n * @param {string} attribute\n * @returns {string}\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record} attributes\n * @param {string} property\n * @returns {string}\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n space: 'xmlns',\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n transform: caseInsensitiveTransform,\n properties: {xmlns: null, xmlnsXLink: null}\n})\n","import {booleanish, number, spaceSeparated} from './util/types.js'\nimport {create} from './util/create.js'\n\nexport const aria = create({\n transform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()\n },\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n})\n","import {\n boolean,\n overloadedBoolean,\n booleanish,\n number,\n spaceSeparated,\n commaSeparated\n} from './util/types.js'\nimport {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const html = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n capture: boolean,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforePrint: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // ``. List of URIs to archives\n axis: null, // `
` and ``. Use `scope` on ``\n background: null, // ``. Use CSS `background-image` instead\n bgColor: null, // `` and table elements. Use CSS `background-color` instead\n border: number, // ``. Use CSS `border-width` instead,\n borderColor: null, // `
`. Use CSS `border-color` instead,\n bottomMargin: number, // ``\n cellPadding: null, // `
`\n cellSpacing: null, // `
`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // ``\n clear: null, // `
`. Use CSS `clear` instead\n code: null, // ``\n codeBase: null, // ``\n codeType: null, // ``\n color: null, // `` and `
`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // ``\n event: null, // `