@powerhousedao/connect 1.0.0-dev.199 → 1.0.0-dev.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.env +2 -2
- package/dist/assets/PeopleFill-DQQdtDDe.js +2 -0
- package/dist/assets/PeopleFill-DQQdtDDe.js.map +1 -0
- package/dist/assets/PlusSquare-3oD1-vzk.js +2 -0
- package/dist/assets/PlusSquare-3oD1-vzk.js.map +1 -0
- package/dist/assets/PlusSquare-CspgRMoS-3oD1-vzk.js +2 -0
- package/dist/assets/PlusSquare-CspgRMoS-3oD1-vzk.js.map +1 -0
- package/dist/assets/app-B4OFGo2O.js +582 -0
- package/dist/assets/app-B4OFGo2O.js.map +1 -0
- package/dist/assets/{app-loader-Dn48G7po.js → app-loader-Bfb1rJhE.js} +3 -3
- package/dist/assets/{app-loader-Dn48G7po.js.map → app-loader-Bfb1rJhE.js.map} +1 -1
- package/dist/assets/app-loader-CcY7cVzc.css +1 -0
- package/dist/assets/{browser-camIpcNU.js → browser-CNIY9JaP.js} +2 -2
- package/dist/assets/{browser-camIpcNU.js.map → browser-CNIY9JaP.js.map} +1 -1
- package/dist/assets/{ccip-D-9jk-RD.js → ccip-BVfRrR8h.js} +2 -2
- package/dist/assets/{ccip-D-9jk-RD.js.map → ccip-BVfRrR8h.js.map} +1 -1
- package/dist/assets/content-XRS-E3Xz.js +7 -0
- package/dist/assets/content-XRS-E3Xz.js.map +1 -0
- package/dist/assets/editor-8j593VN0.js +2 -0
- package/dist/assets/editor-8j593VN0.js.map +1 -0
- package/dist/assets/editor-BZo1P0Ae.js +2 -0
- package/dist/assets/editor-BZo1P0Ae.js.map +1 -0
- package/dist/assets/editor-Bo9Aijfe.js +2 -0
- package/dist/assets/editor-Bo9Aijfe.js.map +1 -0
- package/dist/assets/editor-ehywSkYm.js +346 -0
- package/dist/assets/editor-ehywSkYm.js.map +1 -0
- package/dist/assets/editors-DVl-l3r5.js +3 -0
- package/dist/assets/editors-DVl-l3r5.js.map +1 -0
- package/dist/assets/{getEnsName-DiyJcfh8.js → getEnsName-Cub4UekZ.js} +10 -10
- package/dist/assets/{getEnsName-DiyJcfh8.js.map → getEnsName-Cub4UekZ.js.map} +1 -1
- package/dist/assets/{index-B38XkIrT.js → index-1TcnY8Is.js} +2 -2
- package/dist/assets/{index-B38XkIrT.js.map → index-1TcnY8Is.js.map} +1 -1
- package/dist/assets/index-BEgT5b-5.js +3 -0
- package/dist/assets/{index-BBo8moLy.js.map → index-BEgT5b-5.js.map} +1 -1
- package/dist/assets/{isAddressEqual-CXyuWVb7.js → isAddressEqual-BPfaWlY1.js} +2 -2
- package/dist/assets/{isAddressEqual-CXyuWVb7.js.map → isAddressEqual-BPfaWlY1.js.map} +1 -1
- package/dist/assets/json-D0_QOK7W.js +3 -0
- package/dist/assets/{json-CHCvwHN3.js.map → json-D0_QOK7W.js.map} +1 -1
- package/dist/assets/{main.BmAe1Lus.js → main.VYW2kwWP.js} +2 -2
- package/dist/assets/{main.BmAe1Lus.js.map → main.VYW2kwWP.js.map} +1 -1
- package/dist/assets/react-error-boundary.esm-qNZlhEqp.js +2 -0
- package/dist/assets/react-error-boundary.esm-qNZlhEqp.js.map +1 -0
- package/dist/assets/root-jEsJBgjx.js +17 -0
- package/dist/assets/root-jEsJBgjx.js.map +1 -0
- package/dist/assets/router-BXAzgRkG.js +12 -0
- package/dist/assets/router-BXAzgRkG.js.map +1 -0
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/dist/studio/index.d.ts +1 -0
- package/dist/studio/index.js +35 -4
- package/dist/studio/server.d.ts +1 -0
- package/dist/swEnv.js +4 -4
- package/dist/vite-envs.sh +9 -9
- package/package.json +10 -10
- package/dist/assets/app-DvSjLYs-.js +0 -449
- package/dist/assets/app-DvSjLYs-.js.map +0 -1
- package/dist/assets/app-loader-iGtpD3C9.css +0 -1
- package/dist/assets/content-TOddMACx.js +0 -7
- package/dist/assets/content-TOddMACx.js.map +0 -1
- package/dist/assets/editor-Ba951Cwc.js +0 -346
- package/dist/assets/editor-Ba951Cwc.js.map +0 -1
- package/dist/assets/index-BBo8moLy.js +0 -3
- package/dist/assets/json-CHCvwHN3.js +0 -3
- package/dist/assets/root-D8qKMM0F.js +0 -17
- package/dist/assets/root-D8qKMM0F.js.map +0 -1
- package/dist/assets/router-B1NCyaFw.js +0 -12
- package/dist/assets/router-B1NCyaFw.js.map +0 -1
- package/dist/assets/useUiNodes-D93b3yJT.js +0 -107
- package/dist/assets/useUiNodes-D93b3yJT.js.map +0 -1
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B38XkIrT.js","assets/main.BmAe1Lus.js","assets/app-loader-Dn48G7po.js","assets/app-loader-iGtpD3C9.css","assets/browser-camIpcNU.js","assets/getEnsName-DiyJcfh8.js","assets/isAddressEqual-CXyuWVb7.js","assets/router-B1NCyaFw.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var gP=Object.defineProperty;var R0=t=>{throw TypeError(t)};var yP=(t,e,n)=>e in t?gP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ve=(t,e,n)=>yP(t,typeof e!="symbol"?e+"":e,n),$g=(t,e,n)=>e.has(t)||R0("Cannot "+n);var ce=(t,e,n)=>($g(t,e,"read from private field"),n?n.call(t):e.get(t)),bt=(t,e,n)=>e.has(t)?R0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ht=(t,e,n,r)=>($g(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),sn=(t,e,n)=>($g(t,e,"access private method"),n);var Bf=(t,e,n,r)=>({set _(i){ht(t,e,i,n)},get _(){return ce(t,e,r)}});import{_ as Se}from"./main.BmAe1Lus.js";import{jsx as P,jsxs as Ee,Fragment as Us}from"react/jsx-runtime";import*as Y from"react";import $e,{createElement as Sa,isValidElement as es,cloneElement as op,Children as vP,createContext as Fu,useContext as Yo,useState as We,useRef as qt,useEffect as Dt,useLayoutEffect as xm,useCallback as He,useMemo as Pn,Suspense as qT,lazy as bP,forwardRef as ec,Component as _P,Fragment as Yy,useSyncExternalStore as wP,useReducer as EP,useDebugValue as SP}from"react";import{g as GT,a as $b,o as jb,s as xP,n as Ub,L as ap,c as Ns,b as zf,p as TP}from"./app-loader-Dn48G7po.js";import*as IP from"react-dom";import OP,{createPortal as CP}from"react-dom";function kP(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function st(){return st=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},st.apply(null,arguments)}var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Qre(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var DP={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const RP=tc(DP);var NP=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function N0(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(RP[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var i=new RegExp(NP),s=null;(s=i.exec(t))!==null;)if(s[0].trim())if(s[1]){var o=s[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],i.lastIndex--}else s[2]&&(e.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return e}var AP=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,PP=/^\s*$/,MP=Object.create(null);function ZT(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(ZT,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var LP={parse:function(t,e){e||(e={}),e.components||(e.components=MP);var n,r=[],i=[],s=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");r.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(AP,function(c,u){if(o){if(c!=="</"+n.name+">")return;o=!1}var l,d=c.charAt(1)!=="/",f=c.startsWith("<!--"),h=u+c.length,m=t.charAt(h);if(f){var p=N0(c);return s<0?(r.push(p),r):((l=i[s]).children.push(p),r)}if(d&&(s++,(n=N0(c)).type==="tag"&&e.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!m||m==="<"||n.children.push({type:"text",content:t.slice(h,t.indexOf("<",h))}),s===0&&r.push(n),(l=i[s-1])&&l.children.push(n),i[s]=n),(!d||n.voidElement)&&(s>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(s--,n=s===-1?r:i[s]),!o&&m!=="<"&&m)){l=s===-1?r:i[s].children;var g=t.indexOf("<",h),y=t.slice(h,g===-1?void 0:g);PP.test(y)&&(y=" "),(g>-1&&s+l.length>=0||y!==" ")&&l.push({type:"text",content:y})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+ZT("",n)},"")}};function Ah(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const A0={};function cp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&A0[e[0]]||(typeof e[0]=="string"&&(A0[e[0]]=new Date),Ah(...e))}const YT=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function P0(t,e,n){t.loadNamespaces(e,YT(t,n))}function M0(t,e,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,YT(t,r))}function FP(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=e.languages[0],i=e.options?e.options.fallbackLng:!1,s=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const u=e.services.backendConnector.state[`${a}|${c}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(r,t)&&(!i||o(s,t)))}function $P(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(cp("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(i,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,t))return!1}}):FP(t,e,n)}function jg(t,e){if(!t)return!1;const n=t.props?t.props.children:t.children;return e?n.length>0:!!n}function Ug(t){if(!t)return[];const e=t.props?t.props.children:t.children;return t.props&&t.props.i18nIsDynamicList?Fc(e):e}function jP(t){return Object.prototype.toString.call(t)!=="[object Array]"?!1:t.every(e=>es(e))}function Fc(t){return Array.isArray(t)?t:[t]}function UP(t,e){const n={...e};return n.props=Object.assign(t.props,e.props),n}function KT(t,e){if(!t)return"";let n="";const r=Fc(t),i=e.transSupportBasicHtmlNodes&&e.transKeepBasicHtmlNodesFor?e.transKeepBasicHtmlNodesFor:[];return r.forEach((s,o)=>{if(typeof s=="string")n+=`${s}`;else if(es(s)){const a=Object.keys(s.props).length,c=i.indexOf(s.type)>-1,u=s.props.children;if(!u&&c&&a===0)n+=`<${s.type}/>`;else if(!u&&(!c||a!==0))n+=`<${o}></${o}>`;else if(s.props.i18nIsDynamicList)n+=`<${o}></${o}>`;else if(c&&a===1&&typeof u=="string")n+=`<${s.type}>${u}</${s.type}>`;else{const l=KT(u,e);n+=`<${o}>${l}</${o}>`}}else if(s===null)Ah("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof s=="object"){const{format:a,...c}=s,u=Object.keys(c);if(u.length===1){const l=a?`${u[0]}, ${a}`:u[0];n+=`{{${l}}}`}else Ah("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",s)}else Ah("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",s)}),n}function BP(t,e,n,r,i,s){if(e==="")return[];const o=r.transKeepBasicHtmlNodesFor||[],a=e&&new RegExp(o.map(g=>`<${g}`).join("|")).test(e);if(!t&&!a&&!s)return[e];const c={};function u(g){Fc(g).forEach(v=>{typeof v!="string"&&(jg(v)?u(Ug(v)):typeof v=="object"&&!es(v)&&Object.assign(c,v))})}u(t);const l=LP.parse(`<0>${e}</0>`),d={...c,...i};function f(g,y,v){const b=Ug(g),E=m(b,y.children,v);return jP(b)&&E.length===0||g.props&&g.props.i18nIsDynamicList?b:E}function h(g,y,v,b,E){g.dummy?(g.children=y,v.push(op(g,{key:b},E?void 0:y))):v.push(...vP.map([g],w=>{const x={...w.props};return delete x.i18nIsDynamicList,$e.createElement(w.type,st({},x,{key:b,ref:w.ref},E?{}:{children:y}))}))}function m(g,y,v){const b=Fc(g);return Fc(y).reduce((w,x,_)=>{const k=x.children&&x.children[0]&&x.children[0].content&&n.services.interpolator.interpolate(x.children[0].content,d,n.language);if(x.type==="tag"){let R=b[parseInt(x.name,10)];v.length===1&&!R&&(R=v[0][x.name]),R||(R={});const F=Object.keys(x.attrs).length!==0?UP({props:x.attrs},R):R,V=es(F),T=V&&jg(x,!0)&&!x.voidElement,L=a&&typeof F=="object"&&F.dummy&&!V,S=typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,x.name);if(typeof F=="string"){const C=n.services.interpolator.interpolate(F,d,n.language);w.push(C)}else if(jg(F)||T){const C=f(F,x,v);h(F,C,w,_)}else if(L){const C=m(b,x.children,v);h(F,C,w,_)}else if(Number.isNaN(parseFloat(x.name)))if(S){const C=f(F,x,v);h(F,C,w,_,x.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(x.name)>-1)if(x.voidElement)w.push(Sa(x.name,{key:`${x.name}-${_}`}));else{const C=m(b,x.children,v);w.push(Sa(x.name,{key:`${x.name}-${_}`},C))}else if(x.voidElement)w.push(`<${x.name} />`);else{const C=m(b,x.children,v);w.push(`<${x.name}>${C}</${x.name}>`)}else if(typeof F=="object"&&!V){const C=x.children[0]?k:null;C&&w.push(C)}else h(F,k,w,_,x.children.length!==1||!k)}else if(x.type==="text"){const R=r.transWrapTextNodes,F=s?r.unescape(n.services.interpolator.interpolate(x.content,d,n.language)):n.services.interpolator.interpolate(x.content,d,n.language);R?w.push(Sa(R,{key:`${x.name}-${_}`},F)):w.push(F)}return w},[])}const p=m([{dummy:!0,children:t||[]}],l,Fc(t||[]));return Ug(p[0])}function zP(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:u,ns:l,i18n:d,t:f,shouldUnescape:h,...m}=t;const p=d||$b();if(!p)return cp("You will need to pass in an i18next instance by using i18nextReactModule"),e;const g=f||p.t.bind(p)||(T=>T);s&&(o.context=s);const y={...GT(),...p.options&&p.options.react};let v=l||g.ns||p.options&&p.options.defaultNS;v=typeof v=="string"?[v]:v||["translation"];const b=KT(e,y),E=c||b||y.transEmptyNodeValue||i,{hashTransKey:w}=y,x=i||(w?w(b||E):b||E);p.options&&p.options.interpolation&&p.options.interpolation.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...p.options.interpolation.defaultVariables}:{...p.options.interpolation.defaultVariables});const _=a?o.interpolation:{interpolation:{...o.interpolation,prefix:"#$?",suffix:"?$#"}},k={...o,count:n,...a,..._,defaultValue:E,ns:v},R=x?g(x,k):E;u&&Object.keys(u).forEach(T=>{const L=u[T];if(typeof L.type=="function"||!L.props||!L.props.children||R.indexOf(`${T}/>`)<0&&R.indexOf(`${T} />`)<0)return;function S(){return $e.createElement($e.Fragment,null,L)}u[T]=$e.createElement(S,null)});const F=BP(u||e,R,p,y,k,h),V=r!==void 0?r:y.defaultTransParent;return V?Sa(V,m,F):F}const JT=Fu();class VP{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function XT(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:u,ns:l,i18n:d,t:f,shouldUnescape:h,...m}=t;const{i18n:p,defaultNS:g}=Yo(JT)||{},y=d||p||$b(),v=f||y&&y.t.bind(y);return zP({children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o,values:a,defaults:c,components:u,ns:l||v&&v.ns||g||y&&y.options&&y.options.defaultNS,i18n:y,t:f,shouldUnescape:h,...m})}const HP=(t,e)=>{const n=qt();return Dt(()=>{n.current=t},[t,e]),n.current};function nc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:r,defaultNS:i}=Yo(JT)||{},s=n||r||$b();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new VP),!s){cp("You will need to pass in an i18next instance by using initReactI18next");const b=(w,x)=>typeof x=="string"?x:x&&typeof x=="object"&&typeof x.defaultValue=="string"?x.defaultValue:Array.isArray(w)?w[w.length-1]:w,E=[b,{},!1];return E.t=b,E.i18n={},E.ready=!1,E}s.options.react&&s.options.react.wait!==void 0&&cp("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...GT(),...s.options.react,...e},{useSuspense:a,keyPrefix:c}=o;let u=i||s.options&&s.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(u);const l=(s.isInitialized||s.initializedStoreOnce)&&u.every(b=>$P(b,s,o));function d(){return s.getFixedT(e.lng||null,o.nsMode==="fallback"?u:u[0],c)}const[f,h]=We(d);let m=u.join();e.lng&&(m=`${e.lng}${m}`);const p=HP(m),g=qt(!0);Dt(()=>{const{bindI18n:b,bindI18nStore:E}=o;g.current=!0,!l&&!a&&(e.lng?M0(s,e.lng,u,()=>{g.current&&h(d)}):P0(s,u,()=>{g.current&&h(d)})),l&&p&&p!==m&&g.current&&h(d);function w(){g.current&&h(d)}return b&&s&&s.on(b,w),E&&s&&s.store.on(E,w),()=>{g.current=!1,b&&s&&b.split(" ").forEach(x=>s.off(x,w)),E&&s&&E.split(" ").forEach(x=>s.store.off(x,w))}},[s,m]);const y=qt(!0);Dt(()=>{g.current&&!y.current&&h(d),y.current=!1},[s,c]);const v=[f,s,l];if(v.t=f,v.i18n=s,v.ready=l,l||!l&&!a)return v;throw new Promise(b=>{e.lng?M0(s,e.lng,u,()=>b()):P0(s,u,()=>b())})}function WP(t){return t?typeof t=="number"?{width:t.toString()+"px",height:t.toString()+"px"}:{width:t,height:t}:{}}const Bb="-",qP=t=>{const e=ZP(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(Bb);return a[0]===""&&a.length!==1&&a.shift(),QT(a,e)||GP(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},QT=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?QT(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(Bb);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},L0=/^\[(.+)\]$/,GP=t=>{if(L0.test(t)){const e=L0.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},ZP=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return KP(Object.entries(t.classGroups),n).forEach(([s,o])=>{Ky(o,r,s,e)}),r},Ky=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:F0(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(YP(i)){Ky(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Ky(o,F0(e,s),n,r)})})},F0=(t,e)=>{let n=t;return e.split(Bb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},YP=t=>t.isThemeGetter,KP=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,JP=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},eI="!",XP=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const c=[];let u=0,l=0,d;for(let g=0;g<a.length;g++){let y=a[g];if(u===0){if(y===i&&(r||a.slice(g,g+s)===e)){c.push(a.slice(l,g)),l=g+s;continue}if(y==="/"){d=g;continue}}y==="["?u++:y==="]"&&u--}const f=c.length===0?a:a.substring(l),h=f.startsWith(eI),m=h?f.substring(1):f,p=d&&d>l?d-l:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},QP=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},eM=t=>({cache:JP(t.cacheSize),parseClassName:XP(t),...qP(t)}),tM=/\s+/,nM=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(tM);let a="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:l,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let m=!!h,p=r(m?f.substring(0,h):f);if(!p){if(!m){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}m=!1}const g=QP(l).join(":"),y=d?g+eI:g,v=y+p;if(s.includes(v))continue;s.push(v);const b=i(p,m);for(let E=0;E<b.length;++E){const w=b[E];s.push(y+w)}a=u+(a.length>0?" "+a:a)}return a};function hf(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=tI(e))&&(r&&(r+=" "),r+=n);return r}const tI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=tI(t[r]))&&(n&&(n+=" "),n+=e);return n};function rM(t,...e){let n,r,i,s=o;function o(c){const u=e.reduce((l,d)=>d(l),t());return n=eM(u),r=n.cache.get,i=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const l=nM(c,n);return i(c,l),l}return function(){return s(hf.apply(null,arguments))}}const un=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},nI=/^\[(?:([a-z-]+):)?(.+)\]$/i,iM=/^\d+\/\d+$/,sM=new Set(["px","full","screen"]),oM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,uM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ws=t=>Hc(t)||sM.has(t)||iM.test(t),so=t=>$u(t,"length",vM),Hc=t=>!!t&&!Number.isNaN(Number(t)),Bg=t=>$u(t,"number",Hc),il=t=>!!t&&Number.isInteger(Number(t)),dM=t=>t.endsWith("%")&&Hc(t.slice(0,-1)),yt=t=>nI.test(t),oo=t=>oM.test(t),fM=new Set(["length","size","percentage"]),hM=t=>$u(t,fM,rI),pM=t=>$u(t,"position",rI),mM=new Set(["image","url"]),gM=t=>$u(t,mM,_M),yM=t=>$u(t,"",bM),sl=()=>!0,$u=(t,e,n)=>{const r=nI.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},vM=t=>aM.test(t)&&!cM.test(t),rI=()=>!1,bM=t=>uM.test(t),_M=t=>lM.test(t),wM=()=>{const t=un("colors"),e=un("spacing"),n=un("blur"),r=un("brightness"),i=un("borderColor"),s=un("borderRadius"),o=un("borderSpacing"),a=un("borderWidth"),c=un("contrast"),u=un("grayscale"),l=un("hueRotate"),d=un("invert"),f=un("gap"),h=un("gradientColorStops"),m=un("gradientColorStopPositions"),p=un("inset"),g=un("margin"),y=un("opacity"),v=un("padding"),b=un("saturate"),E=un("scale"),w=un("sepia"),x=un("skew"),_=un("space"),k=un("translate"),R=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",yt,e],T=()=>[yt,e],L=()=>["",ws,so],S=()=>["auto",Hc,yt],C=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",yt],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Hc,yt];return{cacheSize:500,separator:":",theme:{colors:[sl],spacing:[ws,so],blur:["none","",oo,yt],brightness:j(),borderColor:[t],borderRadius:["none","","full",oo,yt],borderSpacing:T(),borderWidth:L(),contrast:j(),grayscale:$(),hueRotate:j(),invert:$(),gap:T(),gradientColorStops:[t],gradientColorStopPositions:[dM,so],inset:V(),margin:V(),opacity:j(),padding:T(),saturate:j(),scale:j(),sepia:$(),skew:j(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",yt]}],container:["container"],columns:[{columns:[oo]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...C(),yt]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",il,yt]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",yt]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",il,yt]}],"grid-cols":[{"grid-cols":[sl]}],"col-start-end":[{col:["auto",{span:["full",il,yt]},yt]}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":[sl]}],"row-start-end":[{row:["auto",{span:[il,yt]},yt]}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",yt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",yt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",yt,e]}],"min-w":[{"min-w":[yt,e,"min","max","fit"]}],"max-w":[{"max-w":[yt,e,"none","full","min","max","fit","prose",{screen:[oo]},oo]}],h:[{h:[yt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[yt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[yt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[yt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",oo,so]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bg]}],"font-family":[{font:[sl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",yt]}],"line-clamp":[{"line-clamp":["none",Hc,Bg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ws,yt]}],"list-image":[{"list-image":["none",yt]}],"list-style-type":[{list:["none","disc","decimal",yt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ws,so]}],"underline-offset":[{"underline-offset":["auto",ws,yt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",yt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",yt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...C(),pM]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hM]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gM]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...N(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:N()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...N()]}],"outline-offset":[{"outline-offset":[ws,yt]}],"outline-w":[{outline:[ws,so]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ws,so]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",oo,yM]}],"shadow-color":[{shadow:[sl]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",oo,yt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",yt]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",yt]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",yt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[il,yt]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",yt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",yt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",yt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ws,so,Bg]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Bt=rM(wM);var EM="Expected a function",$0=NaN,SM="[object Symbol]",xM=/^\s+|\s+$/g,TM=/^[-+]0x[0-9a-f]+$/i,IM=/^0b[01]+$/i,OM=/^0o[0-7]+$/i,CM=parseInt,kM=typeof rr=="object"&&rr&&rr.Object===Object&&rr,DM=typeof self=="object"&&self&&self.Object===Object&&self,RM=kM||DM||Function("return this")(),NM=Object.prototype,AM=NM.toString,PM=Math.max,MM=Math.min,zg=function(){return RM.Date.now()};function LM(t,e,n){var r,i,s,o,a,c,u=0,l=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(EM);e=j0(e)||0,Jy(n)&&(l=!!n.leading,d="maxWait"in n,s=d?PM(j0(n.maxWait)||0,e):s,f="trailing"in n?!!n.trailing:f);function h(x){var _=r,k=i;return r=i=void 0,u=x,o=t.apply(k,_),o}function m(x){return u=x,a=setTimeout(y,e),l?h(x):o}function p(x){var _=x-c,k=x-u,R=e-_;return d?MM(R,s-k):R}function g(x){var _=x-c,k=x-u;return c===void 0||_>=e||_<0||d&&k>=s}function y(){var x=zg();if(g(x))return v(x);a=setTimeout(y,p(x))}function v(x){return a=void 0,f&&r?h(x):(r=i=void 0,o)}function b(){a!==void 0&&clearTimeout(a),u=0,r=c=i=a=void 0}function E(){return a===void 0?o:v(zg())}function w(){var x=zg(),_=g(x);if(r=arguments,i=this,c=x,_){if(a===void 0)return m(c);if(d)return a=setTimeout(y,e),h(c)}return a===void 0&&(a=setTimeout(y,e)),o}return w.cancel=b,w.flush=E,w}function Jy(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function FM(t){return!!t&&typeof t=="object"}function $M(t){return typeof t=="symbol"||FM(t)&&AM.call(t)==SM}function j0(t){if(typeof t=="number")return t;if($M(t))return $0;if(Jy(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Jy(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(xM,"");var n=IM.test(t);return n||OM.test(t)?CM(t.slice(2),n?2:8):TM.test(t)?$0:+t}var jM=LM;const U0=tc(jM);var UM=typeof window<"u"?xm:Dt;function BM(t,e,n,r){const i=qt(e);UM(()=>{i.current=e},[e]),Dt(()=>{const s=window;if(!(s&&s.addEventListener))return;const o=a=>{i.current(a)};return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,n,r])}function eie(){const[t,e]=We(null),n=He(async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch(i){return console.warn("Copy failed",i),e(null),!1}},[]);return[t,n]}function zM(t){const e=qt(t);e.current=t,Dt(()=>()=>{e.current()},[])}function VM(t,e=500,n){const r=qt();zM(()=>{r.current&&r.current.cancel()});const i=Pn(()=>{const s=U0(t,e,n),o=(...a)=>s(...a);return o.cancel=()=>{s.cancel()},o.isPending=()=>!!r.current,o.flush=()=>s.flush(),o},[t,e,n]);return Dt(()=>{r.current=U0(t,e,n)},[t,e,n]),i}function HM(t,e,n){const r=(u,l)=>u===l,i=t instanceof Function?t():t,[s,o]=We(i),a=qt(i),c=VM(o,e,n);return r(a.current,i)||(c(i),a.current=i),[s,c]}function tie(t,e,n="mousedown",r={}){BM(n,i=>{const s=i.target;if(!s||!s.isConnected)return;(Array.isArray(t)?t.filter(a=>!!a.current).every(a=>a.current&&!a.current.contains(s)):t.current&&!t.current.contains(s))&&e(i)},void 0,r)}const WM=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})};function qM(t){return P("div",{style:{width:t.width,height:t.height}})}function GM(t){try{return bP(()=>WM(Object.assign({"../../../assets/icon-components/ArrowFilledRight.tsx":()=>Se(()=>import("./ArrowFilledRight-BXP1j8Cl.js"),[]),"../../../assets/icon-components/ArrowLeft.tsx":()=>Se(()=>import("./ArrowLeft-8ZR_YHAJ.js"),[]),"../../../assets/icon-components/ArrowUp.tsx":()=>Se(()=>import("./ArrowUp-E2jS6Wzt.js"),[]),"../../../assets/icon-components/BarChart.tsx":()=>Se(()=>import("./BarChart-C-E6t7dt.js"),[]),"../../../assets/icon-components/BaseArrowLeft.tsx":()=>Se(()=>import("./BaseArrowLeft-DtHrkTW4.js"),[]),"../../../assets/icon-components/BaseArrowRight.tsx":()=>Se(()=>import("./BaseArrowRight-BIwzFHnh.js"),[]),"../../../assets/icon-components/Braces.tsx":()=>Se(()=>import("./Braces-3LcexUsR.js"),[]),"../../../assets/icon-components/Branch.tsx":()=>Se(()=>import("./Branch-D0CssEh3.js"),[]),"../../../assets/icon-components/BrickGlobe.tsx":()=>Se(()=>import("./BrickGlobe-CdHw7ZVP.js"),[]),"../../../assets/icon-components/Briefcase.tsx":()=>Se(()=>import("./Briefcase-CV2bgnSj.js"),[]),"../../../assets/icon-components/Calendar.tsx":()=>Se(()=>import("./Calendar-DuXN-sPt.js"),[]),"../../../assets/icon-components/CalendarTime.tsx":()=>Se(()=>import("./CalendarTime-BowYBiVM.js"),[]),"../../../assets/icon-components/Caret.tsx":()=>Se(()=>import("./Caret-r16V7Hcs.js"),[]),"../../../assets/icon-components/CaretDown.tsx":()=>Se(()=>import("./CaretDown-DljrBfIz.js"),[]),"../../../assets/icon-components/CaretLeft.tsx":()=>Se(()=>import("./CaretLeft-B_Lzd_Rn.js"),[]),"../../../assets/icon-components/CaretRight.tsx":()=>Se(()=>import("./CaretRight-Bbz5nCpg.js"),[]),"../../../assets/icon-components/CaretSort.tsx":()=>Se(()=>import("./CaretSort-DSgBum1h.js"),[]),"../../../assets/icon-components/Check.tsx":()=>Se(()=>import("./Check-CbV9BYHY.js"),[]),"../../../assets/icon-components/CheckCircle.tsx":()=>Se(()=>import("./CheckCircle-CX2jIKoF.js"),[]),"../../../assets/icon-components/CheckCircleFill.tsx":()=>Se(()=>import("./CheckCircleFill-DLK12sW5.js"),[]),"../../../assets/icon-components/Checkmark.tsx":()=>Se(()=>import("./Checkmark-DBvUEZAd.js"),[]),"../../../assets/icon-components/ChevronDown.tsx":()=>Se(()=>import("./ChevronDown-eUsCPXcB.js"),[]),"../../../assets/icon-components/Circle.tsx":()=>Se(()=>import("./Circle-8dOehHQf.js"),[]),"../../../assets/icon-components/CircleInfo.tsx":()=>Se(()=>import("./CircleInfo-D0ktZDko.js"),[]),"../../../assets/icon-components/Clock.tsx":()=>Se(()=>import("./Clock-CudavWaE.js"),[]),"../../../assets/icon-components/ClockFill.tsx":()=>Se(()=>import("./ClockFill-yWs52y_e.js"),[]),"../../../assets/icon-components/CloudSlash.tsx":()=>Se(()=>import("./CloudSlash-D18Hl3VW.js"),[]),"../../../assets/icon-components/Collapse.tsx":()=>Se(()=>import("./Collapse-BOxZH5-e.js"),[]),"../../../assets/icon-components/Connect.tsx":()=>Se(()=>import("./Connect-laqJZT3s.js"),[]),"../../../assets/icon-components/Copy.tsx":()=>Se(()=>import("./Copy-CkOtWZ6m.js"),[]),"../../../assets/icon-components/CrossCircle.tsx":()=>Se(()=>import("./CrossCircle-Bp9diEe9.js"),[]),"../../../assets/icon-components/Danger.tsx":()=>Se(()=>import("./Danger-CLu7nxgz.js"),[]),"../../../assets/icon-components/Discord.tsx":()=>Se(()=>import("./Discord-CcPWRT8g.js"),[]),"../../../assets/icon-components/Drive.tsx":()=>Se(()=>import("./Drive-CzahDx9j.js"),[]),"../../../assets/icon-components/Edit.tsx":()=>Se(()=>import("./Edit-D9GlgGu8.js"),[]),"../../../assets/icon-components/Ellipsis.tsx":()=>Se(()=>import("./Ellipsis-DWNUJYUI.js"),[]),"../../../assets/icon-components/Error.tsx":()=>Se(()=>import("./Error-FBAhqFT5.js"),[]),"../../../assets/icon-components/Exclamation.tsx":()=>Se(()=>import("./Exclamation-BGFGsVRw.js"),[]),"../../../assets/icon-components/File.tsx":()=>Se(()=>import("./File-DWKl25DR.js"),[]),"../../../assets/icon-components/FilesEarmark.tsx":()=>Se(()=>import("./FilesEarmark-BTL53WSf.js"),[]),"../../../assets/icon-components/FolderClose.tsx":()=>Se(()=>import("./FolderClose-BVMKeKvW.js"),[]),"../../../assets/icon-components/FolderOpen.tsx":()=>Se(()=>import("./FolderOpen-DT55_X9N.js"),[]),"../../../assets/icon-components/FolderPlus.tsx":()=>Se(()=>import("./FolderPlus-C2G5PVs-.js"),[]),"../../../assets/icon-components/Forum.tsx":()=>Se(()=>import("./Forum-Cfgyizyn.js"),[]),"../../../assets/icon-components/Gear.tsx":()=>Se(()=>import("./Gear-CoQ9O06k.js"),[]),"../../../assets/icon-components/Github.tsx":()=>Se(()=>import("./Github-CjkZIHCO.js"),[]),"../../../assets/icon-components/Globe.tsx":()=>Se(()=>import("./Globe-Dy2otZRk.js"),[]),"../../../assets/icon-components/GlobeWww.tsx":()=>Se(()=>import("./GlobeWww-Ci7aa5CE.js"),[]),"../../../assets/icon-components/Hdd.tsx":()=>Se(()=>import("./Hdd-CP-hFB7d.js"),[]),"../../../assets/icon-components/History.tsx":()=>Se(()=>import("./History-CmOiP5qa.js"),[]),"../../../assets/icon-components/InfoSquare.tsx":()=>Se(()=>import("./InfoSquare-DbYZrwmg.js"),[]),"../../../assets/icon-components/Link.tsx":()=>Se(()=>import("./Link-CXIVQOz6.js"),[]),"../../../assets/icon-components/Linkedin.tsx":()=>Se(()=>import("./Linkedin-exhl1yGN.js"),[]),"../../../assets/icon-components/Lock.tsx":()=>Se(()=>import("./Lock-DWdDRi_O.js"),[]),"../../../assets/icon-components/M.tsx":()=>Se(()=>import("./M-ByQIo8bX.js"),[]),"../../../assets/icon-components/PackageManager.tsx":()=>Se(()=>import("./PackageManager-D6Ia8zHs.js"),[]),"../../../assets/icon-components/Pencil.tsx":()=>Se(()=>import("./Pencil-D830iveq.js"),[]),"../../../assets/icon-components/People.tsx":()=>Se(()=>import("./People-B1tewG8c.js"),[]),"../../../assets/icon-components/Person.tsx":()=>Se(()=>import("./Person-BPRmm67U.js"),[]),"../../../assets/icon-components/Pin.tsx":()=>Se(()=>import("./Pin-D53eCMAz.js"),[]),"../../../assets/icon-components/PinFilled.tsx":()=>Se(()=>import("./PinFilled-CMXfFW67.js"),[]),"../../../assets/icon-components/Plus.tsx":()=>Se(()=>import("./Plus-XUIm1wNw.js"),[]),"../../../assets/icon-components/PlusCircle.tsx":()=>Se(()=>import("./PlusCircle-D1IRYULb.js"),[]),"../../../assets/icon-components/PowerhouseLogoSmall.tsx":()=>Se(()=>import("./PowerhouseLogoSmall-DF1uUwIC.js"),[]),"../../../assets/icon-components/Project.tsx":()=>Se(()=>import("./Project-EsBam9d0.js"),[]),"../../../assets/icon-components/QuestionSquare.tsx":()=>Se(()=>import("./QuestionSquare-CDaw1i6L.js"),[]),"../../../assets/icon-components/RedoArrow.tsx":()=>Se(()=>import("./RedoArrow-DM-fqhEP.js"),[]),"../../../assets/icon-components/Reload.tsx":()=>Se(()=>import("./Reload-DPZbA7yl.js"),[]),"../../../assets/icon-components/Renown.tsx":()=>Se(()=>import("./Renown-CItksi2j.js"),[]),"../../../assets/icon-components/RenownHover.tsx":()=>Se(()=>import("./RenownHover-cYQgnwQW.js"),[]),"../../../assets/icon-components/Ring.tsx":()=>Se(()=>import("./Ring-BivnmVc5.js"),[]),"../../../assets/icon-components/Save.tsx":()=>Se(()=>import("./Save-BWCZPY82.js"),[]),"../../../assets/icon-components/Search.tsx":()=>Se(()=>import("./Search-BiEcSbcf.js"),[]),"../../../assets/icon-components/Server.tsx":()=>Se(()=>import("./Server-cAzmNxsS.js"),[]),"../../../assets/icon-components/Settings.tsx":()=>Se(()=>import("./Settings-Cca-sV-_.js"),[]),"../../../assets/icon-components/Synced.tsx":()=>Se(()=>import("./Synced-CjieGKOk.js"),[]),"../../../assets/icon-components/Syncing.tsx":()=>Se(()=>import("./Syncing-KnDBLSYe.js"),[]),"../../../assets/icon-components/Trash.tsx":()=>Se(()=>import("./Trash-DIHOD5wQ.js"),[]),"../../../assets/icon-components/TrashFill.tsx":()=>Se(()=>import("./TrashFill-CG3humXp.js"),[]),"../../../assets/icon-components/TreeViewSlash.tsx":()=>Se(()=>import("./TreeViewSlash-CKJADIpa.js"),[]),"../../../assets/icon-components/TriangleDown.tsx":()=>Se(()=>import("./TriangleDown-Boh-WZzH.js"),[]),"../../../assets/icon-components/VariantArrowLeft.tsx":()=>Se(()=>import("./VariantArrowLeft-Dl1-3L5q.js"),[]),"../../../assets/icon-components/VerticalDots.tsx":()=>Se(()=>import("./VerticalDots-CCZxgZM8.js"),[]),"../../../assets/icon-components/WarningFill.tsx":()=>Se(()=>import("./WarningFill-CRRaW3Oz.js"),[]),"../../../assets/icon-components/XTwitter.tsx":()=>Se(()=>import("./XTwitter-CW6IaHUb.js"),[]),"../../../assets/icon-components/Xmark.tsx":()=>Se(()=>import("./Xmark-CZ3t0Fap.js"),[]),"../../../assets/icon-components/XmarkLight.tsx":()=>Se(()=>import("./XmarkLight-BkhBFy51.js"),[]),"../../../assets/icon-components/Youtube.tsx":()=>Se(()=>import("./Youtube-h-Dc9pri.js"),[])}),`../../../assets/icon-components/${t}.tsx`,6))}catch(e){return console.error(e),qM}}function vt({name:t,size:e=24,color:n,style:r,...i}){const s=WP(e),o={color:n,...s,style:r},a=Pn(()=>GM(t),[t]);return P(qT,{fallback:P("div",{"data-testid":"icon-fallback",style:s}),name:"icon-component",children:P(a,{...i,style:o})})}function Da(t){"@babel/helpers - typeof";return Da=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Da(t)}function ZM(t,e){if(Da(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Da(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iI(t){var e=ZM(t,"string");return Da(e)=="symbol"?e:e+""}function _l(t,e,n){return(e=iI(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function it(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?B0(Object(n),!0).forEach(function(r){_l(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function YM(t){if(Array.isArray(t))return t}function KM(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],c=!0,u=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function Xy(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function sI(t,e){if(t){if(typeof t=="string")return Xy(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xy(t,e):void 0}}function JM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fs(t,e){return YM(t)||KM(t,e)||sI(t,e)||JM()}function XM(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Js(t,e){if(t==null)return{};var n,r,i=XM(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var QM=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function eL(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,i=r===void 0?!1:r,s=t.defaultValue,o=s===void 0?null:s,a=t.inputValue,c=t.menuIsOpen,u=t.onChange,l=t.onInputChange,d=t.onMenuClose,f=t.onMenuOpen,h=t.value,m=Js(t,QM),p=We(a!==void 0?a:n),g=Fs(p,2),y=g[0],v=g[1],b=We(c!==void 0?c:i),E=Fs(b,2),w=E[0],x=E[1],_=We(h!==void 0?h:o),k=Fs(_,2),R=k[0],F=k[1],V=He(function(K,$){typeof u=="function"&&u(K,$),F(K)},[u]),T=He(function(K,$){var q;typeof l=="function"&&(q=l(K,$)),v(q!==void 0?q:K)},[l]),L=He(function(){typeof f=="function"&&f(),x(!0)},[f]),S=He(function(){typeof d=="function"&&d(),x(!1)},[d]),C=a!==void 0?a:y,N=c!==void 0?c:w,U=h!==void 0?h:R;return it(it({},m),{},{inputValue:C,menuIsOpen:N,onChange:V,onInputChange:T,onMenuClose:S,onMenuOpen:L,value:U})}function tL(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,iI(r.key),r)}}function nL(t,e,n){return z0(t.prototype,e),z0(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qy(t,e){return Qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Qy(t,e)}function rL(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qy(t,e)}function up(t){return up=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},up(t)}function oI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oI=function(){return!!t})()}function iL(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sL(t,e){if(e&&(Da(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iL(t)}function oL(t){var e=oI();return function(){var n,r=up(t);if(e){var i=up(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return sL(this,n)}}function aL(t){if(Array.isArray(t))return Xy(t)}function cL(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function uL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zb(t){return aL(t)||cL(t)||sI(t)||uL()}function lL(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function dL(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var fL=function(){function t(n){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(dL(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=lL(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},t}(),tr="-ms-",lp="-moz-",Ht="-webkit-",aI="comm",Vb="rule",Hb="decl",hL="@import",cI="@keyframes",pL="@layer",mL=Math.abs,Tm=String.fromCharCode,gL=Object.assign;function yL(t,e){return Xn(t,0)^45?(((e<<2^Xn(t,0))<<2^Xn(t,1))<<2^Xn(t,2))<<2^Xn(t,3):0}function uI(t){return t.trim()}function vL(t,e){return(t=e.exec(t))?t[0]:t}function Wt(t,e,n){return t.replace(e,n)}function ev(t,e){return t.indexOf(e)}function Xn(t,e){return t.charCodeAt(e)|0}function Jl(t,e,n){return t.slice(e,n)}function qi(t){return t.length}function Wb(t){return t.length}function Vf(t,e){return e.push(t),t}function bL(t,e){return t.map(e).join("")}var Im=1,pu=1,lI=0,kr=0,An=0,ju="";function Om(t,e,n,r,i,s,o){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:Im,column:pu,length:o,return:""}}function ol(t,e){return gL(Om("",null,null,"",null,null,0),t,{length:-t.length},e)}function _L(){return An}function wL(){return An=kr>0?Xn(ju,--kr):0,pu--,An===10&&(pu=1,Im--),An}function Ur(){return An=kr<lI?Xn(ju,kr++):0,pu++,An===10&&(pu=1,Im++),An}function ts(){return Xn(ju,kr)}function Ph(){return kr}function pf(t,e){return Jl(ju,t,e)}function Xl(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function dI(t){return Im=pu=1,lI=qi(ju=t),kr=0,[]}function fI(t){return ju="",t}function Mh(t){return uI(pf(kr-1,tv(t===91?t+2:t===40?t+1:t)))}function EL(t){for(;(An=ts())&&An<33;)Ur();return Xl(t)>2||Xl(An)>3?"":" "}function SL(t,e){for(;--e&&Ur()&&!(An<48||An>102||An>57&&An<65||An>70&&An<97););return pf(t,Ph()+(e<6&&ts()==32&&Ur()==32))}function tv(t){for(;Ur();)switch(An){case t:return kr;case 34:case 39:t!==34&&t!==39&&tv(An);break;case 40:t===41&&tv(t);break;case 92:Ur();break}return kr}function xL(t,e){for(;Ur()&&t+An!==57;)if(t+An===84&&ts()===47)break;return"/*"+pf(e,kr-1)+"*"+Tm(t===47?t:Ur())}function TL(t){for(;!Xl(ts());)Ur();return pf(t,kr)}function IL(t){return fI(Lh("",null,null,null,[""],t=dI(t),0,[0],t))}function Lh(t,e,n,r,i,s,o,a,c){for(var u=0,l=0,d=o,f=0,h=0,m=0,p=1,g=1,y=1,v=0,b="",E=i,w=s,x=r,_=b;g;)switch(m=v,v=Ur()){case 40:if(m!=108&&Xn(_,d-1)==58){ev(_+=Wt(Mh(v),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:_+=Mh(v);break;case 9:case 10:case 13:case 32:_+=EL(m);break;case 92:_+=SL(Ph()-1,7);continue;case 47:switch(ts()){case 42:case 47:Vf(OL(xL(Ur(),Ph()),e,n),c);break;default:_+="/"}break;case 123*p:a[u++]=qi(_)*y;case 125*p:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+l:y==-1&&(_=Wt(_,/\f/g,"")),h>0&&qi(_)-d&&Vf(h>32?H0(_+";",r,n,d-1):H0(Wt(_," ","")+";",r,n,d-2),c);break;case 59:_+=";";default:if(Vf(x=V0(_,e,n,u,l,i,a,b,E=[],w=[],d),s),v===123)if(l===0)Lh(_,e,x,x,E,s,d,a,w);else switch(f===99&&Xn(_,3)===110?100:f){case 100:case 108:case 109:case 115:Lh(t,x,x,r&&Vf(V0(t,x,x,0,0,i,a,b,i,E=[],d),w),i,w,d,a,r?E:w);break;default:Lh(_,x,x,x,[""],w,0,a,w)}}u=l=h=0,p=y=1,b=_="",d=o;break;case 58:d=1+qi(_),h=m;default:if(p<1){if(v==123)--p;else if(v==125&&p++==0&&wL()==125)continue}switch(_+=Tm(v),v*p){case 38:y=l>0?1:(_+="\f",-1);break;case 44:a[u++]=(qi(_)-1)*y,y=1;break;case 64:ts()===45&&(_+=Mh(Ur())),f=ts(),l=d=qi(b=_+=TL(Ph())),v++;break;case 45:m===45&&qi(_)==2&&(p=0)}}return s}function V0(t,e,n,r,i,s,o,a,c,u,l){for(var d=i-1,f=i===0?s:[""],h=Wb(f),m=0,p=0,g=0;m<r;++m)for(var y=0,v=Jl(t,d+1,d=mL(p=o[m])),b=t;y<h;++y)(b=uI(p>0?f[y]+" "+v:Wt(v,/&\f/g,f[y])))&&(c[g++]=b);return Om(t,e,n,i===0?Vb:a,c,u,l)}function OL(t,e,n){return Om(t,e,n,aI,Tm(_L()),Jl(t,2,-2),0)}function H0(t,e,n,r){return Om(t,e,n,Hb,Jl(t,0,r),Jl(t,r+1,-1),r)}function Wc(t,e){for(var n="",r=Wb(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function CL(t,e,n,r){switch(t.type){case pL:if(t.children.length)break;case hL:case Hb:return t.return=t.return||t.value;case aI:return"";case cI:return t.return=t.value+"{"+Wc(t.children,r)+"}";case Vb:t.value=t.props.join(",")}return qi(n=Wc(t.children,r))?t.return=t.value+"{"+n+"}":""}function kL(t){var e=Wb(t);return function(n,r,i,s){for(var o="",a=0;a<e;a++)o+=t[a](n,r,i,s)||"";return o}}function DL(t){return function(e){e.root||(e=e.return)&&t(e)}}function RL(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var NL=function(e,n,r){for(var i=0,s=0;i=s,s=ts(),i===38&&s===12&&(n[r]=1),!Xl(s);)Ur();return pf(e,kr)},AL=function(e,n){var r=-1,i=44;do switch(Xl(i)){case 0:i===38&&ts()===12&&(n[r]=1),e[r]+=NL(kr-1,n,r);break;case 2:e[r]+=Mh(i);break;case 4:if(i===44){e[++r]=ts()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=Tm(i)}while(i=Ur());return e},PL=function(e,n){return fI(AL(dI(e),n))},W0=new WeakMap,ML=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!W0.get(r))&&!i){W0.set(e,!0);for(var s=[],o=PL(n,s),a=r.props,c=0,u=0;c<o.length;c++)for(var l=0;l<a.length;l++,u++)e.props[u]=s[c]?o[c].replace(/&\f/g,a[l]):a[l]+" "+o[c]}}},LL=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function hI(t,e){switch(yL(t,e)){case 5103:return Ht+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ht+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ht+t+lp+t+tr+t+t;case 6828:case 4268:return Ht+t+tr+t+t;case 6165:return Ht+t+tr+"flex-"+t+t;case 5187:return Ht+t+Wt(t,/(\w+).+(:[^]+)/,Ht+"box-$1$2"+tr+"flex-$1$2")+t;case 5443:return Ht+t+tr+"flex-item-"+Wt(t,/flex-|-self/,"")+t;case 4675:return Ht+t+tr+"flex-line-pack"+Wt(t,/align-content|flex-|-self/,"")+t;case 5548:return Ht+t+tr+Wt(t,"shrink","negative")+t;case 5292:return Ht+t+tr+Wt(t,"basis","preferred-size")+t;case 6060:return Ht+"box-"+Wt(t,"-grow","")+Ht+t+tr+Wt(t,"grow","positive")+t;case 4554:return Ht+Wt(t,/([^-])(transform)/g,"$1"+Ht+"$2")+t;case 6187:return Wt(Wt(Wt(t,/(zoom-|grab)/,Ht+"$1"),/(image-set)/,Ht+"$1"),t,"")+t;case 5495:case 3959:return Wt(t,/(image-set\([^]*)/,Ht+"$1$`$1");case 4968:return Wt(Wt(t,/(.+:)(flex-)?(.*)/,Ht+"box-pack:$3"+tr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ht+t+t;case 4095:case 3583:case 4068:case 2532:return Wt(t,/(.+)-inline(.+)/,Ht+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(qi(t)-1-e>6)switch(Xn(t,e+1)){case 109:if(Xn(t,e+4)!==45)break;case 102:return Wt(t,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+lp+(Xn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~ev(t,"stretch")?hI(Wt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Xn(t,e+1)!==115)break;case 6444:switch(Xn(t,qi(t)-3-(~ev(t,"!important")&&10))){case 107:return Wt(t,":",":"+Ht)+t;case 101:return Wt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ht+(Xn(t,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+tr+"$2box$3")+t}break;case 5936:switch(Xn(t,e+11)){case 114:return Ht+t+tr+Wt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ht+t+tr+Wt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ht+t+tr+Wt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Ht+t+tr+t+t}return t}var FL=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case Hb:e.return=hI(e.value,e.length);break;case cI:return Wc([ol(e,{value:Wt(e.value,"@","@"+Ht)})],i);case Vb:if(e.length)return bL(e.props,function(s){switch(vL(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Wc([ol(e,{props:[Wt(s,/:(read-\w+)/,":"+lp+"$1")]})],i);case"::placeholder":return Wc([ol(e,{props:[Wt(s,/:(plac\w+)/,":"+Ht+"input-$1")]}),ol(e,{props:[Wt(s,/:(plac\w+)/,":"+lp+"$1")]}),ol(e,{props:[Wt(s,/:(plac\w+)/,tr+"input-$1")]})],i)}return""})}},$L=[FL],jL=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var g=p.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=e.stylisPlugins||$L,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var g=p.getAttribute("data-emotion").split(" "),y=1;y<g.length;y++)s[g[y]]=!0;a.push(p)});var c,u=[ML,LL];{var l,d=[CL,DL(function(p){l.insert(p)})],f=kL(u.concat(i,d)),h=function(g){return Wc(IL(g),f)};c=function(g,y,v,b){l=v,h(g?g+"{"+y.styles+"}":y.styles),b&&(m.inserted[y.name]=!0)}}var m={key:n,sheet:new fL({key:n,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:c};return m.sheet.hydrate(a),m},pI={exports:{}},Qt={};/** @license React v16.13.1
|
|
5
|
-
* react-is.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var Gn=typeof Symbol=="function"&&Symbol.for,qb=Gn?Symbol.for("react.element"):60103,Gb=Gn?Symbol.for("react.portal"):60106,Cm=Gn?Symbol.for("react.fragment"):60107,km=Gn?Symbol.for("react.strict_mode"):60108,Dm=Gn?Symbol.for("react.profiler"):60114,Rm=Gn?Symbol.for("react.provider"):60109,Nm=Gn?Symbol.for("react.context"):60110,Zb=Gn?Symbol.for("react.async_mode"):60111,Am=Gn?Symbol.for("react.concurrent_mode"):60111,Pm=Gn?Symbol.for("react.forward_ref"):60112,Mm=Gn?Symbol.for("react.suspense"):60113,UL=Gn?Symbol.for("react.suspense_list"):60120,Lm=Gn?Symbol.for("react.memo"):60115,Fm=Gn?Symbol.for("react.lazy"):60116,BL=Gn?Symbol.for("react.block"):60121,zL=Gn?Symbol.for("react.fundamental"):60117,VL=Gn?Symbol.for("react.responder"):60118,HL=Gn?Symbol.for("react.scope"):60119;function qr(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case qb:switch(t=t.type,t){case Zb:case Am:case Cm:case Dm:case km:case Mm:return t;default:switch(t=t&&t.$$typeof,t){case Nm:case Pm:case Fm:case Lm:case Rm:return t;default:return e}}case Gb:return e}}}function mI(t){return qr(t)===Am}Qt.AsyncMode=Zb;Qt.ConcurrentMode=Am;Qt.ContextConsumer=Nm;Qt.ContextProvider=Rm;Qt.Element=qb;Qt.ForwardRef=Pm;Qt.Fragment=Cm;Qt.Lazy=Fm;Qt.Memo=Lm;Qt.Portal=Gb;Qt.Profiler=Dm;Qt.StrictMode=km;Qt.Suspense=Mm;Qt.isAsyncMode=function(t){return mI(t)||qr(t)===Zb};Qt.isConcurrentMode=mI;Qt.isContextConsumer=function(t){return qr(t)===Nm};Qt.isContextProvider=function(t){return qr(t)===Rm};Qt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===qb};Qt.isForwardRef=function(t){return qr(t)===Pm};Qt.isFragment=function(t){return qr(t)===Cm};Qt.isLazy=function(t){return qr(t)===Fm};Qt.isMemo=function(t){return qr(t)===Lm};Qt.isPortal=function(t){return qr(t)===Gb};Qt.isProfiler=function(t){return qr(t)===Dm};Qt.isStrictMode=function(t){return qr(t)===km};Qt.isSuspense=function(t){return qr(t)===Mm};Qt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Cm||t===Am||t===Dm||t===km||t===Mm||t===UL||typeof t=="object"&&t!==null&&(t.$$typeof===Fm||t.$$typeof===Lm||t.$$typeof===Rm||t.$$typeof===Nm||t.$$typeof===Pm||t.$$typeof===zL||t.$$typeof===VL||t.$$typeof===HL||t.$$typeof===BL)};Qt.typeOf=qr;pI.exports=Qt;var WL=pI.exports,gI=WL,qL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},GL={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},yI={};yI[gI.ForwardRef]=qL;yI[gI.Memo]=GL;var ZL=!0;function YL(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var vI=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||ZL===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},KL=function(e,n,r){vI(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var s=n;do e.insert(n===s?"."+i:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function JL(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var XL={animationIterationCount:1,aspectRatio: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,scale: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},QL=/[A-Z]|^ms/g,e2=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bI=function(e){return e.charCodeAt(1)===45},q0=function(e){return e!=null&&typeof e!="boolean"},Vg=RL(function(t){return bI(t)?t:t.replace(QL,"-$&").toLowerCase()}),G0=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(e2,function(r,i,s){return Gi={name:i,styles:s,next:Gi},i})}return XL[e]!==1&&!bI(e)&&typeof n=="number"&&n!==0?n+"px":n};function Ql(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Gi={name:i.name,styles:i.styles,next:Gi},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)Gi={name:o.name,styles:o.styles,next:Gi},o=o.next;var a=s.styles+";";return a}return t2(t,e,n)}case"function":{if(t!==void 0){var c=Gi,u=n(t);return Gi=c,Ql(t,e,u)}break}}var l=n;return l}function t2(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Ql(t,e,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;q0(a)&&(r+=Vg(s)+":"+G0(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&e==null)for(var c=0;c<o.length;c++)q0(o[c])&&(r+=Vg(s)+":"+G0(s,o[c])+";");else{var u=Ql(t,e,o);switch(s){case"animation":case"animationName":{r+=Vg(s)+":"+u+";";break}default:r+=s+"{"+u+"}"}}}return r}var Z0=/label:\s*([^\s;{]+)\s*(;|$)/g,Gi;function _I(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";Gi=void 0;var s=t[0];if(s==null||s.raw===void 0)r=!1,i+=Ql(n,e,s);else{var o=s;i+=o[0]}for(var a=1;a<t.length;a++)if(i+=Ql(n,e,t[a]),r){var c=s;i+=c[a]}Z0.lastIndex=0;for(var u="",l;(l=Z0.exec(i))!==null;)u+="-"+l[1];var d=JL(i)+u;return{name:d,styles:i,next:Gi}}var n2=function(e){return e()},r2=Y.useInsertionEffect?Y.useInsertionEffect:!1,i2=r2||n2,wI=Y.createContext(typeof HTMLElement<"u"?jL({key:"css"}):null);wI.Provider;var s2=function(e){return ec(function(n,r){var i=Yo(wI);return e(n,i,r)})},o2=Y.createContext({}),Yb={}.hasOwnProperty,nv="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",a2=function(e,n){var r={};for(var i in n)Yb.call(n,i)&&(r[i]=n[i]);return r[nv]=e,r},c2=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return vI(n,r,i),i2(function(){return KL(n,r,i)}),null},u2=s2(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var i=t[nv],s=[r],o="";typeof t.className=="string"?o=YL(e.registered,s,t.className):t.className!=null&&(o=t.className+" ");var a=_I(s,void 0,Y.useContext(o2));o+=e.key+"-"+a.name;var c={};for(var u in t)Yb.call(t,u)&&u!=="css"&&u!==nv&&(c[u]=t[u]);return c.className=o,n&&(c.ref=n),Y.createElement(Y.Fragment,null,Y.createElement(c2,{cache:e,serialized:a,isStringTag:typeof i=="string"}),Y.createElement(i,c))}),l2=u2,tt=function(e,n){var r=arguments;if(n==null||!Yb.call(n,"css"))return Y.createElement.apply(void 0,r);var i=r.length,s=new Array(i);s[0]=l2,s[1]=a2(e,n);for(var o=2;o<i;o++)s[o]=r[o];return Y.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(tt);function Kb(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return _I(e)}function d2(){var t=Kb.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function f2(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const h2=["top","right","bottom","left"],Mo=Math.min,Mr=Math.max,dp=Math.round,Hf=Math.floor,ns=t=>({x:t,y:t}),p2={left:"right",right:"left",bottom:"top",top:"bottom"},m2={start:"end",end:"start"};function rv(t,e,n){return Mr(t,Mo(e,n))}function Bs(t,e){return typeof t=="function"?t(e):t}function zs(t){return t.split("-")[0]}function Uu(t){return t.split("-")[1]}function Jb(t){return t==="x"?"y":"x"}function Xb(t){return t==="y"?"height":"width"}function Lo(t){return["top","bottom"].includes(zs(t))?"y":"x"}function Qb(t){return Jb(Lo(t))}function g2(t,e,n){n===void 0&&(n=!1);const r=Uu(t),i=Qb(t),s=Xb(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=fp(o)),[o,fp(o)]}function y2(t){const e=fp(t);return[iv(t),e,iv(e)]}function iv(t){return t.replace(/start|end/g,e=>m2[e])}function v2(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function b2(t,e,n,r){const i=Uu(t);let s=v2(zs(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(iv)))),s}function fp(t){return t.replace(/left|right|bottom|top/g,e=>p2[e])}function _2(t){return{top:0,right:0,bottom:0,left:0,...t}}function EI(t){return typeof t!="number"?_2(t):{top:t,right:t,bottom:t,left:t}}function hp(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Y0(t,e,n){let{reference:r,floating:i}=t;const s=Lo(e),o=Qb(e),a=Xb(o),c=zs(e),u=s==="y",l=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(c){case"top":h={x:l,y:r.y-i.height};break;case"bottom":h={x:l,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Uu(e)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const w2=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:l,y:d}=Y0(u,r,c),f=r,h={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:y}=a[p],{x:v,y:b,data:E,reset:w}=await y({x:l,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:t,floating:e}});l=v??l,d=b??d,h={...h,[g]:{...h[g],...E}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:l,y:d}=Y0(u,f,c)),p=-1)}return{x:l,y:d,placement:f,strategy:i,middlewareData:h}};async function ed(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bs(e,t),m=EI(h),g=a[f?d==="floating"?"reference":"floating":d],y=hp(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:l,strategy:c})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},w=hp(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:c}):v);return{top:(y.top-w.top+m.top)/E.y,bottom:(w.bottom-y.bottom+m.bottom)/E.y,left:(y.left-w.left+m.left)/E.x,right:(w.right-y.right+m.right)/E.x}}const E2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:u,padding:l=0}=Bs(t,e)||{};if(u==null)return{};const d=EI(l),f={x:n,y:r},h=Qb(i),m=Xb(h),p=await o.getDimensions(u),g=h==="y",y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",E=s.reference[m]+s.reference[h]-f[h]-s.floating[m],w=f[h]-s.reference[h],x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let _=x?x[b]:0;(!_||!await(o.isElement==null?void 0:o.isElement(x)))&&(_=a.floating[b]||s.floating[m]);const k=E/2-w/2,R=_/2-p[m]/2-1,F=Mo(d[y],R),V=Mo(d[v],R),T=F,L=_-p[m]-V,S=_/2-p[m]/2+k,C=rv(T,S,L),N=!c.arrow&&Uu(i)!=null&&S!==C&&s.reference[m]/2-(S<T?F:V)-p[m]/2<0,U=N?S<T?S-T:S-L:0;return{[h]:f[h]+U,data:{[h]:C,centerOffset:S-C-U,...N&&{alignmentOffset:U}},reset:N}}}),S2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=Bs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=zs(i),v=Lo(a),b=zs(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=f||(b||!p?[fp(a)]:y2(a)),x=m!=="none";!f&&x&&w.push(...b2(a,p,m,E));const _=[a,...w],k=await ed(e,g),R=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&R.push(k[y]),d){const S=g2(i,o,E);R.push(k[S[0]],k[S[1]])}if(F=[...F,{placement:i,overflows:R}],!R.every(S=>S<=0)){var V,T;const S=(((V=s.flip)==null?void 0:V.index)||0)+1,C=_[S];if(C)return{data:{index:S,overflows:F},reset:{placement:C}};let N=(T=F.filter(U=>U.overflows[0]<=0).sort((U,K)=>U.overflows[1]-K.overflows[1])[0])==null?void 0:T.placement;if(!N)switch(h){case"bestFit":{var L;const U=(L=F.filter(K=>{if(x){const $=Lo(K.placement);return $===v||$==="y"}return!0}).map(K=>[K.placement,K.overflows.filter($=>$>0).reduce(($,q)=>$+q,0)]).sort((K,$)=>K[1]-$[1])[0])==null?void 0:L[0];U&&(N=U);break}case"initialPlacement":N=a;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function K0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function J0(t){return h2.some(e=>t[e]>=0)}const x2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Bs(t,e);switch(r){case"referenceHidden":{const s=await ed(e,{...i,elementContext:"reference"}),o=K0(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:J0(o)}}}case"escaped":{const s=await ed(e,{...i,altBoundary:!0}),o=K0(s,n.floating);return{data:{escapedOffsets:o,escaped:J0(o)}}}default:return{}}}}};async function T2(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=zs(n),a=Uu(n),c=Lo(n)==="y",u=["left","top"].includes(o)?-1:1,l=s&&c?-1:1,d=Bs(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*l,y:f*u}:{x:f*u,y:h*l}}const I2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await T2(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},O2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...c}=Bs(t,e),u={x:n,y:r},l=await ed(e,c),d=Lo(zs(i)),f=Jb(d);let h=u[f],m=u[d];if(s){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=h+l[g],b=h-l[y];h=rv(v,h,b)}if(o){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",v=m+l[g],b=m-l[y];m=rv(v,m,b)}const p=a.fn({...e,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:s,[d]:o}}}}}},C2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Bs(t,e),l={x:n,y:r},d=Lo(i),f=Jb(d);let h=l[f],m=l[d];const p=Bs(a,e),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const b=f==="y"?"height":"width",E=s.reference[f]-s.floating[b]+g.mainAxis,w=s.reference[f]+s.reference[b]-g.mainAxis;h<E?h=E:h>w&&(h=w)}if(u){var y,v;const b=f==="y"?"width":"height",E=["top","left"].includes(zs(i)),w=s.reference[d]-s.floating[b]+(E&&((y=o.offset)==null?void 0:y[d])||0)+(E?0:g.crossAxis),x=s.reference[d]+s.reference[b]+(E?0:((v=o.offset)==null?void 0:v[d])||0)-(E?g.crossAxis:0);m<w?m=w:m>x&&(m=x)}return{[f]:h,[d]:m}}}},k2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:c=()=>{},...u}=Bs(t,e),l=await ed(e,u),d=zs(i),f=Uu(i),h=Lo(i)==="y",{width:m,height:p}=s.floating;let g,y;d==="top"||d==="bottom"?(g=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,g=f==="end"?"top":"bottom");const v=p-l.top-l.bottom,b=m-l.left-l.right,E=Mo(p-l[g],v),w=Mo(m-l[y],b),x=!e.middlewareData.shift;let _=E,k=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(k=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=v),x&&!f){const F=Mr(l.left,0),V=Mr(l.right,0),T=Mr(l.top,0),L=Mr(l.bottom,0);h?k=m-2*(F!==0||V!==0?F+V:Mr(l.left,l.right)):_=p-2*(T!==0||L!==0?T+L:Mr(l.top,l.bottom))}await c({...e,availableWidth:k,availableHeight:_});const R=await o.getDimensions(a.floating);return m!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function $m(){return typeof window<"u"}function Bu(t){return SI(t)?(t.nodeName||"").toLowerCase():"#document"}function Br(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hs(t){var e;return(e=(SI(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function SI(t){return $m()?t instanceof Node||t instanceof Br(t).Node:!1}function Ci(t){return $m()?t instanceof Element||t instanceof Br(t).Element:!1}function cs(t){return $m()?t instanceof HTMLElement||t instanceof Br(t).HTMLElement:!1}function X0(t){return!$m()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Br(t).ShadowRoot}function mf(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ki(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function D2(t){return["table","td","th"].includes(Bu(t))}function jm(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function e_(t){const e=t_(),n=Ci(t)?ki(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function R2(t){let e=Fo(t);for(;cs(e)&&!mu(e);){if(e_(e))return e;if(jm(e))return null;e=Fo(e)}return null}function t_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function mu(t){return["html","body","#document"].includes(Bu(t))}function ki(t){return Br(t).getComputedStyle(t)}function Um(t){return Ci(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fo(t){if(Bu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||X0(t)&&t.host||hs(t);return X0(e)?e.host:e}function xI(t){const e=Fo(t);return mu(e)?t.ownerDocument?t.ownerDocument.body:t.body:cs(e)&&mf(e)?e:xI(e)}function td(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=xI(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Br(i);if(s){const a=sv(o);return e.concat(o,o.visualViewport||[],mf(i)?i:[],a&&n?td(a):[])}return e.concat(i,td(i,[],n))}function sv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function TI(t){const e=ki(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=cs(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=dp(n)!==s||dp(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function n_(t){return Ci(t)?t:t.contextElement}function qc(t){const e=n_(t);if(!cs(e))return ns(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=TI(e);let o=(s?dp(n.width):n.width)/r,a=(s?dp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const N2=ns(0);function II(t){const e=Br(t);return!t_()||!e.visualViewport?N2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function A2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Br(t)?!1:e}function Ra(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=n_(t);let o=ns(1);e&&(r?Ci(r)&&(o=qc(r)):o=qc(t));const a=A2(s,n,r)?II(s):ns(0);let c=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,l=i.width/o.x,d=i.height/o.y;if(s){const f=Br(s),h=r&&Ci(r)?Br(r):r;let m=f,p=sv(m);for(;p&&r&&h!==m;){const g=qc(p),y=p.getBoundingClientRect(),v=ki(p),b=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,E=y.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,u*=g.y,l*=g.x,d*=g.y,c+=b,u+=E,m=Br(p),p=sv(m)}}return hp({width:l,height:d,x:c,y:u})}function r_(t,e){const n=Um(t).scrollLeft;return e?e.left+n:Ra(hs(t)).left+n}function OI(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:r_(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function P2(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=hs(r),a=e?jm(e.floating):!1;if(r===o||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ns(1);const l=ns(0),d=cs(r);if((d||!d&&!s)&&((Bu(r)!=="body"||mf(o))&&(c=Um(r)),cs(r))){const h=Ra(r);u=qc(r),l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}const f=o&&!d&&!s?OI(o,c,!0):ns(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+f.x,y:n.y*u.y-c.scrollTop*u.y+l.y+f.y}}function M2(t){return Array.from(t.getClientRects())}function L2(t){const e=hs(t),n=Um(t),r=t.ownerDocument.body,i=Mr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Mr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+r_(t);const a=-n.scrollTop;return ki(r).direction==="rtl"&&(o+=Mr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function F2(t,e){const n=Br(t),r=hs(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const u=t_();(!u||u&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function $2(t,e){const n=Ra(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=cs(t)?qc(t):ns(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,u=r*s.y;return{width:o,height:a,x:c,y:u}}function Q0(t,e,n){let r;if(e==="viewport")r=F2(t,n);else if(e==="document")r=L2(hs(t));else if(Ci(e))r=$2(e,n);else{const i=II(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return hp(r)}function CI(t,e){const n=Fo(t);return n===e||!Ci(n)||mu(n)?!1:ki(n).position==="fixed"||CI(n,e)}function j2(t,e){const n=e.get(t);if(n)return n;let r=td(t,[],!1).filter(a=>Ci(a)&&Bu(a)!=="body"),i=null;const s=ki(t).position==="fixed";let o=s?Fo(t):t;for(;Ci(o)&&!mu(o);){const a=ki(o),c=e_(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mf(o)&&!c&&CI(t,o))?r=r.filter(l=>l!==o):i=a,o=Fo(o)}return e.set(t,r),r}function U2(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?jm(e)?[]:j2(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((u,l)=>{const d=Q0(e,l,i);return u.top=Mr(d.top,u.top),u.right=Mo(d.right,u.right),u.bottom=Mo(d.bottom,u.bottom),u.left=Mr(d.left,u.left),u},Q0(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function B2(t){const{width:e,height:n}=TI(t);return{width:e,height:n}}function z2(t,e,n){const r=cs(e),i=hs(e),s=n==="fixed",o=Ra(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=ns(0);if(r||!r&&!s)if((Bu(e)!=="body"||mf(i))&&(a=Um(e)),r){const f=Ra(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=r_(i));const u=i&&!r&&!s?OI(i,a):ns(0),l=o.left+a.scrollLeft-c.x-u.x,d=o.top+a.scrollTop-c.y-u.y;return{x:l,y:d,width:o.width,height:o.height}}function Hg(t){return ki(t).position==="static"}function eE(t,e){if(!cs(t)||ki(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hs(t)===n&&(n=n.ownerDocument.body),n}function kI(t,e){const n=Br(t);if(jm(t))return n;if(!cs(t)){let i=Fo(t);for(;i&&!mu(i);){if(Ci(i)&&!Hg(i))return i;i=Fo(i)}return n}let r=eE(t,e);for(;r&&D2(r)&&Hg(r);)r=eE(r,e);return r&&mu(r)&&Hg(r)&&!e_(r)?n:r||R2(t)||n}const V2=async function(t){const e=this.getOffsetParent||kI,n=this.getDimensions,r=await n(t.floating);return{reference:z2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function H2(t){return ki(t).direction==="rtl"}const W2={convertOffsetParentRelativeRectToViewportRelativeRect:P2,getDocumentElement:hs,getClippingRect:U2,getOffsetParent:kI,getElementRects:V2,getClientRects:M2,getDimensions:B2,getScale:qc,isElement:Ci,isRTL:H2};function DI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function q2(t,e){let n=null,r;const i=hs(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:l,top:d,width:f,height:h}=u;if(a||e(),!f||!h)return;const m=Hf(d),p=Hf(i.clientWidth-(l+f)),g=Hf(i.clientHeight-(d+h)),y=Hf(l),b={rootMargin:-m+"px "+-p+"px "+-g+"px "+-y+"px",threshold:Mr(0,Mo(1,c))||1};let E=!0;function w(x){const _=x[0].intersectionRatio;if(_!==c){if(!E)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_===1&&!DI(u,t.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return o(!0),s}function G2(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=n_(t),l=i||s?[...u?td(u):[],...td(e)]:[];l.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=u&&a?q2(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(e)})),n()}),u&&!c&&h.observe(u),h.observe(e));let m,p=c?Ra(t):null;c&&g();function g(){const y=Ra(t);p&&!DI(p,y)&&n(),p=y,m=requestAnimationFrame(g)}return n(),()=>{var y;l.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const nie=I2,rie=O2,iie=S2,sie=k2,oie=x2,aie=E2,cie=C2,uie=(t,e,n)=>{const r=new Map,i={platform:W2,...n},s={...i.platform,_c:r};return w2(t,e,{...i,platform:s})};var ov=xm,Z2=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],pp=function(){};function Y2(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function K2(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var s=[].concat(r);if(e&&t)for(var o in e)e.hasOwnProperty(o)&&e[o]&&s.push("".concat(Y2(t,o)));return s.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var tE=function(e){return sF(e)?e.filter(Boolean):Da(e)==="object"&&e!==null?[e]:[]},RI=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=Js(e,Z2);return it({},n)},xn=function(e,n,r){var i=e.cx,s=e.getStyles,o=e.getClassNames,a=e.className;return{css:s(n,e),className:i(r??{},o(n,e),a)}};function Bm(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function J2(t){return Bm(t)?window.innerHeight:t.clientHeight}function NI(t){return Bm(t)?window.pageYOffset:t.scrollTop}function mp(t,e){if(Bm(t)){window.scrollTo(0,e);return}t.scrollTop=e}function X2(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var i=t;i=i.parentElement;)if(e=getComputedStyle(i),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.documentElement}function Q2(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function Wf(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:pp,i=NI(t),s=e-i,o=10,a=0;function c(){a+=o;var u=Q2(a,i,s,n);mp(t,u),a<n?window.requestAnimationFrame(c):r(t)}c()}function nE(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.offsetHeight/3;r.bottom+i>n.bottom?mp(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+i,t.scrollHeight)):r.top-i<n.top&&mp(t,Math.max(e.offsetTop-i,0))}function eF(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function rE(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function tF(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var AI=!1,nF={get passive(){return AI=!0}},qf=typeof window<"u"?window:{};qf.addEventListener&&qf.removeEventListener&&(qf.addEventListener("p",pp,nF),qf.removeEventListener("p",pp,!1));var rF=AI;function iF(t){return t!=null}function sF(t){return Array.isArray(t)}function Gf(t,e,n){return t?e:n}var oF=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=Object.entries(e).filter(function(o){var a=Fs(o,1),c=a[0];return!r.includes(c)});return s.reduce(function(o,a){var c=Fs(a,2),u=c[0],l=c[1];return o[u]=l,o},{})},aF=["children","innerProps"],cF=["children","innerProps"];function uF(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,i=t.placement,s=t.shouldScroll,o=t.isFixedPosition,a=t.controlHeight,c=X2(n),u={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return u;var l=c.getBoundingClientRect(),d=l.height,f=n.getBoundingClientRect(),h=f.bottom,m=f.height,p=f.top,g=n.offsetParent.getBoundingClientRect(),y=g.top,v=o?window.innerHeight:J2(c),b=NI(c),E=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),x=y-w,_=v-p,k=x+b,R=d-b-p,F=h-v+b+E,V=b+p-w,T=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:e};if(R>=m&&!o)return s&&Wf(c,F,T),{placement:"bottom",maxHeight:e};if(!o&&R>=r||o&&_>=r){s&&Wf(c,F,T);var L=o?_-E:R-E;return{placement:"bottom",maxHeight:L}}if(i==="auto"||o){var S=e,C=o?x:k;return C>=r&&(S=Math.min(C-E-a,e)),{placement:"top",maxHeight:S}}if(i==="bottom")return s&&mp(c,F),{placement:"bottom",maxHeight:e};break;case"top":if(x>=m)return{placement:"top",maxHeight:e};if(k>=m&&!o)return s&&Wf(c,V,T),{placement:"top",maxHeight:e};if(!o&&k>=r||o&&x>=r){var N=e;return(!o&&k>=r||o&&x>=r)&&(N=o?x-w:k-w),s&&Wf(c,V,T),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function lF(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var PI=function(e){return e==="auto"?"bottom":e},dF=function(e,n){var r,i=e.placement,s=e.theme,o=s.borderRadius,a=s.spacing,c=s.colors;return it((r={label:"menu"},_l(r,lF(i),"100%"),_l(r,"position","absolute"),_l(r,"width","100%"),_l(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},MI=Fu(null),fF=function(e){var n=e.children,r=e.minMenuHeight,i=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,a=e.menuShouldScrollIntoView,c=e.theme,u=Yo(MI)||{},l=u.setPortalPlacement,d=qt(null),f=We(i),h=Fs(f,2),m=h[0],p=h[1],g=We(null),y=Fs(g,2),v=y[0],b=y[1],E=c.spacing.controlHeight;return ov(function(){var w=d.current;if(w){var x=o==="fixed",_=a&&!x,k=uF({maxHeight:i,menuEl:w,minHeight:r,placement:s,shouldScroll:_,isFixedPosition:x,controlHeight:E});p(k.maxHeight),b(k.placement),l==null||l(k.placement)}},[i,s,o,a,r,l,E]),n({ref:d,placerProps:it(it({},e),{},{placement:v||PI(s),maxHeight:m})})},hF=function(e){var n=e.children,r=e.innerRef,i=e.innerProps;return tt("div",st({},xn(e,"menu",{menu:!0}),{ref:r},i),n)},pF=hF,mF=function(e,n){var r=e.maxHeight,i=e.theme.spacing.baseUnit;return it({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},gF=function(e){var n=e.children,r=e.innerProps,i=e.innerRef,s=e.isMulti;return tt("div",st({},xn(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:i},r),n)},LI=function(e,n){var r=e.theme,i=r.spacing.baseUnit,s=r.colors;return it({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},yF=LI,vF=LI,bF=function(e){var n=e.children,r=n===void 0?"No options":n,i=e.innerProps,s=Js(e,aF);return tt("div",st({},xn(it(it({},s),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},_F=function(e){var n=e.children,r=n===void 0?"Loading...":n,i=e.innerProps,s=Js(e,cF);return tt("div",st({},xn(it(it({},s),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},wF=function(e){var n=e.rect,r=e.offset,i=e.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},EF=function(e){var n=e.appendTo,r=e.children,i=e.controlElement,s=e.innerProps,o=e.menuPlacement,a=e.menuPosition,c=qt(null),u=qt(null),l=We(PI(o)),d=Fs(l,2),f=d[0],h=d[1],m=Pn(function(){return{setPortalPlacement:h}},[]),p=We(null),g=Fs(p,2),y=g[0],v=g[1],b=He(function(){if(i){var _=eF(i),k=a==="fixed"?0:window.pageYOffset,R=_[f]+k;(R!==(y==null?void 0:y.offset)||_.left!==(y==null?void 0:y.rect.left)||_.width!==(y==null?void 0:y.rect.width))&&v({offset:R,rect:_})}},[i,a,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);ov(function(){b()},[b]);var E=He(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&c.current&&(u.current=G2(i,c.current,b,{elementResize:"ResizeObserver"in window}))},[i,b]);ov(function(){E()},[E]);var w=He(function(_){c.current=_,E()},[E]);if(!n&&a!=="fixed"||!y)return null;var x=tt("div",st({ref:w},xn(it(it({},e),{},{offset:y.offset,position:a,rect:y.rect}),"menuPortal",{"menu-portal":!0}),s),r);return tt(MI.Provider,{value:m},n?CP(x,n):x)},SF=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},xF=function(e){var n=e.children,r=e.innerProps,i=e.isDisabled,s=e.isRtl;return tt("div",st({},xn(e,"container",{"--is-disabled":i,"--is-rtl":s}),r),n)},TF=function(e,n){var r=e.theme.spacing,i=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return it({alignItems:"center",display:i&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},IF=function(e){var n=e.children,r=e.innerProps,i=e.isMulti,s=e.hasValue;return tt("div",st({},xn(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":s}),r),n)},OF=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},CF=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"indicatorsContainer",{indicators:!0}),r),n)},iE,kF=["size"],DF=["innerProps","isRtl","size"],RF={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},FI=function(e){var n=e.size,r=Js(e,kF);return tt("svg",st({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:RF},r))},i_=function(e){return tt(FI,st({size:20},e),tt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},$I=function(e){return tt(FI,st({size:20},e),tt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},jI=function(e,n){var r=e.isFocused,i=e.theme,s=i.spacing.baseUnit,o=i.colors;return it({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:s*2,":hover":{color:r?o.neutral80:o.neutral40}})},NF=jI,AF=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||tt($I,null))},PF=jI,MF=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||tt(i_,null))},LF=function(e,n){var r=e.isDisabled,i=e.theme,s=i.spacing.baseUnit,o=i.colors;return it({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},FF=function(e){var n=e.innerProps;return tt("span",st({},n,xn(e,"indicatorSeparator",{"indicator-separator":!0})))},$F=d2(iE||(iE=f2([`
|
|
12
|
-
0%, 80%, 100% { opacity: 0; }
|
|
13
|
-
40% { opacity: 1; }
|
|
14
|
-
`]))),jF=function(e,n){var r=e.isFocused,i=e.size,s=e.theme,o=s.colors,a=s.spacing.baseUnit;return it({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2})},Wg=function(e){var n=e.delay,r=e.offset;return tt("span",{css:Kb({animation:"".concat($F," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},UF=function(e){var n=e.innerProps,r=e.isRtl,i=e.size,s=i===void 0?4:i,o=Js(e,DF);return tt("div",st({},xn(it(it({},o),{},{innerProps:n,isRtl:r,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),tt(Wg,{delay:0,offset:r}),tt(Wg,{delay:160,offset:!0}),tt(Wg,{delay:320,offset:!r}))},BF=function(e,n){var r=e.isDisabled,i=e.isFocused,s=e.theme,o=s.colors,a=s.borderRadius,c=s.spacing;return it({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:i?o.primary:o.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},zF=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,s=e.innerRef,o=e.innerProps,a=e.menuIsOpen;return tt("div",st({ref:s},xn(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),o,{"aria-disabled":r||void 0}),n)},VF=zF,HF=["data"],WF=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},qF=function(e){var n=e.children,r=e.cx,i=e.getStyles,s=e.getClassNames,o=e.Heading,a=e.headingProps,c=e.innerProps,u=e.label,l=e.theme,d=e.selectProps;return tt("div",st({},xn(e,"group",{group:!0}),c),tt(o,st({},a,{selectProps:d,theme:l,getStyles:i,getClassNames:s,cx:r}),u),tt("div",null,n))},GF=function(e,n){var r=e.theme,i=r.colors,s=r.spacing;return it({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},ZF=function(e){var n=RI(e);n.data;var r=Js(n,HF);return tt("div",st({},xn(e,"groupHeading",{"group-heading":!0}),r))},YF=qF,KF=["innerRef","isDisabled","isHidden","inputClassName"],JF=function(e,n){var r=e.isDisabled,i=e.value,s=e.theme,o=s.spacing,a=s.colors;return it(it({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},XF),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:a.neutral80})},UI={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},XF={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":it({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},UI)},QF=function(e){return it({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},UI)},e$=function(e){var n=e.cx,r=e.value,i=RI(e),s=i.innerRef,o=i.isDisabled,a=i.isHidden,c=i.inputClassName,u=Js(i,KF);return tt("div",st({},xn(e,"input",{"input-container":!0}),{"data-value":r||""}),tt("input",st({className:n({input:!0},c),ref:s,style:QF(a),disabled:o},u)))},t$=e$,n$=function(e,n){var r=e.theme,i=r.spacing,s=r.borderRadius,o=r.colors;return it({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:i.baseUnit/2})},r$=function(e,n){var r=e.theme,i=r.borderRadius,s=r.colors,o=e.cropWithEllipsis;return it({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},i$=function(e,n){var r=e.theme,i=r.spacing,s=r.borderRadius,o=r.colors,a=e.isFocused;return it({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:a?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},BI=function(e){var n=e.children,r=e.innerProps;return tt("div",r,n)},s$=BI,o$=BI;function a$(t){var e=t.children,n=t.innerProps;return tt("div",st({role:"button"},n),e||tt(i_,{size:14}))}var c$=function(e){var n=e.children,r=e.components,i=e.data,s=e.innerProps,o=e.isDisabled,a=e.removeProps,c=e.selectProps,u=r.Container,l=r.Label,d=r.Remove;return tt(u,{data:i,innerProps:it(it({},xn(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:c},tt(l,{data:i,innerProps:it({},xn(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),tt(d,{data:i,innerProps:it(it({},xn(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:c}))},u$=c$,l$=function(e,n){var r=e.isDisabled,i=e.isFocused,s=e.isSelected,o=e.theme,a=o.spacing,c=o.colors;return it({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:s?c.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:s?c.primary:c.primary50}})},d$=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,s=e.isSelected,o=e.innerRef,a=e.innerProps;return tt("div",st({},xn(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":s}),{ref:o,"aria-disabled":r},a),n)},f$=d$,h$=function(e,n){var r=e.theme,i=r.spacing,s=r.colors;return it({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},p$=function(e){var n=e.children,r=e.innerProps;return tt("div",st({},xn(e,"placeholder",{placeholder:!0}),r),n)},m$=p$,g$=function(e,n){var r=e.isDisabled,i=e.theme,s=i.spacing,o=i.colors;return it({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},y$=function(e){var n=e.children,r=e.isDisabled,i=e.innerProps;return tt("div",st({},xn(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},v$=y$,zm={ClearIndicator:MF,Control:VF,DropdownIndicator:AF,DownChevron:$I,CrossIcon:i_,Group:YF,GroupHeading:ZF,IndicatorsContainer:CF,IndicatorSeparator:FF,Input:t$,LoadingIndicator:UF,Menu:pF,MenuList:gF,MenuPortal:EF,LoadingMessage:_F,NoOptionsMessage:bF,MultiValue:u$,MultiValueContainer:s$,MultiValueLabel:o$,MultiValueRemove:a$,Option:f$,Placeholder:m$,SelectContainer:xF,SingleValue:v$,ValueContainer:IF},b$=function(e){return it(it({},zm),e.components)},sE=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function _$(t,e){return!!(t===e||sE(t)&&sE(e))}function w$(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!_$(t[n],e[n]))return!1;return!0}function E$(t,e){e===void 0&&(e=w$);var n=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(n&&n.lastThis===this&&e(i,n.lastArgs))return n.lastResult;var o=t.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}var S$={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},x$=function(e){return tt("span",st({css:S$},e))},oE=x$,T$={guidance:function(e){var n=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,s=e.context,o=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,i=r===void 0?"":r,s=e.labels,o=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,i=e.options,s=e.label,o=s===void 0?"":s,a=e.selectValue,c=e.isDisabled,u=e.isSelected,l=e.isAppleDevice,d=function(p,g){return p&&p.length?"".concat(p.indexOf(g)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(o," focused, ").concat(d(a,r),".");if(n==="menu"&&l){var f=c?" disabled":"",h="".concat(u?" selected":"").concat(f);return"".concat(o).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},I$=function(e){var n=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,s=e.focusableOptions,o=e.isFocused,a=e.selectValue,c=e.selectProps,u=e.id,l=e.isAppleDevice,d=c.ariaLiveMessages,f=c.getOptionLabel,h=c.inputValue,m=c.isMulti,p=c.isOptionDisabled,g=c.isSearchable,y=c.menuIsOpen,v=c.options,b=c.screenReaderStatus,E=c.tabSelectsValue,w=c.isLoading,x=c["aria-label"],_=c["aria-live"],k=Pn(function(){return it(it({},T$),d||{})},[d]),R=Pn(function(){var C="";if(n&&k.onChange){var N=n.option,U=n.options,K=n.removedValue,$=n.removedValues,q=n.value,j=function(ve){return Array.isArray(ve)?null:ve},D=K||N||j(q),X=D?f(D):"",Z=U||$||void 0,z=Z?Z.map(f):[],le=it({isDisabled:D&&p(D,a),label:X,labels:z},n);C=k.onChange(le)}return C},[n,k,p,a,f]),F=Pn(function(){var C="",N=r||i,U=!!(r&&a&&a.includes(r));if(N&&k.onFocus){var K={focused:N,label:f(N),isDisabled:p(N,a),isSelected:U,options:s,context:N===r?"menu":"value",selectValue:a,isAppleDevice:l};C=k.onFocus(K)}return C},[r,i,f,p,k,s,a,l]),V=Pn(function(){var C="";if(y&&v.length&&!w&&k.onFilter){var N=b({count:s.length});C=k.onFilter({inputValue:h,resultsMessage:N})}return C},[s,h,y,k,v,b,w]),T=(n==null?void 0:n.action)==="initial-input-focus",L=Pn(function(){var C="";if(k.guidance){var N=i?"value":y?"menu":"input";C=k.guidance({"aria-label":x,context:N,isDisabled:r&&p(r,a),isMulti:m,isSearchable:g,tabSelectsValue:E,isInitialFocus:T})}return C},[x,r,i,m,p,g,y,k,a,E,T]),S=tt(Yy,null,tt("span",{id:"aria-selection"},R),tt("span",{id:"aria-focused"},F),tt("span",{id:"aria-results"},V),tt("span",{id:"aria-guidance"},L));return tt(Yy,null,tt(oE,{id:u},T&&S),tt(oE,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!T&&S))},O$=I$,av=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],C$=new RegExp("["+av.map(function(t){return t.letters}).join("")+"]","g"),zI={};for(var qg=0;qg<av.length;qg++)for(var Gg=av[qg],Zg=0;Zg<Gg.letters.length;Zg++)zI[Gg.letters[Zg]]=Gg.base;var VI=function(e){return e.replace(C$,function(n){return zI[n]})},k$=E$(VI),aE=function(e){return e.replace(/^\s+|\s+$/g,"")},D$=function(e){return"".concat(e.label," ").concat(e.value)},R$=function(e){return function(n,r){if(n.data.__isNew__)return!0;var i=it({ignoreCase:!0,ignoreAccents:!0,stringify:D$,trim:!0,matchFrom:"any"},e),s=i.ignoreCase,o=i.ignoreAccents,a=i.stringify,c=i.trim,u=i.matchFrom,l=c?aE(r):r,d=c?aE(a(n)):a(n);return s&&(l=l.toLowerCase(),d=d.toLowerCase()),o&&(l=k$(l),d=VI(d)),u==="start"?d.substr(0,l.length)===l:d.indexOf(l)>-1}},N$=["innerRef"];function A$(t){var e=t.innerRef,n=Js(t,N$),r=oF(n,"onExited","in","enter","exit","appear");return tt("input",st({ref:e},r,{css:Kb({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var P$=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function M$(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,i=t.onTopArrive,s=t.onTopLeave,o=qt(!1),a=qt(!1),c=qt(0),u=qt(null),l=He(function(g,y){if(u.current!==null){var v=u.current,b=v.scrollTop,E=v.scrollHeight,w=v.clientHeight,x=u.current,_=y>0,k=E-w-b,R=!1;k>y&&o.current&&(r&&r(g),o.current=!1),_&&a.current&&(s&&s(g),a.current=!1),_&&y>k?(n&&!o.current&&n(g),x.scrollTop=E,R=!0,o.current=!0):!_&&-y>b&&(i&&!a.current&&i(g),x.scrollTop=0,R=!0,a.current=!0),R&&P$(g)}},[n,r,i,s]),d=He(function(g){l(g,g.deltaY)},[l]),f=He(function(g){c.current=g.changedTouches[0].clientY},[]),h=He(function(g){var y=c.current-g.changedTouches[0].clientY;l(g,y)},[l]),m=He(function(g){if(g){var y=rF?{passive:!1}:!1;g.addEventListener("wheel",d,y),g.addEventListener("touchstart",f,y),g.addEventListener("touchmove",h,y)}},[h,f,d]),p=He(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",h,!1))},[h,f,d]);return Dt(function(){if(e){var g=u.current;return m(g),function(){p(g)}}},[e,m,p]),function(g){u.current=g}}var cE=["boxSizing","height","overflow","paddingRight","position"],uE={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function lE(t){t.cancelable&&t.preventDefault()}function dE(t){t.stopPropagation()}function fE(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function hE(){return"ontouchstart"in window||navigator.maxTouchPoints}var pE=!!(typeof window<"u"&&window.document&&window.document.createElement),al=0,vc={capture:!1,passive:!1};function L$(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,i=qt({}),s=qt(null),o=He(function(c){if(pE){var u=document.body,l=u&&u.style;if(r&&cE.forEach(function(m){var p=l&&l[m];i.current[m]=p}),r&&al<1){var d=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(uE).forEach(function(m){var p=uE[m];l&&(l[m]=p)}),l&&(l.paddingRight="".concat(h,"px"))}u&&hE()&&(u.addEventListener("touchmove",lE,vc),c&&(c.addEventListener("touchstart",fE,vc),c.addEventListener("touchmove",dE,vc))),al+=1}},[r]),a=He(function(c){if(pE){var u=document.body,l=u&&u.style;al=Math.max(al-1,0),r&&al<1&&cE.forEach(function(d){var f=i.current[d];l&&(l[d]=f)}),u&&hE()&&(u.removeEventListener("touchmove",lE,vc),c&&(c.removeEventListener("touchstart",fE,vc),c.removeEventListener("touchmove",dE,vc)))}},[r]);return Dt(function(){if(e){var c=s.current;return o(c),function(){a(c)}}},[e,o,a]),function(c){s.current=c}}var F$=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},$$={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function j$(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,i=r===void 0?!0:r,s=t.onBottomArrive,o=t.onBottomLeave,a=t.onTopArrive,c=t.onTopLeave,u=M$({isEnabled:i,onBottomArrive:s,onBottomLeave:o,onTopArrive:a,onTopLeave:c}),l=L$({isEnabled:n}),d=function(h){u(h),l(h)};return tt(Yy,null,n&&tt("div",{onClick:F$,css:$$}),e(d))}var U$={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},B$=function(e){var n=e.name,r=e.onFocus;return tt("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:U$,value:"",onChange:function(){}})},z$=B$;function s_(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function V$(){return s_(/^iPhone/i)}function HI(){return s_(/^Mac/i)}function H$(){return s_(/^iPad/i)||HI()&&navigator.maxTouchPoints>1}function W$(){return V$()||H$()}function q$(){return HI()||W$()}var G$=function(e){return e.label},Z$=function(e){return e.label},Y$=function(e){return e.value},K$=function(e){return!!e.isDisabled},J$={clearIndicator:PF,container:SF,control:BF,dropdownIndicator:NF,group:WF,groupHeading:GF,indicatorsContainer:OF,indicatorSeparator:LF,input:JF,loadingIndicator:jF,loadingMessage:vF,menu:dF,menuList:mF,menuPortal:wF,multiValue:n$,multiValueLabel:r$,multiValueRemove:i$,noOptionsMessage:yF,option:l$,placeholder:h$,singleValue:g$,valueContainer:TF},X$={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Q$=4,WI=4,ej=38,tj=WI*2,nj={baseUnit:WI,controlHeight:ej,menuGutter:tj},Yg={borderRadius:Q$,colors:X$,spacing:nj},rj={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:rE(),captureMenuScroll:!rE(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:R$(),formatGroupLabel:G$,getOptionLabel:Z$,getOptionValue:Y$,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:K$,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!tF(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function mE(t,e,n,r){var i=ZI(t,e,n),s=YI(t,e,n),o=GI(t,e),a=gp(t,e);return{type:"option",data:e,isDisabled:i,isSelected:s,label:o,value:a,index:r}}function Fh(t,e){return t.options.map(function(n,r){if("options"in n){var i=n.options.map(function(o,a){return mE(t,o,e,a)}).filter(function(o){return yE(t,o)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var s=mE(t,n,e,r);return yE(t,s)?s:void 0}).filter(iF)}function qI(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,zb(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function gE(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,zb(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function ij(t,e){return qI(Fh(t,e))}function yE(t,e){var n=t.inputValue,r=n===void 0?"":n,i=e.data,s=e.isSelected,o=e.label,a=e.value;return(!JI(t)||!s)&&KI(t,{label:o,value:a,data:i},r)}function sj(t,e){var n=t.focusedValue,r=t.selectValue,i=r.indexOf(n);if(i>-1){var s=e.indexOf(n);if(s>-1)return n;if(i<e.length)return e[i]}return null}function oj(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var Kg=function(e,n){var r,i=(r=e.find(function(s){return s.data===n}))===null||r===void 0?void 0:r.id;return i||null},GI=function(e,n){return e.getOptionLabel(n)},gp=function(e,n){return e.getOptionValue(n)};function ZI(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function YI(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=gp(t,e);return n.some(function(i){return gp(t,i)===r})}function KI(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var JI=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},aj=1,XI=function(t){rL(n,t);var e=oL(n);function n(r){var i;if(tL(this,n),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=q$(),i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,u){var l=i.props,d=l.onChange,f=l.name;u.name=f,i.ariaOnChange(c,u),d(c,u)},i.setValue=function(c,u,l){var d=i.props,f=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:u,option:l})},i.selectOption=function(c){var u=i.props,l=u.blurInputOnSelect,d=u.isMulti,f=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(c,h),p=i.isOptionDisabled(c,h);if(m){var g=i.getOptionValue(c);i.setValue(h.filter(function(y){return i.getOptionValue(y)!==g}),"deselect-option",c)}else if(!p)d?i.setValue([].concat(zb(h),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:f});return}l&&i.blurInput()},i.removeValue=function(c){var u=i.props.isMulti,l=i.state.selectValue,d=i.getOptionValue(c),f=l.filter(function(m){return i.getOptionValue(m)!==d}),h=Gf(u,f,f[0]||null);i.onChange(h,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(Gf(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,u=i.state.selectValue,l=u[u.length-1],d=u.slice(0,u.length-1),f=Gf(c,d,d[0]||null);l&&i.onChange(f,{action:"pop-value",removedValue:l})},i.getFocusedOptionId=function(c){return Kg(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return gE(Fh(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];return K2.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(c){return GI(i.props,c)},i.getOptionValue=function(c){return gp(i.props,c)},i.getStyles=function(c,u){var l=i.props.unstyled,d=J$[c](u,l);d.boxSizing="border-box";var f=i.props.styles[c];return f?f(d,u):d},i.getClassNames=function(c,u){var l,d;return(l=(d=i.props.classNames)[c])===null||l===void 0?void 0:l.call(d,u)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return b$(i.props)},i.buildCategorizedOptions=function(){return Fh(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return qI(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,u){i.setState({ariaSelection:it({value:c},u)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var u=i.props,l=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!l}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&Bm(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var u=c.touches,l=u&&u.item(0);l&&(i.initialTouchX=l.clientX,i.initialTouchY=l.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var u=c.touches,l=u&&u.item(0);if(l){var d=Math.abs(l.clientX-i.initialTouchX),f=Math.abs(l.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||f>h}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var u=i.props.inputValue,l=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(l,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var u=i.getFocusableOptions(),l=u.indexOf(c);i.setState({focusedOption:c,focusedOptionId:l>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return JI(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var u=i.props,l=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,g=u.menuIsOpen,y=u.onKeyDown,v=u.tabSelectsValue,b=u.openMenuOnFocus,E=i.state,w=E.focusedOption,x=E.focusedValue,_=E.selectValue;if(!p&&!(typeof y=="function"&&(y(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!l||h)return;i.focusValue("previous");break;case"ArrowRight":if(!l||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)i.removeValue(x);else{if(!d)return;l?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!g||!v||!w||b&&i.isOptionSelected(w,_))return;i.selectOption(w);break;case"Enter":if(c.keyCode===229)break;if(g){if(!w||i.isComposing)return;i.selectOption(w);break}return;case"Escape":g?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&f&&i.clearValue();break;case" ":if(h)return;if(!g){i.openMenu("first");break}if(!w)return;i.selectOption(w);break;case"ArrowUp":g?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":g?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!g)return;i.focusOption("pageup");break;case"PageDown":if(!g)return;i.focusOption("pagedown");break;case"Home":if(!g)return;i.focusOption("first");break;case"End":if(!g)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++aj),i.state.selectValue=tE(r.value),r.menuIsOpen&&i.state.selectValue.length){var s=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),a=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=s,i.state.focusedOption=o[a],i.state.focusedOptionId=Kg(s,o[a])}return i}return nL(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&nE(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isDisabled,a=s.menuIsOpen,c=this.state.isFocused;(c&&!o&&i.isDisabled||c&&a&&!i.menuIsOpen)&&this.focusInput(),c&&o&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!o&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(nE(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,s){this.props.onInputChange(i,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var s=this,o=this.state,a=o.selectValue,c=o.isFocused,u=this.buildFocusableOptions(),l=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(l=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[l],focusedOptionId:this.getFocusedOptionId(u[l])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(i){var s=this.state,o=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=o.indexOf(a);a||(c=-1);var u=o.length-1,l=-1;if(o.length){switch(i){case"previous":c===0?l=0:c===-1?l=u:l=c-1;break;case"next":c>-1&&c<u&&(l=c+1);break}this.setState({inputIsHidden:l!==-1,focusedValue:o[l]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var c=0,u=a.indexOf(o);o||(u=-1),i==="up"?c=u>0?u-1:a.length-1:i==="down"?c=(u+1)%a.length:i==="pageup"?(c=u-s,c<0&&(c=0)):i==="pagedown"?(c=u+s,c>a.length-1&&(c=a.length-1)):i==="last"&&(c=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Yg):it(it({},Yg),this.props.theme):Yg}},{key:"getCommonProps",value:function(){var i=this.clearValue,s=this.cx,o=this.getStyles,a=this.getClassNames,c=this.getValue,u=this.selectOption,l=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:s,getStyles:o,getClassNames:a,getValue:c,hasValue:p,isMulti:f,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:l,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,s=i.isClearable,o=i.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(i,s){return ZI(this.props,i,s)}},{key:"isOptionSelected",value:function(i,s){return YI(this.props,i,s)}},{key:"filterOption",value:function(i,s){return KI(this.props,i,s)}},{key:"formatOptionLabel",value:function(i,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:s,inputValue:o,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,s=i.isDisabled,o=i.isSearchable,a=i.inputId,c=i.inputValue,u=i.tabIndex,l=i.form,d=i.menuIsOpen,f=i.required,h=this.getComponents(),m=h.Input,p=this.state,g=p.inputIsHidden,y=p.ariaSelection,v=this.commonProps,b=a||this.getElementId("input"),E=it(it(it({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(y==null?void 0:y.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?Y.createElement(m,st({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:b,innerRef:this.getInputRef,isDisabled:s,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:l,type:"text",value:c},E)):Y.createElement(A$,st({id:b,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:pp,onFocus:this.onInputFocus,disabled:s,tabIndex:u,inputMode:"none",form:l,value:""},E))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,s=this.getComponents(),o=s.MultiValue,a=s.MultiValueContainer,c=s.MultiValueLabel,u=s.MultiValueRemove,l=s.SingleValue,d=s.Placeholder,f=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,g=h.isMulti,y=h.inputValue,v=h.placeholder,b=this.state,E=b.selectValue,w=b.focusedValue,x=b.isFocused;if(!this.hasValue()||!m)return y?null:Y.createElement(d,st({},f,{key:"placeholder",isDisabled:p,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),v);if(g)return E.map(function(k,R){var F=k===w,V="".concat(i.getOptionLabel(k),"-").concat(i.getOptionValue(k));return Y.createElement(o,st({},f,{components:{Container:a,Label:c,Remove:u},isFocused:F,isDisabled:p,key:V,index:R,removeProps:{onClick:function(){return i.removeValue(k)},onTouchEnd:function(){return i.removeValue(k)},onMouseDown:function(L){L.preventDefault()}},data:k}),i.formatOptionLabel(k,"value"))});if(y)return null;var _=E[0];return Y.createElement(l,st({},f,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),s=i.ClearIndicator,o=this.commonProps,a=this.props,c=a.isDisabled,u=a.isLoading,l=this.state.isFocused;if(!this.isClearable()||!s||c||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,st({},o,{innerProps:d,isFocused:l}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),s=i.LoadingIndicator,o=this.commonProps,a=this.props,c=a.isDisabled,u=a.isLoading,l=this.state.isFocused;if(!s||!u)return null;var d={"aria-hidden":"true"};return Y.createElement(s,st({},o,{innerProps:d,isDisabled:c,isFocused:l}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator,o=i.IndicatorSeparator;if(!s||!o)return null;var a=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return Y.createElement(o,st({},a,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator;if(!s)return null;var o=this.commonProps,a=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,st({},o,{innerProps:u,isDisabled:a,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,s=this.getComponents(),o=s.Group,a=s.GroupHeading,c=s.Menu,u=s.MenuList,l=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,h=s.Option,m=this.commonProps,p=this.state.focusedOption,g=this.props,y=g.captureMenuScroll,v=g.inputValue,b=g.isLoading,E=g.loadingMessage,w=g.minMenuHeight,x=g.maxMenuHeight,_=g.menuIsOpen,k=g.menuPlacement,R=g.menuPosition,F=g.menuPortalTarget,V=g.menuShouldBlockScroll,T=g.menuShouldScrollIntoView,L=g.noOptionsMessage,S=g.onMenuScrollToTop,C=g.onMenuScrollToBottom;if(!_)return null;var N=function(X,Z){var z=X.type,le=X.data,pe=X.isDisabled,ve=X.isSelected,je=X.label,ct=X.value,ut=p===le,Ye=pe?void 0:function(){return i.onOptionHover(le)},Ot=pe?void 0:function(){return i.selectOption(le)},O="".concat(i.getElementId("option"),"-").concat(Z),he={id:O,onClick:Ot,onMouseMove:Ye,onMouseOver:Ye,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:ve};return Y.createElement(h,st({},m,{innerProps:he,data:le,isDisabled:pe,isSelected:ve,key:O,label:je,type:z,value:ct,isFocused:ut,innerRef:ut?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(X.data,"menu"))},U;if(this.hasOptions())U=this.getCategorizedOptions().map(function(D){if(D.type==="group"){var X=D.data,Z=D.options,z=D.index,le="".concat(i.getElementId("group"),"-").concat(z),pe="".concat(le,"-heading");return Y.createElement(o,st({},m,{key:le,data:X,options:Z,Heading:a,headingProps:{id:pe,data:D.data},label:i.formatGroupLabel(D.data)}),D.options.map(function(ve){return N(ve,"".concat(z,"-").concat(ve.index))}))}else if(D.type==="option")return N(D,"".concat(D.index))});else if(b){var K=E({inputValue:v});if(K===null)return null;U=Y.createElement(d,m,K)}else{var $=L({inputValue:v});if($===null)return null;U=Y.createElement(f,m,$)}var q={minMenuHeight:w,maxMenuHeight:x,menuPlacement:k,menuPosition:R,menuShouldScrollIntoView:T},j=Y.createElement(fF,st({},m,q),function(D){var X=D.ref,Z=D.placerProps,z=Z.placement,le=Z.maxHeight;return Y.createElement(c,st({},m,q,{innerRef:X,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:b,placement:z}),Y.createElement(j$,{captureEnabled:y,onTopArrive:S,onBottomArrive:C,lockEnabled:V},function(pe){return Y.createElement(u,st({},m,{innerRef:function(je){i.getMenuListRef(je),pe(je)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:b,maxHeight:le,focusedOption:p}),U)}))});return F||R==="fixed"?Y.createElement(l,st({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:k,menuPosition:R}),j):j}},{key:"renderFormField",value:function(){var i=this,s=this.props,o=s.delimiter,a=s.isDisabled,c=s.isMulti,u=s.name,l=s.required,d=this.state.selectValue;if(l&&!this.hasValue()&&!a)return Y.createElement(z$,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(c)if(o){var f=d.map(function(p){return i.getOptionValue(p)}).join(o);return Y.createElement("input",{name:u,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(p,g){return Y.createElement("input",{key:"i-".concat(g),name:u,type:"hidden",value:i.getOptionValue(p)})}):Y.createElement("input",{name:u,type:"hidden",value:""});return Y.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return Y.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,s=this.state,o=s.ariaSelection,a=s.focusedOption,c=s.focusedValue,u=s.isFocused,l=s.selectValue,d=this.getFocusableOptions();return Y.createElement(O$,st({},i,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:a,focusedValue:c,isFocused:u,selectValue:l,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),s=i.Control,o=i.IndicatorsContainer,a=i.SelectContainer,c=i.ValueContainer,u=this.props,l=u.className,d=u.id,f=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return Y.createElement(a,st({},p,{className:l,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),Y.createElement(s,st({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:h}),Y.createElement(c,st({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),Y.createElement(o,st({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,s){var o=s.prevProps,a=s.clearFocusValueOnUpdate,c=s.inputIsHiddenAfterUpdate,u=s.ariaSelection,l=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,g=i.inputValue,y=i.isMulti,v=tE(m),b={};if(o&&(m!==o.value||h!==o.options||p!==o.menuIsOpen||g!==o.inputValue)){var E=p?ij(i,v):[],w=p?gE(Fh(i,v),"".concat(f,"-option")):[],x=a?sj(s,v):null,_=oj(s,E),k=Kg(w,_);b={selectValue:v,focusedOption:_,focusedOptionId:k,focusableOptionsWithIds:w,focusedValue:x,clearFocusValueOnUpdate:!1}}var R=c!=null&&i!==o?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},F=u,V=l&&d;return l&&!V&&(F={value:Gf(y,v,v[0]||null),options:v,action:"initial-input-focus"},V=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(F=null),it(it(it({},b),R),{},{prevProps:i,ariaSelection:F,prevWasFocused:V})}}]),n}(_P);XI.defaultProps=rj;var cj=ec(function(t,e){var n=eL(t);return Y.createElement(XI,st({ref:e},n))}),uj=cj;function lj(t){return P(zm.DropdownIndicator,{...t,children:P(vt,{name:"ChevronDown",size:16})})}function dj(t){return P(zm.ClearIndicator,{...t,children:P(vt,{name:"Xmark",size:16})})}function fj(t){const{label:e,onClick:n,...r}=t,i=!!e&&!!n;return Ee(zm.MenuList,{...r,children:[t.children,i?P("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:n,children:e}):null]})}function wl(t){const e=t["aria-invalid"]==="true",{addItemButtonProps:n,...r}=t;return P(uj,{...r,components:{DropdownIndicator:lj,ClearIndicator:dj,MenuList:i=>fj({...i,...n})},styles:{dropdownIndicator:()=>({label:"indicatorContainer",display:"flex",transition:"color 150ms",color:"var(--gray-900)",padding:8,boxSizing:"border-box"}),clearIndicator:i=>({...i,color:"var(--gray-900)"}),container:i=>({...i,borderColor:"var(--gray-200)",fontSize:12}),placeholder:i=>({...i,color:e?"var(--red-800)":"var(--gray-500)"}),control:()=>({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:32,outline:"0 !important",position:"relative",transition:"all 100ms",backgroundColor:"var(--white)",borderColor:e?"var(--red-900)":"var(--gray-200)",borderStyle:"solid",borderWidth:1,borderRadius:"6px",boxSizing:"border-box"}),option:(i,s)=>({...i,backgroundColor:s.isSelected?"var(--slate-50)":"var(--white)",color:"var(--gray-800)",":hover":{backgroundColor:"var(--slate-50)"}}),menuList:i=>({...i,padding:0,borderRadius:"6px"})},theme:i=>({...i,colors:{...i.colors,primary:"var(--slate-100)",primary25:"var(--slate-50)",primary50:"var(--slate-100)",primary75:"var(--slate-100)",danger:"var(--red-900)",dangerLight:"var(--red-100)",neutral0:"var(--white)",neutral5:"var(--gray-50)",neutral10:"var(--gray-100)",neutral20:"var(--gray-200)",neutral30:"var(--gray-300)",neutral40:"var(--gray-400)",neutral50:"var(--gray-500)",neutral60:"var(--gray-600)",neutral70:"var(--gray-700)",neutral80:"var(--gray-800)",neutral90:"var(--gray-900)"}})})}function ti(t,e){const{className:n,...r}=t;return{className:Bt(e,typeof n=="string"&&n),...r}}const zn=ec(function(t,e){const{color:n="dark",size:r="medium",className:i="",children:s,icon:o,iconPosition:a="left",...c}=t,u={small:"px-2 py-1.5 text-xs rounded-md font-medium",medium:"px-6 py-3 text-base rounded-xl font-semibold tracking-wide"},l=hf({light:"bg-gray-200 text-gray-600 hover:text-gray-700 hover:border-gray-300 active:border-slate-100 active:text-gray-600 disabled:text-gray-400",dark:"bg-gray-800 text-slate-50 hover:bg-slate-800 active:border-slate-700 disabled:bg-gray-300 disabled:text-slate-100",red:"bg-red-900 text-slate-50 hover:opacity-80 active:border-red-800 disabled:text-red-400 disabled:opacity-100",blue:"bg-blue-900 text-slate-50 hover:opacity-80 active:border-blue-800 disabled:text-blue-400 disabled:opacity-100"}[n],u[r]),d=Bt("flex items-center justify-center gap-2 border border-none outline-none transition disabled:cursor-not-allowed",l,i);return Ee("button",{className:d,ref:e,...c,children:[a==="left"&&o,s,a==="right"&&o]})}),hj=t=>{const{children:e,cookies:n,submitLabel:r,rejectLabel:i,onSubmit:s=()=>{},onReject:o=()=>{},...a}=t,[c,u]=We(n),l=f=>{const{id:h,checked:m}=f.target;u(p=>p.map(g=>g.id===h?{...g,value:m}:g))},d="min-w-64 h-8 text-base";return Ee("div",{...ti(a,"flex flex-col items-center"),children:[P("div",{className:"text-center",children:e}),P("div",{className:"my-8 flex gap-x-16 text-sm font-medium",children:c.map(f=>Ee("div",{className:"cursor-pointer",children:[P("input",{checked:f.value,className:"mr-1 size-3 cursor-pointer rounded-sm border-2 border-gray-900 accent-gray-900 focus:outline-none",id:f.id,onChange:l,type:"checkbox"}),P("label",{className:"cursor-pointer select-none",htmlFor:f.id,children:f.label})]},f.id))}),Ee("div",{className:"flex gap-x-8",children:[P(zn,{className:d,color:"light",onClick:()=>o(),size:"small",children:i}),P(zn,{className:d,onClick:()=>s(c),size:"small",children:r})]})]})};function gu(t){const{title:e,isOpen:n,onOpenChange:r,children:i,containerClassName:s,toggleClassName:o,contentClassName:a}=t;return Ee("div",{className:Bt(s),children:[Ee("div",{className:Bt("flex cursor-pointer justify-between text-gray-500",o),onClick:r,children:[P("h2",{className:" font-semibold text-inherit",children:e}),P(vt,{className:hf("transition",n?"":"-rotate-90"),size:16,name:"ChevronDown"})]}),P("div",{className:Bt("max-h-0 overflow-hidden transition-[max-height] duration-300 ease-in-out",n&&"max-h-screen",a),children:i})]})}function Ir(t){return P("div",{...t,className:Bt("h-px bg-gray-200",t.className)})}const Zf="DRIVE",lie="FOLDER",Gc="FILE",die="CREATE",fie="WRITE",hie="READ",pie="UI_NODE",o_="DUPLICATE",a_="NEW_FOLDER",Vm="RENAME",c_="DELETE",QI="SETTINGS",e1="REMOVE_TRIGGER",t1="ADD_TRIGGER",n1="ADD_INVALID_TRIGGER",mie=[a_,Vm,QI],gie=[Vm,c_,o_],yie=[a_,Vm,c_,o_],vie=[t1,e1,n1],pj=[{value:jb,icon:P(vt,{name:"Lock"}),description:"Only available to you"},{value:xP,icon:P(vt,{name:"People"}),description:"Only available to people in this drive"},{value:Ub,icon:P(vt,{name:"Globe"}),description:"Available to everyone",disabled:!0}],mj={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:P(vt,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:P(vt,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:P(vt,{name:"Drive"})}},gj={[t1]:{label:"Add Trigger",icon:P(vt,{className:"text-orange-900",name:"Plus"})},[e1]:{label:"Remove Trigger",icon:P(vt,{className:"text-orange-900",name:"Xmark"})},[n1]:{label:"Add Trigger",icon:P(vt,{className:"text-orange-900",name:"Exclamation"})}},yj={[o_]:{label:"Duplicate",icon:P(vt,{name:"FilesEarmark"})},[a_]:{label:"New Folder",icon:P(vt,{name:"FolderPlus"})},[Vm]:{label:"Rename",icon:P(vt,{name:"Pencil"})},[c_]:{label:"Delete",icon:P(vt,{name:"Trash"}),className:"text-red-900"},[QI]:{label:"Settings",icon:P(vt,{name:"Gear"})}},bie={...gj,...yj};function Do(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function vE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function r1(...t){return e=>{let n=!1;const r=t.map(i=>{const s=vE(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():vE(t[i],null)}}}}function rc(...t){return Y.useCallback(r1(...t),t)}function vj(t,e){const n=Y.createContext(e),r=s=>{const{children:o,...a}=s,c=Y.useMemo(()=>a,Object.values(a));return P(n.Provider,{value:c,children:o})};r.displayName=t+"Provider";function i(s){const o=Y.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function bj(t,e=[]){let n=[];function r(s,o){const a=Y.createContext(o),c=n.length;n=[...n,o];const u=d=>{var y;const{scope:f,children:h,...m}=d,p=((y=f==null?void 0:f[t])==null?void 0:y[c])||a,g=Y.useMemo(()=>m,Object.values(m));return P(p.Provider,{value:g,children:h})};u.displayName=s+"Provider";function l(d,f){var p;const h=((p=f==null?void 0:f[t])==null?void 0:p[c])||a,m=Y.useContext(h);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,l]}const i=()=>{const s=n.map(o=>Y.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return Y.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[r,_j(i,...e)]}function _j(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const d=c(s)[`__scope${u}`];return{...a,...d}},{});return Y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Na(t){const e=Y.useRef(t);return Y.useEffect(()=>{e.current=t}),Y.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function wj({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=Ej({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,a=Na(n),c=Y.useCallback(u=>{if(s){const d=typeof u=="function"?u(t):u;d!==t&&a(d)}else i(u)},[s,t,i,a]);return[o,c]}function Ej({defaultProp:t,onChange:e}){const n=Y.useState(t),[r]=n,i=Y.useRef(r),s=Na(e);return Y.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var u_=Y.forwardRef((t,e)=>{const{children:n,...r}=t,i=Y.Children.toArray(n),s=i.find(xj);if(s){const o=s.props.children,a=i.map(c=>c===s?Y.Children.count(o)>1?Y.Children.only(null):Y.isValidElement(o)?o.props.children:null:c);return P(cv,{...r,ref:e,children:Y.isValidElement(o)?Y.cloneElement(o,void 0,a):null})}return P(cv,{...r,ref:e,children:n})});u_.displayName="Slot";var cv=Y.forwardRef((t,e)=>{const{children:n,...r}=t;if(Y.isValidElement(n)){const i=Ij(n);return Y.cloneElement(n,{...Tj(r,n.props),ref:e?r1(e,i):i})}return Y.Children.count(n)>1?Y.Children.only(null):null});cv.displayName="SlotClone";var Sj=({children:t})=>P(Us,{children:t});function xj(t){return Y.isValidElement(t)&&t.type===Sj}function Tj(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function Ij(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Oj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ps=Oj.reduce((t,e)=>{const n=Y.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?u_:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P(a,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Cj(t,e){t&&IP.flushSync(()=>t.dispatchEvent(e))}function kj(t,e=globalThis==null?void 0:globalThis.document){const n=Na(t);Y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Dj="DismissableLayer",uv="dismissableLayer.update",Rj="dismissableLayer.pointerDownOutside",Nj="dismissableLayer.focusOutside",bE,i1=Y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),s1=Y.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,u=Y.useContext(i1),[l,d]=Y.useState(null),f=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=Y.useState({}),m=rc(e,_=>d(_)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(g),v=l?p.indexOf(l):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,w=Mj(_=>{const k=_.target,R=[...u.branches].some(F=>F.contains(k));!E||R||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},f),x=Lj(_=>{const k=_.target;[...u.branches].some(F=>F.contains(k))||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},f);return kj(_=>{v===u.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},f),Y.useEffect(()=>{if(l)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(bE=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(l)),u.layers.add(l),_E(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=bE)}},[l,f,n,u]),Y.useEffect(()=>()=>{l&&(u.layers.delete(l),u.layersWithOutsidePointerEventsDisabled.delete(l),_E())},[l,u]),Y.useEffect(()=>{const _=()=>h({});return document.addEventListener(uv,_),()=>document.removeEventListener(uv,_)},[]),P(ps.div,{...c,ref:m,style:{pointerEvents:b?E?"auto":"none":void 0,...t.style},onFocusCapture:Do(t.onFocusCapture,x.onFocusCapture),onBlurCapture:Do(t.onBlurCapture,x.onBlurCapture),onPointerDownCapture:Do(t.onPointerDownCapture,w.onPointerDownCapture)})});s1.displayName=Dj;var Aj="DismissableLayerBranch",Pj=Y.forwardRef((t,e)=>{const n=Y.useContext(i1),r=Y.useRef(null),i=rc(e,r);return Y.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),P(ps.div,{...t,ref:i})});Pj.displayName=Aj;function Mj(t,e=globalThis==null?void 0:globalThis.document){const n=Na(t),r=Y.useRef(!1),i=Y.useRef(()=>{});return Y.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){o1(Rj,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Lj(t,e=globalThis==null?void 0:globalThis.document){const n=Na(t),r=Y.useRef(!1);return Y.useEffect(()=>{const i=s=>{s.target&&!r.current&&o1(Nj,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _E(){const t=new CustomEvent(uv);document.dispatchEvent(t)}function o1(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Cj(i,s):i.dispatchEvent(s)}var Jg=0;function Fj(){Y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??wE()),document.body.insertAdjacentElement("beforeend",t[1]??wE()),Jg++,()=>{Jg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Jg--}},[])}function wE(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Xg="focusScope.autoFocusOnMount",Qg="focusScope.autoFocusOnUnmount",EE={bubbles:!1,cancelable:!0},$j="FocusScope",a1=Y.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=Y.useState(null),u=Na(i),l=Na(s),d=Y.useRef(null),f=rc(e,p=>c(p)),h=Y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Y.useEffect(()=>{if(r){let p=function(b){if(h.paused||!a)return;const E=b.target;a.contains(E)?d.current=E:uo(d.current,{select:!0})},g=function(b){if(h.paused||!a)return;const E=b.relatedTarget;E!==null&&(a.contains(E)||uo(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&uo(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,h.paused]),Y.useEffect(()=>{if(a){xE.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Xg,EE);a.addEventListener(Xg,u),a.dispatchEvent(y),y.defaultPrevented||(jj(Hj(c1(a)),{select:!0}),document.activeElement===p&&uo(a))}return()=>{a.removeEventListener(Xg,u),setTimeout(()=>{const y=new CustomEvent(Qg,EE);a.addEventListener(Qg,l),a.dispatchEvent(y),y.defaultPrevented||uo(p??document.body,{select:!0}),a.removeEventListener(Qg,l),xE.remove(h)},0)}}},[a,u,l,h]);const m=Y.useCallback(p=>{if(!n&&!r||h.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(g&&y){const v=p.currentTarget,[b,E]=Uj(v);b&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&uo(b,{select:!0})):p.shiftKey&&y===b&&(p.preventDefault(),n&&uo(E,{select:!0})):y===v&&p.preventDefault()}},[n,r,h.paused]);return P(ps.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});a1.displayName=$j;function jj(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(uo(r,{select:e}),document.activeElement!==n)return}function Uj(t){const e=c1(t),n=SE(e,t),r=SE(e.reverse(),t);return[n,r]}function c1(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function SE(t,e){for(const n of t)if(!Bj(n,{upTo:e}))return n}function Bj(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function zj(t){return t instanceof HTMLInputElement&&"select"in t}function uo(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&zj(t)&&e&&t.select()}}var xE=Vj();function Vj(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=TE(t,e),t.unshift(e)},remove(e){var n;t=TE(t,e),(n=t[0])==null||n.resume()}}}function TE(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Hj(t){return t.filter(e=>e.tagName!=="A")}var yp=globalThis!=null&&globalThis.document?Y.useLayoutEffect:()=>{},Wj=Y.useId||(()=>{}),qj=0;function ey(t){const[e,n]=Y.useState(Wj());return yp(()=>{t||n(r=>r??String(qj++))},[t]),t||(e?`radix-${e}`:"")}var Gj="Portal",u1=Y.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=Y.useState(!1);yp(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?OP.createPortal(P(ps.div,{...r,ref:e}),o):null});u1.displayName=Gj;function Zj(t,e){return Y.useReducer((n,r)=>e[n][r]??n,t)}var Hm=t=>{const{present:e,children:n}=t,r=Yj(e),i=typeof n=="function"?n({present:r.isPresent}):Y.Children.only(n),s=rc(r.ref,Kj(i));return typeof n=="function"||r.isPresent?Y.cloneElement(i,{ref:s}):null};Hm.displayName="Presence";function Yj(t){const[e,n]=Y.useState(),r=Y.useRef({}),i=Y.useRef(t),s=Y.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Zj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Y.useEffect(()=>{const u=Yf(r.current);s.current=a==="mounted"?u:"none"},[a]),yp(()=>{const u=r.current,l=i.current;if(l!==t){const f=s.current,h=Yf(u);t?c("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(l&&f!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),yp(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,d=h=>{const p=Yf(r.current).includes(h.animationName);if(h.target===e&&p&&(c("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=h=>{h.target===e&&(s.current=Yf(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:Y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Yf(t){return(t==null?void 0:t.animationName)||"none"}function Kj(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Jj=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},bc=new WeakMap,Kf=new WeakMap,Jf={},ty=0,l1=function(t){return t&&(t.host||l1(t.parentNode))},Xj=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=l1(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Qj=function(t,e,n,r){var i=Xj(e,Array.isArray(t)?t:[t]);Jf[n]||(Jf[n]=new WeakMap);var s=Jf[n],o=[],a=new Set,c=new Set(i),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};i.forEach(u);var l=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))l(f);else try{var h=f.getAttribute(r),m=h!==null&&h!=="false",p=(bc.get(f)||0)+1,g=(s.get(f)||0)+1;bc.set(f,p),s.set(f,g),o.push(f),p===1&&m&&Kf.set(f,!0),g===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return l(e),a.clear(),ty++,function(){o.forEach(function(d){var f=bc.get(d)-1,h=s.get(d)-1;bc.set(d,f),s.set(d,h),f||(Kf.has(d)||d.removeAttribute(r),Kf.delete(d)),h||d.removeAttribute(n)}),ty--,ty||(bc=new WeakMap,bc=new WeakMap,Kf=new WeakMap,Jf={})}},e5=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=Jj(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Qj(r,i,n,"aria-hidden")):function(){return null}},Yi=function(){return Yi=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Yi.apply(this,arguments)};function d1(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function t5(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var $h="right-scroll-bar-position",jh="width-before-scroll-bar",n5="with-scroll-bars-hidden",r5="--removed-body-scroll-bar-size";function ny(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function i5(t,e){var n=We(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var s5=typeof window<"u"?Y.useLayoutEffect:Y.useEffect,IE=new WeakMap;function o5(t,e){var n=i5(null,function(r){return t.forEach(function(i){return ny(i,r)})});return s5(function(){var r=IE.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||ny(a,null)}),s.forEach(function(a){i.has(a)||ny(a,o)})}IE.set(n,t)},[t]),n}function a5(t){return t}function c5(t,e){e===void 0&&(e=a5);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var c=function(){var l=o;o=[],l.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(l){o.push(l),u()},filter:function(l){return o=o.filter(l),n}}}};return i}function u5(t){t===void 0&&(t={});var e=c5(null);return e.options=Yi({async:!0,ssr:!1},t),e}var f1=function(t){var e=t.sideCar,n=d1(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return Y.createElement(r,Yi({},n))};f1.isSideCarExport=!0;function l5(t,e){return t.useMedium(e),f1}var h1=u5(),ry=function(){},Wm=Y.forwardRef(function(t,e){var n=Y.useRef(null),r=Y.useState({onScrollCapture:ry,onWheelCapture:ry,onTouchMoveCapture:ry}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,l=t.enabled,d=t.shards,f=t.sideCar,h=t.noIsolation,m=t.inert,p=t.allowPinchZoom,g=t.as,y=g===void 0?"div":g,v=t.gapMode,b=d1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,w=o5([n,e]),x=Yi(Yi({},b),i);return Y.createElement(Y.Fragment,null,l&&Y.createElement(E,{sideCar:h1,removeScrollBar:u,shards:d,noIsolation:h,inert:m,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:v}),o?Y.cloneElement(Y.Children.only(a),Yi(Yi({},x),{ref:w})):Y.createElement(y,Yi({},x,{className:c,ref:w}),a))});Wm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wm.classNames={fullWidth:jh,zeroRight:$h};var d5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function f5(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=d5();return e&&t.setAttribute("nonce",e),t}function h5(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function p5(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var m5=function(){var t=0,e=null;return{add:function(n){t==0&&(e=f5())&&(h5(e,n),p5(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},g5=function(){var t=m5();return function(e,n){Y.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},p1=function(){var t=g5(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},y5={left:0,top:0,right:0,gap:0},iy=function(t){return parseInt(t||"",10)||0},v5=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[iy(n),iy(r),iy(i)]},b5=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return y5;var e=v5(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},_5=p1(),Zc="data-scroll-locked",w5=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
15
|
-
.`.concat(n5,` {
|
|
16
|
-
overflow: hidden `).concat(r,`;
|
|
17
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
18
|
-
}
|
|
19
|
-
body[`).concat(Zc,`] {
|
|
20
|
-
overflow: hidden `).concat(r,`;
|
|
21
|
-
overscroll-behavior: contain;
|
|
22
|
-
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
23
|
-
padding-left: `.concat(i,`px;
|
|
24
|
-
padding-top: `).concat(s,`px;
|
|
25
|
-
padding-right: `).concat(o,`px;
|
|
26
|
-
margin-left:0;
|
|
27
|
-
margin-top:0;
|
|
28
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
29
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.`).concat($h,` {
|
|
33
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.`).concat(jh,` {
|
|
37
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.`).concat($h," .").concat($h,` {
|
|
41
|
-
right: 0 `).concat(r,`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.`).concat(jh," .").concat(jh,` {
|
|
45
|
-
margin-right: 0 `).concat(r,`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
body[`).concat(Zc,`] {
|
|
49
|
-
`).concat(r5,": ").concat(a,`px;
|
|
50
|
-
}
|
|
51
|
-
`)},OE=function(){var t=parseInt(document.body.getAttribute(Zc)||"0",10);return isFinite(t)?t:0},E5=function(){Y.useEffect(function(){return document.body.setAttribute(Zc,(OE()+1).toString()),function(){var t=OE()-1;t<=0?document.body.removeAttribute(Zc):document.body.setAttribute(Zc,t.toString())}},[])},S5=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;E5();var s=Y.useMemo(function(){return b5(i)},[i]);return Y.createElement(_5,{styles:w5(s,!e,i,n?"":"!important")})},lv=!1;if(typeof window<"u")try{var Xf=Object.defineProperty({},"passive",{get:function(){return lv=!0,!0}});window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{lv=!1}var _c=lv?{passive:!1}:!1,x5=function(t){return t.tagName==="TEXTAREA"},m1=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!x5(t)&&n[e]==="visible")},T5=function(t){return m1(t,"overflowY")},I5=function(t){return m1(t,"overflowX")},CE=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=g1(t,r);if(i){var s=y1(t,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},O5=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},C5=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},g1=function(t,e){return t==="v"?T5(e):I5(e)},y1=function(t,e){return t==="v"?O5(e):C5(e)},k5=function(t,e){return t==="h"&&e==="rtl"?-1:1},D5=function(t,e,n,r,i){var s=k5(t,window.getComputedStyle(e).direction),o=s*r,a=n.target,c=e.contains(a),u=!1,l=o>0,d=0,f=0;do{var h=y1(t,a),m=h[0],p=h[1],g=h[2],y=p-g-s*m;(m||y)&&g1(t,a)&&(d+=y,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(l&&Math.abs(d)<1||!l&&Math.abs(f)<1)&&(u=!0),u},Qf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},kE=function(t){return[t.deltaX,t.deltaY]},DE=function(t){return t&&"current"in t?t.current:t},R5=function(t,e){return t[0]===e[0]&&t[1]===e[1]},N5=function(t){return`
|
|
52
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
53
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
54
|
-
`)},A5=0,wc=[];function P5(t){var e=Y.useRef([]),n=Y.useRef([0,0]),r=Y.useRef(),i=Y.useState(A5++)[0],s=Y.useState(p1)[0],o=Y.useRef(t);Y.useEffect(function(){o.current=t},[t]),Y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var p=t5([t.lockRef.current],(t.shards||[]).map(DE),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=Y.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var y=Qf(p),v=n.current,b="deltaX"in p?p.deltaX:v[0]-y[0],E="deltaY"in p?p.deltaY:v[1]-y[1],w,x=p.target,_=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in p&&_==="h"&&x.type==="range")return!1;var k=CE(_,x);if(!k)return!0;if(k?w=_:(w=_==="v"?"h":"v",k=CE(_,x)),!k)return!1;if(!r.current&&"changedTouches"in p&&(b||E)&&(r.current=w),!w)return!0;var R=r.current||w;return D5(R,g,p,R==="h"?b:E)},[]),c=Y.useCallback(function(p){var g=p;if(!(!wc.length||wc[wc.length-1]!==s)){var y="deltaY"in g?kE(g):Qf(g),v=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&R5(w.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(DE).filter(Boolean).filter(function(w){return w.contains(g.target)}),E=b.length>0?a(g,b[0]):!o.current.noIsolation;E&&g.cancelable&&g.preventDefault()}}},[]),u=Y.useCallback(function(p,g,y,v){var b={name:p,delta:g,target:y,should:v,shadowParent:M5(y)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(E){return E!==b})},1)},[]),l=Y.useCallback(function(p){n.current=Qf(p),r.current=void 0},[]),d=Y.useCallback(function(p){u(p.type,kE(p),p.target,a(p,t.lockRef.current))},[]),f=Y.useCallback(function(p){u(p.type,Qf(p),p.target,a(p,t.lockRef.current))},[]);Y.useEffect(function(){return wc.push(s),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,_c),document.addEventListener("touchmove",c,_c),document.addEventListener("touchstart",l,_c),function(){wc=wc.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,_c),document.removeEventListener("touchmove",c,_c),document.removeEventListener("touchstart",l,_c)}},[]);var h=t.removeScrollBar,m=t.inert;return Y.createElement(Y.Fragment,null,m?Y.createElement(s,{styles:N5(i)}):null,h?Y.createElement(S5,{gapMode:t.gapMode}):null)}function M5(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const L5=l5(h1,P5);var v1=Y.forwardRef(function(t,e){return Y.createElement(Wm,Yi({},t,{ref:e,sideCar:L5}))});v1.classNames=Wm.classNames;const b1="2.22.17";let cl={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t??"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${b1}`};class qn extends Error{constructor(e,n={}){var a;const r=(()=>{var c;return n.cause instanceof qn?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof qn&&n.cause.docsPath||n.docsPath,s=(a=cl.getDocsUrl)==null?void 0:a.call(cl,{...n,docsPath:i}),o=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...cl.version?[`Version: ${cl.version}`]:[]].join(`
|
|
55
|
-
`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=e,this.version=b1}walk(e){return _1(this,e)}}function _1(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?_1(t.cause,e):e?null:t}class F5 extends qn{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class _ie extends qn{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class $5 extends qn{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class j5 extends qn{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}class wie extends qn{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class w1 extends qn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}class Eie extends qn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}function zu(t,{dir:e,size:n=32}={}){return typeof t=="string"?U5(t,{dir:e,size:n}):B5(t,{dir:e,size:n})}function U5(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new w1({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function B5(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new w1({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const s=e==="right";r[s?i:n-i-1]=t[s?i:t.length-i-1]}return r}function l_(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function RE(t){return l_(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function sy(t,{dir:e="left"}={}){let n=typeof t=="string"?t.replace("0x",""):t,r=0;for(let i=0;i<n.length-1&&n[e==="left"?i:n.length-i-1].toString()==="0";i++)r++;return n=e==="left"?n.slice(r):n.slice(0,n.length-r),typeof t=="string"?(n.length===1&&e==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const z5=new TextEncoder;function V5(t,e={}){return typeof t=="number"||typeof t=="bigint"?W5(t,e):typeof t=="boolean"?H5(t,e):l_(t)?E1(t,e):S1(t,e)}function H5(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?(ic(n,{size:e.size}),zu(n,{size:e.size})):n}const Es={zero:48,nine:57,A:65,F:70,a:97,f:102};function NE(t){if(t>=Es.zero&&t<=Es.nine)return t-Es.zero;if(t>=Es.A&&t<=Es.F)return t-(Es.A-10);if(t>=Es.a&&t<=Es.f)return t-(Es.a-10)}function E1(t,e={}){let n=t;e.size&&(ic(n,{size:e.size}),n=zu(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=NE(r.charCodeAt(a++)),u=NE(r.charCodeAt(a++));if(c===void 0||u===void 0)throw new qn(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[o]=c*16+u}return s}function W5(t,e){const n=vp(t,e);return E1(n)}function S1(t,e={}){const n=z5.encode(t);return typeof e.size=="number"?(ic(n,{size:e.size}),zu(n,{dir:"right",size:e.size})):n}function ic(t,{size:e}){if(RE(t)>e)throw new j5({givenSize:RE(t),maxSize:e})}function q5(t,e={}){const{signed:n}=e;e.size&&ic(t,{size:e.size});const r=BigInt(t);if(!n)return r;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function Sie(t,e={}){let n=t;if(e.size&&(ic(n,{size:e.size}),n=sy(n)),sy(n)==="0x00")return!1;if(sy(n)==="0x01")return!0;throw new $5(n)}function xie(t,e={}){return Number(q5(t,e))}const G5=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Z5(t,e={}){return typeof t=="number"||typeof t=="bigint"?vp(t,e):typeof t=="string"?T1(t,e):typeof t=="boolean"?Y5(t,e):x1(t,e)}function Y5(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(ic(n,{size:e.size}),zu(n,{size:e.size})):n}function x1(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=G5[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(ic(r,{size:e.size}),zu(r,{dir:"right",size:e.size})):r}function vp(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new F5({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${t}${c}`})}const a=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?zu(a,{size:r}):a}const K5=new TextEncoder;function T1(t,e={}){const n=K5.encode(t);return x1(n,e)}class J5 extends qn{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class d_ extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}function bp(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function X5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function qm(t,...e){if(!X5(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Tie(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");bp(t.outputLen),bp(t.blockLen)}function AE(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Q5(t,e){qm(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const eh=BigInt(2**32-1),PE=BigInt(32);function eU(t,e=!1){return e?{h:Number(t&eh),l:Number(t>>PE&eh)}:{h:Number(t>>PE&eh)|0,l:Number(t&eh)|0}}function tU(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=eU(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const nU=(t,e,n)=>t<<n|e>>>32-n,rU=(t,e,n)=>e<<n|t>>>32-n,iU=(t,e,n)=>e<<n-32|t>>>64-n,sU=(t,e,n)=>t<<n-32|e>>>64-n,Ec=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function oU(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Iie(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Oie(t,e){return t<<32-e|t>>>e}const ME=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function aU(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function LE(t){for(let e=0;e<t.length;e++)t[e]=aU(t[e])}function cU(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function I1(t){return typeof t=="string"&&(t=cU(t)),qm(t),t}function Cie(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];qm(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}let uU=class{clone(){return this._cloneInto()}};function lU(t){const e=r=>t().update(I1(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Die(t=32){if(Ec&&typeof Ec.getRandomValues=="function")return Ec.getRandomValues(new Uint8Array(t));if(Ec&&typeof Ec.randomBytes=="function")return Ec.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const O1=[],C1=[],k1=[],dU=BigInt(0),ul=BigInt(1),fU=BigInt(2),hU=BigInt(7),pU=BigInt(256),mU=BigInt(113);for(let t=0,e=ul,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],O1.push(2*(5*r+n)),C1.push((t+1)*(t+2)/2%64);let i=dU;for(let s=0;s<7;s++)e=(e<<ul^(e>>hU)*mU)%pU,e&fU&&(i^=ul<<(ul<<BigInt(s))-ul);k1.push(i)}const[gU,yU]=tU(k1,!0),FE=(t,e,n)=>n>32?iU(t,e,n):nU(t,e,n),$E=(t,e,n)=>n>32?sU(t,e,n):rU(t,e,n);function vU(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],l=n[c+1],d=FE(u,l,1)^n[a],f=$E(u,l,1)^n[a+1];for(let h=0;h<50;h+=10)t[o+h]^=d,t[o+h+1]^=f}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=C1[o],c=FE(i,s,a),u=$E(i,s,a),l=O1[o];i=t[l],s=t[l+1],t[l]=c,t[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=gU[r],t[1]^=yU[r]}n.fill(0)}class f_ extends uU{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,bp(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=oU(this.state)}keccak(){ME||LE(this.state32),vU(this.state32,this.rounds),ME||LE(this.state32),this.posOut=0,this.pos=0}update(e){AE(this);const{blockLen:n,state:r}=this;e=I1(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,n&128&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){AE(this,!1),qm(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return bp(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Q5(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new f_(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const bU=(t,e,n)=>lU(()=>new f_(e,t,n)),_U=bU(1,136,256/8);function wU(t,e){const n=e||"hex",r=_U(l_(t,{strict:!1})?V5(t):t);return n==="bytes"?r:Z5(r)}const oy=new d_(8192);function D1(t,e){if(oy.has(`${t}.${e}`))return oy.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=wU(S1(n),"bytes"),i=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return oy.set(`${t}.${e}`,s),s}function th(t,e){if(!SU(t,{strict:!1}))throw new J5({address:t});return D1(t,e)}const EU=/^0x[a-fA-F0-9]{40}$/,ay=new d_(8192);function SU(t,e){const{strict:n=!0}=e??{},r=`${t}.${n}`;if(ay.has(r))return ay.get(r);const i=EU.test(t)?t.toLowerCase()===t?!0:n?D1(t)===t:!0:!1;return ay.set(r,i),i}function xU(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const xa=(t,e,n)=>JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString():i,n),Rie=t=>t,h_=t=>t;class Fl extends qn{constructor({body:e,cause:n,details:r,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${h_(o)}`,e&&`Request body: ${xa(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class R1 extends qn{constructor({body:e,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${h_(r)}`,`Request body: ${xa(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class jE extends qn{constructor({body:e,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${h_(n)}`,`Request body: ${xa(e)}`],name:"TimeoutError"})}}const TU=-1;class Rr extends qn{constructor(e,{code:n,docsPath:r,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof R1?e.code:n??TU}}class Vu extends Rr{constructor(e,n){super(e,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class nd extends Rr{constructor(e){super(e,{code:nd.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(nd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class rd extends Rr{constructor(e){super(e,{code:rd.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(rd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class id extends Rr{constructor(e,{method:n}={}){super(e,{code:id.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(id,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class sd extends Rr{constructor(e){super(e,{code:sd.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
56
|
-
`)})}}Object.defineProperty(sd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class yu extends Rr{constructor(e){super(e,{code:yu.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(yu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class od extends Rr{constructor(e){super(e,{code:od.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
57
|
-
`)})}}Object.defineProperty(od,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ad extends Rr{constructor(e){super(e,{code:ad.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ad,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Ro extends Rr{constructor(e){super(e,{code:Ro.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class cd extends Rr{constructor(e){super(e,{code:cd.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(cd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class da extends Rr{constructor(e,{method:n}={}){super(e,{code:da.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(da,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class vu extends Rr{constructor(e){super(e,{code:vu.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(vu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class ud extends Rr{constructor(e){super(e,{code:ud.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(ud,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class cr extends Vu{constructor(e){super(e,{code:cr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(cr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class ld extends Vu{constructor(e){super(e,{code:ld.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(ld,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class dd extends Vu{constructor(e,{method:n}={}){super(e,{code:dd.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(dd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class fd extends Vu{constructor(e){super(e,{code:fd.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(fd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class hd extends Vu{constructor(e){super(e,{code:hd.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(hd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Aa extends Vu{constructor(e){super(e,{code:Aa.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Aa,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class IU extends Rr{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function OU(){let t=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}const cy=new Map;function CU({fn:t,id:e,shouldSplitBatch:n,wait:r=0,sort:i}){const s=async()=>{const l=c();o();const d=l.map(({args:f})=>f);d.length!==0&&t(d).then(f=>{i&&Array.isArray(f)&&f.sort(i);for(let h=0;h<l.length;h++){const{resolve:m}=l[h];m==null||m([f[h],f])}}).catch(f=>{for(let h=0;h<l.length;h++){const{reject:m}=l[h];m==null||m(f)}})},o=()=>cy.delete(e),a=()=>c().map(({args:l})=>l),c=()=>cy.get(e)||[],u=l=>cy.set(e,[...c(),l]);return{flush:o,async schedule(l){const{promise:d,resolve:f,reject:h}=OU();return(n==null?void 0:n([...a(),l]))&&s(),c().length>0?(u({args:l,resolve:f,reject:h}),d):(u({args:l,resolve:f,reject:h}),setTimeout(s,r),d)}}}async function kU(t){return new Promise(e=>setTimeout(e,t))}const nh=new d_(8192);function DU(t,{enabled:e=!0,id:n}){if(!e||!n)return t();if(nh.get(n))return nh.get(n);const r=t().finally(()=>nh.delete(n));return nh.set(n,r),r}function N1(t,{delay:e=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:u})=>{const l=typeof e=="function"?e({count:a,error:u}):e;l&&await kU(l),o({count:a+1})};try{const u=await t();i(u)}catch(u){if(a<n&&await r({count:a,error:u}))return c({error:u});s(u)}};o()})}function RU(t,e={}){return async(n,r={})=>{var d;const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...r},{method:u}=n;if((d=s==null?void 0:s.exclude)!=null&&d.includes(u))throw new da(new Error("method not supported"),{method:u});if(s!=null&&s.include&&!s.include.includes(u))throw new da(new Error("method not supported"),{method:u});const l=i?T1(`${c}.${xa(n)}`):void 0;return DU(()=>N1(async()=>{try{return await t(n)}catch(f){const h=f;switch(h.code){case nd.code:throw new nd(h);case rd.code:throw new rd(h);case id.code:throw new id(h,{method:n.method});case sd.code:throw new sd(h);case yu.code:throw new yu(h);case od.code:throw new od(h);case ad.code:throw new ad(h);case Ro.code:throw new Ro(h);case cd.code:throw new cd(h);case da.code:throw new da(h,{method:n.method});case vu.code:throw new vu(h);case ud.code:throw new ud(h);case cr.code:throw new cr(h);case ld.code:throw new ld(h);case dd.code:throw new dd(h);case fd.code:throw new fd(h);case hd.code:throw new hd(h);case Aa.code:throw new Aa(h);case 5e3:throw new cr(h);default:throw f instanceof qn?f:new IU(h)}}},{delay:({count:f,error:h})=>{var m;if(h&&h instanceof Fl){const p=(m=h==null?void 0:h.headers)==null?void 0:m.get("Retry-After");if(p!=null&&p.match(/\d/))return Number.parseInt(p)*1e3}return~~(1<<f)*o},retryCount:a,shouldRetry:({error:f})=>NU(f)}),{enabled:i,id:l})}}function NU(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===vu.code||t.code===yu.code:t instanceof Fl&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function AU(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function A1(t,{errorInstance:e=new Error("timed out"),timeout:n,signal:r}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;n>0&&(o=setTimeout(()=>{r?a.abort():s(e)},n)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function PU(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const UE=PU();function MU(t,e={}){return{async request(n){var d;const{body:r,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=n,a={...e.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:u,signal:l}=a;try{const f=await A1(async({signal:m})=>{const p={...a,body:Array.isArray(r)?xa(r.map(b=>({jsonrpc:"2.0",id:b.id??UE.take(),...b}))):xa({jsonrpc:"2.0",id:r.id??UE.take(),...r}),headers:{"Content-Type":"application/json",...c},method:u||"POST",signal:l||(o>0?m:null)},g=new Request(t,p),y=await(i==null?void 0:i(g,p))??{...p,url:t};return await fetch(y.url??t,y)},{errorInstance:new jE({body:r,url:t}),timeout:o,signal:!0});s&&await s(f);let h;if((d=f.headers.get("Content-Type"))!=null&&d.startsWith("application/json"))h=await f.json();else{h=await f.text();try{h=JSON.parse(h||"{}")}catch(m){if(f.ok)throw m;h={error:h}}}if(!f.ok)throw new Fl({body:r,details:xa(h.error)||f.statusText,headers:f.headers,status:f.status,url:t});return h}catch(f){throw f instanceof Fl||f instanceof jE?f:new Fl({body:r,cause:f,url:t})}}}}const Uh="2.16.3",LU=()=>`@wagmi/core@${Uh}`;var P1=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},_p,M1;let L1=class dv extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return LU()}constructor(e,n={}){var s;super(),_p.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof dv?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details,i=n.cause instanceof dv&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
|
|
58
|
-
`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return P1(this,_p,"m",M1).call(this,this,e)}};_p=new WeakSet,M1=function t(e,n){return n!=null&&n(e)?e:e.cause?P1(this,_p,"m",t).call(this,e.cause,n):e};class fv extends L1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const hv=256;let rh=hv,ih;function F1(t=11){if(!ih||rh+t>hv*2){ih="",rh=0;for(let e=0;e<hv;e++)ih+=(256+Math.random()*256|0).toString(16).substring(1)}return ih.substring(rh,rh+++t)}function FU(t){const{batch:e,cacheTime:n=t.pollingInterval??4e3,ccipRead:r,key:i="base",name:s="Base Client",pollingInterval:o=4e3,type:a="base"}=t,c=t.chain,u=t.account?xU(t.account):void 0,{config:l,request:d,value:f}=t.transport({chain:c,pollingInterval:o}),h={...l,...f},m={account:u,batch:e,cacheTime:n,ccipRead:r,chain:c,key:i,name:s,pollingInterval:o,request:d,transport:h,type:a,uid:F1()};function p(g){return y=>{const v=y(g);for(const E in m)delete v[E];const b={...g,...v};return Object.assign(b,{extend:p(b)})}}return Object.assign(m,{extend:p(m)})}function $U({key:t,methods:e,name:n,request:r,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const u=F1();return{config:{key:t,name:n,request:r,retryCount:i,retryDelay:s,timeout:o,type:a},request:RU(r,{methods:e,retryCount:i,retryDelay:s,uid:u}),value:c}}class jU extends qn{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function UU(t,e={}){const{batch:n,fetchOptions:r,key:i="http",methods:s,name:o="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:c,retryDelay:u}=e;return({chain:l,retryCount:d,timeout:f})=>{const{batchSize:h=1e3,wait:m=0}=typeof n=="object"?n:{},p=e.retryCount??d,g=f??e.timeout??1e4,y=l==null?void 0:l.rpcUrls.default.http[0];if(!y)throw new jU;const v=MU(y,{fetchOptions:r,onRequest:a,onResponse:c,timeout:g});return $U({key:i,methods:s,name:o,async request({method:b,params:E}){const w={method:b,params:E},{schedule:x}=CU({id:y,wait:m,shouldSplitBatch(F){return F.length>h},fn:F=>v.request({body:F}),sort:(F,V)=>F.id-V.id}),_=async F=>n?x(F):[await v.request({body:F})],[{error:k,result:R}]=await _(w);if(k)throw new R1({body:w,error:k,url:y});return R},retryCount:p,retryDelay:u,timeout:g,type:"http"},{fetchOptions:r,url:y})}}let uy=!1;async function BU(t,e={}){var u,l;if(uy)return[];uy=!0,t.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const n=[];if((u=e.connectors)!=null&&u.length)for(const d of e.connectors){let f;typeof d=="function"?f=t._internal.connectors.setup(d):f=d,n.push(f)}else n.push(...t.connectors);let r;try{r=await((l=t.storage)==null?void 0:l.getItem("recentConnectorId"))}catch{}const i={};for(const[,d]of t.state.connections)i[d.connector.id]=1;r&&(i[r]=0);const s=Object.keys(i).length>0?[...n].sort((d,f)=>(i[d.id]??10)-(i[f.id]??10)):n;let o=!1;const a=[],c=[];for(const d of s){const f=await d.getProvider().catch(()=>{});if(!f||c.some(p=>p===f)||!await d.isAuthorized())continue;const m=await d.connect({isReconnecting:!0}).catch(()=>null);m&&(d.emitter.off("connect",t._internal.events.connect),d.emitter.on("change",t._internal.events.change),d.emitter.on("disconnect",t._internal.events.disconnect),t.setState(p=>{const g=new Map(o?p.connections:new Map).set(d.uid,{accounts:m.accounts,chainId:m.chainId,connector:d});return{...p,current:o?p.current:d.uid,connections:g}}),a.push({accounts:m.accounts,chainId:m.chainId,connector:d}),c.push(f),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(d=>({...d,status:"connected"})):t.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),uy=!1,a}class Sc extends L1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}p_.type="injected";function p_(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const c=t.target;if(typeof c=="function"){const u=c();if(u)return u}return typeof c=="object"?c:typeof c=="string"?{...zU[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(u){return u==null?void 0:u.ethereum}}}let i,s,o,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:p_.type,async setup(){const u=await this.getProvider();u!=null&&u.on&&t.target&&(o||(o=this.onConnect.bind(this),u.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),u.on("accountsChanged",i)))},async connect({chainId:u,isReconnecting:l}={}){var h,m,p,g,y,v;const d=await this.getProvider();if(!d)throw new Sc;let f=[];if(l)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(g=(p=(m=(h=(await d.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:h.caveats)==null?void 0:m[0])==null?void 0:p.value)==null?void 0:g.map(E=>th(E)),f.length>0&&(f=await this.getAccounts())}catch(b){const E=b;if(E.code===cr.code)throw new cr(E);if(E.code===Ro.code)throw E}try{!(f!=null&&f.length)&&!l&&(f=(await d.request({method:"eth_requestAccounts"})).map(w=>th(w))),o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),d.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a));let b=await this.getChainId();if(u&&b!==u){const E=await this.switchChain({chainId:u}).catch(w=>{if(w.code===cr.code)throw w;return{id:b}});b=(E==null?void 0:E.id)??b}return e&&await((y=c.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),t.target||await((v=c.storage)==null?void 0:v.setItem("injected.connected",!0)),{accounts:f,chainId:b}}catch(b){const E=b;throw E.code===cr.code?new cr(E):E.code===Ro.code?new Ro(E):E}},async disconnect(){var l,d;const u=await this.getProvider();if(!u)throw new Sc;s&&(u.removeListener("chainChanged",s),s=void 0),a&&(u.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o));try{await A1(()=>u.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((l=c.storage)==null?void 0:l.setItem(`${this.id}.disconnected`,!0)),t.target||await((d=c.storage)==null?void 0:d.removeItem("injected.connected"))},async getAccounts(){const u=await this.getProvider();if(!u)throw new Sc;return(await u.request({method:"eth_accounts"})).map(d=>th(d))},async getChainId(){const u=await this.getProvider();if(!u)throw new Sc;const l=await u.request({method:"eth_chainId"});return Number(l)},async getProvider(){if(typeof window>"u")return;let u;const l=r();return typeof l.provider=="function"?u=l.provider(window):typeof l.provider=="string"?u=Bh(window,l.provider):u=l.provider,u&&!u.removeListener&&("off"in u&&typeof u.off=="function"?u.removeListener=u.off:u.removeListener=()=>{}),u},async isAuthorized(){var u,l;try{if(e&&await((u=c.storage)==null?void 0:u.getItem(`${this.id}.disconnected`))||!t.target&&!await((l=c.storage)==null?void 0:l.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const m=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",m),!!await this.getProvider()),p=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(y=>window.addEventListener("ethereum#initialized",()=>y(m()),{once:!0}))]:[],new Promise(y=>setTimeout(()=>y(m()),p))]))return!0}throw new Sc}return!!(await N1(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:l}){var m,p,g,y;const d=await this.getProvider();if(!d)throw new Sc;const f=c.chains.find(v=>v.id===l);if(!f)throw new Aa(new fv);const h=new Promise(v=>{const b=E=>{"chainId"in E&&E.chainId===l&&(c.emitter.off("change",b),v())};c.emitter.on("change",b)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:vp(l)}]}).then(async()=>{await this.getChainId()===l&&c.emitter.emit("change",{chainId:l})}),h]),f}catch(v){const b=v;if(b.code===4902||((p=(m=b==null?void 0:b.data)==null?void 0:m.originalError)==null?void 0:p.code)===4902)try{const{default:E,...w}=f.blockExplorers??{};let x;u!=null&&u.blockExplorerUrls?x=u.blockExplorerUrls:E&&(x=[E.url,...Object.values(w).map(R=>R.url)]);let _;(g=u==null?void 0:u.rpcUrls)!=null&&g.length?_=u.rpcUrls:_=[((y=f.rpcUrls.default)==null?void 0:y.http[0])??""];const k={blockExplorerUrls:x,chainId:vp(l),chainName:(u==null?void 0:u.chainName)??f.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??f.nativeCurrency,rpcUrls:_};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[k]}).then(async()=>{if(await this.getChainId()===l)c.emitter.emit("change",{chainId:l});else throw new cr(new Error("User rejected switch after adding network."))}),h]),f}catch(E){throw new cr(E)}throw b.code===cr.code?new cr(b):new Aa(b)}},async onAccountsChanged(u){var l;if(u.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),e&&await((l=c.storage)==null?void 0:l.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:u.map(d=>th(d))})},onChainChanged(u){const l=Number(u);c.emitter.emit("change",{chainId:l})},async onConnect(u){const l=await this.getAccounts();if(l.length===0)return;const d=Number(u.chainId);c.emitter.emit("connect",{accounts:l,chainId:d});const f=await this.getProvider();f&&(o&&(f.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),f.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a)))},async onDisconnect(u){const l=await this.getProvider();u&&u.code===1013&&l&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),l&&(s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o))))}})}const zU={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:Bh(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return Bh(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(e[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,n;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(n=t.phantom)==null?void 0:n.ethereum:Bh(t,"isPhantom")}}};function Bh(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r!=null&&r.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}function VU(t){if(typeof window>"u")return;const e=n=>t(n.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function HU(){const t=new Set;let e=[];const n=()=>VU(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r==null||r()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),r==null||r(),r=n()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const WU=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(o,a,c)=>{let u=o;if(a){const l=(c==null?void 0:c.equalityFn)||Object.is;let d=o(r.getState());u=f=>{const h=o(f);if(!l(d,h)){const m=d;a(d=h,m)}},c!=null&&c.fireImmediately&&a(d,d)}return i(u)},t(e,n,r)},qU=WU;function GU(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,void 0),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const pv=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return pv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return pv(r)(n)}}}},ZU=(t,e)=>(n,r,i)=>{let s={storage:GU(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...e},o=!1;const a=new Set,c=new Set;let u=s.storage;if(!u)return t((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...p)},r,i);const l=()=>{const p=s.partialize({...r()});return u.setItem(s.name,{state:p,version:s.version})},d=i.setState;i.setState=(p,g)=>{d(p,g),l()};const f=t((...p)=>{n(...p),l()},r,i);i.getInitialState=()=>f;let h;const m=()=>{var p,g;if(!u)return;o=!1,a.forEach(v=>{var b;return v((b=r())!=null?b:f)});const y=((g=s.onRehydrateStorage)==null?void 0:g.call(s,(p=r())!=null?p:f))||void 0;return pv(u.getItem.bind(u))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return[!0,s.migrate(v.state,v.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var b;const[E,w]=v;if(h=s.merge(w,(b=r())!=null?b:f),n(h,!0),E)return l()}).then(()=>{y==null||y(h,void 0),h=r(),o=!0,c.forEach(v=>v(h))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:p=>{s={...s,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(c.add(p),()=>{c.delete(p)})},s.skipHydration||m(),h||f},YU=ZU,BE=t=>{let e;const n=new Set,r=(u,l)=>{const d=typeof u=="function"?u(e):u;if(!Object.is(d,e)){const f=e;e=l??(typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(h=>h(e,f))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=e=t(r,i,a);return a},ly=t=>t?BE(t):BE;var $1={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,l){this.fn=c,this.context=u,this.once=l||!1}function s(c,u,l,d,f){if(typeof l!="function")throw new TypeError("The listener must be a function");var h=new i(l,d||c,f),m=n?n+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],h]:c._events[m].push(h):(c._events[m]=h,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],l,d;if(this._eventsCount===0)return u;for(d in l=this._events)e.call(l,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},a.prototype.listeners=function(u){var l=n?n+u:u,d=this._events[l];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,h=d.length,m=new Array(h);f<h;f++)m[f]=d[f].fn;return m},a.prototype.listenerCount=function(u){var l=n?n+u:u,d=this._events[l];return d?d.fn?1:d.length:0},a.prototype.emit=function(u,l,d,f,h,m){var p=n?n+u:u;if(!this._events[p])return!1;var g=this._events[p],y=arguments.length,v,b;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,l),!0;case 3:return g.fn.call(g.context,l,d),!0;case 4:return g.fn.call(g.context,l,d,f),!0;case 5:return g.fn.call(g.context,l,d,f,h),!0;case 6:return g.fn.call(g.context,l,d,f,h,m),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];g.fn.apply(g.context,v)}else{var E=g.length,w;for(b=0;b<E;b++)switch(g[b].once&&this.removeListener(u,g[b].fn,void 0,!0),y){case 1:g[b].fn.call(g[b].context);break;case 2:g[b].fn.call(g[b].context,l);break;case 3:g[b].fn.call(g[b].context,l,d);break;case 4:g[b].fn.call(g[b].context,l,d,f);break;default:if(!v)for(w=1,v=new Array(y-1);w<y;w++)v[w-1]=arguments[w];g[b].fn.apply(g[b].context,v)}}return!0},a.prototype.on=function(u,l,d){return s(this,u,l,d,!1)},a.prototype.once=function(u,l,d){return s(this,u,l,d,!0)},a.prototype.removeListener=function(u,l,d,f){var h=n?n+u:u;if(!this._events[h])return this;if(!l)return o(this,h),this;var m=this._events[h];if(m.fn)m.fn===l&&(!f||m.once)&&(!d||m.context===d)&&o(this,h);else{for(var p=0,g=[],y=m.length;p<y;p++)(m[p].fn!==l||f&&!m[p].once||d&&m[p].context!==d)&&g.push(m[p]);g.length?this._events[h]=g.length===1?g[0]:g:o(this,h)}return this},a.prototype.removeAllListeners=function(u){var l;return u?(l=n?n+u:u,this._events[l]&&o(this,l)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})($1);var KU=$1.exports;const JU=tc(KU);class XU{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new JU})}on(e,n){this._emitter.on(e,n)}once(e,n){this._emitter.once(e,n)}off(e,n){this._emitter.off(e,n)}emit(e,...n){const r=n[0];this._emitter.emit(e,{uid:this.uid,...r})}listenerCount(e){return this._emitter.listenerCount(e)}}function QU(t){return new XU(t)}function e3(t,e){return JSON.parse(t,(n,r)=>{let i=r;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(n,i))??i})}function zE(t,e){return t.slice(0,e).join(".")||"."}function VE(t,e){const{length:n}=t;for(let r=0;r<n;++r)if(t[r]===e)return r+1;return 0}function t3(t,e){const n=typeof t=="function",r=typeof e=="function",i=[],s=[];return function(a,c){if(typeof c=="object")if(i.length){const u=VE(i,this);u===0?i[i.length]=this:(i.splice(u),s.splice(u)),s[s.length]=a;const l=VE(i,c);if(l!==0)return r?e.call(this,a,c,zE(s,l)):`[ref=${zE(s,l)}]`}else i[0]=c,s[0]=a;return n?t.call(this,a,c):c}}function n3(t,e,n,r){return JSON.stringify(t,t3((i,s)=>{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},r),n??void 0)}function r3(t){const{deserialize:e=e3,key:n="wagmi",serialize:r=n3,storage:i=j1}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:n,async getItem(o,a){const c=i.getItem(`${n}.${o}`),u=await s(c);return u?e(u)??null:a??null},async setItem(o,a){const c=`${n}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,r(a)))},async removeItem(o){await s(i.removeItem(`${n}.${o}`))}}}const j1={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function i3(){const t=typeof window<"u"&&window.localStorage?window.localStorage:j1;return{getItem(e){return t.getItem(e)},removeItem(e){t.removeItem(e)},setItem(e,n){try{t.setItem(e,n)}catch{}}}}const mv=256;let sh=mv,oh;function s3(t=11){if(!oh||sh+t>mv*2){oh="",sh=0;for(let e=0;e<mv;e++)oh+=(256+Math.random()*256|0).toString(16).substring(1)}return oh.substring(sh,sh+++t)}function o3(t){const{multiInjectedProviderDiscovery:e=!0,storage:n=r3({storage:i3()}),syncConnectedChain:r=!0,ssr:i=!1,...s}=t,o=typeof window<"u"&&e?HU():void 0,a=ly(()=>s.chains),c=ly(()=>{const w=[],x=new Set;for(const _ of s.connectors??[]){const k=u(_);if(w.push(k),!i&&k.rdns){const R=typeof k.rdns=="string"?[k.rdns]:k.rdns;for(const F of R)x.add(F)}}if(!i&&o){const _=o.getProviders();for(const k of _)x.has(k.info.rdns)||w.push(u(l(k)))}return w});function u(w){var k;const x=QU(s3()),_={...w({emitter:x,chains:a.getState(),storage:n,transports:s.transports}),emitter:x,uid:x.uid};return x.on("connect",b),(k=_.setup)==null||k.call(_),_}function l(w){const{info:x}=w,_=w.provider;return p_({target:{...x,id:x.rdns,provider:_}})}const d=new Map;function f(w={}){const x=w.chainId??g.getState().chainId,_=a.getState().find(R=>R.id===x);if(w.chainId&&!_)throw new fv;{const R=d.get(g.getState().chainId);if(R&&!_)return R;if(!_)throw new fv}{const R=d.get(x);if(R)return R}let k;if(s.client)k=s.client({chain:_});else{const R=_.id,F=a.getState().map(L=>L.id),V={},T=Object.entries(s);for(const[L,S]of T)if(!(L==="chains"||L==="client"||L==="connectors"||L==="transports"))if(typeof S=="object")if(R in S)V[L]=S[R];else{if(F.some(N=>N in S))continue;V[L]=S}else V[L]=S;k=FU({...V,chain:_,batch:V.batch??{multicall:!0},transport:L=>s.transports[R]({...L,connectors:c})})}return d.set(x,k),k}function h(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const p="0.0.0-canary-";Uh.startsWith(p)?m=Number.parseInt(Uh.replace(p,"")):m=Number.parseInt(Uh.split(".")[0]??"0");const g=ly(qU(n?YU(h,{migrate(w,x){if(x===m)return w;const _=h(),k=y(w,_.chainId);return{..._,chainId:k}},name:"store",partialize(w){return{connections:{__type:"Map",value:Array.from(w.connections.entries()).map(([x,_])=>{const{id:k,name:R,type:F,uid:V}=_.connector;return[x,{..._,connector:{id:k,name:R,type:F,uid:V}}]})},chainId:w.chainId,current:w.current}},merge(w,x){typeof w=="object"&&w&&"status"in w&&delete w.status;const _=y(w,x.chainId);return{...x,...w,chainId:_}},skipHydration:i,storage:n,version:m}):h));g.setState(h());function y(w,x){return w&&typeof w=="object"&&"chainId"in w&&typeof w.chainId=="number"&&a.getState().some(_=>_.id===w.chainId)?w.chainId:x}r&&g.subscribe(({connections:w,current:x})=>{var _;return x?(_=w.get(x))==null?void 0:_.chainId:void 0},w=>{if(a.getState().some(_=>_.id===w))return g.setState(_=>({..._,chainId:w??_.chainId}))}),o==null||o.subscribe(w=>{const x=new Set,_=new Set;for(const R of c.getState())if(x.add(R.id),R.rdns){const F=typeof R.rdns=="string"?[R.rdns]:R.rdns;for(const V of F)_.add(V)}const k=[];for(const R of w){if(_.has(R.info.rdns))continue;const F=u(l(R));x.has(F.id)||k.push(F)}n&&!g.persist.hasHydrated()||c.setState(R=>[...R,...k],!0)});function v(w){g.setState(x=>{const _=x.connections.get(w.uid);return _?{...x,connections:new Map(x.connections).set(w.uid,{accounts:w.accounts??_.accounts,chainId:w.chainId??_.chainId,connector:_.connector})}:x})}function b(w){g.getState().status==="connecting"||g.getState().status==="reconnecting"||g.setState(x=>{const _=c.getState().find(k=>k.uid===w.uid);return _?(_.emitter.listenerCount("connect")&&_.emitter.off("connect",v),_.emitter.listenerCount("change")||_.emitter.on("change",v),_.emitter.listenerCount("disconnect")||_.emitter.on("disconnect",E),{...x,connections:new Map(x.connections).set(w.uid,{accounts:w.accounts,chainId:w.chainId,connector:_}),current:w.uid,status:"connected"}):x})}function E(w){g.setState(x=>{const _=x.connections.get(w.uid);if(_){const R=_.connector;R.emitter.listenerCount("change")&&_.connector.emitter.off("change",v),R.emitter.listenerCount("disconnect")&&_.connector.emitter.off("disconnect",E),R.emitter.listenerCount("connect")||_.connector.emitter.on("connect",b)}if(x.connections.delete(w.uid),x.connections.size===0)return{...x,connections:new Map,current:null,status:"disconnected"};const k=x.connections.values().next().value;return{...x,connections:new Map(x.connections),current:k.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:f,get state(){return g.getState()},setState(w){let x;typeof w=="function"?x=w(g.getState()):x=w;const _=h();typeof x!="object"&&(x=_),Object.keys(_).some(R=>!(R in x))&&(x=_),g.setState(x,!0)},subscribe(w,x,_){return g.subscribe(w,x,_?{..._,fireImmediately:_.emitImmediately}:void 0)},_internal:{mipd:o,store:g,ssr:!!i,syncConnectedChain:r,transports:s.transports,chains:{setState(w){const x=typeof w=="function"?w(a.getState()):w;if(x.length!==0)return a.setState(x,!0)},subscribe(w){return a.subscribe(w)}},connectors:{providerDetailToConnector:l,setup:u,setState(w){return c.setState(typeof w=="function"?w(c.getState()):w,!0)},subscribe(w){return c.subscribe(w)}},events:{change:v,connect:b,disconnect:E}}}}function a3(t,e){const{initialState:n,reconnectOnMount:r}=e;return n&&!t._internal.store.persist.hasHydrated()&&t.setState({...n,chainId:t.chains.some(i=>i.id===n.chainId)?n.chainId:t.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){t._internal.ssr&&(await t._internal.store.persist.rehydrate(),t._internal.mipd&&t._internal.connectors.setState(i=>{var c;const s=new Set;for(const u of i??[])if(u.rdns){const l=Array.isArray(u.rdns)?u.rdns:[u.rdns];for(const d of l)s.add(d)}const o=[],a=((c=t._internal.mipd)==null?void 0:c.getProviders())??[];for(const u of a){if(s.has(u.info.rdns))continue;const l=t._internal.connectors.providerDetailToConnector(u),d=t._internal.connectors.setup(l);o.push(d)}return[...i,...o]})),r?BU(t):t.storage&&t.setState(i=>({...i,connections:new Map}))}}}function c3(t){const{children:e,config:n,initialState:r,reconnectOnMount:i=!0}=t,{onMount:s}=a3(n,{initialState:r,reconnectOnMount:i});n._internal.ssr||s();const o=qt(!0);return Dt(()=>{if(o.current&&n._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const u3=Fu(void 0);function l3(t){const{children:e,config:n}=t,r={value:n};return Sa(c3,t,Sa(u3.Provider,r,e))}var Gm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Zm=typeof window>"u"||"Deno"in globalThis;function fi(){}function d3(t,e){return typeof t=="function"?t(e):t}function f3(t){return typeof t=="number"&&t>=0&&t!==1/0}function h3(t,e){return Math.max(t+(e||0)-Date.now(),0)}function HE(t,e){return typeof t=="function"?t(e):t}function p3(t,e){return typeof t=="function"?t(e):t}function WE(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==m_(o,e.options))return!1}else if(!md(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function qE(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(pd(e.options.mutationKey)!==pd(s))return!1}else if(!md(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function m_(t,e){return((e==null?void 0:e.queryKeyHashFn)||pd)(t)}function pd(t){return JSON.stringify(t,(e,n)=>gv(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function md(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!md(t[n],e[n])):!1}function U1(t,e){if(t===e)return t;const n=GE(t)&&GE(e);if(n||gv(t)&&gv(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,a=n?[]:{};let c=0;for(let u=0;u<o;u++){const l=n?u:s[u];(!n&&r.includes(l)||n)&&t[l]===void 0&&e[l]===void 0?(a[l]=void 0,c++):(a[l]=U1(t[l],e[l]),a[l]===t[l]&&t[l]!==void 0&&c++)}return i===o&&c===i?t:a}return e}function Nie(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function GE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function gv(t){if(!ZE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!ZE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function ZE(t){return Object.prototype.toString.call(t)==="[object Object]"}function m3(t){return new Promise(e=>{setTimeout(e,t)})}function g3(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?U1(t,e):e}function y3(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function v3(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var g_=Symbol();function B1(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===g_?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var ba,Eo,su,$T,b3=($T=class extends Gm{constructor(){super();bt(this,ba);bt(this,Eo);bt(this,su);ht(this,su,e=>{if(!Zm&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ce(this,Eo)||this.setEventListener(ce(this,su))}onUnsubscribe(){var e;this.hasListeners()||((e=ce(this,Eo))==null||e.call(this),ht(this,Eo,void 0))}setEventListener(e){var n;ht(this,su,e),(n=ce(this,Eo))==null||n.call(this),ht(this,Eo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){ce(this,ba)!==e&&(ht(this,ba,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof ce(this,ba)=="boolean"?ce(this,ba):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ba=new WeakMap,Eo=new WeakMap,su=new WeakMap,$T),z1=new b3,ou,So,au,jT,_3=(jT=class extends Gm{constructor(){super();bt(this,ou,!0);bt(this,So);bt(this,au);ht(this,au,e=>{if(!Zm&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ce(this,So)||this.setEventListener(ce(this,au))}onUnsubscribe(){var e;this.hasListeners()||((e=ce(this,So))==null||e.call(this),ht(this,So,void 0))}setEventListener(e){var n;ht(this,au,e),(n=ce(this,So))==null||n.call(this),ht(this,So,e(this.setOnline.bind(this)))}setOnline(e){ce(this,ou)!==e&&(ht(this,ou,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return ce(this,ou)}},ou=new WeakMap,So=new WeakMap,au=new WeakMap,jT),wp=new _3;function w3(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function E3(t){return Math.min(1e3*2**t,3e4)}function V1(t){return(t??"online")==="online"?wp.isOnline():!0}var H1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function dy(t){return t instanceof H1}function W1(t){let e=!1,n=0,r=!1,i;const s=w3(),o=p=>{var g;r||(f(new H1(p)),(g=t.abort)==null||g.call(t))},a=()=>{e=!0},c=()=>{e=!1},u=()=>z1.isFocused()&&(t.networkMode==="always"||wp.isOnline())&&t.canRun(),l=()=>V1(t.networkMode)&&t.canRun(),d=p=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,p),i==null||i(),s.resolve(p))},f=p=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,p),i==null||i(),s.reject(p))},h=()=>new Promise(p=>{var g;i=y=>{(r||u())&&p(y)},(g=t.onPause)==null||g.call(t)}).then(()=>{var p;i=void 0,r||(p=t.onContinue)==null||p.call(t)}),m=()=>{if(r)return;let p;const g=n===0?t.initialPromise:void 0;try{p=g??t.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(d).catch(y=>{var x;if(r)return;const v=t.retry??(Zm?0:3),b=t.retryDelay??E3,E=typeof b=="function"?b(n,y):b,w=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(e||!w){f(y);return}n++,(x=t.onFail)==null||x.call(t,n,y),m3(E).then(()=>u()?void 0:h()).then(()=>{e?f(y):m()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?m():h().then(m),s)}}function S3(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var dr=S3(),_a,UT,q1=(UT=class{constructor(){bt(this,_a)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),f3(this.gcTime)&&ht(this,_a,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Zm?1/0:5*60*1e3))}clearGcTimeout(){ce(this,_a)&&(clearTimeout(ce(this,_a)),ht(this,_a,void 0))}},_a=new WeakMap,UT),cu,uu,Qr,nr,lf,wa,hi,xs,BT,x3=(BT=class extends q1{constructor(e){super();bt(this,hi);bt(this,cu);bt(this,uu);bt(this,Qr);bt(this,nr);bt(this,lf);bt(this,wa);ht(this,wa,!1),ht(this,lf,e.defaultOptions),this.setOptions(e.options),this.observers=[],ht(this,Qr,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ht(this,cu,I3(this.options)),this.state=e.state??ce(this,cu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=ce(this,nr))==null?void 0:e.promise}setOptions(e){this.options={...ce(this,lf),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ce(this,Qr).remove(this)}setData(e,n){const r=g3(this.state.data,e,this.options);return sn(this,hi,xs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){sn(this,hi,xs).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=ce(this,nr))==null?void 0:r.promise;return(i=ce(this,nr))==null||i.cancel(e),n?n.then(fi).catch(fi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ce(this,cu))}isActive(){return this.observers.some(e=>p3(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===g_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!h3(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=ce(this,nr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=ce(this,nr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ce(this,Qr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(ce(this,nr)&&(ce(this,wa)?ce(this,nr).cancel({revert:!0}):ce(this,nr).cancelRetry()),this.scheduleGc()),ce(this,Qr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||sn(this,hi,xs).call(this,{type:"invalidate"})}fetch(e,n){var c,u,l;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ce(this,nr))return ce(this,nr).continueRetry(),ce(this,nr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(ht(this,wa,!0),r.signal)})},s=()=>{const d=B1(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),ht(this,wa,!1),this.options.persister?this.options.persister(d,f,this):d(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),ht(this,uu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&sn(this,hi,xs).call(this,{type:"fetch",meta:(l=o.fetchOptions)==null?void 0:l.meta});const a=d=>{var f,h,m,p;dy(d)&&d.silent||sn(this,hi,xs).call(this,{type:"error",error:d}),dy(d)||((h=(f=ce(this,Qr).config).onError)==null||h.call(f,d,this),(p=(m=ce(this,Qr).config).onSettled)==null||p.call(m,this.state.data,d,this)),this.scheduleGc()};return ht(this,nr,W1({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,m,p;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(g){a(g);return}(h=(f=ce(this,Qr).config).onSuccess)==null||h.call(f,d,this),(p=(m=ce(this,Qr).config).onSettled)==null||p.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{sn(this,hi,xs).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{sn(this,hi,xs).call(this,{type:"pause"})},onContinue:()=>{sn(this,hi,xs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),ce(this,nr).start()}},cu=new WeakMap,uu=new WeakMap,Qr=new WeakMap,nr=new WeakMap,lf=new WeakMap,wa=new WeakMap,hi=new WeakSet,xs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...T3(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return dy(i)&&i.revert&&ce(this,uu)?{...ce(this,uu),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),dr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ce(this,Qr).notify({query:this,type:"updated",action:e})})},BT);function T3(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:V1(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function I3(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Bi,zT,O3=(zT=class extends Gm{constructor(e={}){super();bt(this,Bi);this.config=e,ht(this,Bi,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??m_(i,n);let o=this.get(s);return o||(o=new x3({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){ce(this,Bi).has(e.queryHash)||(ce(this,Bi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=ce(this,Bi).get(e.queryHash);n&&(e.destroy(),n===e&&ce(this,Bi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){dr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ce(this,Bi).get(e)}getAll(){return[...ce(this,Bi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>WE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>WE(e,r)):n}notify(e){dr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){dr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bi=new WeakMap,zT),zi,ar,Ea,Vi,lo,VT,C3=(VT=class extends q1{constructor(e){super();bt(this,Vi);bt(this,zi);bt(this,ar);bt(this,Ea);this.mutationId=e.mutationId,ht(this,ar,e.mutationCache),ht(this,zi,[]),this.state=e.state||k3(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ce(this,zi).includes(e)||(ce(this,zi).push(e),this.clearGcTimeout(),ce(this,ar).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ht(this,zi,ce(this,zi).filter(n=>n!==e)),this.scheduleGc(),ce(this,ar).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ce(this,zi).length||(this.state.status==="pending"?this.scheduleGc():ce(this,ar).remove(this))}continue(){var e;return((e=ce(this,Ea))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,u,l,d,f,h,m,p,g,y,v,b,E,w,x,_;ht(this,Ea,W1({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(k,R)=>{sn(this,Vi,lo).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{sn(this,Vi,lo).call(this,{type:"pause"})},onContinue:()=>{sn(this,Vi,lo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ce(this,ar).canRun(this)}));const n=this.state.status==="pending",r=!ce(this,Ea).canStart();try{if(!n){sn(this,Vi,lo).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=ce(this,ar).config).onMutate)==null?void 0:s.call(i,e,this));const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));R!==this.state.context&&sn(this,Vi,lo).call(this,{type:"pending",context:R,variables:e,isPaused:r})}const k=await ce(this,Ea).start();return await((u=(c=ce(this,ar).config).onSuccess)==null?void 0:u.call(c,k,e,this.state.context,this)),await((d=(l=this.options).onSuccess)==null?void 0:d.call(l,k,e,this.state.context)),await((h=(f=ce(this,ar).config).onSettled)==null?void 0:h.call(f,k,null,this.state.variables,this.state.context,this)),await((p=(m=this.options).onSettled)==null?void 0:p.call(m,k,null,e,this.state.context)),sn(this,Vi,lo).call(this,{type:"success",data:k}),k}catch(k){try{throw await((y=(g=ce(this,ar).config).onError)==null?void 0:y.call(g,k,e,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,k,e,this.state.context)),await((w=(E=ce(this,ar).config).onSettled)==null?void 0:w.call(E,void 0,k,this.state.variables,this.state.context,this)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,void 0,k,e,this.state.context)),k}finally{sn(this,Vi,lo).call(this,{type:"error",error:k})}}finally{ce(this,ar).runNext(this)}}},zi=new WeakMap,ar=new WeakMap,Ea=new WeakMap,Vi=new WeakSet,lo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dr.batch(()=>{ce(this,zi).forEach(r=>{r.onMutationUpdate(e)}),ce(this,ar).notify({mutation:this,type:"updated",action:e})})},VT);function k3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rs,pi,df,HT,D3=(HT=class extends Gm{constructor(e={}){super();bt(this,Rs);bt(this,pi);bt(this,df);this.config=e,ht(this,Rs,new Set),ht(this,pi,new Map),ht(this,df,0)}build(e,n,r){const i=new C3({mutationCache:this,mutationId:++Bf(this,df)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){ce(this,Rs).add(e);const n=ah(e);if(typeof n=="string"){const r=ce(this,pi).get(n);r?r.push(e):ce(this,pi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ce(this,Rs).delete(e)){const n=ah(e);if(typeof n=="string"){const r=ce(this,pi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&ce(this,pi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=ah(e);if(typeof n=="string"){const r=ce(this,pi).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=ah(e);if(typeof n=="string"){const i=(r=ce(this,pi).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dr.batch(()=>{ce(this,Rs).forEach(e=>{this.notify({type:"removed",mutation:e})}),ce(this,Rs).clear(),ce(this,pi).clear()})}getAll(){return Array.from(ce(this,Rs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>qE(n,r))}findAll(e={}){return this.getAll().filter(n=>qE(e,n))}notify(e){dr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return dr.batch(()=>Promise.all(e.map(n=>n.continue().catch(fi))))}},Rs=new WeakMap,pi=new WeakMap,df=new WeakMap,HT);function ah(t){var e;return(e=t.options.scope)==null?void 0:e.id}function YE(t){return{onFetch:(e,n)=>{var l,d,f,h,m;const r=e.options,i=(f=(d=(l=e.fetchOptions)==null?void 0:l.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=e.state.data)==null?void 0:h.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?p=!0:e.signal.addEventListener("abort",()=>{p=!0}),e.signal)})},y=B1(e.options,e.fetchOptions),v=async(b,E,w)=>{if(p)return Promise.reject();if(E==null&&b.pages.length)return Promise.resolve(b);const x={queryKey:e.queryKey,pageParam:E,direction:w?"backward":"forward",meta:e.options.meta};g(x);const _=await y(x),{maxPages:k}=e.options,R=w?v3:y3;return{pages:R(b.pages,_,k),pageParams:R(b.pageParams,E,k)}};if(i&&s.length){const b=i==="backward",E=b?R3:KE,w={pages:s,pageParams:o},x=E(r,w);a=await v(w,x,b)}else{const b=t??s.length;do{const E=c===0?o[0]??r.initialPageParam:KE(r,a);if(c>0&&E==null)break;a=await v(a,E),c++}while(c<b)}return a};e.options.persister?e.fetchFn=()=>{var p,g;return(g=(p=e.options).persister)==null?void 0:g.call(p,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function KE(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function R3(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var wn,xo,To,lu,du,Io,fu,hu,WT,N3=(WT=class{constructor(t={}){bt(this,wn);bt(this,xo);bt(this,To);bt(this,lu);bt(this,du);bt(this,Io);bt(this,fu);bt(this,hu);ht(this,wn,t.queryCache||new O3),ht(this,xo,t.mutationCache||new D3),ht(this,To,t.defaultOptions||{}),ht(this,lu,new Map),ht(this,du,new Map),ht(this,Io,0)}mount(){Bf(this,Io)._++,ce(this,Io)===1&&(ht(this,fu,z1.subscribe(async t=>{t&&(await this.resumePausedMutations(),ce(this,wn).onFocus())})),ht(this,hu,wp.subscribe(async t=>{t&&(await this.resumePausedMutations(),ce(this,wn).onOnline())})))}unmount(){var t,e;Bf(this,Io)._--,ce(this,Io)===0&&((t=ce(this,fu))==null||t.call(this),ht(this,fu,void 0),(e=ce(this,hu))==null||e.call(this),ht(this,hu,void 0))}isFetching(t){return ce(this,wn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return ce(this,xo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ce(this,wn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=ce(this,wn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(HE(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return ce(this,wn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=ce(this,wn).get(r.queryHash),s=i==null?void 0:i.state.data,o=d3(e,s);if(o!==void 0)return ce(this,wn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return dr.batch(()=>ce(this,wn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=ce(this,wn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=ce(this,wn);dr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=ce(this,wn),r={type:"active",...t};return dr.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=dr.batch(()=>ce(this,wn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(fi).catch(fi)}invalidateQueries(t,e={}){return dr.batch(()=>{if(ce(this,wn).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=dr.batch(()=>ce(this,wn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(fi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(fi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=ce(this,wn).build(this,e);return n.isStaleByTime(HE(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(fi).catch(fi)}fetchInfiniteQuery(t){return t.behavior=YE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(fi).catch(fi)}ensureInfiniteQueryData(t){return t.behavior=YE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return wp.isOnline()?ce(this,xo).resumePausedMutations():Promise.resolve()}getQueryCache(){return ce(this,wn)}getMutationCache(){return ce(this,xo)}getDefaultOptions(){return ce(this,To)}setDefaultOptions(t){ht(this,To,t)}setQueryDefaults(t,e){ce(this,lu).set(pd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...ce(this,lu).values()],n={};return e.forEach(r=>{md(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){ce(this,du).set(pd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...ce(this,du).values()];let n={};return e.forEach(r=>{md(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...ce(this,To).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=m_(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===g_&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...ce(this,To).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){ce(this,wn).clear(),ce(this,xo).clear()}},wn=new WeakMap,xo=new WeakMap,To=new WeakMap,lu=new WeakMap,du=new WeakMap,Io=new WeakMap,fu=new WeakMap,hu=new WeakMap,WT),G1=Y.createContext(void 0),Aie=t=>{const e=Y.useContext(G1);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},A3=({client:t,children:e})=>(Y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),P(G1.Provider,{value:t,children:e}));const Pie="SYNCING",Mie="SUCCESS",Lie="CONFLICT",Fie="MISSING",P3="ERROR",$ie="INITIAL_SYNC";var gf=t=>t.type==="checkbox",fa=t=>t instanceof Date,ur=t=>t==null;const Z1=t=>typeof t=="object";var kn=t=>!ur(t)&&!Array.isArray(t)&&Z1(t)&&!fa(t),Y1=t=>kn(t)&&t.target?gf(t.target)?t.target.checked:t.target.value:t,M3=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,K1=(t,e)=>t.has(M3(e)),L3=t=>{const e=t.constructor&&t.constructor.prototype;return kn(e)&&e.hasOwnProperty("isPrototypeOf")},y_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wr(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(y_&&(t instanceof Blob||r))&&(n||kn(t)))if(e=n?[]:{},!n&&!L3(t))e=t;else for(const i in t)t.hasOwnProperty(i)&&(e[i]=wr(t[i]));else return t;return e}var Ym=t=>Array.isArray(t)?t.filter(Boolean):[],On=t=>t===void 0,Re=(t,e,n)=>{if(!e||!kn(t))return n;const r=Ym(e.split(/[,[\].]+?/)).reduce((i,s)=>ur(i)?i:i[s],t);return On(r)||r===t?On(t[e])?n:t[e]:r},ei=t=>typeof t=="boolean",v_=t=>/^\w*$/.test(t),J1=t=>Ym(t.replace(/["|']|\]/g,"").split(/\.|\[/)),nn=(t,e,n)=>{let r=-1;const i=v_(e)?[e]:J1(e),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let c=n;if(r!==o){const u=t[a];c=kn(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;t[a]=c,t=t[a]}return t};const Ep={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},bi={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ss={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},F3=$e.createContext(null),b_=()=>$e.useContext(F3);var X1=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(i,s,{get:()=>{const o=s;return e._proxyFormState[o]!==bi.all&&(e._proxyFormState[o]=!r||bi.all),n&&(n[o]=!0),t[o]}});return i},Er=t=>kn(t)&&!Object.keys(t).length,Q1=(t,e,n,r)=>{n(t);const{name:i,...s}=t;return Er(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(o=>e[o]===(!r||bi.all))},$l=t=>Array.isArray(t)?t:[t],eO=(t,e,n)=>!t||!e||t===e||$l(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function __(t){const e=$e.useRef(t);e.current=t,$e.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function $3(t){const e=b_(),{control:n=e.control,disabled:r,name:i,exact:s}=t,[o,a]=$e.useState(n._formState),c=$e.useRef(!0),u=$e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),l=$e.useRef(i);return l.current=i,__({disabled:r,next:d=>c.current&&eO(l.current,d.name,s)&&Q1(d,u.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),$e.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),$e.useMemo(()=>X1(o,n,u.current,!1),[o,n])}var Xi=t=>typeof t=="string",tO=(t,e,n,r,i)=>Xi(t)?(r&&e.watch.add(t),Re(n,t,i)):Array.isArray(t)?t.map(s=>(r&&e.watch.add(s),Re(n,s))):(r&&(e.watchAll=!0),n);function j3(t){const e=b_(),{control:n=e.control,name:r,defaultValue:i,disabled:s,exact:o}=t,a=$e.useRef(r);a.current=r,__({disabled:s,subject:n._subjects.values,next:l=>{eO(a.current,l.name,o)&&u(wr(tO(a.current,n._names,l.values||n._formValues,!1,i)))}});const[c,u]=$e.useState(n._getWatch(r,i));return $e.useEffect(()=>n._removeUnmounted()),c}function U3(t){const e=b_(),{name:n,disabled:r,control:i=e.control,shouldUnregister:s}=t,o=K1(i._names.array,n),a=j3({control:i,name:n,defaultValue:Re(i._formValues,n,Re(i._defaultValues,n,t.defaultValue)),exact:!0}),c=$3({control:i,name:n,exact:!0}),u=$e.useRef(i.register(n,{...t.rules,value:a,...ei(t.disabled)?{disabled:t.disabled}:{}})),l=$e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Re(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Re(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Re(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Re(c.validatingFields,n)},error:{enumerable:!0,get:()=>Re(c.errors,n)}}),[c,n]),d=$e.useMemo(()=>({name:n,value:a,...ei(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:f=>u.current.onChange({target:{value:Y1(f),name:n},type:Ep.CHANGE}),onBlur:()=>u.current.onBlur({target:{value:Re(i._formValues,n),name:n},type:Ep.BLUR}),ref:f=>{const h=Re(i._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:m=>f.setCustomValidity(m),reportValidity:()=>f.reportValidity()})}}),[n,i._formValues,r,c.disabled,a,i._fields]);return $e.useEffect(()=>{const f=i._options.shouldUnregister||s,h=(m,p)=>{const g=Re(i._fields,m);g&&g._f&&(g._f.mount=p)};if(h(n,!0),f){const m=wr(Re(i._options.defaultValues,n));nn(i._defaultValues,n,m),On(Re(i._formValues,n))&&nn(i._formValues,n,m)}return!o&&i.register(n),()=>{(o?f&&!i._state.action:f)?i.unregister(n):h(n,!1)}},[n,i,o,s]),$e.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),$e.useMemo(()=>({field:d,formState:c,fieldState:l}),[d,c,l])}const B3=t=>t.render(U3(t));var z3=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},JE=t=>({isOnSubmit:!t||t===bi.onSubmit,isOnBlur:t===bi.onBlur,isOnChange:t===bi.onChange,isOnAll:t===bi.all,isOnTouch:t===bi.onTouched}),XE=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const jl=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const s=Re(t,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(jl(a,e))break}else if(kn(a)&&jl(a,e))break}}};var V3=(t,e,n)=>{const r=$l(Re(t,n));return nn(r,"root",e[n]),nn(t,n,r),t},w_=t=>t.type==="file",Ki=t=>typeof t=="function",Sp=t=>{if(!y_)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},zh=t=>Xi(t),E_=t=>t.type==="radio",xp=t=>t instanceof RegExp;const QE={value:!1,isValid:!1},eS={value:!0,isValid:!0};var nO=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!On(t[0].attributes.value)?On(t[0].value)||t[0].value===""?eS:{value:t[0].value,isValid:!0}:eS:QE}return QE};const tS={isValid:!1,value:null};var rO=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,tS):tS;function nS(t,e,n="validate"){if(zh(t)||Array.isArray(t)&&t.every(zh)||ei(t)&&!t)return{type:n,message:zh(t)?t:"",ref:e}}var xc=t=>kn(t)&&!xp(t)?t:{value:t,message:""},rS=async(t,e,n,r,i,s)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:l,min:d,max:f,pattern:h,validate:m,name:p,valueAsNumber:g,mount:y}=t._f,v=Re(n,p);if(!y||e.has(p))return{};const b=a?a[0]:o,E=T=>{i&&b.reportValidity&&(b.setCustomValidity(ei(T)?"":T||""),b.reportValidity())},w={},x=E_(o),_=gf(o),k=x||_,R=(g||w_(o))&&On(o.value)&&On(v)||Sp(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,F=z3.bind(null,p,r,w),V=(T,L,S,C=Ss.maxLength,N=Ss.minLength)=>{const U=T?L:S;w[p]={type:T?C:N,message:U,ref:o,...F(T?C:N,U)}};if(s?!Array.isArray(v)||!v.length:c&&(!k&&(R||ur(v))||ei(v)&&!v||_&&!nO(a).isValid||x&&!rO(a).isValid)){const{value:T,message:L}=zh(c)?{value:!!c,message:c}:xc(c);if(T&&(w[p]={type:Ss.required,message:L,ref:b,...F(Ss.required,L)},!r))return E(L),w}if(!R&&(!ur(d)||!ur(f))){let T,L;const S=xc(f),C=xc(d);if(!ur(v)&&!isNaN(v)){const N=o.valueAsNumber||v&&+v;ur(S.value)||(T=N>S.value),ur(C.value)||(L=N<C.value)}else{const N=o.valueAsDate||new Date(v),U=q=>new Date(new Date().toDateString()+" "+q),K=o.type=="time",$=o.type=="week";Xi(S.value)&&v&&(T=K?U(v)>U(S.value):$?v>S.value:N>new Date(S.value)),Xi(C.value)&&v&&(L=K?U(v)<U(C.value):$?v<C.value:N<new Date(C.value))}if((T||L)&&(V(!!T,S.message,C.message,Ss.max,Ss.min),!r))return E(w[p].message),w}if((u||l)&&!R&&(Xi(v)||s&&Array.isArray(v))){const T=xc(u),L=xc(l),S=!ur(T.value)&&v.length>+T.value,C=!ur(L.value)&&v.length<+L.value;if((S||C)&&(V(S,T.message,L.message),!r))return E(w[p].message),w}if(h&&!R&&Xi(v)){const{value:T,message:L}=xc(h);if(xp(T)&&!v.match(T)&&(w[p]={type:Ss.pattern,message:L,ref:o,...F(Ss.pattern,L)},!r))return E(L),w}if(m){if(Ki(m)){const T=await m(v,n),L=nS(T,b);if(L&&(w[p]={...L,...F(Ss.validate,L.message)},!r))return E(L.message),w}else if(kn(m)){let T={};for(const L in m){if(!Er(T)&&!r)break;const S=nS(await m[L](v,n),b,L);S&&(T={...S,...F(L,S.message)},E(S.message),r&&(w[p]=T))}if(!Er(T)&&(w[p]={ref:b,...T},!r))return w}}return E(!0),w};function H3(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=On(t)?r++:t[e[r++]];return t}function W3(t){for(const e in t)if(t.hasOwnProperty(e)&&!On(t[e]))return!1;return!0}function Ln(t,e){const n=Array.isArray(e)?e:v_(e)?[e]:J1(e),r=n.length===1?t:H3(t,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(kn(r)&&Er(r)||Array.isArray(r)&&W3(r))&&Ln(t,n.slice(0,-1)),t}var fy=()=>{let t=[];return{get observers(){return t},next:i=>{for(const s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}},yv=t=>ur(t)||!Z1(t);function bo(t,e){if(yv(t)||yv(e))return t===e;if(fa(t)&&fa(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const s=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=e[i];if(fa(s)&&fa(o)||kn(s)&&kn(o)||Array.isArray(s)&&Array.isArray(o)?!bo(s,o):s!==o)return!1}}return!0}var iO=t=>t.type==="select-multiple",q3=t=>E_(t)||gf(t),hy=t=>Sp(t)&&t.isConnected,sO=t=>{for(const e in t)if(Ki(t[e]))return!0;return!1};function Tp(t,e={}){const n=Array.isArray(t);if(kn(t)||n)for(const r in t)Array.isArray(t[r])||kn(t[r])&&!sO(t[r])?(e[r]=Array.isArray(t[r])?[]:{},Tp(t[r],e[r])):ur(t[r])||(e[r]=!0);return e}function oO(t,e,n){const r=Array.isArray(t);if(kn(t)||r)for(const i in t)Array.isArray(t[i])||kn(t[i])&&!sO(t[i])?On(e)||yv(n[i])?n[i]=Array.isArray(t[i])?Tp(t[i],[]):{...Tp(t[i])}:oO(t[i],ur(e)?{}:e[i],n[i]):n[i]=!bo(t[i],e[i]);return n}var ll=(t,e)=>oO(t,e,Tp(e)),aO=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>On(t)?t:e?t===""?NaN:t&&+t:n&&Xi(t)?new Date(t):r?r(t):t;function py(t){const e=t.ref;return w_(e)?e.files:E_(e)?rO(t.refs).value:iO(e)?[...e.selectedOptions].map(({value:n})=>n):gf(e)?nO(t.refs).value:aO(On(e.value)?t.ref.value:e.value,t)}var G3=(t,e,n,r)=>{const i={};for(const s of t){const o=Re(e,s);o&&nn(i,s,o._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},dl=t=>On(t)?t:xp(t)?t.source:kn(t)?xp(t.value)?t.value.source:t.value:t;const iS="AsyncFunction";var Z3=t=>!!t&&!!t.validate&&!!(Ki(t.validate)&&t.validate.constructor.name===iS||kn(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===iS)),Y3=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function sS(t,e,n){const r=Re(t,n);if(r||v_(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=Re(e,s),a=Re(t,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:n}}var K3=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,J3=(t,e)=>!Ym(Re(t,e)).length&&Ln(t,e);const X3={mode:bi.onSubmit,reValidateMode:bi.onChange,shouldFocusError:!0};function Q3(t={}){let e={...X3,...t},n={submitCount:0,isDirty:!1,isLoading:Ki(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=kn(e.defaultValues)||kn(e.values)?wr(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:wr(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const l={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:fy(),array:fy(),state:fy()},f=JE(e.mode),h=JE(e.reValidateMode),m=e.criteriaMode===bi.all,p=I=>A=>{clearTimeout(u),u=setTimeout(I,A)},g=async I=>{if(!e.disabled&&(l.isValid||I)){const A=e.resolver?Er((await k()).errors):await F(r,!0);A!==n.isValid&&d.state.next({isValid:A})}},y=(I,A)=>{!e.disabled&&(l.isValidating||l.validatingFields)&&((I||Array.from(a.mount)).forEach(G=>{G&&(A?nn(n.validatingFields,G,A):Ln(n.validatingFields,G))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Er(n.validatingFields)}))},v=(I,A=[],G,Q,H=!0,ee=!0)=>{if(Q&&G&&!e.disabled){if(o.action=!0,ee&&Array.isArray(Re(r,I))){const de=G(Re(r,I),Q.argA,Q.argB);H&&nn(r,I,de)}if(ee&&Array.isArray(Re(n.errors,I))){const de=G(Re(n.errors,I),Q.argA,Q.argB);H&&nn(n.errors,I,de),J3(n.errors,I)}if(l.touchedFields&&ee&&Array.isArray(Re(n.touchedFields,I))){const de=G(Re(n.touchedFields,I),Q.argA,Q.argB);H&&nn(n.touchedFields,I,de)}l.dirtyFields&&(n.dirtyFields=ll(i,s)),d.state.next({name:I,isDirty:T(I,A),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else nn(s,I,A)},b=(I,A)=>{nn(n.errors,I,A),d.state.next({errors:n.errors})},E=I=>{n.errors=I,d.state.next({errors:n.errors,isValid:!1})},w=(I,A,G,Q)=>{const H=Re(r,I);if(H){const ee=Re(s,I,On(G)?Re(i,I):G);On(ee)||Q&&Q.defaultChecked||A?nn(s,I,A?ee:py(H._f)):C(I,ee),o.mount&&g()}},x=(I,A,G,Q,H)=>{let ee=!1,de=!1;const fe={name:I};if(!e.disabled){const De=!!(Re(r,I)&&Re(r,I)._f&&Re(r,I)._f.disabled);if(!G||Q){l.isDirty&&(de=n.isDirty,n.isDirty=fe.isDirty=T(),ee=de!==fe.isDirty);const rt=De||bo(Re(i,I),A);de=!!(!De&&Re(n.dirtyFields,I)),rt||De?Ln(n.dirtyFields,I):nn(n.dirtyFields,I,!0),fe.dirtyFields=n.dirtyFields,ee=ee||l.dirtyFields&&de!==!rt}if(G){const rt=Re(n.touchedFields,I);rt||(nn(n.touchedFields,I,G),fe.touchedFields=n.touchedFields,ee=ee||l.touchedFields&&rt!==G)}ee&&H&&d.state.next(fe)}return ee?fe:{}},_=(I,A,G,Q)=>{const H=Re(n.errors,I),ee=l.isValid&&ei(A)&&n.isValid!==A;if(e.delayError&&G?(c=p(()=>b(I,G)),c(e.delayError)):(clearTimeout(u),c=null,G?nn(n.errors,I,G):Ln(n.errors,I)),(G?!bo(H,G):H)||!Er(Q)||ee){const de={...Q,...ee&&ei(A)?{isValid:A}:{},errors:n.errors,name:I};n={...n,...de},d.state.next(de)}},k=async I=>{y(I,!0);const A=await e.resolver(s,e.context,G3(I||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return y(I),A},R=async I=>{const{errors:A}=await k(I);if(I)for(const G of I){const Q=Re(A,G);Q?nn(n.errors,G,Q):Ln(n.errors,G)}else n.errors=A;return A},F=async(I,A,G={valid:!0})=>{for(const Q in I){const H=I[Q];if(H){const{_f:ee,...de}=H;if(ee){const fe=a.array.has(ee.name),De=H._f&&Z3(H._f);De&&l.validatingFields&&y([Q],!0);const rt=await rS(H,a.disabled,s,m,e.shouldUseNativeValidation&&!A,fe);if(De&&l.validatingFields&&y([Q]),rt[ee.name]&&(G.valid=!1,A))break;!A&&(Re(rt,ee.name)?fe?V3(n.errors,rt,ee.name):nn(n.errors,ee.name,rt[ee.name]):Ln(n.errors,ee.name))}!Er(de)&&await F(de,A,G)}}return G.valid},V=()=>{for(const I of a.unMount){const A=Re(r,I);A&&(A._f.refs?A._f.refs.every(G=>!hy(G)):!hy(A._f.ref))&&le(I)}a.unMount=new Set},T=(I,A)=>!e.disabled&&(I&&A&&nn(s,I,A),!bo(j(),i)),L=(I,A,G)=>tO(I,a,{...o.mount?s:On(A)?i:Xi(I)?{[I]:A}:A},G,A),S=I=>Ym(Re(o.mount?s:i,I,e.shouldUnregister?Re(i,I,[]):[])),C=(I,A,G={})=>{const Q=Re(r,I);let H=A;if(Q){const ee=Q._f;ee&&(!ee.disabled&&nn(s,I,aO(A,ee)),H=Sp(ee.ref)&&ur(A)?"":A,iO(ee.ref)?[...ee.ref.options].forEach(de=>de.selected=H.includes(de.value)):ee.refs?gf(ee.ref)?ee.refs.length>1?ee.refs.forEach(de=>(!de.defaultChecked||!de.disabled)&&(de.checked=Array.isArray(H)?!!H.find(fe=>fe===de.value):H===de.value)):ee.refs[0]&&(ee.refs[0].checked=!!H):ee.refs.forEach(de=>de.checked=de.value===H):w_(ee.ref)?ee.ref.value="":(ee.ref.value=H,ee.ref.type||d.values.next({name:I,values:{...s}})))}(G.shouldDirty||G.shouldTouch)&&x(I,H,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&q(I)},N=(I,A,G)=>{for(const Q in A){const H=A[Q],ee=`${I}.${Q}`,de=Re(r,ee);(a.array.has(I)||kn(H)||de&&!de._f)&&!fa(H)?N(ee,H,G):C(ee,H,G)}},U=(I,A,G={})=>{const Q=Re(r,I),H=a.array.has(I),ee=wr(A);nn(s,I,ee),H?(d.array.next({name:I,values:{...s}}),(l.isDirty||l.dirtyFields)&&G.shouldDirty&&d.state.next({name:I,dirtyFields:ll(i,s),isDirty:T(I,ee)})):Q&&!Q._f&&!ur(ee)?N(I,ee,G):C(I,ee,G),XE(I,a)&&d.state.next({...n}),d.values.next({name:o.mount?I:void 0,values:{...s}})},K=async I=>{o.mount=!0;const A=I.target;let G=A.name,Q=!0;const H=Re(r,G),ee=()=>A.type?py(H._f):Y1(I),de=fe=>{Q=Number.isNaN(fe)||fa(fe)&&isNaN(fe.getTime())||bo(fe,Re(s,G,fe))};if(H){let fe,De;const rt=ee(),Xe=I.type===Ep.BLUR||I.type===Ep.FOCUS_OUT,tn=!Y3(H._f)&&!e.resolver&&!Re(n.errors,G)&&!H._f.deps||K3(Xe,Re(n.touchedFields,G),n.isSubmitted,h,f),sr=XE(G,a,Xe);nn(s,G,rt),Xe?(H._f.onBlur&&H._f.onBlur(I),c&&c(0)):H._f.onChange&&H._f.onChange(I);const vn=x(G,rt,Xe,!1),Zr=!Er(vn)||sr;if(!Xe&&d.values.next({name:G,type:I.type,values:{...s}}),tn)return l.isValid&&(e.mode==="onBlur"&&Xe?g():Xe||g()),Zr&&d.state.next({name:G,...sr?{}:vn});if(!Xe&&sr&&d.state.next({...n}),e.resolver){const{errors:Rt}=await k([G]);if(de(rt),Q){const Nr=sS(n.errors,r,G),ai=sS(Rt,r,Nr.name||G);fe=ai.error,G=ai.name,De=Er(Rt)}}else y([G],!0),fe=(await rS(H,a.disabled,s,m,e.shouldUseNativeValidation))[G],y([G]),de(rt),Q&&(fe?De=!1:l.isValid&&(De=await F(r,!0)));Q&&(H._f.deps&&q(H._f.deps),_(G,De,fe,vn))}},$=(I,A)=>{if(Re(n.errors,A)&&I.focus)return I.focus(),1},q=async(I,A={})=>{let G,Q;const H=$l(I);if(e.resolver){const ee=await R(On(I)?I:H);G=Er(ee),Q=I?!H.some(de=>Re(ee,de)):G}else I?(Q=(await Promise.all(H.map(async ee=>{const de=Re(r,ee);return await F(de&&de._f?{[ee]:de}:de)}))).every(Boolean),!(!Q&&!n.isValid)&&g()):Q=G=await F(r);return d.state.next({...!Xi(I)||l.isValid&&G!==n.isValid?{}:{name:I},...e.resolver||!I?{isValid:G}:{},errors:n.errors}),A.shouldFocus&&!Q&&jl(r,$,I?H:a.mount),Q},j=I=>{const A={...o.mount?s:i};return On(I)?A:Xi(I)?Re(A,I):I.map(G=>Re(A,G))},D=(I,A)=>({invalid:!!Re((A||n).errors,I),isDirty:!!Re((A||n).dirtyFields,I),error:Re((A||n).errors,I),isValidating:!!Re(n.validatingFields,I),isTouched:!!Re((A||n).touchedFields,I)}),X=I=>{I&&$l(I).forEach(A=>Ln(n.errors,A)),d.state.next({errors:I?n.errors:{}})},Z=(I,A,G)=>{const Q=(Re(r,I,{_f:{}})._f||{}).ref,H=Re(n.errors,I)||{},{ref:ee,message:de,type:fe,...De}=H;nn(n.errors,I,{...De,...A,ref:Q}),d.state.next({name:I,errors:n.errors,isValid:!1}),G&&G.shouldFocus&&Q&&Q.focus&&Q.focus()},z=(I,A)=>Ki(I)?d.values.subscribe({next:G=>I(L(void 0,A),G)}):L(I,A,!0),le=(I,A={})=>{for(const G of I?$l(I):a.mount)a.mount.delete(G),a.array.delete(G),A.keepValue||(Ln(r,G),Ln(s,G)),!A.keepError&&Ln(n.errors,G),!A.keepDirty&&Ln(n.dirtyFields,G),!A.keepTouched&&Ln(n.touchedFields,G),!A.keepIsValidating&&Ln(n.validatingFields,G),!e.shouldUnregister&&!A.keepDefaultValue&&Ln(i,G);d.values.next({values:{...s}}),d.state.next({...n,...A.keepDirty?{isDirty:T()}:{}}),!A.keepIsValid&&g()},pe=({disabled:I,name:A,field:G,fields:Q})=>{(ei(I)&&o.mount||I||a.disabled.has(A))&&(I?a.disabled.add(A):a.disabled.delete(A),x(A,py(G?G._f:Re(Q,A)._f),!1,!1,!0))},ve=(I,A={})=>{let G=Re(r,I);const Q=ei(A.disabled)||ei(e.disabled);return nn(r,I,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:I}},name:I,mount:!0,...A}}),a.mount.add(I),G?pe({field:G,disabled:ei(A.disabled)?A.disabled:e.disabled,name:I}):w(I,!0,A.value),{...Q?{disabled:A.disabled||e.disabled}:{},...e.progressive?{required:!!A.required,min:dl(A.min),max:dl(A.max),minLength:dl(A.minLength),maxLength:dl(A.maxLength),pattern:dl(A.pattern)}:{},name:I,onChange:K,onBlur:K,ref:H=>{if(H){ve(I,A),G=Re(r,I);const ee=On(H.value)&&H.querySelectorAll&&H.querySelectorAll("input,select,textarea")[0]||H,de=q3(ee),fe=G._f.refs||[];if(de?fe.find(De=>De===ee):ee===G._f.ref)return;nn(r,I,{_f:{...G._f,...de?{refs:[...fe.filter(hy),ee,...Array.isArray(Re(i,I))?[{}]:[]],ref:{type:ee.type,name:I}}:{ref:ee}}}),w(I,!1,void 0,ee)}else G=Re(r,I,{}),G._f&&(G._f.mount=!1),(e.shouldUnregister||A.shouldUnregister)&&!(K1(a.array,I)&&o.action)&&a.unMount.add(I)}}},je=()=>e.shouldFocusError&&jl(r,$,a.mount),ct=I=>{ei(I)&&(d.state.next({disabled:I}),jl(r,(A,G)=>{const Q=Re(r,G);Q&&(A.disabled=Q._f.disabled||I,Array.isArray(Q._f.refs)&&Q._f.refs.forEach(H=>{H.disabled=Q._f.disabled||I}))},0,!1))},ut=(I,A)=>async G=>{let Q;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let H=wr(s);if(a.disabled.size)for(const ee of a.disabled)nn(H,ee,void 0);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:ee,values:de}=await k();n.errors=ee,H=de}else await F(r);if(Ln(n.errors,"root"),Er(n.errors)){d.state.next({errors:{}});try{await I(H,G)}catch(ee){Q=ee}}else A&&await A({...n.errors},G),je(),setTimeout(je);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Er(n.errors)&&!Q,submitCount:n.submitCount+1,errors:n.errors}),Q)throw Q},Ye=(I,A={})=>{Re(r,I)&&(On(A.defaultValue)?U(I,wr(Re(i,I))):(U(I,A.defaultValue),nn(i,I,wr(A.defaultValue))),A.keepTouched||Ln(n.touchedFields,I),A.keepDirty||(Ln(n.dirtyFields,I),n.isDirty=A.defaultValue?T(I,wr(Re(i,I))):T()),A.keepError||(Ln(n.errors,I),l.isValid&&g()),d.state.next({...n}))},Ot=(I,A={})=>{const G=I?wr(I):i,Q=wr(G),H=Er(I),ee=H?i:Q;if(A.keepDefaultValues||(i=G),!A.keepValues){if(A.keepDirtyValues){const de=new Set([...a.mount,...Object.keys(ll(i,s))]);for(const fe of Array.from(de))Re(n.dirtyFields,fe)?nn(ee,fe,Re(s,fe)):U(fe,Re(ee,fe))}else{if(y_&&On(I))for(const de of a.mount){const fe=Re(r,de);if(fe&&fe._f){const De=Array.isArray(fe._f.refs)?fe._f.refs[0]:fe._f.ref;if(Sp(De)){const rt=De.closest("form");if(rt){rt.reset();break}}}}r={}}s=e.shouldUnregister?A.keepDefaultValues?wr(i):{}:wr(ee),d.array.next({values:{...ee}}),d.values.next({values:{...ee}})}a={mount:A.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!A.keepIsValid||!!A.keepDirtyValues,o.watch=!!e.shouldUnregister,d.state.next({submitCount:A.keepSubmitCount?n.submitCount:0,isDirty:H?!1:A.keepDirty?n.isDirty:!!(A.keepDefaultValues&&!bo(I,i)),isSubmitted:A.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:H?{}:A.keepDirtyValues?A.keepDefaultValues&&s?ll(i,s):n.dirtyFields:A.keepDefaultValues&&I?ll(i,I):A.keepDirty?n.dirtyFields:{},touchedFields:A.keepTouched?n.touchedFields:{},errors:A.keepErrors?n.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},O=(I,A)=>Ot(Ki(I)?I(s):I,A);return{control:{register:ve,unregister:le,getFieldState:D,handleSubmit:ut,setError:Z,_executeSchema:k,_getWatch:L,_getDirty:T,_updateValid:g,_removeUnmounted:V,_updateFieldArray:v,_updateDisabledField:pe,_getFieldArray:S,_reset:Ot,_resetDefaultValues:()=>Ki(e.defaultValues)&&e.defaultValues().then(I=>{O(I,e.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:I=>{n={...n,...I}},_disableForm:ct,_subjects:d,_proxyFormState:l,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(I){o=I},get _defaultValues(){return i},get _names(){return a},set _names(I){a=I},get _formState(){return n},set _formState(I){n=I},get _options(){return e},set _options(I){e={...e,...I}}},trigger:q,register:ve,handleSubmit:ut,watch:z,setValue:U,getValues:j,reset:O,resetField:Ye,clearErrors:X,unregister:le,setError:Z,setFocus:(I,A={})=>{const G=Re(r,I),Q=G&&G._f;if(Q){const H=Q.refs?Q.refs[0]:Q.ref;H.focus&&(H.focus(),A.shouldSelect&&Ki(H.select)&&H.select())}},getFieldState:D}}function S_(t={}){const e=$e.useRef(void 0),n=$e.useRef(void 0),[r,i]=$e.useState({isDirty:!1,isValidating:!1,isLoading:Ki(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Ki(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...Q3(t),formState:r});const s=e.current.control;return s._options=t,__({subject:s._subjects.state,next:o=>{Q1(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),$e.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),$e.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),$e.useEffect(()=>{t.values&&!bo(t.values,n.current)?(s._reset(t.values,s._options.resetOptions),n.current=t.values,i(o=>({...o}))):s._resetDefaultValues()},[t.values,s]),$e.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),$e.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),$e.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),e.current.formState=X1(r,s),e.current}function Ip(t){const{children:e,className:n,...r}=t;return P("label",{...r,className:Bt("mb-3 block font-semibold text-gray-500",n),children:e})}const Pa=ec(function(t,e){const{icon:n,errorMessage:r,isDirty:i,containerClassName:s,inputClassName:o,errorMessageClassName:a,hideErrors:c=!1,...u}=t,l=t.type??"text",d=!!r;return Ee("div",{children:[Ee("div",{className:Bt("mb-1 flex gap-2 rounded-xl border border-transparent bg-gray-100 p-3 text-gray-800 placeholder:text-gray-500",d&&"border-red-900",s),children:[n&&P("span",{className:hf((!i||d)&&"text-slate-200"),children:n}),P("input",{...u,className:Bt("w-full bg-transparent font-semibold outline-none",o),ref:e,type:l})]}),P("p",{className:Bt("hidden min-h-4 text-xs text-red-900",d&&"block",c&&"hidden",a),children:r})]})});function e4(t){return $e.forwardRef(t)}const t4=e4(function(t,e){const{items:n,value:r,id:i,onChange:s,containerClassName:o,menuClassName:a,itemClassName:c,absolutePositionMenu:u=!1,borderRadius:l="12px"}=t,[d,f]=We(!1),h=p(r)??n[0];function m(y){y.disabled||(s(y.value),f(!1))}function p(y){return n.find(v=>v.value===y)}const g=n.filter(y=>y.value!==r);return Ee("div",{className:Bt("bg-gray-100 transition-[border-radius]",u&&"relative",o),"data-open":d,ref:e,style:{borderRadius:d?`${l} ${l} 0 0`:l},children:[Ee("div",{className:Bt("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",a),id:i,onClick:()=>f(!d),children:[P(oS,{...h,className:c}),P(vt,{className:hf("transition",d?"":"-rotate-90"),name:"ChevronDown"})]}),P("div",{className:Bt("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",d&&"max-h-screen",u&&"absolute"),style:{borderRadius:`0 0 ${l} ${l}`},children:g.map(y=>P(oS,{...y,className:c,onItemClick:()=>m(y)},y.value))})]})});function oS(t){const{className:e,disabled:n,onItemClick:r,icon:i,displayValue:s,value:o,description:a}=t;return Ee("div",{className:Bt(n?"cursor-not-allowed text-gray-500":"text-gray-800","flex size-full cursor-pointer items-center gap-2 bg-inherit py-3 pl-3 text-start outline-none",e),onClick:r,children:[i,Ee("div",{children:[P("p",{className:"capitalize text-inherit",children:s??o.toLowerCase()}),P("p",{className:"text-xs text-inherit",children:a})]})]})}function cO(t){const{control:e,...n}=t;return P(B3,{control:e,name:"sharingType",render:({field:r})=>P(t4,{...n,...r,id:"sharingType",items:pj})})}function x_(t){const{location:e,className:n,...r}=t,i=mj[e];return Ee("div",{...r,className:Bt("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",n),children:[i.icon,Ee("div",{children:[P("p",{children:i.title}),P("p",{className:"text-xs text-slate-200",children:i.description})]})]})}const n4=ec(function(t,e){return Ee("label",{className:"relative cursor-pointer items-center",htmlFor:t.id,children:[P("input",{className:"peer sr-only",ref:e,type:"checkbox",value:"",...t}),P("div",{className:"peer h-6 w-11 rounded-full bg-gray-500 after:absolute after:start-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-gray-50 after:transition-all peer-checked:bg-blue-900 peer-checked:after:translate-x-full peer-focus:outline-none"})]})}),T_=ec(function(t,e){return Ee("div",{className:"flex items-center rounded-xl bg-gray-100 p-3 text-slate-200",children:[Ee("div",{className:"flex-1",children:[P("label",{className:"font-semibold",htmlFor:"availableOffline",children:"Make available offline"}),Ee("p",{className:"text-xs text-gray-500",children:["Check this options if you keep a local backup",P("br",{}),"available at all times."]})]}),P(n4,{id:"availableOffline",ref:e,...t})]})});function r4(t){var e;const[n,r]=We(!1),[i,s]=We(!1),{register:o,handleSubmit:a,control:c,formState:{errors:u}}=S_({defaultValues:{name:"",sharingType:jb,availableOffline:!1}});return Ee("form",{onSubmit:a(t.onSubmit),children:[P(Ip,{htmlFor:"driveName",children:"Drive Name"}),P(Pa,{...o("name",{required:"Drive name is required"}),errorMessage:(e=u.name)==null?void 0:e.message,icon:P(vt,{name:"Drive"}),placeholder:"Drive name"}),P(Ir,{className:"my-4"}),P(Ip,{htmlFor:"sharingType",children:"Sharing settings"}),P(cO,{control:c}),P(Ir,{className:"my-3"}),P(gu,{isOpen:i,onOpenChange:()=>s(!i),title:"Upload from device",children:P("div",{className:"mt-3 grid h-[117px] w-full place-items-center rounded-xl bg-gray-200",children:Ee("div",{className:"rounded-xl bg-white p-3 text-xs",children:[P(vt,{className:"mr-2 inline-block",name:"ArrowUp",size:20}),"Click or drop folder"]})})}),P(Ir,{className:"my-3"}),Ee(gu,{isOpen:n,onOpenChange:()=>r(!n),title:"Location",children:[P(x_,{location:ap}),P(T_,{...o("availableOffline")})]}),P(Ir,{className:"my-3"}),P(zn,{className:"mb-4 w-full",type:"submit",children:"Create new drive"})]})}function i4(t){return Ee("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[P(vt,{className:"text-gray-600",name:"Drive"}),t.driveName]})}function s4(t){const{sharingType:e=Ub,requestPublicDrive:n}=t,[r,i]=We(),[s,o]=We(!1),[a,c]=We(!0),[u,l]=We(!1),[d,f]=We(""),[h,m]=We(""),[p,g]=HM(h,500),{register:y,handleSubmit:v,setValue:b}=S_({mode:"onBlur",defaultValues:{availableOffline:(r==null?void 0:r.availableOffline)??!1}});Dt(()=>{g(h)},[h]),Dt(()=>{if(l(!1),p==="")return;w().catch(console.error);async function w(){try{const{id:x,name:_}=await n(p);i({id:x,name:_,sharingType:e,location:ap,availableOffline:!0}),b("availableOffline",!0),c(!0),f("")}catch(x){i(void 0),c(!1),f(x.message)}}},[p,b,e]);function E({availableOffline:w}){r&&t.onSubmit({...r,availableOffline:w,url:p})}return Ee("form",{onSubmit:v(E),children:[P(Ip,{htmlFor:"url",children:"Add existing drive"}),u?Ee(Us,{children:[P(i4,{driveName:(r==null?void 0:r.name)??"New drive"}),P(Ir,{className:"my-3"}),Ee(gu,{isOpen:s,onOpenChange:()=>o(!s),title:"Location",children:[P(x_,{location:ap}),P(T_,{...y("availableOffline")})]}),P(Ir,{className:"my-3"}),P(zn,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add drive"})]}):Ee(Us,{children:[P(Pa,{errorMessage:d,icon:P(vt,{name:"BrickGlobe"}),onChange:w=>m(w.target.value),placeholder:"Drive URL",required:!0,type:"url",value:h}),P(Ir,{className:"mb-3"}),P(zn,{className:"mt-4 w-full",color:"light",disabled:!a||h==="",onClick:w=>{w.preventDefault(),l(!0)},type:"button",children:"Confirm URL"})]})]})}const uO=ec(function(t,e){return P(Pa,{...t,icon:t.icon??P(vt,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:e})});function o4(t){const{uiDriveNode:e,handleDeleteDrive:n,onCancel:r}=t,[i,s]=We(""),o=i===e.name;function a(){o&&n()}return Ee("div",{children:[P("p",{className:"mb-2 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"}),P(uO,{icon:P(vt,{name:"Lock"}),onChange:c=>s(c.target.value),placeholder:"Enter drive name...",value:i}),Ee("div",{className:"flex gap-3",children:[P(zn,{className:"w-full",color:"light",onClick:r,children:"Cancel"}),P(zn,{className:"w-full",color:"red",disabled:!o,onClick:a,children:"Delete"})]})]})}function a4(t){const{uiDriveNode:e,onSubmit:n}=t,{name:r,sharingType:i,availableOffline:s}=e,[o,a]=We(!1),[c,u]=We(!1),[l,d]=We(!1),{register:f,handleSubmit:h,control:m}=S_({mode:"onBlur",defaultValues:{name:r,sharingType:i,availableOffline:s}}),p=i===Ub?ap:i;return Ee("form",{onSubmit:h(n),children:[P(uO,{...f("name")}),P(Ir,{className:"my-4"}),P(Ip,{htmlFor:"sharingType",children:"Sharing settings"}),P(cO,{control:m}),P(Ir,{className:"my-3"}),Ee(gu,{isOpen:o,onOpenChange:()=>a(!o),title:"Location",children:[P(x_,{location:p}),P(T_,{...f("availableOffline")})]}),P(Ir,{className:"my-3"}),P(gu,{isOpen:c,onOpenChange:()=>u(!c),title:"Danger zone",children:Ee("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>d(!0),type:"button",children:[P(vt,{name:"Trash"}),"Delete drive"]})}),l&&c?P(o4,{...t,onCancel:()=>d(!1)}):Ee(Us,{children:[P(Ir,{className:"my-3"}),P(zn,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}var I_="Dialog",[lO,jie]=bj(I_),[c4,Pi]=lO(I_),dO=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=Y.useRef(null),c=Y.useRef(null),[u=!1,l]=wj({prop:r,defaultProp:i,onChange:s});return P(c4,{scope:e,triggerRef:a,contentRef:c,contentId:ey(),titleId:ey(),descriptionId:ey(),open:u,onOpenChange:l,onOpenToggle:Y.useCallback(()=>l(d=>!d),[l]),modal:o,children:n})};dO.displayName=I_;var fO="DialogTrigger",u4=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(fO,n),s=rc(e,i.triggerRef);return P(ps.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":k_(i.open),...r,ref:s,onClick:Do(t.onClick,i.onOpenToggle)})});u4.displayName=fO;var O_="DialogPortal",[l4,hO]=lO(O_,{forceMount:void 0}),pO=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=Pi(O_,e);return P(l4,{scope:e,forceMount:n,children:Y.Children.map(r,o=>P(Hm,{present:n||s.open,children:P(u1,{asChild:!0,container:i,children:o})}))})};pO.displayName=O_;var Op="DialogOverlay",mO=Y.forwardRef((t,e)=>{const n=hO(Op,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Pi(Op,t.__scopeDialog);return s.modal?P(Hm,{present:r||s.open,children:P(d4,{...i,ref:e})}):null});mO.displayName=Op;var d4=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(Op,n);return P(v1,{as:u_,allowPinchZoom:!0,shards:[i.contentRef],children:P(ps.div,{"data-state":k_(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Ma="DialogContent",gO=Y.forwardRef((t,e)=>{const n=hO(Ma,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Pi(Ma,t.__scopeDialog);return P(Hm,{present:r||s.open,children:s.modal?P(f4,{...i,ref:e}):P(h4,{...i,ref:e})})});gO.displayName=Ma;var f4=Y.forwardRef((t,e)=>{const n=Pi(Ma,t.__scopeDialog),r=Y.useRef(null),i=rc(e,n.contentRef,r);return Y.useEffect(()=>{const s=r.current;if(s)return e5(s)},[]),P(yO,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Do(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Do(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Do(t.onFocusOutside,s=>s.preventDefault())})}),h4=Y.forwardRef((t,e)=>{const n=Pi(Ma,t.__scopeDialog),r=Y.useRef(!1),i=Y.useRef(!1);return P(yO,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),yO=Y.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Pi(Ma,n),c=Y.useRef(null),u=rc(e,c);return Fj(),Ee(Us,{children:[P(a1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:P(s1,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":k_(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),Ee(Us,{children:[P(m4,{titleId:a.titleId}),P(y4,{contentRef:c,descriptionId:a.descriptionId})]})]})}),C_="DialogTitle",vO=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(C_,n);return P(ps.h2,{id:i.titleId,...r,ref:e})});vO.displayName=C_;var bO="DialogDescription",_O=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(bO,n);return P(ps.p,{id:i.descriptionId,...r,ref:e})});_O.displayName=bO;var wO="DialogClose",p4=Y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Pi(wO,n);return P(ps.button,{type:"button",...r,ref:e,onClick:Do(t.onClick,()=>i.onOpenChange(!1))})});p4.displayName=wO;function k_(t){return t?"open":"closed"}var EO="DialogTitleWarning",[Uie,SO]=vj(EO,{contentName:Ma,titleName:C_,docsSlug:"dialog"}),m4=({titleId:t})=>{const e=SO(EO),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
59
|
-
|
|
60
|
-
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
61
|
-
|
|
62
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return Y.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},g4="DialogDescriptionWarning",y4=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${SO(g4).contentName}}.`;return Y.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},v4=dO,b4=pO,_4=mO,w4=gO,E4=vO,S4=_O,x4="VisuallyHidden",xO=Y.forwardRef((t,e)=>P(ps.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));xO.displayName=x4;var T4=xO;function Xs(t){const{title:e,open:n,onOpenChange:r,contentProps:i,overlayProps:s,children:o,...a}=t;return P(v4,{defaultOpen:n,onOpenChange:r,open:n,children:P(b4,{children:P(_4,{...s,className:Bt("fixed inset-0 grid place-items-center overflow-y-auto bg-slate-900/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",s==null?void 0:s.className),children:Ee(w4,{...a,...i,className:Bt("bg-white data-[state=closed]:animate-zoom-out data-[state=open]:animate-zoom-in",i==null?void 0:i.className),children:[Ee(T4,{children:[P(E4,{children:e||"Modal"}),P(S4,{children:e||"Modal"})]}),o]})})})})}function I4(t){const{open:e,onOpenChange:n,onSubmit:r,modalProps:i,containerProps:s}=t;function o(){n(!1)}return P(Xs,{...i,contentProps:{className:"rounded-2xl"},onOpenChange:n,open:e,children:Ee("div",{...s,className:Bt("max-w-[408px] rounded-2xl p-6",s==null?void 0:s.className),children:[Ee("div",{className:"flex justify-between",children:[P("h1",{className:"text-xl font-bold",children:"Create new drive "}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:o,tabIndex:-1,children:P(vt,{name:"XmarkLight",size:24})})]}),P(Ir,{className:"my-4"}),P(r4,{onCancel:o,onSubmit:r})]})})}function O4(t){const{open:e,onOpenChange:n,onSubmit:r,sharingType:i,modalProps:s,containerProps:o,requestPublicDrive:a}=t;function c(){n(!1)}return P(Xs,{...s,contentProps:{className:"rounded-2xl"},onOpenChange:n,open:e,children:Ee("div",{...o,className:Bt("min-w-[408px] max-w-[408px] rounded-2xl p-6",o==null?void 0:o.className),children:[Ee("div",{className:"flex justify-between",children:[P("h1",{className:"text-xl font-bold",children:"Add drive"}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:c,tabIndex:-1,children:P(vt,{name:"XmarkLight",size:24})})]}),P(Ir,{className:"my-4"}),P(s4,{onCancel:c,onSubmit:r,requestPublicDrive:a,sharingType:i})]})})}const aS="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function D_(t){const{body:e,header:n,children:r,onCancel:i,onOpenChange:s,onContinue:o,cancelLabel:a,continueLabel:c,overlayProps:u,contentProps:l,bodyProps:d={},headerProps:f={},containerProps:h={},cancelButtonProps:m={},continueButtonProps:p={},buttonContainerProps:g={},...y}=t;return P(Xs,{contentProps:{...l,className:Bt("rounded-3xl",l==null?void 0:l.className)},onOpenChange:s,overlayProps:{...u,className:u==null?void 0:u.className},...y,children:Ee("div",{...ti(h,"w-[400px] p-6 text-slate-300"),children:[P("div",{...ti(f,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),Ee("div",{...ti(d,"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200"),children:[e,r]}),Ee("div",{...ti(g,"mt-8 flex justify-between gap-3"),children:[P("button",{onClick:i,...ti(m,Bt(aS,"flex-1 bg-slate-50 text-slate-800")),children:a}),P("button",{onClick:o,...ti(p,Bt(aS,"flex-1 bg-gray-800 text-gray-50")),children:c})]})]})})}const cS="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all",uS=300;function C4(t){const{onOpenChange:e,onContinue:n,overlayProps:r,contentProps:i,...s}=t,[o,a]=We(""),c=()=>{e==null||e(!1),setTimeout(()=>a(""),uS)},u=()=>{n(o),setTimeout(()=>a(""),uS)};return P(Xs,{contentProps:{...i,className:Bt("rounded-3xl",i==null?void 0:i.className)},onOpenChange:e,overlayProps:{...r,className:r==null?void 0:r.className},...s,children:Ee("div",{className:"w-[400px] p-6 text-slate-300",children:[P("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),P("div",{className:"my-6",children:P(Pa,{icon:P(vt,{name:"BrickGlobe"}),onChange:l=>a(l.target.value),placeholder:"Document name",required:!0,value:o})}),Ee("div",{className:"mt-8 flex justify-between gap-3",children:[P("button",{className:Bt(cS,"flex-1 bg-slate-50 text-slate-800"),onClick:c,children:"Cancel"}),P(zn,{className:Bt(cS,"flex-1 bg-gray-800 text-gray-50"),onClick:u,children:"Create"})]})]})})}const k4=t=>{const{inputPlaceholder:e,body:n,driveName:r,...i}=t,[s,o]=We("");return P(D_,{bodyProps:{className:"p-0 bg-white my-0"},containerProps:{className:"w-[450px]"},continueButtonProps:{disabled:s!==r,className:s!==r?"bg-red-600 hover:scale-100 cursor-not-allowed active:opacity-100":"bg-red-900"},...i,children:Ee("div",{children:[P("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:n}),P("div",{children:P(Pa,{hideErrors:!0,icon:P(vt,{name:"Lock"}),onChange:a=>o(a.target.value),placeholder:e,value:s})})]})})};function D4(t){const{onDelete:e,deleteLabel:n,...r}=t;return P(D_,{...r,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:n,onContinue:e})}function R4(t){const{uiDriveNode:e,open:n,onOpenChange:r,onDeleteDrive:i,onRenameDrive:s,onChangeSharingType:o,onChangeAvailableOffline:a,modalProps:c,containerProps:u}=t,l=h=>{h.name!==e.name&&s(e,h.name),h.sharingType!==e.sharingType&&o(e,h.sharingType),h.availableOffline!==e.availableOffline&&a(e,h.availableOffline),r(!1)};function d(){i(e),r(!1)}function f(){r(!1)}return P(Xs,{...c,contentProps:{className:"rounded-2xl"},onOpenChange:r,open:n,children:Ee("div",{...u,className:Bt("max-w-[408px] rounded-2xl p-6",u==null?void 0:u.className),children:[Ee("div",{className:"flex justify-between",children:[P("h1",{className:"text-xl font-bold",children:"Drive settings"}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:f,tabIndex:-1,children:P(vt,{name:"XmarkLight",size:24})})]}),P(Ir,{className:"my-4"}),P(a4,{handleCancel:f,handleDeleteDrive:d,onSubmit:l,uiDriveNode:e})]})})}const N4="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function TO(t){const{body:e,header:n,children:r,onOpenChange:i,onContinue:s,closeLabel:o,overlayProps:a,contentProps:c,bodyProps:u={},headerProps:l={},containerProps:d={},continueButtonProps:f={},buttonContainerProps:h={},...m}=t,[p,g]=We(!0),y=qt(null);return Dt(()=>{const v=()=>{const E=y.current;E&&(E.scrollHeight>E.clientHeight?(g(!0),E.addEventListener("scroll",b)):g(!1))},b=()=>{const E=y.current;E&&E.scrollHeight-Math.ceil(E.scrollTop)===E.clientHeight&&g(!1)};return requestAnimationFrame(v),()=>{const E=y.current;E&&E.removeEventListener("scroll",b)}},[]),P(Xs,{contentProps:{...c,className:Bt("rounded-3xl outline-none",c==null?void 0:c.className)},onOpenChange:i,overlayProps:{...a,className:a==null?void 0:a.className},...m,children:Ee("div",{...ti(d,"w-[500px] p-6 text-slate-300"),children:[P("div",{...ti(l,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),Ee("div",{ref:y,...ti(u,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center text-slate-200"),children:[e,r]}),P("div",{...ti(h,"mt-8 flex justify-between gap-3"),children:P("button",{disabled:p,onClick:s,...ti(f,Bt(N4,"flex-1 bg-gray-800 text-gray-50",p&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:o})})]})})}const IO=t=>{const{title:e,children:n,description:r,...i}=t;return Ee("div",{...i,children:[e?P("h2",{className:"font-semibold",children:e}):null,Ee("div",{className:"flex items-center justify-between gap-x-12 text-sm font-medium",children:[P("p",{children:r}),P("div",{children:n})]})]})},A4=t=>{const{onClearStorage:e,buttonLabel:n,...r}=t;return P(IO,{...r,children:P(zn,{className:"h-auto min-h-9 rounded border border-solid border-gray-300 bg-white px-3 py-0 text-sm text-red-800 hover:border-gray-500 hover:bg-white hover:text-red-900",icon:P(vt,{name:"Trash",size:18}),iconPosition:"right",onClick:e,children:n})})};var jt;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(jt||(jt={}));var vv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(vv||(vv={}));const Me=jt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cs=t=>{switch(typeof t){case"undefined":return Me.undefined;case"string":return Me.string;case"number":return isNaN(t)?Me.nan:Me.number;case"boolean":return Me.boolean;case"function":return Me.function;case"bigint":return Me.bigint;case"symbol":return Me.symbol;case"object":return Array.isArray(t)?Me.array:t===null?Me.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Me.promise:typeof Map<"u"&&t instanceof Map?Me.map:typeof Set<"u"&&t instanceof Set?Me.set:typeof Date<"u"&&t instanceof Date?Me.date:Me.object;default:return Me.unknown}},xe=jt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),P4=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Cr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),r}static assert(e){if(!(e instanceof Cr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,jt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Cr.create=t=>new Cr(t);const bu=(t,e)=>{let n;switch(t.code){case xe.invalid_type:t.received===Me.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case xe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,jt.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:n=`Unrecognized key(s) in object: ${jt.joinValues(t.keys,", ")}`;break;case xe.invalid_union:n="Invalid input";break;case xe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${jt.joinValues(t.options)}`;break;case xe.invalid_enum_value:n=`Invalid enum value. Expected ${jt.joinValues(t.options)}, received '${t.received}'`;break;case xe.invalid_arguments:n="Invalid function arguments";break;case xe.invalid_return_type:n="Invalid function return type";break;case xe.invalid_date:n="Invalid date";break;case xe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:jt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case xe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case xe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case xe.custom:n="Invalid input";break;case xe.invalid_intersection_types:n="Intersection results could not be merged";break;case xe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case xe.not_finite:n="Number must be finite";break;default:n=e.defaultError,jt.assertNever(t)}return{message:n}};let OO=bu;function M4(t){OO=t}function Cp(){return OO}const kp=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},L4=[];function Ne(t,e){const n=Cp(),r=kp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===bu?void 0:bu].filter(i=>!!i)});t.common.issues.push(r)}class ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return lt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return ir.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return lt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const lt=Object.freeze({status:"aborted"}),$c=t=>({status:"dirty",value:t}),vr=t=>({status:"valid",value:t}),bv=t=>t.status==="aborted",_v=t=>t.status==="dirty",La=t=>t.status==="valid",gd=t=>typeof Promise<"u"&&t instanceof Promise;function Dp(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function CO(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ge||(Ge={}));var El,Sl;class us{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const lS=(t,e)=>{if(La(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Cr(t.common.issues);return this._error=n,this._error}}};function mt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{var c,u;const{message:l}=t;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:(c=l??r)!==null&&c!==void 0?c:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=l??n)!==null&&u!==void 0?u:a.defaultError}},description:i}}class wt{get description(){return this._def.description}_getType(e){return Cs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Cs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ir,ctx:{common:e.parent.common,data:e.data,parsedType:Cs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(gd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cs(e)},s=this._parseSync({data:e,path:i.path,parent:i});return lS(i,s)}"~validate"(e){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cs(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:i});return La(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>La(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Cs(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(gd(i)?i:Promise.resolve(i));return lS(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:xe.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Di({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return rs.create(this,this._def)}nullable(){return Bo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Si.create(this)}promise(){return wu.create(this,this._def)}or(e){return _d.create([this,e],this._def)}and(e){return wd.create(this,e,this._def)}transform(e){return new Di({...mt(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Id({...mt(this._def),innerType:this,defaultValue:n,typeName:ot.ZodDefault})}brand(){return new R_({typeName:ot.ZodBranded,type:this,...mt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Od({...mt(this._def),innerType:this,catchValue:n,typeName:ot.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return yf.create(this,e)}readonly(){return Cd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const F4=/^c[^\s-]{8,}$/i,$4=/^[0-9a-z]+$/,j4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,B4=/^[a-z0-9_-]{21}$/i,z4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,V4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,H4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let my;const q4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,G4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Z4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Y4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,K4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kO="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",X4=new RegExp(`^${kO}$`);function DO(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Q4(t){return new RegExp(`^${DO(t)}$`)}function RO(t){let e=`${kO}T${DO(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function eB(t,e){return!!((e==="v4"||!e)&&q4.test(t)||(e==="v6"||!e)&&Z4.test(t))}function tB(t,e){if(!z4.test(t))return!1;try{const[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function nB(t,e){return!!((e==="v4"||!e)&&G4.test(t)||(e==="v6"||!e)&&Y4.test(t))}class wi extends wt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Me.string){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_type,expected:Me.string,received:s.parsedType}),lt}const r=new ir;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?Ne(i,{code:xe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ne(i,{code:xe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")H4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"email",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")my||(my=new RegExp(W4,"u")),my.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"emoji",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")U4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"uuid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")B4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"nanoid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")F4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"cuid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")$4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"cuid2",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")j4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"ulid",code:xe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ne(i,{validation:"url",code:xe.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"regex",code:xe.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?RO(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?X4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Q4(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?V4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"duration",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?eB(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"ip",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?tB(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"jwt",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?nB(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"cidr",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?K4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"base64",code:xe.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?J4.test(e.data)||(i=this._getOrReturnCtx(e,i),Ne(i,{validation:"base64url",code:xe.invalid_string,message:s.message}),r.dirty()):jt.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:xe.invalid_string,...Ge.errToObj(r)})}_addCheck(e){return new wi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ge.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ge.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ge.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ge.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ge.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Ge.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ge.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ge.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ge.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ge.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ge.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ge.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ge.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ge.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ge.errToObj(n)})}nonempty(e){return this.min(1,Ge.errToObj(e))}trim(){return new wi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}wi.create=t=>{var e;return new wi({checks:[],typeName:ot.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...mt(t)})};function rB(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class $o extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Me.number){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_type,expected:Me.number,received:s.parsedType}),lt}let r;const i=new ir;for(const s of this._def.checks)s.kind==="int"?jt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?rB(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.not_finite,message:s.message}),i.dirty()):jt.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ge.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ge.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ge.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ge.toString(n))}setLimit(e,n,r,i){return new $o({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ge.toString(i)}]})}_addCheck(e){return new $o({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&jt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}$o.create=t=>new $o({checks:[],typeName:ot.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...mt(t)});class jo extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Me.bigint)return this._getInvalidInput(e);let r;const i=new ir;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ne(r,{code:xe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):jt.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ne(n,{code:xe.invalid_type,expected:Me.bigint,received:n.parsedType}),lt}gte(e,n){return this.setLimit("min",e,!0,Ge.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ge.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ge.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ge.toString(n))}setLimit(e,n,r,i){return new jo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ge.toString(i)}]})}_addCheck(e){return new jo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}jo.create=t=>{var e;return new jo({checks:[],typeName:ot.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...mt(t)})};class yd extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Me.boolean){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.boolean,received:r.parsedType}),lt}return vr(e.data)}}yd.create=t=>new yd({typeName:ot.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...mt(t)});class Fa extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Me.date){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_type,expected:Me.date,received:s.parsedType}),lt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Ne(s,{code:xe.invalid_date}),lt}const r=new ir;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Ne(i,{code:xe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):jt.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Fa({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ge.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ge.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Fa.create=t=>new Fa({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ot.ZodDate,...mt(t)});class Rp extends wt{_parse(e){if(this._getType(e)!==Me.symbol){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.symbol,received:r.parsedType}),lt}return vr(e.data)}}Rp.create=t=>new Rp({typeName:ot.ZodSymbol,...mt(t)});class vd extends wt{_parse(e){if(this._getType(e)!==Me.undefined){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.undefined,received:r.parsedType}),lt}return vr(e.data)}}vd.create=t=>new vd({typeName:ot.ZodUndefined,...mt(t)});class bd extends wt{_parse(e){if(this._getType(e)!==Me.null){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.null,received:r.parsedType}),lt}return vr(e.data)}}bd.create=t=>new bd({typeName:ot.ZodNull,...mt(t)});class _u extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return vr(e.data)}}_u.create=t=>new _u({typeName:ot.ZodAny,...mt(t)});class Ta extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return vr(e.data)}}Ta.create=t=>new Ta({typeName:ot.ZodUnknown,...mt(t)});class Vs extends wt{_parse(e){const n=this._getOrReturnCtx(e);return Ne(n,{code:xe.invalid_type,expected:Me.never,received:n.parsedType}),lt}}Vs.create=t=>new Vs({typeName:ot.ZodNever,...mt(t)});class Np extends wt{_parse(e){if(this._getType(e)!==Me.undefined){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.void,received:r.parsedType}),lt}return vr(e.data)}}Np.create=t=>new Np({typeName:ot.ZodVoid,...mt(t)});class Si extends wt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Me.array)return Ne(n,{code:xe.invalid_type,expected:Me.array,received:n.parsedType}),lt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ne(n,{code:o?xe.too_big:xe.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ne(n,{code:xe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ne(n,{code:xe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new us(n,o,n.path,a)))).then(o=>ir.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new us(n,o,n.path,a)));return ir.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Si({...this._def,minLength:{value:e,message:Ge.toString(n)}})}max(e,n){return new Si({...this._def,maxLength:{value:e,message:Ge.toString(n)}})}length(e,n){return new Si({...this._def,exactLength:{value:e,message:Ge.toString(n)}})}nonempty(e){return this.min(1,e)}}Si.create=(t,e)=>new Si({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...mt(e)});function Dc(t){if(t instanceof yn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=rs.create(Dc(r))}return new yn({...t._def,shape:()=>e})}else return t instanceof Si?new Si({...t._def,type:Dc(t.element)}):t instanceof rs?rs.create(Dc(t.unwrap())):t instanceof Bo?Bo.create(Dc(t.unwrap())):t instanceof ls?ls.create(t.items.map(e=>Dc(e))):t}class yn extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=jt.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Me.object){const u=this._getOrReturnCtx(e);return Ne(u,{code:xe.invalid_type,expected:Me.object,received:u.parsedType}),lt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Vs&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const c=[];for(const u of o){const l=s[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new us(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Vs){const u=this._def.unknownKeys;if(u==="passthrough")for(const l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(Ne(i,{code:xe.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const l of a){const d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new us(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const l of c){const d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>ir.mergeObjectSync(r,u)):ir.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Ge.errToObj,new yn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ge.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new yn({...this._def,unknownKeys:"strip"})}passthrough(){return new yn({...this._def,unknownKeys:"passthrough"})}extend(e){return new yn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new yn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new yn({...this._def,catchall:e})}pick(e){const n={};return jt.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new yn({...this._def,shape:()=>n})}omit(e){const n={};return jt.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new yn({...this._def,shape:()=>n})}deepPartial(){return Dc(this)}partial(e){const n={};return jt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new yn({...this._def,shape:()=>n})}required(e){const n={};return jt.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof rs;)s=s._def.innerType;n[r]=s}}),new yn({...this._def,shape:()=>n})}keyof(){return NO(jt.objectKeys(this.shape))}}yn.create=(t,e)=>new yn({shape:()=>t,unknownKeys:"strip",catchall:Vs.create(),typeName:ot.ZodObject,...mt(e)});yn.strictCreate=(t,e)=>new yn({shape:()=>t,unknownKeys:"strict",catchall:Vs.create(),typeName:ot.ZodObject,...mt(e)});yn.lazycreate=(t,e)=>new yn({shape:t,unknownKeys:"strip",catchall:Vs.create(),typeName:ot.ZodObject,...mt(e)});class _d extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Cr(a.ctx.common.issues));return Ne(n,{code:xe.invalid_union,unionErrors:o}),lt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Cr(c));return Ne(n,{code:xe.invalid_union,unionErrors:a}),lt}}get options(){return this._def.options}}_d.create=(t,e)=>new _d({options:t,typeName:ot.ZodUnion,...mt(e)});const Ts=t=>t instanceof Sd?Ts(t.schema):t instanceof Di?Ts(t.innerType()):t instanceof xd?[t.value]:t instanceof Uo?t.options:t instanceof Td?jt.objectValues(t.enum):t instanceof Id?Ts(t._def.innerType):t instanceof vd?[void 0]:t instanceof bd?[null]:t instanceof rs?[void 0,...Ts(t.unwrap())]:t instanceof Bo?[null,...Ts(t.unwrap())]:t instanceof R_||t instanceof Cd?Ts(t.unwrap()):t instanceof Od?Ts(t._def.innerType):[];class Km extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.object)return Ne(n,{code:xe.invalid_type,expected:Me.object,received:n.parsedType}),lt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ne(n,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=Ts(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new Km({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...mt(r)})}}function wv(t,e){const n=Cs(t),r=Cs(e);if(t===e)return{valid:!0,data:t};if(n===Me.object&&r===Me.object){const i=jt.objectKeys(e),s=jt.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=wv(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===Me.array&&r===Me.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=wv(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Me.date&&r===Me.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class wd extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(bv(s)||bv(o))return lt;const a=wv(s.value,o.value);return a.valid?((_v(s)||_v(o))&&n.dirty(),{status:n.value,value:a.data}):(Ne(r,{code:xe.invalid_intersection_types}),lt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}wd.create=(t,e,n)=>new wd({left:t,right:e,typeName:ot.ZodIntersection,...mt(n)});class ls extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.array)return Ne(r,{code:xe.invalid_type,expected:Me.array,received:r.parsedType}),lt;if(r.data.length<this._def.items.length)return Ne(r,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),lt;!this._def.rest&&r.data.length>this._def.items.length&&(Ne(r,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new us(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ir.mergeArray(n,o)):ir.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new ls({...this._def,rest:e})}}ls.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ls({items:t,typeName:ot.ZodTuple,rest:null,...mt(e)})};class Ed extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.object)return Ne(r,{code:xe.invalid_type,expected:Me.object,received:r.parsedType}),lt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new us(r,a,r.path,a)),value:o._parse(new us(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ir.mergeObjectAsync(n,i):ir.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof wt?new Ed({keyType:e,valueType:n,typeName:ot.ZodRecord,...mt(r)}):new Ed({keyType:wi.create(),valueType:e,typeName:ot.ZodRecord,...mt(n)})}}class Ap extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.map)return Ne(r,{code:xe.invalid_type,expected:Me.map,received:r.parsedType}),lt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],u)=>({key:i._parse(new us(r,a,r.path,[u,"key"])),value:s._parse(new us(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return lt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return lt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}}}}Ap.create=(t,e,n)=>new Ap({valueType:e,keyType:t,typeName:ot.ZodMap,...mt(n)});class $a extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Me.set)return Ne(r,{code:xe.invalid_type,expected:Me.set,received:r.parsedType}),lt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ne(r,{code:xe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ne(r,{code:xe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const l of c){if(l.status==="aborted")return lt;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new us(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new $a({...this._def,minSize:{value:e,message:Ge.toString(n)}})}max(e,n){return new $a({...this._def,maxSize:{value:e,message:Ge.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}$a.create=(t,e)=>new $a({valueType:t,minSize:null,maxSize:null,typeName:ot.ZodSet,...mt(e)});class Yc extends wt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.function)return Ne(n,{code:xe.invalid_type,expected:Me.function,received:n.parsedType}),lt;function r(a,c){return kp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cp(),bu].filter(u=>!!u),issueData:{code:xe.invalid_arguments,argumentsError:c}})}function i(a,c){return kp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cp(),bu].filter(u=>!!u),issueData:{code:xe.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof wu){const a=this;return vr(async function(...c){const u=new Cr([]),l=await a._def.args.parseAsync(c,s).catch(h=>{throw u.addIssue(r(c,h)),u}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const a=this;return vr(function(...c){const u=a._def.args.safeParse(c,s);if(!u.success)throw new Cr([r(c,u.error)]);const l=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Cr([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Yc({...this._def,args:ls.create(e).rest(Ta.create())})}returns(e){return new Yc({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Yc({args:e||ls.create([]).rest(Ta.create()),returns:n||Ta.create(),typeName:ot.ZodFunction,...mt(r)})}}class Sd extends wt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Sd.create=(t,e)=>new Sd({getter:t,typeName:ot.ZodLazy,...mt(e)});class xd extends wt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ne(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),lt}return{status:"valid",value:e.data}}get value(){return this._def.value}}xd.create=(t,e)=>new xd({value:t,typeName:ot.ZodLiteral,...mt(e)});function NO(t,e){return new Uo({values:t,typeName:ot.ZodEnum,...mt(e)})}class Uo extends wt{constructor(){super(...arguments),El.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ne(n,{expected:jt.joinValues(r),received:n.parsedType,code:xe.invalid_type}),lt}if(Dp(this,El)||CO(this,El,new Set(this._def.values)),!Dp(this,El).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ne(n,{received:n.data,code:xe.invalid_enum_value,options:r}),lt}return vr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Uo.create(e,{...this._def,...n})}exclude(e,n=this._def){return Uo.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}El=new WeakMap;Uo.create=NO;class Td extends wt{constructor(){super(...arguments),Sl.set(this,void 0)}_parse(e){const n=jt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Me.string&&r.parsedType!==Me.number){const i=jt.objectValues(n);return Ne(r,{expected:jt.joinValues(i),received:r.parsedType,code:xe.invalid_type}),lt}if(Dp(this,Sl)||CO(this,Sl,new Set(jt.getValidEnumValues(this._def.values))),!Dp(this,Sl).has(e.data)){const i=jt.objectValues(n);return Ne(r,{received:r.data,code:xe.invalid_enum_value,options:i}),lt}return vr(e.data)}get enum(){return this._def.values}}Sl=new WeakMap;Td.create=(t,e)=>new Td({values:t,typeName:ot.ZodNativeEnum,...mt(e)});class wu extends wt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.promise&&n.common.async===!1)return Ne(n,{code:xe.invalid_type,expected:Me.promise,received:n.parsedType}),lt;const r=n.parsedType===Me.promise?n.data:Promise.resolve(n.data);return vr(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wu.create=(t,e)=>new wu({type:t,typeName:ot.ZodPromise,...mt(e)});class Di extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Ne(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return lt;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?lt:c.status==="dirty"||n.value==="dirty"?$c(c.value):c});{if(n.value==="aborted")return lt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?lt:a.status==="dirty"||n.value==="dirty"?$c(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?lt:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?lt:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!La(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>La(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);jt.assertNever(i)}}Di.create=(t,e,n)=>new Di({schema:t,typeName:ot.ZodEffects,effect:e,...mt(n)});Di.createWithPreprocess=(t,e,n)=>new Di({schema:e,effect:{type:"preprocess",transform:t},typeName:ot.ZodEffects,...mt(n)});class rs extends wt{_parse(e){return this._getType(e)===Me.undefined?vr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rs.create=(t,e)=>new rs({innerType:t,typeName:ot.ZodOptional,...mt(e)});class Bo extends wt{_parse(e){return this._getType(e)===Me.null?vr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bo.create=(t,e)=>new Bo({innerType:t,typeName:ot.ZodNullable,...mt(e)});class Id extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Me.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Id.create=(t,e)=>new Id({innerType:t,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...mt(e)});class Od extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return gd(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Od.create=(t,e)=>new Od({innerType:t,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...mt(e)});class Pp extends wt{_parse(e){if(this._getType(e)!==Me.nan){const r=this._getOrReturnCtx(e);return Ne(r,{code:xe.invalid_type,expected:Me.nan,received:r.parsedType}),lt}return{status:"valid",value:e.data}}}Pp.create=t=>new Pp({typeName:ot.ZodNaN,...mt(t)});const iB=Symbol("zod_brand");class R_ extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class yf extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?lt:s.status==="dirty"?(n.dirty(),$c(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?lt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new yf({in:e,out:n,typeName:ot.ZodPipeline})}}class Cd extends wt{_parse(e){const n=this._def.innerType._parse(e),r=i=>(La(i)&&(i.value=Object.freeze(i.value)),i);return gd(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Cd.create=(t,e)=>new Cd({innerType:t,typeName:ot.ZodReadonly,...mt(e)});function AO(t,e={},n){return t?_u.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):_u.create()}const sB={object:yn.lazycreate};var ot;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ot||(ot={}));const oB=(t,e={message:`Input not instance of ${t.name}`})=>AO(n=>n instanceof t,e),ua=wi.create,PO=$o.create,aB=Pp.create,cB=jo.create,MO=yd.create,uB=Fa.create,lB=Rp.create,dB=vd.create,fB=bd.create,hB=_u.create,pB=Ta.create,mB=Vs.create,gB=Np.create,yB=Si.create,LO=yn.create,vB=yn.strictCreate,bB=_d.create,_B=Km.create,wB=wd.create,EB=ls.create,Ev=Ed.create,SB=Ap.create,xB=$a.create,TB=Yc.create,IB=Sd.create,OB=xd.create,CB=Uo.create,kB=Td.create,DB=wu.create,dS=Di.create,RB=rs.create,NB=Bo.create,AB=Di.createWithPreprocess,PB=yf.create,MB=()=>ua().optional(),LB=()=>PO().optional(),FB=()=>MO().optional(),$B={string:t=>wi.create({...t,coerce:!0}),number:t=>$o.create({...t,coerce:!0}),boolean:t=>yd.create({...t,coerce:!0}),bigint:t=>jo.create({...t,coerce:!0}),date:t=>Fa.create({...t,coerce:!0})},jB=lt;var Xt=Object.freeze({__proto__:null,defaultErrorMap:bu,setErrorMap:M4,getErrorMap:Cp,makeIssue:kp,EMPTY_PATH:L4,addIssueToContext:Ne,ParseStatus:ir,INVALID:lt,DIRTY:$c,OK:vr,isAborted:bv,isDirty:_v,isValid:La,isAsync:gd,get util(){return jt},get objectUtil(){return vv},ZodParsedType:Me,getParsedType:Cs,ZodType:wt,datetimeRegex:RO,ZodString:wi,ZodNumber:$o,ZodBigInt:jo,ZodBoolean:yd,ZodDate:Fa,ZodSymbol:Rp,ZodUndefined:vd,ZodNull:bd,ZodAny:_u,ZodUnknown:Ta,ZodNever:Vs,ZodVoid:Np,ZodArray:Si,ZodObject:yn,ZodUnion:_d,ZodDiscriminatedUnion:Km,ZodIntersection:wd,ZodTuple:ls,ZodRecord:Ed,ZodMap:Ap,ZodSet:$a,ZodFunction:Yc,ZodLazy:Sd,ZodLiteral:xd,ZodEnum:Uo,ZodNativeEnum:Td,ZodPromise:wu,ZodEffects:Di,ZodTransformer:Di,ZodOptional:rs,ZodNullable:Bo,ZodDefault:Id,ZodCatch:Od,ZodNaN:Pp,BRAND:iB,ZodBranded:R_,ZodPipeline:yf,ZodReadonly:Cd,custom:AO,Schema:wt,ZodSchema:wt,late:sB,get ZodFirstPartyTypeKind(){return ot},coerce:$B,any:hB,array:yB,bigint:cB,boolean:MO,date:uB,discriminatedUnion:_B,effect:dS,enum:CB,function:TB,instanceof:oB,intersection:wB,lazy:IB,literal:OB,map:SB,nan:aB,nativeEnum:kB,never:mB,null:fB,nullable:NB,number:PO,object:LO,oboolean:FB,onumber:LB,optional:RB,ostring:MB,pipeline:PB,preprocess:AB,promise:DB,record:Ev,set:xB,strictObject:vB,string:ua,symbol:lB,transformer:dS,tuple:EB,undefined:dB,union:bB,unknown:pB,void:gB,NEVER:jB,ZodIssueCode:xe,quotelessJson:P4,ZodError:Cr});const Sv=["@powerhousedao/design-system","document-drive","document-model","document-model-libs"],UB=LO({version:ua({message:"Missing version field in package.json"}),dependencies:Ev(ua(),ua()).nullable(),devDependencies:Ev(ua(),ua()).nullable()}).refine(t=>t.dependencies!=null||t.devDependencies!=null,"package.json must have either dependencies or devDependencies").transform(t=>{const e={...t.dependencies,...t.devDependencies},n=Sv.filter(r=>!e[r]||typeof e[r]!="string");return n.length>0?(console.error("Missing or invalid dependencies:",n,"Available dependencies:",Object.keys(e)),!1):{version:t.version,dependencies:Object.fromEntries(Sv.map(r=>[r,e[r]]))}});function BB(t){const e=UB.safeParse(t);return e.success?e.data:(console.error("Package.json validation failed:",e.error.format()),!1)}function zB(t){const[e,n]=We(!1),{packageJson:r}=t,i=BB(r);return i?P(gu,{isOpen:e,onOpenChange:()=>n(!e),title:`App version: ${i.version}`,toggleClassName:"text-gray-900 text-sm",children:P("ul",{className:"text-gray-600 text-sm",children:Sv.map(s=>Ee("li",{className:"my-1 flex justify-between pr-1",children:[Ee("span",{children:[s.replace("@powerhousedao/",""),":"]}),P("span",{className:"font-normal",children:i.dependencies[s]})]},s))})}):(console.error("Failed to validate package.json data"),null)}function VB(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}VB(`.rmsc{--rmsc-main: #4285f4;--rmsc-hover: #f1f3f5;--rmsc-selected: #e2e6ea;--rmsc-border: #ccc;--rmsc-gray: #aaa;--rmsc-bg: #fff;--rmsc-p: 10px;--rmsc-radius: 4px;--rmsc-h: 38px}.rmsc *{box-sizing:border-box;transition:all .2s ease}.rmsc .gray{color:var(--rmsc-gray)}.rmsc .dropdown-content{position:absolute;z-index:1;top:100%;width:100%;padding-top:8px}.rmsc .dropdown-content .panel-content{overflow:hidden;border-radius:var(--rmsc-radius);background:var(--rmsc-bg);box-shadow:0 0 0 1px #0000001a,0 4px 11px #0000001a}.rmsc .dropdown-container{position:relative;outline:0;background-color:var(--rmsc-bg);border:1px solid var(--rmsc-border);border-radius:var(--rmsc-radius)}.rmsc .dropdown-container[aria-disabled=true]:focus-within{box-shadow:var(--rmsc-gray) 0 0 0 1px;border-color:var(--rmsc-gray)}.rmsc .dropdown-container:focus-within{box-shadow:var(--rmsc-main) 0 0 0 1px;border-color:var(--rmsc-main)}.rmsc .dropdown-heading{position:relative;padding:0 var(--rmsc-p);display:flex;align-items:center;width:100%;height:var(--rmsc-h);cursor:default;outline:0}.rmsc .dropdown-heading .dropdown-heading-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.rmsc .clear-selected-button{cursor:pointer;background:none;border:0;padding:0;display:flex}.rmsc .options{max-height:260px;overflow-y:auto;margin:0;padding-left:0}.rmsc .options li{list-style:none;margin:0}.rmsc .select-item{box-sizing:border-box;cursor:pointer;display:block;padding:var(--rmsc-p);outline-offset:-1px;outline-color:var(--rmsc-primary)}.rmsc .select-item:hover{background:var(--rmsc-hover)}.rmsc .select-item.selected{background:var(--rmsc-selected)}.rmsc .no-options{padding:var(--rmsc-p);text-align:center;color:var(--rmsc-gray)}.rmsc .search{width:100%;position:relative;border-bottom:1px solid var(--rmsc-border)}.rmsc .search input{background:none;height:var(--rmsc-h);padding:0 var(--rmsc-p);width:100%;outline:0;border:0;font-size:1em}.rmsc .search input:focus{background:var(--rmsc-hover)}.rmsc .search-clear-button{cursor:pointer;position:absolute;top:0;right:0;bottom:0;background:none;border:0;padding:0 calc(var(--rmsc-p) / 2)}.rmsc .search-clear-button [hidden]{display:none}.rmsc .item-renderer{display:flex;align-items:baseline}.rmsc .item-renderer input{margin:0 5px 0 0}.rmsc .item-renderer.disabled{opacity:.5}.rmsc .spinner{animation:rotate 2s linear infinite}.rmsc .spinner .path{stroke:var(--rmsc-border);stroke-width:4px;stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
|
|
63
|
-
`);var HB={allItemsAreSelected:"All items are selected.",clearSearch:"Clear Search",clearSelected:"Clear Selected",noOptions:"No options",search:"Search",selectAll:"Select All",selectAllFiltered:"Select All (Filtered)",selectSomeItems:"Select...",create:"Create"},WB={value:[],hasSelectAll:!0,className:"multi-select",debounceDuration:200,options:[]},FO=$e.createContext({}),qB=({props:t,children:e})=>{let[n,r]=We(t.options),i=s=>{var o;return((o=t.overrideStrings)==null?void 0:o[s])||HB[s]};return Dt(()=>{r(t.options)},[t.options]),P(FO.Provider,{value:{t:i,...WB,...t,options:n,setOptions:r},children:e})},Jm=()=>$e.useContext(FO);function GB(t,e){let n=qt(!1);Dt(()=>{n.current?t():n.current=!0},e)}var ZB={when:!0,eventTypes:["keydown"]};function Mp(t,e,n){let r=Pn(()=>Array.isArray(t)?t:[t],[t]),i=Object.assign({},ZB,n),{when:s,eventTypes:o}=i,a=qt(e),{target:c}=i;Dt(()=>{a.current=e});let u=He(l=>{r.some(d=>l.key===d||l.code===d)&&a.current(l)},[r]);Dt(()=>{if(s&&typeof window<"u"){let l=c?c.current:window;return o.forEach(d=>{l&&l.addEventListener(d,u)}),()=>{o.forEach(d=>{l&&l.removeEventListener(d,u)})}}},[s,o,r,c,e])}var Tr={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",SPACE:"Space"},YB=(t,e)=>{let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{t.apply(null,r)},e)}};function KB(t,e){return e?t.filter(({label:n,value:r})=>n!=null&&r!=null&&n.toLowerCase().includes(e.toLowerCase())):t}var $O=()=>Ee("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"dropdown-search-clear-icon gray",children:[P("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),JB=({checked:t,option:e,onClick:n,disabled:r})=>Ee("div",{className:`item-renderer ${r?"disabled":""}`,children:[P("input",{type:"checkbox",onChange:n,checked:t,tabIndex:-1,disabled:r}),P("span",{children:e.label})]}),XB=JB,QB=({itemRenderer:t=XB,option:e,checked:n,tabIndex:r,disabled:i,onSelectionChanged:s,onClick:o})=>{let a=qt(),c=d=>{u(),d.preventDefault()},u=()=>{i||s(!n)},l=d=>{u(),o(d)};return Mp([Tr.ENTER,Tr.SPACE],c,{target:a}),P("label",{className:`select-item ${n?"selected":""}`,role:"option","aria-selected":n,tabIndex:r,ref:a,children:P(t,{option:e,checked:n,onClick:l,disabled:i})})},jO=QB,e6=({options:t,onClick:e,skipIndex:n})=>{let{disabled:r,value:i,onChange:s,ItemRenderer:o}=Jm(),a=(c,u)=>{r||s(u?[...i,c]:i.filter(l=>l.value!==c.value))};return P(Us,{children:t.map((c,u)=>{let l=u+n;return P("li",{children:P(jO,{tabIndex:l,option:c,onSelectionChanged:d=>a(c,d),checked:!!i.find(d=>d.value===c.value),onClick:d=>e(d,l),itemRenderer:o,disabled:c.disabled||r})},(c==null?void 0:c.key)||u)})})},t6=e6,n6=()=>{let{t,onChange:e,options:n,setOptions:r,value:i,filterOptions:s,ItemRenderer:o,disabled:a,disableSearch:c,hasSelectAll:u,ClearIcon:l,debounceDuration:d,isCreatable:f,onCreateOption:h}=Jm(),m=qt(),p=qt(),[g,y]=We(""),[v,b]=We(n),[E,w]=We(""),[x,_]=We(0),k=He(YB(z=>w(z),d),[]),R=Pn(()=>{let z=0;return c||(z+=1),u&&(z+=1),z},[c,u]),F={label:t(g?"selectAllFiltered":"selectAll"),value:""},V=z=>{let le=v.filter(pe=>!pe.disabled).map(pe=>pe.value);if(z){let pe=[...i.map(ve=>ve.value),...le];return(s?v:n).filter(ve=>pe.includes(ve.value))}return i.filter(pe=>!le.includes(pe.value))},T=z=>{let le=V(z);e(le)},L=z=>{k(z.target.value),y(z.target.value),_(0)},S=()=>{var z;w(""),y(""),(z=p==null?void 0:p.current)==null||z.focus()},C=z=>_(z),N=z=>{switch(z.code){case Tr.ARROW_UP:q(-1);break;case Tr.ARROW_DOWN:q(1);break;default:return}z.stopPropagation(),z.preventDefault()};Mp([Tr.ARROW_DOWN,Tr.ARROW_UP],N,{target:m});let U=()=>{_(0)},K=async()=>{let z={label:g,value:g,__isNew__:!0};h&&(z=await h(g)),r([z,...n]),S(),e([...i,z])},$=async()=>s?await s(n,E):KB(n,E),q=z=>{let le=x+z;le=Math.max(0,le),le=Math.min(le,n.length+Math.max(R-1,0)),_(le)};Dt(()=>{var z,le;(le=(z=m==null?void 0:m.current)==null?void 0:z.querySelector(`[tabIndex='${x}']`))==null||le.focus()},[x]);let[j,D]=Pn(()=>{let z=v.filter(le=>!le.disabled);return[z.every(le=>i.findIndex(pe=>pe.value===le.value)!==-1),z.length!==0]},[v,i]);Dt(()=>{$().then(b)},[E,n]);let X=qt();Mp([Tr.ENTER],K,{target:X});let Z=f&&g&&!v.some(z=>(z==null?void 0:z.value)===g);return Ee("div",{className:"select-panel",role:"listbox",ref:m,children:[!c&&Ee("div",{className:"search",children:[P("input",{placeholder:t("search"),type:"text","aria-describedby":t("search"),onChange:L,onFocus:U,value:g,ref:p,tabIndex:0}),P("button",{type:"button",className:"search-clear-button",hidden:!g,onClick:S,"aria-label":t("clearSearch"),children:l||P($O,{})})]}),Ee("ul",{className:"options",children:[u&&D&&P(jO,{tabIndex:R===1?0:1,checked:j,option:F,onSelectionChanged:T,onClick:()=>C(1),itemRenderer:o,disabled:a}),v.length?P(t6,{skipIndex:R,options:v,onClick:(z,le)=>C(le)}):Z?P("li",{onClick:K,className:"select-item creatable",tabIndex:1,ref:X,children:`${t("create")} "${g}"`}):P("li",{className:"no-options",children:t("noOptions")})]})]})},r6=n6,i6=({expanded:t})=>P("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"dropdown-heading-dropdown-arrow gray",children:P("path",{d:t?"M18 15 12 9 6 15":"M6 9L12 15 18 9"})}),s6=()=>{let{t,value:e,options:n,valueRenderer:r}=Jm(),i=e.length===0,s=e.length===n.length,o=r&&r(e,n);return i?P("span",{className:"gray",children:o||t("selectSomeItems")}):P("span",{children:o||(s?t("allItemsAreSelected"):e.map(a=>a.label).join(", "))})},o6=({size:t=24})=>P("span",{style:{width:t,marginRight:"0.2rem"},children:P("svg",{width:t,height:t,className:"spinner",viewBox:"0 0 50 50",style:{display:"inline",verticalAlign:"middle"},children:P("circle",{cx:"25",cy:"25",r:"20",fill:"none",className:"path"})})}),a6=()=>{let{t,onMenuToggle:e,ArrowRenderer:n,shouldToggleOnHover:r,isLoading:i,disabled:s,onChange:o,labelledBy:a,value:c,isOpen:u,defaultIsOpen:l,ClearSelectedIcon:d,closeOnChangedValue:f}=Jm();Dt(()=>{f&&g(!1)},[c]);let[h,m]=We(!0),[p,g]=We(l),[y,v]=We(!1),b=n||i6,E=qt();GB(()=>{e&&e(p)},[p]),Dt(()=>{l===void 0&&typeof u=="boolean"&&(m(!1),g(u))},[u]);let w=L=>{var S;["text","button"].includes(L.target.type)&&[Tr.SPACE,Tr.ENTER].includes(L.code)||(h&&(L.code===Tr.ESCAPE?(g(!1),(S=E==null?void 0:E.current)==null||S.focus()):g(!0)),L.preventDefault())};Mp([Tr.ENTER,Tr.ARROW_DOWN,Tr.SPACE,Tr.ESCAPE],w,{target:E});let x=L=>{h&&r&&g(L)},_=()=>!y&&v(!0),k=L=>{!L.currentTarget.contains(L.relatedTarget)&&h&&(v(!1),g(!1))},R=()=>x(!0),F=()=>x(!1),V=()=>{h&&g(i||s?!1:!p)},T=L=>{L.stopPropagation(),o([]),h&&g(!1)};return Ee("div",{tabIndex:0,className:"dropdown-container","aria-labelledby":a,"aria-expanded":p,"aria-readonly":!0,"aria-disabled":s,ref:E,onFocus:_,onBlur:k,onMouseEnter:R,onMouseLeave:F,children:[Ee("div",{className:"dropdown-heading",onClick:V,children:[P("div",{className:"dropdown-heading-value",children:P(s6,{})}),i&&P(o6,{}),c.length>0&&d!==null&&P("button",{type:"button",className:"clear-selected-button",onClick:T,disabled:s,"aria-label":t("clearSelected"),children:d||P($O,{})}),P(b,{expanded:p})]}),p&&P("div",{className:"dropdown-content",children:P("div",{className:"panel-content",children:P(r6,{})})})]})},c6=a6,u6=t=>P(qB,{props:t,children:P("div",{className:`rmsc ${t.className||"multi-select"}`,children:P(c6,{})})}),l6=u6;const d6=t=>{const{options:e,onChange:n,className:r,selected:i=[],selectProps:s={},...o}=t;return P(IO,{...o,children:P(l6,{className:Bt("checkbox-container w-[200px]",r),labelledBy:"Select",onChange:n,options:e,value:i,...s})})},f6=t=>{const{body:e,title:n,onSave:r,children:i,saveLabel:s,cancelLabel:o,overlayProps:a,contentProps:c,onOpenChange:u,...l}=t;return P(Xs,{contentProps:{...c,className:Bt("rounded-2xl",c==null?void 0:c.className)},onOpenChange:u,overlayProps:{...a,className:Bt("top-10",a==null?void 0:a.className)},...l,children:Ee("div",{className:"w-[432px] p-4 text-gray-900",children:[Ee("div",{className:"flex justify-between",children:[P("h1",{className:"text-center text-xl font-bold",children:n}),P("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:()=>u==null?void 0:u(!1),children:P(vt,{name:"XmarkLight",size:24})})]}),P("div",{className:"mt-8 flex min-h-[50px] items-center justify-center rounded-md bg-slate-50 p-3 text-xs font-medium text-gray-600",children:e}),P("div",{className:"mt-4 flex flex-col gap-y-4",children:i}),Ee("div",{className:"mt-4 flex justify-end gap-x-4",children:[P(zn,{className:"text-gray-900",color:"light",onClick:()=>u==null?void 0:u(!1),children:o}),P(zn,{onClick:r,children:s})]})]})})},fS="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function h6(t){const{body:e,header:n,onOpenChange:r,onContinue:i,cancelLabel:s,continueLabel:o,overlayProps:a,contentProps:c,...u}=t;return P(Xs,{contentProps:{...c,className:Bt("rounded-3xl",c==null?void 0:c.className)},onOpenChange:r,overlayProps:{...a,className:a==null?void 0:a.className},...u,children:Ee("div",{className:"w-[400px] p-6 text-slate-300",children:[P("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:n}),P("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:e}),Ee("div",{className:"mt-8 flex justify-between gap-3",children:[P("button",{className:Bt(fS,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>r==null?void 0:r(!1),children:s}),P("button",{className:Bt(fS,"flex-1 bg-gray-800 text-gray-50"),onClick:i,children:o})]})]})})}function Oo(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var UO={exports:{}};/*!
|
|
64
|
-
|
|
65
|
-
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
66
|
-
<http://stuartk.com/jszip>
|
|
67
|
-
|
|
68
|
-
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
69
|
-
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
70
|
-
|
|
71
|
-
JSZip uses the library pako released under the MIT license :
|
|
72
|
-
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
73
|
-
*/(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(u,l){if(!i[u]){if(!r[u]){var d=typeof Oo=="function"&&Oo;if(!l&&d)return d(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var h=i[u]={exports:{}};r[u][0].call(h.exports,function(m){var p=r[u][1][m];return o(p||m)},h,h.exports,n,r,i,s)}return i[u].exports}for(var a=typeof Oo=="function"&&Oo,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(n,r,i){var s=n("./utils"),o=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(c){for(var u,l,d,f,h,m,p,g=[],y=0,v=c.length,b=v,E=s.getTypeOf(c)!=="string";y<c.length;)b=v-y,d=E?(u=c[y++],l=y<v?c[y++]:0,y<v?c[y++]:0):(u=c.charCodeAt(y++),l=y<v?c.charCodeAt(y++):0,y<v?c.charCodeAt(y++):0),f=u>>2,h=(3&u)<<4|l>>4,m=1<b?(15&l)<<2|d>>6:64,p=2<b?63&d:64,g.push(a.charAt(f)+a.charAt(h)+a.charAt(m)+a.charAt(p));return g.join("")},i.decode=function(c){var u,l,d,f,h,m,p=0,g=0,y="data:";if(c.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");var v,b=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===a.charAt(64)&&b--,c.charAt(c.length-2)===a.charAt(64)&&b--,b%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=o.uint8array?new Uint8Array(0|b):new Array(0|b);p<c.length;)u=a.indexOf(c.charAt(p++))<<2|(f=a.indexOf(c.charAt(p++)))>>4,l=(15&f)<<4|(h=a.indexOf(c.charAt(p++)))>>2,d=(3&h)<<6|(m=a.indexOf(c.charAt(p++))),v[g++]=u,h!==64&&(v[g++]=l),m!==64&&(v[g++]=d);return v}},{"./support":30,"./utils":32}],2:[function(n,r,i){var s=n("./external"),o=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function u(l,d,f,h,m){this.compressedSize=l,this.uncompressedSize=d,this.crc32=f,this.compression=h,this.compressedContent=m}u.prototype={getContentWorker:function(){var l=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return l.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),l},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(l,d,f){return l.pipe(new a).pipe(new c("uncompressedSize")).pipe(d.compressWorker(f)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},r.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var s=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var s=n("./utils"),o=function(){for(var a,c=[],u=0;u<256;u++){a=u;for(var l=0;l<8;l++)a=1&a?3988292384^a>>>1:a>>>1;c[u]=a}return c}();r.exports=function(a,c){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(u,l,d,f){var h=o,m=f+d;u^=-1;for(var p=f;p<m;p++)u=u>>>8^h[255&(u^l[p])];return-1^u}(0|c,a,a.length,0):function(u,l,d,f){var h=o,m=f+d;u^=-1;for(var p=f;p<m;p++)u=u>>>8^h[255&(u^l.charCodeAt(p))];return-1^u}(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),u=s?"uint8array":"array";function l(d,f){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=f,this.meta={}}i.magic="\b\0",a.inherits(l,c),l.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,d.data),!1)},l.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(f){d.push({data:f,meta:d.meta})}},i.compressWorker=function(d){return new l("Deflate",d)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function s(h,m){var p,g="";for(p=0;p<m;p++)g+=String.fromCharCode(255&h),h>>>=8;return g}function o(h,m,p,g,y,v){var b,E,w=h.file,x=h.compression,_=v!==u.utf8encode,k=a.transformTo("string",v(w.name)),R=a.transformTo("string",u.utf8encode(w.name)),F=w.comment,V=a.transformTo("string",v(F)),T=a.transformTo("string",u.utf8encode(F)),L=R.length!==w.name.length,S=T.length!==F.length,C="",N="",U="",K=w.dir,$=w.date,q={crc32:0,compressedSize:0,uncompressedSize:0};m&&!p||(q.crc32=h.crc32,q.compressedSize=h.compressedSize,q.uncompressedSize=h.uncompressedSize);var j=0;m&&(j|=8),_||!L&&!S||(j|=2048);var D=0,X=0;K&&(D|=16),y==="UNIX"?(X=798,D|=function(z,le){var pe=z;return z||(pe=le?16893:33204),(65535&pe)<<16}(w.unixPermissions,K)):(X=20,D|=function(z){return 63&(z||0)}(w.dosPermissions)),b=$.getUTCHours(),b<<=6,b|=$.getUTCMinutes(),b<<=5,b|=$.getUTCSeconds()/2,E=$.getUTCFullYear()-1980,E<<=4,E|=$.getUTCMonth()+1,E<<=5,E|=$.getUTCDate(),L&&(N=s(1,1)+s(l(k),4)+R,C+="up"+s(N.length,2)+N),S&&(U=s(1,1)+s(l(V),4)+T,C+="uc"+s(U.length,2)+U);var Z="";return Z+=`
|
|
74
|
-
\0`,Z+=s(j,2),Z+=x.magic,Z+=s(b,2),Z+=s(E,2),Z+=s(q.crc32,4),Z+=s(q.compressedSize,4),Z+=s(q.uncompressedSize,4),Z+=s(k.length,2),Z+=s(C.length,2),{fileRecord:d.LOCAL_FILE_HEADER+Z+k+C,dirRecord:d.CENTRAL_FILE_HEADER+s(X,2)+Z+s(V.length,2)+"\0\0\0\0"+s(D,4)+s(g,4)+k+C+V}}var a=n("../utils"),c=n("../stream/GenericWorker"),u=n("../utf8"),l=n("../crc32"),d=n("../signature");function f(h,m,p,g){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=p,this.encodeFileName=g,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(f,c),f.prototype.push=function(h){var m=h.meta.percent||0,p=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,c.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:p?(m+100*(p-g-1))/p:100}}))},f.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var m=this.streamFiles&&!h.file.dir;if(m){var p=o(h,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(h){this.accumulate=!1;var m=this.streamFiles&&!h.file.dir,p=o(h,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),m)this.push({data:function(g){return d.DATA_DESCRIPTOR+s(g.crc32,4)+s(g.compressedSize,4)+s(g.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var h=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var p=this.bytesWritten-h,g=function(y,v,b,E,w){var x=a.transformTo("string",w(E));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(y,2)+s(y,2)+s(v,4)+s(b,4)+s(x.length,2)+x}(this.dirRecords.length,p,h,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(h){this._sources.push(h);var m=this;return h.on("data",function(p){m.processChunk(p)}),h.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),h.on("error",function(p){m.error(p)}),this},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(h){var m=this._sources;if(!c.prototype.error.call(this,h))return!1;for(var p=0;p<m.length;p++)try{m[p].error(h)}catch{}return!0},f.prototype.lock=function(){c.prototype.lock.call(this);for(var h=this._sources,m=0;m<h.length;m++)h[m].lock()},r.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var s=n("../compressions"),o=n("./ZipFileWorker");i.generateWorker=function(a,c,u){var l=new o(c.streamFiles,u,c.platform,c.encodeFileName),d=0;try{a.forEach(function(f,h){d++;var m=function(v,b){var E=v||b,w=s[E];if(!w)throw new Error(E+" is not a valid compression method !");return w}(h.options.compression,c.compression),p=h.options.compressionOptions||c.compressionOptions||{},g=h.dir,y=h.date;h._compressWorker(m,p).withStreamInfo("file",{name:f,dir:g,date:y,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(l)}),l.entriesCount=d}catch(f){l.error(f)}return l}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new s;for(var a in this)typeof this[a]!="function"&&(o[a]=this[a]);return o}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(o,a){return new s().loadAsync(o,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var s=n("./utils"),o=n("./external"),a=n("./utf8"),c=n("./zipEntries"),u=n("./stream/Crc32Probe"),l=n("./nodejsUtils");function d(f){return new o.Promise(function(h,m){var p=f.decompressed.getContentWorker().pipe(new u);p.on("error",function(g){m(g)}).on("end",function(){p.streamInfo.crc32!==f.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}r.exports=function(f,h){var m=this;return h=s.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),l.isNode&&l.isStream(f)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",f,!0,h.optimizedBinaryString,h.base64).then(function(p){var g=new c(h);return g.load(p),g}).then(function(p){var g=[o.Promise.resolve(p)],y=p.files;if(h.checkCRC32)for(var v=0;v<y.length;v++)g.push(d(y[v]));return o.Promise.all(g)}).then(function(p){for(var g=p.shift(),y=g.files,v=0;v<y.length;v++){var b=y[v],E=b.fileNameStr,w=s.resolve(b.fileNameStr);m.file(w,b.decompressed,{binary:!0,optimizedBinaryString:!0,date:b.date,dir:b.dir,comment:b.fileCommentStr.length?b.fileCommentStr:null,unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions,createFolders:h.createFolders}),b.dir||(m.file(w).unsafeOriginalName=E)}return g.zipComment.length&&(m.comment=g.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var s=n("../utils"),o=n("../stream/GenericWorker");function a(c,u){o.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(u)}s.inherits(a,o),a.prototype._bindStream=function(c){var u=this;(this._stream=c).pause(),c.on("data",function(l){u.push({data:l,meta:{percent:0}})}).on("error",function(l){u.isPaused?this.generatedError=l:u.error(l)}).on("end",function(){u.isPaused?u._upstreamEnded=!0:u.end()})},a.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var s=n("readable-stream").Readable;function o(a,c,u){s.call(this,c),this._helper=a;var l=this;a.on("data",function(d,f){l.push(d)||l._helper.pause(),u&&u(f)}).on("error",function(d){l.emit("error",d)}).on("end",function(){l.push(null)})}n("../utils").inherits(o,s),o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,o);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,o)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var o=new Buffer(s);return o.fill(0),o},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,i){function s(w,x,_){var k,R=a.getTypeOf(x),F=a.extend(_||{},l);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(w=y(w)),F.createFolders&&(k=g(w))&&v.call(this,k,!0);var V=R==="string"&&F.binary===!1&&F.base64===!1;_&&_.binary!==void 0||(F.binary=!V),(x instanceof d&&x.uncompressedSize===0||F.dir||!x||x.length===0)&&(F.base64=!1,F.binary=!0,x="",F.compression="STORE",R="string");var T=null;T=x instanceof d||x instanceof c?x:m.isNode&&m.isStream(x)?new p(w,x):a.prepareContent(w,x,F.binary,F.optimizedBinaryString,F.base64);var L=new f(w,T,F);this.files[w]=L}var o=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),u=n("./stream/StreamHelper"),l=n("./defaults"),d=n("./compressedObject"),f=n("./zipObject"),h=n("./generate"),m=n("./nodejsUtils"),p=n("./nodejs/NodejsStreamInputAdapter"),g=function(w){w.slice(-1)==="/"&&(w=w.substring(0,w.length-1));var x=w.lastIndexOf("/");return 0<x?w.substring(0,x):""},y=function(w){return w.slice(-1)!=="/"&&(w+="/"),w},v=function(w,x){return x=x!==void 0?x:l.createFolders,w=y(w),this.files[w]||s.call(this,w,null,{dir:!0,createFolders:x}),this.files[w]};function b(w){return Object.prototype.toString.call(w)==="[object RegExp]"}var E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(w){var x,_,k;for(x in this.files)k=this.files[x],(_=x.slice(this.root.length,x.length))&&x.slice(0,this.root.length)===this.root&&w(_,k)},filter:function(w){var x=[];return this.forEach(function(_,k){w(_,k)&&x.push(k)}),x},file:function(w,x,_){if(arguments.length!==1)return w=this.root+w,s.call(this,w,x,_),this;if(b(w)){var k=w;return this.filter(function(F,V){return!V.dir&&k.test(F)})}var R=this.files[this.root+w];return R&&!R.dir?R:null},folder:function(w){if(!w)return this;if(b(w))return this.filter(function(R,F){return F.dir&&w.test(R)});var x=this.root+w,_=v.call(this,x),k=this.clone();return k.root=_.name,k},remove:function(w){w=this.root+w;var x=this.files[w];if(x||(w.slice(-1)!=="/"&&(w+="/"),x=this.files[w]),x&&!x.dir)delete this.files[w];else for(var _=this.filter(function(R,F){return F.name.slice(0,w.length)===w}),k=0;k<_.length;k++)delete this.files[_[k].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(w){var x,_={};try{if((_=a.extend(w||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=_.type.toLowerCase(),_.compression=_.compression.toUpperCase(),_.type==="binarystring"&&(_.type="string"),!_.type)throw new Error("No output type specified.");a.checkSupport(_.type),_.platform!=="darwin"&&_.platform!=="freebsd"&&_.platform!=="linux"&&_.platform!=="sunos"||(_.platform="UNIX"),_.platform==="win32"&&(_.platform="DOS");var k=_.comment||this.comment||"";x=h.generateWorker(this,_,k)}catch(R){(x=new c("error")).error(R)}return new u(x,_.type||"string",_.mimeType)},generateAsync:function(w,x){return this.generateInternalStream(w).accumulate(x)},generateNodeStream:function(w,x){return(w=w||{}).type||(w.type="nodebuffer"),this.generateInternalStream(w).toNodejsStream(x)}};r.exports=E},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data[this.zero+a]},o.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),u=a.charCodeAt(1),l=a.charCodeAt(2),d=a.charCodeAt(3),f=this.length-4;0<=f;--f)if(this.data[f]===c&&this.data[f+1]===u&&this.data[f+2]===l&&this.data[f+3]===d)return f-this.zero;return-1},o.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),u=a.charCodeAt(1),l=a.charCodeAt(2),d=a.charCodeAt(3),f=this.readData(4);return c===f[0]&&u===f[1]&&l===f[2]&&d===f[3]},o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var s=n("../utils");function o(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,u=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=o},{"../utils":32}],19:[function(n,r,i){var s=n("./Uint8ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var s=n("./ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var s=n("../utils"),o=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),u=n("./NodeBufferReader"),l=n("./Uint8ArrayReader");r.exports=function(d){var f=s.getTypeOf(d);return s.checkSupport(f),f!=="string"||o.uint8array?f==="nodebuffer"?new u(d):o.uint8array?new l(s.transformTo("uint8array",d)):new a(s.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var s=n("./GenericWorker"),o=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var s=n("./GenericWorker"),o=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,o),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}o.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(l){u.dataIsReady=!0,u.data=l,u.max=l&&l.length||0,u.type=s.getTypeOf(l),u.isPaused||u._tickAndRepeat()},function(l){u.error(l)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var c=0;c<this._listeners[o].length;c++)this._listeners[o][c].call(this,a)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var a=this;return o.on("data",function(c){a.processChunk(c)}),o.on("end",function(){a.end()}),o.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,a){return this.extraStreamInfo[o]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=s},{}],29:[function(n,r,i){var s=n("../utils"),o=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),u=n("../support"),l=n("../external"),d=null;if(u.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function f(m,p){return new l.Promise(function(g,y){var v=[],b=m._internalType,E=m._outputType,w=m._mimeType;m.on("data",function(x,_){v.push(x),p&&p(_)}).on("error",function(x){v=[],y(x)}).on("end",function(){try{var x=function(_,k,R){switch(_){case"blob":return s.newBlob(s.transformTo("arraybuffer",k),R);case"base64":return c.encode(k);default:return s.transformTo(_,k)}}(E,function(_,k){var R,F=0,V=null,T=0;for(R=0;R<k.length;R++)T+=k[R].length;switch(_){case"string":return k.join("");case"array":return Array.prototype.concat.apply([],k);case"uint8array":for(V=new Uint8Array(T),R=0;R<k.length;R++)V.set(k[R],F),F+=k[R].length;return V;case"nodebuffer":return Buffer.concat(k);default:throw new Error("concat : unsupported type '"+_+"'")}}(b,v),w);g(x)}catch(_){y(_)}v=[]}).resume()})}function h(m,p,g){var y=p;switch(p){case"blob":case"arraybuffer":y="uint8array";break;case"base64":y="string"}try{this._internalType=y,this._outputType=p,this._mimeType=g,s.checkSupport(y),this._worker=m.pipe(new o(y)),m.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}h.prototype={accumulate:function(m){return f(this,m)},on:function(m,p){var g=this;return m==="data"?this._worker.on(m,function(y){p.call(g,y.data,y.meta)}):this._worker.on(m,function(){s.delay(p,arguments,g)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},m)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var s=n("./utils"),o=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),u=new Array(256),l=0;l<256;l++)u[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;u[254]=u[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function f(){c.call(this,"utf-8 encode")}i.utf8encode=function(h){return o.nodebuffer?a.newBufferFrom(h,"utf-8"):function(m){var p,g,y,v,b,E=m.length,w=0;for(v=0;v<E;v++)(64512&(g=m.charCodeAt(v)))==55296&&v+1<E&&(64512&(y=m.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),w+=g<128?1:g<2048?2:g<65536?3:4;for(p=o.uint8array?new Uint8Array(w):new Array(w),v=b=0;b<w;v++)(64512&(g=m.charCodeAt(v)))==55296&&v+1<E&&(64512&(y=m.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),g<128?p[b++]=g:(g<2048?p[b++]=192|g>>>6:(g<65536?p[b++]=224|g>>>12:(p[b++]=240|g>>>18,p[b++]=128|g>>>12&63),p[b++]=128|g>>>6&63),p[b++]=128|63&g);return p}(h)},i.utf8decode=function(h){return o.nodebuffer?s.transformTo("nodebuffer",h).toString("utf-8"):function(m){var p,g,y,v,b=m.length,E=new Array(2*b);for(p=g=0;p<b;)if((y=m[p++])<128)E[g++]=y;else if(4<(v=u[y]))E[g++]=65533,p+=v-1;else{for(y&=v===2?31:v===3?15:7;1<v&&p<b;)y=y<<6|63&m[p++],v--;1<v?E[g++]=65533:y<65536?E[g++]=y:(y-=65536,E[g++]=55296|y>>10&1023,E[g++]=56320|1023&y)}return E.length!==g&&(E.subarray?E=E.subarray(0,g):E.length=g),s.applyFromCharCode(E)}(h=s.transformTo(o.uint8array?"uint8array":"array",h))},s.inherits(d,c),d.prototype.processChunk=function(h){var m=s.transformTo(o.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var p=m;(m=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),m.set(p,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var g=function(v,b){var E;for((b=b||v.length)>v.length&&(b=v.length),E=b-1;0<=E&&(192&v[E])==128;)E--;return E<0||E===0?b:E+u[v[E]]>b?E:b}(m),y=m;g!==m.length&&(o.uint8array?(y=m.subarray(0,g),this.leftOver=m.subarray(g,m.length)):(y=m.slice(0,g),this.leftOver=m.slice(g,m.length))),this.push({data:i.utf8decode(y),meta:h.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,s.inherits(f,c),f.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var s=n("./support"),o=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function u(p){return p}function l(p,g){for(var y=0;y<p.length;++y)g[y]=255&p.charCodeAt(y);return g}n("setimmediate"),i.newBlob=function(p,g){i.checkSupport("blob");try{return new Blob([p],{type:g})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(p),y.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(p,g,y){var v=[],b=0,E=p.length;if(E<=y)return String.fromCharCode.apply(null,p);for(;b<E;)g==="array"||g==="nodebuffer"?v.push(String.fromCharCode.apply(null,p.slice(b,Math.min(b+y,E)))):v.push(String.fromCharCode.apply(null,p.subarray(b,Math.min(b+y,E)))),b+=y;return v.join("")},stringifyByChar:function(p){for(var g="",y=0;y<p.length;y++)g+=String.fromCharCode(p[y]);return g},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function f(p){var g=65536,y=i.getTypeOf(p),v=!0;if(y==="uint8array"?v=d.applyCanBeUsed.uint8array:y==="nodebuffer"&&(v=d.applyCanBeUsed.nodebuffer),v)for(;1<g;)try{return d.stringifyByChunk(p,y,g)}catch{g=Math.floor(g/2)}return d.stringifyByChar(p)}function h(p,g){for(var y=0;y<p.length;y++)g[y]=p[y];return g}i.applyFromCharCode=f;var m={};m.string={string:u,array:function(p){return l(p,new Array(p.length))},arraybuffer:function(p){return m.string.uint8array(p).buffer},uint8array:function(p){return l(p,new Uint8Array(p.length))},nodebuffer:function(p){return l(p,a.allocBuffer(p.length))}},m.array={string:f,array:u,arraybuffer:function(p){return new Uint8Array(p).buffer},uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return a.newBufferFrom(p)}},m.arraybuffer={string:function(p){return f(new Uint8Array(p))},array:function(p){return h(new Uint8Array(p),new Array(p.byteLength))},arraybuffer:u,uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return a.newBufferFrom(new Uint8Array(p))}},m.uint8array={string:f,array:function(p){return h(p,new Array(p.length))},arraybuffer:function(p){return p.buffer},uint8array:u,nodebuffer:function(p){return a.newBufferFrom(p)}},m.nodebuffer={string:f,array:function(p){return h(p,new Array(p.length))},arraybuffer:function(p){return m.nodebuffer.uint8array(p).buffer},uint8array:function(p){return h(p,new Uint8Array(p.length))},nodebuffer:u},i.transformTo=function(p,g){if(g=g||"",!p)return g;i.checkSupport(p);var y=i.getTypeOf(g);return m[y][p](g)},i.resolve=function(p){for(var g=p.split("/"),y=[],v=0;v<g.length;v++){var b=g[v];b==="."||b===""&&v!==0&&v!==g.length-1||(b===".."?y.pop():y.push(b))}return y.join("/")},i.getTypeOf=function(p){return typeof p=="string"?"string":Object.prototype.toString.call(p)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(p)?"nodebuffer":s.uint8array&&p instanceof Uint8Array?"uint8array":s.arraybuffer&&p instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(p){if(!s[p.toLowerCase()])throw new Error(p+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(p){var g,y,v="";for(y=0;y<(p||"").length;y++)v+="\\x"+((g=p.charCodeAt(y))<16?"0":"")+g.toString(16).toUpperCase();return v},i.delay=function(p,g,y){setImmediate(function(){p.apply(y||null,g||[])})},i.inherits=function(p,g){function y(){}y.prototype=g.prototype,p.prototype=new y},i.extend=function(){var p,g,y={};for(p=0;p<arguments.length;p++)for(g in arguments[p])Object.prototype.hasOwnProperty.call(arguments[p],g)&&y[g]===void 0&&(y[g]=arguments[p][g]);return y},i.prepareContent=function(p,g,y,v,b){return c.Promise.resolve(g).then(function(E){return s.blob&&(E instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(E))!==-1)&&typeof FileReader<"u"?new c.Promise(function(w,x){var _=new FileReader;_.onload=function(k){w(k.target.result)},_.onerror=function(k){x(k.target.error)},_.readAsArrayBuffer(E)}):E}).then(function(E){var w=i.getTypeOf(E);return w?(w==="arraybuffer"?E=i.transformTo("uint8array",E):w==="string"&&(b?E=o.decode(E):y&&v!==!0&&(E=function(x){return l(x,s.uint8array?new Uint8Array(x.length):new Array(x.length))}(E))),E):c.Promise.reject(new Error("Can't read the data of '"+p+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,i){var s=n("./reader/readerFor"),o=n("./utils"),a=n("./signature"),c=n("./zipEntry"),u=n("./support");function l(d){this.files=[],this.loadOptions=d}l.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var f=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(f)+", expected "+o.pretty(d)+")")}},isSignature:function(d,f){var h=this.reader.index;this.reader.setIndex(d);var m=this.reader.readString(4)===f;return this.reader.setIndex(h),m},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),f=u.uint8array?"uint8array":"array",h=o.transformTo(f,d);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,f,h,m=this.zip64EndOfCentralSize-44;0<m;)d=this.reader.readInt(2),f=this.reader.readInt(4),h=this.reader.readData(f),this.zip64ExtensibleData[d]={id:d,length:f,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,f;for(d=0;d<this.files.length;d++)f=this.files[d],this.reader.setIndex(f.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),f.readLocalPart(this.reader),f.handleUTF8(),f.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var f=d;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var m=f-h;if(0<m)this.isSignature(f,a.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,i){var s=n("./reader/readerFor"),o=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),u=n("./utf8"),l=n("./compressions"),d=n("./support");function f(h,m){this.options=h,this.loadOptions=m}f.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var m,p;if(h.skip(22),this.fileNameLength=h.readInt(2),p=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(p),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((m=function(g){for(var y in l)if(Object.prototype.hasOwnProperty.call(l,y)&&l[y].magic===g)return l[y];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,m,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var m=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(m),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var m,p,g,y=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<y;)m=h.readInt(2),p=h.readInt(2),g=h.readData(p),this.extraFields[m]={id:m,length:p,value:g};h.setIndex(y)},handleUTF8:function(){var h=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=u.utf8decode(this.fileName),this.fileCommentStr=u.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var p=o.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(p)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var y=o.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(y)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var m=s(h.value);return m.readInt(1)!==1||c(this.fileName)!==m.readInt(4)?null:u.utf8decode(m.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var m=s(h.value);return m.readInt(1)!==1||c(this.fileComment)!==m.readInt(4)?null:u.utf8decode(m.readData(h.length-5))}return null}},r.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function s(m,p,g){this.name=m,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=p,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var o=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),u=n("./compressedObject"),l=n("./stream/GenericWorker");s.prototype={internalStream:function(m){var p=null,g="string";try{if(!m)throw new Error("No output type specified.");var y=(g=m.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),p=this._decompressWorker();var v=!this._dataBinary;v&&!y&&(p=p.pipe(new c.Utf8EncodeWorker)),!v&&y&&(p=p.pipe(new c.Utf8DecodeWorker))}catch(b){(p=new l("error")).error(b)}return new o(p,g,"")},async:function(m,p){return this.internalStream(m).accumulate(p)},nodeStream:function(m,p){return this.internalStream(m||"nodebuffer").toNodejsStream(p)},_compressWorker:function(m,p){if(this._data instanceof u&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new c.Utf8EncodeWorker)),u.createWorkerFrom(g,m,p)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof l?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<d.length;h++)s.prototype[d[h]]=f;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(s){var o,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var u=0,l=new c(m),d=s.document.createTextNode("");l.observe(d,{characterData:!0}),o=function(){d.data=u=++u%2}}else if(s.setImmediate||s.MessageChannel===void 0)o="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var p=s.document.createElement("script");p.onreadystatechange=function(){m(),p.onreadystatechange=null,p.parentNode.removeChild(p),p=null},s.document.documentElement.appendChild(p)}:function(){setTimeout(m,0)};else{var f=new s.MessageChannel;f.port1.onmessage=m,o=function(){f.port2.postMessage(0)}}var h=[];function m(){var p,g;a=!0;for(var y=h.length;y;){for(g=h,h=[],p=-1;++p<y;)g[p]();y=h.length}a=!1}r.exports=function(p){h.push(p)!==1||a||o()}}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var s=n("immediate");function o(){}var a={},c=["REJECTED"],u=["FULFILLED"],l=["PENDING"];function d(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,y!==o&&p(this,y)}function f(y,v,b){this.promise=y,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof b=="function"&&(this.onRejected=b,this.callRejected=this.otherCallRejected)}function h(y,v,b){s(function(){var E;try{E=v(b)}catch(w){return a.reject(y,w)}E===y?a.reject(y,new TypeError("Cannot resolve promise with itself")):a.resolve(y,E)})}function m(y){var v=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof v=="function")return function(){v.apply(y,arguments)}}function p(y,v){var b=!1;function E(_){b||(b=!0,a.reject(y,_))}function w(_){b||(b=!0,a.resolve(y,_))}var x=g(function(){v(w,E)});x.status==="error"&&E(x.value)}function g(y,v){var b={};try{b.value=y(v),b.status="success"}catch(E){b.status="error",b.value=E}return b}(r.exports=d).prototype.finally=function(y){if(typeof y!="function")return this;var v=this.constructor;return this.then(function(b){return v.resolve(y()).then(function(){return b})},function(b){return v.resolve(y()).then(function(){throw b})})},d.prototype.catch=function(y){return this.then(null,y)},d.prototype.then=function(y,v){if(typeof y!="function"&&this.state===u||typeof v!="function"&&this.state===c)return this;var b=new this.constructor(o);return this.state!==l?h(b,this.state===u?y:v,this.outcome):this.queue.push(new f(b,y,v)),b},f.prototype.callFulfilled=function(y){a.resolve(this.promise,y)},f.prototype.otherCallFulfilled=function(y){h(this.promise,this.onFulfilled,y)},f.prototype.callRejected=function(y){a.reject(this.promise,y)},f.prototype.otherCallRejected=function(y){h(this.promise,this.onRejected,y)},a.resolve=function(y,v){var b=g(m,v);if(b.status==="error")return a.reject(y,b.value);var E=b.value;if(E)p(y,E);else{y.state=u,y.outcome=v;for(var w=-1,x=y.queue.length;++w<x;)y.queue[w].callFulfilled(v)}return y},a.reject=function(y,v){y.state=c,y.outcome=v;for(var b=-1,E=y.queue.length;++b<E;)y.queue[b].callRejected(v);return y},d.resolve=function(y){return y instanceof this?y:a.resolve(new this(o),y)},d.reject=function(y){var v=new this(o);return a.reject(v,y)},d.all=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=y.length,E=!1;if(!b)return this.resolve([]);for(var w=new Array(b),x=0,_=-1,k=new this(o);++_<b;)R(y[_],_);return k;function R(F,V){v.resolve(F).then(function(T){w[V]=T,++x!==b||E||(E=!0,a.resolve(k,w))},function(T){E||(E=!0,a.reject(k,T))})}},d.race=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=y.length,E=!1;if(!b)return this.resolve([]);for(var w=-1,x=new this(o);++w<b;)_=y[w],v.resolve(_).then(function(k){E||(E=!0,a.resolve(x,k))},function(k){E||(E=!0,a.reject(x,k))});var _;return x}},{immediate:36}],38:[function(n,r,i){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var s=n("./zlib/deflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),u=n("./zlib/zstream"),l=Object.prototype.toString,d=0,f=-1,h=0,m=8;function p(y){if(!(this instanceof p))return new p(y);this.options=o.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},y||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var b=s.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(b!==d)throw new Error(c[b]);if(v.header&&s.deflateSetHeader(this.strm,v.header),v.dictionary){var E;if(E=typeof v.dictionary=="string"?a.string2buf(v.dictionary):l.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(b=s.deflateSetDictionary(this.strm,E))!==d)throw new Error(c[b]);this._dict_set=!0}}function g(y,v){var b=new p(v);if(b.push(y,!0),b.err)throw b.msg||c[b.err];return b.result}p.prototype.push=function(y,v){var b,E,w=this.strm,x=this.options.chunkSize;if(this.ended)return!1;E=v===~~v?v:v===!0?4:0,typeof y=="string"?w.input=a.string2buf(y):l.call(y)==="[object ArrayBuffer]"?w.input=new Uint8Array(y):w.input=y,w.next_in=0,w.avail_in=w.input.length;do{if(w.avail_out===0&&(w.output=new o.Buf8(x),w.next_out=0,w.avail_out=x),(b=s.deflate(w,E))!==1&&b!==d)return this.onEnd(b),!(this.ended=!0);w.avail_out!==0&&(w.avail_in!==0||E!==4&&E!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(o.shrinkBuf(w.output,w.next_out))):this.onData(o.shrinkBuf(w.output,w.next_out)))}while((0<w.avail_in||w.avail_out===0)&&b!==1);return E===4?(b=s.deflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===d):E!==2||(this.onEnd(d),!(w.avail_out=0))},p.prototype.onData=function(y){this.chunks.push(y)},p.prototype.onEnd=function(y){y===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},i.Deflate=p,i.deflate=g,i.deflateRaw=function(y,v){return(v=v||{}).raw=!0,g(y,v)},i.gzip=function(y,v){return(v=v||{}).gzip=!0,g(y,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,i){var s=n("./zlib/inflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),u=n("./zlib/messages"),l=n("./zlib/zstream"),d=n("./zlib/gzheader"),f=Object.prototype.toString;function h(p){if(!(this instanceof h))return new h(p);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},p||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||p&&p.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&!(15&g.windowBits)&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var y=s.inflateInit2(this.strm,g.windowBits);if(y!==c.Z_OK)throw new Error(u[y]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function m(p,g){var y=new h(g);if(y.push(p,!0),y.err)throw y.msg||u[y.err];return y.result}h.prototype.push=function(p,g){var y,v,b,E,w,x,_=this.strm,k=this.options.chunkSize,R=this.options.dictionary,F=!1;if(this.ended)return!1;v=g===~~g?g:g===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof p=="string"?_.input=a.binstring2buf(p):f.call(p)==="[object ArrayBuffer]"?_.input=new Uint8Array(p):_.input=p,_.next_in=0,_.avail_in=_.input.length;do{if(_.avail_out===0&&(_.output=new o.Buf8(k),_.next_out=0,_.avail_out=k),(y=s.inflate(_,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&R&&(x=typeof R=="string"?a.string2buf(R):f.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,y=s.inflateSetDictionary(this.strm,x)),y===c.Z_BUF_ERROR&&F===!0&&(y=c.Z_OK,F=!1),y!==c.Z_STREAM_END&&y!==c.Z_OK)return this.onEnd(y),!(this.ended=!0);_.next_out&&(_.avail_out!==0&&y!==c.Z_STREAM_END&&(_.avail_in!==0||v!==c.Z_FINISH&&v!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(b=a.utf8border(_.output,_.next_out),E=_.next_out-b,w=a.buf2string(_.output,b),_.next_out=E,_.avail_out=k-E,E&&o.arraySet(_.output,_.output,b,E,0),this.onData(w)):this.onData(o.shrinkBuf(_.output,_.next_out)))),_.avail_in===0&&_.avail_out===0&&(F=!0)}while((0<_.avail_in||_.avail_out===0)&&y!==c.Z_STREAM_END);return y===c.Z_STREAM_END&&(v=c.Z_FINISH),v===c.Z_FINISH?(y=s.inflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===c.Z_OK):v!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(_.avail_out=0))},h.prototype.onData=function(p){this.chunks.push(p)},h.prototype.onEnd=function(p){p===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},i.Inflate=h,i.inflate=m,i.inflateRaw=function(p,g){return(g=g||{}).raw=!0,m(p,g)},i.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(c){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var l=u.shift();if(l){if(typeof l!="object")throw new TypeError(l+"must be non-object");for(var d in l)l.hasOwnProperty(d)&&(c[d]=l[d])}}return c},i.shrinkBuf=function(c,u){return c.length===u?c:c.subarray?c.subarray(0,u):(c.length=u,c)};var o={arraySet:function(c,u,l,d,f){if(u.subarray&&c.subarray)c.set(u.subarray(l,l+d),f);else for(var h=0;h<d;h++)c[f+h]=u[l+h]},flattenChunks:function(c){var u,l,d,f,h,m;for(u=d=0,l=c.length;u<l;u++)d+=c[u].length;for(m=new Uint8Array(d),u=f=0,l=c.length;u<l;u++)h=c[u],m.set(h,f),f+=h.length;return m}},a={arraySet:function(c,u,l,d,f){for(var h=0;h<d;h++)c[f+h]=u[l+h]},flattenChunks:function(c){return[].concat.apply([],c)}};i.setTyped=function(c){c?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(s)},{}],42:[function(n,r,i){var s=n("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function l(d,f){if(f<65537&&(d.subarray&&a||!d.subarray&&o))return String.fromCharCode.apply(null,s.shrinkBuf(d,f));for(var h="",m=0;m<f;m++)h+=String.fromCharCode(d[m]);return h}c[254]=c[254]=1,i.string2buf=function(d){var f,h,m,p,g,y=d.length,v=0;for(p=0;p<y;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<y&&(64512&(m=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(m-56320),p++),v+=h<128?1:h<2048?2:h<65536?3:4;for(f=new s.Buf8(v),p=g=0;g<v;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<y&&(64512&(m=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(m-56320),p++),h<128?f[g++]=h:(h<2048?f[g++]=192|h>>>6:(h<65536?f[g++]=224|h>>>12:(f[g++]=240|h>>>18,f[g++]=128|h>>>12&63),f[g++]=128|h>>>6&63),f[g++]=128|63&h);return f},i.buf2binstring=function(d){return l(d,d.length)},i.binstring2buf=function(d){for(var f=new s.Buf8(d.length),h=0,m=f.length;h<m;h++)f[h]=d.charCodeAt(h);return f},i.buf2string=function(d,f){var h,m,p,g,y=f||d.length,v=new Array(2*y);for(h=m=0;h<y;)if((p=d[h++])<128)v[m++]=p;else if(4<(g=c[p]))v[m++]=65533,h+=g-1;else{for(p&=g===2?31:g===3?15:7;1<g&&h<y;)p=p<<6|63&d[h++],g--;1<g?v[m++]=65533:p<65536?v[m++]=p:(p-=65536,v[m++]=55296|p>>10&1023,v[m++]=56320|1023&p)}return l(v,m)},i.utf8border=function(d,f){var h;for((f=f||d.length)>d.length&&(f=d.length),h=f-1;0<=h&&(192&d[h])==128;)h--;return h<0||h===0?f:h+c[d[h]]>f?h:f}},{"./common":41}],43:[function(n,r,i){r.exports=function(s,o,a,c){for(var u=65535&s|0,l=s>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;l=l+(u=u+o[c++]|0)|0,--d;);u%=65521,l%=65521}return u|l<<16|0}},{}],44:[function(n,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,i){var s=function(){for(var o,a=[],c=0;c<256;c++){o=c;for(var u=0;u<8;u++)o=1&o?3988292384^o>>>1:o>>>1;a[c]=o}return a}();r.exports=function(o,a,c,u){var l=s,d=u+c;o^=-1;for(var f=u;f<d;f++)o=o>>>8^l[255&(o^a[f])];return-1^o}},{}],46:[function(n,r,i){var s,o=n("../utils/common"),a=n("./trees"),c=n("./adler32"),u=n("./crc32"),l=n("./messages"),d=0,f=4,h=0,m=-2,p=-1,g=4,y=2,v=8,b=9,E=286,w=30,x=19,_=2*E+1,k=15,R=3,F=258,V=F+R+1,T=42,L=113,S=1,C=2,N=3,U=4;function K(O,he){return O.msg=l[he],he}function $(O){return(O<<1)-(4<O?9:0)}function q(O){for(var he=O.length;0<=--he;)O[he]=0}function j(O){var he=O.state,ae=he.pending;ae>O.avail_out&&(ae=O.avail_out),ae!==0&&(o.arraySet(O.output,he.pending_buf,he.pending_out,ae,O.next_out),O.next_out+=ae,he.pending_out+=ae,O.total_out+=ae,O.avail_out-=ae,he.pending-=ae,he.pending===0&&(he.pending_out=0))}function D(O,he){a._tr_flush_block(O,0<=O.block_start?O.block_start:-1,O.strstart-O.block_start,he),O.block_start=O.strstart,j(O.strm)}function X(O,he){O.pending_buf[O.pending++]=he}function Z(O,he){O.pending_buf[O.pending++]=he>>>8&255,O.pending_buf[O.pending++]=255&he}function z(O,he){var ae,W,I=O.max_chain_length,A=O.strstart,G=O.prev_length,Q=O.nice_match,H=O.strstart>O.w_size-V?O.strstart-(O.w_size-V):0,ee=O.window,de=O.w_mask,fe=O.prev,De=O.strstart+F,rt=ee[A+G-1],Xe=ee[A+G];O.prev_length>=O.good_match&&(I>>=2),Q>O.lookahead&&(Q=O.lookahead);do if(ee[(ae=he)+G]===Xe&&ee[ae+G-1]===rt&&ee[ae]===ee[A]&&ee[++ae]===ee[A+1]){A+=2,ae++;do;while(ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&ee[++A]===ee[++ae]&&A<De);if(W=F-(De-A),A=De-F,G<W){if(O.match_start=he,Q<=(G=W))break;rt=ee[A+G-1],Xe=ee[A+G]}}while((he=fe[he&de])>H&&--I!=0);return G<=O.lookahead?G:O.lookahead}function le(O){var he,ae,W,I,A,G,Q,H,ee,de,fe=O.w_size;do{if(I=O.window_size-O.lookahead-O.strstart,O.strstart>=fe+(fe-V)){for(o.arraySet(O.window,O.window,fe,fe,0),O.match_start-=fe,O.strstart-=fe,O.block_start-=fe,he=ae=O.hash_size;W=O.head[--he],O.head[he]=fe<=W?W-fe:0,--ae;);for(he=ae=fe;W=O.prev[--he],O.prev[he]=fe<=W?W-fe:0,--ae;);I+=fe}if(O.strm.avail_in===0)break;if(G=O.strm,Q=O.window,H=O.strstart+O.lookahead,ee=I,de=void 0,de=G.avail_in,ee<de&&(de=ee),ae=de===0?0:(G.avail_in-=de,o.arraySet(Q,G.input,G.next_in,de,H),G.state.wrap===1?G.adler=c(G.adler,Q,de,H):G.state.wrap===2&&(G.adler=u(G.adler,Q,de,H)),G.next_in+=de,G.total_in+=de,de),O.lookahead+=ae,O.lookahead+O.insert>=R)for(A=O.strstart-O.insert,O.ins_h=O.window[A],O.ins_h=(O.ins_h<<O.hash_shift^O.window[A+1])&O.hash_mask;O.insert&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[A+R-1])&O.hash_mask,O.prev[A&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=A,A++,O.insert--,!(O.lookahead+O.insert<R)););}while(O.lookahead<V&&O.strm.avail_in!==0)}function pe(O,he){for(var ae,W;;){if(O.lookahead<V){if(le(O),O.lookahead<V&&he===d)return S;if(O.lookahead===0)break}if(ae=0,O.lookahead>=R&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),ae!==0&&O.strstart-ae<=O.w_size-V&&(O.match_length=z(O,ae)),O.match_length>=R)if(W=a._tr_tally(O,O.strstart-O.match_start,O.match_length-R),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=R){for(O.match_length--;O.strstart++,O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart,--O.match_length!=0;);O.strstart++}else O.strstart+=O.match_length,O.match_length=0,O.ins_h=O.window[O.strstart],O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+1])&O.hash_mask;else W=a._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++;if(W&&(D(O,!1),O.strm.avail_out===0))return S}return O.insert=O.strstart<R-1?O.strstart:R-1,he===f?(D(O,!0),O.strm.avail_out===0?N:U):O.last_lit&&(D(O,!1),O.strm.avail_out===0)?S:C}function ve(O,he){for(var ae,W,I;;){if(O.lookahead<V){if(le(O),O.lookahead<V&&he===d)return S;if(O.lookahead===0)break}if(ae=0,O.lookahead>=R&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),O.prev_length=O.match_length,O.prev_match=O.match_start,O.match_length=R-1,ae!==0&&O.prev_length<O.max_lazy_match&&O.strstart-ae<=O.w_size-V&&(O.match_length=z(O,ae),O.match_length<=5&&(O.strategy===1||O.match_length===R&&4096<O.strstart-O.match_start)&&(O.match_length=R-1)),O.prev_length>=R&&O.match_length<=O.prev_length){for(I=O.strstart+O.lookahead-R,W=a._tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-R),O.lookahead-=O.prev_length-1,O.prev_length-=2;++O.strstart<=I&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+R-1])&O.hash_mask,ae=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),--O.prev_length!=0;);if(O.match_available=0,O.match_length=R-1,O.strstart++,W&&(D(O,!1),O.strm.avail_out===0))return S}else if(O.match_available){if((W=a._tr_tally(O,0,O.window[O.strstart-1]))&&D(O,!1),O.strstart++,O.lookahead--,O.strm.avail_out===0)return S}else O.match_available=1,O.strstart++,O.lookahead--}return O.match_available&&(W=a._tr_tally(O,0,O.window[O.strstart-1]),O.match_available=0),O.insert=O.strstart<R-1?O.strstart:R-1,he===f?(D(O,!0),O.strm.avail_out===0?N:U):O.last_lit&&(D(O,!1),O.strm.avail_out===0)?S:C}function je(O,he,ae,W,I){this.good_length=O,this.max_lazy=he,this.nice_length=ae,this.max_chain=W,this.func=I}function ct(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*_),this.dyn_dtree=new o.Buf16(2*(2*w+1)),this.bl_tree=new o.Buf16(2*(2*x+1)),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(k+1),this.heap=new o.Buf16(2*E+1),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*E+1),q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ut(O){var he;return O&&O.state?(O.total_in=O.total_out=0,O.data_type=y,(he=O.state).pending=0,he.pending_out=0,he.wrap<0&&(he.wrap=-he.wrap),he.status=he.wrap?T:L,O.adler=he.wrap===2?0:1,he.last_flush=d,a._tr_init(he),h):K(O,m)}function Ye(O){var he=ut(O);return he===h&&function(ae){ae.window_size=2*ae.w_size,q(ae.head),ae.max_lazy_match=s[ae.level].max_lazy,ae.good_match=s[ae.level].good_length,ae.nice_match=s[ae.level].nice_length,ae.max_chain_length=s[ae.level].max_chain,ae.strstart=0,ae.block_start=0,ae.lookahead=0,ae.insert=0,ae.match_length=ae.prev_length=R-1,ae.match_available=0,ae.ins_h=0}(O.state),he}function Ot(O,he,ae,W,I,A){if(!O)return m;var G=1;if(he===p&&(he=6),W<0?(G=0,W=-W):15<W&&(G=2,W-=16),I<1||b<I||ae!==v||W<8||15<W||he<0||9<he||A<0||g<A)return K(O,m);W===8&&(W=9);var Q=new ct;return(O.state=Q).strm=O,Q.wrap=G,Q.gzhead=null,Q.w_bits=W,Q.w_size=1<<Q.w_bits,Q.w_mask=Q.w_size-1,Q.hash_bits=I+7,Q.hash_size=1<<Q.hash_bits,Q.hash_mask=Q.hash_size-1,Q.hash_shift=~~((Q.hash_bits+R-1)/R),Q.window=new o.Buf8(2*Q.w_size),Q.head=new o.Buf16(Q.hash_size),Q.prev=new o.Buf16(Q.w_size),Q.lit_bufsize=1<<I+6,Q.pending_buf_size=4*Q.lit_bufsize,Q.pending_buf=new o.Buf8(Q.pending_buf_size),Q.d_buf=1*Q.lit_bufsize,Q.l_buf=3*Q.lit_bufsize,Q.level=he,Q.strategy=A,Q.method=ae,Ye(O)}s=[new je(0,0,0,0,function(O,he){var ae=65535;for(ae>O.pending_buf_size-5&&(ae=O.pending_buf_size-5);;){if(O.lookahead<=1){if(le(O),O.lookahead===0&&he===d)return S;if(O.lookahead===0)break}O.strstart+=O.lookahead,O.lookahead=0;var W=O.block_start+ae;if((O.strstart===0||O.strstart>=W)&&(O.lookahead=O.strstart-W,O.strstart=W,D(O,!1),O.strm.avail_out===0)||O.strstart-O.block_start>=O.w_size-V&&(D(O,!1),O.strm.avail_out===0))return S}return O.insert=0,he===f?(D(O,!0),O.strm.avail_out===0?N:U):(O.strstart>O.block_start&&(D(O,!1),O.strm.avail_out),S)}),new je(4,4,8,4,pe),new je(4,5,16,8,pe),new je(4,6,32,32,pe),new je(4,4,16,16,ve),new je(8,16,32,32,ve),new je(8,16,128,128,ve),new je(8,32,128,256,ve),new je(32,128,258,1024,ve),new je(32,258,258,4096,ve)],i.deflateInit=function(O,he){return Ot(O,he,v,15,8,0)},i.deflateInit2=Ot,i.deflateReset=Ye,i.deflateResetKeep=ut,i.deflateSetHeader=function(O,he){return O&&O.state?O.state.wrap!==2?m:(O.state.gzhead=he,h):m},i.deflate=function(O,he){var ae,W,I,A;if(!O||!O.state||5<he||he<0)return O?K(O,m):m;if(W=O.state,!O.output||!O.input&&O.avail_in!==0||W.status===666&&he!==f)return K(O,O.avail_out===0?-5:m);if(W.strm=O,ae=W.last_flush,W.last_flush=he,W.status===T)if(W.wrap===2)O.adler=0,X(W,31),X(W,139),X(W,8),W.gzhead?(X(W,(W.gzhead.text?1:0)+(W.gzhead.hcrc?2:0)+(W.gzhead.extra?4:0)+(W.gzhead.name?8:0)+(W.gzhead.comment?16:0)),X(W,255&W.gzhead.time),X(W,W.gzhead.time>>8&255),X(W,W.gzhead.time>>16&255),X(W,W.gzhead.time>>24&255),X(W,W.level===9?2:2<=W.strategy||W.level<2?4:0),X(W,255&W.gzhead.os),W.gzhead.extra&&W.gzhead.extra.length&&(X(W,255&W.gzhead.extra.length),X(W,W.gzhead.extra.length>>8&255)),W.gzhead.hcrc&&(O.adler=u(O.adler,W.pending_buf,W.pending,0)),W.gzindex=0,W.status=69):(X(W,0),X(W,0),X(W,0),X(W,0),X(W,0),X(W,W.level===9?2:2<=W.strategy||W.level<2?4:0),X(W,3),W.status=L);else{var G=v+(W.w_bits-8<<4)<<8;G|=(2<=W.strategy||W.level<2?0:W.level<6?1:W.level===6?2:3)<<6,W.strstart!==0&&(G|=32),G+=31-G%31,W.status=L,Z(W,G),W.strstart!==0&&(Z(W,O.adler>>>16),Z(W,65535&O.adler)),O.adler=1}if(W.status===69)if(W.gzhead.extra){for(I=W.pending;W.gzindex<(65535&W.gzhead.extra.length)&&(W.pending!==W.pending_buf_size||(W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),j(O),I=W.pending,W.pending!==W.pending_buf_size));)X(W,255&W.gzhead.extra[W.gzindex]),W.gzindex++;W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),W.gzindex===W.gzhead.extra.length&&(W.gzindex=0,W.status=73)}else W.status=73;if(W.status===73)if(W.gzhead.name){I=W.pending;do{if(W.pending===W.pending_buf_size&&(W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),j(O),I=W.pending,W.pending===W.pending_buf_size)){A=1;break}A=W.gzindex<W.gzhead.name.length?255&W.gzhead.name.charCodeAt(W.gzindex++):0,X(W,A)}while(A!==0);W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),A===0&&(W.gzindex=0,W.status=91)}else W.status=91;if(W.status===91)if(W.gzhead.comment){I=W.pending;do{if(W.pending===W.pending_buf_size&&(W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),j(O),I=W.pending,W.pending===W.pending_buf_size)){A=1;break}A=W.gzindex<W.gzhead.comment.length?255&W.gzhead.comment.charCodeAt(W.gzindex++):0,X(W,A)}while(A!==0);W.gzhead.hcrc&&W.pending>I&&(O.adler=u(O.adler,W.pending_buf,W.pending-I,I)),A===0&&(W.status=103)}else W.status=103;if(W.status===103&&(W.gzhead.hcrc?(W.pending+2>W.pending_buf_size&&j(O),W.pending+2<=W.pending_buf_size&&(X(W,255&O.adler),X(W,O.adler>>8&255),O.adler=0,W.status=L)):W.status=L),W.pending!==0){if(j(O),O.avail_out===0)return W.last_flush=-1,h}else if(O.avail_in===0&&$(he)<=$(ae)&&he!==f)return K(O,-5);if(W.status===666&&O.avail_in!==0)return K(O,-5);if(O.avail_in!==0||W.lookahead!==0||he!==d&&W.status!==666){var Q=W.strategy===2?function(H,ee){for(var de;;){if(H.lookahead===0&&(le(H),H.lookahead===0)){if(ee===d)return S;break}if(H.match_length=0,de=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,de&&(D(H,!1),H.strm.avail_out===0))return S}return H.insert=0,ee===f?(D(H,!0),H.strm.avail_out===0?N:U):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?S:C}(W,he):W.strategy===3?function(H,ee){for(var de,fe,De,rt,Xe=H.window;;){if(H.lookahead<=F){if(le(H),H.lookahead<=F&&ee===d)return S;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=R&&0<H.strstart&&(fe=Xe[De=H.strstart-1])===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]){rt=H.strstart+F;do;while(fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&fe===Xe[++De]&&De<rt);H.match_length=F-(rt-De),H.match_length>H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=R?(de=a._tr_tally(H,1,H.match_length-R),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(de=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),de&&(D(H,!1),H.strm.avail_out===0))return S}return H.insert=0,ee===f?(D(H,!0),H.strm.avail_out===0?N:U):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?S:C}(W,he):s[W.level].func(W,he);if(Q!==N&&Q!==U||(W.status=666),Q===S||Q===N)return O.avail_out===0&&(W.last_flush=-1),h;if(Q===C&&(he===1?a._tr_align(W):he!==5&&(a._tr_stored_block(W,0,0,!1),he===3&&(q(W.head),W.lookahead===0&&(W.strstart=0,W.block_start=0,W.insert=0))),j(O),O.avail_out===0))return W.last_flush=-1,h}return he!==f?h:W.wrap<=0?1:(W.wrap===2?(X(W,255&O.adler),X(W,O.adler>>8&255),X(W,O.adler>>16&255),X(W,O.adler>>24&255),X(W,255&O.total_in),X(W,O.total_in>>8&255),X(W,O.total_in>>16&255),X(W,O.total_in>>24&255)):(Z(W,O.adler>>>16),Z(W,65535&O.adler)),j(O),0<W.wrap&&(W.wrap=-W.wrap),W.pending!==0?h:1)},i.deflateEnd=function(O){var he;return O&&O.state?(he=O.state.status)!==T&&he!==69&&he!==73&&he!==91&&he!==103&&he!==L&&he!==666?K(O,m):(O.state=null,he===L?K(O,-3):h):m},i.deflateSetDictionary=function(O,he){var ae,W,I,A,G,Q,H,ee,de=he.length;if(!O||!O.state||(A=(ae=O.state).wrap)===2||A===1&&ae.status!==T||ae.lookahead)return m;for(A===1&&(O.adler=c(O.adler,he,de,0)),ae.wrap=0,de>=ae.w_size&&(A===0&&(q(ae.head),ae.strstart=0,ae.block_start=0,ae.insert=0),ee=new o.Buf8(ae.w_size),o.arraySet(ee,he,de-ae.w_size,ae.w_size,0),he=ee,de=ae.w_size),G=O.avail_in,Q=O.next_in,H=O.input,O.avail_in=de,O.next_in=0,O.input=he,le(ae);ae.lookahead>=R;){for(W=ae.strstart,I=ae.lookahead-(R-1);ae.ins_h=(ae.ins_h<<ae.hash_shift^ae.window[W+R-1])&ae.hash_mask,ae.prev[W&ae.w_mask]=ae.head[ae.ins_h],ae.head[ae.ins_h]=W,W++,--I;);ae.strstart=W,ae.lookahead=R-1,le(ae)}return ae.strstart+=ae.lookahead,ae.block_start=ae.strstart,ae.insert=ae.lookahead,ae.lookahead=0,ae.match_length=ae.prev_length=R-1,ae.match_available=0,O.next_in=Q,O.input=H,O.avail_in=G,ae.wrap=A,h},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,i){r.exports=function(s,o){var a,c,u,l,d,f,h,m,p,g,y,v,b,E,w,x,_,k,R,F,V,T,L,S,C;a=s.state,c=s.next_in,S=s.input,u=c+(s.avail_in-5),l=s.next_out,C=s.output,d=l-(o-s.avail_out),f=l+(s.avail_out-257),h=a.dmax,m=a.wsize,p=a.whave,g=a.wnext,y=a.window,v=a.hold,b=a.bits,E=a.lencode,w=a.distcode,x=(1<<a.lenbits)-1,_=(1<<a.distbits)-1;e:do{b<15&&(v+=S[c++]<<b,b+=8,v+=S[c++]<<b,b+=8),k=E[v&x];t:for(;;){if(v>>>=R=k>>>24,b-=R,(R=k>>>16&255)===0)C[l++]=65535&k;else{if(!(16&R)){if(!(64&R)){k=E[(65535&k)+(v&(1<<R)-1)];continue t}if(32&R){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}F=65535&k,(R&=15)&&(b<R&&(v+=S[c++]<<b,b+=8),F+=v&(1<<R)-1,v>>>=R,b-=R),b<15&&(v+=S[c++]<<b,b+=8,v+=S[c++]<<b,b+=8),k=w[v&_];n:for(;;){if(v>>>=R=k>>>24,b-=R,!(16&(R=k>>>16&255))){if(!(64&R)){k=w[(65535&k)+(v&(1<<R)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(V=65535&k,b<(R&=15)&&(v+=S[c++]<<b,(b+=8)<R&&(v+=S[c++]<<b,b+=8)),h<(V+=v&(1<<R)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=R,b-=R,(R=l-d)<V){if(p<(R=V-R)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(L=y,(T=0)===g){if(T+=m-R,R<F){for(F-=R;C[l++]=y[T++],--R;);T=l-V,L=C}}else if(g<R){if(T+=m+g-R,(R-=g)<F){for(F-=R;C[l++]=y[T++],--R;);if(T=0,g<F){for(F-=R=g;C[l++]=y[T++],--R;);T=l-V,L=C}}}else if(T+=g-R,R<F){for(F-=R;C[l++]=y[T++],--R;);T=l-V,L=C}for(;2<F;)C[l++]=L[T++],C[l++]=L[T++],C[l++]=L[T++],F-=3;F&&(C[l++]=L[T++],1<F&&(C[l++]=L[T++]))}else{for(T=l-V;C[l++]=C[T++],C[l++]=C[T++],C[l++]=C[T++],2<(F-=3););F&&(C[l++]=C[T++],1<F&&(C[l++]=C[T++]))}break}}break}}while(c<u&&l<f);c-=F=b>>3,v&=(1<<(b-=F<<3))-1,s.next_in=c,s.next_out=l,s.avail_in=c<u?u-c+5:5-(c-u),s.avail_out=l<f?f-l+257:257-(l-f),a.hold=v,a.bits=b}},{}],49:[function(n,r,i){var s=n("../utils/common"),o=n("./adler32"),a=n("./crc32"),c=n("./inffast"),u=n("./inftrees"),l=1,d=2,f=0,h=-2,m=1,p=852,g=592;function y(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(T){var L;return T&&T.state?(L=T.state,T.total_in=T.total_out=L.total=0,T.msg="",L.wrap&&(T.adler=1&L.wrap),L.mode=m,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new s.Buf32(p),L.distcode=L.distdyn=new s.Buf32(g),L.sane=1,L.back=-1,f):h}function E(T){var L;return T&&T.state?((L=T.state).wsize=0,L.whave=0,L.wnext=0,b(T)):h}function w(T,L){var S,C;return T&&T.state?(C=T.state,L<0?(S=0,L=-L):(S=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?h:(C.window!==null&&C.wbits!==L&&(C.window=null),C.wrap=S,C.wbits=L,E(T))):h}function x(T,L){var S,C;return T?(C=new v,(T.state=C).window=null,(S=w(T,L))!==f&&(T.state=null),S):h}var _,k,R=!0;function F(T){if(R){var L;for(_=new s.Buf32(512),k=new s.Buf32(32),L=0;L<144;)T.lens[L++]=8;for(;L<256;)T.lens[L++]=9;for(;L<280;)T.lens[L++]=7;for(;L<288;)T.lens[L++]=8;for(u(l,T.lens,0,288,_,0,T.work,{bits:9}),L=0;L<32;)T.lens[L++]=5;u(d,T.lens,0,32,k,0,T.work,{bits:5}),R=!1}T.lencode=_,T.lenbits=9,T.distcode=k,T.distbits=5}function V(T,L,S,C){var N,U=T.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new s.Buf8(U.wsize)),C>=U.wsize?(s.arraySet(U.window,L,S-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(C<(N=U.wsize-U.wnext)&&(N=C),s.arraySet(U.window,L,S-C,N,U.wnext),(C-=N)?(s.arraySet(U.window,L,S-C,C,0),U.wnext=C,U.whave=U.wsize):(U.wnext+=N,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=N))),0}i.inflateReset=E,i.inflateReset2=w,i.inflateResetKeep=b,i.inflateInit=function(T){return x(T,15)},i.inflateInit2=x,i.inflate=function(T,L){var S,C,N,U,K,$,q,j,D,X,Z,z,le,pe,ve,je,ct,ut,Ye,Ot,O,he,ae,W,I=0,A=new s.Buf8(4),G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return h;(S=T.state).mode===12&&(S.mode=13),K=T.next_out,N=T.output,q=T.avail_out,U=T.next_in,C=T.input,$=T.avail_in,j=S.hold,D=S.bits,X=$,Z=q,he=f;e:for(;;)switch(S.mode){case m:if(S.wrap===0){S.mode=13;break}for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(2&S.wrap&&j===35615){A[S.check=0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0),D=j=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&j)<<8)+(j>>8))%31){T.msg="incorrect header check",S.mode=30;break}if((15&j)!=8){T.msg="unknown compression method",S.mode=30;break}if(D-=4,O=8+(15&(j>>>=4)),S.wbits===0)S.wbits=O;else if(O>S.wbits){T.msg="invalid window size",S.mode=30;break}S.dmax=1<<O,T.adler=S.check=1,S.mode=512&j?10:12,D=j=0;break;case 2:for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(S.flags=j,(255&S.flags)!=8){T.msg="unknown compression method",S.mode=30;break}if(57344&S.flags){T.msg="unknown header flags set",S.mode=30;break}S.head&&(S.head.text=j>>8&1),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0)),D=j=0,S.mode=3;case 3:for(;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.head&&(S.head.time=j),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,A[2]=j>>>16&255,A[3]=j>>>24&255,S.check=a(S.check,A,4,0)),D=j=0,S.mode=4;case 4:for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.head&&(S.head.xflags=255&j,S.head.os=j>>8),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0)),D=j=0,S.mode=5;case 5:if(1024&S.flags){for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.length=j,S.head&&(S.head.extra_len=j),512&S.flags&&(A[0]=255&j,A[1]=j>>>8&255,S.check=a(S.check,A,2,0)),D=j=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&($<(z=S.length)&&(z=$),z&&(S.head&&(O=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),s.arraySet(S.head.extra,C,U,z,O)),512&S.flags&&(S.check=a(S.check,C,z,U)),$-=z,U+=z,S.length-=z),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if($===0)break e;for(z=0;O=C[U+z++],S.head&&O&&S.length<65536&&(S.head.name+=String.fromCharCode(O)),O&&z<$;);if(512&S.flags&&(S.check=a(S.check,C,z,U)),$-=z,U+=z,O)break e}else S.head&&(S.head.name=null);S.length=0,S.mode=8;case 8:if(4096&S.flags){if($===0)break e;for(z=0;O=C[U+z++],S.head&&O&&S.length<65536&&(S.head.comment+=String.fromCharCode(O)),O&&z<$;);if(512&S.flags&&(S.check=a(S.check,C,z,U)),$-=z,U+=z,O)break e}else S.head&&(S.head.comment=null);S.mode=9;case 9:if(512&S.flags){for(;D<16;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(j!==(65535&S.check)){T.msg="header crc mismatch",S.mode=30;break}D=j=0}S.head&&(S.head.hcrc=S.flags>>9&1,S.head.done=!0),T.adler=S.check=0,S.mode=12;break;case 10:for(;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}T.adler=S.check=y(j),D=j=0,S.mode=11;case 11:if(S.havedict===0)return T.next_out=K,T.avail_out=q,T.next_in=U,T.avail_in=$,S.hold=j,S.bits=D,2;T.adler=S.check=1,S.mode=12;case 12:if(L===5||L===6)break e;case 13:if(S.last){j>>>=7&D,D-=7&D,S.mode=27;break}for(;D<3;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}switch(S.last=1&j,D-=1,3&(j>>>=1)){case 0:S.mode=14;break;case 1:if(F(S),S.mode=20,L!==6)break;j>>>=2,D-=2;break e;case 2:S.mode=17;break;case 3:T.msg="invalid block type",S.mode=30}j>>>=2,D-=2;break;case 14:for(j>>>=7&D,D-=7&D;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if((65535&j)!=(j>>>16^65535)){T.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&j,D=j=0,S.mode=15,L===6)break e;case 15:S.mode=16;case 16:if(z=S.length){if($<z&&(z=$),q<z&&(z=q),z===0)break e;s.arraySet(N,C,U,z,K),$-=z,U+=z,q-=z,K+=z,S.length-=z;break}S.mode=12;break;case 17:for(;D<14;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(S.nlen=257+(31&j),j>>>=5,D-=5,S.ndist=1+(31&j),j>>>=5,D-=5,S.ncode=4+(15&j),j>>>=4,D-=4,286<S.nlen||30<S.ndist){T.msg="too many length or distance symbols",S.mode=30;break}S.have=0,S.mode=18;case 18:for(;S.have<S.ncode;){for(;D<3;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.lens[G[S.have++]]=7&j,j>>>=3,D-=3}for(;S.have<19;)S.lens[G[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,ae={bits:S.lenbits},he=u(0,S.lens,0,19,S.lencode,0,S.work,ae),S.lenbits=ae.bits,he){T.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have<S.nlen+S.ndist;){for(;je=(I=S.lencode[j&(1<<S.lenbits)-1])>>>16&255,ct=65535&I,!((ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(ct<16)j>>>=ve,D-=ve,S.lens[S.have++]=ct;else{if(ct===16){for(W=ve+2;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(j>>>=ve,D-=ve,S.have===0){T.msg="invalid bit length repeat",S.mode=30;break}O=S.lens[S.have-1],z=3+(3&j),j>>>=2,D-=2}else if(ct===17){for(W=ve+3;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}D-=ve,O=0,z=3+(7&(j>>>=ve)),j>>>=3,D-=3}else{for(W=ve+7;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}D-=ve,O=0,z=11+(127&(j>>>=ve)),j>>>=7,D-=7}if(S.have+z>S.nlen+S.ndist){T.msg="invalid bit length repeat",S.mode=30;break}for(;z--;)S.lens[S.have++]=O}}if(S.mode===30)break;if(S.lens[256]===0){T.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,ae={bits:S.lenbits},he=u(l,S.lens,0,S.nlen,S.lencode,0,S.work,ae),S.lenbits=ae.bits,he){T.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,ae={bits:S.distbits},he=u(d,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,ae),S.distbits=ae.bits,he){T.msg="invalid distances set",S.mode=30;break}if(S.mode=20,L===6)break e;case 20:S.mode=21;case 21:if(6<=$&&258<=q){T.next_out=K,T.avail_out=q,T.next_in=U,T.avail_in=$,S.hold=j,S.bits=D,c(T,Z),K=T.next_out,N=T.output,q=T.avail_out,U=T.next_in,C=T.input,$=T.avail_in,j=S.hold,D=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;je=(I=S.lencode[j&(1<<S.lenbits)-1])>>>16&255,ct=65535&I,!((ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(je&&!(240&je)){for(ut=ve,Ye=je,Ot=ct;je=(I=S.lencode[Ot+((j&(1<<ut+Ye)-1)>>ut)])>>>16&255,ct=65535&I,!(ut+(ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}j>>>=ut,D-=ut,S.back+=ut}if(j>>>=ve,D-=ve,S.back+=ve,S.length=ct,je===0){S.mode=26;break}if(32&je){S.back=-1,S.mode=12;break}if(64&je){T.msg="invalid literal/length code",S.mode=30;break}S.extra=15&je,S.mode=22;case 22:if(S.extra){for(W=S.extra;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.length+=j&(1<<S.extra)-1,j>>>=S.extra,D-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;je=(I=S.distcode[j&(1<<S.distbits)-1])>>>16&255,ct=65535&I,!((ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(!(240&je)){for(ut=ve,Ye=je,Ot=ct;je=(I=S.distcode[Ot+((j&(1<<ut+Ye)-1)>>ut)])>>>16&255,ct=65535&I,!(ut+(ve=I>>>24)<=D);){if($===0)break e;$--,j+=C[U++]<<D,D+=8}j>>>=ut,D-=ut,S.back+=ut}if(j>>>=ve,D-=ve,S.back+=ve,64&je){T.msg="invalid distance code",S.mode=30;break}S.offset=ct,S.extra=15&je,S.mode=24;case 24:if(S.extra){for(W=S.extra;D<W;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}S.offset+=j&(1<<S.extra)-1,j>>>=S.extra,D-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){T.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(q===0)break e;if(z=Z-q,S.offset>z){if((z=S.offset-z)>S.whave&&S.sane){T.msg="invalid distance too far back",S.mode=30;break}le=z>S.wnext?(z-=S.wnext,S.wsize-z):S.wnext-z,z>S.length&&(z=S.length),pe=S.window}else pe=N,le=K-S.offset,z=S.length;for(q<z&&(z=q),q-=z,S.length-=z;N[K++]=pe[le++],--z;);S.length===0&&(S.mode=21);break;case 26:if(q===0)break e;N[K++]=S.length,q--,S.mode=21;break;case 27:if(S.wrap){for(;D<32;){if($===0)break e;$--,j|=C[U++]<<D,D+=8}if(Z-=q,T.total_out+=Z,S.total+=Z,Z&&(T.adler=S.check=S.flags?a(S.check,N,Z,K-Z):o(S.check,N,Z,K-Z)),Z=q,(S.flags?j:y(j))!==S.check){T.msg="incorrect data check",S.mode=30;break}D=j=0}S.mode=28;case 28:if(S.wrap&&S.flags){for(;D<32;){if($===0)break e;$--,j+=C[U++]<<D,D+=8}if(j!==(4294967295&S.total)){T.msg="incorrect length check",S.mode=30;break}D=j=0}S.mode=29;case 29:he=1;break e;case 30:he=-3;break e;case 31:return-4;case 32:default:return h}return T.next_out=K,T.avail_out=q,T.next_in=U,T.avail_in=$,S.hold=j,S.bits=D,(S.wsize||Z!==T.avail_out&&S.mode<30&&(S.mode<27||L!==4))&&V(T,T.output,T.next_out,Z-T.avail_out)?(S.mode=31,-4):(X-=T.avail_in,Z-=T.avail_out,T.total_in+=X,T.total_out+=Z,S.total+=Z,S.wrap&&Z&&(T.adler=S.check=S.flags?a(S.check,N,Z,T.next_out-Z):o(S.check,N,Z,T.next_out-Z)),T.data_type=S.bits+(S.last?64:0)+(S.mode===12?128:0)+(S.mode===20||S.mode===15?256:0),(X==0&&Z===0||L===4)&&he===f&&(he=-5),he)},i.inflateEnd=function(T){if(!T||!T.state)return h;var L=T.state;return L.window&&(L.window=null),T.state=null,f},i.inflateGetHeader=function(T,L){var S;return T&&T.state&&2&(S=T.state).wrap?((S.head=L).done=!1,f):h},i.inflateSetDictionary=function(T,L){var S,C=L.length;return T&&T.state?(S=T.state).wrap!==0&&S.mode!==11?h:S.mode===11&&o(1,L,C,0)!==S.check?-3:V(T,L,C,C)?(S.mode=31,-4):(S.havedict=1,f):h},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var s=n("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(l,d,f,h,m,p,g,y){var v,b,E,w,x,_,k,R,F,V=y.bits,T=0,L=0,S=0,C=0,N=0,U=0,K=0,$=0,q=0,j=0,D=null,X=0,Z=new s.Buf16(16),z=new s.Buf16(16),le=null,pe=0;for(T=0;T<=15;T++)Z[T]=0;for(L=0;L<h;L++)Z[d[f+L]]++;for(N=V,C=15;1<=C&&Z[C]===0;C--);if(C<N&&(N=C),C===0)return m[p++]=20971520,m[p++]=20971520,y.bits=1,0;for(S=1;S<C&&Z[S]===0;S++);for(N<S&&(N=S),T=$=1;T<=15;T++)if($<<=1,($-=Z[T])<0)return-1;if(0<$&&(l===0||C!==1))return-1;for(z[1]=0,T=1;T<15;T++)z[T+1]=z[T]+Z[T];for(L=0;L<h;L++)d[f+L]!==0&&(g[z[d[f+L]]++]=L);if(_=l===0?(D=le=g,19):l===1?(D=o,X-=257,le=a,pe-=257,256):(D=c,le=u,-1),T=S,x=p,K=L=j=0,E=-1,w=(q=1<<(U=N))-1,l===1&&852<q||l===2&&592<q)return 1;for(;;){for(k=T-K,F=g[L]<_?(R=0,g[L]):g[L]>_?(R=le[pe+g[L]],D[X+g[L]]):(R=96,0),v=1<<T-K,S=b=1<<U;m[x+(j>>K)+(b-=v)]=k<<24|R<<16|F|0,b!==0;);for(v=1<<T-1;j&v;)v>>=1;if(v!==0?(j&=v-1,j+=v):j=0,L++,--Z[T]==0){if(T===C)break;T=d[f+g[L]]}if(N<T&&(j&w)!==E){for(K===0&&(K=N),x+=S,$=1<<(U=T-K);U+K<C&&!(($-=Z[U+K])<=0);)U++,$<<=1;if(q+=1<<U,l===1&&852<q||l===2&&592<q)return 1;m[E=j&w]=N<<24|U<<16|x-p|0}}return j!==0&&(m[x+j]=T-K<<24|64<<16|0),y.bits=N,0}},{"../utils/common":41}],51:[function(n,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,i){var s=n("../utils/common"),o=0,a=1;function c(I){for(var A=I.length;0<=--A;)I[A]=0}var u=0,l=29,d=256,f=d+1+l,h=30,m=19,p=2*f+1,g=15,y=16,v=7,b=256,E=16,w=17,x=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=new Array(2*(f+2));c(V);var T=new Array(2*h);c(T);var L=new Array(512);c(L);var S=new Array(256);c(S);var C=new Array(l);c(C);var N,U,K,$=new Array(h);function q(I,A,G,Q,H){this.static_tree=I,this.extra_bits=A,this.extra_base=G,this.elems=Q,this.max_length=H,this.has_stree=I&&I.length}function j(I,A){this.dyn_tree=I,this.max_code=0,this.stat_desc=A}function D(I){return I<256?L[I]:L[256+(I>>>7)]}function X(I,A){I.pending_buf[I.pending++]=255&A,I.pending_buf[I.pending++]=A>>>8&255}function Z(I,A,G){I.bi_valid>y-G?(I.bi_buf|=A<<I.bi_valid&65535,X(I,I.bi_buf),I.bi_buf=A>>y-I.bi_valid,I.bi_valid+=G-y):(I.bi_buf|=A<<I.bi_valid&65535,I.bi_valid+=G)}function z(I,A,G){Z(I,G[2*A],G[2*A+1])}function le(I,A){for(var G=0;G|=1&I,I>>>=1,G<<=1,0<--A;);return G>>>1}function pe(I,A,G){var Q,H,ee=new Array(g+1),de=0;for(Q=1;Q<=g;Q++)ee[Q]=de=de+G[Q-1]<<1;for(H=0;H<=A;H++){var fe=I[2*H+1];fe!==0&&(I[2*H]=le(ee[fe]++,fe))}}function ve(I){var A;for(A=0;A<f;A++)I.dyn_ltree[2*A]=0;for(A=0;A<h;A++)I.dyn_dtree[2*A]=0;for(A=0;A<m;A++)I.bl_tree[2*A]=0;I.dyn_ltree[2*b]=1,I.opt_len=I.static_len=0,I.last_lit=I.matches=0}function je(I){8<I.bi_valid?X(I,I.bi_buf):0<I.bi_valid&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0}function ct(I,A,G,Q){var H=2*A,ee=2*G;return I[H]<I[ee]||I[H]===I[ee]&&Q[A]<=Q[G]}function ut(I,A,G){for(var Q=I.heap[G],H=G<<1;H<=I.heap_len&&(H<I.heap_len&&ct(A,I.heap[H+1],I.heap[H],I.depth)&&H++,!ct(A,Q,I.heap[H],I.depth));)I.heap[G]=I.heap[H],G=H,H<<=1;I.heap[G]=Q}function Ye(I,A,G){var Q,H,ee,de,fe=0;if(I.last_lit!==0)for(;Q=I.pending_buf[I.d_buf+2*fe]<<8|I.pending_buf[I.d_buf+2*fe+1],H=I.pending_buf[I.l_buf+fe],fe++,Q===0?z(I,H,A):(z(I,(ee=S[H])+d+1,A),(de=_[ee])!==0&&Z(I,H-=C[ee],de),z(I,ee=D(--Q),G),(de=k[ee])!==0&&Z(I,Q-=$[ee],de)),fe<I.last_lit;);z(I,b,A)}function Ot(I,A){var G,Q,H,ee=A.dyn_tree,de=A.stat_desc.static_tree,fe=A.stat_desc.has_stree,De=A.stat_desc.elems,rt=-1;for(I.heap_len=0,I.heap_max=p,G=0;G<De;G++)ee[2*G]!==0?(I.heap[++I.heap_len]=rt=G,I.depth[G]=0):ee[2*G+1]=0;for(;I.heap_len<2;)ee[2*(H=I.heap[++I.heap_len]=rt<2?++rt:0)]=1,I.depth[H]=0,I.opt_len--,fe&&(I.static_len-=de[2*H+1]);for(A.max_code=rt,G=I.heap_len>>1;1<=G;G--)ut(I,ee,G);for(H=De;G=I.heap[1],I.heap[1]=I.heap[I.heap_len--],ut(I,ee,1),Q=I.heap[1],I.heap[--I.heap_max]=G,I.heap[--I.heap_max]=Q,ee[2*H]=ee[2*G]+ee[2*Q],I.depth[H]=(I.depth[G]>=I.depth[Q]?I.depth[G]:I.depth[Q])+1,ee[2*G+1]=ee[2*Q+1]=H,I.heap[1]=H++,ut(I,ee,1),2<=I.heap_len;);I.heap[--I.heap_max]=I.heap[1],function(Xe,tn){var sr,vn,Zr,Rt,Nr,ai,_r=tn.dyn_tree,eo=tn.max_code,ea=tn.stat_desc.static_tree,to=tn.stat_desc.has_stree,Ar=tn.stat_desc.extra_bits,no=tn.stat_desc.extra_base,ci=tn.stat_desc.max_length,vs=0;for(Rt=0;Rt<=g;Rt++)Xe.bl_count[Rt]=0;for(_r[2*Xe.heap[Xe.heap_max]+1]=0,sr=Xe.heap_max+1;sr<p;sr++)ci<(Rt=_r[2*_r[2*(vn=Xe.heap[sr])+1]+1]+1)&&(Rt=ci,vs++),_r[2*vn+1]=Rt,eo<vn||(Xe.bl_count[Rt]++,Nr=0,no<=vn&&(Nr=Ar[vn-no]),ai=_r[2*vn],Xe.opt_len+=ai*(Rt+Nr),to&&(Xe.static_len+=ai*(ea[2*vn+1]+Nr)));if(vs!==0){do{for(Rt=ci-1;Xe.bl_count[Rt]===0;)Rt--;Xe.bl_count[Rt]--,Xe.bl_count[Rt+1]+=2,Xe.bl_count[ci]--,vs-=2}while(0<vs);for(Rt=ci;Rt!==0;Rt--)for(vn=Xe.bl_count[Rt];vn!==0;)eo<(Zr=Xe.heap[--sr])||(_r[2*Zr+1]!==Rt&&(Xe.opt_len+=(Rt-_r[2*Zr+1])*_r[2*Zr],_r[2*Zr+1]=Rt),vn--)}}(I,A),pe(ee,rt,I.bl_count)}function O(I,A,G){var Q,H,ee=-1,de=A[1],fe=0,De=7,rt=4;for(de===0&&(De=138,rt=3),A[2*(G+1)+1]=65535,Q=0;Q<=G;Q++)H=de,de=A[2*(Q+1)+1],++fe<De&&H===de||(fe<rt?I.bl_tree[2*H]+=fe:H!==0?(H!==ee&&I.bl_tree[2*H]++,I.bl_tree[2*E]++):fe<=10?I.bl_tree[2*w]++:I.bl_tree[2*x]++,ee=H,rt=(fe=0)===de?(De=138,3):H===de?(De=6,3):(De=7,4))}function he(I,A,G){var Q,H,ee=-1,de=A[1],fe=0,De=7,rt=4;for(de===0&&(De=138,rt=3),Q=0;Q<=G;Q++)if(H=de,de=A[2*(Q+1)+1],!(++fe<De&&H===de)){if(fe<rt)for(;z(I,H,I.bl_tree),--fe!=0;);else H!==0?(H!==ee&&(z(I,H,I.bl_tree),fe--),z(I,E,I.bl_tree),Z(I,fe-3,2)):fe<=10?(z(I,w,I.bl_tree),Z(I,fe-3,3)):(z(I,x,I.bl_tree),Z(I,fe-11,7));ee=H,rt=(fe=0)===de?(De=138,3):H===de?(De=6,3):(De=7,4)}}c($);var ae=!1;function W(I,A,G,Q){Z(I,(u<<1)+(Q?1:0),3),function(H,ee,de,fe){je(H),X(H,de),X(H,~de),s.arraySet(H.pending_buf,H.window,ee,de,H.pending),H.pending+=de}(I,A,G)}i._tr_init=function(I){ae||(function(){var A,G,Q,H,ee,de=new Array(g+1);for(H=Q=0;H<l-1;H++)for(C[H]=Q,A=0;A<1<<_[H];A++)S[Q++]=H;for(S[Q-1]=H,H=ee=0;H<16;H++)for($[H]=ee,A=0;A<1<<k[H];A++)L[ee++]=H;for(ee>>=7;H<h;H++)for($[H]=ee<<7,A=0;A<1<<k[H]-7;A++)L[256+ee++]=H;for(G=0;G<=g;G++)de[G]=0;for(A=0;A<=143;)V[2*A+1]=8,A++,de[8]++;for(;A<=255;)V[2*A+1]=9,A++,de[9]++;for(;A<=279;)V[2*A+1]=7,A++,de[7]++;for(;A<=287;)V[2*A+1]=8,A++,de[8]++;for(pe(V,f+1,de),A=0;A<h;A++)T[2*A+1]=5,T[2*A]=le(A,5);N=new q(V,_,d+1,f,g),U=new q(T,k,0,h,g),K=new q(new Array(0),R,0,m,v)}(),ae=!0),I.l_desc=new j(I.dyn_ltree,N),I.d_desc=new j(I.dyn_dtree,U),I.bl_desc=new j(I.bl_tree,K),I.bi_buf=0,I.bi_valid=0,ve(I)},i._tr_stored_block=W,i._tr_flush_block=function(I,A,G,Q){var H,ee,de=0;0<I.level?(I.strm.data_type===2&&(I.strm.data_type=function(fe){var De,rt=4093624447;for(De=0;De<=31;De++,rt>>>=1)if(1&rt&&fe.dyn_ltree[2*De]!==0)return o;if(fe.dyn_ltree[18]!==0||fe.dyn_ltree[20]!==0||fe.dyn_ltree[26]!==0)return a;for(De=32;De<d;De++)if(fe.dyn_ltree[2*De]!==0)return a;return o}(I)),Ot(I,I.l_desc),Ot(I,I.d_desc),de=function(fe){var De;for(O(fe,fe.dyn_ltree,fe.l_desc.max_code),O(fe,fe.dyn_dtree,fe.d_desc.max_code),Ot(fe,fe.bl_desc),De=m-1;3<=De&&fe.bl_tree[2*F[De]+1]===0;De--);return fe.opt_len+=3*(De+1)+5+5+4,De}(I),H=I.opt_len+3+7>>>3,(ee=I.static_len+3+7>>>3)<=H&&(H=ee)):H=ee=G+5,G+4<=H&&A!==-1?W(I,A,G,Q):I.strategy===4||ee===H?(Z(I,2+(Q?1:0),3),Ye(I,V,T)):(Z(I,4+(Q?1:0),3),function(fe,De,rt,Xe){var tn;for(Z(fe,De-257,5),Z(fe,rt-1,5),Z(fe,Xe-4,4),tn=0;tn<Xe;tn++)Z(fe,fe.bl_tree[2*F[tn]+1],3);he(fe,fe.dyn_ltree,De-1),he(fe,fe.dyn_dtree,rt-1)}(I,I.l_desc.max_code+1,I.d_desc.max_code+1,de+1),Ye(I,I.dyn_ltree,I.dyn_dtree)),ve(I),Q&&je(I)},i._tr_tally=function(I,A,G){return I.pending_buf[I.d_buf+2*I.last_lit]=A>>>8&255,I.pending_buf[I.d_buf+2*I.last_lit+1]=255&A,I.pending_buf[I.l_buf+I.last_lit]=255&G,I.last_lit++,A===0?I.dyn_ltree[2*G]++:(I.matches++,A--,I.dyn_ltree[2*(S[G]+d+1)]++,I.dyn_dtree[2*D(A)]++),I.last_lit===I.lit_bufsize-1},i._tr_align=function(I){Z(I,2,3),z(I,b,V),function(A){A.bi_valid===16?(X(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):8<=A.bi_valid&&(A.pending_buf[A.pending++]=255&A.bi_buf,A.bi_buf>>=8,A.bi_valid-=8)}(I)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(s){(function(o,a){if(!o.setImmediate){var c,u,l,d,f=1,h={},m=!1,p=o.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(o);g=g&&g.setTimeout?g:o,c={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){v(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,w=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=w,E}}()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",b,!1):o.attachEvent("onmessage",b),function(E){o.postMessage(d+E,"*")}):o.MessageChannel?((l=new MessageChannel).port1.onmessage=function(E){v(E.data)},function(E){l.port2.postMessage(E)}):p&&"onreadystatechange"in p.createElement("script")?(u=p.documentElement,function(E){var w=p.createElement("script");w.onreadystatechange=function(){v(E),w.onreadystatechange=null,u.removeChild(w),w=null},u.appendChild(w)}):function(E){setTimeout(v,0,E)},g.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var w=new Array(arguments.length-1),x=0;x<w.length;x++)w[x]=arguments[x+1];var _={callback:E,args:w};return h[f]=_,c(f),f++},g.clearImmediate=y}function y(E){delete h[E]}function v(E){if(m)setTimeout(v,0,E);else{var w=h[E];if(w){m=!0;try{(function(x){var _=x.callback,k=x.args;switch(k.length){case 0:_();break;case 1:_(k[0]);break;case 2:_(k[0],k[1]);break;case 3:_(k[0],k[1],k[2]);break;default:_.apply(a,k)}})(w)}finally{y(E),m=!1}}}}function b(E){E.source===o&&typeof E.data=="string"&&E.data.indexOf(d)===0&&v(+E.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(UO);var p6=UO.exports;const BO=tc(p6),In={Remove:"remove",Replace:"replace",Add:"add"},zO=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),m6=Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),Vh=Symbol.iterator,zr={mutable:"mutable",immutable:"immutable"},N_={};function Ul(t,e){return t instanceof Map?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function hS(t,e){if(e in t){let n=Reflect.getPrototypeOf(t);for(;n;){const r=Reflect.getOwnPropertyDescriptor(n,e);if(r)return r;n=Reflect.getPrototypeOf(n)}}}function A_(t){return Object.getPrototypeOf(t)===Set.prototype}function P_(t){return Object.getPrototypeOf(t)===Map.prototype}function Lr(t){var e;return(e=t.copy)!==null&&e!==void 0?e:t.original}function ja(t){return!!Pt(t)}function Pt(t){return typeof t!="object"?null:t==null?void 0:t[zO]}function M_(t){var e;const n=Pt(t);return n?(e=n.copy)!==null&&e!==void 0?e:n.original:t}function Ri(t,e){if(!t||typeof t!="object")return!1;let n;return Object.getPrototypeOf(t)===Object.prototype||Array.isArray(t)||t instanceof Map||t instanceof Set||!!(e!=null&&e.mark)&&((n=e.mark(t,zr))===zr.immutable||typeof n=="function")}function VO(t,e=[]){if(Object.hasOwnProperty.call(t,"key")){const n=t.parent.copy,r=Pt(Hs(n,t.key));if(r!==null&&(r==null?void 0:r.original)!==t.original)return null;const i=t.parent.type===3,s=i?Array.from(t.parent.setMap.keys()).indexOf(t.key):t.key;if(!(i&&n.size>s||Ul(n,s)))return null;e.push(s)}if(t.parent)return VO(t.parent,e);e.reverse();try{g6(t.copy,e)}catch{return null}return e}function sc(t){return Array.isArray(t)?1:t instanceof Map?2:t instanceof Set?3:0}function Hs(t,e){return sc(t)===2?t.get(e):t[e]}function vf(t,e,n){sc(t)===2?t.set(e,n):t[e]=n}function gy(t,e){const n=Pt(t);return(n?Lr(n):t)[e]}function $s(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function xv(t){if(t)for(;t.finalities.revoke.length>0;)t.finalities.revoke.pop()()}function ha(t,e){return e?t:[""].concat(t).map(n=>{const r=`${n}`;return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function g6(t,e){for(let n=0;n<e.length-1;n+=1){const r=e[n];if(t=Hs(sc(t)===3?Array.from(t):t,r),typeof t!="object")throw new Error(`Cannot resolve patch at '${e.join("/")}'.`)}return t}function y6(t){const e=Object.create(Object.getPrototypeOf(t));return Reflect.ownKeys(t).forEach(n=>{let r=Reflect.getOwnPropertyDescriptor(t,n);if(r.enumerable&&r.configurable&&r.writable){e[n]=t[n];return}r.writable||(r.writable=!0,r.configurable=!0),(r.get||r.set)&&(r={configurable:!0,writable:!0,enumerable:r.enumerable,value:t[n]}),Reflect.defineProperty(e,n,r)}),e}const v6=Object.prototype.propertyIsEnumerable;function HO(t,e){let n;if(Array.isArray(t))return Array.prototype.concat.call(t);if(t instanceof Set){if(!A_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(t.values())}return Set.prototype.difference?Set.prototype.difference.call(t,new Set):new Set(t.values())}else if(t instanceof Map){if(!P_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(t)}return new Map(t)}else if(e!=null&&e.mark&&(n=e.mark(t,zr),n!==void 0)&&n!==zr.mutable){if(n===zr.immutable)return y6(t);if(typeof n=="function"){if(e.enablePatches||e.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return n()}throw new Error(`Unsupported mark result: ${n}`)}else if(typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i]}),Object.getOwnPropertySymbols(t).forEach(i=>{v6.call(t,i)&&(r[i]=t[i])}),r}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function fr(t){t.copy||(t.copy=HO(t.original,t.options))}function xl(t){if(!Ri(t))return M_(t);if(Array.isArray(t))return t.map(xl);if(t instanceof Map){const n=Array.from(t.entries()).map(([r,i])=>[r,xl(i)]);if(!P_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(n)}return new Map(n)}if(t instanceof Set){const n=Array.from(t).map(xl);if(!A_(t)){const r=Object.getPrototypeOf(t).constructor;return new r(n)}return new Set(n)}const e=Object.create(Object.getPrototypeOf(t));for(const n in t)e[n]=xl(t[n]);return e}function Hh(t){return ja(t)?xl(t):t}function is(t){var e;t.assignedMap=(e=t.assignedMap)!==null&&e!==void 0?e:new Map,t.operated||(t.operated=!0,t.parent&&is(t.parent))}function pS(){throw new Error("Cannot modify frozen object")}function Rc(t,e,n,r,i){{n=n??new WeakMap,r=r??[],i=i??[];const o=n.has(t)?n.get(t):t;if(r.length>0){const a=r.indexOf(o);if(o&&typeof o=="object"&&a!==-1)throw r[0]===o?new Error("Forbids circular reference"):new Error(`Forbids circular reference: ~/${i.slice(0,a).map((c,u)=>{if(typeof c=="symbol")return`[${c.toString()}]`;const l=r[u];return typeof c=="object"&&(l instanceof Map||l instanceof Set)?Array.from(l.keys()).indexOf(c):c}).join("/")}`);r.push(o),i.push(e)}else r.push(o)}if(Object.isFrozen(t)||ja(t)){r.pop(),i.pop();return}switch(sc(t)){case 2:for(const[a,c]of t)Rc(a,a,n,r,i),Rc(c,a,n,r,i);t.set=t.clear=t.delete=pS;break;case 3:for(const a of t)Rc(a,a,n,r,i);t.add=t.clear=t.delete=pS;break;case 1:Object.freeze(t);let o=0;for(const a of t)Rc(a,o,n,r,i),o+=1;break;default:Object.freeze(t),Object.keys(t).forEach(a=>{const c=t[a];Rc(c,a,n,r,i)})}r.pop(),i.pop()}function L_(t,e){const n=sc(t);if(n===0)Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)});else if(n===1){let r=0;for(const i of t)e(r,i,t),r+=1}else t.forEach((r,i)=>e(i,r,t))}function WO(t,e,n){if(ja(t)||!Ri(t,n)||e.has(t)||Object.isFrozen(t))return;const r=t instanceof Set,i=r?new Map:void 0;if(e.add(t),L_(t,(s,o)=>{var a;if(ja(o)){const c=Pt(o);fr(c);const u=!((a=c.assignedMap)===null||a===void 0)&&a.size||c.operated?c.copy:c.original;vf(r?i:t,s,u)}else WO(o,e,n)}),i){const s=t,o=Array.from(s);s.clear(),o.forEach(a=>{s.add(i.has(a)?i.get(a):a)})}}function b6(t,e){const n=t.type===3?t.setMap:t.copy;t.finalities.revoke.length>1&&t.assignedMap.get(e)&&n&&WO(Hs(n,e),t.finalities.handledSet,t.options)}function Tv(t){t.type===3&&t.copy&&(t.copy.clear(),t.setMap.forEach(e=>{t.copy.add(M_(e))}))}function Iv(t,e,n,r){if(t.operated&&t.assignedMap&&t.assignedMap.size>0&&!t.finalized){if(n&&r){const s=VO(t);s&&e(t,s,n,r)}t.finalized=!0}}function F_(t,e,n,r){const i=Pt(n);i&&(i.callbacks||(i.callbacks=[]),i.callbacks.push((s,o)=>{var a;const c=t.type===3?t.setMap:t.copy;if($s(Hs(c,e),n)){let u=i.original;i.copy&&(u=i.copy),Tv(t),Iv(t,r,s,o),t.options.enableAutoFreeze&&(t.options.updatedValues=(a=t.options.updatedValues)!==null&&a!==void 0?a:new WeakMap,t.options.updatedValues.set(u,i.original)),vf(c,e,u)}}),t.options.enableAutoFreeze&&i.finalities!==t.finalities&&(t.options.enableAutoFreeze=!1)),Ri(n,t.options)&&t.finalities.draft.push(()=>{const s=t.type===3?t.setMap:t.copy;$s(Hs(s,e),n)&&b6(t,e)})}function _6(t,e,n,r,i){let{original:s,assignedMap:o,options:a}=t,c=t.copy;c.length<s.length&&([s,c]=[c,s],[n,r]=[r,n]);for(let u=0;u<s.length;u+=1)if(o.get(u.toString())&&c[u]!==s[u]){const l=e.concat([u]),d=ha(l,i);n.push({op:In.Replace,path:d,value:Hh(c[u])}),r.push({op:In.Replace,path:d,value:Hh(s[u])})}for(let u=s.length;u<c.length;u+=1){const l=e.concat([u]),d=ha(l,i);n.push({op:In.Add,path:d,value:Hh(c[u])})}if(s.length<c.length){const{arrayLengthAssignment:u=!0}=a.enablePatches;if(u){const l=e.concat(["length"]),d=ha(l,i);r.push({op:In.Replace,path:d,value:s.length})}else for(let l=c.length;s.length<l;l-=1){const d=e.concat([l-1]),f=ha(d,i);r.push({op:In.Remove,path:f})}}}function w6({original:t,copy:e,assignedMap:n},r,i,s,o){n.forEach((a,c)=>{const u=Hs(t,c),l=Hh(Hs(e,c)),d=a?Ul(t,c)?In.Replace:In.Add:In.Remove;if($s(u,l)&&d===In.Replace)return;const f=r.concat(c),h=ha(f,o);i.push(d===In.Remove?{op:d,path:h}:{op:d,path:h,value:l}),s.push(d===In.Add?{op:In.Remove,path:h}:d===In.Remove?{op:In.Add,path:h,value:u}:{op:In.Replace,path:h,value:u})})}function E6({original:t,copy:e},n,r,i,s){let o=0;t.forEach(a=>{if(!e.has(a)){const c=n.concat([o]),u=ha(c,s);r.push({op:In.Remove,path:u,value:a}),i.unshift({op:In.Add,path:u,value:a})}o+=1}),o=0,e.forEach(a=>{if(!t.has(a)){const c=n.concat([o]),u=ha(c,s);r.push({op:In.Add,path:u,value:a}),i.unshift({op:In.Remove,path:u,value:a})}o+=1})}function kd(t,e,n,r){const{pathAsArray:i=!0}=t.options.enablePatches;switch(t.type){case 0:case 2:return w6(t,e,n,r,i);case 1:return _6(t,e,n,r,i);case 3:return E6(t,e,n,r,i)}}let Ov=!1;const Lp=(t,e,n=!1)=>{if(typeof t=="object"&&t!==null&&(!Ri(t,e)||n)&&!Ov)throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")};function S6(t){Ov=!0;let e;try{e=t()}finally{Ov=!1}return e}const Cv={get size(){return Lr(Pt(this)).size},has(t){return Lr(Pt(this)).has(t)},set(t,e){const n=Pt(this),r=Lr(n);return(!r.has(t)||!$s(r.get(t),e))&&(fr(n),is(n),n.assignedMap.set(t,!0),n.copy.set(t,e),F_(n,t,e,kd)),this},delete(t){if(!this.has(t))return!1;const e=Pt(this);return fr(e),is(e),e.original.has(t)?e.assignedMap.set(t,!1):e.assignedMap.delete(t),e.copy.delete(t),!0},clear(){const t=Pt(this);if(this.size){fr(t),is(t),t.assignedMap=new Map;for(const[e]of t.original)t.assignedMap.set(e,!1);t.copy.clear()}},forEach(t,e){const n=Pt(this);Lr(n).forEach((r,i)=>{t.call(e,this.get(i),i,this)})},get(t){var e,n;const r=Pt(this),i=Lr(r).get(t),s=((n=(e=r.options).mark)===null||n===void 0?void 0:n.call(e,i,zr))===zr.mutable;if(r.options.strict&&Lp(i,r.options,s),s||r.finalized||!Ri(i,r.options)||i!==r.original.get(t))return i;const o=N_.createDraft({original:i,parentDraft:r,key:t,finalities:r.finalities,options:r.options});return fr(r),r.copy.set(t,o),o},keys(){return Lr(Pt(this)).keys()},values(){const t=this.keys();return{[Vh]:()=>this.values(),next:()=>{const e=t.next();return e.done?e:{done:!1,value:this.get(e.value)}}}},entries(){const t=this.keys();return{[Vh]:()=>this.entries(),next:()=>{const e=t.next();if(e.done)return e;const n=this.get(e.value);return{done:!1,value:[e.value,n]}}}},[Vh](){return this.entries()}},x6=Reflect.ownKeys(Cv),mS=(t,e,{isValuesIterator:n})=>()=>{var r,i;const s=e.next();if(s.done)return s;const o=s.value;let a=t.setMap.get(o);const c=Pt(a),u=((i=(r=t.options).mark)===null||i===void 0?void 0:i.call(r,a,zr))===zr.mutable;if(t.options.strict&&Lp(o,t.options,u),!u&&!c&&Ri(o,t.options)&&!t.finalized&&t.original.has(o)){const l=N_.createDraft({original:o,parentDraft:t,key:o,finalities:t.finalities,options:t.options});t.setMap.set(o,l),a=l}else c&&(a=c.proxy);return{done:!1,value:n?a:[a,a]}},Fp={get size(){return Pt(this).setMap.size},has(t){const e=Pt(this);if(e.setMap.has(t))return!0;fr(e);const n=Pt(t);return!!(n&&e.setMap.has(n.original))},add(t){const e=Pt(this);return this.has(t)||(fr(e),is(e),e.assignedMap.set(t,!0),e.setMap.set(t,t),F_(e,t,t,kd)),this},delete(t){if(!this.has(t))return!1;const e=Pt(this);fr(e),is(e);const n=Pt(t);return n&&e.setMap.has(n.original)?(e.assignedMap.set(n.original,!1),e.setMap.delete(n.original)):(!n&&e.setMap.has(t)?e.assignedMap.set(t,!1):e.assignedMap.delete(t),e.setMap.delete(t))},clear(){if(!this.size)return;const t=Pt(this);fr(t),is(t);for(const e of t.original)t.assignedMap.set(e,!1);t.setMap.clear()},values(){const t=Pt(this);fr(t);const e=t.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:mS(t,e,{isValuesIterator:!0})}},entries(){const t=Pt(this);fr(t);const e=t.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:mS(t,e,{isValuesIterator:!1})}},keys(){return this.values()},[Vh](){return this.values()},forEach(t,e){const n=this.values();let r=n.next();for(;!r.done;)t.call(e,r.value,r.value,this),r=n.next()}};Set.prototype.difference&&Object.assign(Fp,{intersection(t){return Set.prototype.intersection.call(new Set(this.values()),t)},union(t){return Set.prototype.union.call(new Set(this.values()),t)},difference(t){return Set.prototype.difference.call(new Set(this.values()),t)},symmetricDifference(t){return Set.prototype.symmetricDifference.call(new Set(this.values()),t)},isSubsetOf(t){return Set.prototype.isSubsetOf.call(new Set(this.values()),t)},isSupersetOf(t){return Set.prototype.isSupersetOf.call(new Set(this.values()),t)},isDisjointFrom(t){return Set.prototype.isDisjointFrom.call(new Set(this.values()),t)}});const T6=Reflect.ownKeys(Fp),qO=new WeakSet,GO={get(t,e,n){var r,i;const s=(r=t.copy)===null||r===void 0?void 0:r[e];if(s&&qO.has(s))return s;if(e===zO)return t;let o;if(t.options.mark){const u=e==="size"&&(t.original instanceof Map||t.original instanceof Set)?Reflect.get(t.original,e):Reflect.get(t.original,e,n);if(o=t.options.mark(u,zr),o===zr.mutable)return t.options.strict&&Lp(u,t.options,!0),u}const a=Lr(t);if(a instanceof Map&&x6.includes(e)){if(e==="size")return Object.getOwnPropertyDescriptor(Cv,"size").get.call(t.proxy);const u=Cv[e];if(u)return u.bind(t.proxy)}if(a instanceof Set&&T6.includes(e)){if(e==="size")return Object.getOwnPropertyDescriptor(Fp,"size").get.call(t.proxy);const u=Fp[e];if(u)return u.bind(t.proxy)}if(!Ul(a,e)){const u=hS(a,e);return u?"value"in u?u.value:(i=u.get)===null||i===void 0?void 0:i.call(t.proxy):void 0}const c=a[e];if(t.options.strict&&Lp(c,t.options),t.finalized||!Ri(c,t.options))return c;if(c===gy(t.original,e)){if(fr(t),t.copy[e]=$_({original:t.original[e],parentDraft:t,key:t.type===1?Number(e):e,finalities:t.finalities,options:t.options}),typeof o=="function"){const u=Pt(t.copy[e]);return fr(u),is(u),u.copy}return t.copy[e]}return c},set(t,e,n){var r;if(t.type===3||t.type===2)throw new Error("Map/Set draft does not support any property assignment.");let i;if(t.type===1&&e!=="length"&&!(Number.isInteger(i=Number(e))&&i>=0&&(e===0||i===0||String(i)===String(e))))throw new Error("Only supports setting array indices and the 'length' property.");const s=hS(Lr(t),e);if(s!=null&&s.set)return s.set.call(t.proxy,n),!0;const o=gy(Lr(t),e),a=Pt(o);return a&&$s(a.original,n)?(t.copy[e]=n,t.assignedMap=(r=t.assignedMap)!==null&&r!==void 0?r:new Map,t.assignedMap.set(e,!1),!0):($s(n,o)&&(n!==void 0||Ul(t.original,e))||(fr(t),is(t),Ul(t.original,e)&&$s(n,t.original[e])?t.assignedMap.delete(e):t.assignedMap.set(e,!0),t.copy[e]=n,F_(t,e,n,kd)),!0)},has(t,e){return e in Lr(t)},ownKeys(t){return Reflect.ownKeys(Lr(t))},getOwnPropertyDescriptor(t,e){const n=Lr(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},getPrototypeOf(t){return Reflect.getPrototypeOf(t.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(t,e){var n;return t.type===1?GO.set.call(this,t,e,void 0,t.proxy):(gy(t.original,e)!==void 0||e in t.original?(fr(t),is(t),t.assignedMap.set(e,!1)):(t.assignedMap=(n=t.assignedMap)!==null&&n!==void 0?n:new Map,t.assignedMap.delete(e)),t.copy&&delete t.copy[e],!0)}};function $_(t){const{original:e,parentDraft:n,key:r,finalities:i,options:s}=t,o=sc(e),a={type:o,finalized:!1,parent:n,original:e,copy:null,proxy:null,finalities:i,options:s,setMap:o===3?new Map(e.entries()):void 0};(r||"key"in t)&&(a.key=r);const{proxy:c,revoke:u}=Proxy.revocable(o===1?Object.assign([],a):a,GO);if(i.revoke.push(u),qO.add(c),a.proxy=c,n){const l=n;l.finalities.draft.push((d,f)=>{var h,m;const p=Pt(c);let g=l.type===3?l.setMap:l.copy;const y=Hs(g,r),v=Pt(y);if(v){let b=v.original;v.operated&&(b=M_(y)),Tv(v),Iv(v,kd,d,f),l.options.enableAutoFreeze&&(l.options.updatedValues=(h=l.options.updatedValues)!==null&&h!==void 0?h:new WeakMap,l.options.updatedValues.set(b,v.original)),vf(g,r,b)}(m=p.callbacks)===null||m===void 0||m.forEach(b=>{b(d,f)})})}else{const l=Pt(c);l.finalities.draft.push((d,f)=>{Tv(l),Iv(l,kd,d,f)})}return c}N_.createDraft=$_;function I6(t,e,n,r,i){var s;const o=Pt(t),a=(s=o==null?void 0:o.original)!==null&&s!==void 0?s:t,c=!!e.length;if(o!=null&&o.operated)for(;o.finalities.draft.length>0;)o.finalities.draft.pop()(n,r);const u=c?e[0]:o?o.operated?o.copy:o.original:t;return o&&xv(o),i&&Rc(u,u,o==null?void 0:o.options.updatedValues),[u,n&&c?[{op:In.Replace,path:[],value:e[0]}]:n,r&&c?[{op:In.Replace,path:[],value:a}]:r]}function O6(t,e){var n;const r={draft:[],revoke:[],handledSet:new WeakSet};let i,s;e.enablePatches&&(i=[],s=[]);const a=((n=e.mark)===null||n===void 0?void 0:n.call(e,t,zr))===zr.mutable||!Ri(t,e)?t:$_({original:t,parentDraft:null,finalities:r,options:e});return[a,(c=[])=>{const[u,l,d]=I6(a,c,i,s,e.enableAutoFreeze);return e.enablePatches?[u,l,d]:u}]}function kv(t){const{rootDraft:e,value:n,useRawReturn:r=!1,isRoot:i=!0}=t;L_(n,(s,o,a)=>{const c=Pt(o);if(c&&e&&c.finalities===e.finalities){t.isContainDraft=!0;const u=c.original;if(a instanceof Set){const l=Array.from(a);a.clear(),l.forEach(d=>a.add(s===d?u:d))}else vf(a,s,u)}else typeof o=="object"&&o!==null&&(t.value=o,t.isRoot=!1,kv(t))}),i&&(t.isContainDraft||console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."),r&&console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."))}function ZO(t){var e;const n=Pt(t);if(!Ri(t,n==null?void 0:n.options))return t;const r=sc(t);if(n&&!n.operated)return n.original;let i;function s(){i=r===2?P_(t)?new Map(t):new(Object.getPrototypeOf(t)).constructor(t):r===3?Array.from(n.setMap.values()):HO(t,n==null?void 0:n.options)}if(n){n.finalized=!0;try{s()}finally{n.finalized=!1}}else i=t;if(L_(i,(o,a)=>{if(n&&$s(Hs(n.original,o),a))return;const c=ZO(a);c!==a&&(i===t&&s(),vf(i,o,c))}),r===3){const o=(e=n==null?void 0:n.original)!==null&&e!==void 0?e:i;return A_(o)?new Set(i):new(Object.getPrototypeOf(o)).constructor(i)}return i}function gS(t){if(!ja(t))throw new Error(`current() is only used for Draft, parameter: ${t}`);return ZO(t)}const C6=t=>function e(n,r,i){var s,o,a;if(typeof n=="function"&&typeof r!="function")return function(w,...x){return e(w,_=>n.call(this,_,...x),r)};const c=n,u=r;let l=i;if(typeof r!="function"&&(l=r),l!==void 0&&Object.prototype.toString.call(l)!=="[object Object]")throw new Error(`Invalid options: ${l}, 'options' should be an object.`);l=Object.assign(Object.assign({},t),l);const d=ja(c)?gS(c):c,f=Array.isArray(l.mark)?(w,x)=>{for(const _ of l.mark){if(typeof _!="function")throw new Error(`Invalid mark: ${_}, 'mark' should be a function.`);const k=_(w,x);if(k)return k}}:l.mark,h=(s=l.enablePatches)!==null&&s!==void 0?s:!1,m=(o=l.strict)!==null&&o!==void 0?o:!1,g={enableAutoFreeze:(a=l.enableAutoFreeze)!==null&&a!==void 0?a:!1,mark:f,strict:m,enablePatches:h};if(!Ri(d,g)&&typeof d=="object"&&d!==null)throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");const[y,v]=O6(d,g);if(typeof r!="function"){if(!Ri(d,g))throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");return[y,v]}let b;try{b=u(y)}catch(w){throw xv(Pt(y)),w}const E=w=>{const x=Pt(y);if(!ja(w)){if(w!==void 0&&!$s(w,y)&&(x!=null&&x.operated))throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");const k=w==null?void 0:w[m6];if(k){const R=k[0];return g.strict&&typeof w=="object"&&w!==null&&kv({rootDraft:x,value:w,useRawReturn:!0}),v([R])}if(w!==void 0)return typeof w=="object"&&w!==null&&kv({rootDraft:x,value:w}),v([w])}if(w===y||w===void 0)return v([]);const _=Pt(w);if(g===_.options){if(_.operated)throw new Error("Cannot return a modified child draft.");return v([gS(w)])}return v([w])};return b instanceof Promise?b.then(E,w=>{throw xv(Pt(y)),w}):E(b)},j_=C6();Object.prototype.constructor.toString();var k6=Object.defineProperty,D6=(t,e,n)=>e in t?k6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,YO=(t,e,n)=>D6(t,typeof e!="symbol"?e+"":e,n);const R6=t=>t!=null;Xt.any().refine(t=>R6(t));const N6=Xt.enum(["LOAD_STATE"]),A6=Xt.enum(["PRUNE"]),P6=Xt.enum(["REDO"]),M6=Xt.enum(["SET_NAME"]),L6=Xt.enum(["UNDO"]);function Xm(){return Xt.literal("global").or(Xt.literal("local"))}function F6(){return Xt.union([$6(),U6(),B6(),z6(),V6()])}function $6(){return Xt.object({input:Xt.lazy(()=>KO()),type:N6,scope:Xm()})}function KO(){return Xt.object({operations:Xt.number(),state:Xt.lazy(()=>j6())})}function j6(){return Xt.object({data:Xt.unknown().nullish(),name:Xt.string()})}function U6(){return Xt.object({input:Xt.lazy(()=>JO()),type:A6,scope:Xm()})}function JO(){return Xt.object({end:Xt.number().nullish(),start:Xt.number().nullish()})}const XO=Xt.number;function B6(){return Xt.object({input:XO(),type:P6,scope:Xm()})}const QO=Xt.string;function z6(){return Xt.object({input:QO(),type:M6,scope:Xt.literal("global")})}const eC=Xt.number;function V6(){return Xt.object({input:eC(),type:L6,scope:Xm()})}function H6(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ch={exports:{}},yS;function W6(){return yS||(yS=1,function(t,e){const{hasOwnProperty:n}=Object.prototype,r=y();r.configure=y,r.stringify=r,r.default=r,e.stringify=r,e.configure=y,t.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(v){return v.length<5e3&&!i.test(v)?`"${v}"`:JSON.stringify(v)}function o(v,b){if(v.length>200||b)return v.sort(b);for(let E=1;E<v.length;E++){const w=v[E];let x=E;for(;x!==0&&v[x-1]>w;)v[x]=v[x-1],x--;v[x]=w}return v}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(v){return a.call(v)!==void 0&&v.length!==0}function u(v,b,E){v.length<E&&(E=v.length);const w=b===","?"":" ";let x=`"0":${w}${v[0]}`;for(let _=1;_<E;_++)x+=`${b}"${_}":${w}${v[_]}`;return x}function l(v){if(n.call(v,"circularValue")){const b=v.circularValue;if(typeof b=="string")return`"${b}"`;if(b==null)return b;if(b===Error||b===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(v){let b;if(n.call(v,"deterministic")&&(b=v.deterministic,typeof b!="boolean"&&typeof b!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return b===void 0?!0:b}function f(v,b){let E;if(n.call(v,b)&&(E=v[b],typeof E!="boolean"))throw new TypeError(`The "${b}" argument must be of type boolean`);return E===void 0?!0:E}function h(v,b){let E;if(n.call(v,b)){if(E=v[b],typeof E!="number")throw new TypeError(`The "${b}" argument must be of type number`);if(!Number.isInteger(E))throw new TypeError(`The "${b}" argument must be an integer`);if(E<1)throw new RangeError(`The "${b}" argument must be >= 1`)}return E===void 0?1/0:E}function m(v){return v===1?"1 item":`${v} items`}function p(v){const b=new Set;for(const E of v)(typeof E=="string"||typeof E=="number")&&b.add(String(E));return b}function g(v){if(n.call(v,"strict")){const b=v.strict;if(typeof b!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(b)return E=>{let w=`Object can not safely be stringified. Received type ${typeof E}`;throw typeof E!="function"&&(w+=` (${E.toString()})`),new Error(w)}}}function y(v){v={...v};const b=g(v);b&&(v.bigint===void 0&&(v.bigint=!1),"circularValue"in v||(v.circularValue=Error));const E=l(v),w=f(v,"bigint"),x=d(v),_=typeof x=="function"?x:void 0,k=h(v,"maximumDepth"),R=h(v,"maximumBreadth");function F(C,N,U,K,$,q){let j=N[C];switch(typeof j=="object"&&j!==null&&typeof j.toJSON=="function"&&(j=j.toJSON(C)),j=K.call(N,C,j),typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(U.indexOf(j)!==-1)return E;let D="",X=",";const Z=q;if(Array.isArray(j)){if(j.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(j),$!==""&&(q+=$,D+=`
|
|
75
|
-
${q}`,X=`,
|
|
76
|
-
${q}`);const ct=Math.min(j.length,R);let ut=0;for(;ut<ct-1;ut++){const Ot=F(String(ut),j,U,K,$,q);D+=Ot!==void 0?Ot:"null",D+=X}const Ye=F(String(ut),j,U,K,$,q);if(D+=Ye!==void 0?Ye:"null",j.length-1>R){const Ot=j.length-R-1;D+=`${X}"... ${m(Ot)} not stringified"`}return $!==""&&(D+=`
|
|
77
|
-
${Z}`),U.pop(),`[${D}]`}let z=Object.keys(j);const le=z.length;if(le===0)return"{}";if(k<U.length+1)return'"[Object]"';let pe="",ve="";$!==""&&(q+=$,X=`,
|
|
78
|
-
${q}`,pe=" ");const je=Math.min(le,R);x&&!c(j)&&(z=o(z,_)),U.push(j);for(let ct=0;ct<je;ct++){const ut=z[ct],Ye=F(ut,j,U,K,$,q);Ye!==void 0&&(D+=`${ve}${s(ut)}:${pe}${Ye}`,ve=X)}if(le>R){const ct=le-R;D+=`${ve}"...":${pe}"${m(ct)} not stringified"`,ve=X}return $!==""&&ve.length>1&&(D=`
|
|
79
|
-
${q}${D}
|
|
80
|
-
${Z}`),U.pop(),`{${D}}`}case"number":return isFinite(j)?String(j):b?b(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(j);default:return b?b(j):void 0}}function V(C,N,U,K,$,q){switch(typeof N=="object"&&N!==null&&typeof N.toJSON=="function"&&(N=N.toJSON(C)),typeof N){case"string":return s(N);case"object":{if(N===null)return"null";if(U.indexOf(N)!==-1)return E;const j=q;let D="",X=",";if(Array.isArray(N)){if(N.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(N),$!==""&&(q+=$,D+=`
|
|
81
|
-
${q}`,X=`,
|
|
82
|
-
${q}`);const le=Math.min(N.length,R);let pe=0;for(;pe<le-1;pe++){const je=V(String(pe),N[pe],U,K,$,q);D+=je!==void 0?je:"null",D+=X}const ve=V(String(pe),N[pe],U,K,$,q);if(D+=ve!==void 0?ve:"null",N.length-1>R){const je=N.length-R-1;D+=`${X}"... ${m(je)} not stringified"`}return $!==""&&(D+=`
|
|
83
|
-
${j}`),U.pop(),`[${D}]`}U.push(N);let Z="";$!==""&&(q+=$,X=`,
|
|
84
|
-
${q}`,Z=" ");let z="";for(const le of K){const pe=V(le,N[le],U,K,$,q);pe!==void 0&&(D+=`${z}${s(le)}:${Z}${pe}`,z=X)}return $!==""&&z.length>1&&(D=`
|
|
85
|
-
${q}${D}
|
|
86
|
-
${j}`),U.pop(),`{${D}}`}case"number":return isFinite(N)?String(N):b?b(N):"null";case"boolean":return N===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(N);default:return b?b(N):void 0}}function T(C,N,U,K,$){switch(typeof N){case"string":return s(N);case"object":{if(N===null)return"null";if(typeof N.toJSON=="function"){if(N=N.toJSON(C),typeof N!="object")return T(C,N,U,K,$);if(N===null)return"null"}if(U.indexOf(N)!==-1)return E;const q=$;if(Array.isArray(N)){if(N.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(N),$+=K;let pe=`
|
|
87
|
-
${$}`;const ve=`,
|
|
88
|
-
${$}`,je=Math.min(N.length,R);let ct=0;for(;ct<je-1;ct++){const Ye=T(String(ct),N[ct],U,K,$);pe+=Ye!==void 0?Ye:"null",pe+=ve}const ut=T(String(ct),N[ct],U,K,$);if(pe+=ut!==void 0?ut:"null",N.length-1>R){const Ye=N.length-R-1;pe+=`${ve}"... ${m(Ye)} not stringified"`}return pe+=`
|
|
89
|
-
${q}`,U.pop(),`[${pe}]`}let j=Object.keys(N);const D=j.length;if(D===0)return"{}";if(k<U.length+1)return'"[Object]"';$+=K;const X=`,
|
|
90
|
-
${$}`;let Z="",z="",le=Math.min(D,R);c(N)&&(Z+=u(N,X,R),j=j.slice(N.length),le-=N.length,z=X),x&&(j=o(j,_)),U.push(N);for(let pe=0;pe<le;pe++){const ve=j[pe],je=T(ve,N[ve],U,K,$);je!==void 0&&(Z+=`${z}${s(ve)}: ${je}`,z=X)}if(D>R){const pe=D-R;Z+=`${z}"...": "${m(pe)} not stringified"`,z=X}return z!==""&&(Z=`
|
|
91
|
-
${$}${Z}
|
|
92
|
-
${q}`),U.pop(),`{${Z}}`}case"number":return isFinite(N)?String(N):b?b(N):"null";case"boolean":return N===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(N);default:return b?b(N):void 0}}function L(C,N,U){switch(typeof N){case"string":return s(N);case"object":{if(N===null)return"null";if(typeof N.toJSON=="function"){if(N=N.toJSON(C),typeof N!="object")return L(C,N,U);if(N===null)return"null"}if(U.indexOf(N)!==-1)return E;let K="";const $=N.length!==void 0;if($&&Array.isArray(N)){if(N.length===0)return"[]";if(k<U.length+1)return'"[Array]"';U.push(N);const Z=Math.min(N.length,R);let z=0;for(;z<Z-1;z++){const pe=L(String(z),N[z],U);K+=pe!==void 0?pe:"null",K+=","}const le=L(String(z),N[z],U);if(K+=le!==void 0?le:"null",N.length-1>R){const pe=N.length-R-1;K+=`,"... ${m(pe)} not stringified"`}return U.pop(),`[${K}]`}let q=Object.keys(N);const j=q.length;if(j===0)return"{}";if(k<U.length+1)return'"[Object]"';let D="",X=Math.min(j,R);$&&c(N)&&(K+=u(N,",",R),q=q.slice(N.length),X-=N.length,D=","),x&&(q=o(q,_)),U.push(N);for(let Z=0;Z<X;Z++){const z=q[Z],le=L(z,N[z],U);le!==void 0&&(K+=`${D}${s(z)}:${le}`,D=",")}if(j>R){const Z=j-R;K+=`${D}"...":"${m(Z)} not stringified"`}return U.pop(),`{${K}}`}case"number":return isFinite(N)?String(N):b?b(N):"null";case"boolean":return N===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(N);default:return b?b(N):void 0}}function S(C,N,U){if(arguments.length>1){let K="";if(typeof U=="number"?K=" ".repeat(Math.min(U,10)):typeof U=="string"&&(K=U.slice(0,10)),N!=null){if(typeof N=="function")return F("",{"":C},[],N,K,"");if(Array.isArray(N))return V("",C,[],p(N),K,"")}if(K.length!==0)return T("",C,[],K,"")}return L("",C,[])}return S}}(ch,ch.exports)),ch.exports}var q6=W6();const Ua=H6(q6);Ua.configure;const G6=[1518500249,1859775393,-1894007588,-899497514];function Z6(t){return new Y6}class Y6{constructor(){this.A=1732584193,this.B=-271733879,this.C=-1732584194,this.D=271733878,this.E=-1009589776,this._size=0,this._sp=0,(!uh||fl>=8e3)&&(uh=new ArrayBuffer(8e3),fl=0),this._byte=new Uint8Array(uh,fl,80),this._word=new Int32Array(uh,fl,20),fl+=80}update(e){if(typeof e=="string")return this._utf8(e);if(e==null)throw new TypeError("Invalid type: "+typeof e);const n=e.byteOffset,r=e.byteLength;let i=r/64|0,s=0;if(i&&!(n&3)&&!(this._size%64)){const a=new Int32Array(e.buffer,n,i*16);for(;i--;)this._int32(a,s>>2),s+=64;this._size+=s}if(e.BYTES_PER_ELEMENT!==1&&e.buffer){const a=new Uint8Array(e.buffer,n+s,r-s);return this._uint8(a)}return s===r?this:this._uint8(e,s)}_uint8(e,n){const{_byte:r,_word:i}=this,s=e.length;for(n=n|0;n<s;){const o=this._size%64;let a=o;for(;n<s&&a<64;)r[a++]=e[n++];a>=64&&this._int32(i),this._size+=a-o}return this}_utf8(e){const{_byte:n,_word:r}=this,i=e.length;let s=this._sp;for(let o=0;o<i;){const a=this._size%64;let c=a;for(;o<i&&c<64;){let u=e.charCodeAt(o++)|0;u<128?n[c++]=u:u<2048?(n[c++]=192|u>>>6,n[c++]=128|u&63):u<55296||u>57343?(n[c++]=224|u>>>12,n[c++]=128|u>>>6&63,n[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,n[c++]=240|u>>>18,n[c++]=128|u>>>12&63,n[c++]=128|u>>>6&63,n[c++]=128|u&63,s=0):s=u}c>=64&&(this._int32(r),r[0]=r[16]),this._size+=c-a}return this._sp=s,this}_int32(e,n){let{A:r,B:i,C:s,D:o,E:a}=this,c=0;for(n=n|0;c<16;)ra[c++]=ao(e[n++]);for(c=16;c<80;c++)ra[c]=X6(ra[c-3]^ra[c-8]^ra[c-14]^ra[c-16]);for(c=0;c<80;c++){const u=c/20|0,l=Q6(r)+t8(u,i,s,o)+a+ra[c]+G6[u]|0;a=o,o=s,s=e8(i),i=r,r=l}this.A=r+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=o+this.D|0,this.E=a+this.E|0}digest(e){const{_byte:n,_word:r}=this;let i=this._size%64|0;for(n[i++]=128;i&3;)n[i++]=0;if(i>>=2,i>14){for(;i<16;)r[i++]=0;i=0,this._int32(r)}for(;i<16;)r[i++]=0;const s=this._size*8,o=(s&4294967295)>>>0,a=(s-o)/4294967296;return a&&(r[14]=ao(a)),o&&(r[15]=ao(o)),this._int32(r),e==="hex"?this._hex():this._bin()}_hex(){const{A:e,B:n,C:r,D:i,E:s}=this;return hl(e)+hl(n)+hl(r)+hl(i)+hl(s)}_bin(){const{A:e,B:n,C:r,D:i,E:s,_byte:o,_word:a}=this;return a[0]=ao(e),a[1]=ao(n),a[2]=ao(r),a[3]=ao(i),a[4]=ao(s),o.slice(0,20)}}const ra=new Int32Array(80);let uh,fl=0;const hl=t=>(t+4294967296).toString(16).substr(-8),K6=t=>t<<24&4278190080|t<<8&16711680|t>>8&65280|t>>24&255,J6=t=>t,ao=n8()?J6:K6,X6=t=>t<<1|t>>>31,Q6=t=>t<<5|t>>>27,e8=t=>t<<30|t>>>2;function t8(t,e,n,r){return t===0?e&n|~e&r:t===2?e&n|e&r|n&r:e^n^r}function n8(){return new Uint8Array(new Uint16Array([65279]).buffer)[0]===254}const U_=new Error("File system not available.");function r8(){if(!crypto.randomUUID)throw new Error("generateUUID is not available in unsecure contexts.");return crypto.randomUUID()}function i8(t,e,n){throw U_}function tC(t){throw U_}function s8(t){throw U_}const o8=async t=>tC(),bf=(t,e="sha1")=>{if(!["sha1"].includes(e))throw new Error("Hashing algorithm not supported: Available: sha1");const n=c8(t);return a8(n)};function a8(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function c8(t,e="sha1"){if(!["sha1"].includes(e))throw new Error("Hashing algorithm not supported: Available: sha1");return Z6().update(t).digest()}function B_(t){if(t&&t.toString()!=="UUIDv4")throw new Error(`Id generation method not supported: "${t.toString()}"`);return r8()}function nC(t){return(new Date(t).getTime()/1e3).toFixed(0)}function rC({documentId:t,signer:e,operation:n,previousStateHash:r}){const{timestamp:i,scope:s,id:o,type:a}=n;return[nC(i),e.app.key,bf([t,s,o,a,Ua(n.input)].join("")),r]}const u8=new TextEncoder;function z_(t){const e=t.join(""),n=`Signed Operation:
|
|
93
|
-
`+e.length.toString();return u8.encode(n+e)}function iC(t){const e=ArrayBuffer.isView(t)?t:new Uint8Array(t);return Array.prototype.map.call(e,n=>("00"+n.toString(16)).slice(-2)).join("")}function sC(t){var e;return new Uint8Array(((e=t.match(/[\da-f]{2}/gi))==null?void 0:e.map(function(n){return parseInt(n,16)}))??[])}async function oC(t,e){const n=rC(t),r=z_(n),i=await e(r);return[...n,`0x${iC(i)}`]}async function l8(t,e,n,r,i){var s,o;const a=e(n,t,void 0,{reuseHash:!0,reuseOperationResultingState:!0}),c=a.operations[t.scope].at(-1);if(!c)throw new Error("Action was not applied");const u=((s=a.operations[t.scope].at(-2))==null?void 0:s.hash)??"",l=await oC({...r,operation:c,previousStateHash:u},i);return{...c,context:{...c.context,signer:{...(o=c.context)==null?void 0:o.signer,...r.signer,signatures:[...r.signer.signatures??[],l]}}}}async function d8(t,e,n){const r=e.app.key,i=t.slice(0,4),s=sC(t[4]),o=z_(i);return n(r,s,o)}class V_ extends Error{constructor(e){super(),YO(this,"data"),this.name="InvalidActionInputError",this.data=e,this.message=this.message||`Invalid action input: ${JSON.stringify(e,null,2)}`}}class aC extends V_{constructor(e){super(e),YO(this,"issues"),this.issues=e,this.name="InvalidActionInputZodError"}}const cC={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(cC);var Xr=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Nc,Tl,oa;class f8{constructor(...e){Nc.set(this,new Map),Tl.set(this,new Map),oa.set(this,new Map);for(const n of e)this.define(n)}define(e,n=!1){for(let[r,i]of Object.entries(e)){r=r.toLowerCase(),i=i.map(a=>a.toLowerCase()),Xr(this,oa,"f").has(r)||Xr(this,oa,"f").set(r,new Set);const s=Xr(this,oa,"f").get(r);let o=!0;for(let a of i){const c=a.startsWith("*");if(a=c?a.slice(1):a,s==null||s.add(a),o&&Xr(this,Tl,"f").set(r,a),o=!1,c)continue;const u=Xr(this,Nc,"f").get(a);if(u&&u!=r&&!n)throw new Error(`"${r} -> ${a}" conflicts with "${u} -> ${a}". Pass \`force=true\` to override this definition.`);Xr(this,Nc,"f").set(a,r)}}return this}getType(e){if(typeof e!="string")return null;const n=e.replace(/^.*[/\\]/,"").toLowerCase(),r=n.replace(/^.*\./,"").toLowerCase(),i=n.length<e.length;return!(r.length<n.length-1)&&i?null:Xr(this,Nc,"f").get(r)??null}getExtension(e){var n;return typeof e!="string"?null:(e=(n=e==null?void 0:e.split)==null?void 0:n.call(e,";")[0],(e&&Xr(this,Tl,"f").get(e.trim().toLowerCase()))??null)}getAllExtensions(e){return typeof e!="string"?null:Xr(this,oa,"f").get(e.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of Xr(this,oa,"f").values())Object.freeze(e);return this}_getTestState(){return{types:Xr(this,Nc,"f"),extensions:Xr(this,Tl,"f")}}}Nc=new WeakMap,Tl=new WeakMap,oa=new WeakMap;const h8=new f8(cC)._freeze();function uC(t){const e=[],n=Object.keys(t);for(const r of n){const i=t[r].sort((o,a)=>o.index-a.index);let s=-1;for(let o=0;o<i.length;o++)s=s+1+i[o].skip,i[o].index!==s&&e.push({message:`Invalid operation index ${i[o].index} at position ${o}`,details:{position:o,operation:i[o],scope:i[o].scope}})}return e}var lC=(t=>(t.UNEXPECTED_INDEX="UNEXPECTED_INDEX",t))(lC||{}),dC=(t=>(t.DUPLICATED_INDEX="DUPLICATED_INDEX",t.MISSING_INDEX="MISSING_INDEX",t))(dC||{});function H_(t){const e=[];let n=-1;for(const r of t){const i=r.index-r.skip;i!==n+1&&e.push({operation:{index:r.index,skip:r.skip},issue:"UNEXPECTED_INDEX",category:i>n+1?"MISSING_INDEX":"DUPLICATED_INDEX",message:`Expected index ${n+1} with skip 0 or equivalent, got index ${r.index} with skip ${r.skip}`}),n=r.index}return e}function xi(t){var e,n,r;const i=[];let s=t.length-1;for(;s>-1;){i.unshift(t[s]);const o=(((e=t[s])==null?void 0:e.index)||0)-(((n=t[s])==null?void 0:n.skip)||0)-1;let a=s-1;for(;a>-1&&(((r=t[a])==null?void 0:r.index)||0)>o;)a--;s=a}return i}function p8(t){const e=[...t],n=e[e.length-1];return n&&(n.type==="NOOP"?e.push({...n,index:n.index,type:"NOOP",skip:q_(t)}):e.push({type:"NOOP",index:n.index+1,timestamp:new Date().toISOString(),input:{},skip:1,scope:n.scope,hash:n.hash})),e}function ii(t){return t.slice().sort((e,n)=>e.skip-n.skip).sort((e,n)=>e.index-n.index)}const m8=(t,e,n)=>[...e,...n].sort((r,i)=>new Date(r.timestamp).getTime()-new Date(i.timestamp).getTime()).map((r,i)=>({...r,index:t.index+i,skip:i===0?t.skip:0})),g8=(t,e,n)=>[...e,...n].sort((r,i)=>new Date(r.timestamp).getTime()-new Date(i.timestamp).getTime()).sort((r,i)=>r.index-i.index).map((r,i)=>({...r,index:t.index+i,skip:i===0?t.skip:0}));function W_(t,e){return Ua(t)===Ua(e)}function y8(t,e){const n=xi(ii(t.slice())),r=xi(ii(e.slice()));if(n.length<1)return[r,[]];const i=[];let s=!1;for(;r.length>0;){const o=r[0];let a=n.shift();for(;a&&fC(a,o);)i.push(a),a=n.shift();if(a?s||(W_(a,o)?(r.shift(),i.push(a)):(n.unshift(a),s=!0)):s=!0,s){let c=r.shift();for(;c;)i.push(c),c=r.shift()}}if(!s){let o=n.shift();for(;o;)i.push(o),o=n.shift()}return[xi(i),n]}function fC(t,e){return t.index<e.index||t.index===e.index&&t.id===e.id&&t.skip<e.skip}function hC(t,e){const n=[],r=[],i=[],s=Math.max(t.length,e.length);let o=!1;for(let a=0;a<s;a++){const c=t[a],u=e[a];c&&u?!o&&W_(c,u)?n.push(c):(o=!0,r.push(c),i.push(u)):c?r.push(c):u&&i.push(u)}return[n,r,i]}function v8(t,e,n){const[r,i,s]=hC(xi(t),xi(e)),o=yy(r),a=1+Math.max(o,yy(i),yy(s)),c=mC(s,i),u=n({index:a,skip:a-(o+1)},i,c);return r.concat(u)}function yy(t){const e=t[t.length-1];return e?e.index:-1}function q_(t){var e,n,r;if(t.length<1)return-1;const i=xi(t);let s=(((e=i[i.length-1])==null?void 0:e.skip)||0)+1;return i.length>1&&(s+=((n=i[i.length-2])==null?void 0:n.skip)||0),(((r=i[i.length-1])==null?void 0:r.index)||-1)<s?-1:s}const b8=t=>H_(xi(ii(t))),_8=t=>t.reduce((n,r)=>{var i;return n[r.scope]||(n[r.scope]=[]),(i=n[r.scope])==null||i.push(r),n},{}),w8=(t,e)=>{var n;const r={integrityIssues:[],validOperations:[],invalidOperations:[],duplicatedOperations:[]},i=ii(t),s=ii(e),o=H_([...i,...s]),c=(n=[...o.filter(u=>u.category==="MISSING_INDEX")].sort((u,l)=>l.operation.index-u.operation.index).pop())==null?void 0:n.operation;for(const u of s){if(c&&u.index>=c.index){r.invalidOperations.push(u);continue}if(o.some(d=>d.operation.index===u.index&&d.operation.skip===u.skip&&d.category==="DUPLICATED_INDEX")){r.duplicatedOperations.push(u);continue}r.validOperations.push(u)}return r.integrityIssues.push(...o),r};function E8(t,e){return t.filter(n=>!e.some(r=>n.type==="NOOP"&&n.skip===0&&n.index===r.index||n.index===r.index&&n.skip===r.skip&&n.scope===r.scope&&n.hash===r.hash&&n.type===r.type))}function pC(t,e){const[n]=ii(t).slice(-1),r=(n==null?void 0:n.index)??-1,i=r+1,s={...e,index:e.index??i};if(s.index<r)throw new Error(`The skip header operation index must be greater than or equal to ${r}`);return(xi(ii([...t,s]))||[]).slice(0,-1)}function Dd(t){return{...Object.entries(t).reduce((n,r)=>{const[i,s]=r;return{...n,[i]:xi(ii(s))}},{})}}function mC(t,e){return t.filter(n=>n.id?!e.some(r=>r.id===n.id):!0)}function gC(t){return t?Object.entries(t).reduce((n,[r,i])=>({...n,[r]:i.map(s=>{const{resultingState:o,...a}=s;return a})}),{}):{}}function yC(t,e){return t.filter(n=>!e.some(r=>n.index===r.index))}const S8=Object.freeze(Object.defineProperty({__proto__:null,IntegrityIssueSubType:dC,IntegrityIssueType:lC,addUndo:p8,attachBranch:y8,checkCleanedOperationsIntegrity:H_,checkOperationsIntegrity:b8,diffOperations:yC,filterDocumentOperationsResultingState:gC,filterDuplicatedOperations:mC,garbageCollect:xi,garbageCollectDocumentOperations:Dd,groupOperationsByScope:_8,merge:v8,nextSkipNumber:q_,operationsAreEqual:W_,precedes:fC,prepareOperations:w8,removeExistingOperations:E8,reshuffleByTimestamp:m8,reshuffleByTimestampAndIndex:g8,skipHeaderOperations:pC,sortOperations:ii,split:hC},Symbol.toStringTag,{value:"Module"})),G_=async t=>{const e=new BO,{name:n,revision:r,documentType:i,created:s,lastModified:o}=t,a={name:n,revision:r,documentType:i,created:s,lastModified:o};return e.file("header.json",JSON.stringify(a,null,2)),e.file("state.json",JSON.stringify(t.initialState||{},null,2)),e.file("current-state.json",JSON.stringify(t.state||{},null,2)),e.file("operations.json",JSON.stringify(gC(t.operations),null,2)),t.attachments&&Object.keys(t.attachments).forEach(u=>{const{data:l,...d}=t.attachments[u];e.file(u,l,{base64:!0,createFolders:!0,comment:JSON.stringify(d)})}),e},vC=async(t,e,n,r)=>{await(await G_(t)).generateAsync({type:"uint8array",streamFiles:!0});const s=r??t.name,o=`.${n}.zip`;return i8(e,s.endsWith(o)?s:`${s}${o}`)},x8=async(t,e)=>{const r=await(await G_(t)).generateAsync({type:"blob"}),i=await e.createWritable();await i.write(r),await i.close()},Dv=async(t,e,n)=>{const r=tC();return bC(r,e,n)},bC=async(t,e,n)=>{const r=new BO;return await r.loadAsync(t),T8(r,e,n)};async function T8(t,e,n){const r=t.file("state.json");if(!r)throw new Error("Initial state not found");const i=await r.async("string"),s=JSON.parse(i),o=t.file("header.json");let a;o&&(a=JSON.parse(await o.async("string")));const c=t.file("operations.json");if(!c)throw new Error("Operations history not found");const u=JSON.parse(await c.async("string")),l=Dd(u),d=uC(l);if(d.length){const h=d.map(m=>m.message);throw new Error(h.join(`
|
|
94
|
-
`))}let f=Z_(s,l,e,void 0,a,{},n);return a&&(f={...f,...a}),f}function _C(t){const e=t.replace(/^.*\./,"")||void 0,n=t.replace(/^.*[/\\]/,"")||void 0;return{extension:e,fileName:n}}async function I8(t){const{buffer:e,mimeType:n="application/octet-stream"}=await s8(),r=_C(t),i=e.toString("base64");return{data:i,hash:bf(i),mimeType:n,...r}}async function O8(t){const e=await o8(),n=h8.getType(t)||"application/octet-stream",r=_C(t),i=e.toString("base64");return{data:i,hash:bf(i),mimeType:n,...r}}function C8(t,e){return{...t,name:e}}function k8(t,e,n){const{scope:r,input:i}=e;return j_({document:t,action:e,skip:n,reuseLastOperationIndex:!1},o=>{const a=[...t.operations[r]],c=ii(a);o.action=jC(r);const u=c.at(-1);let l=(u==null?void 0:u.index)??-1;const d=(u==null?void 0:u.type)!=="NOOP";d?l=l+1:o.reuseLastOperationIndex=!0;const f=d?[...c,{index:l,skip:0}]:c;if(o.skip=q_(f),u&&o.skip>u.skip+1&&(o.skip=o.skip+1),o.skip<0)throw new Error("Cannot undo: you can't undo more operations than the ones in the scope history")})}function D8(t,e,n){const{scope:r,input:i}=e;return j_({document:t,action:e,skip:n,reuseLastOperationIndex:!1},o=>{if(o.skip>0)throw new Error("Cannot redo: skip value from reducer cannot be used with REDO action");if(i>1)throw new Error("Cannot redo: you can only redo one operation at a time");if(i<1)throw new Error("Invalid REDO action: invalid redo input value");if(o.document.clipboard.length<1)throw new Error("Cannot redo: no operations in the clipboard");const a=o.document.clipboard.findLastIndex(u=>u.scope===r);if(a<0)throw new Error(`Cannot redo: no operations in clipboard for scope "${r}"`);const c=o.document.clipboard.splice(a,1)[0];o.action={type:c.type,scope:c.scope,input:c.input}})}function R8(t,e,n){const{scope:r}=e,i=t.operations[r];let{input:{start:s,end:o}}=e;s=s||0,o=o||i.length;const a=i.slice(s,o),c=i.slice(0,s),u=i.slice(o),l=Nd(t.initialState,{...t.operations,[r]:c.concat(a)},n),{name:d,state:f}=l,h=c.length,m=c.length?c[c.length-1].timestamp:u.length?u[0].timestamp:new Date().toISOString();return Nd(t.initialState,{...t.operations,[r]:[...c,{...Y_({name:d,state:f},a.length),timestamp:m,index:h,hash:wf({state:f},"global")},...u.map((p,g)=>({...p,index:h+g+1}))]},n)}function N8(t,e){return{...t,name:e.name,state:e.state??{global:{},local:{}}}}const wC="SET_NAME",oc="UNDO",Hu="REDO",_f="PRUNE",EC="LOAD_STATE",A8="NOOP";function P8(t,e){let n;return"index"in e?n={...e}:n=t.operations[e.scope].at(-1),((n==null?void 0:n.index)??-1)+1}function SC(t,e){return{...t,revision:{...t.revision,[e.scope]:P8(t,e)},lastModified:PC(t)}}function M8(t,e,n=0,r=!1){if([oc,Hu,_f].includes(e.type))return t;const{scope:i}=e,s=t.operations[i].slice();let o;const a=s.at(-1),c=(a==null?void 0:a.index)??-1;let u=r?c:c+1,l=new Date().toISOString();if("index"in e){if(e.index-n>u)throw new Error(`Missing operations: expected ${u} with skip 0 or equivalent, got index ${e.index} with skip ${n}`);u=e.index,o=e.id,l=e.timestamp}else o="id"in e?e.id:B_();return s.push({...e,id:o,index:u,timestamp:l,hash:"",scope:i,skip:n,error:void 0}),{...t,operations:{...t.operations,[i]:s}}}function xC(t,e,n=0,r=!1){let i=M8(t,e,n,r);return i=SC(i,e),i}function TC(t,e,n){switch(F6().parse(e),e.type){case wC:return C8(t,e.input);case _f:return R8(t,e,n);case EC:return N8(t,e.input.state);default:return t}}function L8(t,e,n){switch(e.type){case oc:return k8(t,e,n);case Hu:return D8(t,e,n);default:return{document:t,action:e,skip:n,reuseLastOperationIndex:!1}}}function IC(t,e,n,r,i=!1,s=Qm){const o=e.scope,a=t.operations[o].at(-1);if(!a)return t;const c=Dd({...t.operations,[o]:pC(t.operations[o],a)});let u;const l=c[o].at(-1);if(i&&(l!=null&&l.resultingState))u=s(l.resultingState);else{const{state:d}=Nd(t.initialState,c,n,void 0,void 0,void 0,void 0,{reuseHash:!0,reuseOperationResultingState:i,operationResultingStateParser:s});u=d[o]}return{...t,state:{...t.state,[o]:u},operations:Dd({...t.operations})}}function F8(t,e,n,r=!1,i=Qm){const s=[...t.operations[e]],o=ii(s);o.pop();const a=Dd({...t.operations}),c=[...a[e]],u=yC(xi(o),c),l=Nd(t.initialState,a,n,void 0,void 0,void 0,void 0,{reuseHash:!0,reuseOperationResultingState:r,operationResultingStateParser:i}),d=ii([...t.clipboard,...u].filter(f=>f.type!=="NOOP")).reverse();return{...l,clipboard:d}}function OC(t,e,n,r,i={}){const{skip:s,ignoreSkipOperations:o=!1,reuseHash:a=!1,reuseOperationResultingState:c=!1,operationResultingStateParser:u}=i;let l={...e},d=s||0,f={...t},h=!1;const m=!o&&(d>0||"index"in l&&l.skip>0);if(CC(l)){const{skip:b,action:E,document:w,reuseLastOperationIndex:x}=L8(t,l,d);l=E,d=b,f=w,h=x}else f={...f,clipboard:[]};if(Rd(l)&&(f=TC(f,l,n)),f=xC(f,l,d,h),kC(e))return F8(f,e.scope,n);if(m&&(f=IC(f,l,n,d,c,u)),f=j_(f,b=>{try{const E=n(b.state,l,r);E&&S6(()=>{b.state=E})}catch(E){const w=f.operations[l.scope].length-1;b.operations[l.scope][w].error=E.message,b.operations[l.scope][w].skip=0,m&&(b.state={...t.state},b.operations={...t.operations,[l.scope]:[...t.operations[l.scope],{...b.operations[l.scope][w]}]})}}),[oc,Hu,_f].includes(l.type))return f;const g=l.scope||"global",y=a&&Object.prototype.hasOwnProperty.call(l,"hash")?l.hash:wf(f,g),v=f.operations[g].at(-1);return v&&(v.hash=y,c&&(v.resultingState=f.state[g]),!Rd(l)&&l.attachments&&l.attachments.forEach(b=>{const{hash:E,...w}=b;f.attachments[E]={...w}})),f}function $8(t,e,n,r,i={}){const{skip:s,ignoreSkipOperations:o=!1,reuseHash:a=!1,reuseOperationResultingState:c=!1,operationResultingStateParser:u}=i,l={...e},d=s||0;let f={...t};const h=!o&&(d>0||"index"in l&&l.skip>0);Rd(l)&&(f=TC(f,l,n)),f=xC(f,l,d),h&&(f=IC(f,l,n,d,c,u));try{const y=n(f.state,l,r);y&&(f.state=y)}catch(y){const v=f.operations[l.scope].length-1;f.operations[l.scope][v].error=y.message,f.operations[l.scope][v].skip=0,h&&(f.state={...t.state},f.operations={...t.operations,[l.scope]:[...t.operations[l.scope],{...f.operations[l.scope][v]}]})}if([oc,Hu,_f].includes(l.type))return f;const m=l.scope||"global",p=a&&Object.prototype.hasOwnProperty.call(l,"hash")?l.hash:wf(f,m),g=f.operations[m].at(-1);return g&&(g.hash=p,c&&(g.resultingState=f.state[m]),!Rd(l)&&l.attachments&&l.attachments.forEach(y=>{const{hash:v,...b}=y;f.attachments[v]={...b}})),f}function j8(t){return t.type===A8&&t.skip!==void 0&&t.skip>0&&t.hash!==void 0}function CC(t){return[oc,Hu].includes(t.type)}function kC(t){return t.type===oc}function Rd(t){return[wC,oc,Hu,_f,EC].includes(t.type)}function ac(t,e,n,r,i="global"){if(!t)throw new Error("Empty action type");if(typeof t!="string")throw new Error(`Invalid action type: ${JSON.stringify(t)}`);const s={type:t,input:e,scope:i};n&&(s.attachments=n);try{r==null||r().parse(s.input)}catch(o){throw o instanceof Cr?new aC(o.issues):new V_(o)}return s}function DC(t,e=OC){return(n,r,i,s)=>e(n,r,t,i,s)}function U8(t,e=$8){return(n,r,i,s)=>e(n,r,t,i,s)}const RC=(t,e)=>({name:"",documentType:"",revision:{global:0,local:0},created:new Date().toISOString(),lastModified:new Date().toISOString(),attachments:{},...t,state:(e==null?void 0:e(t==null?void 0:t.state))??(t==null?void 0:t.state)??{global:{},local:{}}}),NC=(t,e)=>{const n=RC(t,e);return{...n,initialState:n,operations:{global:[],local:[]},clipboard:[]}},wf=(t,e="global")=>bf(Ua(t.state[e]||"")),B8=(t,e=1e3)=>{const n=Math.random()*e;return bf(`${(t??new Date).toISOString()}${n}`)};function Il(t){return Object.freeze(t)}function z8(t,e){const n=[...t];let r=e||0,i=n.length>0?n[n.length-1].index:0;const s=[];for(const o of n.reverse()){if(r>0){const u=i-o.index;r-=u}if(r<0)throw new Error("Invalid operation index, missing operations");const a={ignore:r>0,operation:o},c=o.skip>0?o.skip+1:0;if(c>0&&c>r){const u=c-r;r=r+u}i=o.index,s.push(a)}return s.reverse()}function AC(t){return Object.values(t).flatMap(e=>e).sort((e,n)=>new Date(e.timestamp).getTime()-new Date(n.timestamp).getTime())}function V8(t){return Object.values(t).flatMap(e=>e).sort((e,n)=>new Date(e.operation.timestamp).getTime()-new Date(n.operation.timestamp).getTime())}function PC(t){var e;return((e=AC(t.operations).at(-1))==null?void 0:e.timestamp)||t.initialState.lastModified}function Nd(t,e,n,r,i,s=OC,o={},a){const c=DC(n,s);return Z_(t,e,c,r,i,o,a)}function Z_(t,e,n,r,i,s={},o){const{checkHashes:a=!0,reuseOperationResultingState:c,operationResultingStateParser:u=Qm}=o||{};let l=t;const d=[],f={global:[],local:[]};if(c)for(const[y,v]of Object.entries(e)){const b=v.findLastIndex(w=>!!w.resultingState);if(b<0){d.push(...v);continue}const E=v[b];try{const w=u(E.resultingState);l={...l,state:{...l.state,[y]:w}},f[y].push(...v.slice(0,b+1)),d.push(...v.slice(b+1))}catch{d.push(...v)}}else d.push(...Object.values(e).flat());const h=NC(l);h.initialState=t,h.operations=f;let m=h;if(d.length)m=d.reduce((y,v)=>n(y,v,r,{skip:v.skip,ignoreSkipOperations:!0,reuseHash:!a}),h);else for(const y of Object.values(f)){const v=y.at(-1);v&&(m=SC(m,v))}if(!a)for(const y of Object.keys(m.state))for(let v=d.length-1;v>=0;v--){const b=d[v];if(b.scope===y){if(b.hash!==wf(m,y))throw new Error(`Hash mismatch for scope ${y}`);break}}const p=Object.keys(m.operations).reduce((y,v)=>{const b=v;return{...y,[b]:[...m.operations[b].map((E,w)=>{var x;return{...E,timestamp:((x=e[b][w])==null?void 0:x.timestamp)??E.timestamp}})]}},{global:[],local:[]}),g=Object.values(p).reduce((y,v)=>{const b=v.at(-1);return b&&b.timestamp>y&&(y=b.timestamp),y},t.lastModified);return{...m,operations:p,lastModified:g}}function H8(t,e){return Ua(t)===Ua(e)}function Qm(t){const e=typeof t;if(e==="string")return JSON.parse(t);if(e==="object")return t;throw new Error(`Providing resulting state is of type: ${e}`)}const MC=t=>ac("SET_NAME",t,void 0,QO,void 0),LC=(t=1,e="global")=>ac("UNDO",t,void 0,eC,e),FC=(t=1,e="global")=>ac("REDO",t,void 0,XO,e),$C=(t,e,n="global")=>ac("PRUNE",{start:t,end:e},void 0,JO,n),Y_=(t,e)=>ac("LOAD_STATE",{state:t,operations:e},void 0,KO),jC=(t="global")=>ac("NOOP",{},void 0,void 0,t),UC=Object.freeze(Object.defineProperty({__proto__:null,loadState:Y_,noop:jC,prune:$C,redo:FC,setName:MC,undo:LC},Symbol.toStringTag,{value:"Module"}));var W8=Object.defineProperty,q8=(t,e,n)=>e in t?W8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vy=(t,e,n)=>q8(t,typeof e!="symbol"?e+"":e,n);class Ef{constructor(e,n,r){vy(this,"_document"),vy(this,"_reducer"),vy(this,"_signalDispatch"),this._reducer=e,this._document=n,this._signalDispatch=r}dispatch(e,n){return this._document=this._reducer(this._document,e,this._signalDispatch,n),this}saveToFile(e,n,r){return vC(this._document,e,n,r)}async loadFromFile(e){this._document=await Dv(e,this._reducer)}static async stateFromFile(e,n){return await Dv(e,n)}get state(){return Il(this._document.state)}get operations(){return Il(this._document.operations)}get name(){return this._document.name}get documentType(){return this._document.documentType}get created(){return this._document.created}get lastModified(){return this._document.lastModified}get revision(){return this._document.revision.global}getRevision(e){return this._document.revision[e]}get initialState(){return Il(this._document.initialState)}toDocument(){return Il(this._document)}getAttachment(e){return this._document.attachments[e]}setName(e){return this.dispatch(MC(e)),this}undo(e){return this.dispatch(LC(e)),this}redo(e){return this.dispatch(FC(e)),this}prune(e,n){return this.dispatch($C(e,n)),this}loadState(e,n){return this.dispatch(Y_(e,n)),this}}function BC(t,e){e.forEach(n=>{Object.getOwnPropertyNames(n.prototype).forEach(r=>{Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))})})}const Vt=Object.freeze(Object.defineProperty({__proto__:null,InvalidActionInputError:V_,InvalidActionInputZodError:aC,ab2hex:iC,buildOperationSignature:oC,buildOperationSignatureMessage:z_,buildOperationSignatureParams:rC,buildSignedOperation:l8,createAction:ac,createDocument:NC,createExtendedState:RC,createReducer:DC,createUnsafeReducer:U8,createZip:G_,documentHelpers:S8,generateId:B_,getDocumentLastModified:PC,getLocalFile:O8,getRemoteFile:I8,getUnixTimestamp:nC,hashDocument:wf,hashKey:B8,hex2ab:sC,isBaseAction:Rd,isNoopOperation:j8,isSameDocument:H8,isUndo:kC,isUndoRedo:CC,loadFromFile:Dv,loadFromInput:bC,mapSkippedOperations:z8,parseResultingState:Qm,readOnly:Il,replayDocument:Z_,replayOperations:Nd,saveToFile:vC,saveToFileHandle:x8,sortMappedOperations:V8,sortOperations:AC,validateOperations:uC,verifyOperationSignature:d8},Symbol.toStringTag,{value:"Module"}));function zC(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=zC(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Co(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=zC(t))&&(r&&(r+=" "),r+=e);return r}const Ad=t=>typeof t=="number"&&!isNaN(t),Ia=t=>typeof t=="string",$r=t=>typeof t=="function",Wh=t=>Ia(t)||$r(t)?t:null,Rv=t=>es(t)||Ia(t)||$r(t)||Ad(t);function G8(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=t;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,n)})})}function eg(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:s=300}=t;return function(o){let{children:a,position:c,preventExitTransition:u,done:l,nodeRef:d,isIn:f,playToast:h}=o;const m=r?`${e}--${c}`:e,p=r?`${n}--${c}`:n,g=qt(0);return xm(()=>{const y=d.current,v=m.split(" "),b=E=>{E.target===d.current&&(h(),y.removeEventListener("animationend",b),y.removeEventListener("animationcancel",b),g.current===0&&E.type!=="animationcancel"&&y.classList.remove(...v))};y.classList.add(...v),y.addEventListener("animationend",b),y.addEventListener("animationcancel",b)},[]),Dt(()=>{const y=d.current,v=()=>{y.removeEventListener("animationend",v),i?G8(y,l,s):l()};f||(u?v():(g.current=1,y.className+=` ${p}`,y.addEventListener("animationend",v)))},[f]),$e.createElement($e.Fragment,null,a)}}function vS(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const hr=new Map;let Pd=[];const Nv=new Set,Z8=t=>Nv.forEach(e=>e(t)),VC=()=>hr.size>0;function HC(t,e){var n;if(e)return!((n=hr.get(e))==null||!n.isToastActive(t));let r=!1;return hr.forEach(i=>{i.isToastActive(t)&&(r=!0)}),r}function WC(t,e){Rv(t)&&(VC()||Pd.push({content:t,options:e}),hr.forEach(n=>{n.buildToast(t,e)}))}function bS(t,e){hr.forEach(n=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===n.id&&n.toggle(t,e==null?void 0:e.id):n.toggle(t,e==null?void 0:e.id)})}function Y8(t){const{subscribe:e,getSnapshot:n,setProps:r}=qt(function(s){const o=s.containerId||1;return{subscribe(a){const c=function(l,d,f){let h=1,m=0,p=[],g=[],y=[],v=d;const b=new Map,E=new Set,w=()=>{y=Array.from(b.values()),E.forEach(k=>k())},x=k=>{g=k==null?[]:g.filter(R=>R!==k),w()},_=k=>{const{toastId:R,onOpen:F,updateId:V,children:T}=k.props,L=V==null;k.staleId&&b.delete(k.staleId),b.set(R,k),g=[...g,k.props.toastId].filter(S=>S!==k.staleId),w(),f(vS(k,L?"added":"updated")),L&&$r(F)&&F(es(T)&&T.props)};return{id:l,props:v,observe:k=>(E.add(k),()=>E.delete(k)),toggle:(k,R)=>{b.forEach(F=>{R!=null&&R!==F.props.toastId||$r(F.toggle)&&F.toggle(k)})},removeToast:x,toasts:b,clearQueue:()=>{m-=p.length,p=[]},buildToast:(k,R)=>{if((D=>{let{containerId:X,toastId:Z,updateId:z}=D;const le=X?X!==l:l!==1,pe=b.has(Z)&&z==null;return le||pe})(R))return;const{toastId:F,updateId:V,data:T,staleId:L,delay:S}=R,C=()=>{x(F)},N=V==null;N&&m++;const U={...v,style:v.toastStyle,key:h++,...Object.fromEntries(Object.entries(R).filter(D=>{let[X,Z]=D;return Z!=null})),toastId:F,updateId:V,data:T,closeToast:C,isIn:!1,className:Wh(R.className||v.toastClassName),bodyClassName:Wh(R.bodyClassName||v.bodyClassName),progressClassName:Wh(R.progressClassName||v.progressClassName),autoClose:!R.isLoading&&(K=R.autoClose,$=v.autoClose,K===!1||Ad(K)&&K>0?K:$),deleteToast(){const D=b.get(F),{onClose:X,children:Z}=D.props;$r(X)&&X(es(Z)&&Z.props),f(vS(D,"removed")),b.delete(F),m--,m<0&&(m=0),p.length>0?_(p.shift()):w()}};var K,$;U.closeButton=v.closeButton,R.closeButton===!1||Rv(R.closeButton)?U.closeButton=R.closeButton:R.closeButton===!0&&(U.closeButton=!Rv(v.closeButton)||v.closeButton);let q=k;es(k)&&!Ia(k.type)?q=op(k,{closeToast:C,toastProps:U,data:T}):$r(k)&&(q=k({closeToast:C,toastProps:U,data:T}));const j={content:q,props:U,staleId:L};v.limit&&v.limit>0&&m>v.limit&&N?p.push(j):Ad(S)?setTimeout(()=>{_(j)},S):_(j)},setProps(k){v=k},setToggle:(k,R)=>{b.get(k).toggle=R},isToastActive:k=>g.some(R=>R===k),getSnapshot:()=>y}}(o,s,Z8);hr.set(o,c);const u=c.observe(a);return Pd.forEach(l=>WC(l.content,l.options)),Pd=[],()=>{u(),hr.delete(o)}},setProps(a){var c;(c=hr.get(o))==null||c.setProps(a)},getSnapshot(){var a;return(a=hr.get(o))==null?void 0:a.getSnapshot()}}}(t)).current;r(t);const i=wP(e,n,n);return{getToastToRender:function(s){if(!i)return[];const o=new Map;return t.newestOnTop&&i.reverse(),i.forEach(a=>{const{position:c}=a.props;o.has(c)||o.set(c,[]),o.get(c).push(a)}),Array.from(o,a=>s(a[0],a[1]))},isToastActive:HC,count:i==null?void 0:i.length}}function K8(t){const[e,n]=We(!1),[r,i]=We(!1),s=qt(null),o=qt({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:c,closeToast:u,onClick:l,closeOnClick:d}=t;var f,h;function m(){n(!0)}function p(){n(!1)}function g(b){const E=s.current;o.canDrag&&E&&(o.didMove=!0,e&&p(),o.delta=t.draggableDirection==="x"?b.clientX-o.start:b.clientY-o.start,o.start!==b.clientX&&(o.canCloseOnClick=!1),E.style.transform=`translate3d(${t.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,E.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function y(){document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",y);const b=s.current;if(o.canDrag&&o.didMove&&b){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),t.closeToast(),void t.collapseAll();b.style.transition="transform 0.2s, opacity 0.2s",b.style.removeProperty("transform"),b.style.removeProperty("opacity")}}(h=hr.get((f={id:t.toastId,containerId:t.containerId,fn:n}).containerId||1))==null||h.setToggle(f.id,f.fn),Dt(()=>{if(t.pauseOnFocusLoss)return document.hasFocus()||p(),window.addEventListener("focus",m),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",m),window.removeEventListener("blur",p)}},[t.pauseOnFocusLoss]);const v={onPointerDown:function(b){if(t.draggable===!0||t.draggable===b.pointerType){o.didMove=!1,document.addEventListener("pointermove",g),document.addEventListener("pointerup",y);const E=s.current;o.canCloseOnClick=!0,o.canDrag=!0,E.style.transition="none",t.draggableDirection==="x"?(o.start=b.clientX,o.removalDistance=E.offsetWidth*(t.draggablePercent/100)):(o.start=b.clientY,o.removalDistance=E.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent)/100)}},onPointerUp:function(b){const{top:E,bottom:w,left:x,right:_}=s.current.getBoundingClientRect();b.nativeEvent.type!=="touchend"&&t.pauseOnHover&&b.clientX>=x&&b.clientX<=_&&b.clientY>=E&&b.clientY<=w?p():m()}};return a&&c&&(v.onMouseEnter=p,t.stacked||(v.onMouseLeave=m)),d&&(v.onClick=b=>{l&&l(b),o.canCloseOnClick&&u()}),{playToast:m,pauseToast:p,isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:v}}function J8(t){let{delay:e,isRunning:n,closeToast:r,type:i="default",hide:s,className:o,style:a,controlledProgress:c,progress:u,rtl:l,isIn:d,theme:f}=t;const h=s||c&&u===0,m={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused"};c&&(m.transform=`scaleX(${u})`);const p=Co("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":l}),g=$r(o)?o({rtl:l,type:i,defaultClassName:p}):Co(p,o),y={[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{d&&r()}};return $e.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":h},$e.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${i}`}),$e.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:g,style:m,...y}))}let X8=1;const qC=()=>""+X8++;function Q8(t){return t&&(Ia(t.toastId)||Ad(t.toastId))?t.toastId:qC()}function Bl(t,e){return WC(t,e),e.toastId}function $p(t,e){return{...e,type:e&&e.type||t,toastId:Q8(e)}}function lh(t){return(e,n)=>Bl(e,$p(t,n))}function an(t,e){return Bl(t,$p("default",e))}an.loading=(t,e)=>Bl(t,$p("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),an.promise=function(t,e,n){let r,{pending:i,error:s,success:o}=e;i&&(r=Ia(i)?an.loading(i,n):an.loading(i.render,{...n,...i}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(l,d,f)=>{if(d==null)return void an.dismiss(r);const h={type:l,...a,...n,data:f},m=Ia(d)?{render:d}:d;return r?an.update(r,{...h,...m}):an(m.render,{...h,...m}),f},u=$r(t)?t():t;return u.then(l=>c("success",o,l)).catch(l=>c("error",s,l)),u},an.success=lh("success"),an.info=lh("info"),an.error=lh("error"),an.warning=lh("warning"),an.warn=an.warning,an.dark=(t,e)=>Bl(t,$p("default",{theme:"dark",...e})),an.dismiss=function(t){(function(e){var n;if(VC()){if(e==null||Ia(n=e)||Ad(n))hr.forEach(r=>{r.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const r=hr.get(e.containerId);r?r.removeToast(e.id):hr.forEach(i=>{i.removeToast(e.id)})}}else Pd=Pd.filter(r=>e!=null&&r.options.toastId!==e)})(t)},an.clearWaitingQueue=function(t){t===void 0&&(t={}),hr.forEach(e=>{!e.props.limit||t.containerId&&e.id!==t.containerId||e.clearQueue()})},an.isActive=HC,an.update=function(t,e){e===void 0&&(e={});const n=((r,i)=>{var s;let{containerId:o}=i;return(s=hr.get(o||1))==null?void 0:s.toasts.get(r)})(t,e);if(n){const{props:r,content:i}=n,s={delay:100,...r,...e,toastId:e.toastId||t,updateId:qC()};s.toastId!==t&&(s.staleId=t);const o=s.render||i;delete s.render,Bl(o,s)}},an.done=t=>{an.update(t,{progress:1})},an.onChange=function(t){return Nv.add(t),()=>{Nv.delete(t)}},an.play=t=>bS(!0,t),an.pause=t=>bS(!1,t);const e9=typeof window<"u"?xm:Dt,dh=t=>{let{theme:e,type:n,isLoading:r,...i}=t;return $e.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...i})},by={info:function(t){return $e.createElement(dh,{...t},$e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return $e.createElement(dh,{...t},$e.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return $e.createElement(dh,{...t},$e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return $e.createElement(dh,{...t},$e.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return $e.createElement("div",{className:"Toastify__spinner"})}},t9=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:s}=K8(t),{closeButton:o,children:a,autoClose:c,onClick:u,type:l,hideProgressBar:d,closeToast:f,transition:h,position:m,className:p,style:g,bodyClassName:y,bodyStyle:v,progressClassName:b,progressStyle:E,updateId:w,role:x,progress:_,rtl:k,toastId:R,deleteToast:F,isIn:V,isLoading:T,closeOnClick:L,theme:S}=t,C=Co("Toastify__toast",`Toastify__toast-theme--${S}`,`Toastify__toast--${l}`,{"Toastify__toast--rtl":k},{"Toastify__toast--close-on-click":L}),N=$r(p)?p({rtl:k,position:m,type:l,defaultClassName:C}):Co(C,p),U=function(j){let{theme:D,type:X,isLoading:Z,icon:z}=j,le=null;const pe={theme:D,type:X};return z===!1||($r(z)?le=z({...pe,isLoading:Z}):es(z)?le=op(z,pe):Z?le=by.spinner():(ve=>ve in by)(X)&&(le=by[X](pe))),le}(t),K=!!_||!c,$={closeToast:f,type:l,theme:S};let q=null;return o===!1||(q=$r(o)?o($):es(o)?op(o,$):function(j){let{closeToast:D,theme:X,ariaLabel:Z="close"}=j;return $e.createElement("button",{className:`Toastify__close-button Toastify__close-button--${X}`,type:"button",onClick:z=>{z.stopPropagation(),D(z)},"aria-label":Z},$e.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},$e.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}($)),$e.createElement(h,{isIn:V,done:F,position:m,preventExitTransition:n,nodeRef:r,playToast:s},$e.createElement("div",{id:R,onClick:u,"data-in":V,className:N,...i,style:g,ref:r},$e.createElement("div",{...V&&{role:x},className:$r(y)?y({type:l}):Co("Toastify__toast-body",y),style:v},U!=null&&$e.createElement("div",{className:Co("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},U),$e.createElement("div",null,a)),q,$e.createElement(J8,{...w&&!K?{key:`pb-${w}`}:{},rtl:k,theme:S,delay:c,isRunning:e,isIn:V,closeToast:f,hide:d,type:l,style:E,className:b,controlledProgress:K,progress:_||0})))},tg=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},n9=eg(tg("bounce",!0));eg(tg("slide",!0));eg(tg("zoom"));eg(tg("flip"));const r9={position:"top-right",transition:n9,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function i9(t){let e={...r9,...t};const n=t.stacked,[r,i]=We(!0),s=qt(null),{getToastToRender:o,isToastActive:a,count:c}=Y8(e),{className:u,style:l,rtl:d,containerId:f}=e;function h(p){const g=Co("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":d});return $r(u)?u({position:p,rtl:d,defaultClassName:g}):Co(g,Wh(u))}function m(){n&&(i(!0),an.play())}return e9(()=>{if(n){var p;const g=s.current.querySelectorAll('[data-in="true"]'),y=12,v=(p=e.position)==null?void 0:p.includes("top");let b=0,E=0;Array.from(g).reverse().forEach((w,x)=>{const _=w;_.classList.add("Toastify__toast--stacked"),x>0&&(_.dataset.collapsed=`${r}`),_.dataset.pos||(_.dataset.pos=v?"top":"bot");const k=b*(r?.2:1)+(r?0:y*x);_.style.setProperty("--y",`${v?k:-1*k}px`),_.style.setProperty("--g",`${y}`),_.style.setProperty("--s",""+(1-(r?E:0))),b+=_.offsetHeight,E+=.025})}},[r,c,n]),$e.createElement("div",{ref:s,className:"Toastify",id:f,onMouseEnter:()=>{n&&(i(!1),an.pause())},onMouseLeave:m},o((p,g)=>{const y=g.length?{...l}:{...l,pointerEvents:"none"};return $e.createElement("div",{className:h(p),style:y,key:`container-${p}`},g.map(v=>{let{content:b,props:E}=v;return $e.createElement(t9,{...E,stacked:n,collapseAll:m,isIn:a(E.toastId,E.containerId),style:E.style,key:`toast-${E.key}`},b)}))}))}function s9(t){return t==="connect-success"||t==="connect-warning"||t==="connect-loading"||t==="connect-deleted"}function o9(t){if(s9(t)){const e={};switch(t){case"connect-success":e.type="success",e.icon=P(vt,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":e.type="warning",e.icon=P(vt,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":e.type="default",e.icon=P(vt,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":e.type="error",e.icon=P(vt,{className:"text-red-800",name:"TrashFill",size:24});break}return e}return{type:t}}function Bie(t,e){const{type:n="default",...r}=e||{},i=o9(n);return an(t,{...i,...r})}const a9=({closeToast:t})=>P("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:t,children:P(vt,{name:"XmarkLight",size:16})}),c9=t=>P(i9,{closeButton:a9,...t}),u9={driveNodes:[],selectedNode:null,selectedNodePath:[],selectedDriveNode:null,selectedParentNode:null,setDriveNodes:()=>{},setSelectedNode:()=>{},getNodeById:()=>null,getParentNode:()=>null,getIsSelected:()=>!1,getIsInSelectedNodePath:()=>!1,getSiblings:()=>[]},GC=Fu(u9),l9=({children:t})=>{const[e,n]=We([]),[r,i]=We(null),[s,o]=We([]),[a,c]=We(null),[u,l]=We(null),d=He((_,k)=>{if(!(k!=null&&k.length))return null;for(const R of k){if(R.id===_)return R;const F=R.nodeMap[_];if(F)return F}return null},[]),f=He(_=>d(_,e),[d,e]),h=He((_,k)=>!_||!(k!=null&&k.length)?null:_.kind===Zf?_:k.find(R=>R.id===_.driveId)??null,[]),m=He((_,k)=>{if(!(k!=null&&k.length)||_.kind===Zf)return null;const R=d(_.parentFolder,k);if(!R)return null;if(R.kind===Gc)throw new Error(`Parent node ${_.parentFolder} is a file, not a folder`);return R},[d]),p=He(_=>m(_,e),[m,e]),g=He((_,k)=>!_||!(k!=null&&k.length)?null:_.kind===Gc?m(_,k):_,[m]),y=He((_,k)=>{const R=[],F=k.find(T=>T.id===_.driveId);let V=_;for(;V;)R.push(V),V=V.parentFolder===(F==null?void 0:F.id)?F:V.parentFolder?F==null?void 0:F.nodeMap[V.parentFolder]:void 0;return R.reverse()},[]),v=He(_=>{if(!_)return;if(i(_),c(h(_,e)),l(g(_,e)),_.kind===Zf){o([_]);return}const k=y(_,e);o(k)},[e,y,h,g]),b=He(_=>r===_,[r]),E=He(_=>_.kind===Gc?!1:s.includes(_),[s]),w=He(_=>{if(_.kind===Zf)return console.warn("Drive nodes do not have siblings, as they are top-level nodes"),[];const k=m(_,e);return(k==null?void 0:k.children)??[]},[m,e]);Dt(()=>{if(!r)return;const _=d(r.id,e);_&&v(_)},[e,d,r,v]);const x=Pn(()=>({driveNodes:e,selectedNode:r,selectedNodePath:s,selectedDriveNode:a,selectedParentNode:u,getNodeById:f,getParentNode:p,setDriveNodes:n,setSelectedNode:v,getIsSelected:b,getIsInSelectedNodePath:E,getSiblings:w}),[e,r,s,a,u,f,p,v,b,E,w]);return P(GC.Provider,{value:x,children:t})},zie=()=>Yo(GC),_S=AU({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),d9=o3({chains:[_S],transports:{[_S.id]:UU()}}),f9=new N3;function h9(t){const{children:e,wagmiProviderProps:n,queryClientProviderProps:r}=t,{config:i=d9,...s}=n??{},{client:o=f9,...a}=r??{};return P(l3,{config:i,...s,children:P(A3,{client:o,...a,children:e})})}let p9=0;function gn(t,e){const n=`atom${++p9}`,r={toString(){return n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=m9,r.write=g9),e&&(r.write=e),r}function m9(t){return t(this)}function g9(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const wS=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,ES=t=>"init"in t,SS=t=>!!t.write,jp=new WeakMap,Av=t=>{var e;return Pv(t)&&!((e=jp.get(t))!=null&&e[1])},y9=(t,e)=>{const n=jp.get(t);n&&(n[1]=!0,n[0].forEach(r=>r(e)))},v9=t=>{if(jp.has(t))return;const e=[new Set,!1];jp.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},Pv=t=>typeof(t==null?void 0:t.then)=="function",xS=t=>"v"in t||"e"in t,fh=t=>{if("e"in t)throw t.e;return t.v},ZC=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},b9=(t,e,n,r)=>{var i;e.d.set(n,r.n),Av(e.v)&&ZC(t,e.v,r),(i=r.m)==null||i.t.add(t)},_9=Symbol.for("JOTAI.EXPERIMENTAL.FLUSHSTOREHOOK"),YC=(...t)=>{const[e,n,r,i,s,o]=t,a=V=>{let T=e(V);return T||(T={d:new Map,p:new Set,n:0},n(V,T),s==null||s(V,F)),T},c=new WeakMap,u=new Map,l=new Set,d=new Set,f=()=>{var V;const T=[],L=S=>{try{S()}catch(C){T.push(C)}};do{(V=F[_9])==null||V.call(F);const S=new Set,C=S.add.bind(S);u.forEach(N=>{var U;return(U=N.m)==null?void 0:U.l.forEach(C)}),u.clear(),l.forEach(C),l.clear(),d.forEach(C),d.clear(),S.forEach(L),u.size&&v()}while(u.size||l.size||d.size);if(T.length)throw T[0]},h=(V,T,L)=>{const S="v"in T,C=T.v,N=Av(T.v)?T.v:null;if(Pv(L)){v9(L);for(const U of T.d.keys())ZC(V,L,a(U));T.v=L}else T.v=L;delete T.e,(!S||!Object.is(C,T.v))&&(++T.n,N&&y9(N,L))},m=V=>{var T;const L=a(V);if(xS(L)&&(L.m&&c.get(V)!==L.n||Array.from(L.d).every(([q,j])=>m(q).n===j)))return L;L.d.clear();let S=!0;const C=()=>{L.m&&(w(V,L),v(),f())},N=q=>{if(wS(V,q)){const D=a(q);if(!xS(D))if(ES(q))h(q,D,q.init);else throw new Error("no atom init");return fh(D)}const j=m(q);try{return fh(j)}finally{b9(V,L,q,j),S||C()}};let U,K;const $={get signal(){return U||(U=new AbortController),U.signal},get setSelf(){return!K&&SS(V)&&(K=(...q)=>{if(!S)return E(V,...q)}),K}};try{const q=r(V,N,$);return h(V,L,q),Pv(q)&&((T=q.onCancel)==null||T.call(q,()=>U==null?void 0:U.abort()),q.then(C,C)),L}catch(q){return delete L.v,L.e=q,++L.n,L}finally{S=!1}},p=V=>fh(m(V)),g=V=>{var T;const L=new Map;for(const S of((T=V.m)==null?void 0:T.t)||[]){const C=a(S);C.m&&L.set(S,C)}for(const S of V.p)L.set(S,a(S));return L},y=V=>{const T=[V];for(;T.length;){const L=T.pop();for(const[S,C]of g(L))c.has(S)||(c.set(S,C.n),T.push(C))}},v=()=>{var V;const T=[],L=new WeakSet,S=new WeakSet,C=Array.from(u);for(;C.length;){const[N,U]=C[C.length-1];if(S.has(N)){C.pop();continue}if(L.has(N)){c.get(N)===U.n?T.push([N,U,U.n]):(c.delete(N),u.set(N,U)),S.add(N),C.pop();continue}L.add(N);for(const[K,$]of g(U))L.has(K)||C.push([K,$])}for(let N=T.length-1;N>=0;--N){const[U,K,$]=T[N];let q=!1;for(const j of K.d.keys())if(j!==U&&u.has(j)){q=!0;break}q&&(m(U),w(U,K),$!==K.n&&(u.set(U,K),(V=K.u)==null||V.call(K))),c.delete(U)}},b=(V,...T)=>{let L=!0;const S=N=>fh(m(N)),C=(N,...U)=>{var K;const $=a(N);try{if(wS(V,N)){if(!ES(N))throw new Error("atom not writable");const q=$.n,j=U[0];h(N,$,j),w(N,$),q!==$.n&&(u.set(N,$),(K=$.u)==null||K.call($),y($));return}else return b(N,...U)}finally{L||(v(),f())}};try{return i(V,S,C,...T)}finally{L=!1}},E=(V,...T)=>{try{return b(V,...T)}finally{v(),f()}},w=(V,T)=>{var L;if(T.m&&!Av(T.v)){for(const[S,C]of T.d)if(!T.m.d.has(S)){const N=a(S);x(S,N).t.add(V),T.m.d.add(S),C!==N.n&&(u.set(S,N),(L=N.u)==null||L.call(N),y(N))}for(const S of T.m.d||[])if(!T.d.has(S)){T.m.d.delete(S);const C=_(S,a(S));C==null||C.t.delete(V)}}},x=(V,T)=>{var L;if(!T.m){m(V);for(const S of T.d.keys())x(S,a(S)).t.add(V);if(T.m={l:new Set,d:new Set(T.d.keys()),t:new Set},(L=T.h)==null||L.call(T),SS(V)){const S=T.m,C=()=>{let N=!0;const U=(...K)=>{try{return b(V,...K)}finally{N||(v(),f())}};try{const K=o(V,U);K&&(S.u=()=>{N=!0;try{K()}finally{N=!1}})}finally{N=!1}};d.add(C)}}return T.m},_=(V,T)=>{var L;if(T.m&&!T.m.l.size&&!Array.from(T.m.t).some(S=>{var C;return(C=a(S).m)==null?void 0:C.d.has(V)})){const S=T.m.u;S&&l.add(S),delete T.m,(L=T.h)==null||L.call(T);for(const C of T.d.keys()){const N=_(C,a(C));N==null||N.t.delete(V)}return}return T.m},F={get:p,set:E,sub:(V,T)=>{const L=a(V),C=x(V,L).l;return C.add(T),f(),()=>{C.delete(T),_(V,L),f()}},unstable_derive:V=>YC(...V(...t))};return F},K_=()=>{const t=new WeakMap;return YC(n=>t.get(n),(n,r)=>t.set(n,r).get(n),(n,...r)=>n.read(...r),(n,...r)=>n.write(...r),(n,...r)=>{var i;return(i=n.unstable_onInit)==null?void 0:i.call(n,...r)},(n,...r)=>{var i;return(i=n.onMount)==null?void 0:i.call(n,...r)})};let _y;const KC=()=>(_y||(_y=K_()),_y),JC=Fu(void 0),XC=t=>Yo(JC)||KC(),w9=({children:t,store:e})=>{const n=qt(void 0);return!e&&!n.current&&(n.current=K_()),Sa(JC.Provider,{value:e||n.current},t)},QC=t=>typeof(t==null?void 0:t.then)=="function",E9=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},S9=$e.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(E9(t),t)}),wy=new WeakMap,x9=t=>{let e=wy.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>u=>{i===c&&n(u)},o=c=>u=>{i===c&&r(u)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(u=>{QC(u)?(wy.set(u,e),i=u,u.then(s(u),o(u)),a(u)):n(u)})};t.then(s(t),o(t)),a(t)}),wy.set(t,e)),e};function cc(t,e){const n=XC(),[[r,i,s],o]=EP(u=>{const l=n.get(t);return Object.is(u[0],l)&&u[1]===n&&u[2]===t?u:[l,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),Dt(()=>{const u=n.sub(t,()=>{o()});return o(),u},[n,t,void 0]),SP(a),QC(a)){const u=x9(a);return S9(u)}return a}function T9(t,e){const n=XC();return He((...i)=>n.set(t,...i),[n,t])}function Ni(t,e){return[cc(t),T9(t)]}const I9=Symbol("");function O9(t,e){let n=null;const r=new Map,i=new Set,s=a=>{let c;if(c=r.get(a),c!==void 0)if(n!=null&&n(c[1],a))s.remove(a);else return c[0];const u=t(a);return r.set(a,[u,Date.now()]),o("CREATE",a,u),u};function o(a,c,u){for(const l of i)l({type:a,param:c,atom:u})}return s.unstable_listen=a=>(i.add(a),()=>{i.delete(a)}),s.getParams=()=>r.keys(),s.remove=a=>{{if(!r.has(a))return;const[c]=r.get(a);r.delete(a),o("REMOVE",a,c)}},s.setShouldRemove=a=>{if(n=a,!!n)for(const[c,[u,l]]of r)n(l,c)&&(r.delete(c),o("REMOVE",c,u))},s}const C9=t=>typeof(t==null?void 0:t.then)=="function";function k9(t=()=>{try{return window.localStorage}catch{return}},e){var n;let r,i;const s={getItem:(c,u)=>{var l,d;const f=m=>{if(m=m||"",r!==m){try{i=JSON.parse(m,e==null?void 0:e.reviver)}catch{return u}r=m}return i},h=(d=(l=t())==null?void 0:l.getItem(c))!=null?d:null;return C9(h)?h.then(f):f(h)},setItem:(c,u)=>{var l;return(l=t())==null?void 0:l.setItem(c,JSON.stringify(u,void 0))},removeItem:c=>{var u;return(u=t())==null?void 0:u.removeItem(c)}},o=c=>(u,l,d)=>c(u,f=>{let h;try{h=JSON.parse(f||"")}catch{h=d}l(h)});let a;try{a=(n=t())==null?void 0:n.subscribe}catch{}return!a&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(a=(c,u)=>{if(!(t()instanceof window.Storage))return()=>{};const l=d=>{d.storageArea===t()&&d.key===c&&u(d.newValue)};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}}),a&&(s.subscribe=o(a)),s}const D9=k9();function ek(t,e,n=D9,r){const i=gn(e);return i.onMount=o=>{o(n.getItem(t,e));let a;return n.subscribe&&(a=n.subscribe(t,o,e)),a},gn(o=>o(i),(o,a,c)=>{const u=typeof c=="function"?c(o(i)):c;return u===I9?(a(i,e),n.removeItem(t)):u instanceof Promise?u.then(l=>(a(i,l),n.setItem(t,l))):(a(i,u),n.setItem(t,u))})}const Ey=new WeakMap,R9=(t,e)=>(Ey.has(e)?Ey:Ey.set(e,t())).get(e),N9=t=>t instanceof Promise,TS={state:"loading"};function Vie(t){return R9(()=>{const e=new WeakMap,n=gn(0),r=gn((i,{setSelf:s})=>{i(n);let o;try{o=i(t)}catch(l){return{state:"hasError",error:l}}if(!N9(o))return{state:"hasData",data:o};const a=o,c=e.get(a);if(c)return c;a.then(l=>{e.set(a,{state:"hasData",data:l}),s()},l=>{e.set(a,{state:"hasError",error:l}),s()});const u=e.get(a);return u||(e.set(a,TS),TS)},(i,s)=>{s(n,o=>o+1)});return gn(i=>i(r))},t)}const IS=(t,e,n)=>(e.has(n)?e:e.set(n,t())).get(n),A9=new WeakMap,P9=(t,e,n)=>{const r=IS(()=>new WeakMap,A9,e);return IS(t,r,n)},M9=t=>t instanceof Promise,L9=()=>{};function tk(t,e=L9){return P9(()=>{const n=new WeakMap,r=new WeakMap,i=gn(0),s=gn((o,{setSelf:a})=>{o(i);const c=o(s),u=o(t);if(!M9(u))return{v:u};if(u!==(c==null?void 0:c.p)&&u.then(l=>{r.set(u,l),a()},l=>{n.set(u,l),a()}),n.has(u))throw n.get(u);return r.has(u)?{p:u,v:r.get(u)}:c&&"v"in c?{p:u,f:e(c.v),v:c.v}:{p:u,f:e()}},(o,a)=>{a(i,c=>c+1)});return s.init=void 0,gn(o=>{const a=o(s);return"f"in a?a.f:a.v},(o,a,...c)=>a(t,...c))},t,e)}function J_(t){const e=gn(void 0);return delete e.init,Object.defineProperty(e,"init",{get(){return t()}}),e}const Ol=Ns.routerBasename,Sf=(t,e,n,r)=>ek(`${Ol}:${t}`,e,void 0),F9=(t,e,n)=>ek(t,e,{getItem(r,i){const s=localStorage.getItem(`${Ol}:${r}`);return s?JSON.parse(s):i},setItem(r,i){localStorage.setItem(`${Ol}:${r}`,JSON.stringify(i)),n(i)},removeItem(r){localStorage.removeItem(`${Ol}:${r}`)},subscribe(r,i){if(typeof window.addEventListener>"u")return()=>null;function s(o){o.storageArea===localStorage&&o.key===`${Ol}:${r}`&&i(o.newValue??"")}return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)}}),$9="acceptedCookies",j9=Sf($9,{analytics:!1,marketing:!1,functional:!1}),X_=()=>Ni(j9),U9="display-cookie-banner",B9=Sf(U9,!0),z9=()=>Ni(B9);function V9(t){const{open:e,onAddLocalDrive:n,onClose:r}=t;async function i(s){await n(s),r()}return P(I4,{open:e,onSubmit:i,onOpenChange:s=>{if(!s)return r()}})}const H9=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),W9=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),q9=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),G9=/[^\p{L}\d]+/giu,OS="$1\0$2",CS="";function nk(t){let e=t.trim();e=e.replace(H9,OS).replace(W9,OS),e=e.replace(G9,"\0");let n=0,r=e.length;for(;e.charAt(n)==="\0";)n++;if(n===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(n,r).split(/\0/g)}function Z9(t){const e=nk(t);for(let n=0;n<e.length;n++){const r=e[n],i=q9.exec(r);if(i){const s=i.index+(i[1]??i[2]).length;e.splice(n,1,r.slice(0,s),r.slice(s))}}return e}function rk(t,e){const[n,r,i]=X9(t,e),s=Y9(e==null?void 0:e.locale),o=K9(e==null?void 0:e.locale),a=J9(s,o);return n+r.map(a).join("")+i}function Y9(t){return e=>e.toLocaleLowerCase(t)}function K9(t){return e=>e.toLocaleUpperCase(t)}function J9(t,e){return(n,r)=>{const i=n[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(n.slice(1))}}function X9(t,e={}){const n=e.split??(e.separateNumbers?Z9:nk),r=e.prefixCharacters??CS,i=e.suffixCharacters??CS;let s=0,o=t.length;for(;s<t.length;){const a=t.charAt(s);if(!r.includes(a))break;s++}for(;o>s;){const a=o-1,c=t.charAt(a);if(!i.includes(c))break;o=a}return[t.slice(0,s),n(t.slice(s,o)),t.slice(o)]}function Gt(t,e){if(!!!t)throw new Error(e)}function Ba(t){return typeof t=="object"&&t!==null}function Ti(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const Q9=/\r\n|[\n\r]/g;function Mv(t,e){let n=0,r=1;for(const i of t.body.matchAll(Q9)){if(typeof i.index=="number"||Ti(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function ez(t){return ik(t.source,Mv(t.source,t.start))}function ik(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,c=e.column+a,u=`${t.name}:${o}:${c}
|
|
95
|
-
`,l=r.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){const f=Math.floor(c/80),h=c%80,m=[];for(let p=0;p<d.length;p+=80)m.push(d.slice(p,p+80));return u+kS([[`${o} |`,m[0]],...m.slice(1,f+1).map(p=>["|",p]),["|","^".padStart(h)],["|",m[f+1]]])}return u+kS([[`${o-1} |`,l[i-1]],[`${o} |`,d],["|","^".padStart(c)],[`${o+1} |`,l[i+1]]])}function kS(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
|
|
96
|
-
`)}function tz(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class Ie extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:c,path:u,originalError:l,extensions:d}=tz(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=l??void 0,this.nodes=DS(Array.isArray(o)?o:o?[o]:void 0);const f=DS((r=this.nodes)===null||r===void 0?void 0:r.map(m=>m.loc).filter(m=>m!=null));this.source=a??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=c??(f==null?void 0:f.map(m=>m.start)),this.locations=c&&a?c.map(m=>Mv(a,m)):f==null?void 0:f.map(m=>Mv(m.source,m.start));const h=Ba(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(s=d??h)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Ie):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
|
|
97
|
-
|
|
98
|
-
`+ez(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
|
|
99
|
-
|
|
100
|
-
`+ik(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function DS(t){return t===void 0||t.length===0?void 0:t}function Bn(t,e,n){return new Ie(`Syntax Error: ${n}`,{source:t,positions:[e]})}class nz{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class sk{constructor(e,n,r,i,s,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const ok={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},rz=new Set(Object.keys(ok));function RS(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&rz.has(e)}var ni;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(ni||(ni={}));var nt;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(nt||(nt={}));var ne;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(ne||(ne={}));function Lv(t){return t===9||t===32}function Md(t){return t>=48&&t<=57}function ak(t){return t>=97&&t<=122||t>=65&&t<=90}function Q_(t){return ak(t)||t===95}function ck(t){return ak(t)||Md(t)||t===95}function iz(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var s;const a=t[o],c=sz(a);c!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&c<n&&(n=c))}return t.map((o,a)=>a===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function sz(t){let e=0;for(;e<t.length&&Lv(t.charCodeAt(e));)++e;return e}function oz(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(h=>h.length===0||Lv(h.charCodeAt(0))),o=n.endsWith('\\"""'),a=t.endsWith('"')&&!o,c=t.endsWith("\\"),u=a||c,l=!i||t.length>70||u||s||o;let d="";const f=i&&Lv(t.charCodeAt(0));return(l&&!f||s)&&(d+=`
|
|
101
|
-
`),d+=n,(l||u)&&(d+=`
|
|
102
|
-
`),'"""'+d+'"""'}var be;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(be||(be={}));class az{constructor(e){const n=new sk(be.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==be.EOF)do if(e.next)e=e.next;else{const n=uz(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===be.COMMENT);return e}}function cz(t){return t===be.BANG||t===be.DOLLAR||t===be.AMP||t===be.PAREN_L||t===be.PAREN_R||t===be.SPREAD||t===be.COLON||t===be.EQUALS||t===be.AT||t===be.BRACKET_L||t===be.BRACKET_R||t===be.BRACE_L||t===be.PIPE||t===be.BRACE_R}function Wu(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function ng(t,e){return uk(t.charCodeAt(e))&&lk(t.charCodeAt(e+1))}function uk(t){return t>=55296&&t<=56319}function lk(t){return t>=56320&&t<=57343}function za(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return be.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Nn(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new sk(e,n,r,s,o,i)}function uz(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return lz(t,i);case 33:return Nn(t,be.BANG,i,i+1);case 36:return Nn(t,be.DOLLAR,i,i+1);case 38:return Nn(t,be.AMP,i,i+1);case 40:return Nn(t,be.PAREN_L,i,i+1);case 41:return Nn(t,be.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return Nn(t,be.SPREAD,i,i+3);break;case 58:return Nn(t,be.COLON,i,i+1);case 61:return Nn(t,be.EQUALS,i,i+1);case 64:return Nn(t,be.AT,i,i+1);case 91:return Nn(t,be.BRACKET_L,i,i+1);case 93:return Nn(t,be.BRACKET_R,i,i+1);case 123:return Nn(t,be.BRACE_L,i,i+1);case 124:return Nn(t,be.PIPE,i,i+1);case 125:return Nn(t,be.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?gz(t,i):fz(t,i)}if(Md(s)||s===45)return dz(t,i,s);if(Q_(s))return yz(t,i);throw Bn(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Wu(s)||ng(n,i)?`Unexpected character: ${za(t,i)}.`:`Invalid character: ${za(t,i)}.`)}return Nn(t,be.EOF,r,r)}function lz(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(Wu(s))++i;else if(ng(n,i))i+=2;else break}return Nn(t,be.COMMENT,e,i,n.slice(e+1,i))}function dz(t,e,n){const r=t.source.body;let i=e,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),Md(s))throw Bn(t.source,i,`Invalid number, unexpected digit after 0: ${za(t,i)}.`)}else i=Sy(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=Sy(t,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Sy(t,i,s),s=r.charCodeAt(i)),s===46||Q_(s))throw Bn(t.source,i,`Invalid number, expected digit but got: ${za(t,i)}.`);return Nn(t,o?be.FLOAT:be.INT,e,i,r.slice(e,i))}function Sy(t,e,n){if(!Md(n))throw Bn(t.source,e,`Invalid number, expected digit but got: ${za(t,e)}.`);const r=t.source.body;let i=e+1;for(;Md(r.charCodeAt(i));)++i;return i}function fz(t,e){const n=t.source.body,r=n.length;let i=e+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),Nn(t,be.STRING,e,i+1,o);if(a===92){o+=n.slice(s,i);const c=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?hz(t,i):pz(t,i):mz(t,i);o+=c.value,i+=c.size,s=i;continue}if(a===10||a===13)break;if(Wu(a))++i;else if(ng(n,i))i+=2;else throw Bn(t.source,i,`Invalid character within String: ${za(t,i)}.`)}throw Bn(t.source,i,"Unterminated string.")}function hz(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(e+i++);if(s===125){if(i<5||!Wu(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Cl(s),r<0)break}throw Bn(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function pz(t,e){const n=t.source.body,r=NS(n,e+2);if(Wu(r))return{value:String.fromCodePoint(r),size:6};if(uk(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=NS(n,e+8);if(lk(i))return{value:String.fromCodePoint(r,i),size:12}}throw Bn(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function NS(t,e){return Cl(t.charCodeAt(e))<<12|Cl(t.charCodeAt(e+1))<<8|Cl(t.charCodeAt(e+2))<<4|Cl(t.charCodeAt(e+3))}function Cl(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function mz(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
103
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Bn(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function gz(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,s=e+3,o=s,a="";const c=[];for(;s<r;){const u=n.charCodeAt(s);if(u===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),c.push(a);const l=Nn(t,be.BLOCK_STRING,e,s+3,iz(c).join(`
|
|
104
|
-
`));return t.line+=c.length-1,t.lineStart=i,l}if(u===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(u===10||u===13){a+=n.slice(o,s),c.push(a),u===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Wu(u))++s;else if(ng(n,s))s+=2;else throw Bn(t.source,s,`Invalid character within String: ${za(t,s)}.`)}throw Bn(t.source,s,"Unterminated string.")}function yz(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(ck(s))++i;else break}return Nn(t,be.NAME,e,i,n.slice(e,i))}const vz=10,dk=2;function Qe(t){return rg(t,[])}function rg(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return bz(t,e);default:return String(t)}}function bz(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(_z(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:rg(r,n)}else if(Array.isArray(t))return Ez(t,n);return wz(t,n)}function _z(t){return typeof t.toJSON=="function"}function wz(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>dk?"["+Sz(t)+"]":"{ "+n.map(([i,s])=>i+": "+rg(s,e)).join(", ")+" }"}function Ez(t,e){if(t.length===0)return"[]";if(e.length>dk)return"[Array]";const n=Math.min(vz,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(rg(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function Sz(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const xz=globalThis.process&&!0,ms=xz?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===s){const o=Qe(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
|
|
105
|
-
|
|
106
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
107
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
108
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
109
|
-
|
|
110
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
111
|
-
|
|
112
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
113
|
-
versions may have different capabilities and behavior. The data from one
|
|
114
|
-
version used in the function from another could produce confusing and
|
|
115
|
-
spurious results.`)}}return!1};class fk{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||Gt(!1,`Body must be a string. Received: ${Qe(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||Gt(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Gt(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Tz(t){return ms(t,fk)}function hk(t,e){const n=new Iz(t,e),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}class Iz{constructor(e,n={}){const r=Tz(e)?e:new fk(e);this._lexer=new az(r),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(be.NAME);return this.node(e,{kind:ne.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:ne.DOCUMENT,definitions:this.many(be.SOF,this.parseDefinition,be.EOF)})}parseDefinition(){if(this.peek(be.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===be.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Bn(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(be.BRACE_L))return this.node(e,{kind:ne.OPERATION_DEFINITION,operation:ni.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(be.NAME)&&(r=this.parseName()),this.node(e,{kind:ne.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(be.NAME);switch(e.value){case"query":return ni.QUERY;case"mutation":return ni.MUTATION;case"subscription":return ni.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(be.PAREN_L,this.parseVariableDefinition,be.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ne.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(be.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(be.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(be.DOLLAR),this.node(e,{kind:ne.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ne.SELECTION_SET,selections:this.many(be.BRACE_L,this.parseSelection,be.BRACE_R)})}parseSelection(){return this.peek(be.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(be.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:ne.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(be.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(be.PAREN_L,n,be.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(be.COLON),this.node(n,{kind:ne.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(be.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(be.NAME)?this.node(e,{kind:ne.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:ne.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case be.BRACKET_L:return this.parseList(e);case be.BRACE_L:return this.parseObject(e);case be.INT:return this.advanceLexer(),this.node(n,{kind:ne.INT,value:n.value});case be.FLOAT:return this.advanceLexer(),this.node(n,{kind:ne.FLOAT,value:n.value});case be.STRING:case be.BLOCK_STRING:return this.parseStringLiteral();case be.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:ne.BOOLEAN,value:!0});case"false":return this.node(n,{kind:ne.BOOLEAN,value:!1});case"null":return this.node(n,{kind:ne.NULL});default:return this.node(n,{kind:ne.ENUM,value:n.value})}case be.DOLLAR:if(e)if(this.expectToken(be.DOLLAR),this._lexer.token.kind===be.NAME){const r=this._lexer.token.value;throw Bn(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:ne.STRING,value:e.value,block:e.kind===be.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:ne.LIST,values:this.any(be.BRACKET_L,n,be.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:ne.OBJECT,fields:this.any(be.BRACE_L,n,be.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(be.COLON),this.node(n,{kind:ne.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(be.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(be.AT),this.node(n,{kind:ne.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(be.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(be.BRACKET_R),n=this.node(e,{kind:ne.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(be.BANG)?this.node(e,{kind:ne.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:ne.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(be.STRING)||this.peek(be.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(be.BRACE_L,this.parseOperationTypeDefinition,be.BRACE_R);return this.node(e,{kind:ne.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(be.COLON);const r=this.parseNamedType();return this.node(e,{kind:ne.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ne.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(be.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(be.BRACE_L,this.parseFieldDefinition,be.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(be.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:ne.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(be.PAREN_L,this.parseInputValueDef,be.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(be.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(be.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:ne.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ne.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:ne.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(be.EQUALS)?this.delimitedMany(be.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:ne.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(be.BRACE_L,this.parseEnumValueDefinition,be.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Bn(this._lexer.source,this._lexer.token.start,`${hh(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(be.BRACE_L,this.parseInputValueDef,be.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===be.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(be.BRACE_L,this.parseOperationTypeDefinition,be.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:ne.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:ne.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ne.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ne.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(be.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:ne.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(be.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(nt,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new nz(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw Bn(this._lexer.source,n.start,`Expected ${pk(e)}, found ${hh(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===be.NAME&&n.value===e)this.advanceLexer();else throw Bn(this._lexer.source,n.start,`Expected "${e}", found ${hh(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===be.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return Bn(this._lexer.source,n.start,`Unexpected ${hh(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(n.kind!==be.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw Bn(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function hh(t){const e=t.value;return pk(t.kind)+(e!=null?` "${e}"`:"")}function pk(t){return cz(t)?`"${t}"`:t}const Oz=5;function zo(t,e){const[n,r]=e?[t,e]:[void 0,t];let i=" Did you mean ";n&&(i+=n+" ");const s=r.map(c=>`"${c}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}const o=s.slice(0,Oz),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function AS(t){return t}function Va(t,e){const n=Object.create(null);for(const r of t)n[e(r)]=r;return n}function ew(t,e,n){const r=Object.create(null);for(const i of t)r[e(i)]=n(i);return r}function As(t,e){const n=Object.create(null);for(const r of Object.keys(t))n[r]=e(t[r],r);return n}function tw(t,e){let n=0,r=0;for(;n<t.length&&r<e.length;){let i=t.charCodeAt(n),s=e.charCodeAt(r);if(ph(i)&&ph(s)){let o=0;do++n,o=o*10+i-Fv,i=t.charCodeAt(n);while(ph(i)&&o>0);let a=0;do++r,a=a*10+s-Fv,s=e.charCodeAt(r);while(ph(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++n,++r}}return t.length-e.length}const Fv=48,Cz=57;function ph(t){return!isNaN(t)&&Fv<=t&&t<=Cz}function uc(t,e){const n=Object.create(null),r=new kz(t),i=Math.floor(t.length*.4)+1;for(const s of e){const o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{const a=n[s]-n[o];return a!==0?a:tw(s,o)})}class kz{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=PS(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const r=e.toLowerCase();if(this._inputLowerCase===r)return 1;let i=PS(r),s=this._inputArray;if(i.length<s.length){const l=i;i=s,s=l}const o=i.length,a=s.length;if(o-a>n)return;const c=this._rows;for(let l=0;l<=a;l++)c[0][l]=l;for(let l=1;l<=o;l++){const d=c[(l-1)%3],f=c[l%3];let h=f[0]=l;for(let m=1;m<=a;m++){const p=i[l-1]===s[m-1]?0:1;let g=Math.min(d[m]+1,f[m-1]+1,d[m-1]+p);if(l>1&&m>1&&i[l-1]===s[m-2]&&i[l-2]===s[m-1]){const y=c[(l-2)%3][m-2];g=Math.min(g,y+1)}g<h&&(h=g),f[m]=g}if(h>n)return}const u=c[o%3][a];return u<=n?u:void 0}}function PS(t){const e=t.length,n=new Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r);return n}function oi(t){if(t==null)return Object.create(null);if(Object.getPrototypeOf(t)===null)return t;const e=Object.create(null);for(const[n,r]of Object.entries(t))e[n]=r;return e}function Dz(t){return`"${t.replace(Rz,Nz)}"`}const Rz=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Nz(t){return Az[t.charCodeAt(0)]}const Az=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],kl=Object.freeze({});function mk(t,e,n=ok){const r=new Map;for(const y of Object.values(ne))r.set(y,gk(e,y));let i,s=Array.isArray(t),o=[t],a=-1,c=[],u=t,l,d;const f=[],h=[];do{a++;const y=a===o.length,v=y&&c.length!==0;if(y){if(l=h.length===0?void 0:f[f.length-1],u=d,d=h.pop(),v)if(s){u=u.slice();let E=0;for(const[w,x]of c){const _=w-E;x===null?(u.splice(_,1),E++):u[_]=x}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[E,w]of c)u[E]=w}a=i.index,o=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(d){if(l=s?a:o[a],u=d[l],u==null)continue;f.push(l)}let b;if(!Array.isArray(u)){var m,p;RS(u)||Gt(!1,`Invalid AST Node: ${Qe(u)}.`);const E=y?(m=r.get(u.kind))===null||m===void 0?void 0:m.leave:(p=r.get(u.kind))===null||p===void 0?void 0:p.enter;if(b=E==null?void 0:E.call(e,u,l,d,f,h),b===kl)break;if(b===!1){if(!y){f.pop();continue}}else if(b!==void 0&&(c.push([l,b]),!y))if(RS(b))u=b;else{f.pop();continue}}if(b===void 0&&v&&c.push([l,u]),y)f.pop();else{var g;i={inArray:s,index:a,keys:o,edits:c,prev:i},s=Array.isArray(u),o=s?u:(g=n[u.kind])!==null&&g!==void 0?g:[],a=-1,c=[],d&&h.push(d),d=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function Pz(t){const e=new Array(t.length).fill(null),n=Object.create(null);for(const r of Object.values(ne)){let i=!1;const s=new Array(t.length).fill(void 0),o=new Array(t.length).fill(void 0);for(let c=0;c<t.length;++c){const{enter:u,leave:l}=gk(t[c],r);i||(i=u!=null||l!=null),s[c]=u,o[c]=l}if(!i)continue;const a={enter(...c){const u=c[0];for(let d=0;d<t.length;d++)if(e[d]===null){var l;const f=(l=s[d])===null||l===void 0?void 0:l.apply(t[d],c);if(f===!1)e[d]=u;else if(f===kl)e[d]=kl;else if(f!==void 0)return f}},leave(...c){const u=c[0];for(let d=0;d<t.length;d++)if(e[d]===null){var l;const f=(l=o[d])===null||l===void 0?void 0:l.apply(t[d],c);if(f===kl)e[d]=kl;else if(f!==void 0&&f!==!1)return f}else e[d]===u&&(e[d]=null)}};n[r]=a}return n}function gk(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function jn(t){return mk(t,Lz)}const Mz=80,Lz={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>ze(t.definitions,`
|
|
116
|
-
|
|
117
|
-
`)},OperationDefinition:{leave(t){const e=At("(",ze(t.variableDefinitions,", "),")"),n=ze([t.operation,ze([t.name,e]),ze(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+At(" = ",n)+At(" ",ze(r," "))},SelectionSet:{leave:({selections:t})=>ui(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=At("",t,": ")+e;let o=s+At("(",ze(n,", "),")");return o.length>Mz&&(o=s+At(`(
|
|
118
|
-
`,qh(ze(n,`
|
|
119
|
-
`)),`
|
|
120
|
-
)`)),ze([o,ze(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+At(" ",ze(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>ze(["...",At("on ",t),ze(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${At("(",ze(n,", "),")")} on ${e} ${At("",ze(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?oz(t):Dz(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+ze(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+ze(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+At("(",ze(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>At("",t,`
|
|
121
|
-
`)+ze(["schema",ze(e," "),ui(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>At("",t,`
|
|
122
|
-
`)+ze(["scalar",e,ze(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>At("",t,`
|
|
123
|
-
`)+ze(["type",e,At("implements ",ze(n," & ")),ze(r," "),ui(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>At("",t,`
|
|
124
|
-
`)+e+(MS(n)?At(`(
|
|
125
|
-
`,qh(ze(n,`
|
|
126
|
-
`)),`
|
|
127
|
-
)`):At("(",ze(n,", "),")"))+": "+r+At(" ",ze(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>At("",t,`
|
|
128
|
-
`)+ze([e+": "+n,At("= ",r),ze(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>At("",t,`
|
|
129
|
-
`)+ze(["interface",e,At("implements ",ze(n," & ")),ze(r," "),ui(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>At("",t,`
|
|
130
|
-
`)+ze(["union",e,ze(n," "),At("= ",ze(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>At("",t,`
|
|
131
|
-
`)+ze(["enum",e,ze(n," "),ui(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>At("",t,`
|
|
132
|
-
`)+ze([e,ze(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>At("",t,`
|
|
133
|
-
`)+ze(["input",e,ze(n," "),ui(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>At("",t,`
|
|
134
|
-
`)+"directive @"+e+(MS(n)?At(`(
|
|
135
|
-
`,qh(ze(n,`
|
|
136
|
-
`)),`
|
|
137
|
-
)`):At("(",ze(n,", "),")"))+(r?" repeatable":"")+" on "+ze(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>ze(["extend schema",ze(t," "),ui(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>ze(["extend scalar",t,ze(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>ze(["extend type",t,At("implements ",ze(e," & ")),ze(n," "),ui(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>ze(["extend interface",t,At("implements ",ze(e," & ")),ze(n," "),ui(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>ze(["extend union",t,ze(e," "),At("= ",ze(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>ze(["extend enum",t,ze(e," "),ui(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>ze(["extend input",t,ze(e," "),ui(n)]," ")}};function ze(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function ui(t){return At(`{
|
|
138
|
-
`,qh(ze(t,`
|
|
139
|
-
`)),`
|
|
140
|
-
}`)}function At(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function qh(t){return At(" ",t.replace(/\n/g,`
|
|
141
|
-
`))}function MS(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
|
|
142
|
-
`)))!==null&&e!==void 0?e:!1}function $v(t,e){switch(t.kind){case ne.NULL:return null;case ne.INT:return parseInt(t.value,10);case ne.FLOAT:return parseFloat(t.value);case ne.STRING:case ne.ENUM:case ne.BOOLEAN:return t.value;case ne.LIST:return t.values.map(n=>$v(n,e));case ne.OBJECT:return ew(t.fields,n=>n.name.value,n=>$v(n.value,e));case ne.VARIABLE:return e==null?void 0:e[t.name.value]}}function Mi(t){if(t!=null||Gt(!1,"Must provide name."),typeof t=="string"||Gt(!1,"Expected name to be a string."),t.length===0)throw new Ie("Expected name to be a non-empty string.");for(let e=1;e<t.length;++e)if(!ck(t.charCodeAt(e)))throw new Ie(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(!Q_(t.charCodeAt(0)))throw new Ie(`Names must start with [_a-zA-Z] but "${t}" does not.`);return t}function Fz(t){if(t==="true"||t==="false"||t==="null")throw new Ie(`Enum values cannot be named: ${t}`);return Mi(t)}function nw(t){return qu(t)||yr(t)||Wn(t)||Ws(t)||qs(t)||Vr(t)||Hr(t)||ln(t)}function qu(t){return ms(t,Gs)}function yr(t){return ms(t,ri)}function Wn(t){return ms(t,jv)}function Ws(t){return ms(t,Jc)}function qs(t){return ms(t,Fd)}function Vr(t){return ms(t,Uv)}function Hr(t){return ms(t,pr)}function ln(t){return ms(t,It)}function yk(t){return qu(t)||qs(t)||Vr(t)||vk(t)&&yk(t.ofType)}function Eu(t){return qu(t)||qs(t)}function Ld(t){return yr(t)||Wn(t)||Ws(t)}function Oa(t){return Wn(t)||Ws(t)}class pr{constructor(e){nw(e)||Gt(!1,`Expected ${Qe(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class It{constructor(e){$z(e)||Gt(!1,`Expected ${Qe(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function vk(t){return Hr(t)||ln(t)}function $z(t){return nw(t)&&!ln(t)}function jz(t){if(t)return ln(t)?t.ofType:t}function Ha(t){if(t){let e=t;for(;vk(e);)e=e.ofType;return e}}function bk(t){return typeof t=="function"?t():t}function _k(t){return typeof t=="function"?t():t}class Gs{constructor(e){var n,r,i,s;const o=(n=e.parseValue)!==null&&n!==void 0?n:AS;this.name=Mi(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=(r=e.serialize)!==null&&r!==void 0?r:AS,this.parseValue=o,this.parseLiteral=(i=e.parseLiteral)!==null&&i!==void 0?i:(a,c)=>o($v(a,c)),this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(s=e.extensionASTNodes)!==null&&s!==void 0?s:[],e.specifiedByURL==null||typeof e.specifiedByURL=="string"||Gt(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${Qe(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize=="function"||Gt(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue=="function"&&typeof e.parseLiteral=="function"||Gt(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class ri{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>Ek(e),this._interfaces=()=>wk(e),e.isTypeOf==null||typeof e.isTypeOf=="function"||Gt(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${Qe(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:xk(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function wk(t){var e;const n=bk((e=t.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(n)||Gt(!1,`${t.name} interfaces must be an Array or a function which returns an Array.`),n}function Ek(t){const e=_k(t.fields);return Kc(e)||Gt(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),As(e,(n,r)=>{var i;Kc(n)||Gt(!1,`${t.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||Gt(!1,`${t.name}.${r} field resolver must be a function if provided, but got: ${Qe(n.resolve)}.`);const s=(i=n.args)!==null&&i!==void 0?i:{};return Kc(s)||Gt(!1,`${t.name}.${r} args must be an object with argument names as keys.`),{name:Mi(r),description:n.description,type:n.type,args:Sk(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:oi(n.extensions),astNode:n.astNode}})}function Sk(t){return Object.entries(t).map(([e,n])=>({name:Mi(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:oi(n.extensions),astNode:n.astNode}))}function Kc(t){return Ba(t)&&!Array.isArray(t)}function xk(t){return As(t,e=>({description:e.description,type:e.type,args:Tk(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Tk(t){return ew(t,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Ik(t){return ln(t.type)&&t.defaultValue===void 0}class jv{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Ek.bind(void 0,e),this._interfaces=wk.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Gt(!1,`${this.name} must provide "resolveType" as a function, but got: ${Qe(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:xk(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Jc{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=Uz.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Gt(!1,`${this.name} must provide "resolveType" as a function, but got: ${Qe(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Uz(t){const e=bk(t.types);return Array.isArray(e)||Gt(!1,`Must provide Array of types or a function which returns such an array for Union ${t.name}.`),e}class Fd{constructor(e){var n;this.name=Mi(e.name),this.description=e.description,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof e.values=="function"?e.values:LS(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=LS(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=Va(this.getValues(),n=>n.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));const n=this._valueLookup.get(e);if(n===void 0)throw new Ie(`Enum "${this.name}" cannot represent value: ${Qe(e)}`);return n.name}parseValue(e){if(typeof e!="string"){const r=Qe(e);throw new Ie(`Enum "${this.name}" cannot represent non-string value: ${r}.`+mh(this,r))}const n=this.getValue(e);if(n==null)throw new Ie(`Value "${e}" does not exist in "${this.name}" enum.`+mh(this,e));return n.value}parseLiteral(e,n){if(e.kind!==ne.ENUM){const i=jn(e);throw new Ie(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+mh(this,i),{nodes:e})}const r=this.getValue(e.value);if(r==null){const i=jn(e);throw new Ie(`Value "${i}" does not exist in "${this.name}" enum.`+mh(this,i),{nodes:e})}return r.value}toConfig(){const e=ew(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function mh(t,e){const n=t.getValues().map(i=>i.name),r=uc(e,n);return zo("the enum value",r)}function LS(t,e){return Kc(e)||Gt(!1,`${t} values must be an object with value names as keys.`),Object.entries(e).map(([n,r])=>(Kc(r)||Gt(!1,`${t}.${n} must refer to an object with a "value" key representing an internal value but got: ${Qe(r)}.`),{name:Fz(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:oi(r.extensions),astNode:r.astNode}))}class Uv{constructor(e){var n,r;this.name=Mi(e.name),this.description=e.description,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=e.isOneOf)!==null&&r!==void 0?r:!1,this._fields=Bz.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const e=As(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Bz(t){const e=_k(t.fields);return Kc(e)||Gt(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),As(e,(n,r)=>(!("resolve"in n)||Gt(!1,`${t.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:Mi(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:oi(n.extensions),astNode:n.astNode}))}function zz(t){return ln(t.type)&&t.defaultValue===void 0}function zl(t,e,n){return e===n?!0:ln(n)?ln(e)?zl(t,e.ofType,n.ofType):!1:ln(e)?zl(t,e.ofType,n):Hr(n)?Hr(e)?zl(t,e.ofType,n.ofType):!1:Hr(e)?!1:Oa(n)&&(Wn(e)||yr(e))&&t.isSubType(n,e)}function FS(t,e,n){return e===n?!0:Oa(e)?Oa(n)?t.getPossibleTypes(e).some(r=>t.isSubType(n,r)):t.isSubType(e,n):Oa(n)?t.isSubType(n,e):!1}const xy=2147483647,Ty=-2147483648,Vz=new Gs({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(t){const e=xf(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isInteger(n))throw new Ie(`Int cannot represent non-integer value: ${Qe(e)}`);if(n>xy||n<Ty)throw new Ie("Int cannot represent non 32-bit signed integer value: "+Qe(e));return n},parseValue(t){if(typeof t!="number"||!Number.isInteger(t))throw new Ie(`Int cannot represent non-integer value: ${Qe(t)}`);if(t>xy||t<Ty)throw new Ie(`Int cannot represent non 32-bit signed integer value: ${t}`);return t},parseLiteral(t){if(t.kind!==ne.INT)throw new Ie(`Int cannot represent non-integer value: ${jn(t)}`,{nodes:t});const e=parseInt(t.value,10);if(e>xy||e<Ty)throw new Ie(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return e}}),Hz=new Gs({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(t){const e=xf(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isFinite(n))throw new Ie(`Float cannot represent non numeric value: ${Qe(e)}`);return n},parseValue(t){if(typeof t!="number"||!Number.isFinite(t))throw new Ie(`Float cannot represent non numeric value: ${Qe(t)}`);return t},parseLiteral(t){if(t.kind!==ne.FLOAT&&t.kind!==ne.INT)throw new Ie(`Float cannot represent non numeric value: ${jn(t)}`,t);return parseFloat(t.value)}}),Cn=new Gs({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(t){const e=xf(t);if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"&&Number.isFinite(e))return e.toString();throw new Ie(`String cannot represent value: ${Qe(t)}`)},parseValue(t){if(typeof t!="string")throw new Ie(`String cannot represent a non string value: ${Qe(t)}`);return t},parseLiteral(t){if(t.kind!==ne.STRING)throw new Ie(`String cannot represent a non string value: ${jn(t)}`,{nodes:t});return t.value}}),jr=new Gs({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(t){const e=xf(t);if(typeof e=="boolean")return e;if(Number.isFinite(e))return e!==0;throw new Ie(`Boolean cannot represent a non boolean value: ${Qe(e)}`)},parseValue(t){if(typeof t!="boolean")throw new Ie(`Boolean cannot represent a non boolean value: ${Qe(t)}`);return t},parseLiteral(t){if(t.kind!==ne.BOOLEAN)throw new Ie(`Boolean cannot represent a non boolean value: ${jn(t)}`,{nodes:t});return t.value}}),Ok=new Gs({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(t){const e=xf(t);if(typeof e=="string")return e;if(Number.isInteger(e))return String(e);throw new Ie(`ID cannot represent value: ${Qe(t)}`)},parseValue(t){if(typeof t=="string")return t;if(typeof t=="number"&&Number.isInteger(t))return t.toString();throw new Ie(`ID cannot represent value: ${Qe(t)}`)},parseLiteral(t){if(t.kind!==ne.STRING&&t.kind!==ne.INT)throw new Ie("ID cannot represent a non-string and non-integer value: "+jn(t),{nodes:t});return t.value}}),rw=Object.freeze([Cn,Vz,Hz,jr,Ok]);function Wz(t){return rw.some(({name:e})=>t.name===e)}function xf(t){if(Ba(t)){if(typeof t.valueOf=="function"){const e=t.valueOf();if(!Ba(e))return e}if(typeof t.toJSON=="function")return t.toJSON()}return t}function qz(t){return ms(t,Vo)}class Vo{constructor(e){var n,r;this.name=Mi(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=(n=e.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=oi(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||Gt(!1,`@${e.name} locations must be an Array.`);const i=(r=e.args)!==null&&r!==void 0?r:{};Ba(i)&&!Array.isArray(i)||Gt(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=Sk(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Tk(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Ck=new Vo({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[nt.FIELD,nt.FRAGMENT_SPREAD,nt.INLINE_FRAGMENT],args:{if:{type:new It(jr),description:"Included when true."}}}),kk=new Vo({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[nt.FIELD,nt.FRAGMENT_SPREAD,nt.INLINE_FRAGMENT],args:{if:{type:new It(jr),description:"Skipped when true."}}}),Gz="No longer supported",Dk=new Vo({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[nt.FIELD_DEFINITION,nt.ARGUMENT_DEFINITION,nt.INPUT_FIELD_DEFINITION,nt.ENUM_VALUE],args:{reason:{type:Cn,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Gz}}}),Rk=new Vo({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[nt.SCALAR],args:{url:{type:new It(Cn),description:"The URL that specifies the behavior of this scalar."}}}),Nk=new Vo({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[nt.INPUT_OBJECT],args:{}}),Gu=Object.freeze([Ck,kk,Dk,Rk,Nk]);function Zz(t){return typeof t=="object"&&typeof(t==null?void 0:t[Symbol.iterator])=="function"}function Dl(t,e){if(ln(e)){const n=Dl(t,e.ofType);return(n==null?void 0:n.kind)===ne.NULL?null:n}if(t===null)return{kind:ne.NULL};if(t===void 0)return null;if(Hr(e)){const n=e.ofType;if(Zz(t)){const r=[];for(const i of t){const s=Dl(i,n);s!=null&&r.push(s)}return{kind:ne.LIST,values:r}}return Dl(t,n)}if(Vr(e)){if(!Ba(t))return null;const n=[];for(const r of Object.values(e.getFields())){const i=Dl(t[r.name],r.type);i&&n.push({kind:ne.OBJECT_FIELD,name:{kind:ne.NAME,value:r.name},value:i})}return{kind:ne.OBJECT,fields:n}}if(Eu(e)){const n=e.serialize(t);if(n==null)return null;if(typeof n=="boolean")return{kind:ne.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const r=String(n);return $S.test(r)?{kind:ne.INT,value:r}:{kind:ne.FLOAT,value:r}}if(typeof n=="string")return qs(e)?{kind:ne.ENUM,value:n}:e===Ok&&$S.test(n)?{kind:ne.INT,value:n}:{kind:ne.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${Qe(n)}.`)}Ti(!1,"Unexpected input type: "+Qe(e))}const $S=/^-?(?:0|[1-9][0-9]*)$/,iw=new ri({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Cn,resolve:t=>t.description},types:{description:"A list of all types supported by this server.",type:new It(new pr(new It(Ei))),resolve(t){return Object.values(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new It(Ei),resolve:t=>t.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ei,resolve:t=>t.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ei,resolve:t=>t.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new It(new pr(new It(Ak))),resolve:t=>t.getDirectives()}})}),Ak=new ri({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
143
|
-
|
|
144
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},isRepeatable:{type:new It(jr),resolve:t=>t.isRepeatable},locations:{type:new It(new pr(new It(Pk))),resolve:t=>t.locations},args:{type:new It(new pr(new It(ig))),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}}})}),Pk=new Fd({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:nt.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:nt.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:nt.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:nt.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:nt.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:nt.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:nt.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:nt.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:nt.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:nt.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:nt.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:nt.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:nt.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:nt.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:nt.UNION,description:"Location adjacent to a union definition."},ENUM:{value:nt.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:nt.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:nt.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:nt.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ei=new ri({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new It(Fk),resolve(t){if(qu(t))return Un.SCALAR;if(yr(t))return Un.OBJECT;if(Wn(t))return Un.INTERFACE;if(Ws(t))return Un.UNION;if(qs(t))return Un.ENUM;if(Vr(t))return Un.INPUT_OBJECT;if(Hr(t))return Un.LIST;if(ln(t))return Un.NON_NULL;Ti(!1,`Unexpected type: "${Qe(t)}".`)}},name:{type:Cn,resolve:t=>"name"in t?t.name:void 0},description:{type:Cn,resolve:t=>"description"in t?t.description:void 0},specifiedByURL:{type:Cn,resolve:t=>"specifiedByURL"in t?t.specifiedByURL:void 0},fields:{type:new pr(new It(Mk)),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(yr(t)||Wn(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new pr(new It(Ei)),resolve(t){if(yr(t)||Wn(t))return t.getInterfaces()}},possibleTypes:{type:new pr(new It(Ei)),resolve(t,e,n,{schema:r}){if(Oa(t))return r.getPossibleTypes(t)}},enumValues:{type:new pr(new It(Lk)),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(qs(t)){const n=t.getValues();return e?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new pr(new It(ig)),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Vr(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Ei,resolve:t=>"ofType"in t?t.ofType:void 0},isOneOf:{type:jr,resolve:t=>{if(Vr(t))return t.isOneOf}}})}),Mk=new ri({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},args:{type:new It(new pr(new It(ig))),args:{includeDeprecated:{type:jr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}},type:{type:new It(Ei),resolve:t=>t.type},isDeprecated:{type:new It(jr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Cn,resolve:t=>t.deprecationReason}})}),ig=new ri({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},type:{type:new It(Ei),resolve:t=>t.type},defaultValue:{type:Cn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(t){const{type:e,defaultValue:n}=t,r=Dl(n,e);return r?jn(r):null}},isDeprecated:{type:new It(jr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Cn,resolve:t=>t.deprecationReason}})}),Lk=new ri({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new It(Cn),resolve:t=>t.name},description:{type:Cn,resolve:t=>t.description},isDeprecated:{type:new It(jr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Cn,resolve:t=>t.deprecationReason}})});var Un;(function(t){t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.INPUT_OBJECT="INPUT_OBJECT",t.LIST="LIST",t.NON_NULL="NON_NULL"})(Un||(Un={}));const Fk=new Fd({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Un.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Un.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Un.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Un.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Un.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Un.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Un.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Un.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new It(iw);new It(Cn);new It(Cn);const sw=Object.freeze([iw,Ak,Pk,Ei,Mk,ig,Lk,Fk]);function Yz(t){return sw.some(({name:e})=>t.name===e)}class Kz{constructor(e){var n,r;this.__validationErrors=e.assumeValid===!0?[]:void 0,Ba(e)||Gt(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||Gt(!1,`"types" must be Array if provided but got: ${Qe(e.types)}.`),!e.directives||Array.isArray(e.directives)||Gt(!1,`"directives" must be Array if provided but got: ${Qe(e.directives)}.`),this.description=e.description,this.extensions=oi(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=(r=e.directives)!==null&&r!==void 0?r:Gu;const i=new Set(e.types);if(e.types!=null)for(const s of e.types)i.delete(s),yi(s,i);this._queryType!=null&&yi(this._queryType,i),this._mutationType!=null&&yi(this._mutationType,i),this._subscriptionType!=null&&yi(this._subscriptionType,i);for(const s of this._directives)if(qz(s))for(const o of s.args)yi(o.type,i);yi(iw,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of i){if(s==null)continue;const o=s.name;if(o||Gt(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,Wn(s)){for(const a of s.getInterfaces())if(Wn(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.interfaces.push(s)}}else if(yr(s)){for(const a of s.getInterfaces())if(Wn(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case ni.QUERY:return this.getQueryType();case ni.MUTATION:return this.getMutationType();case ni.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Ws(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const n=this._implementationsMap[e.name];return n??{objects:[],interfaces:[]}}isSubType(e,n){let r=this._subTypeMap[e.name];if(r===void 0){if(r=Object.create(null),Ws(e))for(const i of e.getTypes())r[i.name]=!0;else{const i=this.getImplementations(e);for(const s of i.objects)r[s.name]=!0;for(const s of i.interfaces)r[s.name]=!0}this._subTypeMap[e.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(n=>n.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function yi(t,e){const n=Ha(t);if(!e.has(n)){if(e.add(n),Ws(n))for(const r of n.getTypes())yi(r,e);else if(yr(n)||Wn(n)){for(const r of n.getInterfaces())yi(r,e);for(const r of Object.values(n.getFields())){yi(r.type,e);for(const i of r.args)yi(i.type,e)}}else if(Vr(n))for(const r of Object.values(n.getFields()))yi(r.type,e)}return e}function ds(t,e){switch(e.kind){case ne.LIST_TYPE:{const n=ds(t,e.type);return n&&new pr(n)}case ne.NON_NULL_TYPE:{const n=ds(t,e.type);return n&&new It(n)}case ne.NAMED_TYPE:return t.getType(e.name.value)}}function Jz(t){return t.kind===ne.OPERATION_DEFINITION||t.kind===ne.FRAGMENT_DEFINITION}function Xz(t){return t.kind===ne.SCHEMA_DEFINITION||Tf(t)||t.kind===ne.DIRECTIVE_DEFINITION}function Tf(t){return t.kind===ne.SCALAR_TYPE_DEFINITION||t.kind===ne.OBJECT_TYPE_DEFINITION||t.kind===ne.INTERFACE_TYPE_DEFINITION||t.kind===ne.UNION_TYPE_DEFINITION||t.kind===ne.ENUM_TYPE_DEFINITION||t.kind===ne.INPUT_OBJECT_TYPE_DEFINITION}function Qz(t){return t.kind===ne.SCHEMA_EXTENSION||ow(t)}function ow(t){return t.kind===ne.SCALAR_TYPE_EXTENSION||t.kind===ne.OBJECT_TYPE_EXTENSION||t.kind===ne.INTERFACE_TYPE_EXTENSION||t.kind===ne.UNION_TYPE_EXTENSION||t.kind===ne.ENUM_TYPE_EXTENSION||t.kind===ne.INPUT_OBJECT_TYPE_EXTENSION}function eV(t){return{Document(e){for(const n of e.definitions)if(!Jz(n)){const r=n.kind===ne.SCHEMA_DEFINITION||n.kind===ne.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';t.reportError(new Ie(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function tV(t){return{Field(e){const n=t.getParentType();if(n&&!t.getFieldDef()){const i=t.getSchema(),s=e.name.value;let o=zo("to use an inline fragment on",nV(i,n,s));o===""&&(o=zo(rV(n,s))),t.reportError(new Ie(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:e}))}}}}function nV(t,e,n){if(!Oa(e))return[];const r=new Set,i=Object.create(null);for(const o of t.getPossibleTypes(e))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{const c=i[a.name]-i[o.name];return c!==0?c:Wn(o)&&t.isSubType(o,a)?-1:Wn(a)&&t.isSubType(a,o)?1:tw(o.name,a.name)}).map(o=>o.name)}function rV(t,e){if(yr(t)||Wn(t)){const n=Object.keys(t.getFields());return uc(e,n)}return[]}function iV(t){return{InlineFragment(e){const n=e.typeCondition;if(n){const r=ds(t.getSchema(),n);if(r&&!Ld(r)){const i=jn(n);t.reportError(new Ie(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(e){const n=ds(t.getSchema(),e.typeCondition);if(n&&!Ld(n)){const r=jn(e.typeCondition);t.reportError(new Ie(`Fragment "${e.name.value}" cannot condition on non composite type "${r}".`,{nodes:e.typeCondition}))}}}}function sV(t){return{...$k(t),Argument(e){const n=t.getArgument(),r=t.getFieldDef(),i=t.getParentType();if(!n&&r&&i){const s=e.name.value,o=r.args.map(c=>c.name),a=uc(s,o);t.reportError(new Ie(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+zo(a),{nodes:e}))}}}}function $k(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():Gu;for(const o of r)e[o.name]=o.args.map(a=>a.name);const i=t.getDocument().definitions;for(const o of i)if(o.kind===ne.DIRECTIVE_DEFINITION){var s;const a=(s=o.arguments)!==null&&s!==void 0?s:[];e[o.name.value]=a.map(c=>c.name.value)}return{Directive(o){const a=o.name.value,c=e[a];if(o.arguments&&c)for(const u of o.arguments){const l=u.name.value;if(!c.includes(l)){const d=uc(l,c);t.reportError(new Ie(`Unknown argument "${l}" on directive "@${a}".`+zo(d),{nodes:u}))}}return!1}}}function jk(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():Gu;for(const s of r)e[s.name]=s.locations;const i=t.getDocument().definitions;for(const s of i)s.kind===ne.DIRECTIVE_DEFINITION&&(e[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,c,u){const l=s.name.value,d=e[l];if(!d){t.reportError(new Ie(`Unknown directive "@${l}".`,{nodes:s}));return}const f=oV(u);f&&!d.includes(f)&&t.reportError(new Ie(`Directive "@${l}" may not be used on ${f}.`,{nodes:s}))}}}function oV(t){const e=t[t.length-1];switch("kind"in e||Ti(!1),e.kind){case ne.OPERATION_DEFINITION:return aV(e.operation);case ne.FIELD:return nt.FIELD;case ne.FRAGMENT_SPREAD:return nt.FRAGMENT_SPREAD;case ne.INLINE_FRAGMENT:return nt.INLINE_FRAGMENT;case ne.FRAGMENT_DEFINITION:return nt.FRAGMENT_DEFINITION;case ne.VARIABLE_DEFINITION:return nt.VARIABLE_DEFINITION;case ne.SCHEMA_DEFINITION:case ne.SCHEMA_EXTENSION:return nt.SCHEMA;case ne.SCALAR_TYPE_DEFINITION:case ne.SCALAR_TYPE_EXTENSION:return nt.SCALAR;case ne.OBJECT_TYPE_DEFINITION:case ne.OBJECT_TYPE_EXTENSION:return nt.OBJECT;case ne.FIELD_DEFINITION:return nt.FIELD_DEFINITION;case ne.INTERFACE_TYPE_DEFINITION:case ne.INTERFACE_TYPE_EXTENSION:return nt.INTERFACE;case ne.UNION_TYPE_DEFINITION:case ne.UNION_TYPE_EXTENSION:return nt.UNION;case ne.ENUM_TYPE_DEFINITION:case ne.ENUM_TYPE_EXTENSION:return nt.ENUM;case ne.ENUM_VALUE_DEFINITION:return nt.ENUM_VALUE;case ne.INPUT_OBJECT_TYPE_DEFINITION:case ne.INPUT_OBJECT_TYPE_EXTENSION:return nt.INPUT_OBJECT;case ne.INPUT_VALUE_DEFINITION:{const n=t[t.length-3];return"kind"in n||Ti(!1),n.kind===ne.INPUT_OBJECT_TYPE_DEFINITION?nt.INPUT_FIELD_DEFINITION:nt.ARGUMENT_DEFINITION}default:Ti(!1,"Unexpected kind: "+Qe(e.kind))}}function aV(t){switch(t){case ni.QUERY:return nt.QUERY;case ni.MUTATION:return nt.MUTATION;case ni.SUBSCRIPTION:return nt.SUBSCRIPTION}}function cV(t){return{FragmentSpread(e){const n=e.name.value;t.getFragment(n)||t.reportError(new Ie(`Unknown fragment "${n}".`,{nodes:e.name}))}}}function Uk(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);for(const s of t.getDocument().definitions)Tf(s)&&(r[s.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,c,u){const l=s.name.value;if(!n[l]&&!r[l]){var d;const f=(d=u[2])!==null&&d!==void 0?d:a,h=f!=null&&uV(f);if(h&&jS.includes(l))return;const m=uc(l,h?jS.concat(i):i);t.reportError(new Ie(`Unknown type "${l}".`+zo(m),{nodes:s}))}}}}const jS=[...rw,...sw].map(t=>t.name);function uV(t){return"kind"in t&&(Xz(t)||Qz(t))}function lV(t){let e=0;return{Document(n){e=n.definitions.filter(r=>r.kind===ne.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&e>1&&t.reportError(new Ie("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function dV(t){var e,n,r;const i=t.getSchema(),s=(e=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&e!==void 0?e:i==null?void 0:i.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(s){t.reportError(new Ie("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&t.reportError(new Ie("Must provide only one schema definition.",{nodes:a})),++o}}}const fV=3;function hV(t){function e(n,r=Object.create(null),i=0){if(n.kind===ne.FRAGMENT_SPREAD){const s=n.name.value;if(r[s]===!0)return!1;const o=t.getFragment(s);if(!o)return!1;try{return r[s]=!0,e(o,r,i)}finally{r[s]=void 0}}if(n.kind===ne.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=fV))return!0;if("selectionSet"in n&&n.selectionSet){for(const s of n.selectionSet.selections)if(e(s,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&e(n))return t.reportError(new Ie("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function pV(t){const e=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(e[s.name.value])return;const o=s.name.value;e[o]=!0;const a=t.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(const c of a){const u=c.name.value,l=r[u];if(n.push(c),l===void 0){const d=t.getFragment(u);d&&i(d)}else{const d=n.slice(l),f=d.slice(0,-1).map(h=>'"'+h.name.value+'"').join(", ");t.reportError(new Ie(`Cannot spread fragment "${u}" within itself`+(f!==""?` via ${f}.`:"."),{nodes:d}))}n.pop()}r[o]=void 0}}}function mV(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i}of r){const s=i.name.value;e[s]!==!0&&t.reportError(new Ie(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){e[n.variable.name.value]=!0}}}function gV(t){const e=[],n=[];return{OperationDefinition(r){return e.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){const r=Object.create(null);for(const i of e)for(const s of t.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(const i of n){const s=i.name.value;r[s]!==!0&&t.reportError(new Ie(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}function yV(t){let e=[];return{OperationDefinition:{enter(){e=[]},leave(n){const r=Object.create(null),i=t.getRecursiveVariableUsages(n);for(const{node:s}of i)r[s.name.value]=!0;for(const s of e){const o=s.variable.name.value;r[o]!==!0&&t.reportError(new Ie(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){e.push(n)}}}function aw(t){switch(t.kind){case ne.OBJECT:return{...t,fields:vV(t.fields)};case ne.LIST:return{...t,values:t.values.map(aw)};case ne.INT:case ne.FLOAT:case ne.STRING:case ne.BOOLEAN:case ne.NULL:case ne.ENUM:case ne.VARIABLE:return t}}function vV(t){return t.map(e=>({...e,value:aw(e.value)})).sort((e,n)=>tw(e.name.value,n.name.value))}function Bk(t){return Array.isArray(t)?t.map(([e,n])=>`subfields "${e}" conflict because `+Bk(n)).join(" and "):t}function bV(t){const e=new Hk,n=new TV,r=new Map;return{SelectionSet(i){const s=_V(t,r,e,n,t.getParentType(),i);for(const[[o,a],c,u]of s){const l=Bk(a);t.reportError(new Ie(`Fields "${o}" conflict because ${l}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(u)}))}}}}function _V(t,e,n,r,i,s){const o=[],[a,c]=zp(t,e,i,s);if(EV(t,o,e,n,r,a),c.length!==0)for(let u=0;u<c.length;u++){Up(t,o,e,n,r,!1,a,c[u]);for(let l=u+1;l<c.length;l++)Bp(t,o,e,n,r,!1,c[u],c[l])}return o}function Up(t,e,n,r,i,s,o,a){if(r.has(o,a,s))return;r.add(o,a,s);const c=t.getFragment(a);if(!c)return;const[u,l]=zv(t,n,c);if(o!==u){cw(t,e,n,r,i,s,o,u);for(const d of l)Up(t,e,n,r,i,s,o,d)}}function Bp(t,e,n,r,i,s,o,a){if(o===a||i.has(o,a,s))return;i.add(o,a,s);const c=t.getFragment(o),u=t.getFragment(a);if(!c||!u)return;const[l,d]=zv(t,n,c),[f,h]=zv(t,n,u);cw(t,e,n,r,i,s,l,f);for(const m of h)Bp(t,e,n,r,i,s,o,m);for(const m of d)Bp(t,e,n,r,i,s,m,a)}function wV(t,e,n,r,i,s,o,a,c){const u=[],[l,d]=zp(t,e,s,o),[f,h]=zp(t,e,a,c);cw(t,u,e,n,r,i,l,f);for(const m of h)Up(t,u,e,n,r,i,l,m);for(const m of d)Up(t,u,e,n,r,i,f,m);for(const m of d)for(const p of h)Bp(t,u,e,n,r,i,m,p);return u}function EV(t,e,n,r,i,s){for(const[o,a]of Object.entries(s))if(a.length>1)for(let c=0;c<a.length;c++)for(let u=c+1;u<a.length;u++){const l=zk(t,n,r,i,!1,o,a[c],a[u]);l&&e.push(l)}}function cw(t,e,n,r,i,s,o,a){for(const[c,u]of Object.entries(o)){const l=a[c];if(l)for(const d of u)for(const f of l){const h=zk(t,n,r,i,s,c,d,f);h&&e.push(h)}}}function zk(t,e,n,r,i,s,o,a){const[c,u,l]=o,[d,f,h]=a,m=i||c!==d&&yr(c)&&yr(d);if(!m){const b=u.name.value,E=f.name.value;if(b!==E)return[[s,`"${b}" and "${E}" are different fields`],[u],[f]];if(!SV(u,f))return[[s,"they have differing arguments"],[u],[f]]}const p=l==null?void 0:l.type,g=h==null?void 0:h.type;if(p&&g&&Bv(p,g))return[[s,`they return conflicting types "${Qe(p)}" and "${Qe(g)}"`],[u],[f]];const y=u.selectionSet,v=f.selectionSet;if(y&&v){const b=wV(t,e,n,r,m,Ha(p),y,Ha(g),v);return xV(b,s,u,f)}}function SV(t,e){const n=t.arguments,r=e.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;const i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{const o=s.value,a=i.get(s.name.value);return a===void 0?!1:US(o)===US(a)})}function US(t){return jn(aw(t))}function Bv(t,e){return Hr(t)?Hr(e)?Bv(t.ofType,e.ofType):!0:Hr(e)?!0:ln(t)?ln(e)?Bv(t.ofType,e.ofType):!0:ln(e)?!0:Eu(t)||Eu(e)?t!==e:!1}function zp(t,e,n,r){const i=e.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);Vk(t,n,r,s,o);const a=[s,Object.keys(o)];return e.set(r,a),a}function zv(t,e,n){const r=e.get(n.selectionSet);if(r)return r;const i=ds(t.getSchema(),n.typeCondition);return zp(t,e,i,n.selectionSet)}function Vk(t,e,n,r,i){for(const s of n.selections)switch(s.kind){case ne.FIELD:{const o=s.name.value;let a;(yr(e)||Wn(e))&&(a=e.getFields()[o]);const c=s.alias?s.alias.value:o;r[c]||(r[c]=[]),r[c].push([e,s,a]);break}case ne.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case ne.INLINE_FRAGMENT:{const o=s.typeCondition,a=o?ds(t.getSchema(),o):e;Vk(t,a,s.selectionSet,r,i);break}}}function xV(t,e,n,r){if(t.length>0)return[[e,t.map(([i])=>i)],[n,...t.map(([,i])=>i).flat()],[r,...t.map(([,,i])=>i).flat()]]}class Hk{constructor(){this._data=new Map}has(e,n,r){var i;const s=(i=this._data.get(e))===null||i===void 0?void 0:i.get(n);return s===void 0?!1:r?!0:r===s}add(e,n,r){const i=this._data.get(e);i===void 0?this._data.set(e,new Map([[n,r]])):i.set(n,r)}}class TV{constructor(){this._orderedPairSet=new Hk}has(e,n,r){return e<n?this._orderedPairSet.has(e,n,r):this._orderedPairSet.has(n,e,r)}add(e,n,r){e<n?this._orderedPairSet.add(e,n,r):this._orderedPairSet.add(n,e,r)}}function IV(t){return{InlineFragment(e){const n=t.getType(),r=t.getParentType();if(Ld(n)&&Ld(r)&&!FS(t.getSchema(),n,r)){const i=Qe(r),s=Qe(n);t.reportError(new Ie(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:e}))}},FragmentSpread(e){const n=e.name.value,r=OV(t,n),i=t.getParentType();if(r&&i&&!FS(t.getSchema(),r,i)){const s=Qe(i),o=Qe(r);t.reportError(new Ie(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:e}))}}}}function OV(t,e){const n=t.getFragment(e);if(n){const r=ds(t.getSchema(),n.typeCondition);if(Ld(r))return r}}function CV(t){const e=t.getSchema(),n=Object.create(null);for(const i of t.getDocument().definitions)Tf(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){const s=i.name.value,o=n[s],a=e==null?void 0:e.getType(s);let c;if(o?c=kV[o.kind]:a&&(c=DV(a)),c){if(c!==i.kind){const u=RV(i.kind);t.reportError(new Ie(`Cannot extend non-${u} type "${s}".`,{nodes:o?[o,i]:i}))}}else{const u=Object.keys({...n,...e==null?void 0:e.getTypeMap()}),l=uc(s,u);t.reportError(new Ie(`Cannot extend type "${s}" because it is not defined.`+zo(l),{nodes:i.name}))}}}const kV={[ne.SCALAR_TYPE_DEFINITION]:ne.SCALAR_TYPE_EXTENSION,[ne.OBJECT_TYPE_DEFINITION]:ne.OBJECT_TYPE_EXTENSION,[ne.INTERFACE_TYPE_DEFINITION]:ne.INTERFACE_TYPE_EXTENSION,[ne.UNION_TYPE_DEFINITION]:ne.UNION_TYPE_EXTENSION,[ne.ENUM_TYPE_DEFINITION]:ne.ENUM_TYPE_EXTENSION,[ne.INPUT_OBJECT_TYPE_DEFINITION]:ne.INPUT_OBJECT_TYPE_EXTENSION};function DV(t){if(qu(t))return ne.SCALAR_TYPE_EXTENSION;if(yr(t))return ne.OBJECT_TYPE_EXTENSION;if(Wn(t))return ne.INTERFACE_TYPE_EXTENSION;if(Ws(t))return ne.UNION_TYPE_EXTENSION;if(qs(t))return ne.ENUM_TYPE_EXTENSION;if(Vr(t))return ne.INPUT_OBJECT_TYPE_EXTENSION;Ti(!1,"Unexpected type: "+Qe(t))}function RV(t){switch(t){case ne.SCALAR_TYPE_EXTENSION:return"scalar";case ne.OBJECT_TYPE_EXTENSION:return"object";case ne.INTERFACE_TYPE_EXTENSION:return"interface";case ne.UNION_TYPE_EXTENSION:return"union";case ne.ENUM_TYPE_EXTENSION:return"enum";case ne.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:Ti(!1,"Unexpected kind: "+Qe(t))}}function NV(t){return{...Wk(t),Field:{leave(e){var n;const r=t.getFieldDef();if(!r)return!1;const i=new Set((n=e.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(const s of r.args)if(!i.has(s.name)&&Ik(s)){const o=Qe(s.type);t.reportError(new Ie(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:e}))}}}}}function Wk(t){var e;const n=Object.create(null),r=t.getSchema(),i=(e=r==null?void 0:r.getDirectives())!==null&&e!==void 0?e:Gu;for(const a of i)n[a.name]=Va(a.args.filter(Ik),c=>c.name);const s=t.getDocument().definitions;for(const a of s)if(a.kind===ne.DIRECTIVE_DEFINITION){var o;const c=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=Va(c.filter(AV),u=>u.name.value)}return{Directive:{leave(a){const c=a.name.value,u=n[c];if(u){var l;const d=(l=a.arguments)!==null&&l!==void 0?l:[],f=new Set(d.map(h=>h.name.value));for(const[h,m]of Object.entries(u))if(!f.has(h)){const p=nw(m.type)?Qe(m.type):jn(m.type);t.reportError(new Ie(`Directive "@${c}" argument "${h}" of type "${p}" is required, but it was not provided.`,{nodes:a}))}}}}}}function AV(t){return t.type.kind===ne.NON_NULL_TYPE&&t.defaultValue==null}function PV(t){return{Field(e){const n=t.getType(),r=e.selectionSet;if(n)if(Eu(Ha(n))){if(r){const i=e.name.value,s=Qe(n);t.reportError(new Ie(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(r){if(r.selections.length===0){const i=e.name.value,s=Qe(n);t.reportError(new Ie(`Field "${i}" of type "${s}" must have at least one field selected.`,{nodes:e}))}}else{const i=e.name.value,s=Qe(n);t.reportError(new Ie(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:e}))}}}}function pa(t,e,n){if(t){if(t.kind===ne.VARIABLE){const r=t.name.value;if(n==null||n[r]===void 0)return;const i=n[r];return i===null&&ln(e)?void 0:i}if(ln(e))return t.kind===ne.NULL?void 0:pa(t,e.ofType,n);if(t.kind===ne.NULL)return null;if(Hr(e)){const r=e.ofType;if(t.kind===ne.LIST){const s=[];for(const o of t.values)if(BS(o,n)){if(ln(r))return;s.push(null)}else{const a=pa(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=pa(t,r,n);return i===void 0?void 0:[i]}if(Vr(e)){if(t.kind!==ne.OBJECT)return;const r=Object.create(null),i=Va(t.fields,s=>s.name.value);for(const s of Object.values(e.getFields())){const o=i[s.name];if(!o||BS(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(ln(s.type))return;continue}const a=pa(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}if(e.isOneOf){const s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(Eu(e)){let r;try{r=e.parseLiteral(t,n)}catch{return}return r===void 0?void 0:r}Ti(!1,"Unexpected input type: "+Qe(e))}}function BS(t,e){return t.kind===ne.VARIABLE&&(e==null||e[t.name.value]===void 0)}function MV(t,e,n){var r;const i={},s=(r=e.arguments)!==null&&r!==void 0?r:[],o=Va(s,a=>a.name.value);for(const a of t.args){const c=a.name,u=a.type,l=o[c];if(!l){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(ln(u))throw new Ie(`Argument "${c}" of required type "${Qe(u)}" was not provided.`,{nodes:e});continue}const d=l.value;let f=d.kind===ne.NULL;if(d.kind===ne.VARIABLE){const m=d.name.value;if(n==null||!LV(n,m)){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(ln(u))throw new Ie(`Argument "${c}" of required type "${Qe(u)}" was provided the variable "$${m}" which was not provided a runtime value.`,{nodes:d});continue}f=n[m]==null}if(f&&ln(u))throw new Ie(`Argument "${c}" of non-null type "${Qe(u)}" must not be null.`,{nodes:d});const h=pa(d,u,n);if(h===void 0)throw new Ie(`Argument "${c}" has invalid value ${jn(d)}.`,{nodes:d});i[c]=h}return i}function $d(t,e,n){var r;const i=(r=e.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===t.name);if(i)return MV(t,i,n)}function LV(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function FV(t,e,n,r,i){const s=new Map;return Vv(t,e,n,r,i,s,new Set),s}function Vv(t,e,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case ne.FIELD:{if(!Iy(n,a))continue;const c=$V(a),u=s.get(c);u!==void 0?u.push(a):s.set(c,[a]);break}case ne.INLINE_FRAGMENT:{if(!Iy(n,a)||!zS(t,a,r))continue;Vv(t,e,n,r,a.selectionSet,s,o);break}case ne.FRAGMENT_SPREAD:{const c=a.name.value;if(o.has(c)||!Iy(n,a))continue;o.add(c);const u=e[c];if(!u||!zS(t,u,r))continue;Vv(t,e,n,r,u.selectionSet,s,o);break}}}function Iy(t,e){const n=$d(kk,e,t);if((n==null?void 0:n.if)===!0)return!1;const r=$d(Ck,e,t);return(r==null?void 0:r.if)!==!1}function zS(t,e,n){const r=e.typeCondition;if(!r)return!0;const i=ds(t,r);return i===n?!0:Oa(i)?t.isSubType(i,n):!1}function $V(t){return t.alias?t.alias.value:t.name.value}function jV(t){return{OperationDefinition(e){if(e.operation==="subscription"){const n=t.getSchema(),r=n.getSubscriptionType();if(r){const i=e.name?e.name.value:null,s=Object.create(null),o=t.getDocument(),a=Object.create(null);for(const u of o.definitions)u.kind===ne.FRAGMENT_DEFINITION&&(a[u.name.value]=u);const c=FV(n,a,s,r,e.selectionSet);if(c.size>1){const d=[...c.values()].slice(1).flat();t.reportError(new Ie(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:d}))}for(const u of c.values())u[0].name.value.startsWith("__")&&t.reportError(new Ie(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:u}))}}}}}function uw(t,e){const n=new Map;for(const r of t){const i=e(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}function UV(t){return{DirectiveDefinition(r){var i;const s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:e,InterfaceTypeExtension:e,ObjectTypeDefinition:e,ObjectTypeExtension:e};function e(r){var i;const s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(const c of o){var a;const u=c.name.value,l=(a=c.arguments)!==null&&a!==void 0?a:[];n(`${s}.${u}`,l)}return!1}function n(r,i){const s=uw(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new Ie(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function qk(t){return{Field:e,Directive:e};function e(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=uw(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new Ie(`There can be only one argument named "${o}".`,{nodes:a.map(c=>c.name)}))}}function BV(t){const e=Object.create(null),n=t.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n!=null&&n.getDirective(i)){t.reportError(new Ie(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return e[i]?t.reportError(new Ie(`There can be only one directive named "@${i}".`,{nodes:[e[i],r.name]})):e[i]=r.name,!1}}}function Gk(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():Gu;for(const a of r)e[a.name]=!a.isRepeatable;const i=t.getDocument().definitions;for(const a of i)a.kind===ne.DIRECTIVE_DEFINITION&&(e[a.name.value]=!a.repeatable);const s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let c;if(a.kind===ne.SCHEMA_DEFINITION||a.kind===ne.SCHEMA_EXTENSION)c=s;else if(Tf(a)||ow(a)){const u=a.name.value;c=o[u],c===void 0&&(o[u]=c=Object.create(null))}else c=Object.create(null);for(const u of a.directives){const l=u.name.value;e[l]&&(c[l]?t.reportError(new Ie(`The directive "@${l}" can only be used once at this location.`,{nodes:[c[l],u]})):c[l]=u)}}}}function zV(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const c=(o=s.values)!==null&&o!==void 0?o:[],u=r[a];for(const l of c){const d=l.name.value,f=n[a];qs(f)&&f.getValue(d)?t.reportError(new Ie(`Enum value "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[d]?t.reportError(new Ie(`Enum value "${a}.${d}" can only be defined once.`,{nodes:[u[d],l.name]})):u[d]=l.name}return!1}}function VV(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const c=(o=s.fields)!==null&&o!==void 0?o:[],u=r[a];for(const l of c){const d=l.name.value;HV(n[a],d)?t.reportError(new Ie(`Field "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):u[d]?t.reportError(new Ie(`Field "${a}.${d}" can only be defined once.`,{nodes:[u[d],l.name]})):u[d]=l.name}return!1}}function HV(t,e){return yr(t)||Wn(t)||Vr(t)?t.getFields()[e]!=null:!1}function WV(t){const e=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return e[r]?t.reportError(new Ie(`There can be only one fragment named "${r}".`,{nodes:[e[r],n.name]})):e[r]=n.name,!1}}}function Zk(t){const e=[];let n=Object.create(null);return{ObjectValue:{enter(){e.push(n),n=Object.create(null)},leave(){const r=e.pop();r||Ti(!1),n=r}},ObjectField(r){const i=r.name.value;n[i]?t.reportError(new Ie(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}function qV(t){const e=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(e[r.value]?t.reportError(new Ie(`There can be only one operation named "${r.value}".`,{nodes:[e[r.value],r]})):e[r.value]=r),!1},FragmentDefinition:()=>!1}}function GV(t){const e=t.getSchema(),n=Object.create(null),r=e?{query:e.getQueryType(),mutation:e.getMutationType(),subscription:e.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;const a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(const c of a){const u=c.operation,l=n[u];r[u]?t.reportError(new Ie(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:c})):l?t.reportError(new Ie(`There can be only one ${u} type in schema.`,{nodes:[l,c]})):n[u]=c}return!1}}function ZV(t){const e=Object.create(null),n=t.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){const s=i.name.value;if(n!=null&&n.getType(s)){t.reportError(new Ie(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return e[s]?t.reportError(new Ie(`There can be only one type named "${s}".`,{nodes:[e[s],i.name]})):e[s]=i.name,!1}}function YV(t){return{OperationDefinition(e){var n;const r=(n=e.variableDefinitions)!==null&&n!==void 0?n:[],i=uw(r,s=>s.variable.name.value);for(const[s,o]of i)o.length>1&&t.reportError(new Ie(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}function KV(t){let e={};return{OperationDefinition:{enter(){e={}}},VariableDefinition(n){e[n.variable.name.value]=n},ListValue(n){const r=jz(t.getParentInputType());if(!Hr(r))return ia(t,n),!1},ObjectValue(n){const r=Ha(t.getInputType());if(!Vr(r))return ia(t,n),!1;const i=Va(n.fields,s=>s.name.value);for(const s of Object.values(r.getFields()))if(!i[s.name]&&zz(s)){const a=Qe(s.type);t.reportError(new Ie(`Field "${r.name}.${s.name}" of required type "${a}" was not provided.`,{nodes:n}))}r.isOneOf&&JV(t,n,r,i,e)},ObjectField(n){const r=Ha(t.getParentInputType());if(!t.getInputType()&&Vr(r)){const s=uc(n.name.value,Object.keys(r.getFields()));t.reportError(new Ie(`Field "${n.name.value}" is not defined by type "${r.name}".`+zo(s),{nodes:n}))}},NullValue(n){const r=t.getInputType();ln(r)&&t.reportError(new Ie(`Expected value of type "${Qe(r)}", found ${jn(n)}.`,{nodes:n}))},EnumValue:n=>ia(t,n),IntValue:n=>ia(t,n),FloatValue:n=>ia(t,n),StringValue:n=>ia(t,n),BooleanValue:n=>ia(t,n)}}function ia(t,e){const n=t.getInputType();if(!n)return;const r=Ha(n);if(!Eu(r)){const i=Qe(n);t.reportError(new Ie(`Expected value of type "${i}", found ${jn(e)}.`,{nodes:e}));return}try{if(r.parseLiteral(e,void 0)===void 0){const s=Qe(n);t.reportError(new Ie(`Expected value of type "${s}", found ${jn(e)}.`,{nodes:e}))}}catch(i){const s=Qe(n);i instanceof Ie?t.reportError(i):t.reportError(new Ie(`Expected value of type "${s}", found ${jn(e)}; `+i.message,{nodes:e,originalError:i}))}}function JV(t,e,n,r,i){var s;const o=Object.keys(r);if(o.length!==1){t.reportError(new Ie(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[e]}));return}const c=(s=r[o[0]])===null||s===void 0?void 0:s.value,u=!c||c.kind===ne.NULL,l=(c==null?void 0:c.kind)===ne.VARIABLE;if(u){t.reportError(new Ie(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[e]}));return}if(l){const d=c.name.value;i[d].type.kind!==ne.NON_NULL_TYPE&&t.reportError(new Ie(`Variable "${d}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[e]}))}}function XV(t){return{VariableDefinition(e){const n=ds(t.getSchema(),e.type);if(n!==void 0&&!yk(n)){const r=e.variable.name.value,i=jn(e.type);t.reportError(new Ie(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:e.type}))}}}}function QV(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i,type:s,defaultValue:o}of r){const a=i.name.value,c=e[a];if(c&&s){const u=t.getSchema(),l=ds(u,c.type);if(l&&!eH(u,l,c.defaultValue,s,o)){const d=Qe(l),f=Qe(s);t.reportError(new Ie(`Variable "$${a}" of type "${d}" used in position expecting type "${f}".`,{nodes:[c,i]}))}}}}},VariableDefinition(n){e[n.variable.name.value]=n}}}function eH(t,e,n,r,i){if(ln(r)&&!ln(e)){if(!(n!=null&&n.kind!==ne.NULL)&&!(i!==void 0))return!1;const a=r.ofType;return zl(t,e,a)}return zl(t,e,r)}const tH=Object.freeze([hV]);Object.freeze([eV,qV,lV,jV,Uk,iV,XV,PV,tV,WV,cV,gV,IV,pV,YV,mV,yV,jk,Gk,sV,qk,KV,NV,QV,bV,Zk,...tH]);const nH=Object.freeze([dV,GV,ZV,zV,VV,UV,BV,Uk,jk,Gk,CV,$k,qk,Zk,Wk]);class rH{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const r of this.getDocument().definitions)r.kind===ne.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const r=[e];let i;for(;i=r.pop();)for(const s of i.selections)s.kind===ne.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const r=Object.create(null),i=[e.selectionSet];let s;for(;s=i.pop();)for(const o of this.getFragmentSpreads(s)){const a=o.name.value;if(r[a]!==!0){r[a]=!0;const c=this.getFragment(a);c&&(n.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}class iH extends rH{constructor(e,n,r){super(e,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}function sH(t,e,n=nH){const r=[],i=new iH(t,e,o=>{r.push(o)}),s=n.map(o=>o(i));return mk(t,Pz(s)),r}function oH(t){const e=sH(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
|
|
145
|
-
|
|
146
|
-
`))}function aH(t,e,n){var r,i,s,o;const a=[],c=Object.create(null),u=[];let l;const d=[];for(const D of e.definitions)if(D.kind===ne.SCHEMA_DEFINITION)l=D;else if(D.kind===ne.SCHEMA_EXTENSION)d.push(D);else if(Tf(D))a.push(D);else if(ow(D)){const X=D.name.value,Z=c[X];c[X]=Z?Z.concat([D]):[D]}else D.kind===ne.DIRECTIVE_DEFINITION&&u.push(D);if(Object.keys(c).length===0&&a.length===0&&u.length===0&&d.length===0&&l==null)return t;const f=Object.create(null);for(const D of t.types)f[D.name]=v(D);for(const D of a){var h;const X=D.name.value;f[X]=(h=VS[X])!==null&&h!==void 0?h:j(D)}const m={query:t.query&&g(t.query),mutation:t.mutation&&g(t.mutation),subscription:t.subscription&&g(t.subscription),...l&&V([l]),...V(d)};return{description:(r=l)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value,...m,types:Object.values(f),directives:[...t.directives.map(y),...u.map(S)],extensions:Object.create(null),astNode:(s=l)!==null&&s!==void 0?s:t.astNode,extensionASTNodes:t.extensionASTNodes.concat(d),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1};function p(D){return Hr(D)?new pr(p(D.ofType)):ln(D)?new It(p(D.ofType)):g(D)}function g(D){return f[D.name]}function y(D){const X=D.toConfig();return new Vo({...X,args:As(X.args,F)})}function v(D){if(Yz(D)||Wz(D))return D;if(qu(D))return w(D);if(yr(D))return x(D);if(Wn(D))return _(D);if(Ws(D))return k(D);if(qs(D))return E(D);if(Vr(D))return b(D);Ti(!1,"Unexpected type: "+Qe(D))}function b(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new Uv({...Z,fields:()=>({...As(Z.fields,le=>({...le,type:p(le.type)})),...U(z)}),extensionASTNodes:Z.extensionASTNodes.concat(z)})}function E(D){var X;const Z=D.toConfig(),z=(X=c[D.name])!==null&&X!==void 0?X:[];return new Fd({...Z,values:{...Z.values,...K(z)},extensionASTNodes:Z.extensionASTNodes.concat(z)})}function w(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];let le=Z.specifiedByURL;for(const ve of z){var pe;le=(pe=HS(ve))!==null&&pe!==void 0?pe:le}return new Gs({...Z,specifiedByURL:le,extensionASTNodes:Z.extensionASTNodes.concat(z)})}function x(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new ri({...Z,interfaces:()=>[...D.getInterfaces().map(g),...$(z)],fields:()=>({...As(Z.fields,R),...C(z)}),extensionASTNodes:Z.extensionASTNodes.concat(z)})}function _(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new jv({...Z,interfaces:()=>[...D.getInterfaces().map(g),...$(z)],fields:()=>({...As(Z.fields,R),...C(z)}),extensionASTNodes:Z.extensionASTNodes.concat(z)})}function k(D){var X;const Z=D.toConfig(),z=(X=c[Z.name])!==null&&X!==void 0?X:[];return new Jc({...Z,types:()=>[...D.getTypes().map(g),...q(z)],extensionASTNodes:Z.extensionASTNodes.concat(z)})}function R(D){return{...D,type:p(D.type),args:D.args&&As(D.args,F)}}function F(D){return{...D,type:p(D.type)}}function V(D){const X={};for(const z of D){var Z;const le=(Z=z.operationTypes)!==null&&Z!==void 0?Z:[];for(const pe of le)X[pe.operation]=T(pe.type)}return X}function T(D){var X;const Z=D.name.value,z=(X=VS[Z])!==null&&X!==void 0?X:f[Z];if(z===void 0)throw new Error(`Unknown type: "${Z}".`);return z}function L(D){return D.kind===ne.LIST_TYPE?new pr(L(D.type)):D.kind===ne.NON_NULL_TYPE?new It(L(D.type)):T(D)}function S(D){var X;return new Vo({name:D.name.value,description:(X=D.description)===null||X===void 0?void 0:X.value,locations:D.locations.map(({value:Z})=>Z),isRepeatable:D.repeatable,args:N(D.arguments),astNode:D})}function C(D){const X=Object.create(null);for(const le of D){var Z;const pe=(Z=le.fields)!==null&&Z!==void 0?Z:[];for(const ve of pe){var z;X[ve.name.value]={type:L(ve.type),description:(z=ve.description)===null||z===void 0?void 0:z.value,args:N(ve.arguments),deprecationReason:gh(ve),astNode:ve}}}return X}function N(D){const X=D??[],Z=Object.create(null);for(const le of X){var z;const pe=L(le.type);Z[le.name.value]={type:pe,description:(z=le.description)===null||z===void 0?void 0:z.value,defaultValue:pa(le.defaultValue,pe),deprecationReason:gh(le),astNode:le}}return Z}function U(D){const X=Object.create(null);for(const le of D){var Z;const pe=(Z=le.fields)!==null&&Z!==void 0?Z:[];for(const ve of pe){var z;const je=L(ve.type);X[ve.name.value]={type:je,description:(z=ve.description)===null||z===void 0?void 0:z.value,defaultValue:pa(ve.defaultValue,je),deprecationReason:gh(ve),astNode:ve}}}return X}function K(D){const X=Object.create(null);for(const le of D){var Z;const pe=(Z=le.values)!==null&&Z!==void 0?Z:[];for(const ve of pe){var z;X[ve.name.value]={description:(z=ve.description)===null||z===void 0?void 0:z.value,deprecationReason:gh(ve),astNode:ve}}}return X}function $(D){return D.flatMap(X=>{var Z,z;return(Z=(z=X.interfaces)===null||z===void 0?void 0:z.map(T))!==null&&Z!==void 0?Z:[]})}function q(D){return D.flatMap(X=>{var Z,z;return(Z=(z=X.types)===null||z===void 0?void 0:z.map(T))!==null&&Z!==void 0?Z:[]})}function j(D){var X;const Z=D.name.value,z=(X=c[Z])!==null&&X!==void 0?X:[];switch(D.kind){case ne.OBJECT_TYPE_DEFINITION:{var le;const Ye=[D,...z];return new ri({name:Z,description:(le=D.description)===null||le===void 0?void 0:le.value,interfaces:()=>$(Ye),fields:()=>C(Ye),astNode:D,extensionASTNodes:z})}case ne.INTERFACE_TYPE_DEFINITION:{var pe;const Ye=[D,...z];return new jv({name:Z,description:(pe=D.description)===null||pe===void 0?void 0:pe.value,interfaces:()=>$(Ye),fields:()=>C(Ye),astNode:D,extensionASTNodes:z})}case ne.ENUM_TYPE_DEFINITION:{var ve;const Ye=[D,...z];return new Fd({name:Z,description:(ve=D.description)===null||ve===void 0?void 0:ve.value,values:K(Ye),astNode:D,extensionASTNodes:z})}case ne.UNION_TYPE_DEFINITION:{var je;const Ye=[D,...z];return new Jc({name:Z,description:(je=D.description)===null||je===void 0?void 0:je.value,types:()=>q(Ye),astNode:D,extensionASTNodes:z})}case ne.SCALAR_TYPE_DEFINITION:{var ct;return new Gs({name:Z,description:(ct=D.description)===null||ct===void 0?void 0:ct.value,specifiedByURL:HS(D),astNode:D,extensionASTNodes:z})}case ne.INPUT_OBJECT_TYPE_DEFINITION:{var ut;const Ye=[D,...z];return new Uv({name:Z,description:(ut=D.description)===null||ut===void 0?void 0:ut.value,fields:()=>U(Ye),astNode:D,extensionASTNodes:z,isOneOf:cH(D)})}}}}const VS=Va([...rw,...sw],t=>t.name);function gh(t){const e=$d(Dk,t);return e==null?void 0:e.reason}function HS(t){const e=$d(Rk,t);return e==null?void 0:e.url}function cH(t){return!!$d(Nk,t)}function uH(t,e){t!=null&&t.kind===ne.DOCUMENT||Gt(!1,"Must provide valid Document AST."),(e==null?void 0:e.assumeValid)!==!0&&(e==null?void 0:e.assumeValidSDL)!==!0&&oH(t);const r=aH({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},t,e);if(r.astNode==null)for(const s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}const i=[...r.directives,...Gu.filter(s=>r.directives.every(o=>o.name!==s.name))];return new Kz({...r,directives:i})}function lH(t,e){const n=hk(t,{noLocation:void 0,allowLegacyFragmentVariables:void 0});return uH(n,{assumeValidSDL:void 0,assumeValid:void 0})}const lw=JSON,dH=t=>t.toUpperCase(),fH=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},hH=(t,e,n)=>t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0},pH=(t,e,n)=>t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0},mH=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0},WS=t=>{var r,i;let e;const n=t.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(e=(i=(r=n[0])==null?void 0:r.name)==null?void 0:i.value),e},Oy=t=>{if(typeof t=="string"){let n;try{const r=hk(t);n=WS(r)}catch{}return{query:t,operationName:n}}const e=WS(t);return{query:jn(t),operationName:e}};class Xc extends Error{constructor(e,n){const r=`${Xc.extractMessage(e)}: ${JSON.stringify({response:e,request:n})}`;super(r),Object.setPrototypeOf(this,Xc.prototype),this.response=e,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Xc)}static extractMessage(e){var n,r;return((r=(n=e.errors)==null?void 0:n[0])==null?void 0:r.message)??`GraphQL Error (Code: ${e.status})`}}var Hv={exports:{}};(function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof rr<"u"&&rr,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof rr<"u"&&rr||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(C){return C&&DataView.prototype.isPrototypeOf(C)}if(c.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(C){return C&&l.indexOf(Object.prototype.toString.call(C))>-1};function f(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(C)||C==="")throw new TypeError('Invalid character in header field name: "'+C+'"');return C.toLowerCase()}function h(C){return typeof C!="string"&&(C=String(C)),C}function m(C){var N={next:function(){var U=C.shift();return{done:U===void 0,value:U}}};return c.iterable&&(N[Symbol.iterator]=function(){return N}),N}function p(C){this.map={},C instanceof p?C.forEach(function(N,U){this.append(U,N)},this):Array.isArray(C)?C.forEach(function(N){if(N.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+N.length);this.append(N[0],N[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(N){this.append(N,C[N])},this)}p.prototype.append=function(C,N){C=f(C),N=h(N);var U=this.map[C];this.map[C]=U?U+", "+N:N},p.prototype.delete=function(C){delete this.map[f(C)]},p.prototype.get=function(C){return C=f(C),this.has(C)?this.map[C]:null},p.prototype.has=function(C){return this.map.hasOwnProperty(f(C))},p.prototype.set=function(C,N){this.map[f(C)]=h(N)},p.prototype.forEach=function(C,N){for(var U in this.map)this.map.hasOwnProperty(U)&&C.call(N,this.map[U],U,this)},p.prototype.keys=function(){var C=[];return this.forEach(function(N,U){C.push(U)}),m(C)},p.prototype.values=function(){var C=[];return this.forEach(function(N){C.push(N)}),m(C)},p.prototype.entries=function(){var C=[];return this.forEach(function(N,U){C.push([U,N])}),m(C)},c.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function g(C){if(!C._noBody){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}}function y(C){return new Promise(function(N,U){C.onload=function(){N(C.result)},C.onerror=function(){U(C.error)}})}function v(C){var N=new FileReader,U=y(N);return N.readAsArrayBuffer(C),U}function b(C){var N=new FileReader,U=y(N),K=/charset=([A-Za-z0-9_-]+)/.exec(C.type),$=K?K[1]:"utf-8";return N.readAsText(C,$),U}function E(C){for(var N=new Uint8Array(C),U=new Array(N.length),K=0;K<N.length;K++)U[K]=String.fromCharCode(N[K]);return U.join("")}function w(C){if(C.slice)return C.slice(0);var N=new Uint8Array(C.byteLength);return N.set(new Uint8Array(C)),N.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(C){this.bodyUsed=this.bodyUsed,this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:c.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:c.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():c.arrayBuffer&&c.blob&&u(C)?(this._bodyArrayBuffer=w(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||d(C))?this._bodyArrayBuffer=w(C):this._bodyText=C=Object.prototype.toString.call(C):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var C=g(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var C=g(this);return C||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(v);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var C=g(this);if(C)return C;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(C){var N=C.toUpperCase();return _.indexOf(N)>-1?N:C}function R(C,N){if(!(this instanceof R))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');N=N||{};var U=N.body;if(C instanceof R){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,N.headers||(this.headers=new p(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!U&&C._bodyInit!=null&&(U=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new p(N.headers)),this.method=k(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal||function(){if("AbortController"in a){var q=new AbortController;return q.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(N.cache==="no-store"||N.cache==="no-cache")){var K=/([?&])_=[^&]*/;if(K.test(this.url))this.url=this.url.replace(K,"$1_="+new Date().getTime());else{var $=/\?/;this.url+=($.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}R.prototype.clone=function(){return new R(this,{body:this._bodyInit})};function F(C){var N=new FormData;return C.trim().split("&").forEach(function(U){if(U){var K=U.split("="),$=K.shift().replace(/\+/g," "),q=K.join("=").replace(/\+/g," ");N.append(decodeURIComponent($),decodeURIComponent(q))}}),N}function V(C){var N=new p,U=C.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(K){return K.indexOf(`
|
|
147
|
-
`)===0?K.substr(1,K.length):K}).forEach(function(K){var $=K.split(":"),q=$.shift().trim();if(q){var j=$.join(":").trim();try{N.append(q,j)}catch(D){console.warn("Response "+D.message)}}}),N}x.call(R.prototype);function T(C,N){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=N.statusText===void 0?"":""+N.statusText,this.headers=new p(N.headers),this.url=N.url||"",this._initBody(C)}x.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},T.error=function(){var C=new T(null,{status:200,statusText:""});return C.ok=!1,C.status=0,C.type="error",C};var L=[301,302,303,307,308];T.redirect=function(C,N){if(L.indexOf(N)===-1)throw new RangeError("Invalid status code");return new T(null,{status:N,headers:{location:C}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(N,U){this.message=N,this.name=U;var K=Error(N);this.stack=K.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function S(C,N){return new Promise(function(U,K){var $=new R(C,N);if($.signal&&$.signal.aborted)return K(new o.DOMException("Aborted","AbortError"));var q=new XMLHttpRequest;function j(){q.abort()}q.onload=function(){var Z={statusText:q.statusText,headers:V(q.getAllResponseHeaders()||"")};$.url.indexOf("file://")===0&&(q.status<200||q.status>599)?Z.status=200:Z.status=q.status,Z.url="responseURL"in q?q.responseURL:Z.headers.get("X-Request-URL");var z="response"in q?q.response:q.responseText;setTimeout(function(){U(new T(z,Z))},0)},q.onerror=function(){setTimeout(function(){K(new TypeError("Network request failed"))},0)},q.ontimeout=function(){setTimeout(function(){K(new TypeError("Network request timed out"))},0)},q.onabort=function(){setTimeout(function(){K(new o.DOMException("Aborted","AbortError"))},0)};function D(Z){try{return Z===""&&a.location.href?a.location.href:Z}catch{return Z}}if(q.open($.method,D($.url),!0),$.credentials==="include"?q.withCredentials=!0:$.credentials==="omit"&&(q.withCredentials=!1),"responseType"in q&&(c.blob?q.responseType="blob":c.arrayBuffer&&(q.responseType="arraybuffer")),N&&typeof N.headers=="object"&&!(N.headers instanceof p||a.Headers&&N.headers instanceof a.Headers)){var X=[];Object.getOwnPropertyNames(N.headers).forEach(function(Z){X.push(f(Z)),q.setRequestHeader(Z,h(N.headers[Z]))}),$.headers.forEach(function(Z,z){X.indexOf(z)===-1&&q.setRequestHeader(z,Z)})}else $.headers.forEach(function(Z,z){q.setRequestHeader(z,Z)});$.signal&&($.signal.addEventListener("abort",j),q.onreadystatechange=function(){q.readyState===4&&$.signal.removeEventListener("abort",j)}),q.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return S.polyfill=!0,a.fetch||(a.fetch=S,a.Headers=p,a.Request=R,a.Response=T),o.Headers=p,o.Request=R,o.Response=T,o.fetch=S,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(Hv,Hv.exports);var Vp=Hv.exports;const Gh=tc(Vp),gH=kP({__proto__:null,default:Gh},[Vp]),Tc=t=>{let e={};return t&&(typeof Headers<"u"&&t instanceof Headers||gH&&Vp.Headers&&t instanceof Vp.Headers?e=fH(t):Array.isArray(t)?t.forEach(([n,r])=>{n&&r!==void 0&&(e[n]=r)}):e=t),e},qS=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),yH=t=>{if(!Array.isArray(t.query)){const r=t,i=[`query=${encodeURIComponent(qS(r.query))}`];return t.variables&&i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`),r.operationName&&i.push(`operationName=${encodeURIComponent(r.operationName)}`),i.join("&")}if(typeof t.variables<"u"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");const e=t,n=t.query.reduce((r,i,s)=>(r.push({query:qS(i),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),r),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`},vH=t=>async e=>{const{url:n,query:r,variables:i,operationName:s,fetch:o,fetchOptions:a,middleware:c}=e,u={...e.headers};let l="",d;t==="POST"?(d=_H(r,i,s,a.jsonSerializer),typeof d=="string"&&(u["Content-Type"]="application/json")):l=yH({query:r,variables:i,operationName:s,jsonSerializer:a.jsonSerializer??lw});const f={method:t,headers:u,body:d,...a};let h=n,m=f;if(c){const p=await Promise.resolve(c({...f,url:n,operationName:s,variables:i})),{url:g,...y}=p;h=g,m=y}return l&&(h=`${h}?${l}`),await o(h,m)};class bH{constructor(e,n={}){this.url=e,this.requestConfig=n,this.rawRequest=async(...r)=>{const[i,s,o]=r,a=pH(i,s,o),{headers:c,fetch:u=Gh,method:l="POST",requestMiddleware:d,responseMiddleware:f,...h}=this.requestConfig,{url:m}=this;a.signal!==void 0&&(h.signal=a.signal);const{operationName:p}=Oy(a.query);return Cy({url:m,query:a.query,variables:a.variables,headers:{...Tc(ky(c)),...Tc(a.requestHeaders)},operationName:p,fetch:u,method:l,fetchOptions:h,middleware:d}).then(g=>(f&&f(g),g)).catch(g=>{throw f&&f(g),g})}}async request(e,...n){const[r,i]=n,s=hH(e,r,i),{headers:o,fetch:a=Gh,method:c="POST",requestMiddleware:u,responseMiddleware:l,...d}=this.requestConfig,{url:f}=this;s.signal!==void 0&&(d.signal=s.signal);const{query:h,operationName:m}=Oy(s.document);return Cy({url:f,query:h,variables:s.variables,headers:{...Tc(ky(o)),...Tc(s.requestHeaders)},operationName:m,fetch:a,method:c,fetchOptions:d,middleware:u}).then(p=>(l&&l(p),p.data)).catch(p=>{throw l&&l(p),p})}batchRequests(e,n){const r=mH(e,n),{headers:i,...s}=this.requestConfig;r.signal!==void 0&&(s.signal=r.signal);const o=r.documents.map(({document:c})=>Oy(c).query),a=r.documents.map(({variables:c})=>c);return Cy({url:this.url,query:o,variables:a,headers:{...Tc(ky(i)),...Tc(r.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Gh,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(c=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c.data)).catch(c=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,n){const{headers:r}=this.requestConfig;return r?r[e]=n:this.requestConfig.headers={[e]:n},this}setEndpoint(e){return this.url=e,this}}const Cy=async t=>{const{query:e,variables:n,fetchOptions:r}=t,i=vH(dH(t.method??"post")),s=Array.isArray(t.query),o=await i(t),a=await wH(o,r.jsonSerializer??lw),c=Array.isArray(a)?!a.some(({data:l})=>!l):!!a.data,u=Array.isArray(a)||!a.errors||Array.isArray(a.errors)&&!a.errors.length||r.errorPolicy==="all"||r.errorPolicy==="ignore";if(o.ok&&u&&c){const{errors:l,...d}=(Array.isArray(a),a),f=r.errorPolicy==="ignore"?d:a;return{...s?{data:f}:f,headers:o.headers,status:o.status}}else{const l=typeof a=="string"?{error:a}:a;throw new Xc({...l,status:o.status,headers:o.headers},{query:e,variables:n})}},_H=(t,e,n,r)=>{const i=r??lw;if(!Array.isArray(t))return i.stringify({query:t,variables:e,operationName:n});if(typeof e<"u"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");const s=t.reduce((o,a,c)=>(o.push({query:a,variables:e?e[c]:void 0}),o),[]);return i.stringify(s)},wH=async(t,e)=>{let n;return t.headers.forEach((r,i)=>{i.toLowerCase()==="content-type"&&(n=r)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},ky=t=>typeof t=="function"?t():t,Qc=(t,...e)=>t.reduce((n,r,i)=>`${n}${r}${i in e?String(e[i]):""}`,"");var Hi;class EH{constructor(){bt(this,Hi,console);Ve(this,"log",(...e)=>ce(this,Hi).log(...e));Ve(this,"info",(...e)=>ce(this,Hi).info(...e));Ve(this,"warn",(...e)=>ce(this,Hi).warn(...e));Ve(this,"error",(...e)=>ce(this,Hi).error(...e));Ve(this,"debug",(...e)=>ce(this,Hi).debug(...e));Ve(this,"trace",(...e)=>ce(this,Hi).trace(...e));this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.trace=this.trace.bind(this)}set logger(e){ht(this,Hi,e)}}Hi=new WeakMap;const Yk=new EH,_t=Yk,SH=t=>Yk.logger=t;async function eu(...t){const[e,...n]=t,r=new bH(e,{fetch}),{errors:i,...s}=await r.request(...n),o={...s};return i!=null&&i.length&&(o.errors=i.map(({message:a,...c})=>new Ie(a,c))),o}function Zh(t){return t instanceof ri?Object.entries(t.getFields()).map(([e,n])=>{const r=n.type instanceof It?n.type.ofType:n.type;if(r instanceof ri||r instanceof Jc)return`${e} { ${Zh(r)} }`;if(r instanceof pr){const i=r.ofType instanceof It?r.ofType.ofType:r.ofType;if(i instanceof Gs)return e;if(i instanceof ri||i instanceof Jc)return`${e} { ${Zh(i)} }`;throw new Error(`List item type ${i.toString()} is not handled`)}return e}).join(" "):t instanceof Jc?t.getTypes().map(e=>`... on ${e.name} { ${Zh(e)} }`).join(" "):""}function xH(t,e){const n=rk(t.name),r=t.specifications.at(-1);if(!r)throw new Error("No document model specification found");const i=`${r.state.global.schema} type Query { ${n}: ${n}State }`,o=lH(i).getQueryType();if(!o)throw new Error("No query type found");const c=o.getFields()[n];if(!c)throw new Error("No state query found");return Zh(c.type)}async function ma(t){var n,r;let e;try{const i=await eu(t,Qc`
|
|
148
|
-
query getDrive {
|
|
149
|
-
drive {
|
|
150
|
-
id
|
|
151
|
-
name
|
|
152
|
-
icon
|
|
153
|
-
slug
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
`);if((n=i.errors)!=null&&n.length||!i.drive)throw((r=i.errors)==null?void 0:r.at(0))??new Error("Drive not found");e=i.drive}catch(i){throw _t.error(i),new Error("Couldn't find drive info")}return e}async function GS(t,e,n){const{documentModel:r,utils:i}=n,s=xH(r),o=rk(r.name),a=await eu(t,Qc`
|
|
157
|
-
query ($id: String!) {
|
|
158
|
-
document(id: $id) {
|
|
159
|
-
id
|
|
160
|
-
name
|
|
161
|
-
created
|
|
162
|
-
documentType
|
|
163
|
-
lastModified
|
|
164
|
-
revision
|
|
165
|
-
operations {
|
|
166
|
-
id
|
|
167
|
-
error
|
|
168
|
-
hash
|
|
169
|
-
index
|
|
170
|
-
skip
|
|
171
|
-
timestamp
|
|
172
|
-
type
|
|
173
|
-
inputText
|
|
174
|
-
context {
|
|
175
|
-
signer {
|
|
176
|
-
user {
|
|
177
|
-
address
|
|
178
|
-
networkId
|
|
179
|
-
chainId
|
|
180
|
-
}
|
|
181
|
-
app {
|
|
182
|
-
name
|
|
183
|
-
key
|
|
184
|
-
}
|
|
185
|
-
signatures
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
... on ${o} {
|
|
190
|
-
state {
|
|
191
|
-
${s}
|
|
192
|
-
}
|
|
193
|
-
initialState {
|
|
194
|
-
${s}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
`,{id:e}),c=a.document?{...a.document,revision:{global:a.document.revision,local:0},state:i.createState({global:a.document.state}),operations:{global:a.document.operations.map(({inputText:u,...l})=>({...l,error:l.error??void 0,scope:"global",input:JSON.parse(u)})),local:[]},attachments:{},initialState:i.createExtendedState({created:a.document.created,lastModified:a.document.created,state:i.createState({global:a.document.initialState})}),clipboard:[]}:null;return{...a,document:c}}function TH(t){const{open:e,groupSharingType:n,onAddRemoteDrive:r,onClose:i}=t;async function s(o){await r(o),i()}return P(O4,{open:e,onSubmit:s,sharingType:n,onOpenChange:o=>{if(!o)return i()},requestPublicDrive:ma})}const IH=t=>{const{open:e,onClose:n,onCancel:r,title:i,body:s,cancelLabel:o,continueLabel:a,onContinue:c}=t;return P(D_,{open:e,onCancel:()=>r(n),header:i,body:s,cancelLabel:o,continueLabel:a,onContinue:()=>c(n),onOpenChange:u=>{if(!u)return n()}})},OH=t=>{const{open:e,onClose:n}=t,{t:r}=nc();return P(TO,{open:e,header:r("modals.cookiesPolicy.title"),body:P(XT,{i18nKey:"modals.cookiesPolicy.body",components:{subtitle:P("h2",{className:"mb-4 text-lg font-bold"}),p:P("p",{className:"mb-2"}),list:P("ul",{className:"mb-4 list-disc pl-6"}),bullet:P("li",{})}}),bodyProps:{className:"text-left"},closeLabel:"Close",onContinue:()=>n(),overlayProps:{style:{zIndex:1e4}}})};var CH=Object.defineProperty,kH=(t,e,n)=>e in t?CH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,DH=(t,e,n)=>kH(t,e+"",n),Ut;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ut||(Ut={}));var Wv;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Wv||(Wv={}));const Le=Ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ks=t=>{switch(typeof t){case"undefined":return Le.undefined;case"string":return Le.string;case"number":return isNaN(t)?Le.nan:Le.number;case"boolean":return Le.boolean;case"function":return Le.function;case"bigint":return Le.bigint;case"symbol":return Le.symbol;case"object":return Array.isArray(t)?Le.array:t===null?Le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Le.promise:typeof Map<"u"&&t instanceof Map?Le.map:typeof Set<"u"&&t instanceof Set?Le.set:typeof Date<"u"&&t instanceof Date?Le.date:Le.object;default:return Le.unknown}},Te=Ut.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),RH=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");let Ii=class Kk extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),r}static assert(e){if(!(e instanceof Kk))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ut.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Ii.create=t=>new Ii(t);const Su=(t,e)=>{let n;switch(t.code){case Te.invalid_type:t.received===Le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ut.jsonStringifyReplacer)}`;break;case Te.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ut.joinValues(t.keys,", ")}`;break;case Te.invalid_union:n="Invalid input";break;case Te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ut.joinValues(t.options)}`;break;case Te.invalid_enum_value:n=`Invalid enum value. Expected ${Ut.joinValues(t.options)}, received '${t.received}'`;break;case Te.invalid_arguments:n="Invalid function arguments";break;case Te.invalid_return_type:n="Invalid function return type";break;case Te.invalid_date:n="Invalid date";break;case Te.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ut.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Te.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Te.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Te.custom:n="Invalid input";break;case Te.invalid_intersection_types:n="Intersection results could not be merged";break;case Te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Te.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ut.assertNever(t)}return{message:n}};let Jk=Su;function NH(t){Jk=t}function Hp(){return Jk}const Wp=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},AH=[];function Ae(t,e){const n=Hp(),r=Wp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Su?void 0:Su].filter(i=>!!i)});t.common.issues.push(r)}let Dr=class Xk{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return dt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return Xk.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return dt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}};const dt=Object.freeze({status:"aborted"}),qp=t=>({status:"dirty",value:t}),br=t=>({status:"valid",value:t}),qv=t=>t.status==="aborted",Gv=t=>t.status==="dirty",Wa=t=>t.status==="valid",jd=t=>typeof Promise<"u"&&t instanceof Promise;function Gp(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Qk(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ze||(Ze={}));var Rl,Nl;let fs=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const ZS=(t,e)=>{if(Wa(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ii(t.common.issues);return this._error=n,this._error}}};function gt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{var a,c;const{message:u}=t;return s.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:(a=u??r)!==null&&a!==void 0?a:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:o.defaultError}},description:i}}class Et{get description(){return this._def.description}_getType(e){return ks(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ks(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Dr,ctx:{common:e.parent.common,data:e.data,parsedType:ks(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(jd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)},s=this._parseSync({data:e,path:i.path,parent:i});return ZS(i,s)}"~validate"(e){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:i});return Wa(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>Wa(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(jd(i)?i:Promise.resolve(i));return ZS(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Te.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Ai({schema:this,typeName:at.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ss.create(this,this._def)}nullable(){return Wo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qa.create(this)}promise(){return Iu.create(this,this._def)}or(e){return qd.create([this,e],this._def)}and(e){return Gd.create(this,e,this._def)}transform(e){return new Ai({...gt(this._def),schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Jd({...gt(this._def),innerType:this,defaultValue:n,typeName:at.ZodDefault})}brand(){return new dw({typeName:at.ZodBranded,type:this,...gt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Xd({...gt(this._def),innerType:this,catchValue:n,typeName:at.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return fw.create(this,e)}readonly(){return Qd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const PH=/^c[^\s-]{8,}$/i,MH=/^[0-9a-z]+$/,LH=/^[0-9A-HJKMNP-TV-Z]{26}$/i,FH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$H=/^[a-z0-9_-]{21}$/i,jH=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,UH=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,BH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Dy;const VH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,HH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,WH=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qH=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZH=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,eD="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",YH=new RegExp(`^${eD}$`);function tD(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function KH(t){return new RegExp(`^${tD(t)}$`)}function nD(t){let e=`${eD}T${tD(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function JH(t,e){return!!((e==="v4"||!e)&&VH.test(t)||(e==="v6"||!e)&&WH.test(t))}function XH(t,e){if(!jH.test(t))return!1;try{const[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function QH(t,e){return!!((e==="v4"||!e)&&HH.test(t)||(e==="v6"||!e)&&qH.test(t))}let xu=class Al extends Et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Le.string){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_type,expected:Le.string,received:i.parsedType}),dt}const n=new Dr;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(r=this._getOrReturnCtx(e,r),s?Ae(r,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Ae(r,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")BH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"email",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Dy||(Dy=new RegExp(zH,"u")),Dy.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"emoji",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")FH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"uuid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")$H.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"nanoid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")PH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"cuid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")MH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"cuid2",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")LH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"ulid",code:Te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Ae(r,{validation:"url",code:Te.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"regex",code:Te.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?nD(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?YH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?KH(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?UH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"duration",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?JH(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"ip",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?XH(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"jwt",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?QH(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"cidr",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?GH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"base64",code:Te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?ZH.test(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{validation:"base64url",code:Te.invalid_string,message:i.message}),n.dirty()):Ut.assertNever(i);return{status:n.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Te.invalid_string,...Ze.errToObj(r)})}_addCheck(e){return new Al({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ze.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Ze.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ze.errToObj(n)})}nonempty(e){return this.min(1,Ze.errToObj(e))}trim(){return new Al({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Al({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Al({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};xu.create=t=>{var e;return new xu({checks:[],typeName:at.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...gt(t)})};function e7(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}let Ud=class Zv extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Le.number){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_type,expected:Le.number,received:i.parsedType}),dt}let n;const r=new Dr;for(const i of this._def.checks)i.kind==="int"?Ut.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?e7(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.not_finite,message:i.message}),r.dirty()):Ut.assertNever(i);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,i){return new Zv({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(e){return new Zv({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ut.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Ud.create=t=>new Ud({checks:[],typeName:at.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});let Bd=class Yv extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Le.bigint)return this._getInvalidInput(e);let n;const r=new Dr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ae(n,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):Ut.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.bigint,received:n.parsedType}),dt}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,i){return new Yv({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(e){return new Yv({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Bd.create=t=>{var e;return new Bd({checks:[],typeName:at.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...gt(t)})};let zd=class extends Et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Le.boolean){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.boolean,received:n.parsedType}),dt}return br(e.data)}};zd.create=t=>new zd({typeName:at.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});let Vd=class rD extends Et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Le.date){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_type,expected:Le.date,received:i.parsedType}),dt}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ae(i,{code:Te.invalid_date}),dt}const n=new Dr;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:Te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ut.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rD({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ze.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Vd.create=t=>new Vd({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:at.ZodDate,...gt(t)});let Zp=class extends Et{_parse(e){if(this._getType(e)!==Le.symbol){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.symbol,received:n.parsedType}),dt}return br(e.data)}};Zp.create=t=>new Zp({typeName:at.ZodSymbol,...gt(t)});let Hd=class extends Et{_parse(e){if(this._getType(e)!==Le.undefined){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.undefined,received:n.parsedType}),dt}return br(e.data)}};Hd.create=t=>new Hd({typeName:at.ZodUndefined,...gt(t)});let Wd=class extends Et{_parse(e){if(this._getType(e)!==Le.null){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.null,received:n.parsedType}),dt}return br(e.data)}};Wd.create=t=>new Wd({typeName:at.ZodNull,...gt(t)});class Tu extends Et{constructor(){super(...arguments),this._any=!0}_parse(e){return br(e.data)}}Tu.create=t=>new Tu({typeName:at.ZodAny,...gt(t)});let Ca=class extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return br(e.data)}};Ca.create=t=>new Ca({typeName:at.ZodUnknown,...gt(t)});let Zs=class extends Et{_parse(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.never,received:n.parsedType}),dt}};Zs.create=t=>new Zs({typeName:at.ZodNever,...gt(t)});let Yp=class extends Et{_parse(e){if(this._getType(e)!==Le.undefined){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.void,received:n.parsedType}),dt}return br(e.data)}};Yp.create=t=>new Yp({typeName:at.ZodVoid,...gt(t)});let qa=class Yh extends Et{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Le.array)return Ae(n,{code:Te.invalid_type,expected:Le.array,received:n.parsedType}),dt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ae(n,{code:o?Te.too_big:Te.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:Te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:Te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new fs(n,o,n.path,a)))).then(o=>Dr.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new fs(n,o,n.path,a)));return Dr.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Yh({...this._def,minLength:{value:e,message:Ze.toString(n)}})}max(e,n){return new Yh({...this._def,maxLength:{value:e,message:Ze.toString(n)}})}length(e,n){return new Yh({...this._def,exactLength:{value:e,message:Ze.toString(n)}})}nonempty(e){return this.min(1,e)}};qa.create=(t,e)=>new qa({type:t,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray,...gt(e)});function Ac(t){if(t instanceof si){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ss.create(Ac(r))}return new si({...t._def,shape:()=>e})}else return t instanceof qa?new qa({...t._def,type:Ac(t.element)}):t instanceof ss?ss.create(Ac(t.unwrap())):t instanceof Wo?Wo.create(Ac(t.unwrap())):t instanceof Ho?Ho.create(t.items.map(e=>Ac(e))):t}let si=class li extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ut.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Le.object){const c=this._getOrReturnCtx(e);return Ae(c,{code:Te.invalid_type,expected:Le.object,received:c.parsedType}),dt}const{status:n,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Zs&&this._def.unknownKeys==="strip"))for(const c in r.data)s.includes(c)||o.push(c);const a=[];for(const c of s){const u=i[c],l=r.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new fs(r,l,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Zs){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)a.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")o.length>0&&(Ae(r,{code:Te.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const l=r.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new fs(r,l,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of a){const l=await u.key,d=await u.value;c.push({key:l,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>Dr.mergeObjectSync(n,c)):Dr.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Ze.errToObj,new li({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ze.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new li({...this._def,unknownKeys:"strip"})}passthrough(){return new li({...this._def,unknownKeys:"passthrough"})}extend(e){return new li({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new li({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:at.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new li({...this._def,catchall:e})}pick(e){const n={};return Ut.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new li({...this._def,shape:()=>n})}omit(e){const n={};return Ut.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new li({...this._def,shape:()=>n})}deepPartial(){return Ac(this)}partial(e){const n={};return Ut.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new li({...this._def,shape:()=>n})}required(e){const n={};return Ut.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ss;)i=i._def.innerType;n[r]=i}}),new li({...this._def,shape:()=>n})}keyof(){return uD(Ut.objectKeys(this.shape))}};si.create=(t,e)=>new si({shape:()=>t,unknownKeys:"strip",catchall:Zs.create(),typeName:at.ZodObject,...gt(e)});si.strictCreate=(t,e)=>new si({shape:()=>t,unknownKeys:"strict",catchall:Zs.create(),typeName:at.ZodObject,...gt(e)});si.lazycreate=(t,e)=>new si({shape:t,unknownKeys:"strip",catchall:Zs.create(),typeName:at.ZodObject,...gt(e)});let qd=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Ii(a.ctx.common.issues));return Ae(n,{code:Te.invalid_union,unionErrors:o}),dt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Ii(c));return Ae(n,{code:Te.invalid_union,unionErrors:a}),dt}}get options(){return this._def.options}};qd.create=(t,e)=>new qd({options:t,typeName:at.ZodUnion,...gt(e)});const fo=t=>t instanceof Zd?fo(t.schema):t instanceof Ai?fo(t.innerType()):t instanceof Yd?[t.value]:t instanceof If?t.options:t instanceof Kd?Ut.objectValues(t.enum):t instanceof Jd?fo(t._def.innerType):t instanceof Hd?[void 0]:t instanceof Wd?[null]:t instanceof ss?[void 0,...fo(t.unwrap())]:t instanceof Wo?[null,...fo(t.unwrap())]:t instanceof dw||t instanceof Qd?fo(t.unwrap()):t instanceof Xd?fo(t._def.innerType):[];let iD=class sD extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Le.object)return Ae(n,{code:Te.invalid_type,expected:Le.object,received:n.parsedType}),dt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:Te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=fo(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new sD({typeName:at.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...gt(r)})}};function Kv(t,e){const n=ks(t),r=ks(e);if(t===e)return{valid:!0,data:t};if(n===Le.object&&r===Le.object){const i=Ut.objectKeys(e),s=Ut.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=Kv(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===Le.array&&r===Le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=Kv(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Le.date&&r===Le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}let Gd=class extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(qv(s)||qv(o))return dt;const a=Kv(s.value,o.value);return a.valid?((Gv(s)||Gv(o))&&n.dirty(),{status:n.value,value:a.data}):(Ae(r,{code:Te.invalid_intersection_types}),dt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Gd.create=(t,e,n)=>new Gd({left:t,right:e,typeName:at.ZodIntersection,...gt(n)});let Ho=class oD extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.array)return Ae(r,{code:Te.invalid_type,expected:Le.array,received:r.parsedType}),dt;if(r.data.length<this._def.items.length)return Ae(r,{code:Te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dt;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:Te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new fs(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Dr.mergeArray(n,s)):Dr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new oD({...this._def,rest:e})}};Ho.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ho({items:t,typeName:at.ZodTuple,rest:null,...gt(e)})};let aD=class Jv extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.object)return Ae(r,{code:Te.invalid_type,expected:Le.object,received:r.parsedType}),dt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new fs(r,a,r.path,a)),value:o._parse(new fs(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Dr.mergeObjectAsync(n,i):Dr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Et?new Jv({keyType:e,valueType:n,typeName:at.ZodRecord,...gt(r)}):new Jv({keyType:xu.create(),valueType:e,typeName:at.ZodRecord,...gt(n)})}},Kp=class extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.map)return Ae(r,{code:Te.invalid_type,expected:Le.map,received:r.parsedType}),dt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],u)=>({key:i._parse(new fs(r,a,r.path,[u,"key"])),value:s._parse(new fs(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return dt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return dt;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}}}};Kp.create=(t,e,n)=>new Kp({valueType:e,keyType:t,typeName:at.ZodMap,...gt(n)});let Jp=class Xv extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Le.set)return Ae(r,{code:Te.invalid_type,expected:Le.set,received:r.parsedType}),dt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ae(r,{code:Te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ae(r,{code:Te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const l of c){if(l.status==="aborted")return dt;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new fs(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new Xv({...this._def,minSize:{value:e,message:Ze.toString(n)}})}max(e,n){return new Xv({...this._def,maxSize:{value:e,message:Ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Jp.create=(t,e)=>new Jp({valueType:t,minSize:null,maxSize:null,typeName:at.ZodSet,...gt(e)});let cD=class Kh extends Et{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Le.function)return Ae(n,{code:Te.invalid_type,expected:Le.function,received:n.parsedType}),dt;function r(a,c){return Wp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Hp(),Su].filter(u=>!!u),issueData:{code:Te.invalid_arguments,argumentsError:c}})}function i(a,c){return Wp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Hp(),Su].filter(u=>!!u),issueData:{code:Te.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Iu){const a=this;return br(async function(...c){const u=new Ii([]),l=await a._def.args.parseAsync(c,s).catch(f=>{throw u.addIssue(r(c,f)),u}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw u.addIssue(i(d,f)),u})})}else{const a=this;return br(function(...c){const u=a._def.args.safeParse(c,s);if(!u.success)throw new Ii([r(c,u.error)]);const l=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Ii([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Kh({...this._def,args:Ho.create(e).rest(Ca.create())})}returns(e){return new Kh({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Kh({args:e||Ho.create([]).rest(Ca.create()),returns:n||Ca.create(),typeName:at.ZodFunction,...gt(r)})}},Zd=class extends Et{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Zd.create=(t,e)=>new Zd({getter:t,typeName:at.ZodLazy,...gt(e)});let Yd=class extends Et{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ae(n,{received:n.data,code:Te.invalid_literal,expected:this._def.value}),dt}return{status:"valid",value:e.data}}get value(){return this._def.value}};Yd.create=(t,e)=>new Yd({value:t,typeName:at.ZodLiteral,...gt(e)});function uD(t,e){return new If({values:t,typeName:at.ZodEnum,...gt(e)})}let If=class Qv extends Et{constructor(){super(...arguments),Rl.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{expected:Ut.joinValues(r),received:n.parsedType,code:Te.invalid_type}),dt}if(Gp(this,Rl)||Qk(this,Rl,new Set(this._def.values)),!Gp(this,Rl).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{received:n.data,code:Te.invalid_enum_value,options:r}),dt}return br(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Qv.create(e,{...this._def,...n})}exclude(e,n=this._def){return Qv.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Rl=new WeakMap;If.create=uD;let Kd=class extends Et{constructor(){super(...arguments),Nl.set(this,void 0)}_parse(e){const n=Ut.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Le.string&&r.parsedType!==Le.number){const i=Ut.objectValues(n);return Ae(r,{expected:Ut.joinValues(i),received:r.parsedType,code:Te.invalid_type}),dt}if(Gp(this,Nl)||Qk(this,Nl,new Set(Ut.getValidEnumValues(this._def.values))),!Gp(this,Nl).has(e.data)){const i=Ut.objectValues(n);return Ae(r,{received:r.data,code:Te.invalid_enum_value,options:i}),dt}return br(e.data)}get enum(){return this._def.values}};Nl=new WeakMap;Kd.create=(t,e)=>new Kd({values:t,typeName:at.ZodNativeEnum,...gt(e)});let Iu=class extends Et{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Le.promise&&n.common.async===!1)return Ae(n,{code:Te.invalid_type,expected:Le.promise,received:n.parsedType}),dt;const r=n.parsedType===Le.promise?n.data:Promise.resolve(n.data);return br(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Iu.create=(t,e)=>new Iu({type:t,typeName:at.ZodPromise,...gt(e)});let Ai=class extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return dt;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?dt:c.status==="dirty"||n.value==="dirty"?qp(c.value):c});{if(n.value==="aborted")return dt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?dt:a.status==="dirty"||n.value==="dirty"?qp(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?dt:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?dt:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Wa(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Wa(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);Ut.assertNever(i)}};Ai.create=(t,e,n)=>new Ai({schema:t,typeName:at.ZodEffects,effect:e,...gt(n)});Ai.createWithPreprocess=(t,e,n)=>new Ai({schema:e,effect:{type:"preprocess",transform:t},typeName:at.ZodEffects,...gt(n)});let ss=class extends Et{_parse(e){return this._getType(e)===Le.undefined?br(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ss.create=(t,e)=>new ss({innerType:t,typeName:at.ZodOptional,...gt(e)});let Wo=class extends Et{_parse(e){return this._getType(e)===Le.null?br(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Wo.create=(t,e)=>new Wo({innerType:t,typeName:at.ZodNullable,...gt(e)});let Jd=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Le.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Jd.create=(t,e)=>new Jd({innerType:t,typeName:at.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...gt(e)});let Xd=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return jd(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ii(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ii(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Xd.create=(t,e)=>new Xd({innerType:t,typeName:at.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...gt(e)});let Xp=class extends Et{_parse(e){if(this._getType(e)!==Le.nan){const n=this._getOrReturnCtx(e);return Ae(n,{code:Te.invalid_type,expected:Le.nan,received:n.parsedType}),dt}return{status:"valid",value:e.data}}};Xp.create=t=>new Xp({typeName:at.ZodNaN,...gt(t)});const t7=Symbol("zod_brand");let dw=class extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},fw=class lD extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?dt:i.status==="dirty"?(n.dirty(),qp(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?dt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new lD({in:e,out:n,typeName:at.ZodPipeline})}},Qd=class extends Et{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Wa(i)&&(i.value=Object.freeze(i.value)),i);return jd(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Qd.create=(t,e)=>new Qd({innerType:t,typeName:at.ZodReadonly,...gt(e)});function dD(t,e={},n){return t?Tu.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):Tu.create()}const n7={object:si.lazycreate};var at;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(at||(at={}));const r7=(t,e={message:`Input not instance of ${t.name}`})=>dD(n=>n instanceof t,e),fD=xu.create,hD=Ud.create,i7=Xp.create,s7=Bd.create,pD=zd.create,o7=Vd.create,a7=Zp.create,c7=Hd.create,u7=Wd.create,l7=Tu.create,d7=Ca.create,f7=Zs.create,h7=Yp.create,p7=qa.create,m7=si.create,g7=si.strictCreate,y7=qd.create,v7=iD.create,b7=Gd.create,_7=Ho.create,w7=aD.create,E7=Kp.create,S7=Jp.create,x7=cD.create,T7=Zd.create,I7=Yd.create,O7=If.create,C7=Kd.create,k7=Iu.create,YS=Ai.create,D7=ss.create,R7=Wo.create,N7=Ai.createWithPreprocess,A7=fw.create,P7=()=>fD().optional(),M7=()=>hD().optional(),L7=()=>pD().optional(),F7={string:t=>xu.create({...t,coerce:!0}),number:t=>Ud.create({...t,coerce:!0}),boolean:t=>zd.create({...t,coerce:!0}),bigint:t=>Bd.create({...t,coerce:!0}),date:t=>Vd.create({...t,coerce:!0})},$7=dt;var ge=Object.freeze({__proto__:null,defaultErrorMap:Su,setErrorMap:NH,getErrorMap:Hp,makeIssue:Wp,EMPTY_PATH:AH,addIssueToContext:Ae,ParseStatus:Dr,INVALID:dt,DIRTY:qp,OK:br,isAborted:qv,isDirty:Gv,isValid:Wa,isAsync:jd,get util(){return Ut},get objectUtil(){return Wv},ZodParsedType:Le,getParsedType:ks,ZodType:Et,datetimeRegex:nD,ZodString:xu,ZodNumber:Ud,ZodBigInt:Bd,ZodBoolean:zd,ZodDate:Vd,ZodSymbol:Zp,ZodUndefined:Hd,ZodNull:Wd,ZodAny:Tu,ZodUnknown:Ca,ZodNever:Zs,ZodVoid:Yp,ZodArray:qa,ZodObject:si,ZodUnion:qd,ZodDiscriminatedUnion:iD,ZodIntersection:Gd,ZodTuple:Ho,ZodRecord:aD,ZodMap:Kp,ZodSet:Jp,ZodFunction:cD,ZodLazy:Zd,ZodLiteral:Yd,ZodEnum:If,ZodNativeEnum:Kd,ZodPromise:Iu,ZodEffects:Ai,ZodTransformer:Ai,ZodOptional:ss,ZodNullable:Wo,ZodDefault:Jd,ZodCatch:Xd,ZodNaN:Xp,BRAND:t7,ZodBranded:dw,ZodPipeline:fw,ZodReadonly:Qd,custom:dD,Schema:Et,ZodSchema:Et,late:n7,get ZodFirstPartyTypeKind(){return at},coerce:F7,any:l7,array:p7,bigint:s7,boolean:pD,date:o7,discriminatedUnion:v7,effect:YS,enum:O7,function:x7,instanceof:r7,intersection:b7,lazy:T7,literal:I7,map:E7,nan:i7,nativeEnum:C7,never:f7,null:u7,nullable:R7,number:hD,object:m7,oboolean:L7,onumber:M7,optional:D7,ostring:P7,pipeline:A7,preprocess:N7,promise:k7,record:w7,set:S7,strictObject:g7,string:fD,symbol:a7,transformer:YS,tuple:_7,undefined:c7,union:y7,unknown:d7,void:h7,NEVER:$7,ZodIssueCode:Te,quotelessJson:RH,ZodError:Ii});const j7=t=>t!=null;ge.any().refine(t=>j7(t));function mD(){return ge.object({end:ge.string()})}function gD(){return ge.object({id:ge.string()})}function yD(){return ge.object({ownerId:ge.string()})}function vD(){return ge.object({ownerType:ge.string()})}function bD(){return ge.object({period:ge.string()})}function _D(){return ge.object({start:ge.string()})}const Ic={setIdOperation(t,e){t.id=e.input.id},setOwnerIdOperation(t,e){t.ownerId=e.input.ownerId},setOwnerTypeOperation(t,e){t.ownerType=e.input.ownerType},setPeriodOperation(t,e){t.period=e.input.period},setStartOperation(t,e){t.start=e.input.start},setEndOperation(t,e){t.end=e.input.end}},U7=(t,e,n)=>{if(Vt.isBaseAction(e))return t;switch(e.type){case"SET_ID":gD().parse(e.input),Ic.setIdOperation(t[e.scope],e,n);break;case"SET_OWNER_ID":yD().parse(e.input),Ic.setOwnerIdOperation(t[e.scope],e,n);break;case"SET_OWNER_TYPE":vD().parse(e.input),Ic.setOwnerTypeOperation(t[e.scope],e,n);break;case"SET_PERIOD":bD().parse(e.input),Ic.setPeriodOperation(t[e.scope],e,n);break;case"SET_START":_D().parse(e.input),Ic.setStartOperation(t[e.scope],e,n);break;case"SET_END":mD().parse(e.input),Ic.setEndOperation(t[e.scope],e,n);break;default:return t}},eb=Vt.createReducer(U7),B7={id:"",ownerId:"",ownerType:"",period:"",start:"",end:"",actualsComparison:[],snapshotAccount:[]},z7={},Vl={fileExtension:"phas",createState(t){return{global:{...B7,...t==null?void 0:t.global},local:{...z7,...t==null?void 0:t.local}}},createExtendedState(t){return Vt.createExtendedState({...t,documentType:"powerhouse/account-snapshot"},Vl.createState)},createDocument(t){return Vt.createDocument(Vl.createExtendedState(t),Vl.createState)},saveToFile(t,e,n){return Vt.saveToFile(t,e,"phas",n)},saveToFileHandle(t,e){return Vt.saveToFileHandle(t,e)},loadFromFile(t){return Vt.loadFromFile(t,eb)},loadFromInput(t){return Vt.loadFromInput(t,eb)}},{createAction:Zu}=Vt,wD=t=>Zu("SET_ID",{...t},void 0,gD,"global"),ED=t=>Zu("SET_OWNER_ID",{...t},void 0,yD,"global"),SD=t=>Zu("SET_OWNER_TYPE",{...t},void 0,vD,"global"),xD=t=>Zu("SET_PERIOD",{...t},void 0,bD,"global"),TD=t=>Zu("SET_START",{...t},void 0,_D,"global"),ID=t=>Zu("SET_END",{...t},void 0,mD,"global");class V7 extends Ef{setId(e){return this.dispatch(wD(e))}setOwnerId(e){return this.dispatch(ED(e))}setOwnerType(e){return this.dispatch(SD(e))}setPeriod(e){return this.dispatch(xD(e))}setStart(e){return this.dispatch(TD(e))}setEnd(e){return this.dispatch(ID(e))}}const OD=class CD extends Ef{constructor(e,n){super(eb,Vl.createDocument(e),n)}saveToFile(e,n){return super.saveToFile(e,CD.fileExtension,n)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const n=new this;return await n.loadFromFile(e),n}};DH(OD,"fileExtension","phas");let H7=OD;BC(H7,[V7]);const W7=Object.freeze(Object.defineProperty({__proto__:null,setEnd:ID,setId:wD,setOwnerId:ED,setOwnerType:SD,setPeriod:xD,setStart:TD},Symbol.toStringTag,{value:"Module"})),q7=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));({...Vl,...q7});({...UC,...W7});var G7=Object.defineProperty,Z7=(t,e,n)=>e in t?G7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Y7=(t,e,n)=>Z7(t,e+"",n);const sg={id:"powerhouse/document-drive",name:"DocumentDrive",extension:"phdd",description:"",author:{name:"Powerhouse Inc",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],state:{global:{schema:`type FolderNode {
|
|
200
|
-
id: String!
|
|
201
|
-
name: String!
|
|
202
|
-
kind: String!
|
|
203
|
-
parentFolder: String
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
type SynchronizationUnit {
|
|
207
|
-
syncId: ID!
|
|
208
|
-
scope: String!
|
|
209
|
-
branch: String!
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
type FileNode {
|
|
213
|
-
id: String!
|
|
214
|
-
name: String!
|
|
215
|
-
kind: String!
|
|
216
|
-
documentType: String!
|
|
217
|
-
parentFolder: String
|
|
218
|
-
synchronizationUnits: [SynchronizationUnit!]!
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
union Node = FolderNode | FileNode
|
|
222
|
-
|
|
223
|
-
type DocumentDriveState {
|
|
224
|
-
id: ID!
|
|
225
|
-
name: String!
|
|
226
|
-
nodes: [Node!]!
|
|
227
|
-
icon: String
|
|
228
|
-
slug: String
|
|
229
|
-
}`,initialValue:'"{\\"id\\":\\"\\",\\"name\\":\\"\\",\\"nodes\\":[],\\"icon\\":null,\\"slug\\":null}"',examples:[]},local:{schema:`type ListenerFilter {
|
|
230
|
-
documentType: [String!]!
|
|
231
|
-
documentId: [ID!]
|
|
232
|
-
scope: [String!]
|
|
233
|
-
branch: [String!]
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
enum TransmitterType {
|
|
237
|
-
Internal,
|
|
238
|
-
SwitchboardPush,
|
|
239
|
-
PullResponder,
|
|
240
|
-
SecureConnect,
|
|
241
|
-
MatrixConnect,
|
|
242
|
-
RESTWebhook
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
type ListenerCallInfo {
|
|
246
|
-
transmitterType: TransmitterType
|
|
247
|
-
name: String
|
|
248
|
-
data: String
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
type Listener {
|
|
252
|
-
listenerId: ID!
|
|
253
|
-
label: String
|
|
254
|
-
block: Boolean!
|
|
255
|
-
system: Boolean!
|
|
256
|
-
filter: ListenerFilter!
|
|
257
|
-
callInfo: ListenerCallInfo
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
enum TriggerType {
|
|
261
|
-
PullResponder
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
type PullResponderTriggerData {
|
|
265
|
-
listenerId: ID!
|
|
266
|
-
url: String!
|
|
267
|
-
interval: String!
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
union TriggerData = PullResponderTriggerData
|
|
271
|
-
|
|
272
|
-
type Trigger {
|
|
273
|
-
id: ID!
|
|
274
|
-
type: TriggerType!
|
|
275
|
-
data: TriggerData
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
type DocumentDriveLocalState{
|
|
279
|
-
sharingType: String
|
|
280
|
-
listeners: [Listener!]!
|
|
281
|
-
triggers: [Trigger!]!
|
|
282
|
-
availableOffline: Boolean!
|
|
283
|
-
}`,initialValue:'"{ \\"listeners\\": [], \\"triggers\\": [], \\"sharingType\\": \\"private\\", \\"availableOffline\\": false}"',examples:[]}},modules:[{id:"GRzuvv78tBvmB6ciitokLfonNHA=",name:"Node",description:"",operations:[{id:"7xiTdxonc9yEASR8sfV/KnbSV10=",name:"ADD_FILE",description:"",schema:`input AddFileInput {
|
|
284
|
-
id: ID!
|
|
285
|
-
name: String!
|
|
286
|
-
documentType: String!
|
|
287
|
-
parentFolder: ID
|
|
288
|
-
synchronizationUnits: [SynchronizationUnit!]!
|
|
289
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"4lzNMMKKdIAtEU6i12xLgi9hp+U=",name:"ADD_FOLDER",description:"",schema:`input AddFolderInput {
|
|
290
|
-
id: ID!
|
|
291
|
-
name: String!
|
|
292
|
-
parentFolder: ID
|
|
293
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"53jH2/3TWTTcgCJiv2C+BmuC6i0=",name:"DELETE_NODE",description:"",schema:`input DeleteNodeInput {
|
|
294
|
-
id: ID!
|
|
295
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"pNn+Y1/HVq/GNMk7t0u3g3gtMLE=",name:"UPDATE_FILE",description:"",schema:`input UpdateFileInput {
|
|
296
|
-
id: ID!
|
|
297
|
-
parentFolder: ID
|
|
298
|
-
name: String
|
|
299
|
-
documentType: String
|
|
300
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"P0x1M8Mnt+Q/+9nggkwgVbfybsc=",name:"UPDATE_NODE",description:"",schema:`input UpdateNodeInput {
|
|
301
|
-
id: ID!
|
|
302
|
-
parentFolder: ID
|
|
303
|
-
name: String
|
|
304
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"vnQ7OB5b3wGLgjhbgJqAIpA+JLE=",name:"COPY_NODE",description:"",schema:`input CopyNodeInput {
|
|
305
|
-
srcId: ID!
|
|
306
|
-
targetId: ID!
|
|
307
|
-
targetName: String
|
|
308
|
-
targetParentFolder: ID
|
|
309
|
-
synchronizationUnits: [SynchronizationUnit!]
|
|
310
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"VNyiD/sNGzk6k9A1Qe7s8dmrJxA=",name:"MOVE_NODE",description:"",schema:`input MoveNodeInput {
|
|
311
|
-
srcFolder: ID!
|
|
312
|
-
targetParentFolder: ID
|
|
313
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"}]},{id:"0dHwHlxOM9x0vMZ+gLnKxf2qTEo=",name:"Drive",description:"",operations:[{id:"qGCiPGpTt/cyz3HzyrBn92z1dsU=",name:"SET_DRIVE_NAME",description:"",schema:`input SetDriveNameInput {
|
|
314
|
-
name: String!
|
|
315
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"qGCiPGpTt/cyz3HzyrBn92z30dsU=",name:"SET_DRIVE_ICON",description:"",schema:`input SetDriveIconInput {
|
|
316
|
-
icon: String!
|
|
317
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"qGCiPGpTt/cyz3HzyrBn92z2dsU=",name:"SET_SHARING_TYPE",description:"",schema:`input SetSharingTypeInput {
|
|
318
|
-
type: String!
|
|
319
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z3dsU=",name:"SET_AVAILABLE_OFFLINE",description:"",schema:`input SetAvailableOfflineInput {
|
|
320
|
-
availableOffline: Boolean!
|
|
321
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z9dsU=",name:"ADD_LISTENER",description:"",schema:`input AddListenerInput {
|
|
322
|
-
listener: Listener!
|
|
323
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z10dsU=",name:"REMOVE_LISTENER",description:"",schema:`input RemoveListenerInput {
|
|
324
|
-
listenerId: String!
|
|
325
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z20dsU=",name:"ADD_TRIGGER",description:"",schema:`input AddTriggerInput {
|
|
326
|
-
trigger: Trigger!
|
|
327
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z30dsU=",name:"REMOVE_TRIGGER",description:"",schema:`input RemoveTriggerInput {
|
|
328
|
-
triggerId: String!
|
|
329
|
-
}`,template:"",reducer:"",errors:[],examples:[],scope:"local"}]}]}]},kD=t=>t!=null,K7=ge.any().refine(t=>kD(t)),DD=ge.enum(["Internal","MatrixConnect","PullResponder","RESTWebhook","SecureConnect","SwitchboardPush"]),RD=ge.enum(["PullResponder"]);function hw(){return ge.object({document:ge.unknown().nullish(),documentType:ge.string(),id:ge.string(),name:ge.string(),parentFolder:ge.string().nullish(),synchronizationUnits:ge.array(og())})}function pw(){return ge.object({id:ge.string(),name:ge.string(),parentFolder:ge.string().nullish()})}function mw(){return ge.object({listener:bw()})}function gw(){return ge.object({trigger:Ow()})}function yw(){return ge.object({srcId:ge.string(),synchronizationUnits:ge.array(og()).nullish(),targetId:ge.string(),targetName:ge.string().nullish(),targetParentFolder:ge.string().nullish()})}function vw(){return ge.object({id:ge.string()})}function J7(){return ge.object({__typename:ge.literal("DocumentDriveLocalState").optional(),availableOffline:ge.boolean(),listeners:ge.array(bw()),sharingType:ge.string().nullable(),triggers:ge.array(Ow())})}function X7(){return ge.object({__typename:ge.literal("DocumentDriveState").optional(),icon:ge.string().nullable(),id:ge.string(),name:ge.string(),nodes:ge.array(LD()),slug:ge.string().nullable()})}function ND(){return ge.object({__typename:ge.literal("FileNode").optional(),documentType:ge.string(),id:ge.string(),kind:ge.string(),name:ge.string(),parentFolder:ge.string().nullable(),synchronizationUnits:ge.array(og())})}function AD(){return ge.object({__typename:ge.literal("FolderNode").optional(),id:ge.string(),kind:ge.string(),name:ge.string(),parentFolder:ge.string().nullable()})}function bw(){return ge.object({__typename:ge.literal("Listener").optional(),block:ge.boolean(),callInfo:PD().nullable(),filter:MD(),label:ge.string().nullable(),listenerId:ge.string(),system:ge.boolean()})}function PD(){return ge.object({__typename:ge.literal("ListenerCallInfo").optional(),data:ge.string().nullable(),name:ge.string().nullable(),transmitterType:DD.nullable()})}function MD(){return ge.object({__typename:ge.literal("ListenerFilter").optional(),branch:ge.array(ge.string()).nullable(),documentId:ge.array(ge.string()).nullable(),documentType:ge.array(ge.string()),scope:ge.array(ge.string()).nullable()})}function _w(){return ge.object({srcFolder:ge.string(),targetParentFolder:ge.string().nullish()})}function LD(){return ge.union([ND(),AD()])}function FD(){return ge.object({__typename:ge.literal("PullResponderTriggerData").optional(),interval:ge.string(),listenerId:ge.string(),url:ge.string()})}function ww(){return ge.object({listenerId:ge.string()})}function Ew(){return ge.object({triggerId:ge.string()})}function Sw(){return ge.object({availableOffline:ge.boolean()})}function xw(){return ge.object({icon:ge.string()})}function Tw(){return ge.object({name:ge.string()})}function Iw(){return ge.object({type:ge.string()})}function og(){return ge.object({__typename:ge.literal("SynchronizationUnit").optional(),branch:ge.string(),scope:ge.string(),syncId:ge.string()})}function Ow(){return ge.object({__typename:ge.literal("Trigger").optional(),data:$D().nullable(),id:ge.string(),type:RD})}function $D(){return FD()}function Cw(){return ge.object({documentType:ge.string().nullish(),id:ge.string(),name:ge.string().nullish(),parentFolder:ge.string().nullish()})}function kw(){return ge.object({id:ge.string(),name:ge.string().nullish(),parentFolder:ge.string().nullish()})}const Q7=Object.freeze(Object.defineProperty({__proto__:null,AddFileInputSchema:hw,AddFolderInputSchema:pw,AddListenerInputSchema:mw,AddTriggerInputSchema:gw,CopyNodeInputSchema:yw,DeleteNodeInputSchema:vw,DocumentDriveLocalStateSchema:J7,DocumentDriveStateSchema:X7,FileNodeSchema:ND,FolderNodeSchema:AD,ListenerCallInfoSchema:PD,ListenerFilterSchema:MD,ListenerSchema:bw,MoveNodeInputSchema:_w,NodeSchema:LD,PullResponderTriggerDataSchema:FD,RemoveListenerInputSchema:ww,RemoveTriggerInputSchema:Ew,SetAvailableOfflineInputSchema:Sw,SetDriveIconInputSchema:xw,SetDriveNameInputSchema:Tw,SetSharingTypeInputSchema:Iw,SynchronizationUnitSchema:og,TransmitterTypeSchema:DD,TriggerDataSchema:$D,TriggerSchema:Ow,TriggerTypeSchema:RD,UpdateFileInputSchema:Cw,UpdateNodeInputSchema:kw,definedNonNullAnySchema:K7,isDefinedNonNullAny:kD},Symbol.toStringTag,{value:"Module"})),sa={addFileOperation(t,e,n){if(t.nodes.find(a=>a.id===e.input.id))throw new Error(`Node with id ${e.input.id} already exists!`);const r=po({nodes:t.nodes,srcName:e.input.name,targetParentFolder:e.input.parentFolder||null}),i=e.input.synchronizationUnits,s=i.find(a=>!!t.nodes.find(c=>Or(c)&&c.synchronizationUnits.find(u=>u.syncId===a.syncId)));if(s)throw new Error(`A synchronization unit with Id ${s.syncId} already exists`);const o={id:e.input.id,name:r,kind:"file",parentFolder:e.input.parentFolder??null,synchronizationUnits:i,documentType:e.input.documentType};t.nodes.push(o),n==null||n({type:"CREATE_CHILD_DOCUMENT",input:{id:e.input.id,documentType:e.input.documentType,synchronizationUnits:i,document:e.input.document}})},addFolderOperation(t,e){if(t.nodes.find(r=>r.id===e.input.id))throw new Error(`Node with id ${e.input.id} already exists!`);const n=po({nodes:t.nodes,srcName:e.input.name,targetParentFolder:e.input.parentFolder||null});t.nodes.push({...e.input,name:n,kind:"folder",parentFolder:e.input.parentFolder??null})},deleteNodeOperation(t,e,n){const r=t.nodes.find(s=>s.id===e.input.id);if(!r)throw new Error(`Node with id ${e.input.id} not found`);const i=Ou(r,t.nodes);t.nodes=t.nodes.filter(s=>s.id!==e.input.id&&!i.find(o=>o.id===s.id)),[r,...i].filter(s=>Or(s)).forEach(s=>{n==null||n({type:"DELETE_CHILD_DOCUMENT",input:{id:s.id}})})},updateFileOperation(t,e){t.nodes=t.nodes.map(n=>n.id===e.input.id?{...n,name:po({nodes:t.nodes,srcName:e.input.name??n.name,targetParentFolder:e.input.parentFolder||null}),documentType:e.input.documentType??n.documentType}:n)},updateNodeOperation(t,e){t.nodes=t.nodes.map(n=>n.id===e.input.id?{...n,name:po({nodes:t.nodes,srcName:e.input.name??n.name,targetParentFolder:e.input.parentFolder||null}),parentFolder:e.input.parentFolder===null?null:n.parentFolder}:n)},copyNodeOperation(t,e,n){const r=t.nodes.find(a=>a.id===e.input.srcId);if(!r)throw new Error(`Node with id ${e.input.srcId} not found`);if(t.nodes.find(a=>a.id===e.input.targetId))throw new Error(`Node with id ${e.input.targetId} already exists`);const i=po({nodes:t.nodes,srcName:e.input.targetName||r.name,targetParentFolder:e.input.targetParentFolder||null}),s={...r,name:i,id:e.input.targetId,parentFolder:e.input.targetParentFolder||null},o=Or(s);if(o){const a=e.input.synchronizationUnits;if(!e.input.synchronizationUnits)throw new Error("Synchronization units were not provided");const c=a.find(u=>!!t.nodes.find(l=>Or(l)&&l.synchronizationUnits.find(d=>d.syncId===u.syncId)));if(c)throw new Error(`A synchronization unit with Id ${c.syncId} already exists`);s.synchronizationUnits=a}t.nodes.push(s),o&&(n==null||n({type:"COPY_CHILD_DOCUMENT",input:{id:e.input.srcId,newId:e.input.targetId,synchronizationUnits:s.synchronizationUnits}}))},moveNodeOperation(t,e){if(e.input.srcFolder===e.input.targetParentFolder)throw new Error("Circular Reference Error: Attempting to move a node to its current parent folder");const n=t.nodes.find(i=>i.id===e.input.srcFolder);if(!n)throw new Error(`Node with id ${e.input.srcFolder} not found`);const r=po({nodes:t.nodes,srcName:n.name,targetParentFolder:e.input.targetParentFolder||null});if(ag(n)&&Ou(n,t.nodes).find(i=>i.id===e.input.targetParentFolder))throw new Error("Circular Reference Error: Cannot move a folder to one of its descendants");t.nodes=t.nodes.map(i=>i.id===e.input.srcFolder?{...i,name:r,parentFolder:e.input.targetParentFolder||null}:i)}},co={setDriveNameOperation(t,e,n){t.name=e.input.name},setDriveIconOperation(t,e,n){t.icon=e.input.icon},setSharingTypeOperation(t,e,n){t.sharingType=e.input.type},setAvailableOfflineOperation(t,e,n){t.availableOffline=e.input.availableOffline},addListenerOperation(t,e,n){if(t.listeners.find(r=>r.listenerId===e.input.listener.listenerId))throw new Error(`A listener with Id: ${e.input.listener.listenerId} already exists`);t.listeners.push(e.input.listener)},removeListenerOperation(t,e,n){t.listeners=t.listeners.filter(r=>r.listenerId!==e.input.listenerId)},addTriggerOperation(t,e,n){if(t.triggers.find(r=>r.id===e.input.trigger.id))throw new Error(`A trigger with Id: ${e.input.trigger.id} already exists`);t.triggers.push(e.input.trigger)},removeTriggerOperation(t,e,n){t.triggers=t.triggers.filter(r=>r.id!==e.input.triggerId)}},eW=(t,e,n)=>{if(Vt.isBaseAction(e))return t;switch(e.type){case"ADD_FILE":hw().parse(e.input),sa.addFileOperation(t[e.scope],e,n);break;case"ADD_FOLDER":pw().parse(e.input),sa.addFolderOperation(t[e.scope],e,n);break;case"DELETE_NODE":vw().parse(e.input),sa.deleteNodeOperation(t[e.scope],e,n);break;case"UPDATE_FILE":Cw().parse(e.input),sa.updateFileOperation(t[e.scope],e,n);break;case"UPDATE_NODE":kw().parse(e.input),sa.updateNodeOperation(t[e.scope],e,n);break;case"COPY_NODE":yw().parse(e.input),sa.copyNodeOperation(t[e.scope],e,n);break;case"MOVE_NODE":_w().parse(e.input),sa.moveNodeOperation(t[e.scope],e,n);break;case"SET_DRIVE_NAME":Tw().parse(e.input),co.setDriveNameOperation(t[e.scope],e,n);break;case"SET_DRIVE_ICON":xw().parse(e.input),co.setDriveIconOperation(t[e.scope],e,n);break;case"SET_SHARING_TYPE":Iw().parse(e.input),co.setSharingTypeOperation(t[e.scope],e,n);break;case"SET_AVAILABLE_OFFLINE":Sw().parse(e.input),co.setAvailableOfflineOperation(t[e.scope],e,n);break;case"ADD_LISTENER":mw().parse(e.input),co.addListenerOperation(t[e.scope],e,n);break;case"REMOVE_LISTENER":ww().parse(e.input),co.removeListenerOperation(t[e.scope],e,n);break;case"ADD_TRIGGER":gw().parse(e.input),co.addTriggerOperation(t[e.scope],e,n);break;case"REMOVE_TRIGGER":Ew().parse(e.input),co.removeTriggerOperation(t[e.scope],e,n);break;default:return t}},Ga=Vt.createReducer(eW),tW={id:"",name:"",nodes:[],icon:null,slug:null},nW={listeners:[],triggers:[],sharingType:"private",availableOffline:!1},Hl={fileExtension:"phdd",createState(t){return{global:{...tW,...t==null?void 0:t.global},local:{...nW,...t==null?void 0:t.local}}},createExtendedState(t){return Vt.createExtendedState({...t,documentType:"powerhouse/document-drive"},Hl.createState)},createDocument(t){return Vt.createDocument(Hl.createExtendedState(t),Hl.createState)},saveToFile(t,e,n){return Vt.saveToFile(t,e,"phdd",n)},saveToFileHandle(t,e){return Vt.saveToFileHandle(t,e)},loadFromFile(t){return Vt.loadFromFile(t,Ga)},loadFromInput(t){return Vt.loadFromInput(t,Ga)}},{createAction:lc}=Vt,Dw=t=>lc("ADD_FILE",{...t},void 0,hw,"global"),jD=t=>lc("ADD_FOLDER",{...t},void 0,pw,"global"),UD=t=>lc("DELETE_NODE",{...t},void 0,vw,"global"),BD=t=>lc("UPDATE_FILE",{...t},void 0,Cw,"global"),zD=t=>lc("UPDATE_NODE",{...t},void 0,kw,"global"),Rw=t=>lc("COPY_NODE",{...t},void 0,yw,"global"),VD=t=>lc("MOVE_NODE",{...t},void 0,_w,"global");class rW extends Ef{addFile(e){return this.dispatch(Dw(e))}addFolder(e){return this.dispatch(jD(e))}deleteNode(e){return this.dispatch(UD(e))}updateFile(e){return this.dispatch(BD(e))}updateNode(e){return this.dispatch(zD(e))}copyNode(e){return this.dispatch(Rw(e))}moveNode(e){return this.dispatch(VD(e))}}const{createAction:Ko}=Vt,HD=t=>Ko("SET_DRIVE_NAME",{...t},void 0,Tw,"global"),WD=t=>Ko("SET_DRIVE_ICON",{...t},void 0,xw,"global"),qD=t=>Ko("SET_SHARING_TYPE",{...t},void 0,Iw,"local"),GD=t=>Ko("SET_AVAILABLE_OFFLINE",{...t},void 0,Sw,"local"),ZD=t=>Ko("ADD_LISTENER",{...t},void 0,mw,"local"),YD=t=>Ko("REMOVE_LISTENER",{...t},void 0,ww,"local"),KD=t=>Ko("ADD_TRIGGER",{...t},void 0,gw,"local"),JD=t=>Ko("REMOVE_TRIGGER",{...t},void 0,Ew,"local");class iW extends Ef{setDriveName(e){return this.dispatch(HD(e))}setDriveIcon(e){return this.dispatch(WD(e))}setSharingType(e){return this.dispatch(qD(e))}setAvailableOffline(e){return this.dispatch(GD(e))}addListener(e){return this.dispatch(ZD(e))}removeListener(e){return this.dispatch(YD(e))}addTrigger(e){return this.dispatch(KD(e))}removeTrigger(e){return this.dispatch(JD(e))}}const XD=class QD extends Ef{constructor(e,n){super(Ga,Hl.createDocument(e),n)}saveToFile(e,n){return super.saveToFile(e,QD.fileExtension,n)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const n=new this;return await n.loadFromFile(e),n}};Y7(XD,"fileExtension","phdd");let Nw=XD;BC(Nw,[rW,iW]);const sW=Object.freeze(Object.defineProperty({__proto__:null,addFile:Dw,addFolder:jD,addListener:ZD,addTrigger:KD,copyNode:Rw,deleteNode:UD,moveNode:VD,removeListener:YD,removeTrigger:JD,setAvailableOffline:GD,setDriveIcon:WD,setDriveName:HD,setSharingType:qD,updateFile:BD,updateNode:zD},Symbol.toStringTag,{value:"Module"}));var Zn=[];for(var Ry=0;Ry<256;++Ry)Zn.push((Ry+256).toString(16).slice(1));function oW(t,e=0){return(Zn[t[e+0]]+Zn[t[e+1]]+Zn[t[e+2]]+Zn[t[e+3]]+"-"+Zn[t[e+4]]+Zn[t[e+5]]+"-"+Zn[t[e+6]]+Zn[t[e+7]]+"-"+Zn[t[e+8]]+Zn[t[e+9]]+"-"+Zn[t[e+10]]+Zn[t[e+11]]+Zn[t[e+12]]+Zn[t[e+13]]+Zn[t[e+14]]+Zn[t[e+15]]).toLowerCase()}var yh,aW=new Uint8Array(16);function cW(){if(!yh&&(yh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yh(aW)}var uW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const KS={randomUUID:uW};function lW(t,e,n){if(KS.randomUUID&&!t)return KS.randomUUID();t=t||{};var r=t.random||(t.rng||cW)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,oW(r)}function Or(t){return t.kind==="file"}function ag(t){return t.kind==="folder"}function Aw(t,e){if(t.parentFolder){const n=e.find(r=>r.id===t.parentFolder);if(!n)throw new Error(`Parent node with id ${t.parentFolder} not found`);return[n,...Aw(n,e)]}else return[]}function Ou(t,e){const n=e.filter(i=>i.parentFolder===t.id),r=n.map(i=>Ou(i,e));return[...n,...r.flat()]}function eR(t,e,n){const r=n.find(a=>a.id===t.srcId);if(!r)throw new Error(`Node with id ${t.srcId} not found`);const i=[{...r,name:t.targetName||r.name,parentFolder:t.targetParentFolder||null},...Ou(r,n)],s={};t.targetParentFolder&&(s[t.targetParentFolder]=t.targetParentFolder);const o=a=>{let c=s[a];if(!c){const u=a;c=e(a),s[u]=c}return c};return i.map(a=>({srcId:a.id,targetId:o(a.id),targetName:a.name,targetParentFolder:a.parentFolder?o(a.parentFolder):null,synchronizationUnits:Or(a)?a.synchronizationUnits.map(c=>({...c,syncId:Of(n)})):void 0}))}function Of(t){let e="";for(;!e||t.find(n=>Or(n)&&n.synchronizationUnits.find(r=>r.syncId===e));)e=lW();return e}function Pw(t,e,n="main"){return e.map(r=>({scope:r,branch:n,syncId:Of(t.nodes)}))}function Mw(t,e,n){return Dw({...e,synchronizationUnits:Pw(t,n)})}function tR(t,e){const n=t.nodes.find(i=>i.id===e.srcId);if(!n)throw new Error(`Node with id ${e.srcId} not found`);let r;return Or(n)&&(r=n.synchronizationUnits.map(i=>({...i,syncId:Of(t.nodes)}))),Rw({...e,synchronizationUnits:r})}function Lw(t,e){let n=0;const r=new RegExp(`^${Fw(e)} \\(copy\\)(?: (\\d+))?$`);for(const i of t){const s=i.match(r);if(s){const o=s[1]?parseInt(s[1],10):1;o>n&&(n=o)}}return n+1}function Fw(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function po(t){const{nodes:e,targetParentFolder:n,srcName:r}=t,i=e.filter(s=>n===""?s.parentFolder===null:s.parentFolder===n).map(s=>s.name);return i.includes(r)?`${r} (copy) ${Lw(i,r)}`:r}const dW=Object.freeze(Object.defineProperty({__proto__:null,escapeRegExp:Fw,generateAddNodeAction:Mw,generateCopyNodeAction:tR,generateNodesCopy:eR,generateSynchronizationUnitId:Of,generateSynchronizationUnits:Pw,getAncestors:Aw,getDescendants:Ou,getNextCopyNumber:Lw,handleTargetNameCollisions:po,isFileNode:Or,isFolderNode:ag},Symbol.toStringTag,{value:"Module"})),nR=Nw,ef={...Hl,...dW},Jn={...UC,...sW},rR={Document:nR,reducer:Ga,actions:Jn,utils:ef,documentModel:sg},fW=Object.freeze(Object.defineProperty({__proto__:null,Document:nR,DocumentDrive:Nw,actions:Jn,documentModel:sg,escapeRegExp:Fw,generateAddNodeAction:Mw,generateCopyNodeAction:tR,generateNodesCopy:eR,generateSynchronizationUnitId:Of,generateSynchronizationUnits:Pw,getAncestors:Aw,getDescendants:Ou,getNextCopyNumber:Lw,handleTargetNameCollisions:po,isFileNode:Or,isFolderNode:ag,module:rR,reducer:Ga,utils:ef,z:Q7},Symbol.toStringTag,{value:"Module"}));let iR=()=>({emit(t,...e){for(let n=this.events[t]||[],r=0,i=n.length;r<i;r++)n[r](...e)},events:{},on(t,e){var n;return((n=this.events)[t]||(n[t]=[])).push(e),()=>{var r;this.events[t]=(r=this.events[t])==null?void 0:r.filter(i=>e!==i)}}});class sR{constructor(){Ve(this,"cache",new Map)}async setDocument(e,n,r){var a;const i=r.operations.global.map(c=>(delete c.resultingState,c)),s=r.operations.local.map(c=>(delete c.resultingState,c)),o={...r,operations:{global:i,local:s}};return this.cache.has(e)||this.cache.set(e,new Map),(a=this.cache.get(e))==null||a.set(n,o),!0}async deleteDocument(e,n){var r;return((r=this.cache.get(e))==null?void 0:r.delete(n))??!1}async getDocument(e,n){var r;return(r=this.cache.get(e))==null?void 0:r.get(n)}}class hW extends Error{constructor(e,n){super(`Document model "${e}" not found`,{cause:n}),this.id=e}}class xr extends Error{constructor(n,r,i,s){super(i,{cause:s??r});Ve(this,"status");Ve(this,"operation");this.status=n,this.operation=r}}class pW extends xr{constructor(e,n){super("CONFLICT",n,`Conflicting operation on index ${n.index}`,{existingOperation:e,newOperation:n})}}class mW extends Error{constructor(n){super(`Drive already exists. ID: ${n}`);Ve(this,"driveId");this.driveId=n}}class Wl extends Error{constructor(n){super(`Drive with id ${n} not found`);Ve(this,"driveId");this.driveId=n}}class oR extends Error{constructor(n,r){super(n);Ve(this,"syncUnitId");this.syncUnitId=r}}var tf;(t=>{t.useMessageChannel=typeof MessageChannel>"u"?new Error("MessageChannel is not supported"):r=>{const i=new AbortController,s=i.signal,o=new MessageChannel;return o.port1.postMessage(null),o.port2.addEventListener("message",()=>{r(),o.port1.close(),o.port2.close()},{once:!0,signal:s}),o.port2.start(),()=>i.abort()},t.usePostMessage=(()=>{const r=typeof window=="object"&&window||typeof global=="object"&&global||typeof self=="object"&&self;if(!r)return new Error("No global object found");const i=r;if(!i.postMessage||!i.addEventListener||i.importScripts)return new Error("postMessage is not supported");let s=0;const o=new Map;function a(){return s===9007199254740991?0:++s}const c="com.usePostMessage"+Math.random();return i.addEventListener("message",u=>{const l=u;if(typeof l.data!="string"||l.source!==i||!l.data.startsWith(c))return;const d=l.data.split(":").at(1);if(d===void 0)return;const f=+d,h=o.get(f);h&&(h(),o.delete(f))},!1),u=>{const l=a();return o.set(l,u),i.postMessage(c+":"+l,{targetOrigin:"*"}),()=>{o.delete(l)}}})(),t.useSetImmediate=typeof window<"u"?new Error("setImmediate is not supported on the browser"):typeof setImmediate>"u"?new Error("setImmediate is not supported"):r=>{const i=setImmediate(r);return()=>clearImmediate(i)},t.useSetTimeout=r=>{const i=setTimeout(r,0);return()=>clearTimeout(i)};function e(r){return t.useSetImmediate instanceof Error?t.useMessageChannel instanceof Error?t.usePostMessage instanceof Error?(0,t.useSetTimeout)(r):(0,t.usePostMessage)(r):(0,t.useMessageChannel)(r):(0,t.useSetImmediate)(r)}t.runAsap=e;function n(r,i=e){if(i instanceof Error)throw new Error("queueMethod is not supported",{cause:i});return new Promise((s,o)=>{i(()=>{r().then(s).catch(o)})})}t.runAsapAsync=n})(tf||(tf={}));const gW=tf.runAsap,yW=tf.runAsapAsync;function aa(t){return t.documentType===sg.id}function Qp(t,e){const n=Object.keys(t).reduce((i,s)=>{var a;const o=s;return i[o]=((a=t[o].at(-1))==null?void 0:a.index)??0,i},{}),r=e.find(i=>i.index<(n[i.scope]??0));if(r)throw new xr("ERROR",r,`Tried to add operation with index ${r.index} and document is at index ${n[r.scope]}`);return e.sort((i,s)=>i.index-s.index).reduce((i,s)=>{const o=i[s.scope]||[];return{...i,[s.scope]:[...o,s]}},t)}function $w(){return B_()}function vW(t,e){return new Date(t)<new Date(e)}function Jh(t){return"operations"in t}function bW(t){return"actions"in t}class _W{constructor(e){Ve(this,"id");Ve(this,"blocked",!1);Ve(this,"deleted",!1);Ve(this,"items",[]);Ve(this,"dependencies",new Array);this.id=e}async setDeleted(e){this.deleted=e}async isDeleted(){return this.deleted}async addJob(e){return this.items.push(e),Promise.resolve()}async getNextJob(){const e=this.items.shift();return Promise.resolve(e)}async amountOfJobs(){return Promise.resolve(this.items.length)}getId(){return this.id}async setBlocked(e){this.blocked=e}async isBlocked(){return this.blocked}async getJobs(){return this.items}async addDependencies(e){this.dependencies.find(n=>n.jobId===e.jobId)||this.dependencies.push(e),this.isBlocked()||this.setBlocked(!0)}async removeDependencies(e){this.dependencies=this.dependencies.filter(n=>n.jobId!==e.jobId&&n.driveId!==e.driveId),this.dependencies.length===0&&await this.setBlocked(!1)}}class aR{constructor(e=3,n=0){Ve(this,"emitter",iR());Ve(this,"ticker",0);Ve(this,"queues",[]);Ve(this,"workers");Ve(this,"timeout");Ve(this,"delegate");this.workers=e,this.timeout=n}async init(e,n){this.delegate=e;for(let r=0;r<this.workers;r++)setTimeout(()=>this.processNextJob.bind(this)().catch(n),100*r);return Promise.resolve()}async addJob(e){if(!this.delegate)throw new Error("No server delegate defined");const n=$w(),r=this.getQueue(e.driveId,e.documentId);if(await r.isDeleted())throw new Error("Queue is deleted");if(e.documentId&&!await this.delegate.checkDocumentExists(e.driveId,e.documentId)&&!await r.isBlocked()){await r.setBlocked(!0);const u=await this.getQueue(e.driveId).getJobs();for(const l of u)(Jh(l)?l.operations:l.actions).find(h=>{const m=h.input;return h.type==="ADD_FILE"&&m.id===e.documentId})&&await r.addDependencies(l)}const s=Jh(e)?e.operations:e.actions,o=s.filter(c=>c.type==="ADD_FILE");for(const c of o){const u=c.input;await this.getQueue(e.driveId,u.id).addDependencies({jobId:n,...e})}const a=s.filter(c=>c.type==="DELETE_NODE");for(const c of a){const u=c.input;await this.getQueue(e.driveId,u.id).setDeleted(!0)}return await r.addJob({jobId:n,...e}),n}getQueue(e,n){const r=this.getQueueId(e,n);let i=this.queues.find(s=>s.getId()===r);return i||(i=new _W(r),this.queues.push(i)),i}removeQueue(e,n){const r=this.getQueueId(e,n);this.queues=this.queues.filter(i=>i.getId()!==r),this.emit("queueRemoved",r)}getQueueByIndex(e){const n=this.queues[e];return n||null}getQueues(){return this.queues.map(e=>e.getId())}retryNextJob(e){const n=e!==void 0?e:this.timeout;(n>0?i=>setTimeout(i,n):gW)(()=>this.processNextJob())}async findFirstNonEmptyQueue(e){const n=this.queues.length;for(let r=0;r<n;r++){const i=(e+r)%n,s=this.queues[i];if(s&&await s.amountOfJobs()>0)return i}return null}async processNextJob(){if(!this.delegate)throw new Error("No server delegate defined");if(this.queues.length===0){this.retryNextJob();return}const e=this.queues[this.ticker];if(!e){this.ticker=0,this.retryNextJob();return}if(await e.amountOfJobs()===0){const s=await this.findFirstNonEmptyQueue(this.ticker);s!==null?(this.ticker=s,this.retryNextJob(0)):this.retryNextJob();return}if(this.ticker=this.ticker===this.queues.length-1?0:this.ticker+1,await e.isBlocked()){this.retryNextJob();return}await e.setBlocked(!0);const i=await e.getNextJob();if(!i){this.retryNextJob();return}try{const s=await this.delegate.processJob(i),a=(Jh(i)?i.operations:i.actions).filter(c=>c.type==="ADD_FILE");if(a.length>0)for(const c of a)await this.getQueue(i.driveId,c.input.id).removeDependencies(i);this.emit("jobCompleted",i,s)}catch(s){_t.error("job failed",s),this.emit("jobFailed",i,s)}finally{await e.setBlocked(!1),this.retryNextJob(0)}}emit(e,...n){this.emitter.emit(e,...n)}on(e,n){return this.emitter.on(e,n)}getQueueId(e,n){return`queue:${e}${n?`:${n}`:""}`}}class cg extends Error{}class ca extends cg{constructor(e){super(`Read drive ${e} not found.`)}}class wW extends cg{constructor(e){super(`Read drive with slug ${e} not found.`)}}class JS extends cg{constructor(e,n){super(`Document with id ${n} not found on read drive ${e}.`)}}var ff,mi,Qa,tb,cR;class EW{constructor(e){bt(this,Qa);bt(this,ff);bt(this,mi,new Map);ht(this,ff,e)}async fetchDrive(e){const n=ce(this,mi).get(e);if(!n)return new ca(e);const r=await this.fetchDocument(e,e,sg.id);if(r instanceof Error)return r;const i={...r,readContext:n.context};return n.drive=i,i}async fetchDocument(e,n,r){const i=ce(this,mi).get(e);if(!i)return new ca(e);let s;try{s=ce(this,ff).call(this,r)}catch(u){return new hW(r,u)}const{url:o}=i.context,{errors:a,document:c}=await GS(o,n,s);if(a){const u=sn(this,Qa,tb).call(this,a,e,n);if(u instanceof cg)return u;if(u)throw u}return c||new JS(e,n)}async addReadDrive(e,n){const{id:r}=(n==null?void 0:n.expectedDriveInfo)??await ma(e),i=await sn(this,Qa,cR).call(this,r,e);if(i instanceof Error)throw i;if(!i)throw new Error(`Drive "${r}" not found at ${e}`);ce(this,mi).set(r,{drive:i,context:{...n,url:e}})}async getReadDrives(){return Promise.resolve([...ce(this,mi).keys()])}async getReadDrive(e){const n=ce(this,mi).get(e);return Promise.resolve(n?{...n.drive,readContext:n.context}:new ca(e))}async getReadDriveBySlug(e){const n=[...ce(this,mi).values()].find(({drive:r})=>r.state.global.slug===e);return Promise.resolve(n?{...n.drive,readContext:n.context}:new wW(e))}getReadDriveContext(e){var n;return Promise.resolve(((n=ce(this,mi).get(e))==null?void 0:n.context)??new ca(e))}deleteReadDrive(e){const n=ce(this,mi).delete(e);return Promise.resolve(n?void 0:new ca(e))}}ff=new WeakMap,mi=new WeakMap,Qa=new WeakSet,tb=function(e,n,r){for(const s of e){if(s.message===`Drive with id ${n} not found`)return new ca(n);if(r&&s.message===`Document with id ${r} not found`)return new JS(n,r)}const i=e.at(0);if(i)return i},cR=async function(e,n){const{errors:r,document:i}=await GS(n,e,fW);return(r?sn(this,Qa,tb).call(this,r,e):void 0)||i};function SW(t){var e,n,r,Xh,Qh,o;return o=class extends t{constructor(...u){super(...u);bt(this,r);bt(this,e);bt(this,n,new Set);ht(this,e,new EW(this.getDocumentModel.bind(this))),sn(this,r,Xh).call(this).then(l=>{l.length&&sn(this,r,Qh).call(this,l,"add")}).catch(_t.error)}getReadDrives(){return ce(this,e).getReadDrives()}getReadDrive(u){return ce(this,e).getReadDrive(u)}getReadDriveBySlug(u){return ce(this,e).getReadDriveBySlug(u)}getReadDriveContext(u){return ce(this,e).getReadDriveContext(u)}async addReadDrive(u,l){await ce(this,e).addReadDrive(u,l),sn(this,r,Qh).call(this,await sn(this,r,Xh).call(this),"add")}fetchDrive(u){return ce(this,e).fetchDrive(u)}fetchDocument(u,l,d){return ce(this,e).fetchDocument(u,l,d)}async deleteReadDrive(u){const l=await ce(this,e).deleteReadDrive(u);if(l)return l;sn(this,r,Qh).call(this,await sn(this,r,Xh).call(this),"delete")}async migrateReadDrive(u,l){const d=await this.getReadDriveContext(u);if(d instanceof Error)return d;const{url:f,...h}=d;try{return await this.addRemoteDrive(f,l)}catch(m){throw _t.error(m),await this.addReadDrive(d.url,h),m}}onReadDrivesUpdate(u){return ce(this,n).add(u),Promise.resolve(()=>ce(this,n).delete(u))}},e=new WeakMap,n=new WeakMap,r=new WeakSet,Xh=async function(){const u=await this.getReadDrives();return(await Promise.all(u.map(d=>this.getReadDrive(d)))).filter(d=>!(d instanceof Error))},Qh=function(u,l){ce(this,n).forEach(d=>d(u,l))},o}class xW{constructor(){Ve(this,"documents");Ve(this,"drives");Ve(this,"slugToDriveId",{});this.documents={},this.drives={}}checkDocumentExists(e,n){var r;return Promise.resolve(((r=this.documents[e])==null?void 0:r[n])!==void 0)}async getDocuments(e){return Object.keys(this.documents[e]??{})}async getDocument(e,n){const r=this.documents[e];if(!r)throw new Wl(e);const i=r[n];if(!i)throw new Error(`Document with id ${n} not found`);return i}async saveDocument(e,n,r){this.documents[e]=this.documents[e]??{},this.documents[e][n]=r}async clearStorage(){this.documents={},this.drives={}}async createDocument(e,n,r){this.documents[e]=this.documents[e]??{};const{operations:i,initialState:s,name:o,revision:a,documentType:c,created:u,lastModified:l,clipboard:d,state:f}=r;this.documents[e][n]={operations:i,initialState:s,name:o,revision:a,documentType:c,created:u,lastModified:l,clipboard:d,state:f}}async addDocumentOperations(e,n,r,i){const s=await this.getDocument(e,n);if(!s)throw new Error(`Document with id ${n} not found`);const o=Qp(s.operations,r);this.documents[e][n]={...s,...i,operations:o}}async deleteDocument(e,n){if(!this.documents[e])throw new Wl(e);delete this.documents[e][n]}async getDrives(){return Object.keys(this.drives)}async getDrive(e){const n=this.drives[e];if(!n)throw new Wl(e);return n}async getDriveBySlug(e){const n=this.slugToDriveId[e];if(!n)throw new Error(`Drive with slug ${e} not found`);return this.getDrive(n)}async createDrive(e,n){this.drives[e]=n,this.documents[e]={};const{slug:r}=n.initialState.state.global;r&&(this.slugToDriveId[r]=e)}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=Qp(i.operations,n);this.drives[e]={...i,...r,operations:s}}async deleteDrive(e){delete this.documents[e],delete this.drives[e]}async getSynchronizationUnitsRevision(e){return(await Promise.allSettled(e.map(async r=>{try{const i=await(r.documentId?this.getDocument(r.driveId,r.documentId):this.getDrive(r.driveId));if(!i)return;const s=i.operations[r.scope].at(-1);if(s)return{driveId:r.driveId,documentId:r.documentId,scope:r.scope,branch:r.branch,lastUpdated:s.timestamp,revision:s.index}}catch{return}}))).reduce((r,i)=>(i.status==="fulfilled"&&i.value!==void 0&&r.push(i.value),r),[])}}function TW(t){return typeof t.getReadDrives=="function"}class IW{constructor(e,n,r){Ve(this,"defaultRemoteDrives",new Map);Ve(this,"removeOldRemoteDrivesConfig");if(this.server=e,this.delegate=n,r!=null&&r.defaultDrives.remoteDrives)for(const i of r.defaultDrives.remoteDrives)this.defaultRemoteDrives.set(i.url,{...i,status:"PENDING"});this.removeOldRemoteDrivesConfig=(r==null?void 0:r.defaultDrives.removeOldRemoteDrives)||{strategy:"preserve-all"}}getDefaultRemoteDrives(){return new Map(JSON.parse(JSON.stringify(Array.from(this.defaultRemoteDrives))))}async deleteDriveById(e){try{await this.server.deleteDrive(e)}catch(n){n instanceof Wl||_t.error(n)}}async preserveDrivesById(e,n,r="detach"){const i=n.map(a=>this.server.getDrive(a)),o=(await Promise.all(i)).filter(a=>a.state.local.listeners.length>0||a.state.local.triggers.length>0).filter(a=>!e.includes(a.state.global.id)).map(a=>a.state.global.id);r==="detach"?await this.detachDrivesById(o):await this.removeDrivesById(o)}async removeDrivesById(e){for(const n of e)await this.deleteDriveById(n)}async detachDrivesById(e){const n=e.map(r=>this.delegate.detachDrive(r));await Promise.all(n)}async removeOldremoteDrives(){const e=await this.server.getDrives();switch(this.removeOldRemoteDrivesConfig.strategy){case"preserve-by-id-and-detach":case"preserve-by-id":{const n=this.removeOldRemoteDrivesConfig.strategy==="preserve-by-id-and-detach"?"detach":"remove";await this.preserveDrivesById(this.removeOldRemoteDrivesConfig.ids,e,n);break}case"preserve-by-url-and-detach":case"preserve-by-url":{const n=this.removeOldRemoteDrivesConfig.strategy==="preserve-by-url-and-detach"?"detach":"remove",r=this.removeOldRemoteDrivesConfig.urls.map(s=>ma(s)),i=(await Promise.all(r)).map(s=>s.id);await this.preserveDrivesById(i,e,n);break}case"remove-by-id":{const n=this.removeOldRemoteDrivesConfig.ids.filter(r=>e.includes(r));await this.removeDrivesById(n);break}case"remove-by-url":{const n=this.removeOldRemoteDrivesConfig.urls.map(s=>ma(s)),i=(await Promise.all(n)).map(s=>s.id).filter(s=>e.includes(s));await this.removeDrivesById(i);break}case"remove-all":{const n=e.map(s=>this.server.getDrive(s)),i=(await Promise.all(n)).filter(s=>s.state.local.listeners.length>0||s.state.local.triggers.length>0).map(s=>s.state.global.id);await this.removeDrivesById(i);break}case"detach-by-id":{const r=this.removeOldRemoteDrivesConfig.ids.filter(i=>e.includes(i)).map(i=>this.delegate.detachDrive(i));await Promise.all(r);break}case"detach-by-url":{const n=this.removeOldRemoteDrivesConfig.urls.map(o=>ma(o)),s=(await Promise.all(n)).map(o=>o.id).filter(o=>e.includes(o)).map(o=>this.delegate.detachDrive(o));await Promise.all(s);break}}}async setAllDefaultDrivesAccessLevel(e){const n=this.defaultRemoteDrives.values();for(const r of n)await this.setDefaultDriveAccessLevel(r.url,e)}async setDefaultDriveAccessLevel(e,n){const r=this.defaultRemoteDrives.get(e);if(r&&r.options.accessLevel!==n){const i={...r,options:{...r.options,accessLevel:n}};this.defaultRemoteDrives.set(e,i),await this.initializeDefaultRemoteDrives([i])}}async initializeDefaultRemoteDrives(e=Array.from(this.defaultRemoteDrives.values())){const n=await this.server.getDrives(),r=TW(this.server)?this.server:void 0,i=await(r==null?void 0:r.getReadDrives());for(const s of e){let o={...s};try{const a=s.metadata??await ma(s.url);o={...s,metadata:a},this.defaultRemoteDrives.set(s.url,o);const c=n.includes(a.id),u=i==null?void 0:i.includes(a.id),l=s.options.accessLevel!==void 0,d=r&&s.options.accessLevel==="READ",f=d?u:c;if(l&&(d?c:u))try{await(d?this.server.deleteDrive(a.id):r==null?void 0:r.deleteReadDrive(a.id))}catch(m){_t.error(m)}if(f){o.status="ALREADY_ADDED",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ALREADY_ADDED",this.defaultRemoteDrives,o,a.id,a.name);continue}o.status="ADDING",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ADDING",this.defaultRemoteDrives,o),!l&&r||d?await r.addReadDrive(s.url,{...s.options,expectedDriveInfo:a}):await this.server.addRemoteDrive(s.url,{...s.options,expectedDriveInfo:a}),o.status="SUCCESS",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("SUCCESS",this.defaultRemoteDrives,o,a.id,a.name)}catch(a){o.status="ERROR",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ERROR",this.defaultRemoteDrives,o,void 0,void 0,a)}}}}const{attachBranch:OW,garbageCollect:CW,groupOperationsByScope:kW,merge:DW,split:pse,precedes:RW,removeExistingOperations:NW,reshuffleByTimestamp:AW,sortOperations:PW,addUndo:mse,checkOperationsIntegrity:gse,checkCleanedOperationsIntegrity:yse,reshuffleByTimestampAndIndex:vse,nextSkipNumber:bse,prepareOperations:_se,IntegrityIssueSubType:wse,IntegrityIssueType:Ese}=Vt.documentHelpers;class MW{}const nb={sequentialUpdates:!0};class LW{constructor(e,n=new Map,r=nb){Ve(this,"drive");Ve(this,"listenerState",new Map);Ve(this,"options");Ve(this,"transmitters",{});this.drive=e,this.listenerState=n,this.options={...nb,...r}}}var Em,lR;class uR{constructor(e,n){bt(this,Em);Ve(this,"drive");Ve(this,"listener");Ve(this,"receiver");this.listener=e,this.drive=n}async transmit(e,n){var i;if(!this.receiver)return[];const r=[];for(const s of e){const o=await sn(this,Em,lR).call(this,s),a=((i=o.at(-1))==null?void 0:i.state)??{};r.push({...s,operations:o,state:a})}try{return await this.receiver.onStrands(r),e.map(({operations:s,...o})=>{var a;return{...o,status:"SUCCESS",revision:((a=s.at(s.length-1))==null?void 0:a.index)??-1}})}catch(s){return _t.error(s),e.map(({operations:o,...a})=>{var c;return{...a,status:"ERROR",revision:(((c=o.at(0))==null?void 0:c.index)??0)-1}})}}setReceiver(e){this.receiver=e}async disconnect(){var e;await((e=this.receiver)==null?void 0:e.onDisconnect())}getListener(){return this.listener}}Em=new WeakSet,lR=async function(e){const n=[],r=new Map,i=async s=>{const o=r.get(s);if(o)return o;const a={revisions:{[e.scope]:s},checkHashes:!1},c=await(e.documentId?this.drive.getDocument(e.driveId,e.documentId,a):this.drive.getDrive(e.driveId,a));return s<0?r.set(s,c.initialState.state[e.scope]):r.set(s,c.state[e.scope]),r.get(s)};for(const s of e.operations)n.push({...s,state:await i(s.index),previousState:await i(s.index-1)});return n};class Ps{constructor(e,n,r){Ve(this,"drive");Ve(this,"listener");Ve(this,"manager");this.listener=e,this.drive=n,this.manager=r}getStrands(e){return this.manager.getStrands(this.listener.driveId,this.listener.listenerId,e)}disconnect(){return Promise.resolve()}async processAcknowledge(e,n,r){const i=await this.manager.getListenerSyncUnitIds(e,n);let s=!0;for(const o of r){const a=i.find(c=>c.scope===o.scope&&c.branch===o.branch&&c.driveId===o.driveId&&c.documentId==o.documentId);if(!a){_t.warn("Unknown sync unit was acknowledged",o),s=!1;continue}await this.manager.updateListenerRevision(n,e,a.syncId,o.revision)}return s}static async registerPullResponder(e,n,r){var o;const i=await eu(n,Qc`
|
|
330
|
-
mutation registerPullResponderListener($filter: InputListenerFilter!) {
|
|
331
|
-
registerPullResponderListener(filter: $filter) {
|
|
332
|
-
listenerId
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
`,{filter:r}),s=(o=i.errors)==null?void 0:o.at(0);if(s)throw s;if(!i.registerPullResponderListener)throw new Error("Error registering listener");return i.registerPullResponderListener.listenerId}static async pullStrands(e,n,r,i){var a;const s=await eu(n,Qc`
|
|
336
|
-
query strands($listenerId: ID!) {
|
|
337
|
-
system {
|
|
338
|
-
sync {
|
|
339
|
-
strands(listenerId: $listenerId) {
|
|
340
|
-
driveId
|
|
341
|
-
documentId
|
|
342
|
-
scope
|
|
343
|
-
branch
|
|
344
|
-
operations {
|
|
345
|
-
id
|
|
346
|
-
timestamp
|
|
347
|
-
skip
|
|
348
|
-
type
|
|
349
|
-
input
|
|
350
|
-
hash
|
|
351
|
-
index
|
|
352
|
-
context {
|
|
353
|
-
signer {
|
|
354
|
-
user {
|
|
355
|
-
address
|
|
356
|
-
networkId
|
|
357
|
-
chainId
|
|
358
|
-
}
|
|
359
|
-
app {
|
|
360
|
-
name
|
|
361
|
-
key
|
|
362
|
-
}
|
|
363
|
-
signatures
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
`,{listenerId:r}),o=(a=s.errors)==null?void 0:a.at(0);if(o)throw o;return s.system?s.system.sync.strands.map(c=>({...c,operations:c.operations.map(u=>({...u,input:JSON.parse(u.input)}))})):[]}static async acknowledgeStrands(e,n,r,i){var a;const s=await eu(n,Qc`
|
|
372
|
-
mutation acknowledge(
|
|
373
|
-
$listenerId: String!
|
|
374
|
-
$revisions: [ListenerRevisionInput]
|
|
375
|
-
) {
|
|
376
|
-
acknowledge(listenerId: $listenerId, revisions: $revisions)
|
|
377
|
-
}
|
|
378
|
-
`,{listenerId:r,revisions:i}),o=(a=s.errors)==null?void 0:a.at(0);if(o)throw o;if(s.acknowledge===null)throw new Error("Error acknowledging strands");return s.acknowledge}static async executePull(e,n,r,i,s,o){var a;try{const{url:c,listenerId:u}=n.data,l=await Ps.pullStrands(e,c,u);if(!l.length){s==null||s([]);return}const d=[];for(const f of l){const h=f.operations.map(p=>({...p,scope:f.scope,branch:f.branch}));let m;try{const p=await r(f,{type:"trigger",trigger:n});if(p.error)throw p.error}catch(p){m=p,i(m)}d.push({branch:f.branch,documentId:f.documentId||"",driveId:f.driveId,revision:((a=h.pop())==null?void 0:a.index)??-1,scope:f.scope,status:m?m instanceof xr?m.status:"ERROR":"SUCCESS",error:m})}s==null||s(d),await Ps.acknowledgeStrands(e,c,u,d.map(f=>{const{error:h,...m}=f;return m})).then(f=>o==null?void 0:o(f)).catch(f=>_t.error("ACK error",f))}catch(c){i(c)}}static setupPull(e,n,r,i,s,o){const{interval:a}=n.data;let c=JW;if(a)try{const f=parseInt(a);f&&(c=f)}catch{}let u=!1,l;return(async()=>{for(;!u;)await this.executePull(e,n,r,i,s,o),await new Promise(f=>{l=setTimeout(f,c)})})().catch(_t.error),()=>{u=!0,l!==void 0&&clearTimeout(l)}}static async createPullResponderTrigger(e,n,r){const{pullFilter:i,pullInterval:s}=r,o=await Ps.registerPullResponder(e,n,i??{documentId:["*"],documentType:["*"],branch:["*"],scope:["*"]});return{id:$w(),type:"PullResponder",data:{url:n,listenerId:o,interval:(s==null?void 0:s.toString())??""}}}static isPullResponderTrigger(e){return e.type==="PullResponder"}}var FW={space:"",cycles:!1,replacer:(t,e)=>e,stringify:JSON.stringify},dc={isArray:Array.isArray,assign:Object.assign,isObject:t=>typeof t=="object",isFunction:t=>typeof t=="function",isBoolean:t=>typeof t=="boolean",isRegex:t=>t instanceof RegExp,keys:Object.keys};const pl=FW,$W=dc.isFunction,jW=dc.isBoolean,UW=dc.isObject,BW=dc.isArray,zW=dc.isRegex,VW=dc.assign,HW=dc.keys;function WW(t){return t==null?t:zW(t)?t.toString():t.toJSON?t.toJSON():t}function qW(t,e){e=e||VW({},pl),$W(e)&&(e={compare:e});const n=e.space||pl.space,r=jW(e.cycles)?e.cycles:pl.cycles,i=e.replacer||pl.replacer,s=e.stringify||pl.stringify,o=e.compare&&function(c){return function(u){return function(l,d){const f={key:l,value:u[l]},h={key:d,value:u[d]};return c(f,h)}}}(e.compare);r||s(t);const a=[];return function c(u,l,d,f){const h=n?`
|
|
379
|
-
`+new Array(f+1).join(n):"",m=n?": ":":";if(d=WW(d),d=i.call(u,l,d),d!==void 0){if(!UW(d)||d===null)return s(d);if(BW(d)){const p=[];for(let g=0;g<d.length;g++){const y=c(d,g,d[g],f+1)||s(null);p.push(h+n+y)}return"["+p.join(",")+h+"]"}else{if(r){if(a.indexOf(d)!==-1)return s("[Circular]");a.push(d)}const p=HW(d).sort(o&&o(d)),g=[];for(let y=0;y<p.length;y++){const v=p[y],b=c(d,v,d[v],f+1);if(!b)continue;const E=s(v)+m+b;g.push(h+n+E)}return a.splice(a.indexOf(d),1),"{"+g.join(",")+h+"}"}}}({"":t},"",t,0)}var GW=qW;const ZW=tc(GW);class YW{constructor(e,n){Ve(this,"drive");Ve(this,"listener");Ve(this,"targetURL");this.listener=e,this.drive=n,this.targetURL=e.callInfo.data}async transmit(e,n){var r;if(n.type==="trigger"&&((r=n.trigger.data)==null?void 0:r.url)===this.targetURL)return e.map(i=>{var s;return{driveId:i.driveId,documentId:i.documentId,scope:i.scope,branch:i.branch,status:"SUCCESS",revision:((s=i.operations.at(-1))==null?void 0:s.index)??-1}});try{const{pushUpdates:i}=await eu(this.targetURL,Qc`
|
|
380
|
-
mutation pushUpdates($strands: [InputStrandUpdate!]) {
|
|
381
|
-
pushUpdates(strands: $strands) {
|
|
382
|
-
driveId
|
|
383
|
-
documentId
|
|
384
|
-
scope
|
|
385
|
-
branch
|
|
386
|
-
status
|
|
387
|
-
revision
|
|
388
|
-
error
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
`,{strands:e.map(s=>({...s,operations:s.operations.map(o=>({...o,input:ZW(o.input)}))}))});if(!i)throw new Error("Couldn't update listener revision");return i}catch(i){throw _t.error(i),i}return[]}}function KW(t,e=250){let n;return(r,...i)=>(n&&clearTimeout(n),new Promise((s,o)=>{r?t(...i).then(s).catch(o):n=setTimeout(()=>{t(...i).then(s).catch(o)},e)}))}const Sm=class Sm extends LW{constructor(){super(...arguments);Ve(this,"triggerUpdate",KW(this._triggerUpdate.bind(this),Sm.LISTENER_UPDATE_DELAY))}async getTransmitter(n,r){var i;return Promise.resolve((i=this.transmitters[n])==null?void 0:i[r])}driveHasListeners(n){return this.listenerState.has(n)}async addListener(n){var a;const r=n.driveId;this.listenerState.has(r)||this.listenerState.set(r,new Map),this.listenerState.get(r).set(n.listenerId,{block:n.block,driveId:n.driveId,pendingTimeout:"0",listener:n,listenerStatus:"CREATED",syncUnits:new Map});let s;switch((a=n.callInfo)==null?void 0:a.transmitterType){case"SwitchboardPush":{s=new YW(n,this.drive);break}case"PullResponder":{s=new Ps(n,this.drive,this);break}case"Internal":{s=new uR(n,this.drive);break}}if(!s)throw new Error("Transmitter not found");const o=this.transmitters[r]||{};return o[n.listenerId]=s,this.transmitters[r]=o,this.triggerUpdate(!0,{type:"local"}),Promise.resolve(s)}async removeListener(n,r){const i=this.listenerState.get(n);return i?Promise.resolve(i.delete(r)):!1}async removeSyncUnits(n,r){const i=this.listenerState.get(n);if(i){for(const[,s]of i)for(const o of r)s.syncUnits.delete(o.syncId);return Promise.resolve()}}async updateSynchronizationRevisions(n,r,i,s,o,a=!1){const c=this.listenerState.get(n);if(!c)return[];const u=[];for(const[,l]of c){if(u.find(f=>f.listenerId===l.listener.listenerId))continue;const d=await this.getTransmitter(n,l.listener.listenerId);if(d!=null&&d.transmit)for(const f of r){if(!this._checkFilter(l.listener.filter,f))continue;const h=l.syncUnits.get(f.syncId);if(!h||h.listenerRev<f.revision){u.push(l.listener);break}}}return u.length?(s==null||s(u),this.triggerUpdate(a,i,o)):[]}async updateListenerRevision(n,r,i,s){const o=this.listenerState.get(r);if(!o)return;const a=o.get(n);if(!a)return;const c=new Date().toISOString(),u=a.syncUnits.get(i);return u?(u.listenerRev=s,u.lastUpdated=c):a.syncUnits.set(i,{listenerRev:s,lastUpdated:c}),Promise.resolve()}async _triggerUpdate(n,r){var s;const i=[];for(const[o,a]of this.listenerState)for(const[c,u]of a){const l=await this.getTransmitter(o,c);if(!(l!=null&&l.transmit))continue;const d=await this.getListenerSyncUnits(o,u.listener.listenerId),f=[],h=d.map(m=>async()=>{const p=u.syncUnits.get(m.syncId);if(p&&p.listenerRev>=m.revision)return;const g=[];try{const y=await this.drive.getOperationData(o,m.syncId,{fromRevision:p==null?void 0:p.listenerRev});g.push(...y)}catch(y){_t.error(y)}g.length&&f.push({driveId:o,documentId:m.documentId,branch:m.branch,operations:g,scope:m.scope})});if(this.options.sequentialUpdates)for(const m of h)await m();else await Promise.all(h.map(m=>m()));if(f.length!=0){u.pendingTimeout=new Date(new Date().getTime()/1e3+300).toISOString(),u.listenerStatus="PENDING";try{const m=await l.transmit(f,n);u.pendingTimeout="0",u.listenerStatus="PENDING";const p=new Date().toISOString();for(const g of m){const y=d.find(v=>g.documentId===v.documentId&&g.scope===v.scope&&g.branch===v.branch);y?u.syncUnits.set(y.syncId,{lastUpdated:p,listenerRev:g.revision}):_t.warn(`Received revision for untracked unit for listener ${u.listener.listenerId}`,g)}for(const g of m){const y=g.status==="ERROR";if((s=g.error)!=null&&s.includes("Missing operations")){const v=await this._triggerUpdate(n,r);i.push(...v)}else if(i.push({listenerId:u.listener.listenerId,listenerRevisions:m}),y)throw new xr(g.status,void 0,g.error,g.error)}u.listenerStatus="SUCCESS"}catch(m){r==null||r(m,o,u),u.listenerStatus=m instanceof xr?m.status:"ERROR"}}}return i}_checkFilter(n,r){const{branch:i,documentId:s,scope:o,documentType:a}=r;return!!((!n.branch||n.branch.includes(i)||n.branch.includes("*"))&&(!n.documentId||n.documentId.includes(s)||n.documentId.includes("*"))&&(!n.scope||n.scope.includes(o)||n.scope.includes("*"))&&(!n.documentType||n.documentType.includes(a)||n.documentType.includes("*")))}getListenerSyncUnits(n,r,i){var a;const s=(a=this.listenerState.get(n))==null?void 0:a.get(r);if(!s)return[];const o=s.listener.filter;return this.drive.getSynchronizationUnits(n,o.documentId??["*"],o.scope??["*"],o.branch??["*"],o.documentType??["*"],i)}getListenerSyncUnitIds(n,r){var o;const i=(o=this.listenerState.get(n))==null?void 0:o.get(r);if(!i)return[];const s=i.listener.filter;return this.drive.getSynchronizationUnitsIds(n,s.documentId??["*"],s.scope??["*"],s.branch??["*"],s.documentType??["*"])}async initDrive(n){const{state:{local:{listeners:r}}}=n;for(const i of r)await this.addListener({block:i.block,driveId:n.state.global.id,filter:{branch:i.filter.branch??[],documentId:i.filter.documentId??[],documentType:i.filter.documentType,scope:i.filter.scope??[]},listenerId:i.listenerId,system:i.system,callInfo:i.callInfo??void 0,label:i.label??""})}async removeDrive(n){this.listenerState.delete(n);const r=this.transmitters[n];r&&await Promise.all(Object.values(r).map(i=>{var s;return(s=i.disconnect)==null?void 0:s.call(i)}))}getListener(n,r){const i=this.listenerState.get(n);if(!i)throw new Error("Drive not found");const s=i.get(r);if(!s)throw new Error("Listener not found");return Promise.resolve(s)}async getStrands(n,r,i){const s=await this.getListener(n,r),o=[],a=await this.drive.getDrive(n),c=await this.getListenerSyncUnits(n,r,a),u=i==null?void 0:i.limit;let l=0;const d=c.map(f=>async()=>{if(u&&l>=u||f.revision<0)return;const h=s.syncUnits.get(f.syncId);if(h&&h.listenerRev>=f.revision)return;const{documentId:m,driveId:p,scope:g,branch:y}=f;try{const v=await this.drive.getOperationData(p,f.syncId,{since:i==null?void 0:i.since,fromRevision:(i==null?void 0:i.fromRevision)??(h==null?void 0:h.listenerRev),limit:u?u-l:void 0},a);if(!v.length)return;l+=v.length,o.push({driveId:p,documentId:m,scope:g,branch:y,operations:v})}catch(v){_t.error(v);return}});if(this.options.sequentialUpdates)for(const f of d)await f();else await Promise.all(d.map(f=>f()));return o}};Ve(Sm,"LISTENER_UPDATE_DELAY",250);let rb=Sm;function XS(t,e){return e?Object.keys(t).reduce((n,r)=>{const i=e[r];return i!==void 0&&(n[r]=t[r].filter(s=>s.index<=i)),n},{global:[],local:[]}):t}function Ny(t,e){return!e||Object.entries(e).find(([n,r])=>{const i=t.operations[n].at(-1);return r===-1?i!==void 0:(i==null?void 0:i.index)!==r})===void 0}const JW=5e3;class XW extends MW{constructor(n,r=new xW,i=new sR,s=new aR,o){var a,c;super();Ve(this,"emitter",iR());Ve(this,"cache");Ve(this,"documentModels");Ve(this,"storage");Ve(this,"listenerStateManager");Ve(this,"triggerMap",new Map);Ve(this,"syncStatus",new Map);Ve(this,"queueManager");Ve(this,"initializePromise");Ve(this,"defaultDrivesManager");Ve(this,"options");Ve(this,"defaultDrivesManagerDelegate",{detachDrive:this.detachDrive.bind(this),emit:(...n)=>this.emit("defaultRemoteDrive",...n)});Ve(this,"queueDelegate",{checkDocumentExists:(n,r)=>this.storage.checkDocumentExists(n,r),processOperationJob:async({driveId:n,documentId:r,operations:i,options:s})=>r?this.addOperations(n,r,i,s):this.addDriveOperations(n,i,s),processActionJob:async({driveId:n,documentId:r,actions:i,options:s})=>r?this.addActions(n,r,i,s):this.addDriveActions(n,i,s),processJob:async n=>{if(Jh(n))return this.queueDelegate.processOperationJob(n);if(bW(n))return this.queueDelegate.processActionJob(n);throw new Error("Unknown job type",n)}});this.options={...o,defaultDrives:{...o==null?void 0:o.defaultDrives},listenerManager:{...nb,...o==null?void 0:o.listenerManager},taskQueueMethod:(o==null?void 0:o.taskQueueMethod)===void 0?tf.runAsap:o.taskQueueMethod},this.listenerStateManager=new rb(this,void 0,o==null?void 0:o.listenerManager),this.documentModels=n,this.storage=r,this.cache=i,this.queueManager=s,this.defaultDrivesManager=new IW(this,this.defaultDrivesManagerDelegate,o),(c=(a=this.storage).setStorageDelegate)==null||c.call(a,{getCachedOperations:async(u,l)=>{try{const d=await this.cache.getDocument(u,l);return d==null?void 0:d.operations}catch(d){_t.error(d);return}}}),this.initializePromise=this._initialize()}setDocumentModels(n){this.documentModels=[...n],this.emit("documentModels",[...n])}initializeDefaultRemoteDrives(){return this.defaultDrivesManager.initializeDefaultRemoteDrives()}getDefaultRemoteDrives(){return this.defaultDrivesManager.getDefaultRemoteDrives()}setDefaultDriveAccessLevel(n,r){return this.defaultDrivesManager.setDefaultDriveAccessLevel(n,r)}setAllDefaultDrivesAccessLevel(n){return this.defaultDrivesManager.setAllDefaultDrivesAccessLevel(n)}getOperationSource(n){return n.type==="local"?"push":"pull"}getCombinedSyncUnitStatus(n){if(!n.pull&&!n.push||n.pull==="INITIAL_SYNC")return"INITIAL_SYNC";if(n.push==="INITIAL_SYNC")return n.pull||"INITIAL_SYNC";const r=["ERROR","MISSING","CONFLICT","SYNCING","SUCCESS"];return Object.values(n).sort((s,o)=>r.indexOf(s)-r.indexOf(o))[0]}initSyncStatus(n,r){const i=Object.entries(r).reduce((s,[o,a])=>({...s,[o]:a!=="SYNCING"?a:"INITIAL_SYNC"}),{});this.syncStatus.set(n,i),this.emit("syncStatus",n,this.getCombinedSyncUnitStatus(i),void 0,i)}async initializeDriveSyncStatus(n,r){const i=await this.getSynchronizationUnitsIds(n),s={pull:r.state.local.triggers.length>0?"INITIAL_SYNC":void 0,push:r.state.local.listeners.length>0?"SUCCESS":void 0};if(!s.pull&&!s.push)return;const o=[n,...i.map(a=>a.syncId)];for(const a of o)this.initSyncStatus(a,s)}updateSyncUnitStatus(n,r,i){if(r===null){this.syncStatus.delete(n);return}const s=this.syncStatus.get(n);if(!s){this.initSyncStatus(n,r);return}if(Object.entries(r).some(([a,c])=>s[a]!==c)){const a=Object.entries(r).reduce((l,[d,f])=>({...l,[d]:l[d]==="INITIAL_SYNC"&&f==="SYNCING"?"INITIAL_SYNC":f}),s),c=this.getCombinedSyncUnitStatus(s),u=this.getCombinedSyncUnitStatus(a);this.syncStatus.set(n,a),c!==u&&this.emit("syncStatus",n,this.getCombinedSyncUnitStatus(a),i,a)}}async saveStrand(n,r){const i=n.operations.map(o=>({...o,scope:n.scope,branch:n.branch})),s=await(n.documentId?this.queueOperations(n.driveId,n.documentId,i,{source:r}):this.queueDriveOperations(n.driveId,i,{source:r}));if(s.status==="ERROR"){const o=n.documentId!==""?(await this.getSynchronizationUnitsIds(n.driveId,[n.documentId],[n.scope],[n.branch])).map(c=>c.syncId):[n.driveId],a=this.getOperationSource(r);for(const c of o)this.updateSyncUnitStatus(c,{[a]:s.status},s.error)}return this.emit("strandUpdate",n),s}handleListenerError(n,r,i){_t.error(`Listener ${i.listener.label??i.listener.listenerId} error:`,n);const s=n instanceof xr?n.status:"ERROR";this.updateSyncUnitStatus(r,{push:s},n)}shouldSyncRemoteDrive(n){return n.state.local.availableOffline&&n.state.local.triggers.length>0}async startSyncRemoteDrive(n){const r=await this.getDrive(n);let i=this.triggerMap.get(n);const s=await this.getSynchronizationUnitsIds(n,void 0,void 0,void 0,void 0,r);for(const o of r.state.local.triggers)if(!(i!=null&&i.get(o.id))){i||(i=new Map),this.updateSyncUnitStatus(n,{pull:"SYNCING"});for(const a of s)this.updateSyncUnitStatus(a.syncId,{pull:"SYNCING"});if(Ps.isPullResponderTrigger(o)){let a=!0;const c=Ps.setupPull(n,o,this.saveStrand.bind(this),u=>{const l=u instanceof xr?u.status:"ERROR";this.updateSyncUnitStatus(n,{pull:l},u),u instanceof Xc&&this.emit("clientStrandsError",n,o,u.response.status,u.message)},u=>{const l=u.filter(f=>f.status!=="SUCCESS");l.length<1&&this.updateSyncUnitStatus(n,{pull:"SUCCESS"});const d=u.filter(f=>f.documentId!=="").map(f=>f.documentId);if(this.getSynchronizationUnitsIds(n,d).then(f=>{for(const h of f){const m=l.find(p=>p.documentId===h.documentId);m?this.updateSyncUnitStatus(h.syncId,{pull:m.status},m.error):this.updateSyncUnitStatus(h.syncId,{pull:"SUCCESS"})}}).catch(console.error),a){a=!1;const f=r.state.local.listeners.find(h=>{var m;return o.data.url===((m=h.callInfo)==null?void 0:m.data)});f&&this.getSynchronizationUnitsRevision(n,s).then(h=>{for(const m of h)this.listenerStateManager.updateListenerRevision(f.listenerId,n,m.syncId,m.revision).catch(_t.error)}).catch(_t.error)}});i.set(o.id,c),this.triggerMap.set(n,i)}}}async stopSyncRemoteDrive(n){const i=(await this.getSynchronizationUnitsIds(n)).filter(o=>o.documentId!=="").map(o=>o.syncId),s=this.triggerMap.get(n);s==null||s.forEach(o=>o()),this.updateSyncUnitStatus(n,null);for(const o of i)this.updateSyncUnitStatus(o,null);return this.triggerMap.delete(n)}initialize(){return this.initializePromise}async _initialize(){await this.queueManager.init(this.queueDelegate,i=>{_t.error("Error initializing queue manager",i),n.push(i)});try{await this.defaultDrivesManager.removeOldremoteDrives()}catch(i){_t.error(i)}const n=[],r=await this.getDrives();for(const i of r)await this._initializeDrive(i).catch(s=>{_t.error(`Error initializing drive ${i}`,s),n.push(s)});return this.options.defaultDrives.loadOnInit!==!1&&await this.defaultDrivesManager.initializeDefaultRemoteDrives(),typeof window<"u"&&window.addEventListener("online",()=>{this.listenerStateManager.triggerUpdate(!1,{type:"local"},this.handleListenerError.bind(this)).catch(i=>{_t.error("Non handled error updating listeners",i)})}),n.length===0?null:n}async _initializeDrive(n){const r=await this.getDrive(n);await this.initializeDriveSyncStatus(n,r),this.shouldSyncRemoteDrive(r)&&await this.startSyncRemoteDrive(n),await this.listenerStateManager.initDrive(r)}async getSynchronizationUnits(n,r,i,s,o,a){const c=a||await this.getDrive(n),u=await this.getSynchronizationUnitsIds(n,r,i,s,o,c);return this.getSynchronizationUnitsRevision(n,u,c)}async getSynchronizationUnitsRevision(n,r,i){const s=i||await this.getDrive(n),o=await this.storage.getSynchronizationUnitsRevision(r),a=r.map(c=>({...c,lastUpdated:s.created,revision:-1}));for(const c of o){const u=a.find(l=>c.driveId===l.driveId&&c.documentId===l.documentId&&c.scope===l.scope&&c.branch===l.branch);u&&(u.revision=c.revision,u.lastUpdated=c.lastUpdated)}return a}async getSynchronizationUnitsIds(n,r,i,s,o,a){const u=(a??await this.getDrive(n)).state.global.nodes.filter(d=>Or(d)&&(!(r!=null&&r.length)||r.includes(d.id)||r.includes("*"))&&(!(o!=null&&o.length)||o.includes(d.documentType)||o.includes("*")));(!r||r.includes("*")||r.includes(""))&&(!(o!=null&&o.length)||o.includes("powerhouse/document-drive")||o.includes("*"))&&u.unshift({id:"",documentType:"powerhouse/document-drive",synchronizationUnits:[{syncId:"0",scope:"global",branch:"main"}]});const l=[];for(const d of u){const f=i!=null&&i.length||s!=null&&s.length?d.synchronizationUnits.filter(h=>(!(i!=null&&i.length)||i.includes(h.scope)||i.includes("*"))&&(!(s!=null&&s.length)||s.includes(h.branch)||s.includes("*"))):d.synchronizationUnits;f.length&&l.push(...f.map(h=>({driveId:n,documentId:d.id,syncId:h.syncId,documentType:d.documentType,scope:h.scope,branch:h.branch})))}return l}async getSynchronizationUnitIdInfo(n,r,i){const o=(i||await this.getDrive(n)).state.global.nodes.find(c=>Or(c)&&c.synchronizationUnits.find(u=>u.syncId===r));if(!o||!Or(o))return;const a=o.synchronizationUnits.find(c=>c.syncId===r);if(a)return{syncId:r,scope:a.scope,branch:a.branch,driveId:n,documentId:o.id,documentType:o.documentType}}async getSynchronizationUnit(n,r,i){const s=await this.getSynchronizationUnitIdInfo(n,r,i);if(!s)return;const{scope:o,branch:a,documentId:c,documentType:u}=s,l=await this.getDocument(n,c),d=l.operations[o]??[],f=d[d.length-1];return{syncId:r,scope:o,branch:a,driveId:n,documentId:c,documentType:u,lastUpdated:(f==null?void 0:f.timestamp)??l.lastModified,revision:(f==null?void 0:f.index)??0}}async getOperationData(n,r,i,s){const o=r==="0"?{documentId:"",scope:"global"}:await this.getSynchronizationUnitIdInfo(n,r,s);if(!o)throw new Error(`Invalid Sync Id ${r} in drive ${n}`);const u=((r==="0"?s||await this.getDrive(n):await this.getDocument(n,o.documentId)).operations[o.scope]??[]).filter(d=>Object.keys(i).length===0||(i.since===void 0||vW(i.since,d.timestamp))&&(i.fromRevision===void 0||d.index>i.fromRevision));return(i.limit?u.slice(0,i.limit):u).map(d=>({hash:d.hash,index:d.index,timestamp:d.timestamp,type:d.type,input:d.input,skip:d.skip,context:d.context,id:d.id}))}getDocumentModel(n){const r=this.documentModels.find(i=>i.documentModel.id===n);if(!r)throw new Error(`Document type ${n} not supported`);return r}getDocumentModels(){return[...this.documentModels]}async addDrive(n){const r=n.global.id||$w();if(!r)throw new Error("Invalid Drive Id");if((await this.storage.getDrives()).includes(r))throw new mW(r);const s=ef.createDocument({state:n});return await this.storage.createDrive(r,s),n.global.slug&&await this.cache.deleteDocument("drives-slug",n.global.slug),await this._initializeDrive(r),this.emit("driveAdded",s),s}async addRemoteDrive(n,r){const{id:i,name:s,slug:o,icon:a}=r.expectedDriveInfo||await ma(n),{pullFilter:c,pullInterval:u,availableOffline:l,sharingType:d,listeners:f,triggers:h}=r,m=await Ps.createPullResponderTrigger(i,n,{pullFilter:c,pullInterval:u});return await this.addDrive({global:{id:i,name:s,slug:o,icon:a??null},local:{triggers:[...h,m],listeners:f,availableOffline:l,sharingType:d}})}async registerPullResponderTrigger(n,r,i){return await Ps.createPullResponderTrigger(n,r,i)}async deleteDrive(n){(await Promise.allSettled([this.stopSyncRemoteDrive(n),this.listenerStateManager.removeDrive(n),this.cache.deleteDocument("drives",n),this.storage.deleteDrive(n)])).forEach(i=>{if(i.status==="rejected")throw i.reason})}getDrives(){return this.storage.getDrives()}async getDrive(n,r){let i;try{const a=await this.cache.getDocument("drives",n);if(a&&aa(a)&&(i=a,Ny(i,r==null?void 0:r.revisions)))return i}catch(a){_t.error("Error getting drive from cache",a)}const s=i??await this.storage.getDrive(n),o=this._buildDocument(s,r);if(aa(o))return r!=null&&r.revisions||this.cache.setDocument("drives",n,o).catch(_t.error),o;throw new Error(`Document with id ${n} is not a Document Drive`)}async getDriveBySlug(n,r){try{const o=await this.cache.getDocument("drives-slug",n);if(o&&aa(o))return o}catch(o){_t.error("Error getting drive from cache",o)}const i=await this.storage.getDriveBySlug(n),s=this._buildDocument(i,r);if(aa(s))return this.cache.setDocument("drives-slug",n,s).catch(_t.error),s;throw new Error(`Document with slug ${n} is not a Document Drive`)}async getDocument(n,r,i){let s;try{if(s=await this.cache.getDocument(n,r),s&&Ny(s,i==null?void 0:i.revisions))return s}catch(c){_t.error("Error getting document from cache",c)}const o=s??await this.storage.getDocument(n,r),a=this._buildDocument(o,i);return i!=null&&i.revisions||this.cache.setDocument(n,r,a).catch(_t.error),a}getDocuments(n){return this.storage.getDocuments(n)}async createDocument(n,r){let i;if(r.document){if(r.documentType!==r.document.documentType)throw new Error(`Provided document is not ${r.documentType}`);i=this._buildDocument(r.document).state}const s=r.document??this.getDocumentModel(r.documentType).utils.createDocument(),o={name:s.name,revision:s.revision,documentType:s.documentType,created:s.created,lastModified:s.lastModified,operations:{global:[],local:[]},initialState:s.initialState,clipboard:[],state:i??s.state};await this.storage.createDocument(n,r.id,o);for(const c of r.synchronizationUnits)this.initSyncStatus(c.syncId,{pull:this.triggerMap.get(n)?"INITIAL_SYNC":void 0,push:this.listenerStateManager.driveHasListeners(n)?"SUCCESS":void 0});const a=Object.values(s.operations).flat();return a.length&&(aa(s)?await this.storage.addDriveOperations(n,a,s):await this.storage.addDocumentOperations(n,r.id,a,s)),s}async deleteDocument(n,r){try{const i=await this.getSynchronizationUnitsIds(n,[r]);for(const s of i)this.updateSyncUnitStatus(s.syncId,null);await this.listenerStateManager.removeSyncUnits(n,i)}catch(i){_t.warn("Error deleting document",i)}return await this.cache.deleteDocument(n,r),this.storage.deleteDocument(n,r)}async _processOperations(n,r,i,s){const o=[],a=[],c=await this._addDocumentResultingStage(i,n,r);let u=this._buildDocument(c),l;const d=kW(s);for(const f of Object.keys(d)){const h=i.operations[f],m=NW(d[f]||[],h);if(m.length<1)continue;const p=CW(PW(h)),[g,y]=OW(p,m),b=(y.length<1?g:DW(p,g,AW)).filter(E=>p.length<1||RW(p[p.length-1],E));for(const E of b){let w=!1;if(y.length>0){const x=s.find(_=>_.hash===E.hash);w=!x||x.index!==E.index||x.skip!==E.skip}try{const x=this.options.taskQueueMethod,_=()=>this._performOperation(n,r,u,E,w),k=await(x?yW(_,x):_());u=k.document,a.push(...k.signals),o.push(k.operation)}catch(x){l=x instanceof xr?x:new xr("ERROR",E,x.message,x.cause);break}}}return{document:u,operationsApplied:o,signals:a,error:l}}async _addDocumentResultingStage(n,r,i,s){var c,u,l,d;const o=(s==null?void 0:s.revisions)!==void 0?XS(n.operations,s.revisions):n.operations,a=Vt.documentHelpers.garbageCollectDocumentOperations(o);for(const f of Object.keys(a)){const h=a[f].at(-1);h&&!h.resultingState&&(h.resultingState=await(i?(u=(c=this.storage).getOperationResultingState)==null?void 0:u.call(c,r,i,h.index,h.scope,"main"):(d=(l=this.storage).getDriveOperationResultingState)==null?void 0:d.call(l,r,h.index,h.scope,"main")))}return{...n,operations:a}}_buildDocument(n,r){if(n.state&&(!r||r.checkHashes===!1)&&Ny(n,r==null?void 0:r.revisions))return n;const i=this.getDocumentModel(n.documentType),s=(r==null?void 0:r.revisions)!==void 0?XS(n.operations,r.revisions):n.operations,o=Vt.documentHelpers.garbageCollectDocumentOperations(s);return Vt.replayDocument(n.initialState,o,i.reducer,void 0,n,void 0,{...r,checkHashes:(r==null?void 0:r.checkHashes)??!0,reuseOperationResultingState:(r==null?void 0:r.checkHashes)??!0})}async _performOperation(n,r,i,s,o=!1){var g,y,v,b;const a=this.getDocumentModel(i.documentType),c=[];let u=i;const l=s.scope,f=Vt.documentHelpers.garbageCollectDocumentOperations({...i.operations,[l]:Vt.documentHelpers.skipHeaderOperations(i.operations[l],s)})[l].at(-1);f&&!f.resultingState&&(f.resultingState=await(r?(y=(g=this.storage).getOperationResultingState)==null?void 0:y.call(g,n,r,f.index,f.scope,"main"):(b=(v=this.storage).getDriveOperationResultingState)==null?void 0:b.call(v,n,f.index,f.scope,"main")));const h=[];u=a.reducer(u,s,E=>{let w;switch(E.type){case"CREATE_CHILD_DOCUMENT":w=()=>this.createDocument(n,E.input);break;case"DELETE_CHILD_DOCUMENT":w=()=>this.deleteDocument(n,E.input.id);break;case"COPY_CHILD_DOCUMENT":w=()=>this.getDocument(n,E.input.id).then(x=>this.createDocument(n,{id:E.input.newId,documentType:x.documentType,document:x,synchronizationUnits:E.input.synchronizationUnits}));break}w&&h.push(()=>w().then(x=>({signal:E,result:x})))},{skip:s.skip,reuseOperationResultingState:!0});const p=u.operations[s.scope].filter(E=>E.index==s.index&&E.skip==s.skip).at(0);if(!p)throw new xr("ERROR",s,`Operation with index ${s.index}:${s.skip} was not applied.`);if(!p.error&&p.hash!==s.hash&&!o)throw new pW(s,p);for(const E of h){const w=await E();c.push(w)}return{document:u,signals:c,operation:p}}addOperation(n,r,i,s){return this.addOperations(n,r,[i],s)}async _addOperations(n,r,i){if(this.storage.addDocumentOperationsWithTransaction)await this.storage.addDocumentOperationsWithTransaction(n,r,i);else{const s=await this.storage.getDocument(n,r),o=await i(s);o.operations.length>0&&await this.storage.addDocumentOperations(n,r,o.operations,o.header)}}queueOperation(n,r,i,s){return this.queueOperations(n,r,[i],s)}async resultIfExistingOperations(n,r,i){try{const s=await this.getDocument(n,r);return i.find(a=>!a.id||!s.operations[a.scope].find(c=>c.id===a.id&&c.index===a.index&&c.type===a.type&&c.hash===a.hash))?void 0:{status:"SUCCESS",document:s,operations:i,signals:[]}}catch(s){s.message.includes(`Document with id ${r} not found`)||console.error(s);return}}async queueOperations(n,r,i,s){const o=await this.resultIfExistingOperations(n,r,i);if(o)return o;try{const a=await this.queueManager.addJob({driveId:n,documentId:r,operations:i,options:s});return new Promise((c,u)=>{const l=this.queueManager.on("jobCompleted",(f,h)=>{f.jobId===a&&(l(),d(),c(h))}),d=this.queueManager.on("jobFailed",(f,h)=>{f.jobId===a&&(l(),d(),u(h))})})}catch(a){throw _t.error("Error adding job",a),a}}async queueAction(n,r,i,s){return this.queueActions(n,r,[i],s)}async queueActions(n,r,i,s){try{const o=await this.queueManager.addJob({driveId:n,documentId:r,actions:i,options:s});return new Promise((a,c)=>{const u=this.queueManager.on("jobCompleted",(d,f)=>{d.jobId===o&&(u(),l(),a(f))}),l=this.queueManager.on("jobFailed",(d,f)=>{d.jobId===o&&(u(),l(),c(f))})})}catch(o){throw _t.error("Error adding job",o),o}}async queueDriveAction(n,r,i){return this.queueDriveActions(n,[r],i)}async queueDriveActions(n,r,i){try{const s=await this.queueManager.addJob({driveId:n,actions:r,options:i});return new Promise((o,a)=>{const c=this.queueManager.on("jobCompleted",(l,d)=>{l.jobId===s&&(c(),u(),o(d))}),u=this.queueManager.on("jobFailed",(l,d)=>{l.jobId===s&&(c(),u(),a(d))})})}catch(s){throw _t.error("Error adding drive job",s),s}}async addOperations(n,r,i,s){const o=await this.resultIfExistingOperations(n,r,i);if(o)return o;let a;const c=[],u=[];let l;try{await this._addOperations(n,r,async y=>{const v=await this._processOperations(n,r,y,i);if(!v.document)throw _t.error("Invalid document"),v.error??new Error("Invalid document");return a=v.document,l=v.error,u.push(...v.signals),c.push(...v.operationsApplied),{operations:v.operationsApplied,header:v.document,newState:a.state}}),a&&this.cache.setDocument(n,r,a).catch(_t.error);const{scopes:d,branches:f}=c.reduce((y,v)=>(y.scopes.includes(v.scope)||y.scopes.push(v.scope),y),{scopes:[],branches:["main"]}),h=await this.getSynchronizationUnits(n,[r],d,f),p=c.find(y=>!i.find(v=>v.id===y.id&&v.index===y.index&&v.skip===y.skip&&v.hash===y.hash))?{type:"local"}:(s==null?void 0:s.source)??{type:"local"},g=this.getOperationSource(p);if(this.listenerStateManager.updateSynchronizationRevisions(n,h,p,()=>{this.updateSyncUnitStatus(n,{[g]:"SYNCING"});for(const y of h)this.updateSyncUnitStatus(y.syncId,{[g]:"SYNCING"})},this.handleListenerError.bind(this),(s==null?void 0:s.forceSync)??p.type==="local").then(y=>{y.length&&this.updateSyncUnitStatus(n,{[g]:"SUCCESS"});for(const v of h)this.updateSyncUnitStatus(v.syncId,{[g]:"SUCCESS"})}).catch(y=>{_t.error("Non handled error updating sync revision",y),this.updateSyncUnitStatus(n,{[g]:"ERROR"},y);for(const v of h)this.updateSyncUnitStatus(v.syncId,{[g]:"ERROR"},y)}),l)throw l;return{status:"SUCCESS",document:a,operations:c,signals:u}}catch(d){const f=d instanceof xr?d:new xr("ERROR",void 0,d.message,d.cause);return{status:f.status,error:f,document:a,operations:c,signals:u}}}addDriveOperation(n,r,i){return this.addDriveOperations(n,[r],i)}async clearStorage(){var n,r;for(const i of await this.getDrives())await this.deleteDrive(i);await((r=(n=this.storage).clearStorage)==null?void 0:r.call(n))}async _addDriveOperations(n,r){if(this.storage.addDriveOperationsWithTransaction)return this.storage.addDriveOperationsWithTransaction(n,r);{const i=await this.storage.getDrive(n),s=await r(i);return s.operations.length>0&&await this.storage.addDriveOperations(n,s.operations,s.header),s}}queueDriveOperation(n,r,i){return this.queueDriveOperations(n,[r],i)}async resultIfExistingDriveOperations(n,r){try{const i=await this.getDrive(n);return r.find(o=>!o.id||!i.operations[o.scope].find(a=>a.id===o.id&&a.index===o.index&&a.type===o.type&&a.hash===o.hash))?void 0:{status:"SUCCESS",document:i,operations:r,signals:[]}}catch(i){console.error(i);return}}async queueDriveOperations(n,r,i){const s=await this.resultIfExistingDriveOperations(n,r);if(s)return s;try{const o=await this.queueManager.addJob({driveId:n,operations:r,options:i});return new Promise((a,c)=>{const u=this.queueManager.on("jobCompleted",(d,f)=>{d.jobId===o&&(u(),l(),a(f))}),l=this.queueManager.on("jobFailed",(d,f)=>{d.jobId===o&&(u(),l(),c(f))})})}catch(o){throw _t.error("Error adding drive job",o),o}}async addDriveOperations(n,r,i){let s;const o=[],a=[];let c;const u=await this.resultIfExistingDriveOperations(n,r);if(u)return u;try{if(await this._addDriveOperations(n,async d=>{const f=await this._processOperations(n,void 0,d,r.slice());return s=f.document,o.push(...f.operationsApplied),a.push(...f.signals),c=f.error,{operations:f.operationsApplied,header:f.document}}),!s||!aa(s))throw c??new Error("Invalid Document Drive document");this.cache.setDocument("drives",n,s).catch(_t.error);for(const d of o)switch(d.type){case"ADD_LISTENER":{await this.addListener(n,d);break}case"REMOVE_LISTENER":{await this.removeListener(n,d);break}}const l=o.filter(d=>d.scope==="global").slice().pop();if(l){const f=o.find(m=>!r.find(p=>p.id===m.id&&p.index===m.index&&p.skip===m.skip&&p.hash===m.hash))?{type:"local"}:(i==null?void 0:i.source)??{type:"local"},h=this.getOperationSource(f);this.listenerStateManager.updateSynchronizationRevisions(n,[{syncId:"0",driveId:n,documentId:"",scope:"global",branch:"main",documentType:"powerhouse/document-drive",lastUpdated:l.timestamp,revision:l.index}],f,()=>{this.updateSyncUnitStatus(n,{[h]:"SYNCING"})},this.handleListenerError.bind(this),(i==null?void 0:i.forceSync)??f.type==="local").then(m=>{m.length&&this.updateSyncUnitStatus(n,{[h]:"SUCCESS"})}).catch(m=>{_t.error("Non handled error updating sync revision",m),this.updateSyncUnitStatus(n,{[h]:"ERROR"},m)})}if(this.shouldSyncRemoteDrive(s)?this.startSyncRemoteDrive(s.state.global.id):this.stopSyncRemoteDrive(s.state.global.id),c)throw c;return{status:"SUCCESS",document:s,operations:o,signals:a}}catch(l){const d=l instanceof xr?l:new xr("ERROR",void 0,l.message,l.cause);return{status:d.status,error:d,document:s,operations:o,signals:a}}}_buildOperations(n,r){const i=[],{reducer:s}=this.getDocumentModel(n.documentType);for(const o of r){n=s(n,o);const a=n.operations[o.scope].slice().pop();if(!a)throw new Error("Error creating operations");i.push(a)}return i}async addAction(n,r,i,s){return this.addActions(n,r,[i],s)}async addActions(n,r,i,s){const o=await this.getDocument(n,r),a=this._buildOperations(o,i);return this.addOperations(n,r,a,s)}async addDriveAction(n,r,i){return this.addDriveActions(n,[r],i)}async addDriveActions(n,r,i){const s=await this.getDrive(n),o=this._buildOperations(s,r);return await this.addDriveOperations(n,o,i)}async addInternalListener(n,r,i){const s={callInfo:{data:"",name:"Interal",transmitterType:"Internal"},system:!0,...i};await this.addDriveAction(n,Jn.addListener({listener:s}));const o=await this.getTransmitter(n,i.listenerId);if(!o)throw _t.error("Internal listener not found"),new Error("Internal listener not found");if(!(o instanceof uR))throw _t.error("Listener is not an internal transmitter"),new Error("Listener is not an internal transmitter");return o.setReceiver(r),o}async detachDrive(n){const r=await this.getDrive(n),i=r.state.local.listeners||[],s=r.state.local.triggers||[];for(const o of i)await this.addDriveAction(n,Jn.removeListener({listenerId:o.listenerId}));for(const o of s)await this.addDriveAction(n,Jn.removeTrigger({triggerId:o.id}));await this.addDriveAction(n,Jn.setSharingType({type:"LOCAL"}))}async addListener(n,r){var s,o,a;const{listener:i}=r.input;await this.listenerStateManager.addListener({...i,driveId:n,label:i.label??"",system:i.system??!1,filter:{branch:i.filter.branch??[],documentId:i.filter.documentId??[],documentType:i.filter.documentType??[],scope:i.filter.scope??[]},callInfo:{data:((s=i.callInfo)==null?void 0:s.data)??"",name:((o=i.callInfo)==null?void 0:o.name)??"PullResponder",transmitterType:((a=i.callInfo)==null?void 0:a.transmitterType)??"PullResponder"}})}async removeListener(n,r){const{listenerId:i}=r.input;await this.listenerStateManager.removeListener(n,i)}getTransmitter(n,r){return this.listenerStateManager.getTransmitter(n,r)}getListener(n,r){return this.listenerStateManager.getListener(n,r)}getSyncStatus(n){const r=this.syncStatus.get(n);return r?this.getCombinedSyncUnitStatus(r):new oR(`Sync status not found for syncUnitId: ${n}`,n)}on(n,r){return this.emitter.on(n,r)}emit(n,...r){return this.emitter.emit(n,...r)}}const QW=SW(XW),dR=Object.prototype.toString;function tu(t){switch(dR.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ys(t,Error)}}function Yu(t,e){return dR.call(t)===`[object ${e}]`}function jw(t){return Yu(t,"ErrorEvent")}function QS(t){return Yu(t,"DOMError")}function eq(t){return Yu(t,"DOMException")}function os(t){return Yu(t,"String")}function Uw(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Bw(t){return t===null||Uw(t)||typeof t!="object"&&typeof t!="function"}function Za(t){return Yu(t,"Object")}function ug(t){return typeof Event<"u"&&Ys(t,Event)}function tq(t){return typeof Element<"u"&&Ys(t,Element)}function nq(t){return Yu(t,"RegExp")}function lg(t){return!!(t&&t.then&&typeof t.then=="function")}function rq(t){return Za(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function fR(t){return typeof t=="number"&&t!==t}function Ys(t,e){try{return t instanceof e}catch{return!1}}function hR(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function nu(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function em(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{hR(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function iq(t,e,n=!1){return os(t)?nq(e)?e.test(t):os(e)?n?t===e:t.includes(e):!1:!1}function Ku(t,e=[],n=!1){return e.some(r=>iq(t,r,n))}function sq(t,e,n=250,r,i,s,o){if(!s.exception||!s.exception.values||!o||!Ys(o.originalException,Error))return;const a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;a&&(s.exception.values=oq(ib(t,e,i,o.originalException,r,s.exception.values,a,0),n))}function ib(t,e,n,r,i,s,o,a){if(s.length>=n+1)return s;let c=[...s];if(Ys(r[i],Error)){ex(o,a);const u=t(e,r[i]),l=c.length;tx(u,i,l,a),c=ib(t,e,n,r[i],i,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(Ys(u,Error)){ex(o,a);const d=t(e,u),f=c.length;tx(d,`errors[${l}]`,f,a),c=ib(t,e,n,u,i,[d,...c],d,f)}}),c}function ex(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function tx(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function oq(t,e){return t.map(n=>(n.value&&(n.value=nu(n.value,e)),n))}function vh(t){return t&&t.Math==Math?t:void 0}const Mt=typeof globalThis=="object"&&vh(globalThis)||typeof window=="object"&&vh(window)||typeof self=="object"&&vh(self)||typeof global=="object"&&vh(global)||function(){return this}()||{};function zw(){return Mt}function pR(t,e,n){const r=n||Mt,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const ru=zw(),aq=80;function qo(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,o=0;const a=" > ",c=a.length;let u;const l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||aq;for(;n&&s++<r&&(u=cq(n,l),!(u==="html"||s>1&&o+i.length*c+u.length>=d));)i.push(u),o+=u.length,n=n.parentNode;return i.reverse().join(a)}catch{return"<unknown>"}}function cq(t,e){const n=t,r=[];let i,s,o,a,c;if(!n||!n.tagName)return"";if(ru.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const u=e&&e.length?e.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(u&&u.length)u.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&os(i))for(s=i.split(/\s+/),c=0;c<s.length;c++)r.push(`.${s[c]}`);const l=["aria-label","type","name","title","alt"];for(c=0;c<l.length;c++)o=l[c],a=n.getAttribute(o),a&&r.push(`[${o}="${a}"]`);return r.join("")}function uq(){try{return ru.document.location.href}catch{return""}}function lq(t){return ru.document&&ru.document.querySelector?ru.document.querySelector(t):null}function mR(t){if(!ru.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const Ju=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,dq="Sentry Logger ",tm=["debug","info","warn","error","log","assert","trace"],nm={};function Ya(t){if(!("console"in Mt))return t();const e=Mt.console,n={},r=Object.keys(nm);r.forEach(i=>{const s=nm[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function fq(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Ju?tm.forEach(n=>{e[n]=(...r)=>{t&&Ya(()=>{Mt.console[n](`${dq}[${n}]:`,...r)})}}):tm.forEach(n=>{e[n]=()=>{}}),e}const me=fq(),hq=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function pq(t){return t==="http"||t==="https"}function Xu(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function mq(t){const e=hq.exec(t);if(!e){Ya(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,i="",s,o="",a]=e.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const d=u.match(/^\d+/);d&&(u=d[0])}return gR({host:s,pass:i,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function gR(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function gq(t){if(!Ju)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(me.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?pq(r)?e&&isNaN(parseInt(e,10))?(me.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(me.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(me.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function yq(t){const e=typeof t=="string"?mq(t):gR(t);if(!(!e||!gq(e)))return e}class Ji extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function Vn(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&yR(i,r),t[e]=i}function Go(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Ju&&me.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function yR(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,Go(t,"__sentry_original__",e)}catch{}}function Vw(t){return t.__sentry_original__}function vq(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function vR(t){if(tu(t))return{message:t.message,name:t.name,stack:t.stack,...rx(t)};if(ug(t)){const e={type:t.type,target:nx(t.target),currentTarget:nx(t.currentTarget),...rx(t)};return typeof CustomEvent<"u"&&Ys(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function nx(t){try{return tq(t)?qo(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function rx(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function bq(t,e=40){const n=Object.keys(vR(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return nu(n[0],e);for(let r=n.length;r>0;r--){const i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:nu(i,e)}return""}function gr(t){return sb(t,new Map)}function sb(t,e){if(_q(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))typeof t[i]<"u"&&(r[i]=sb(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(sb(i,e))}),r}return t}function _q(t){if(!Za(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const bR=50,ix=/\(error: (.*)\)/,sx=/captureMessage|captureException/;function _R(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{const i=[],s=n.split(`
|
|
392
|
-
`);for(let o=r;o<s.length;o++){const a=s[o];if(a.length>1024)continue;const c=ix.test(a)?a.replace(ix,"$1"):a;if(!c.match(/\S*Error: /)){for(const u of e){const l=u(c);if(l){i.push(l);break}}if(i.length>=bR)break}}return Eq(i)}}function wq(t){return Array.isArray(t)?_R(...t):t}function Eq(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),sx.test(e[e.length-1].function||"")&&(e.pop(),sx.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,bR).map(n=>({...n,filename:n.filename||e[e.length-1].filename,function:n.function||"?"}))}const Ay="<anonymous>";function Ks(t){try{return!t||typeof t!="function"?Ay:t.name||Ay}catch{return Ay}}const ep={},ox={};function fc(t,e){ep[t]=ep[t]||[],ep[t].push(e)}function hc(t,e){ox[t]||(e(),ox[t]=!0)}function Oi(t,e){const n=t&&ep[t];if(n)for(const r of n)try{r(e)}catch(i){Ju&&me.error(`Error while triggering instrumentation handler.
|
|
393
|
-
Type: ${t}
|
|
394
|
-
Name: ${Ks(r)}
|
|
395
|
-
Error:`,i)}}function wR(t){const e="console";fc(e,t),hc(e,Sq)}function Sq(){"console"in Mt&&tm.forEach(function(t){t in Mt.console&&Vn(Mt.console,t,function(e){return nm[t]=e,function(...n){Oi("console",{args:n,level:t});const i=nm[t];i&&i.apply(Mt.console,n)}})})}function Sn(){const t=Mt,e=t.crypto||t.msCrypto;let n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function ER(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function _o(t){const{message:e,event_id:n}=t;if(e)return e;const r=ER(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ob(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function Ka(t,e){const n=ER(t);if(!n)return;const r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...e},e&&"data"in e){const s={...i&&i.data,...e.data};n.mechanism.data=s}}function ax(t){if(t&&t.__sentry_captured__)return!0;try{Go(t,"__sentry_captured__",!0)}catch{}return!1}function SR(t){return Array.isArray(t)?t:[t]}const Pc=Mt,xq=1e3;let cx,ab,cb;function xR(t){const e="dom";fc(e,t),hc(e,Tq)}function Tq(){if(!Pc.document)return;const t=Oi.bind(null,"dom"),e=ux(t,!0);Pc.document.addEventListener("click",e,!1),Pc.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=Pc[n]&&Pc[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Vn(r,"addEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},l=u[s]=u[s]||{refCount:0};if(!l.handler){const d=ux(t);l.handler=d,i.call(this,s,d,a)}l.refCount++}catch{}return i.call(this,s,o,a)}}),Vn(r,"removeEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},l=u[s];l&&(l.refCount--,l.refCount<=0&&(i.call(this,s,l.handler,a),l.handler=void 0,delete u[s]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,a)}}))})}function Iq(t){if(t.type!==ab)return!1;try{if(!t.target||t.target._sentryId!==cb)return!1}catch{}return!0}function Oq(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function ux(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Cq(n);if(Oq(n.type,r))return;Go(n,"_sentryCaptured",!0),r&&!r._sentryId&&Go(r,"_sentryId",Sn());const i=n.type==="keypress"?"input":n.type;Iq(n)||(t({event:n,name:i,global:e}),ab=n.type,cb=r?r._sentryId:void 0),clearTimeout(cx),cx=Pc.setTimeout(()=>{cb=void 0,ab=void 0},xq)}}function Cq(t){try{return t.target}catch{return null}}const ub=zw();function TR(){if(!("fetch"in ub))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function lb(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function IR(){if(typeof EdgeRuntime=="string")return!0;if(!TR())return!1;if(lb(ub.fetch))return!0;let t=!1;const e=ub.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=lb(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){Ju&&me.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function dg(t){const e="fetch";fc(e,t),hc(e,kq)}function kq(){IR()&&Vn(Mt,"fetch",function(t){return function(...e){const{method:n,url:r}=Dq(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Oi("fetch",{...i}),t.apply(Mt,e).then(s=>{const o={...i,endTimestamp:Date.now(),response:s};return Oi("fetch",o),s},s=>{const o={...i,endTimestamp:Date.now(),error:s};throw Oi("fetch",o),s})}})}function db(t,e){return!!t&&typeof t=="object"&&!!t[e]}function lx(t){return typeof t=="string"?t:t?db(t,"url")?t.url:t.toString?t.toString():"":""}function Dq(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:lx(n),method:db(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:lx(e),method:db(e,"method")?String(e.method).toUpperCase():"GET"}}let bh=null;function OR(t){const e="error";fc(e,t),hc(e,Rq)}function Rq(){bh=Mt.onerror,Mt.onerror=function(t,e,n,r,i){return Oi("error",{column:r,error:i,line:n,msg:t,url:e}),bh&&!bh.__SENTRY_LOADER__?bh.apply(this,arguments):!1},Mt.onerror.__SENTRY_INSTRUMENTED__=!0}let _h=null;function CR(t){const e="unhandledrejection";fc(e,t),hc(e,Nq)}function Nq(){_h=Mt.onunhandledrejection,Mt.onunhandledrejection=function(t){return Oi("unhandledrejection",t),_h&&!_h.__SENTRY_LOADER__?_h.apply(this,arguments):!0},Mt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const wh=zw();function Aq(){const t=wh.chrome,e=t&&t.app&&t.app.runtime,n="history"in wh&&!!wh.history.pushState&&!!wh.history.replaceState;return!e&&n}const ml=Mt;let Eh;function fg(t){const e="history";fc(e,t),hc(e,Pq)}function Pq(){if(!Aq())return;const t=ml.onpopstate;ml.onpopstate=function(...n){const r=ml.location.href,i=Eh;if(Eh=r,Oi("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=Eh,o=String(i);Eh=o,Oi("history",{from:s,to:o})}return n.apply(this,r)}}Vn(ml.history,"pushState",e),Vn(ml.history,"replaceState",e)}const Mq=Mt,Ms="__sentry_xhr_v3__";function hg(t){const e="xhr";fc(e,t),hc(e,Lq)}function Lq(){if(!Mq.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;Vn(t,"open",function(e){return function(...n){const r=Date.now(),i=os(n[0])?n[0].toUpperCase():void 0,s=Fq(n[1]);if(!i||!s)return e.apply(this,n);this[Ms]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const a=this[Ms];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}const c={args:[i,s],endTimestamp:Date.now(),startTimestamp:r,xhr:this};Oi("xhr",c)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Vn(this,"onreadystatechange",function(a){return function(...c){return o(),a.apply(this,c)}}):this.addEventListener("readystatechange",o),Vn(this,"setRequestHeader",function(a){return function(...c){const[u,l]=c,d=this[Ms];return d&&os(u)&&os(l)&&(d.request_headers[u.toLowerCase()]=l),a.apply(this,c)}}),e.apply(this,n)}}),Vn(t,"send",function(e){return function(...n){const r=this[Ms];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const i={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return Oi("xhr",i),e.apply(this,n)}})}function Fq(t){if(os(t))return t;try{return t.toString()}catch{}}function $q(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function jq(){return"npm"}function Uq(){return!$q()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function dx(){return typeof window<"u"&&(!Uq()||Bq())}function Bq(){return Mt.process!==void 0&&Mt.process.type==="renderer"}function zq(){const t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let s=0;s<e.length;s++)if(e[s]===i)return!0;return e.push(i),!1}function r(i){if(t)e.delete(i);else for(let s=0;s<e.length;s++)if(e[s]===i){e.splice(s,1);break}}return[n,r]}function vi(t,e=100,n=1/0){try{return fb("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function kR(t,e=3,n=100*1024){const r=vi(t,e);return qq(r)>n?kR(t,e-1,n):r}function fb(t,e,n=1/0,r=1/0,i=zq()){const[s,o]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&!fR(e))return e;const a=Vq(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(e))return"[Circular ~]";const u=e;if(u&&typeof u.toJSON=="function")try{const h=u.toJSON();return fb("",h,c-1,r,i)}catch{}const l=Array.isArray(e)?[]:{};let d=0;const f=vR(e);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){l[h]="[MaxProperties ~]";break}const m=f[h];l[h]=fb(h,m,c-1,r,i),d++}return o(e),l}function Vq(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(hR(e))return"[VueViewModel]";if(rq(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${Ks(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=Hq(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Hq(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function Wq(t){return~-encodeURI(t).split(/%..|./).length}function qq(t){return Wq(JSON.stringify(t))}var Os;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(Os||(Os={}));function Cu(t){return new Fr(e=>{e(t)})}function Hw(t){return new Fr((e,n)=>{n(t)})}class Fr{constructor(e){Fr.prototype.__init.call(this),Fr.prototype.__init2.call(this),Fr.prototype.__init3.call(this),Fr.prototype.__init4.call(this),this._state=Os.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new Fr((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Fr((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(Os.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Os.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===Os.PENDING){if(lg(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Os.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Os.RESOLVED&&n[1](this._value),this._state===Os.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Gq(t){const e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function i(o){if(!n())return Hw(new Ji("Not adding Promise because buffer limit was reached."));const a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function s(o){return new Fr((a,c)=>{let u=e.length;if(!u)return a(!0);const l=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(d=>{Cu(d).then(()=>{--u||(clearTimeout(l),a(!0))},c)})})}return{$:e,add:i,drain:s}}function ka(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const Zq=["fatal","error","warning","log","info","debug"];function DR(t){return t==="warn"?"warning":Zq.includes(t)?t:"log"}const RR=1e3;function Cf(){return Date.now()/RR}function Yq(){const{performance:t}=Mt;if(!t||!t.now)return Cf;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/RR}const kf=Yq(),Wr=(()=>{const{performance:t}=Mt;if(!t||!t.now)return;const e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,o=t.timing&&t.timing.navigationStart,c=typeof o=="number"?Math.abs(o+n-r):e,u=c<e;return s||u?i<=c?t.timeOrigin:o:r})(),hb="baggage",NR="sentry-",Kq=/^sentry-/,Jq=8192;function Xq(t){if(!os(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,i)=>{const s=fx(i);for(const o of Object.keys(s))r[o]=s[o];return r},{});else{if(!t)return;e=fx(t)}const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(Kq)){const o=i.slice(NR.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function AR(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${NR}${r}`]=i),n),{});return Qq(e)}function fx(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function Qq(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=i===0?s:`${e},${s}`;return o.length>Jq?(Ju&&me.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const eG=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function tG(t){if(!t)return;const e=t.match(eG);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function nG(t,e){const n=tG(t),r=Xq(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||Sn(),parentSpanId:s||Sn().substring(16),spanId:Sn().substring(16),sampled:o,dsc:r||{}}:{traceId:i||Sn(),spanId:Sn().substring(16)}}function Ww(t=Sn(),e=Sn().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function Jo(t,e=[]){return[t,e]}function rG(t,e){const[n,r]=t;return[n,[...r,e]]}function hx(t,e){const n=t[1];for(const r of n){const i=r[0].type;if(e(r,i))return!0}return!1}function pb(t,e){return(e||new TextEncoder).encode(t)}function iG(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(o){typeof i=="string"?i=typeof o=="string"?i+o:[pb(i,e),o]:i.push(typeof o=="string"?pb(o,e):o)}for(const o of r){const[a,c]=o;if(s(`
|
|
396
|
-
${JSON.stringify(a)}
|
|
397
|
-
`),typeof c=="string"||c instanceof Uint8Array)s(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(vi(c))}s(u)}}return typeof i=="string"?i:sG(i)}function sG(t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function oG(t,e){const n=typeof t.data=="string"?pb(t.data,e):t.data;return[gr({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const aG={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function px(t){return aG[t]}function qw(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function PR(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:Xu(r)},...i&&{trace:gr({...i})}}}function cG(t,e,n){const r=[{type:"client_report"},{timestamp:Cf(),discarded_events:t}];return Jo(e?{dsn:e}:{},[r])}const uG=60*1e3;function lG(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?uG:r-e}function dG(t,e){return t[e]||t.all||0}function MR(t,e,n=Date.now()){return dG(t,e)>n}function LR(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,u,,,l]=a.split(":",5),d=parseInt(c,10),f=(isNaN(d)?60:d)*1e3;if(!u)i.all=r+f;else for(const h of u.split(";"))h==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(i[h]=r+f):i[h]=r+f}else o?i.all=r+lG(o,r):e===429&&(i.all=r+60*1e3);return i}function fG(t,e){return t??e()}function Py(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const et=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,pg="production";function Gw(){return pR("globalEventProcessors",()=>[])}function hG(t){Gw().push(t)}function rm(t,e,n,r=0){return new Fr((i,s)=>{const o=t[r];if(e===null||typeof o!="function")i(e);else{const a=o({...e},n);et&&o.id&&a===null&&me.log(`Event processor "${o.id}" dropped event`),lg(a)?a.then(c=>rm(t,c,n,r+1).then(i)).then(null,s):rm(t,a,n,r+1).then(i).then(null,s)}})}function FR(t){const e=kf(),n={sid:Sn(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>pG(n)};return t&&Ja(n,t),n}function Ja(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||kf(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Sn()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function $R(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),Ja(t,n)}function pG(t){return gr({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}const mG=0,jR=1;function Zw(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:a,origin:c}=Dn(t);return gr({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:a,trace_id:n,origin:c})}function mg(t){const{traceId:e,spanId:n}=t.spanContext(),r=Yw(t);return Ww(e,n,r)}function gg(t){return typeof t=="number"?mx(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?mx(t.getTime()):kf()}function mx(t){return t>9999999999?t/1e3:t}function Dn(t){return gG(t)?t.getSpanJSON():typeof t.toJSON=="function"?t.toJSON():{}}function gG(t){return typeof t.getSpanJSON=="function"}function Yw(t){const{traceFlags:e}=t.spanContext();return!!(e&jR)}function UR(t,e,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||Sn(),timestamp:e.timestamp||Cf()},u=n.integrations||t.integrations.map(g=>g.name);yG(c,t),_G(c,u),e.type===void 0&&vG(c,t.stackParser);const l=EG(r,n.captureContext);n.mechanism&&Ka(c,n.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],f=MG().getScopeData();if(s){const g=s.getScopeData();_x(f,g)}if(l){const g=l.getScopeData();_x(f,g)}const h=[...n.attachments||[],...f.attachments];h.length&&(n.attachments=h),HR(c,f);const m=[...d,...Gw(),...f.eventProcessors];return rm(m,c,n).then(g=>(g&&bG(g),typeof o=="number"&&o>0?wG(g,o,a):g))}function yG(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:pg),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&i!==void 0&&(t.dist=i),t.message&&(t.message=nu(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=nu(o.value,s));const a=t.request;a&&a.url&&(a.url=nu(a.url,s))}const gx=new WeakMap;function vG(t,e){const n=Mt._sentryDebugIds;if(!n)return;let r;const i=gx.get(e);i?r=i:(r=new Map,gx.set(e,r));const s=Object.keys(n).reduce((o,a)=>{let c;const u=r.get(a);u?c=u:(c=e(a),r.set(a,c));for(let l=c.length-1;l>=0;l--){const d=c[l];if(d.filename){o[d.filename]=n[a];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=s[a.filename])})})}catch{}}function bG(t){const e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function _G(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function wG(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:vi(i.data,e,n)}}))},...t.user&&{user:vi(t.user,e,n)},...t.contexts&&{contexts:vi(t.contexts,e,n)},...t.extra&&{extra:vi(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=vi(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>{const s=Dn(i).data;return s&&(i.data=vi(s,e,n)),i})),r}function EG(t,e){if(!e)return t;const n=t?t.clone():new js;return n.update(e),n}function SG(t){if(t)return xG(t)?{captureContext:t}:IG(t)?{captureContext:t}:t}function xG(t){return t instanceof js||typeof t=="function"}const TG=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function IG(t){return Object.keys(t).some(e=>TG.includes(e))}function Df(t,e){return Qn().captureException(t,SG(e))}function yx(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return Qn().captureMessage(t,n,r)}function yg(t,e){return Qn().captureEvent(t,e)}function Zo(t,e){Qn().addBreadcrumb(t,e)}function OG(t,e){Qn().setContext(t,e)}function CG(t){Qn().setUser(t)}function BR(...t){const e=Qn();if(t.length===2){const[n,r]=t;return n?e.withScope(()=>(e.getStackTop().scope=n,r(n))):e.withScope(r)}return e.withScope(t[0])}function Lt(){return Qn().getClient()}function Gr(){return Qn().getScope()}function vx(t){const e=Lt(),n=Xo(),r=Gr(),{release:i,environment:s=pg}=e&&e.getOptions()||{},{userAgent:o}=Mt.navigator||{},a=FR({release:i,environment:s,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...t}),c=n.getSession();return c&&c.status==="ok"&&Ja(c,{status:"exited"}),zR(),n.setSession(a),r.setSession(a),a}function zR(){const t=Xo(),e=Gr(),n=e.getSession()||t.getSession();n&&$R(n),VR(),t.setSession(),e.setSession()}function VR(){const t=Xo(),e=Gr(),n=Lt(),r=e.getSession()||t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function bx(t=!1){if(t){zR();return}VR()}function im(t){return t.transaction}function vg(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=gr({environment:r.environment||pg,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function ku(t){const e=Lt();if(!e)return{};const n=vg(Dn(t).trace_id||"",e,Gr()),r=im(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;s!=null&&(n.sample_rate=`${s}`);const a=Dn(r);return o&&o!=="url"&&(n.transaction=a.description),n.sampled=String(Yw(r)),e.emit&&e.emit("createDsc",n),n}function HR(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;kG(t,e),r&&NG(t,r),AG(t,n),DG(t,i),RG(t,s)}function _x(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:l,attachments:d,propagationContext:f,transactionName:h,span:m}=e;gl(t,"extra",n),gl(t,"tags",r),gl(t,"user",i),gl(t,"contexts",s),gl(t,"sdkProcessingMetadata",a),o&&(t.level=o),h&&(t.transactionName=h),m&&(t.span=m),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...f}}function gl(t,e,n){if(n&&Object.keys(n).length){t[e]={...t[e]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[e][r]=n[r])}}function kG(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=e,c=gr(n);c&&Object.keys(c).length&&(t.extra={...c,...t.extra});const u=gr(r);u&&Object.keys(u).length&&(t.tags={...u,...t.tags});const l=gr(i);l&&Object.keys(l).length&&(t.user={...l,...t.user});const d=gr(s);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts}),o&&(t.level=o),a&&(t.transaction=a)}function DG(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function RG(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function NG(t,e){t.contexts={trace:Zw(e),...t.contexts};const n=im(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:ku(e),...t.sdkProcessingMetadata};const r=Dn(n).description;r&&(t.tags={transaction:r,...t.tags})}}function AG(t,e){t.fingerprint=t.fingerprint?SR(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}const PG=100;let My;class js{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=wx()}static clone(e){return e?e.clone():new js}clone(){const e=new js;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Ja(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e;if(n instanceof js){const r=n.getScopeData();this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&Object.keys(r.user).length&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint.length&&(this._fingerprint=r.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),r.propagationContext&&(this._propagationContext=r.propagationContext)}else if(Za(n)){const r=e;this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint&&(this._fingerprint=r.fingerprint),r.requestSession&&(this._requestSession=r.requestSession),r.propagationContext&&(this._propagationContext=r.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=wx(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:PG;if(r<=0)return this;const i={timestamp:Cf(),...e},s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>r?s.slice(-r):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:n,_contexts:r,_tags:i,_extra:s,_user:o,_level:a,_fingerprint:c,_eventProcessors:u,_propagationContext:l,_sdkProcessingMetadata:d,_transactionName:f,_span:h}=this;return{breadcrumbs:e,attachments:n,contexts:r,tags:i,extra:s,user:o,level:a,fingerprint:c||[],eventProcessors:u,propagationContext:l,sdkProcessingMetadata:d,transactionName:f,span:h}}applyToEvent(e,n={},r=[]){HR(e,this.getScopeData());const i=[...r,...Gw(),...this._eventProcessors];return rm(i,e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:Sn();if(!this._client)return me.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:Sn();if(!this._client)return me.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Sn();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(me.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function MG(){return My||(My=new js),My}function wx(){return{traceId:Sn(),spanId:Sn().substring(16)}}const mb="7.120.3",WR=parseFloat(mb),LG=100;class qR{constructor(e,n,r,i=WR){this._version=i;let s;n?s=n:(s=new js,s.setClient(e));let o;r?o=r:(o=new js,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const n=this.getStackTop();n.client=e,n.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const n=this.pushScope();let r;try{r=e(n)}catch(i){throw this.popScope(),i}return lg(r)?r.then(i=>(this.popScope(),i),i=>{throw this.popScope(),i}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Sn(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:Sn(),s=new Error(e);return this.getScope().captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Sn();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=LG}=i.getOptions&&i.getOptions()||{};if(o<=0)return;const c={timestamp:Cf(),...e},u=s?Ya(()=>s(c,n)):c;u!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",u,n),r.addBreadcrumb(u,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n),this.getIsolationScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n),this.getIsolationScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n),this.getIsolationScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=Ex(this);try{e(this)}finally{Ex(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return et&&me.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return et&&!r&&(this.getClient()?me.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
398
|
-
Sentry.addTracingExtensions();
|
|
399
|
-
Sentry.init({...});
|
|
400
|
-
`):me.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&$R(r),this._sendSessionUpdate(),n.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=pg}=r&&r.getOptions()||{},{userAgent:o}=Mt.navigator||{},a=FR({release:i,environment:s,user:n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&Ja(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(e,...n){const i=Rf().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,n);et&&me.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Rf(){return Mt.__SENTRY__=Mt.__SENTRY__||{extensions:{},hub:void 0},Mt}function Ex(t){const e=Rf(),n=gb(e);return GR(e,t),n}function Qn(){const t=Rf();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return FG(t)}function Xo(){return Qn().getIsolationScope()}function FG(t=Rf()){return(!$G(t)||gb(t).isOlderThan(WR))&&GR(t,new qR),gb(t)}function $G(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function gb(t){return pR("hub",()=>new qR,t)}function GR(t,e){if(!t)return!1;const n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}function pc(t){return Qn().getScope().getTransaction()}let Sx=!1;function jG(){Sx||(Sx=!0,OR(yb),CR(yb))}function yb(){const t=pc();if(t){const e="internal_error";et&&me.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}yb.tag="sentry_tracingErrorCallback";var xx;(function(t){const e="ok";t.Ok=e;const n="deadline_exceeded";t.DeadlineExceeded=n;const r="unauthenticated";t.Unauthenticated=r;const i="permission_denied";t.PermissionDenied=i;const s="not_found";t.NotFound=s;const o="resource_exhausted";t.ResourceExhausted=o;const a="invalid_argument";t.InvalidArgument=a;const c="unimplemented";t.Unimplemented=c;const u="unavailable";t.Unavailable=u;const l="internal_error";t.InternalError=l;const d="unknown_error";t.UnknownError=d;const f="cancelled";t.Cancelled=f;const h="already_exists";t.AlreadyExists=h;const m="failed_precondition";t.FailedPrecondition=m;const p="aborted";t.Aborted=p;const g="out_of_range";t.OutOfRange=g;const y="data_loss";t.DataLoss=y})(xx||(xx={}));function UG(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function Kw(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=UG(e);n!=="unknown_error"&&t.setStatus(n)}function Qu(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Lt(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function ZR(t){if(!Qu())return;const e=zG(t),n=Qn(),r=t.scope?t.scope.getSpan():Jw();if(t.onlyIfParent&&!r)return;const o=(t.scope||Gr()).clone();return BG(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:o})}function Jw(){return Gr().getSpan()}function BG(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!Qu())return;const s=Xo();let o;if(e&&!r)o=e.startChild(n);else if(e){const a=ku(e),{traceId:c,spanId:u}=e.spanContext(),l=Yw(e);o=t.startTransaction({traceId:c,parentSpanId:u,parentSampled:l,...n,metadata:{dynamicSamplingContext:a,...n.metadata}})}else{const{traceId:a,dsc:c,parentSpanId:u,sampled:l}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:a,parentSpanId:u,parentSampled:l,...n,metadata:{dynamicSamplingContext:c,...n.metadata}})}return i.setSpan(o),VG(o,i,s),o}function zG(t){if(t.startTime){const e={...t};return e.startTimestamp=gg(t.startTime),delete e.startTime,e}return t}const YR="_sentryScope",KR="_sentryIsolationScope";function VG(t,e,n){t&&(Go(t,KR,n),Go(t,YR,e))}function HG(t){return{scope:t[YR],isolationScope:t[KR]}}const as="sentry.source",jc="sentry.sample_rate",Pl="sentry.op",ga="sentry.origin",WG="profile_id";class JR{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class bg{constructor(e={}){this._traceId=e.traceId||Sn(),this._spanId=e.spanId||Sn().substring(16),this._startTime=e.startTimestamp||kf(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[ga]:e.origin||"manual",[Pl]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[Pl]}set op(e){this.setAttribute(Pl,e)}get origin(){return this._attributes[ga]}set origin(e){this.setAttribute(ga,e)}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?jR:mG}}startChild(e){const n=new bg({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);const r=im(this);if(n.transaction=r,et&&r){const i=e&&e.op||"< unknown op >",s=Dn(n).description||"< unknown name >",o=r.spanContext().spanId,a=`[Tracing] Starting '${i}' span on transaction '${s}' (${o}).`;me.log(a),this._logMessage=a}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setAttribute(e,n){n===void 0?delete this._attributes[e]:this._attributes[e]=n}setAttributes(e){Object.keys(e).forEach(n=>this.setAttribute(n,e[n]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return Kw(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const n=im(this);if(et&&n&&n.spanContext().spanId!==this._spanId){const r=this._logMessage;r&&me.log(r.replace("Starting","Finishing"))}this._endTime=gg(e)}toTraceparent(){return mg(this)}toContext(){return gr({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return Zw(this)}getSpanJSON(){return gr({data:this._getData(),description:this._name,op:this._attributes[Pl],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ga],_metrics_summary:void 0,profile_id:this._attributes[WG],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:n}=this,r=Object.keys(e).length>0,i=Object.keys(n).length>0;if(!(!r&&!i))return r&&i?{...e,...n}:r?e:n}}class XR extends bg{constructor(e,n){super(e),this._contexts={},this._hub=n||Qn(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const r=this._metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[as]&&{source:this._attributes[as]},...this._attributes[jc]&&{sampleRate:this._attributes[jc]}}}set metadata(e){this._metadata=e}setName(e,n="custom"){this._name=e,this.setAttribute(as,n)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new JR(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const n=gg(e),r=this._finishTransaction(n);if(r)return this._hub.captureEvent(r)}toContext(){const e=super.toContext();return gr({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return ku(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(et&&me.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this._sampled!==!0){et&&me.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}const r=this.spanRecorder?this.spanRecorder.spans.filter(l=>l!==this&&Dn(l).timestamp):[];if(this._trimEnd&&r.length>0){const l=r.map(d=>Dn(d).timestamp).filter(Boolean);this._endTime=l.reduce((d,f)=>d>f?d:f)}const{scope:i,isolationScope:s}=HG(this),{metadata:o}=this,{source:a}=o,c={contexts:{...this._contexts,trace:Zw(this)},spans:r,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:i,capturedSpanIsolationScope:s,...gr({dynamicSamplingContext:ku(this)})},_metrics_summary:void 0,...a&&{transaction_info:{source:a}}};return Object.keys(this._measurements).length>0&&(et&&me.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),c.measurements=this._measurements),et&&me.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),c}}const tp={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},qG="finishReason",Oc=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class GG extends JR{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const n=e.end;e.end=(...r)=>(this._popActivity(e.spanContext().spanId),n.apply(e,r)),Dn(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}}class ZG extends XR{constructor(e,n,r=tp.idleTimeout,i=tp.finalTimeout,s=tp.heartbeatInterval,o=!1,a=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Oc[4],this._autoFinishAllowed=!a,o&&(et&&me.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),n.getScope().setSpan(this)),a||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Oc[3],this.end())},this._finalTimeout)}end(e){const n=gg(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(qG,this._finishReason),this.spanRecorder){et&&me.log("[Tracing] finishing IdleTransaction",new Date(n*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,n);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanContext().spanId===this.spanContext().spanId)return!0;Dn(r).timestamp||(r.setStatus("cancelled"),r.end(n),et&&me.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const{start_timestamp:i,timestamp:s}=Dn(r),o=i&&i<n,a=(this._finalTimeout+this._idleTimeout)/1e3,c=s&&i&&s-i<a;if(et){const u=JSON.stringify(r,void 0,2);o?c||me.log("[Tracing] discarding Span since it finished after Transaction final timeout",u):me.log("[Tracing] discarding Span since it happened after Transaction was finished",u)}return o&&c}),et&&me.log("[Tracing] flushing IdleTransaction")}else et&&me.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new GG(n,r,this.spanContext().spanId,e),et&&me.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Oc[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(et&&me.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Oc[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),et&&me.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,et&&me.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(et&&me.log(`[Tracing] popActivity ${e}`),delete this.activities[e],et&&me.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=kf();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=Oc[5],this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(et&&me.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Oc[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){et&&me.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function QR(t,e,n){if(!Qu(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setAttribute(jc,Number(t.sampled)),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setAttribute(jc,Number(r))):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setAttribute(jc,Number(r))):(r=1,t.setAttribute(jc,r)),eN(r)?r?(t.sampled=Math.random()<r,t.sampled?(et&&me.log(`[Tracing] starting ${t.op} transaction - ${Dn(t).description}`),t):(et&&me.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):(et&&me.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):(et&&me.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function eN(t){return fR(t)||!(typeof t=="number"||typeof t=="boolean")?(et&&me.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?(et&&me.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function YG(){const e=this.getScope().getSpan();return e?{"sentry-trace":mg(e)}:{}}function KG(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(et&&me.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter.
|
|
401
|
-
The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new XR(t,this);return o=QR(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function tN(t,e,n,r,i,s,o,a=!1){const c=t.getClient(),u=c&&c.getOptions()||{};let l=new ZG(e,t,n,r,o,i,a);return l=QR(l,u,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),l.isRecording()&&l.initSpanRecorder(u._experiments&&u._experiments.maxSpans),c&&c.emit&&c.emit("startTransaction",l),l}function JG(){const t=Rf();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=KG),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=YG),jG())}function XG(t,e,n){const r=pc();r&&r.setMeasurement(t,e,n)}function QG(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function eZ(t,e,n,r){const i=qw(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&e&&{dsn:Xu(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Jo(s,[o])}function tZ(t,e,n,r){const i=qw(n),s=t.type&&t.type!=="replay_event"?t.type:"event";QG(t,n&&n.sdk);const o=PR(t,i,r,e);return delete t.sdkProcessingMetadata,Jo(o,[[{type:s},t]])}const nZ="7";function rZ(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function iZ(t){return`${rZ(t)}${t.projectId}/envelope/`}function sZ(t,e){return vq({sentry_key:t.publicKey,sentry_version:nZ,...e&&{sentry_client:`${e.name}/${e.version}`}})}function oZ(t,e={}){const n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${iZ(t)}?${sZ(t,r)}`}const Tx=[];function aZ(t){const e={};return t.forEach(n=>{const{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function cZ(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=SR(n(e)):r=e;const i=aZ(r),s=lZ(i,o=>o.name==="Debug");if(s!==-1){const[o]=i.splice(s,1);i.push(o)}return i}function uZ(t,e){const n={};return e.forEach(r=>{r&&nN(t,r,n)}),n}function Ix(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function nN(t,e,n){if(n[e.name]){et&&me.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,Tx.indexOf(e.name)===-1&&(e.setupOnce(hG,Qn),Tx.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),t.on&&typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,o)=>r(s,o,t),{id:e.name});t.addEventProcessor(i)}et&&me.log(`Integration installed: ${e.name}`)}function lZ(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}function Li(t,e){return Object.assign(function(...r){return e(...r)},{id:t})}function dZ(t){let e="";for(const n of t){const r=Object.entries(n.tags),i=r.length>0?`|#${r.map(([s,o])=>`${s}:${o}`).join(",")}`:"";e+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${i}|T${n.timestamp}
|
|
402
|
-
`}return e}function fZ(t,e,n,r){const i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&e&&(i.dsn=Xu(e));const s=hZ(t);return Jo(i,[s])}function hZ(t){const e=dZ(t);return[{type:"statsd",length:e.length},e]}const Ox="Not capturing exception because it's already been captured.";class pZ{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=yq(e.dsn):et&&me.warn("No DSN provided, client will not send events."),this._dsn){const n=oZ(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(ax(e)){et&&me.log(Ox);return}let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const o=Uw(e)?e:String(e),a=Bw(e)?this.eventFromMessage(o,n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&ax(n.originalException)){et&&me.log(Ox);return}let i=n&&n.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,n,o||r).then(a=>{i=a})),i}captureSession(e){typeof e.release!="string"?et&&me.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ja(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):Cu(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return et&&me.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const n=this._integrations[e.name];nN(this,e,this._integrations),n||Ix(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=tZ(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=rG(r,oG(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=eZ(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=typeof r=="number"?r:1,s=`${e}:${n}`;et&&me.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}captureAggregateMetrics(e){et&&me.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const n=fZ(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=uZ(this,e),Ix(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const u=c.mechanism;if(u&&u.handled===!1){r=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(Ja(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Fr(n=>{let r=0;const i=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=i,e&&r>=e&&(clearInterval(s),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i=Xo()){const s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit("preprocessEvent",e,n),UR(s,e,n,r,this,i).then(a=>{if(a===null)return a;const c={...i.getPropagationContext(),...r?r.getPropagationContext():void 0};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:d,parentSpanId:f,dsc:h}=c;a.contexts={trace:{trace_id:l,span_id:d,parent_span_id:f},...a.contexts};const m=h||vg(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:m,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(et){const s=i;s.logLevel==="log"?me.log(s.message):me.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,o=iN(e),a=rN(e),c=e.type||"error",u=`before send for type \`${c}\``;if(a&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),Hw(new Ji(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const l=c==="replay_event"?"replay":c,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,f).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",l,e),new Ji("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return h;const p=gZ(i,h,n);return mZ(p,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",l,e),o){const y=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw new Ji(`${u} returned \`null\`, will not send event.`,"log")}const m=r&&r.getSession();if(!o&&m&&this._updateSessionFromEvent(m,h),o){const g=h.sdkProcessingMetadata&&h.sdkProcessingMetadata.spanCountBeforeProcessing||0,y=h.spans?h.spans.length:0,v=g-y;v>0&&this.recordDroppedEvent("before_send","span",v)}const p=h.transaction_info;if(o&&p&&h.transaction!==e.transaction){const g="custom";h.transaction_info={...p,source:g}}return this.sendEvent(h,n),h}).then(null,h=>{throw h instanceof Ji?h:(this.captureException(h,{data:{__sentry__:!0},originalException:h}),new Ji(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
403
|
-
Reason: ${h}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{et&&me.error("Error while sending event:",n)});et&&me.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function mZ(t,e){const n=`${e} must return \`null\` or a valid event.`;if(lg(t))return t.then(r=>{if(!Za(r)&&r!==null)throw new Ji(n);return r},r=>{throw new Ji(`${e} rejected with ${r}`)});if(!Za(t)&&t!==null)throw new Ji(n);return t}function gZ(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;if(rN(e)&&r)return r(e,n);if(iN(e)&&i){if(e.spans){const s=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:s}}return i(e,n)}return e}function rN(t){return t.type===void 0}function iN(t){return t.type==="transaction"}function yZ(t){const e=Lt();!e||!e.addEventProcessor||e.addEventProcessor(t)}function vZ(t,e){e.debug===!0&&(et?me.enable():Ya(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Gr().update(e.initialScope);const r=new t(e);bZ(r),_Z(r)}function bZ(t){const n=Qn().getStackTop();n.client=t,n.scope.setClient(t)}function _Z(t){t.init?t.init():t.setupIntegrations&&t.setupIntegrations()}const wZ=30;function sN(t,e,n=Gq(t.bufferSize||wZ)){let r={};const i=o=>n.drain(o);function s(o){const a=[];if(hx(o,(d,f)=>{const h=px(f);if(MR(r,h)){const m=Cx(d,f);t.recordDroppedEvent("ratelimit_backoff",h,m)}else a.push(d)}),a.length===0)return Cu();const c=Jo(o[0],a),u=d=>{hx(c,(f,h)=>{const m=Cx(f,h);t.recordDroppedEvent(d,px(h),m)})},l=()=>e({body:iG(c,t.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&et&&me.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=LR(r,d),d),d=>{throw u("network_error"),d});return n.add(l).then(d=>d,d=>{if(d instanceof Ji)return et&&me.error("Skipped sending event because buffer is full."),u("queue_overflow"),Cu();throw d})}return s.__sentry__baseTransport__=!0,{send:s,flush:i}}function Cx(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}function EZ(t,e){const n={sent_at:new Date().toISOString()};e&&(n.dsn=Xu(e));const r=t.map(SZ);return Jo(n,r)}function SZ(t){return[{type:"span"},t]}function oN(t,e){const n=e&&IZ(e)?e.getClient():e,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return TZ(t,r)||xZ(t,i)}function xZ(t,e){return e?kx(t)===kx(e):!1}function TZ(t,e){return e?t.includes(e.host):!1}function kx(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function IZ(t){return t.getClient!==void 0}function aN(t,e,n=[e],r="npm"){const i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:mb})),version:mb}),t._metadata=i}const OZ=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],CZ=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],cN="InboundFilters",kZ=(t={})=>({name:cN,setupOnce(){},processEvent(e,n,r){const i=r.getOptions(),s=DZ(t,i);return RZ(e,s)?null:e}}),uN=kZ;Li(cN,uN);function DZ(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:OZ],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:CZ],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function RZ(t,e){return e.ignoreInternal&&FZ(t)?(et&&me.warn(`Event dropped due to being internal Sentry Error.
|
|
404
|
-
Event: ${_o(t)}`),!0):NZ(t,e.ignoreErrors)?(et&&me.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
405
|
-
Event: ${_o(t)}`),!0):AZ(t,e.ignoreTransactions)?(et&&me.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
406
|
-
Event: ${_o(t)}`),!0):PZ(t,e.denyUrls)?(et&&me.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
407
|
-
Event: ${_o(t)}.
|
|
408
|
-
Url: ${sm(t)}`),!0):MZ(t,e.allowUrls)?!1:(et&&me.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
409
|
-
Event: ${_o(t)}.
|
|
410
|
-
Url: ${sm(t)}`),!0)}function NZ(t,e){return t.type||!e||!e.length?!1:LZ(t).some(n=>Ku(n,e))}function AZ(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?Ku(n,e):!1}function PZ(t,e){if(!e||!e.length)return!1;const n=sm(t);return n?Ku(n,e):!1}function MZ(t,e){if(!e||!e.length)return!0;const n=sm(t);return n?Ku(n,e):!0}function LZ(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),et&&e.length===0&&me.error(`Could not extract message for event ${_o(t)}`),e}function FZ(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function $Z(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function sm(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?$Z(e):null}catch{return et&&me.error(`Cannot extract url for event ${_o(t)}`),null}}let Dx;const lN="FunctionToString",Rx=new WeakMap,jZ=()=>({name:lN,setupOnce(){Dx=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=Vw(this),n=Rx.has(Lt())&&e!==void 0?e:this;return Dx.apply(n,t)}}catch{}},setup(t){Rx.set(t,!0)}}),dN=jZ;Li(lN,dN);const mn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,pt=Mt;function UZ(){pt.document?pt.document.addEventListener("visibilitychange",()=>{const t=pc();if(pt.document.hidden&&t){const e="cancelled",{op:n,status:r}=Dn(t);mn&&me.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}}):mn&&me.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Nf=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||r===void 0)&&(r=e.value,e.delta=i,t(e)))}},BZ=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,zZ=()=>{const t=pt.performance.timing,e=pt.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},_g=()=>pt.__WEB_VITALS_POLYFILL__?pt.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||zZ()):pt.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Xw=()=>{const t=_g();return t&&t.activationStart||0},Af=(t,e)=>{const n=_g();let r="navigate";return n&&(pt.document&&pt.document.prerendering||Xw()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:BZ(),navigationType:r}},el=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{e(i.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},Pf=(t,e)=>{const n=r=>{(r.type==="pagehide"||pt.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};pt.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},VZ=(t,e={})=>{const n=Af("CLS",0);let r,i=0,s=[];const o=c=>{c.forEach(u=>{if(!u.hadRecentInput){const l=s[0],d=s[s.length-1];i&&s.length!==0&&u.startTime-d.startTime<1e3&&u.startTime-l.startTime<5e3?(i+=u.value,s.push(u)):(i=u.value,s=[u]),i>n.value&&(n.value=i,n.entries=s,r&&r())}})},a=el("layout-shift",o);if(a){r=Nf(t,n,e.reportAllChanges);const c=()=>{o(a.takeRecords()),r(!0)};return Pf(c),c}};let om=-1;const HZ=()=>{pt.document&&pt.document.visibilityState&&(om=pt.document.visibilityState==="hidden"&&!pt.document.prerendering?0:1/0)},WZ=()=>{Pf(({timeStamp:t})=>{om=t},!0)},Qw=()=>(om<0&&(HZ(),WZ()),{get firstHiddenTime(){return om}}),qZ=t=>{const e=Qw(),n=Af("FID");let r;const i=a=>{a.startTime<e.firstHiddenTime&&(n.value=a.processingStart-a.startTime,n.entries.push(a),r(!0))},s=a=>{a.forEach(i)},o=el("first-input",s);r=Nf(t,n),o&&Pf(()=>{s(o.takeRecords()),o.disconnect()},!0)};let fN=0,Ly=1/0,Sh=0;const GZ=t=>{t.forEach(e=>{e.interactionId&&(Ly=Math.min(Ly,e.interactionId),Sh=Math.max(Sh,e.interactionId),fN=Sh?(Sh-Ly)/7+1:0)})};let vb;const ZZ=()=>vb?fN:performance.interactionCount||0,YZ=()=>{"interactionCount"in performance||vb||(vb=el("event",GZ,{type:"event",buffered:!0,durationThreshold:0}))},hN=()=>ZZ(),Nx=10,Ds=[],Fy={},Ax=t=>{const e=Ds[Ds.length-1],n=Fy[t.interactionId];if(n||Ds.length<Nx||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};Fy[r.id]=r,Ds.push(r)}Ds.sort((r,i)=>i.latency-r.latency),Ds.splice(Nx).forEach(r=>{delete Fy[r.id]})}},KZ=()=>{const t=Math.min(Ds.length-1,Math.floor(hN()/50));return Ds[t]},JZ=(t,e)=>{e=e||{},YZ();const n=Af("INP");let r;const i=o=>{o.forEach(c=>{c.interactionId&&Ax(c),c.entryType==="first-input"&&!Ds.some(l=>l.entries.some(d=>c.duration===d.duration&&c.startTime===d.startTime))&&Ax(c)});const a=KZ();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,r())},s=el("event",i,{durationThreshold:e.durationThreshold||40});r=Nf(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Pf(()=>{i(s.takeRecords()),n.value<0&&hN()>0&&(n.value=0,n.entries=[]),r(!0)}))},Px={},XZ=t=>{const e=Qw(),n=Af("LCP");let r;const i=o=>{const a=o[o.length-1];if(a){const c=Math.max(a.startTime-Xw(),0);c<e.firstHiddenTime&&(n.value=c,n.entries=[a],r())}},s=el("largest-contentful-paint",i);if(s){r=Nf(t,n);const o=()=>{Px[n.id]||(i(s.takeRecords()),s.disconnect(),Px[n.id]=!0,r(!0))};return["keydown","click"].forEach(a=>{pt.document&&addEventListener(a,o,{once:!0,capture:!0})}),Pf(o,!0),o}},bb=t=>{pt.document&&(pt.document.prerendering?addEventListener("prerenderingchange",()=>bb(t),!0):pt.document.readyState!=="complete"?addEventListener("load",()=>bb(t),!0):setTimeout(t,0))},QZ=(t,e)=>{e=e||{};const n=Af("TTFB"),r=Nf(t,n,e.reportAllChanges);bb(()=>{const i=_g();if(i){if(n.value=Math.max(i.responseStart-Xw(),0),n.value<0||n.value>performance.now())return;n.entries=[i],r(!0)}})},ql={},am={};let pN,mN,gN,yN,vN;function eY(t,e=!1){return Mf("cls",t,iY,pN,e)}function bN(t,e=!1){return Mf("lcp",t,oY,gN,e)}function tY(t){return Mf("ttfb",t,aY,yN)}function nY(t){return Mf("fid",t,sY,mN)}function rY(t){return Mf("inp",t,cY,vN)}function Du(t,e){return _N(t,e),am[t]||(uY(t),am[t]=!0),wN(t,e)}function tl(t,e){const n=ql[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(i){mn&&me.error(`Error while triggering instrumentation handler.
|
|
411
|
-
Type: ${t}
|
|
412
|
-
Name: ${Ks(r)}
|
|
413
|
-
Error:`,i)}}function iY(){return VZ(t=>{tl("cls",{metric:t}),pN=t},{reportAllChanges:!0})}function sY(){return qZ(t=>{tl("fid",{metric:t}),mN=t})}function oY(){return XZ(t=>{tl("lcp",{metric:t}),gN=t})}function aY(){return QZ(t=>{tl("ttfb",{metric:t}),yN=t})}function cY(){return JZ(t=>{tl("inp",{metric:t}),vN=t})}function Mf(t,e,n,r,i=!1){_N(t,e);let s;return am[t]||(s=n(),am[t]=!0),r&&e({metric:r}),wN(t,e,i?s:void 0)}function uY(t){const e={};t==="event"&&(e.durationThreshold=0),el(t,n=>{tl(t,{entries:n})},e)}function _N(t,e){ql[t]=ql[t]||[],ql[t].push(e)}function wN(t,e,n){return()=>{n&&n();const r=ql[t];if(!r)return;const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function $y(t){return typeof t=="number"&&isFinite(t)}function Ru(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const lY=2147483647;function $n(t){return t/1e3}function e0(){return pt.addEventListener&&pt.performance}let Mx=0,En={},Ui,Gl;function dY(){const t=e0();if(t&&Wr){t.mark&&pt.performance.mark("sentry-tracing-init");const e=yY(),n=mY(),r=gY(),i=vY();return()=>{e(),n(),r(),i()}}return()=>{}}function fY(){Du("longtask",({entries:t})=>{for(const e of t){const n=pc();if(!n)return;const r=$n(Wr+e.startTime),i=$n(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function hY(){Du("event",({entries:t})=>{for(const e of t){const n=pc();if(!n)return;if(e.name==="click"){const r=$n(Wr+e.startTime),i=$n(e.duration),s={description:qo(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i},o=mR(e.target);o&&(s.attributes={"ui.component_name":o}),n.startChild(s)}}})}function pY(t,e){if(e0()&&Wr){const r=bY(t,e);return()=>{r()}}return()=>{}}function mY(){return eY(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(mn&&me.log("[Measurements] Adding CLS"),En.cls={value:t.value,unit:""},Gl=e)},!0)}function gY(){return bN(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(mn&&me.log("[Measurements] Adding LCP"),En.lcp={value:t.value,unit:"millisecond"},Ui=e)},!0)}function yY(){return nY(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=$n(Wr),r=$n(e.startTime);mn&&me.log("[Measurements] Adding FID"),En.fid={value:t.value,unit:"millisecond"},En["mark.fid"]={value:n+r,unit:"second"}})}function vY(){return tY(({metric:t})=>{t.entries[t.entries.length-1]&&(mn&&me.log("[Measurements] Adding TTFB"),En.ttfb={value:t.value,unit:"millisecond"})})}const Lx={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function bY(t,e){return rY(({metric:n})=>{if(n.value===void 0)return;const r=n.entries.find(b=>b.duration===n.value&&Lx[b.name]!==void 0),i=Lt();if(!r||!i)return;const s=Lx[r.name],o=i.getOptions(),a=$n(Wr+r.startTime),c=$n(n.value),u=r.interactionId!==void 0?t[r.interactionId]:void 0;if(u===void 0)return;const{routeName:l,parentContext:d,activeTransaction:f,user:h,replayId:m}=u,p=h!==void 0?h.email||h.id||h.ip_address:void 0,g=f!==void 0?f.getProfileId():void 0,y=new bg({startTimestamp:a,endTimestamp:a+c,op:`ui.interaction.${s}`,name:qo(r.target),attributes:{release:o.release,environment:o.environment,transaction:l,...p!==void 0&&p!==""?{user:p}:{},...g!==void 0?{profile_id:g}:{},...m!==void 0?{replay_id:m}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=CY(d,o,e);if(v&&Math.random()<v){const b=y?EZ([y],i.getDsn()):void 0,E=i&&i.getTransport();E&&b&&E.send(b).then(null,w=>{mn&&me.error("Error while sending interaction:",w)});return}})}function _Y(t){const e=e0();if(!e||!pt.performance.getEntries||!Wr)return;mn&&me.log("[Tracing] Adding & adjusting spans using Performance API");const n=$n(Wr),r=e.getEntries(),{op:i,start_timestamp:s}=Dn(t);if(r.slice(Mx).forEach(o=>{const a=$n(o.startTime),c=$n(o.duration);if(!(t.op==="navigation"&&s&&n+a<s))switch(o.entryType){case"navigation":{EY(t,o,n);break}case"mark":case"paint":case"measure":{wY(t,o,a,c,n);const u=Qw(),l=o.startTime<u.firstHiddenTime;o.name==="first-paint"&&l&&(mn&&me.log("[Measurements] Adding FP"),En.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&l&&(mn&&me.log("[Measurements] Adding FCP"),En.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{xY(t,o,o.name,a,c,n);break}}}),Mx=Math.max(r.length-1,0),TY(t),i==="pageload"){OY(En),["fcp","fp","lcp"].forEach(a=>{if(!En[a]||!s||n>=s)return;const c=En[a].value,u=n+$n(c),l=Math.abs((u-s)*1e3),d=l-c;mn&&me.log(`[Measurements] Normalized ${a} from ${c} to ${l} (${d})`),En[a].value=l});const o=En["mark.fid"];o&&En.fid&&(Ru(t,{description:"first input delay",endTimestamp:o.value+$n(En.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete En["mark.fid"]),"fcp"in En||delete En.cls,Object.keys(En).forEach(a=>{XG(a,En[a].value,En[a].unit)}),IY(t)}Ui=void 0,Gl=void 0,En={}}function wY(t,e,n,r,i){const s=i+n,o=s+r;return Ru(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function EY(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{xh(t,e,r,n)}),xh(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),xh(t,e,"fetch",n,"cache","domainLookupStart"),xh(t,e,"domainLookup",n,"DNS"),SY(t,e,n)}function xh(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],a=e[`${n}Start`];!a||!o||Ru(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+$n(a),endTimestamp:r+$n(o)})}function SY(t,e,n){e.responseEnd&&(Ru(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+$n(e.requestStart),endTimestamp:n+$n(e.responseEnd)}),Ru(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+$n(e.responseStart),endTimestamp:n+$n(e.responseEnd)}))}function xY(t,e,n,r,i,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=ka(n),a={};jy(a,e,"transferSize","http.response_transfer_size"),jy(a,e,"encodedBodySize","http.response_content_length"),jy(a,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(a["url.scheme"]=o.protocol.split(":").pop()),o.host&&(a["server.address"]=o.host),a["url.same_origin"]=n.includes(pt.location.origin);const c=s+r,u=c+i;Ru(t,{description:n.replace(pt.location.origin,""),endTimestamp:u,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:c,data:a})}function TY(t){const e=pt.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),$y(n.rtt)&&(En["connection.rtt"]={value:n.rtt,unit:"millisecond"})),$y(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),$y(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function IY(t){Ui&&(mn&&me.log("[Measurements] Adding LCP Data"),Ui.element&&t.setTag("lcp.element",qo(Ui.element)),Ui.id&&t.setTag("lcp.id",Ui.id),Ui.url&&t.setTag("lcp.url",Ui.url.trim().slice(0,200)),t.setTag("lcp.size",Ui.size)),Gl&&Gl.sources&&(mn&&me.log("[Measurements] Adding CLS Data"),Gl.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,qo(e.node))))}function jy(t,e,n,r){const i=e[n];i!=null&&i<lY&&(t[r]=i)}function OY(t){const e=_g();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(mn&&me.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function CY(t,e,n){if(!Qu(e))return!1;let r;return t!==void 0&&typeof e.tracesSampler=="function"?r=e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:pt.location}):t!==void 0&&t.sampled!==void 0?r=t.sampled:typeof e.tracesSampleRate<"u"?r=e.tracesSampleRate:r=1,eN(r)?r===!0?n:r===!1?0:r*n:(mn&&me.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function kY(t,e,n,r,i="auto.http.browser"){if(!Qu()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const h=t.fetchData.__span;if(!h)return;const m=r[h];m&&(NY(m,t),delete r[h]);return}const o=Gr(),a=Lt(),{method:c,url:u}=t.fetchData,l=RY(u),d=l?ka(l).host:void 0,f=s?ZR({name:`${c} ${u}`,onlyIfParent:!0,attributes:{url:u,type:"fetch","http.method":c,"http.url":l,"server.address":d,[ga]:i},op:"http.client"}):void 0;if(f&&(t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(t.fetchData.url)&&a){const h=t.args[0];t.args[1]=t.args[1]||{};const m=t.args[1];m.headers=DY(h,a,o,m,f)}return f}function DY(t,e,n,r,i){const s=i||n.getSpan(),o=Xo(),{traceId:a,spanId:c,sampled:u,dsc:l}={...o.getPropagationContext(),...n.getPropagationContext()},d=s?mg(s):Ww(a,c,u),f=AR(l||(s?ku(s):vg(a,e,n))),h=r.headers||(typeof Request<"u"&&Ys(t,Request)?t.headers:void 0);if(h)if(typeof Headers<"u"&&Ys(h,Headers)){const m=new Headers(h);return m.append("sentry-trace",d),f&&m.append(hb,f),m}else if(Array.isArray(h)){const m=[...h,["sentry-trace",d]];return f&&m.push([hb,f]),m}else{const m="baggage"in h?h.baggage:void 0,p=[];return Array.isArray(m)?p.push(...m):m&&p.push(m),f&&p.push(f),{...h,"sentry-trace":d,baggage:p.length>0?p.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function RY(t){try{return new URL(t).href}catch{return}}function NY(t,e){if(e.response){Kw(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus("internal_error");t.end()}const _b=["localhost",/^\/(?!\/)/],wb={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:_b,tracePropagationTargets:_b};function AY(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:wb.traceFetch,traceXHR:wb.traceXHR,...t},a=typeof s=="function"?s:l=>!0,c=l=>FY(l,r||i),u={};e&&dg(l=>{const d=kY(l,a,c,u);if(d){const f=EN(l.fetchData.url),h=f?ka(f).host:void 0;d.setAttributes({"http.url":f,"server.address":h})}o&&d&&Fx(d)}),n&&hg(l=>{const d=$Y(l,a,c,u);o&&d&&Fx(d)})}function PY(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Fx(t){const{url:e}=Dn(t).data||{};if(!e||typeof e!="string")return;const n=Du("resource",({entries:r})=>{r.forEach(i=>{PY(i)&&i.name.endsWith(e)&&(LY(i).forEach(o=>t.setAttribute(...o)),setTimeout(n))})})}function MY(t){let e="unknown",n="unknown",r="";for(const i of t){if(i==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(i))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=i}return r===t&&(e=r),{name:e,version:n}}function ji(t=0){return((Wr||performance.timeOrigin)+t)/1e3}function LY(t){const{name:e,version:n}=MY(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),Wr?[...r,["http.request.redirect_start",ji(t.redirectStart)],["http.request.fetch_start",ji(t.fetchStart)],["http.request.domain_lookup_start",ji(t.domainLookupStart)],["http.request.domain_lookup_end",ji(t.domainLookupEnd)],["http.request.connect_start",ji(t.connectStart)],["http.request.secure_connection_start",ji(t.secureConnectionStart)],["http.request.connection_end",ji(t.connectEnd)],["http.request.request_start",ji(t.requestStart)],["http.request.response_start",ji(t.responseStart)],["http.request.response_end",ji(t.responseEnd)]]:r}function FY(t,e){return Ku(t,e||_b)}function $Y(t,e,n,r){const i=t.xhr,s=i&&i[Ms];if(!Qu()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const h=i.__sentry_xhr_span_id__;if(!h)return;const m=r[h];m&&s.status_code!==void 0&&(Kw(m,s.status_code),m.end(),delete r[h]);return}const a=Gr(),c=Xo(),u=EN(s.url),l=u?ka(u).host:void 0,d=o?ZR({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":u,url:s.url,"server.address":l,[ga]:"auto.http.browser"},op:"http.client"}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);const f=Lt();if(i.setRequestHeader&&n(s.url)&&f){const{traceId:h,spanId:m,sampled:p,dsc:g}={...c.getPropagationContext(),...a.getPropagationContext()},y=d?mg(d):Ww(h,m,p),v=AR(g||(d?ku(d):vg(h,f,a)));jY(i,y,v)}return d}function jY(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(hb,n)}catch{}}function EN(t){try{return new URL(t,pt.location.origin).href}catch{return}}const UY="BrowserTracing",BY={...tp,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...wb},zY=(t={})=>{const e=mn?!!(t.tracePropagationTargets||t.tracingOrigins):!1;JG(),!t.tracePropagationTargets&&t.tracingOrigins&&(t.tracePropagationTargets=t.tracingOrigins);const n={...BY,...t},r=dY(),i={};n.enableInp&&pY(i,n.interactionsSampleRate),n.enableLongTask&&fY(),n._experiments.enableInteractions&&hY();const s={name:void 0,context:void 0};function o(a){const c=Qn(),{beforeStartSpan:u,idleTimeout:l,finalTimeout:d,heartbeatInterval:f}=n,h=a.op==="pageload";let m;if(h){const v=h?$x("sentry-trace"):"",b=h?$x("baggage"):void 0,{traceId:E,dsc:w,parentSpanId:x,sampled:_}=nG(v,b);m={traceId:E,parentSpanId:x,parentSampled:_,...a,metadata:{...a.metadata,dynamicSamplingContext:w},trimEnd:!0}}else m={trimEnd:!0,...a};const p=u?u(m):m;p.metadata=p.name!==m.name?{...p.metadata,source:"custom"}:p.metadata,s.name=p.name,s.context=p,p.sampled===!1&&mn&&me.log(`[Tracing] Will not send ${p.op} transaction because of beforeNavigate.`),mn&&me.log(`[Tracing] Starting ${p.op} transaction on scope`);const{location:g}=pt,y=tN(c,p,l,d,!0,{location:g},f,h);return h&&pt.document&&(pt.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(pt.document.readyState)&&y.sendAutoFinishSignal()}),["interactive","complete"].includes(pt.document.readyState)&&y.sendAutoFinishSignal()),y.registerBeforeFinishCallback(v=>{r(),_Y(v)}),y}return{name:UY,setupOnce:()=>{},afterAllSetup(a){const c=a.getOptions(),{markBackgroundSpan:u,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:h,_experiments:m}=n,p=c&&c.tracePropagationTargets,g=p||n.tracePropagationTargets;mn&&e&&p&&me.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.");let y,v=pt.location&&pt.location.href;if(a.on&&(a.on("startNavigationSpan",b=>{y&&(mn&&me.log(`[Tracing] Finishing current transaction with op: ${Dn(y).op}`),y.end()),y=o({op:"navigation",...b})}),a.on("startPageLoadSpan",b=>{y&&(mn&&me.log(`[Tracing] Finishing current transaction with op: ${Dn(y).op}`),y.end()),y=o({op:"pageload",...b})})),n.instrumentPageLoad&&a.emit&&pt.location){const b={name:pt.location.pathname,startTimestamp:Wr?Wr/1e3:void 0,origin:"auto.pageload.browser",attributes:{[as]:"url"}};SN(a,b)}n.instrumentNavigation&&a.emit&&pt.location&&fg(({to:b,from:E})=>{if(E===void 0&&v&&v.indexOf(b)!==-1){v=void 0;return}if(E!==b){v=void 0;const w={name:pt.location.pathname,origin:"auto.navigation.browser",attributes:{[as]:"url"}};VY(a,w)}}),u&&UZ(),m.enableInteractions&&HY(n,s),n.enableInp&&qY(i,s),AY({traceFetch:l,traceXHR:d,tracePropagationTargets:g,shouldCreateSpanForRequest:f,enableHTTPTimings:h})},options:n}};function SN(t,e){if(!t.emit)return;t.emit("startPageLoadSpan",e);const n=Jw();return(n&&Dn(n).op)==="pageload"?n:void 0}function VY(t,e){if(!t.emit)return;t.emit("startNavigationSpan",e);const n=Jw();return(n&&Dn(n).op)==="navigation"?n:void 0}function $x(t){const e=lq(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function HY(t,e){let n;const r=()=>{const{idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=t,a="ui.action.click",c=pc();if(c&&c.op&&["navigation","pageload"].includes(c.op)){mn&&me.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(n&&(n.setFinishReason("interactionInterrupted"),n.end(),n=void 0),!e.name){mn&&me.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}const{location:u}=pt,l={name:e.name,op:a,trimEnd:!0,data:{[as]:e.context?GY(e.context):"url"}};n=tN(Qn(),l,i,s,!0,{location:u},o)};["click"].forEach(i=>{pt.document&&addEventListener(i,r,{once:!1,capture:!0})})}function WY(t){return"duration"in t}const jx=10;function qY(t,e){const n=({entries:r})=>{const i=Lt(),s=i!==void 0&&i.getIntegrationByName!==void 0?i.getIntegrationByName("Replay"):void 0,o=s!==void 0?s.getReplayId():void 0,a=pc(),c=Gr(),u=c!==void 0?c.getUser():void 0;r.forEach(l=>{if(WY(l)){const d=l.interactionId;if(d===void 0)return;const f=t[d],h=l.duration,m=l.startTime,p=Object.keys(t),g=p.length>0?p.reduce((y,v)=>t[y].duration<t[v].duration?y:v):void 0;if(l.entryType==="first-input"&&p.map(v=>t[v]).some(v=>v.duration===h&&v.startTime===m)||!d)return;if(f)f.duration=Math.max(f.duration,h);else if(p.length<jx||g===void 0||h>t[g].duration){const y=e.name,v=e.context;y&&v&&(g&&Object.keys(t).length>=jx&&delete t[g],t[d]={routeName:y,duration:h,parentContext:v,user:u,activeTransaction:a,replayId:o,startTime:m})}}})};Du("event",n),Du("first-input",n)}function GY(t){const e=t.attributes&&t.attributes[as],n=t.data&&t.data[as],r=t.metadata&&t.metadata.source;return e||n||r}const Jt=Mt;let Eb=0;function xN(){return Eb>0}function ZY(){Eb++,setTimeout(()=>{Eb--})}function Nu(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(Vw(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{const s=i.map(o=>Nu(o,e));return t.apply(this,s)}catch(s){throw ZY(),BR(o=>{o.addEventProcessor(a=>(e.mechanism&&(ob(a,void 0),Ka(a,e.mechanism)),a.extra={...a.extra,arguments:i},a)),Df(s)}),s}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}yR(r,t),Go(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const Ls=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function TN(t,e){const n=t0(t,e),r={type:e&&e.name,value:XY(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function YY(t,e,n,r){const i=Lt(),s=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:ug(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:tK(e,{isUnhandledRejection:r})}]},extra:{__serialized__:kR(e,s)}};if(n){const a=t0(t,n);a.length&&(o.exception.values[0].stacktrace={frames:a})}return o}function Uy(t,e){return{exception:{values:[TN(t,e)]}}}function t0(t,e){const n=e.stacktrace||e.stack||"",r=JY(e);try{return t(n,r)}catch{}return[]}const KY=/Minified React error #\d+;/i;function JY(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(KY.test(t.message))return 1}return 0}function XY(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function QY(t,e,n,r){const i=n&&n.syntheticException||void 0,s=n0(t,e,i,r);return Ka(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),Cu(s)}function eK(t,e,n="info",r,i){const s=r&&r.syntheticException||void 0,o=Sb(t,e,s,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Cu(o)}function n0(t,e,n,r,i){let s;if(jw(e)&&e.error)return Uy(t,e.error);if(QS(e)||eq(e)){const o=e;if("stack"in e)s=Uy(t,e);else{const a=o.name||(QS(o)?"DOMError":"DOMException"),c=o.message?`${a}: ${o.message}`:a;s=Sb(t,c,n,r),ob(s,c)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return tu(e)?Uy(t,e):Za(e)||ug(e)?(s=YY(t,e,n,i),Ka(s,{synthetic:!0}),s):(s=Sb(t,e,n,r),ob(s,`${e}`),Ka(s,{synthetic:!0}),s)}function Sb(t,e,n,r){const i={};if(r&&n){const s=t0(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(Uw(e)){const{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function tK(t,{isUnhandledRejection:e}){const n=bq(t),r=e?"promise rejection":"exception";return jw(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:ug(t)?`Event \`${nK(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function nK(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function rK(t,{metadata:e,tunnel:n,dsn:r}){const i={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Xu(r)}},s=iK(t);return Jo(i,[s])}function iK(t){return[{type:"user_report"},t]}class sK extends pZ{constructor(e){const n=Jt.SENTRY_SDK_SOURCE||jq();aN(e,"browser",["browser"],n),super(e),e.sendClientReports&&Jt.document&&Jt.document.addEventListener("visibilitychange",()=>{Jt.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return QY(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return eK(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){Ls&&me.warn("SDK not enabled, will not capture user feedback.");return}const n=rK(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){Ls&&me.log("No outcomes to send");return}if(!this._dsn){Ls&&me.log("No dsn provided, will not send outcomes");return}Ls&&me.log("Sending outcomes:",e);const n=cG(e,this._options.tunnel&&Xu(this._dsn));this._sendEnvelope(n)}}let Ml;function oK(){if(Ml)return Ml;if(lb(Jt.fetch))return Ml=Jt.fetch.bind(Jt);const t=Jt.document;let e=Jt.fetch;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){Ls&&me.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return Ml=e.bind(Jt)}function aK(){Ml=void 0}function cK(t,e=oK()){let n=0,r=0;function i(s){const o=s.body.length;n+=o,r++;const a={body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=o,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return aK(),n-=o,r--,Hw(c)}}return sN(t,i)}const uK=4;function lK(t){function e(n){return new Fr((r,i)=>{const s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===uK&&r({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",t.url);for(const o in t.headers)Object.prototype.hasOwnProperty.call(t.headers,o)&&s.setRequestHeader(o,t.headers[o]);s.send(n.body)})}return sN(t,e)}const wg="?",dK=30,fK=40,hK=50;function r0(t,e,n,r){const i={filename:t,function:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const pK=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mK=/\((\S*)(?::(\d+))(?::(\d+))\)/,gK=t=>{const e=pK.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const s=mK.exec(e[2]);s&&(e[2]=s[1],e[3]=s[2],e[4]=s[3])}const[r,i]=IN(e[1]||wg,e[2]);return r0(i,r,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},yK=[dK,gK],vK=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bK=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_K=t=>{const e=vK.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=bK.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let r=e[3],i=e[1]||wg;return[i,r]=IN(i,r),r0(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},wK=[hK,_K],EK=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,SK=t=>{const e=EK.exec(t);return e?r0(e[2],e[1]||wg,+e[3],e[4]?+e[4]:void 0):void 0},xK=[fK,SK],TK=[yK,wK,xK],IK=_R(...TK),IN=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:wg,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Th=1024,ON="Breadcrumbs",OK=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:ON,setupOnce(){},setup(n){e.console&&wR(DK(n)),e.dom&&xR(kK(n,e.dom)),e.xhr&&hg(RK(n)),e.fetch&&dg(NK(n)),e.history&&fg(AK(n)),e.sentry&&n.on&&n.on("beforeSendEvent",CK(n))}}},CN=OK;Li(ON,CN);function CK(t){return function(n){Lt()===t&&Zo({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:_o(n)},{event:n})}}function kK(t,e){return function(r){if(Lt()!==t)return;let i,s,o=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Th&&(Ls&&me.warn(`\`dom.maxStringLength\` cannot exceed ${Th}, but a value of ${a} was configured. Sentry will use ${Th} instead.`),a=Th),typeof o=="string"&&(o=[o]);try{const u=r.event,l=PK(u)?u.target:u;i=qo(l,{keyAttrs:o,maxStringLength:a}),s=mR(l)}catch{i="<unknown>"}if(i.length===0)return;const c={category:`ui.${r.name}`,message:i};s&&(c.data={"ui.component_name":s}),Zo(c,{event:r.event,name:r.name,global:r.global})}}function DK(t){return function(n){if(Lt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:DR(n.level),message:em(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${em(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Zo(r,{input:n.args,level:n.level})}}function RK(t){return function(n){if(Lt()!==t)return;const{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[Ms];if(!r||!i||!s)return;const{method:o,url:a,status_code:c,body:u}=s,l={method:o,url:a,status_code:c},d={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:i};Zo({category:"xhr",data:l,type:"http"},d)}}function NK(t){return function(n){if(Lt()!==t)return;const{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i};Zo({category:"fetch",data:s,level:"error",type:"http"},o)}else{const s=n.response,o={...n.fetchData,status_code:s&&s.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:i};Zo({category:"fetch",data:o,type:"http"},a)}}}function AK(t){return function(n){if(Lt()!==t)return;let r=n.from,i=n.to;const s=ka(Jt.location.href);let o=r?ka(r):void 0;const a=ka(i);(!o||!o.path)&&(o=s),s.protocol===a.protocol&&s.host===a.host&&(i=a.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),Zo({category:"navigation",data:{from:r,to:i}})}}function PK(t){return!!t&&!!t.target}const kN="Dedupe",MK=()=>{let t;return{name:kN,setupOnce(){},processEvent(e){if(e.type)return e;try{if(LK(e,t))return Ls&&me.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},DN=MK;Li(kN,DN);function LK(t,e){return e?!!(FK(t,e)||$K(t,e)):!1}function FK(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!NN(t,e)||!RN(t,e))}function $K(t,e){const n=Ux(e),r=Ux(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!NN(t,e)||!RN(t,e))}function RN(t,e){let n=Bx(t),r=Bx(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){const s=r[i],o=n[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function NN(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Ux(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Bx(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const AN="GlobalHandlers",jK=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:AN,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(UK(n),zx("onerror")),e.onunhandledrejection&&(BK(n),zx("onunhandledrejection"))}}},PN=jK;Li(AN,PN);function UK(t){OR(e=>{const{stackParser:n,attachStacktrace:r}=LN();if(Lt()!==t||xN())return;const{msg:i,url:s,line:o,column:a,error:c}=e,u=c===void 0&&os(i)?HK(i,s,o,a):MN(n0(n,c||i,void 0,r,!1),s,o,a);u.level="error",yg(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function BK(t){CR(e=>{const{stackParser:n,attachStacktrace:r}=LN();if(Lt()!==t||xN())return;const i=zK(e),s=Bw(i)?VK(i):n0(n,i,void 0,r,!0);s.level="error",yg(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function zK(t){if(Bw(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return t}function VK(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function HK(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=jw(t)?t.message:t,o="Error";const a=s.match(i);return a&&(o=a[1],s=a[2]),MN({exception:{values:[{type:o,value:s}]}},e,n,r)}function MN(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[],u=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,d=os(e)&&e.length>0?e:uq();return c.length===0&&c.push({colno:u,filename:d,function:"?",in_app:!0,lineno:l}),t}function zx(t){Ls&&me.log(`Global Handler attached: ${t}`)}function LN(){const t=Lt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const FN="HttpContext",WK=()=>({name:FN,setupOnce(){},preprocessEvent(t){if(!Jt.navigator&&!Jt.location&&!Jt.document)return;const e=t.request&&t.request.url||Jt.location&&Jt.location.href,{referrer:n}=Jt.document||{},{userAgent:r}=Jt.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),$N=WK;Li(FN,$N);const qK="cause",GK=5,jN="LinkedErrors",ZK=(t={})=>{const e=t.limit||GK,n=t.key||qK;return{name:jN,setupOnce(){},preprocessEvent(r,i,s){const o=s.getOptions();sq(TN,o.stackParser,o.maxValueLength,n,e,r,i)}}},UN=ZK;Li(jN,UN);const YK=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],BN="TryCatch",KK=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:BN,setupOnce(){e.setTimeout&&Vn(Jt,"setTimeout",Vx),e.setInterval&&Vn(Jt,"setInterval",Vx),e.requestAnimationFrame&&Vn(Jt,"requestAnimationFrame",JK),e.XMLHttpRequest&&"XMLHttpRequest"in Jt&&Vn(XMLHttpRequest.prototype,"send",XK);const n=e.eventTarget;n&&(Array.isArray(n)?n:YK).forEach(QK)}}},zN=KK;Li(BN,zN);function Vx(t){return function(...e){const n=e[0];return e[0]=Nu(n,{mechanism:{data:{function:Ks(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function JK(t){return function(e){return t.apply(this,[Nu(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Ks(t)},handled:!1,type:"instrument"}})])}}function XK(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&Vn(n,i,function(s){const o={mechanism:{data:{function:i,handler:Ks(s)},handled:!1,type:"instrument"}},a=Vw(s);return a&&(o.mechanism.data.handler=Ks(a)),Nu(s,o)})}),t.apply(this,e)}}function QK(t){const e=Jt,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Vn(n,"addEventListener",function(r){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Nu(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ks(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,Nu(s,{mechanism:{data:{function:"addEventListener",handler:Ks(s),target:t},handled:!1,type:"instrument"}}),o])}}),Vn(n,"removeEventListener",function(r){return function(i,s,o){const a=s;try{const c=a&&a.__sentry_wrapped__;c&&r.call(this,i,c,o)}catch{}return r.call(this,i,a,o)}}))}const eJ=[uN(),dN(),zN(),CN(),PN(),UN(),DN(),$N()];function tJ(t){return[...eJ]}function nJ(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=tJ()),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),Jt.SENTRY_RELEASE&&Jt.SENTRY_RELEASE.id&&(t.release=Jt.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e={...t,stackParser:wq(t.stackParser||IK),integrations:cZ(t),transport:t.transport||(TR()?cK:lK)};vZ(sK,e),t.autoSessionTracking&&rJ()}function rJ(){if(typeof Jt.document>"u"){Ls&&me.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}vx({ignoreDuration:!0}),bx(),fg(({from:t,to:e})=>{t!==void 0&&t!==e&&(vx({ignoreDuration:!0}),bx())})}const cn=Mt,i0="sentryReplaySession",iJ="replay_event",s0="Unable to send Replay",sJ=3e5,oJ=9e5,aJ=5e3,cJ=5500,uJ=6e4,lJ=5e3,dJ=3,Hx=15e4,Ih=5e3,fJ=3e3,hJ=300,o0=2e7,pJ=4999,mJ=15e3,Wx=36e5;function gJ(t,e){return t??e()}function cm(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}var Fn;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Fn||(Fn={}));function yJ(t){return t.nodeType===t.ELEMENT_NODE}function Zl(t){const e=cm([t,"optionalAccess",n=>n.host]);return cm([e,"optionalAccess",n=>n.shadowRoot])===t}function Yl(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function vJ(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function bJ(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function um(t){try{const e=t.rules||t.cssRules;return e?vJ(Array.from(e,VN).join("")):null}catch{return null}}function VN(t){let e;if(wJ(t))try{e=um(t.styleSheet)||bJ(t)}catch{}else if(EJ(t)&&t.selectorText.includes(":"))return _J(t.cssText);return e||t.cssText}function _J(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function wJ(t){return"styleSheet"in t}function EJ(t){return"selectorText"in t}class HN{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const n=cm([this,"access",r=>r.getMeta,"call",r=>r(e),"optionalAccess",r=>r.id]);return gJ(n,()=>-1)}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function SJ(){return new HN}function Eg({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function nf({isMasked:t,element:e,value:n,maskInputFn:r}){let i=n||"";return t?(r&&(i=r(i,e)),"*".repeat(i.length)):i}function Au(t){return t.toLowerCase()}function xb(t){return t.toUpperCase()}const qx="__rrweb_original__";function xJ(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let i=0;i<t.height;i+=n){const s=e.getImageData,o=qx in s?s[qx]:s;if(new Uint32Array(o.call(e,r,i,Math.min(n,t.width-r),Math.min(n,t.height-i)).data.buffer).some(c=>c!==0))return!1}return!0}function a0(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Au(e):null}function lm(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}let TJ=1;const IJ=new RegExp("[^a-z0-9-_:]"),rf=-2;function c0(){return TJ++}function OJ(t){if(t instanceof HTMLFormElement)return"form";const e=Au(t.tagName);return IJ.test(e)?"div":e}function CJ(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let Cc,Gx;const kJ=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,DJ=/^(?:[a-z+]+:)?\/\//i,RJ=/^www\..*/i,NJ=/^(data:)([^,]*),(.*)/i;function dm(t,e){return(t||"").replace(kJ,(n,r,i,s,o,a)=>{const c=i||o||a,u=r||s||"";if(!c)return n;if(DJ.test(c)||RJ.test(c))return`url(${u}${c}${u})`;if(NJ.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${CJ(e)+c}${u})`;const l=e.split("/"),d=c.split("/");l.pop();for(const f of d)f!=="."&&(f===".."?l.pop():l.push(f));return`url(${u}${l.join("/")}${u})`})}const AJ=/^[^ \t\n\r\u000c]+/,PJ=/^[, \t\n\r\u000c]+/;function MJ(t,e){if(e.trim()==="")return e;let n=0;function r(s){let o;const a=s.exec(e.substring(n));return a?(o=a[0],n+=o.length,o):""}const i=[];for(;r(PJ),!(n>=e.length);){let s=r(AJ);if(s.slice(-1)===",")s=Uc(t,s.substring(0,s.length-1)),i.push(s);else{let o="";s=Uc(t,s);let a=!1;for(;;){const c=e.charAt(n);if(c===""){i.push((s+o).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,i.push((s+o).trim());break}else c==="("&&(a=!0);o+=c,n+=1}}}return i.join(", ")}function Uc(t,e){if(!e||e.trim()==="")return e;const n=t.createElement("a");return n.href=e,n.href}function LJ(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function u0(){const t=document.createElement("a");return t.href="",t.href}function WN(t,e,n,r,i,s){return r&&(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?Uc(t,r):n==="srcset"?MJ(t,r):n==="style"?dm(r,u0()):e==="object"&&n==="data"?Uc(t,r):typeof s=="function"?s(n,r,i):r)}function qN(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function FJ(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(n)return t.matches(n)}catch{}return!1}function $J(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function ya(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:ya(t.parentNode,e,n,r+1)}function Bc(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if($J(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Pu(t,e,n,r,i,s){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let a=-1,c=-1;if(s){if(c=ya(o,Bc(r,i)),c<0)return!0;a=ya(o,Bc(e,n),c>=0?c:1/0)}else{if(a=ya(o,Bc(e,n)),a<0)return!1;c=ya(o,Bc(r,i),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!s}catch{}return!!s}function jJ(t,e,n){const r=t.contentWindow;if(!r)return;let i=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const a=setTimeout(()=>{i||(e(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||t.src===o||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function UJ(t,e,n){let r=!1,i;try{i=t.sheet}catch{return}if(i)return;const s=setTimeout(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{clearTimeout(s),r=!0,e()})}function BJ(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:m={},maskTextFn:p,maskInputFn:g,dataURLOptions:y={},inlineImages:v,recordCanvas:b,keepIframeSrcFn:E,newlyAddedElement:w=!1}=e,x=zJ(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Fn.Document,childNodes:[],compatMode:t.compatMode}:{type:Fn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Fn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:x};case t.ELEMENT_NODE:return HJ(t,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:h,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:y,inlineImages:v,recordCanvas:b,keepIframeSrcFn:E,newlyAddedElement:w,rootId:x,maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f});case t.TEXT_NODE:return VJ(t,{maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:p,maskInputOptions:m,maskInputFn:g,rootId:x});case t.CDATA_SECTION_NODE:return{type:Fn.CDATA,textContent:"",rootId:x};case t.COMMENT_NODE:return{type:Fn.Comment,textContent:t.textContent||"",rootId:x};default:return!1}}function zJ(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function VJ(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:l}=e,d=t.parentNode&&t.parentNode.tagName;let f=t.textContent;const h=d==="STYLE"?!0:void 0,m=d==="SCRIPT"?!0:void 0,p=d==="TEXTAREA"?!0:void 0;if(h&&f){try{t.nextSibling||t.previousSibling||cm([t,"access",y=>y.parentNode,"access",y=>y.sheet,"optionalAccess",y=>y.cssRules])&&(f=um(t.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,t)}f=dm(f,u0())}m&&(f="SCRIPT_PLACEHOLDER");const g=Pu(t,r,s,i,o,n);if(!h&&!m&&!p&&f&&g&&(f=a?a(f,t.parentElement):f.replace(/[\S]/g,"*")),p&&f&&(c.textarea||g)&&(f=u?u(f,t.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const y=Eg({type:null,tagName:d,maskInputOptions:c});f=nf({isMasked:Pu(t,r,s,i,o,y),element:t,value:f,maskInputFn:u})}return{type:Fn.Text,textContent:f||"",isStyle:h,rootId:l}}function HJ(t,e){const{doc:n,blockClass:r,blockSelector:i,unblockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:m=!1,rootId:p,maskAllText:g,maskTextClass:y,unmaskTextClass:v,maskTextSelector:b,unmaskTextSelector:E}=e,w=FJ(t,r,i,s),x=OJ(t);let _={};const k=t.attributes.length;for(let F=0;F<k;F++){const V=t.attributes[F];V.name&&!qN(x,V.name,V.value)&&(_[V.name]=WN(n,x,Au(V.name),V.value,t,c))}if(x==="link"&&o){const F=Array.from(n.styleSheets).find(T=>T.href===t.href);let V=null;F&&(V=um(F)),V&&(delete _.rel,delete _.href,_._cssText=dm(V,F.href))}if(x==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const F=um(t.sheet);F&&(_._cssText=dm(F,u0()))}if(x==="input"||x==="textarea"||x==="select"||x==="option"){const F=t,V=a0(F),T=lm(F,xb(x),V),L=F.checked;if(V!=="submit"&&V!=="button"&&T){const S=Pu(F,y,b,v,E,Eg({type:V,tagName:xb(x),maskInputOptions:a}));_.value=nf({isMasked:S,element:F,value:T,maskInputFn:u})}L&&(_.checked=L)}if(x==="option"&&(t.selected&&!a.select?_.selected=!0:delete _.selected),x==="canvas"&&f){if(t.__context==="2d")xJ(t)||(_.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const F=t.toDataURL(l.type,l.quality),V=document.createElement("canvas");V.width=t.width,V.height=t.height;const T=V.toDataURL(l.type,l.quality);F!==T&&(_.rr_dataURL=F)}}if(x==="img"&&d){Cc||(Cc=n.createElement("canvas"),Gx=Cc.getContext("2d"));const F=t,V=F.crossOrigin;F.crossOrigin="anonymous";const T=()=>{F.removeEventListener("load",T);try{Cc.width=F.naturalWidth,Cc.height=F.naturalHeight,Gx.drawImage(F,0,0),_.rr_dataURL=Cc.toDataURL(l.type,l.quality)}catch(L){console.warn(`Cannot inline img src=${F.currentSrc}! Error: ${L}`)}V?_.crossOrigin=V:F.removeAttribute("crossorigin")};F.complete&&F.naturalWidth!==0?T():F.addEventListener("load",T)}if((x==="audio"||x==="video")&&(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime),m||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),w){const{width:F,height:V}=t.getBoundingClientRect();_={class:_.class,rr_width:`${F}px`,rr_height:`${V}px`}}x==="iframe"&&!h(_.src)&&(t.contentDocument||(_.rr_src=_.src),delete _.src);let R;try{customElements.get(x)&&(R=!0)}catch{}return{type:Fn.Element,tagName:x,attributes:_,childNodes:[],isSVG:LJ(t)||void 0,needBlock:w,rootId:p,isCustom:R}}function on(t){return t==null?"":t.toLowerCase()}function WJ(t,e){if(e.comment&&t.type===Fn.Comment)return!0;if(t.type===Fn.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(on(t.attributes.name).match(/^msapplication-tile(image|color)$/)||on(t.attributes.name)==="application-name"||on(t.attributes.rel)==="icon"||on(t.attributes.rel)==="apple-touch-icon"||on(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&on(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(on(t.attributes.property).match(/^(og|twitter|fb):/)||on(t.attributes.name).match(/^(og|twitter):/)||on(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(on(t.attributes.name)==="robots"||on(t.attributes.name)==="googlebot"||on(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(on(t.attributes.name)==="author"||on(t.attributes.name)==="generator"||on(t.attributes.name)==="framework"||on(t.attributes.name)==="publisher"||on(t.attributes.name)==="progid"||on(t.attributes.property).match(/^article:/)||on(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(on(t.attributes.name)==="google-site-verification"||on(t.attributes.name)==="yandex-verification"||on(t.attributes.name)==="csrf-token"||on(t.attributes.name)==="p:domain_verify"||on(t.attributes.name)==="verify-v1"||on(t.attributes.name)==="verification"||on(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function zc(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:h=!0,maskInputOptions:m={},maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b={},inlineImages:E=!1,recordCanvas:w=!1,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k=5e3,onStylesheetLoad:R,stylesheetLoadTimeout:F=5e3,keepIframeSrcFn:V=()=>!1,newlyAddedElement:T=!1}=e;let{preserveWhiteSpace:L=!0}=e;const S=BJ(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,dataURLOptions:b,inlineImages:E,recordCanvas:w,keepIframeSrcFn:V,newlyAddedElement:T});if(!S)return console.warn(t,"not serialized"),null;let C;r.hasNode(t)?C=r.getId(t):WJ(S,v)||!L&&S.type===Fn.Text&&!S.isStyle&&!S.textContent.replace(/^\s+|\s+$/gm,"").length?C=rf:C=c0();const N=Object.assign(S,{id:C});if(r.add(t,N),C===rf)return null;x&&x(t);let U=!f;if(N.type===Fn.Element){U=U&&!N.needBlock,delete N.needBlock;const K=t.shadowRoot;K&&Yl(K)&&(N.isShadowHost=!0)}if((N.type===Fn.Document||N.type===Fn.Element)&&U){v.headWhitespace&&N.type===Fn.Element&&N.tagName==="head"&&(L=!1);const K={doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:V};for(const $ of Array.from(t.childNodes)){const q=zc($,K);q&&N.childNodes.push(q)}if(yJ(t)&&t.shadowRoot)for(const $ of Array.from(t.shadowRoot.childNodes)){const q=zc($,K);q&&(Yl(t.shadowRoot)&&(q.isShadow=!0),N.childNodes.push(q))}}return t.parentNode&&Zl(t.parentNode)&&Yl(t.parentNode)&&(N.isShadow=!0),N.type===Fn.Element&&N.tagName==="iframe"&&jJ(t,()=>{const K=t.contentDocument;if(K&&_){const $=zc(K,{doc:K,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:V});$&&_(t,$)}},k),N.type===Fn.Element&&N.tagName==="link"&&N.attributes.rel==="stylesheet"&&UJ(t,()=>{if(R){const K=zc(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:L,onSerialize:x,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:V});K&&R(t,K)}},F),N}function qJ(t,e){const{mirror:n=new HN,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:l=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:h=!1,maskAllInputs:m=!1,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOM:v=!1,dataURLOptions:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:_,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:F=()=>!1}=e;return zc(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:p,maskTextFn:g,maskInputFn:y,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:b,inlineImages:f,recordCanvas:h,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:x,iframeLoadTimeout:_,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:F,newlyAddedElement:!1})}function mo(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function mr(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Mc=`Please stop import mirror directly. Instead of that,\r
|
|
414
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
415
|
-
or you can use record.mirror to access the mirror instance during recording.`;let Zx={map:{},getId(){return console.error(Mc),-1},getNode(){return console.error(Mc),null},removeNodeFromMap(){console.error(Mc)},has(){return console.error(Mc),!1},reset(){console.error(Mc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Zx=new Proxy(Zx,{get(t,e,n){return e==="map"&&console.error(Mc),Reflect.get(t,e,n)}}));function sf(t,e,n={}){let r=null,i=0;return function(...s){const o=Date.now();!i&&n.leading===!1&&(i=o);const a=e-(o-i),c=this;a<=0||a>e?(r&&(QJ(r),r=null),i=o,t.apply(c,s)):!r&&n.trailing!==!1&&(r=Sg(()=>{i=n.leading===!1?0:Date.now(),r=null,t.apply(c,s)},a))}}function GN(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(o){Sg(()=>{n.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>GN(t,e,s||{},!0)}function l0(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}let fm=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(fm=()=>new Date().getTime());function ZN(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:mo([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:mo([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||mo([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function YN(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function KN(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function JN(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function _i(t,e,n,r,i){if(!t)return!1;const s=JN(t);if(!s)return!1;const o=Bc(e,n);if(!i){const u=r&&s.matches(r);return o(s)&&!u}const a=ya(s,o);let c=-1;return a<0?!1:(r&&(c=ya(s,Bc(null,r))),a>-1&&c<0?!0:a<c)}function GJ(t,e){return e.getId(t)!==-1}function By(t,e){return e.getId(t)===rf}function XN(t,e){if(Zl(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?XN(t.parentNode,e):!0:!0}function Tb(t){return!!t.changedTouches}function ZJ(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function QN(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function eA(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function Ib(t){return!!mo([t,"optionalAccess",e=>e.shadowRoot])}class YJ{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return fG(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function tA(t){let e=null;return mo([t,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function KJ(t){let e=t,n;for(;n=tA(e);)e=n;return e}function JJ(t){const e=t.ownerDocument;if(!e)return!1;const n=KJ(t);return e.contains(n)}function nA(t){const e=t.ownerDocument;return e?e.contains(t)||JJ(t):!1}const Yx={};function d0(t){const e=Yx[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch{}return Yx[t]=r.bind(window)}function XJ(...t){return d0("requestAnimationFrame")(...t)}function Sg(...t){return d0("setTimeout")(...t)}function QJ(...t){return d0("clearTimeout")(...t)}var xt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(xt||{}),Tt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Tt||{}),or=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(or||{}),Is=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Is||{});function eX(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function Kx(t){return"__ln"in t}class tX{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=eX([n,"optionalAccess",i=>i.next])||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&Kx(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&Kx(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Jx=(t,e)=>`${t}@${e}`;class nX{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new tX,i=c=>{let u=c,l=rf;for(;l===rf;)u=u&&u.nextSibling,l=u&&this.mirror.getId(u);return l},s=c=>{if(!c.parentNode||!nA(c))return;const u=Zl(c.parentNode)?this.mirror.getId(tA(c)):this.mirror.getId(c.parentNode),l=i(c);if(u===-1||l===-1)return r.addNode(c);const d=zc(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{QN(f,this.mirror)&&this.iframeManager.addIframe(f),eA(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Ib(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,h)=>{this.iframeManager.attachIframe(f,h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,h)=>{this.stylesheetManager.attachLinkElement(f,h)}});d&&(e.push({parentId:u,nextId:l,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)Xx(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!Qx(this.droppedSet,c)&&!Xx(this.removes,c,this.mirror)||Qx(this.movedSet,c)?s(c):this.droppedSet.add(c);let o=null;for(;r.length;){let c=null;if(o){const u=this.mirror.getId(o.value.parentNode),l=i(o.value);u!==-1&&l!==-1&&(c=o)}if(!c){let u=r.tail;for(;u;){const l=u;if(u=u.previous,l){const d=this.mirror.getId(l.value.parentNode);if(i(l.value)===-1)continue;if(d!==-1){c=l;break}else{const h=l.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=h.parentNode.host;if(this.mirror.getId(m)!==-1){c=l;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}o=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:u}=c;if(typeof u.style=="string"){const l=JSON.stringify(c.styleDiff),d=JSON.stringify(c._unchangedStyles);l.length<u.style.length&&(l+d).split("var(").length===u.style.split("var(").length&&(u.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:u}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!By(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Pu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,JN(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=a0(n),a=n.tagName;i=lm(n,a,o);const c=Eg({maskInputOptions:this.maskInputOptions,tagName:a,type:o}),u=Pu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);i=nf({isMasked:u,element:n,value:i,maskInputFn:this.maskInputFn})}if(_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||i===e.oldValue)return;let s=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!qN(n.tagName,r)&&(s.attributes[r]=WN(this.doc,Au(n.tagName),Au(r),i,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==o.style.getPropertyValue(a)||u!==o.style.getPropertyPriority(a)?u===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,u]:s._unchangedStyles[a]=[c,u]}for(const a of Array.from(o.style))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),i=Zl(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);_i(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||By(n,this.mirror)||!GJ(n,this.mirror)||(this.addedSet.has(n)?(Ob(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||XN(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Jx(r,i)]?Ob(this.movedSet,n):this.removes.push({parentId:i,id:r,isShadow:Zl(e.target)&&Yl(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(By(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Jx(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);_i(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(r=>this.genAdds(r)),Ib(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ob(t,e){t.delete(e),e.childNodes.forEach(n=>Ob(t,n))}function Xx(t,e,n){return t.length===0?!1:rA(t,e,n)}function rA(t,e,n){const{parentNode:r}=e;if(!r)return!1;const i=n.getId(r);return t.some(s=>s.id===i)?!0:rA(t,r,n)}function Qx(t,e){return t.size===0?!1:iA(t,e)}function iA(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:iA(t,n):!1}let Kl;function rX(t){Kl=t}function iX(){Kl=void 0}const $t=t=>Kl?(...n)=>{try{return t(...n)}catch(r){if(Kl&&Kl(r)===!0)return()=>{};throw r}}:t;function Zi(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const Vc=[];function Lf(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function sA(t,e){const n=new nX;Vc.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const i=Zi([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);i&&window[i]&&(r=window[i]);const s=new r($t(o=>{t.onMutation&&t.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function sX({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],a;const c=sf($t(d=>{const f=Date.now()-a;t(o.map(h=>(h.timeOffset-=f,h)),d),o=[],a=null}),s),u=$t(sf($t(d=>{const f=Lf(d),{clientX:h,clientY:m}=Tb(d)?d.changedTouches[0]:d;a||(a=fm()),o.push({x:h,y:m,id:r.getId(f),timeOffset:fm()-a}),c(typeof DragEvent<"u"&&d instanceof DragEvent?Tt.Drag:d instanceof MouseEvent?Tt.MouseMove:Tt.TouchMove)}),i,{trailing:!1})),l=[mr("mousemove",u,n),mr("touchmove",u,n),mr("drag",u,n)];return $t(()=>{l.forEach(d=>d())})}function oX({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[];let u=null;const l=d=>f=>{const h=Lf(f);if(_i(h,r,i,s,!0))return;let m=null,p=d;if("pointerType"in f){switch(f.pointerType){case"mouse":m=Is.Mouse;break;case"touch":m=Is.Touch;break;case"pen":m=Is.Pen;break}m===Is.Touch?or[d]===or.MouseDown?p="TouchStart":or[d]===or.MouseUp&&(p="TouchEnd"):Is.Pen}else Tb(f)&&(m=Is.Touch);m!==null?(u=m,(p.startsWith("Touch")&&m===Is.Touch||p.startsWith("Mouse")&&m===Is.Mouse)&&(m=null)):or[d]===or.Click&&(m=u,u=null);const g=Tb(f)?f.changedTouches[0]:f;if(!g)return;const y=n.getId(h),{clientX:v,clientY:b}=g;$t(t)({type:or[p],id:y,x:v,y:b,...m!==null&&{pointerType:m}})};return Object.keys(or).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&a[d]!==!1).forEach(d=>{let f=Au(d);const h=l(d);if(window.PointerEvent)switch(or[d]){case or.MouseDown:case or.MouseUp:f=f.replace("mouse","pointer");break;case or.TouchStart:case or.TouchEnd:return}c.push(mr(f,h,e))}),$t(()=>{c.forEach(d=>d())})}function oA({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){const a=$t(sf($t(c=>{const u=Lf(c);if(!u||_i(u,r,i,s,!0))return;const l=n.getId(u);if(u===e&&e.defaultView){const d=ZN(e.defaultView);t({id:l,x:d.left,y:d.top})}else t({id:l,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return mr("scroll",a,e)}function aX({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const i=$t(sf($t(()=>{const s=YN(),o=KN();(n!==s||r!==o)&&(t({width:Number(o),height:Number(s)}),n=s,r=o)}),200));return mr("resize",i,e)}const cX=["INPUT","TEXTAREA","SELECT"],eT=new WeakMap;function uX({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:l,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:h,maskTextSelector:m,unmaskTextSelector:p}){function g(_){let k=Lf(_);const R=_.isTrusted,F=k&&xb(k.tagName);if(F==="OPTION"&&(k=k.parentElement),!k||!F||cX.indexOf(F)<0||_i(k,r,i,s,!0))return;const V=k;if(V.classList.contains(o)||a&&V.matches(a))return;const T=a0(k);let L=lm(V,F,T),S=!1;const C=Eg({maskInputOptions:c,tagName:F,type:T}),N=Pu(k,f,m,h,p,C);(T==="radio"||T==="checkbox")&&(S=k.checked),L=nf({isMasked:N,element:k,value:L,maskInputFn:u}),y(k,d?{text:L,isChecked:S,userTriggered:R}:{text:L,isChecked:S});const U=k.name;T==="radio"&&U&&S&&e.querySelectorAll(`input[type="radio"][name="${U}"]`).forEach(K=>{if(K!==k){const $=nf({isMasked:N,element:K,value:lm(K,F,T),maskInputFn:u});y(K,d?{text:$,isChecked:!S,userTriggered:!1}:{text:$,isChecked:!S})}})}function y(_,k){const R=eT.get(_);if(!R||R.text!==k.text||R.isChecked!==k.isChecked){eT.set(_,k);const F=n.getId(_);$t(t)({...k,id:F})}}const b=(l.input==="last"?["change"]:["input","change"]).map(_=>mr(_,$t(g),e)),E=e.defaultView;if(!E)return()=>{b.forEach(_=>_())};const w=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),x=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return w&&w.set&&b.push(...x.map(_=>GN(_[0],_[1],{set(){$t(g)({target:this,isTrusted:!1})}},!1,E))),$t(()=>{b.forEach(_=>_())})}function hm(t){const e=[];function n(r,i){if(Oh("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Oh("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Oh("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Oh("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return n(t,e)}function go(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function lX({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:$t((l,d,f)=>{const[h,m]=f,{id:p,styleId:g}=go(d,e,n.styleMirror);return(p&&p!==-1||g&&g!==-1)&&t({id:p,styleId:g,adds:[{rule:h,index:m}]}),l.apply(d,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:$t((l,d,f)=>{const[h]=f,{id:m,styleId:p}=go(d,e,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&t({id:m,styleId:p,removes:[{index:h}]}),l.apply(d,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:$t((l,d,f)=>{const[h]=f,{id:m,styleId:p}=go(d,e,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&t({id:m,styleId:p,replace:h}),l.apply(d,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:$t((l,d,f)=>{const[h]=f,{id:m,styleId:p}=go(d,e,n.styleMirror);return(m&&m!==-1||p&&p!==-1)&&t({id:m,styleId:p,replaceSync:h}),l.apply(d,f)})}));const c={};Ch("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Ch("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Ch("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Ch("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach(([l,d])=>{u[l]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[l].insertRule,{apply:$t((f,h,m)=>{const[p,g]=m,{id:y,styleId:v}=go(h.parentStyleSheet,e,n.styleMirror);return(y&&y!==-1||v&&v!==-1)&&t({id:y,styleId:v,adds:[{rule:p,index:[...hm(h),g||0]}]}),f.apply(h,m)})}),d.prototype.deleteRule=new Proxy(u[l].deleteRule,{apply:$t((f,h,m)=>{const[p]=m,{id:g,styleId:y}=go(h.parentStyleSheet,e,n.styleMirror);return(g&&g!==-1||y&&y!==-1)&&t({id:g,styleId:y,removes:[{index:[...hm(h),p]}]}),f.apply(h,m)})})}),$t(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=s,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([l,d])=>{d.prototype.insertRule=u[l].insertRule,d.prototype.deleteRule=u[l].deleteRule})})}function aA({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);const i=n.nodeName==="#document"?Zi([n,"access",o=>o.defaultView,"optionalAccess",o=>o.Document]):Zi([n,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),s=Zi([i,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(Zi([i,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!i||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return Zi([s,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const a=Zi([s,"access",c=>c.set,"optionalAccess",c=>c.call,"call",c=>c(this,o)]);if(r!==null&&r!==-1)try{e.adoptStyleSheets(o,r)}catch{}return a}}),$t(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function dX({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:$t((a,c,u)=>{const[l,d,f]=u;if(n.has(l))return s.apply(c,[l,d,f]);const{id:h,styleId:m}=go(Zi([c,"access",p=>p.parentRule,"optionalAccess",p=>p.parentStyleSheet]),e,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&t({id:h,styleId:m,set:{property:l,value:d,priority:f},index:hm(c.parentRule)}),a.apply(c,u)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:$t((a,c,u)=>{const[l]=u;if(n.has(l))return o.apply(c,[l]);const{id:d,styleId:f}=go(Zi([c,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),e,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&t({id:d,styleId:f,remove:{property:l},index:hm(c.parentRule)}),a.apply(c,u)})}),$t(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o})}function fX({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:i,sampling:s,doc:o}){const a=$t(u=>sf($t(l=>{const d=Lf(l);if(!d||_i(d,e,n,r,!0))return;const{currentTime:f,volume:h,muted:m,playbackRate:p}=d;t({type:u,id:i.getId(d),currentTime:f,volume:h,muted:m,playbackRate:p})}),s.media||500)),c=[mr("play",a(0),o),mr("pause",a(1),o),mr("seeked",a(2),o),mr("volumechange",a(3),o),mr("ratechange",a(4),o)];return $t(()=>{c.forEach(u=>u())})}function hX({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(c,u,l){const d=new s(c,u,l);return i.set(d,{family:c,buffer:typeof u!="string",descriptors:l,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};const o=l0(e.fonts,"add",function(a){return function(c){return Sg($t(()=>{const u=i.get(c);u&&(t(u),i.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(o),$t(()=>{r.forEach(a=>a())})}function pX(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=t;let a=!0;const c=$t(()=>{const u=e.getSelection();if(!u||a&&Zi([u,"optionalAccess",f=>f.isCollapsed]))return;a=u.isCollapsed||!1;const l=[],d=u.rangeCount||0;for(let f=0;f<d;f++){const h=u.getRangeAt(f),{startContainer:m,startOffset:p,endContainer:g,endOffset:y}=h;_i(m,r,i,s,!0)||_i(g,r,i,s,!0)||l.push({start:n.getId(m),startOffset:p,end:n.getId(g),endOffset:y})}o({ranges:l})});return c(),mr("selectionchange",c)}function mX({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:l0(n.customElements,"define",function(i){return function(s,o,a){try{e({define:{name:s}})}catch{}return i.apply(this,[s,o,a])}})}function gX(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=sA(t,t.doc),i=sX(t),s=oX(t),o=oA(t),a=aX(t,{win:n}),c=uX(t),u=fX(t),l=lX(t,{win:n}),d=aA(t,t.doc),f=dX(t,{win:n}),h=t.collectFonts?hX(t):()=>{},m=pX(t),p=mX(t),g=[];for(const y of t.plugins)g.push(y.observer(y.callback,n,y.options));return $t(()=>{Vc.forEach(y=>y.reset()),r.disconnect(),i(),s(),o(),a(),c(),u(),l(),d(),f(),h(),m(),p(),g.forEach(y=>y())})}function Oh(t){return typeof window[t]<"u"}function Ch(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Cb{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,i){const s=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let a=s.get(n);return a||(a=this.generateIdFn(),s.set(n,a),o.set(a,n)),a}getIds(e,n){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return n.map(s=>this.getId(e,s,r,i))}getRemoteId(e,n,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const s=i.get(n);return s||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}function tT(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}class yX{constructor(){this.crossOriginIframeMirror=new Cb(c0),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class vX{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Cb(c0),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Cb(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),tT([this,"access",r=>r.loadListener,"optionalCall",r=>r(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const s=this.transformCrossOriginEvent(i,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case xt.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:xt.IncrementalSnapshot,data:{source:Tt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case xt.Meta:case xt.Load:case xt.DomContentLoaded:return!1;case xt.Plugin:return n;case xt.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case xt.IncrementalSnapshot:switch(n.data.source){case Tt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const i=this.crossOriginIframeRootIdMap.get(e);i&&this.patchRootIdOnNode(r.node,i)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.Drag:case Tt.TouchMove:case Tt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.ViewportResize:return!1;case Tt.MediaInteraction:case Tt.MouseInteraction:case Tt.Scroll:case Tt.CanvasMutation:case Tt.Input:return this.replaceIds(n.data,e,["id"]),n;case Tt.StyleSheetRule:case Tt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Tt.Font:return n;case Tt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Tt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),tT([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(i=>{this.replaceStyleIds(i,e,["styleId"])})]),n}}return!1}replace(e,n,r,i){for(const s of i)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=e.getIds(r,n[s]):n[s]=e.getId(r,n[s]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==Fn.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class bX{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class _X{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Yl(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=sA({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(oA({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Sg(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(aA({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(l0(e.prototype,"attachShadow",function(i){return function(s){const o=i.call(this,s);return this.shadowRoot&&nA(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class nT{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class wX{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new YJ,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},i=[];for(const s of e){let o;this.styleMirror.has(s)?o=this.styleMirror.getId(s):(o=this.styleMirror.add(s),i.push({styleId:o,rules:Array.from(s.rules||CSSRule,(a,c)=>({rule:VN(a),index:c}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class EX{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){XJ(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==n)}add(e,n){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let _n,pm;const di=SJ();function No(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:s=null,unblockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:l="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:h=null,inlineStylesheet:m=!0,maskAllInputs:p,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,maxCanvasSize:w=null,packFn:x,sampling:_={},dataURLOptions:k={},mousemoveWait:R,recordCanvas:F=!1,recordCrossOriginIframes:V=!1,recordAfter:T=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:L=!1,collectFonts:S=!1,inlineImages:C=!1,plugins:N,keepIframeSrcFn:U=()=>!1,ignoreCSSAttributes:K=new Set([]),errorHandler:$,onMutation:q,getCanvasManager:j}=t;rX($);const D=V?window.parent===window:!0;let X=!1;if(!D)try{window.parent.document&&(X=!1)}catch{X=!0}if(D&&!e)throw new Error("emit function is required");R!==void 0&&_.mousemove===void 0&&(_.mousemove=R),di.reset();const Z=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g!==void 0?g:{},z=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};ZJ();let le,pe=0;const ve=A=>{for(const G of N||[])G.eventProcessor&&(A=G.eventProcessor(A));return x&&!X&&(A=x(A)),A};_n=(A,G)=>{const Q=A;if(Q.timestamp=fm(),Py([Vc,"access",H=>H[0],"optionalAccess",H=>H.isFrozen,"call",H=>H()])&&Q.type!==xt.FullSnapshot&&!(Q.type===xt.IncrementalSnapshot&&Q.data.source===Tt.Mutation)&&Vc.forEach(H=>H.unfreeze()),D)Py([e,"optionalCall",H=>H(ve(Q),G)]);else if(X){const H={type:"rrweb",event:ve(Q),origin:window.location.origin,isCheckout:G};window.parent.postMessage(H,"*")}if(Q.type===xt.FullSnapshot)le=Q,pe=0;else if(Q.type===xt.IncrementalSnapshot){if(Q.data.source===Tt.Mutation&&Q.data.isAttachIframe)return;pe++;const H=r&&pe>=r,ee=n&&le&&Q.timestamp-le.timestamp>n;(H||ee)&&I(!0)}};const je=A=>{_n({type:xt.IncrementalSnapshot,data:{source:Tt.Mutation,...A}})},ct=A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.Scroll,...A}}),ut=A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...A}}),Ye=A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.AdoptedStyleSheet,...A}}),Ot=new wX({mutationCb:je,adoptedStyleSheetCb:Ye}),O=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new yX:new vX({mirror:di,mutationCb:je,stylesheetManager:Ot,recordCrossOriginIframes:V,wrappedEmit:_n});for(const A of N||[])A.getMirror&&A.getMirror({nodeMirror:di,crossOriginIframeMirror:O.crossOriginIframeMirror,crossOriginIframeStyleMirror:O.crossOriginIframeStyleMirror});const he=new EX,ae=xX(j,{mirror:di,win:window,mutationCb:A=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...A}}),recordCanvas:F,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:w,sampling:_.canvas,dataURLOptions:k,errorHandler:$}),W=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new bX:new _X({mutationCb:je,scrollCb:ct,bypassOptions:{onMutation:q,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:m,maskInputOptions:Z,dataURLOptions:k,maskAttributeFn:v,maskTextFn:E,maskInputFn:b,recordCanvas:F,inlineImages:C,sampling:_,slimDOMOptions:z,iframeManager:O,stylesheetManager:Ot,canvasManager:ae,keepIframeSrcFn:U,processedNodeManager:he},mirror:di}),I=(A=!1)=>{_n({type:xt.Meta,data:{href:window.location.href,width:KN(),height:YN()}},A),Ot.reset(),W.init(),Vc.forEach(Q=>Q.lock());const G=qJ(document,{mirror:di,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:m,maskAllInputs:Z,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,slimDOM:z,dataURLOptions:k,recordCanvas:F,inlineImages:C,onSerialize:Q=>{QN(Q,di)&&O.addIframe(Q),eA(Q,di)&&Ot.trackLinkElement(Q),Ib(Q)&&W.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,H)=>{O.attachIframe(Q,H),W.observeAttachShadow(Q)},onStylesheetLoad:(Q,H)=>{Ot.attachLinkElement(Q,H)},keepIframeSrcFn:U});if(!G)return console.warn("Failed to snapshot the document");_n({type:xt.FullSnapshot,data:{node:G,initialOffset:ZN(window)}}),Vc.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ot.adoptStyleSheets(document.adoptedStyleSheets,di.getId(document))};pm=I;try{const A=[],G=H=>$t(gX)({onMutation:q,mutationCb:je,mousemoveCb:(ee,de)=>_n({type:xt.IncrementalSnapshot,data:{source:de,positions:ee}}),mouseInteractionCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.MouseInteraction,...ee}}),scrollCb:ct,viewportResizeCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.ViewportResize,...ee}}),inputCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.Input,...ee}}),mediaInteractionCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.MediaInteraction,...ee}}),styleSheetRuleCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.StyleSheetRule,...ee}}),styleDeclarationCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.StyleDeclaration,...ee}}),canvasMutationCb:ut,fontCb:ee=>_n({type:xt.IncrementalSnapshot,data:{source:Tt.Font,...ee}}),selectionCb:ee=>{_n({type:xt.IncrementalSnapshot,data:{source:Tt.Selection,...ee}})},customElementCb:ee=>{_n({type:xt.IncrementalSnapshot,data:{source:Tt.CustomElement,...ee}})},blockClass:i,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:h,maskInputOptions:Z,inlineStylesheet:m,sampling:_,recordCanvas:F,inlineImages:C,userTriggeredOnInput:L,collectFonts:S,doc:H,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,keepIframeSrcFn:U,blockSelector:s,unblockSelector:o,slimDOMOptions:z,dataURLOptions:k,mirror:di,iframeManager:O,stylesheetManager:Ot,shadowDomManager:W,processedNodeManager:he,canvasManager:ae,ignoreCSSAttributes:K,plugins:Py([N,"optionalAccess",ee=>ee.filter,"call",ee=>ee(de=>de.observer),"optionalAccess",ee=>ee.map,"call",ee=>ee(de=>({observer:de.observer,options:de.options,callback:fe=>_n({type:xt.Plugin,data:{plugin:de.name,payload:fe}})}))])||[]},{});O.addLoadListener(H=>{try{A.push(G(H.contentDocument))}catch(ee){console.warn(ee)}});const Q=()=>{I(),A.push(G(document))};return document.readyState==="interactive"||document.readyState==="complete"?Q():(A.push(mr("DOMContentLoaded",()=>{_n({type:xt.DomContentLoaded,data:{}}),T==="DOMContentLoaded"&&Q()})),A.push(mr("load",()=>{_n({type:xt.Load,data:{}}),T==="load"&&Q()},window))),()=>{A.forEach(H=>H()),he.destroy(),pm=void 0,iX()}}catch(A){console.warn(A)}}function SX(t){if(!pm)throw new Error("please take full snapshot after start recording");pm(t)}No.mirror=di;No.takeFullSnapshot=SX;function xX(t,e){try{return t?t(e):new nT}catch{return console.warn("Unable to initialize CanvasManager"),new nT}}const TX=3,IX=5;function f0(t){return t>9999999999?t:t*1e3}function zy(t){return t>9999999999?t/1e3:t}function Ff(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:xt.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:vi(e,10,1e3)}}),e.category==="console")))}const OX="button,a";function cA(t){return t.closest(OX)||t}function uA(t){const e=lA(t);return!e||!(e instanceof Element)?e:cA(e)}function lA(t){return CX(t)?t.target:t}function CX(t){return typeof t=="object"&&!!t&&"target"in t}let yo;function kX(t){return yo||(yo=[],DX()),yo.push(t),()=>{const e=yo?yo.indexOf(t):-1;e>-1&&yo.splice(e,1)}}function DX(){Vn(cn,"open",function(t){return function(...e){if(yo)try{yo.forEach(n=>n())}catch{}return t.apply(cn,e)}})}function RX(t,e,n){t.handleClick(e,n)}class NX{constructor(e,n,r=Ff){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=kX(()=>{this._lastMutation=rT()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(PX(n,this._ignoreSelector)||!MX(e))return;const r={timestamp:zy(e.timestamp),clickBreadcrumb:e,clickCount:0,node:n};this._clicks.some(i=>i.node===r.node&&Math.abs(i.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=zy(e)}registerScroll(e=Date.now()){this._lastScroll=zy(e)}registerClick(e){const n=cA(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=rT();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&e.push(r)});for(const r of e){const i=this._clicks.indexOf(r);i>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(i,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,i=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!r&&!i,{clickCount:o,clickBreadcrumb:a}=e;if(s){const c=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",l={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:cn.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,l);return}if(o>1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:cn.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const AX=["A","BUTTON","INPUT"];function PX(t,e){return!!(!AX.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function MX(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function rT(){return Date.now()/1e3}function LX(t,e){try{if(!FX(e))return;const{source:n}=e.data;if(n===Tt.Mutation&&t.registerMutation(e.timestamp),n===Tt.Scroll&&t.registerScroll(e.timestamp),$X(e)){const{type:r,id:i}=e.data,s=No.mirror.getNode(i);s instanceof HTMLElement&&r===or.Click&&t.registerClick(s)}}catch{}}function FX(t){return t.type===TX}function $X(t){return t.data.source===Tt.MouseInteraction}function Qi(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var mm;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(mm||(mm={}));const jX=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function UX(t){const e={};for(const n in t)if(jX.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const BX=t=>e=>{if(!t.isEnabled())return;const n=zX(e);if(!n)return;const r=e.name==="click",i=r?e.event:void 0;r&&t.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&RX(t.clickDetector,n,uA(e.event)),Ff(t,n)};function dA(t,e){const n=No.mirror.getId(t),r=n&&No.mirror.getNode(n),i=r&&No.mirror.getMeta(r),s=i&&HX(i)?i:null;return{message:e,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(o=>o.type===mm.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:UX(s.attributes)}}:{}}}function zX(t){const{target:e,message:n}=VX(t);return Qi({category:`ui.${t.name}`,...dA(e,n)})}function VX(t){const e=t.name==="click";let n,r=null;try{r=e?uA(t.event):lA(t.event),n=qo(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function HX(t){return t.type===mm.Element}function WX(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=qX(e);n&&Ff(t,n)}function qX(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s,target:o}=t;if(!o||GX(o)||!s)return null;const a=e||r||i,c=s.length===1;if(!a&&c)return null;const u=qo(o,{maxStringLength:200})||"<unknown>",l=dA(o,u);return Qi({category:"ui.keyDown",message:u,data:{...l.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s}})}function GX(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const iT={resource:XX,paint:KX,navigation:JX};function ZX(t){return t.map(YX).filter(Boolean)}function YX(t){return iT[t.entryType]?iT[t.entryType](t):null}function Mu(t){return((Wr||cn.performance.timeOrigin)+t)/1e3}function KX(t){const{duration:e,entryType:n,name:r,startTime:i}=t,s=Mu(i);return{type:n,name:r,start:s,end:s+e,data:void 0}}function JX(t){const{entryType:e,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:h,transferSize:m,type:p}=t;return i===0?null:{type:`${e}.${p}`,start:Mu(h),end:Mu(s),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:l,loadEventEnd:d,domComplete:s,redirectCount:f}}}function XX(t){const{entryType:e,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:u}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:Mu(s),end:Mu(i),name:r,data:{size:u,statusCode:c,decodedBodySize:o,encodedBodySize:a}}}function QX(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,i=t.value,s=Mu(i);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:s,end:s,data:{value:i,size:i,nodeId:r?No.mirror.getId(r):void 0}}}function eQ(t){function e(i){t.performanceEntries.includes(i)||t.performanceEntries.push(i)}function n({entries:i}){i.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(i=>{r.push(Du(i,n))}),r.push(bN(({metric:i})=>{t.replayPerformanceEntries.push(QX(i))})),()=>{r.forEach(i=>i())}}const rn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,tQ='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function nQ(){const t=new Blob([tQ]);return URL.createObjectURL(t)}function lr(t,e){rn&&(me.info(t),e&&fA(t))}function iu(t,e){rn&&(me.info(t),e&&setTimeout(()=>{fA(t)},0))}function fA(t){Zo({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class h0 extends Error{constructor(){super(`Event buffer exceeded maximum size of ${o0}.`)}}class hA{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>o0)throw new h0;this.events.push(e)}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(n=>n.timestamp).sort()[0];return e?f0(e):null}}class rQ{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){lr("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((i,s)=>{const o=({data:a})=>{const c=a;if(c.method===e&&c.id===r){if(this._worker.removeEventListener("message",o),!c.success){rn&&me.error("[Replay]",c.response),s(new Error("Error in compression worker"));return}i(c.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:e,arg:n})})}_getAndIncrementId(){return this._id++}}class iQ{constructor(e){this._worker=new rQ(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const n=f0(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>o0?Promise.reject(new h0):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{rn&&me.warn('[Replay] Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class sQ{constructor(e){this._fallback=new hA,this._compression=new iQ(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{lr("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:n}=this._fallback,r=[];for(const i of e)r.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._used=this._compression;try{await Promise.all(r)}catch(i){rn&&me.warn("[Replay] Failed to add events when switching buffers.",i)}}}function oQ({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=aQ(e);if(n)return n}return lr("[Replay] Using simple buffer"),new hA}function aQ(t){try{const e=t||cQ();if(!e)return;lr(`[Replay] Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new sQ(n)}catch{lr("[Replay] Failed to create compression worker")}}function cQ(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?nQ():""}function p0(){try{return"sessionStorage"in cn&&!!cn.sessionStorage}catch{return!1}}function uQ(t){lQ(),t.session=void 0}function lQ(){if(p0())try{cn.sessionStorage.removeItem(i0)}catch{}}function pA(t){return t===void 0?!1:Math.random()<t}function mA(t){const e=Date.now(),n=t.id||Sn(),r=t.started||e,i=t.lastActivity||e,s=t.segmentId||0,o=t.sampled,a=t.previousSessionId;return{id:n,started:r,lastActivity:i,segmentId:s,sampled:o,previousSessionId:a}}function m0(t){if(p0())try{cn.sessionStorage.setItem(i0,JSON.stringify(t))}catch{}}function dQ(t,e){return pA(t)?"session":e?"buffer":!1}function sT({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const i=dQ(t,e),s=mA({sampled:i,previousSessionId:r});return n&&m0(s),s}function fQ(t){if(!p0())return null;try{const e=cn.sessionStorage.getItem(i0);if(!e)return null;const n=JSON.parse(e);return iu("[Replay] Loading existing session",t),mA(n)}catch{return null}}function kb(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function gA(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return kb(t.started,e,r)||kb(t.lastActivity,n,r)}function yA(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!gA(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function Vy({traceInternals:t,sessionIdleExpire:e,maxReplayDuration:n,previousSessionId:r},i){const s=i.stickySession&&fQ(t);return s?yA(s,{sessionIdleExpire:e,maxReplayDuration:n})?(iu("[Replay] Session in sessionStorage is expired, creating new one..."),sT(i,{previousSessionId:s.id})):s:(iu("[Replay] Creating new session",t),sT(i,{previousSessionId:r}))}function hQ(t){return t.type===xt.Custom}function g0(t,e,n){return bA(t,e)?(vA(t,e,n),!0):!1}function pQ(t,e,n){return bA(t,e)?vA(t,e,n):Promise.resolve(null)}async function vA(t,e,n){if(!t.eventBuffer)return null;try{n&&t.recordingMode==="buffer"&&t.eventBuffer.clear(),n&&(t.eventBuffer.hasCheckout=!0);const r=t.getOptions(),i=mQ(e,r.beforeAddRecordingEvent);return i?await t.eventBuffer.addEvent(i):void 0}catch(r){const i=r&&r instanceof h0?"addEventSizeExceeded":"addEvent";rn&&me.error(r),await t.stop({reason:i});const s=Lt();s&&s.recordDroppedEvent("internal_sdk_error","replay")}}function bA(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=f0(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(lr(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1):!0}function mQ(t,e){try{if(typeof e=="function"&&hQ(t))return e(t)}catch(n){return rn&&me.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return t}function y0(t){return!t.type}function Db(t){return t.type==="transaction"}function gQ(t){return t.type==="replay_event"}function oT(t){return t.type==="feedback"}function _A(t){const e=bQ();return(n,r)=>{if(!t.isEnabled()||!y0(n)&&!Db(n))return;const i=r&&r.statusCode;if(!(e&&(!i||i<200||i>=300))){if(Db(n)){yQ(t,n);return}vQ(t,n)}}}function yQ(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}function vQ(t,e){const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||setTimeout(()=>{t.sendBufferedReplayOrFlush()})}function bQ(){const t=Lt();if(!t)return!1;const e=t.getTransport();return e&&e.send.__sentry__baseTransport__||!1}function _Q(t){return e=>{!t.isEnabled()||!y0(e)||wQ(t,e)}}function wQ(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0].value;if(typeof n=="string"&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Qi({category:"replay.hydrate-error"});Ff(t,r)}}function EQ(t,e){return t.type||!t.exception||!t.exception.values||!t.exception.values.length?!1:!!(e.originalException&&e.originalException.__rrweb__)}function SQ(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:xt.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function xQ(t,e){return t.recordingMode!=="buffer"||e.message===s0||!e.exception||e.type?!1:pA(t.getOptions().errorSampleRate)}function TQ(t,e=!1){const n=e?_A(t):void 0;return Object.assign((r,i)=>t.isEnabled()?gQ(r)?(delete r.breadcrumbs,r):!y0(r)&&!Db(r)&&!oT(r)||!t.checkAndHandleExpiredSession()?r:oT(r)?(t.flush(),r.contexts.feedback.replay_id=t.getSessionId(),SQ(t,r),r):EQ(r,i)&&!t.getOptions()._experiments.captureExceptions?(rn&&me.log("[Replay] Ignoring error from rrweb internals",r),null):((xQ(t,r)||t.recordingMode==="session")&&(r.tags={...r.tags,replayId:t.getSessionId()}),n&&n(r,{statusCode:200}),r):r,{id:"Replay"})}function xg(t,e){return e.map(({type:n,start:r,end:i,name:s,data:o})=>{const a=t.throttledAddEvent({type:xt.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:i,data:o}}});return typeof a=="string"?Promise.resolve(null):a})}function IQ(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function OQ(t){return e=>{if(!t.isEnabled())return;const n=IQ(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(xg(t,[n]),!1)))}}function CQ(t,e){return rn&&t.getOptions()._experiments.traceInternals?!1:oN(e,Lt())}function Tg(t,e){t.isEnabled()&&e!==null&&(CQ(t,e.name)||t.addUpdate(()=>(xg(t,[e]),!0)))}function kQ(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:i}=t;if(!n)return null;const{method:s,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:s,statusCode:i?i.status:void 0}}}function DQ(t){return e=>{if(!t.isEnabled())return;const n=kQ(e);Tg(t,n)}}function RQ(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,i=r[Ms];if(!e||!n||!i)return null;const{method:s,url:o,status_code:a}=i;return o===void 0?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:s,statusCode:a}}}function NQ(t){return e=>{if(!t.isEnabled())return;const n=RQ(e);Tg(t,n)}}function Ig(t,e){if(t)try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=xA(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function wA(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function EA(t){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[xA(t)];if(!t)return[void 0]}catch{return rn&&me.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return rn&&me.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function gm(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function SA(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:a,response:c}=e;return{type:t,start:n/1e3,end:r/1e3,name:i,data:gr({method:s,statusCode:o,request:a,response:c})}}function of(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Ao(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:i,warnings:s}=AQ(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function Rb(t,e){return Object.keys(t).reduce((n,r)=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=t[r]),n},{})}function xA(t){return new URLSearchParams(t).toString()}function AQ(t){if(!t||typeof t!="string")return{body:t};const e=t.length>Hx,n=PQ(t);if(e){const r=t.slice(0,Hx);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function PQ(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function ym(t,e){const n=MQ(t);return Ku(n,e)}function MQ(t,e=cn.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(cn.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function LQ(t,e,n){try{const r=await $Q(t,e,n),i=SA("resource.fetch",r);Tg(n.replay,i)}catch(r){rn&&me.error("[Replay] Failed to capture fetch breadcrumb",r)}}function FQ(t,e,n){const{input:r,response:i}=e,s=r?TA(r):void 0,o=Ig(s,n.textEncoder),a=i?wA(i.headers.get("content-length")):void 0;o!==void 0&&(t.data.request_body_size=o),a!==void 0&&(t.data.response_body_size=a)}async function $Q(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=e,{url:o,method:a,status_code:c=0,request_body_size:u,response_body_size:l}=t.data,d=ym(o,n.networkDetailAllowUrls)&&!ym(o,n.networkDetailDenyUrls),f=d?jQ(n,e.input,u):of(u),h=await UQ(d,n,e.response,l);return{startTimestamp:i,endTimestamp:s,url:o,method:a,statusCode:c,request:f,response:h}}function jQ({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const i=n?VQ(n,e):{};if(!t)return Ao(i,r,void 0);const s=TA(n),[o,a]=EA(s),c=Ao(i,r,o);return a?gm(c,a):c}async function UQ(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},i,s){if(!t&&s!==void 0)return of(s);const o=i?IA(i.headers,r):{};if(!i||!e&&s!==void 0)return Ao(o,s,void 0);const[a,c]=await zQ(i),u=BQ(a,{networkCaptureBodies:e,textEncoder:n,responseBodySize:s,captureDetails:t,headers:o});return c?gm(u,c):u}function BQ(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:i,headers:s}){try{const o=t&&t.length&&r===void 0?Ig(t,n):r;return i?e?Ao(s,o,t):Ao(s,o,void 0):of(o)}catch(o){return rn&&me.warn("[Replay] Failed to serialize response body",o),Ao(s,r,void 0)}}async function zQ(t){const e=HQ(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await WQ(e)]}catch(n){return rn&&me.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function TA(t=[]){if(!(t.length!==2||typeof t[1]!="object"))return t[1].body}function IA(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function VQ(t,e){return t.length===1&&typeof t[0]!="string"?aT(t[0],e):t.length===2?aT(t[1],e):{}}function aT(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?IA(n,e):Array.isArray(n)?{}:Rb(n,e):{}}function HQ(t){try{return t.clone()}catch(e){rn&&me.warn("[Replay] Failed to clone response body",e)}}function WQ(t){return new Promise((e,n)=>{const r=setTimeout(()=>n(new Error("Timeout while trying to read response body")),500);qQ(t).then(i=>e(i),i=>n(i)).finally(()=>clearTimeout(r))})}async function qQ(t){return await t.text()}async function GQ(t,e,n){try{const r=YQ(t,e,n),i=SA("resource.xhr",r);Tg(n.replay,i)}catch(r){rn&&me.error("[Replay] Failed to capture xhr breadcrumb",r)}}function ZQ(t,e,n){const{xhr:r,input:i}=e;if(!r)return;const s=Ig(i,n.textEncoder),o=r.getResponseHeader("content-length")?wA(r.getResponseHeader("content-length")):QQ(r.response,r.responseType,n.textEncoder);s!==void 0&&(t.data.request_body_size=s),o!==void 0&&(t.data.response_body_size=o)}function YQ(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:a}=e,{url:c,method:u,status_code:l=0,request_body_size:d,response_body_size:f}=t.data;if(!c)return null;if(!a||!ym(c,n.networkDetailAllowUrls)||ym(c,n.networkDetailDenyUrls)){const x=of(d),_=of(f);return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:x,response:_}}const h=a[Ms],m=h?Rb(h.request_headers,n.networkRequestHeaders):{},p=Rb(KQ(a),n.networkResponseHeaders),[g,y]=n.networkCaptureBodies?EA(o):[void 0],[v,b]=n.networkCaptureBodies?JQ(a):[void 0],E=Ao(m,d,g),w=Ao(p,f,v);return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:y?gm(E,y):E,response:b?gm(w,b):w}}function KQ(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
|
|
416
|
-
`).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i.toLowerCase()]=s,n},{}):{}}function JQ(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return XQ(t.response,t.responseType)}catch(n){e.push(n)}return rn&&me.warn("[Replay] Failed to get xhr response body",...e),[void 0]}function XQ(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch{return rn&&me.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return rn&&me.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function QQ(t,e,n){try{const r=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return Ig(r,n)}catch{return}}function eee(t){const e=Lt();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a}=t.getOptions(),c={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a};e&&e.on?e.on("beforeAddBreadcrumb",(u,l)=>tee(c,u,l)):(dg(DQ(t)),hg(NQ(t)))}catch{}}function tee(t,e,n){if(e.data)try{nee(e)&&iee(n)&&(ZQ(e,n,t),GQ(e,n,t)),ree(e)&&see(n)&&(FQ(e,n,t),LQ(e,n,t))}catch{rn&&me.warn("Error when enriching network breadcrumb")}}function nee(t){return t.category==="xhr"}function ree(t){return t.category==="fetch"}function iee(t){return t&&t.xhr}function see(t){return t&&t.response}let cT=null;function oee(t){return!!t.category}const aee=t=>e=>{if(!t.isEnabled())return;const n=cee(e);n&&Ff(t,n)};function cee(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();return cT===e||!e||(cT=e,!oee(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))?null:e.category==="console"?uee(e):Qi(e)}function uee(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||e.length===0)return Qi(t);let n=!1;const r=e.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Ih?(n=!0,`${i.slice(0,Ih)}…`):i;if(typeof i=="object")try{const s=vi(i,7);return JSON.stringify(s).length>Ih?(n=!0,`${JSON.stringify(s,null,2).slice(0,Ih)}…`):s}catch{}return i});return Qi({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function lee(t){const e=Gr(),n=Lt();e.addScopeListener(aee(t)),xR(BX(t)),fg(OQ(t)),eee(t);const r=TQ(t,!uT(n));n&&n.addEventProcessor?n.addEventProcessor(r):yZ(r),uT(n)&&(n.on("beforeSendEvent",_Q(t)),n.on("afterSendEvent",_A(t)),n.on("createDsc",i=>{const s=t.getSessionId();s&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(i.replay_id=s)}),n.on("startTransaction",i=>{t.lastTransaction=i}),n.on("finishTransaction",i=>{t.lastTransaction=i}),n.on("beforeSendFeedback",(i,s)=>{const o=t.getSessionId();s&&s.includeReplay&&t.isEnabled()&&o&&i.contexts&&i.contexts.feedback&&(i.contexts.feedback.replay_id=o)}))}function uT(t){return!!(t&&t.on)}async function dee(t){try{return Promise.all(xg(t,[fee(cn.performance.memory)]))}catch{return[]}}function fee(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function hee(t,e,n){let r,i,s;const o=n.maxWait?Math.max(n.maxWait,e):0;function a(){return c(),r=t(),r}function c(){i!==void 0&&clearTimeout(i),s!==void 0&&clearTimeout(s),i=s=void 0}function u(){return i!==void 0||s!==void 0?a():r}function l(){return i&&clearTimeout(i),i=setTimeout(a,e),o&&s===void 0&&(s=setTimeout(a,o)),r}return l.cancel=c,l.flush=u,l}function pee(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){rn&&me.warn("[Replay] Received replay event after session expired.");return}const i=r||!e;e=!0,t.clickDetector&&LX(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&i&&t.setInitialState(),!g0(t,n,i))return!0;if(!i)return!1;if(gee(t,i),t.session&&t.session.previousSessionId)return!0;if(t.recordingMode==="buffer"&&t.session&&t.eventBuffer){const s=t.eventBuffer.getEarliestTimestamp();s&&(lr(`[Replay] Updating session start time to earliest event in buffer to ${new Date(s)}`,t.getOptions()._experiments.traceInternals),t.session.started=s,t.getOptions().stickySession&&m0(t.session))}return t.recordingMode==="session"&&t.flush(),!0})}}function mee(t){const e=t.getOptions();return{type:xt.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function gee(t,e){!e||!t.session||t.session.segmentId!==0||g0(t,mee(t),!1)}function yee(t,e,n,r){return Jo(PR(t,qw(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function vee({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}
|
|
417
|
-
`;if(typeof t=="string")n=`${r}${t}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+t.length),n.set(s),n.set(t,s.length)}return n}async function bee({client:t,scope:e,replayId:n,event:r}){const i=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,s={event_id:n,integrations:i};t.emit&&t.emit("preprocessEvent",r,s);const o=await UR(t.getOptions(),r,s,e,t,Xo());if(!o)return null;o.platform=o.platform||"javascript";const a=t.getSdkMetadata&&t.getSdkMetadata(),{name:c,version:u}=a&&a.sdk||{};return o.sdk={...o.sdk,name:c||"sentry.javascript.unknown",version:u||"0.0.0"},o}async function _ee({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:i,session:s}){const o=vee({recordingData:t,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:l}=r,d=Lt(),f=Gr(),h=d&&d.getTransport(),m=d&&d.getDsn();if(!d||!h||!m||!s.sampled)return;const p={type:iJ,replay_start_timestamp:l/1e3,timestamp:i/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:e,segment_id:n,replay_type:s.sampled},g=await bee({scope:f,client:d,replayId:e,event:p});if(!g){d.recordDroppedEvent("event_processor","replay",p),lr("An event processor returned `null`, will not send event.");return}delete g.sdkProcessingMetadata;const y=yee(g,o,m,d.getOptions().tunnel);let v;try{v=await h.send(y)}catch(E){const w=new Error(s0);try{w.cause=E}catch{}throw w}if(!v)return v;if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new OA(v.statusCode);const b=LR({},v);if(MR(b,"replay"))throw new CA(b);return v}class OA extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class CA extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function kA(t,e={count:0,interval:lJ}){const{recordingData:n,options:r}=t;if(n.length)try{return await _ee(t),!0}catch(i){if(i instanceof OA||i instanceof CA)throw i;if(OG("Replays",{_retryCount:e.count}),rn&&r._experiments&&r._experiments.captureExceptions&&Df(i),e.count>=dJ){const s=new Error(`${s0} - max retries exceeded`);try{s.cause=i}catch{}throw s}return e.interval*=++e.count,new Promise((s,o)=>{setTimeout(async()=>{try{await kA(t,e),s(!0)}catch(a){o(a)}},e.interval)})}}const DA="__THROTTLED",wee="__SKIPPED";function Eee(t,e,n){const r=new Map,i=a=>{const c=a-n;r.forEach((u,l)=>{l<c&&r.delete(l)})},s=()=>[...r.values()].reduce((a,c)=>a+c,0);let o=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(i(c),s()>=e){const l=o;return o=!0,l?wee:DA}o=!1;const u=r.get(c)||0;return r.set(c,u+1),t(...a)}}class vo{constructor({options:e,recordingOptions:n}){vo.prototype.__init.call(this),vo.prototype.__init2.call(this),vo.prototype.__init3.call(this),vo.prototype.__init4.call(this),vo.prototype.__init5.call(this),vo.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:sJ,sessionIdleExpire:oJ},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=hee(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Eee((o,a)=>pQ(this,o,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:i}=this.getOptions(),s=r?{threshold:Math.min(fJ,r),timeout:r,scrollTimeout:hJ,ignoreSelector:i?i.join(","):""}:void 0;s&&(this.clickDetector=new NX(this,s))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options;if(!(n<=0&&r<=0)){if(this._initializeSessionForSampling(e),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",iu(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");iu("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const e=Vy({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");iu("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=Vy({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=No({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:uJ},emit:pee(this),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{lr(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,uQ(this)}catch(r){this._handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),lr("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),lr("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();lr("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const n=e();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&kb(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${cn.location.pathname}${cn.location.hash}${cn.location.search}`,n=`${cn.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===DA){const i=Qi({category:"replay.throttled"});this.addUpdate(()=>!g0(this,{type:IX,timestamp:i.timestamp||0,data:{tag:"breadcrumb",payload:i,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastTransaction||Gr().getTransaction(),r=(e&&Dn(e).data||{})[as];if(!(!e||!r||!["route","custom"].includes(r)))return Dn(e).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=oQ({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){rn&&me.error("[Replay]",e),rn&&this._options._experiments&&this._options._experiments.captureExceptions&&Df(e)}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=Vy({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return yA(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{cn.document.addEventListener("visibilitychange",this._handleVisibilityChange),cn.addEventListener("blur",this._handleWindowBlur),cn.addEventListener("focus",this._handleWindowFocus),cn.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(lee(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}this._performanceCleanupCallback=eQ(this)}_removeListeners(){try{cn.document.removeEventListener("visibilitychange",this._handleVisibilityChange),cn.removeEventListener("blur",this._handleWindowBlur),cn.removeEventListener("focus",this._handleWindowFocus),cn.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{cn.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=Qi({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=Qi({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{WX(this,e)}}_doChangeToBackgroundTasks(e){!this.session||gA(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){lr("[Replay] Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:xt.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){const e=ZX(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(xg(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){rn&&me.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await dee(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await kA({replayId:e,recordingData:s,segmentId:i,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=Lt();r&&r.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){rn&&me.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,i=Date.now()-n;this._debouncedFlush.cancel();const s=i<this._options.minReplayDuration,o=i>this._options.maxReplayDuration+5e3;if(s||o){lr(`[Replay] Session duration (${Math.floor(i/1e3)}s) is too ${s?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),s&&this._debouncedFlush();return}const a=this.eventBuffer;if(a&&this.session.segmentId===0&&!a.hasCheckout&&lr("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(c){rn&&me.error(c)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&m0(this.session)}__init6(){this._onMutationHandler=e=>{const n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=r&&n>r;if(n>i||s){const o=Qi({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(o)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function yl(t,e,n,r){const i=typeof r=="string"?r.split(","):[],s=[...t,...i,...e];return typeof n<"u"&&(typeof n=="string"&&s.push(`.${n}`),Ya(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),s.join(",")}function See({mask:t,unmask:e,block:n,unblock:r,ignore:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,ignoreClass:u}){const l=['base[href="/"]'],d=yl(t,[".sentry-mask","[data-sentry-mask]"],a,c),f=yl(e,[".sentry-unmask","[data-sentry-unmask]"]),h={maskTextSelector:d,unmaskTextSelector:f,blockSelector:yl(n,[".sentry-block","[data-sentry-block]",...l],s,o),unblockSelector:yl(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:yl(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],u)};return s instanceof RegExp&&(h.blockClass=s),a instanceof RegExp&&(h.maskTextClass=a),h}function xee({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:i,value:s}){return!r||i.unmaskTextSelector&&t.matches(i.unmaskTextSelector)?s:n.includes(e)||e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s}const lT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Tee=["content-length","content-type","accept"];let dT=!1;const Iee=t=>new Og(t);class Og{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=aJ,flushMaxDelay:n=cJ,minReplayDuration:r=pJ,maxReplayDuration:i=Wx,stickySession:s=!0,useCompression:o=!0,workerUrl:a,_experiments:c={},sessionSampleRate:u,errorSampleRate:l,maskAllText:d=!0,maskAllInputs:f=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:m=750,mutationLimit:p=1e4,slowClickTimeout:g=7e3,slowClickIgnoreSelectors:y=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:b=[],networkCaptureBodies:E=!0,networkRequestHeaders:w=[],networkResponseHeaders:x=[],mask:_=[],maskAttributes:k=["title","placeholder"],unmask:R=[],block:F=[],unblock:V=[],ignore:T=[],maskFn:L,beforeAddRecordingEvent:S,beforeErrorSampling:C,blockClass:N,blockSelector:U,maskInputOptions:K,maskTextClass:$,maskTextSelector:q,ignoreClass:j}={}){this.name=Og.id;const D=See({mask:_,unmask:R,block:F,unblock:V,ignore:T,blockClass:N,blockSelector:U,maskTextClass:$,maskTextSelector:q,ignoreClass:j});if(this._recordingOptions={maskAllInputs:f,maskAllText:d,maskInputOptions:{...K||{},password:!0},maskTextFn:L,maskInputFn:L,maskAttributeFn:(X,Z,z)=>xee({maskAttributes:k,maskAllText:d,privacyOptions:D,key:X,value:Z,el:z}),...D,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:X=>{try{X.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,mJ),maxReplayDuration:Math.min(i,Wx),stickySession:s,sessionSampleRate:u,errorSampleRate:l,useCompression:o,workerUrl:a,blockAllMedia:h,maskAllInputs:f,maskAllText:d,mutationBreadcrumbLimit:m,mutationLimit:p,slowClickTimeout:g,slowClickIgnoreSelectors:y,networkDetailAllowUrls:v,networkDetailDenyUrls:b,networkCaptureBodies:E,networkRequestHeaders:fT(w),networkResponseHeaders:fT(x),beforeAddRecordingEvent:S,beforeErrorSampling:C,_experiments:c},typeof u=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
|
|
418
|
-
This option is deprecated and will be removed soon.
|
|
419
|
-
Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
|
|
420
|
-
Sentry.init({ replaysSessionSampleRate: ${u} })`),this._initialOptions.sessionSampleRate=u),typeof l=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
|
|
421
|
-
This option is deprecated and will be removed soon.
|
|
422
|
-
Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
|
|
423
|
-
Sentry.init({ replaysOnErrorSampleRate: ${l} })`),this._initialOptions.errorSampleRate=l),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${lT}`:lT),this._isInitialized&&dx())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return dT}set _isInitialized(e){dT=e}setupOnce(){dx()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(e){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(e)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const e=Oee(this._initialOptions);this._replay=new vo({options:e,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const n=Lt().getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}Og.__initStatic();function Oee(t){const e=Lt(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...gr(t)};return n?(t.sessionSampleRate==null&&t.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&Ya(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate=="number"&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate=="number"&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):(Ya(()=>{console.warn("SDK client is not available.")}),r)}function fT(t){return[...Tee,...t.map(e=>e.toLowerCase())]}const RA="CaptureConsole",Cee=(t={})=>{const e=t.levels||tm;return{name:RA,setupOnce(){},setup(n){"console"in Mt&&wR(({args:r,level:i})=>{Lt()!==n||!e.includes(i)||kee(r,i)})}}},NA=Cee;Li(RA,NA);function kee(t,e){const n={level:DR(e),extra:{arguments:t}};BR(r=>{if(r.addEventProcessor(o=>(o.logger="console",Ka(o,{handled:!1,type:"console"}),o)),e==="assert"&&t[0]===!1){const o=`Assertion failed: ${em(t.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",t.slice(1)),yx(o,n);return}const i=t.find(o=>o instanceof Error);if(e==="error"&&i){Df(i,n);return}const s=em(t," ");yx(s,n)})}const af=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,AA="ExtraErrorData",Dee=(t={})=>{const e=t.depth||3,n=t.captureErrorCause||!1;return{name:AA,setupOnce(){},processEvent(r,i){return Ree(r,i,e,n)}}},PA=Dee;Li(AA,PA);function Ree(t,e={},n,r){if(!e.originalException||!tu(e.originalException))return t;const i=e.originalException.name||e.originalException.constructor.name,s=Nee(e.originalException,r);if(s){const o={...t.contexts},a=vi(s,n);return Za(a)&&(Go(a,"__sentry_skip_normalization__",!0),o[i]=a),{...t,contexts:o}}return t}function Nee(t,e){try{const n=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],r={};for(const i of Object.keys(t)){if(n.indexOf(i)!==-1)continue;const s=t[i];r[i]=tu(s)?s.toString():s}if(e&&t.cause!==void 0&&(r.cause=tu(t.cause)?t.cause.toString():t.cause),typeof t.toJSON=="function"){const i=t.toJSON();for(const s of Object.keys(i)){const o=i[s];r[s]=tu(o)?o.toString():o}}return r}catch(n){af&&me.error("Unable to extract extra data from the Error object:",n)}return null}var MA={exports:{}};/*!
|
|
424
|
-
localForage -- Offline Storage, Improved
|
|
425
|
-
Version 1.10.0
|
|
426
|
-
https://localforage.github.io/localForage
|
|
427
|
-
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
428
|
-
*/(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(u,l){if(!i[u]){if(!r[u]){var d=typeof Oo=="function"&&Oo;if(!l&&d)return d(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var h=i[u]={exports:{}};r[u][0].call(h.exports,function(m){var p=r[u][1][m];return o(p||m)},h,h.exports,n,r,i,s)}return i[u].exports}for(var a=typeof Oo=="function"&&Oo,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(n,r,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var c=0,u=new o(m),l=s.document.createTextNode("");u.observe(l,{characterData:!0}),a=function(){l.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=m,a=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var g=s.document.createElement("script");g.onreadystatechange=function(){m(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},s.document.documentElement.appendChild(g)}:a=function(){setTimeout(m,0)};var f,h=[];function m(){f=!0;for(var g,y,v=h.length;v;){for(y=h,h=[],g=-1;++g<v;)y[g]();v=h.length}f=!1}r.exports=p;function p(g){h.push(g)===1&&!f&&a()}}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,r,i){var s=n(1);function o(){}var a={},c=["REJECTED"],u=["FULFILLED"],l=["PENDING"];r.exports=d;function d(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,w!==o&&p(this,w)}d.prototype.catch=function(w){return this.then(null,w)},d.prototype.then=function(w,x){if(typeof w!="function"&&this.state===u||typeof x!="function"&&this.state===c)return this;var _=new this.constructor(o);if(this.state!==l){var k=this.state===u?w:x;h(_,k,this.outcome)}else this.queue.push(new f(_,w,x));return _};function f(w,x,_){this.promise=w,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(w){a.resolve(this.promise,w)},f.prototype.otherCallFulfilled=function(w){h(this.promise,this.onFulfilled,w)},f.prototype.callRejected=function(w){a.reject(this.promise,w)},f.prototype.otherCallRejected=function(w){h(this.promise,this.onRejected,w)};function h(w,x,_){s(function(){var k;try{k=x(_)}catch(R){return a.reject(w,R)}k===w?a.reject(w,new TypeError("Cannot resolve promise with itself")):a.resolve(w,k)})}a.resolve=function(w,x){var _=g(m,x);if(_.status==="error")return a.reject(w,_.value);var k=_.value;if(k)p(w,k);else{w.state=u,w.outcome=x;for(var R=-1,F=w.queue.length;++R<F;)w.queue[R].callFulfilled(x)}return w},a.reject=function(w,x){w.state=c,w.outcome=x;for(var _=-1,k=w.queue.length;++_<k;)w.queue[_].callRejected(x);return w};function m(w){var x=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof x=="function")return function(){x.apply(w,arguments)}}function p(w,x){var _=!1;function k(T){_||(_=!0,a.reject(w,T))}function R(T){_||(_=!0,a.resolve(w,T))}function F(){x(R,k)}var V=g(F);V.status==="error"&&k(V.value)}function g(w,x){var _={};try{_.value=w(x),_.status="success"}catch(k){_.status="error",_.value=k}return _}d.resolve=y;function y(w){return w instanceof this?w:a.resolve(new this(o),w)}d.reject=v;function v(w){var x=new this(o);return a.reject(x,w)}d.all=b;function b(w){var x=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=w.length,k=!1;if(!_)return this.resolve([]);for(var R=new Array(_),F=0,V=-1,T=new this(o);++V<_;)L(w[V],V);return T;function L(S,C){x.resolve(S).then(N,function(U){k||(k=!0,a.reject(T,U))});function N(U){R[C]=U,++F===_&&!k&&(k=!0,a.resolve(T,R))}}}d.race=E;function E(w){var x=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=w.length,k=!1;if(!_)return this.resolve([]);for(var R=-1,F=new this(o);++R<_;)V(w[R]);return F;function V(T){x.resolve(T).then(function(L){k||(k=!0,a.resolve(F,L))},function(L){k||(k=!0,a.reject(F,L))})}}},{1:1}],3:[function(n,r,i){(function(s){typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof rr<"u"?rr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,r,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M};function o(M,J){if(!(M instanceof J))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=a();function u(){try{if(!c||!c.open)return!1;var M=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),J=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!M||J)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(M,J){M=M||[],J=J||{};try{return new Blob(M,J)}catch(re){if(re.name!=="TypeError")throw re;for(var B=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,ie=new B,oe=0;oe<M.length;oe+=1)ie.append(M[oe]);return ie.getBlob(J.type)}}typeof Promise>"u"&&n(3);var d=Promise;function f(M,J){J&&M.then(function(B){J(null,B)},function(B){J(B)})}function h(M,J,B){typeof J=="function"&&M.then(J),typeof B=="function"&&M.catch(B)}function m(M){return typeof M!="string"&&(console.warn(M+" used as a key, but it is not a string."),M=String(M)),M}function p(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var g="local-forage-detect-blob-support",y=void 0,v={},b=Object.prototype.toString,E="readonly",w="readwrite";function x(M){for(var J=M.length,B=new ArrayBuffer(J),ie=new Uint8Array(B),oe=0;oe<J;oe++)ie[oe]=M.charCodeAt(oe);return B}function _(M){return new d(function(J){var B=M.transaction(g,w),ie=l([""]);B.objectStore(g).put(ie,"key"),B.onabort=function(oe){oe.preventDefault(),oe.stopPropagation(),J(!1)},B.oncomplete=function(){var oe=navigator.userAgent.match(/Chrome\/(\d+)/),re=navigator.userAgent.match(/Edge\//);J(re||!oe||parseInt(oe[1],10)>=43)}}).catch(function(){return!1})}function k(M){return typeof y=="boolean"?d.resolve(y):_(M).then(function(J){return y=J,y})}function R(M){var J=v[M.name],B={};B.promise=new d(function(ie,oe){B.resolve=ie,B.reject=oe}),J.deferredOperations.push(B),J.dbReady?J.dbReady=J.dbReady.then(function(){return B.promise}):J.dbReady=B.promise}function F(M){var J=v[M.name],B=J.deferredOperations.pop();if(B)return B.resolve(),B.promise}function V(M,J){var B=v[M.name],ie=B.deferredOperations.pop();if(ie)return ie.reject(J),ie.promise}function T(M,J){return new d(function(B,ie){if(v[M.name]=v[M.name]||D(),M.db)if(J)R(M),M.db.close();else return B(M.db);var oe=[M.name];J&&oe.push(M.version);var re=c.open.apply(c,oe);J&&(re.onupgradeneeded=function(ye){var we=re.result;try{we.createObjectStore(M.storeName),ye.oldVersion<=1&&we.createObjectStore(g)}catch(Oe){if(Oe.name==="ConstraintError")console.warn('The database "'+M.name+'" has been upgraded from version '+ye.oldVersion+" to version "+ye.newVersion+', but the storage "'+M.storeName+'" already exists.');else throw Oe}}),re.onerror=function(ye){ye.preventDefault(),ie(re.error)},re.onsuccess=function(){var ye=re.result;ye.onversionchange=function(we){we.target.close()},B(ye),F(M)}})}function L(M){return T(M,!1)}function S(M){return T(M,!0)}function C(M,J){if(!M.db)return!0;var B=!M.db.objectStoreNames.contains(M.storeName),ie=M.version<M.db.version,oe=M.version>M.db.version;if(ie&&(M.version!==J&&console.warn('The database "'+M.name+`" can't be downgraded from version `+M.db.version+" to version "+M.version+"."),M.version=M.db.version),oe||B){if(B){var re=M.db.version+1;re>M.version&&(M.version=re)}return!0}return!1}function N(M){return new d(function(J,B){var ie=new FileReader;ie.onerror=B,ie.onloadend=function(oe){var re=btoa(oe.target.result||"");J({__local_forage_encoded_blob:!0,data:re,type:M.type})},ie.readAsBinaryString(M)})}function U(M){var J=x(atob(M.data));return l([J],{type:M.type})}function K(M){return M&&M.__local_forage_encoded_blob}function $(M){var J=this,B=J._initReady().then(function(){var ie=v[J._dbInfo.name];if(ie&&ie.dbReady)return ie.dbReady});return h(B,M,M),B}function q(M){R(M);for(var J=v[M.name],B=J.forages,ie=0;ie<B.length;ie++){var oe=B[ie];oe._dbInfo.db&&(oe._dbInfo.db.close(),oe._dbInfo.db=null)}return M.db=null,L(M).then(function(re){return M.db=re,C(M)?S(M):re}).then(function(re){M.db=J.db=re;for(var ye=0;ye<B.length;ye++)B[ye]._dbInfo.db=re}).catch(function(re){throw V(M,re),re})}function j(M,J,B,ie){ie===void 0&&(ie=1);try{var oe=M.db.transaction(M.storeName,J);B(null,oe)}catch(re){if(ie>0&&(!M.db||re.name==="InvalidStateError"||re.name==="NotFoundError"))return d.resolve().then(function(){if(!M.db||re.name==="NotFoundError"&&!M.db.objectStoreNames.contains(M.storeName)&&M.version<=M.db.version)return M.db&&(M.version=M.db.version+1),S(M)}).then(function(){return q(M).then(function(){j(M,J,B,ie-1)})}).catch(B);B(re)}}function D(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function X(M){var J=this,B={db:null};if(M)for(var ie in M)B[ie]=M[ie];var oe=v[B.name];oe||(oe=D(),v[B.name]=oe),oe.forages.push(J),J._initReady||(J._initReady=J.ready,J.ready=$);var re=[];function ye(){return d.resolve()}for(var we=0;we<oe.forages.length;we++){var Oe=oe.forages[we];Oe!==J&&re.push(Oe._initReady().catch(ye))}var Ce=oe.forages.slice(0);return d.all(re).then(function(){return B.db=oe.db,L(B)}).then(function(ke){return B.db=ke,C(B,J._defaultConfig.version)?S(B):ke}).then(function(ke){B.db=oe.db=ke,J._dbInfo=B;for(var qe=0;qe<Ce.length;qe++){var Ct=Ce[qe];Ct!==J&&(Ct._dbInfo.db=B.db,Ct._dbInfo.version=B.version)}})}function Z(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){j(B._dbInfo,E,function(ye,we){if(ye)return re(ye);try{var Oe=we.objectStore(B._dbInfo.storeName),Ce=Oe.get(M);Ce.onsuccess=function(){var ke=Ce.result;ke===void 0&&(ke=null),K(ke)&&(ke=U(ke)),oe(ke)},Ce.onerror=function(){re(Ce.error)}}catch(ke){re(ke)}})}).catch(re)});return f(ie,J),ie}function z(M,J){var B=this,ie=new d(function(oe,re){B.ready().then(function(){j(B._dbInfo,E,function(ye,we){if(ye)return re(ye);try{var Oe=we.objectStore(B._dbInfo.storeName),Ce=Oe.openCursor(),ke=1;Ce.onsuccess=function(){var qe=Ce.result;if(qe){var Ct=qe.value;K(Ct)&&(Ct=U(Ct));var Zt=M(Ct,qe.key,ke++);Zt!==void 0?oe(Zt):qe.continue()}else oe()},Ce.onerror=function(){re(Ce.error)}}catch(qe){re(qe)}})}).catch(re)});return f(ie,J),ie}function le(M,J,B){var ie=this;M=m(M);var oe=new d(function(re,ye){var we;ie.ready().then(function(){return we=ie._dbInfo,b.call(J)==="[object Blob]"?k(we.db).then(function(Oe){return Oe?J:N(J)}):J}).then(function(Oe){j(ie._dbInfo,w,function(Ce,ke){if(Ce)return ye(Ce);try{var qe=ke.objectStore(ie._dbInfo.storeName);Oe===null&&(Oe=void 0);var Ct=qe.put(Oe,M);ke.oncomplete=function(){Oe===void 0&&(Oe=null),re(Oe)},ke.onabort=ke.onerror=function(){var Zt=Ct.error?Ct.error:Ct.transaction.error;ye(Zt)}}catch(Zt){ye(Zt)}})}).catch(ye)});return f(oe,B),oe}function pe(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){j(B._dbInfo,w,function(ye,we){if(ye)return re(ye);try{var Oe=we.objectStore(B._dbInfo.storeName),Ce=Oe.delete(M);we.oncomplete=function(){oe()},we.onerror=function(){re(Ce.error)},we.onabort=function(){var ke=Ce.error?Ce.error:Ce.transaction.error;re(ke)}}catch(ke){re(ke)}})}).catch(re)});return f(ie,J),ie}function ve(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){j(J._dbInfo,w,function(re,ye){if(re)return oe(re);try{var we=ye.objectStore(J._dbInfo.storeName),Oe=we.clear();ye.oncomplete=function(){ie()},ye.onabort=ye.onerror=function(){var Ce=Oe.error?Oe.error:Oe.transaction.error;oe(Ce)}}catch(Ce){oe(Ce)}})}).catch(oe)});return f(B,M),B}function je(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){j(J._dbInfo,E,function(re,ye){if(re)return oe(re);try{var we=ye.objectStore(J._dbInfo.storeName),Oe=we.count();Oe.onsuccess=function(){ie(Oe.result)},Oe.onerror=function(){oe(Oe.error)}}catch(Ce){oe(Ce)}})}).catch(oe)});return f(B,M),B}function ct(M,J){var B=this,ie=new d(function(oe,re){if(M<0){oe(null);return}B.ready().then(function(){j(B._dbInfo,E,function(ye,we){if(ye)return re(ye);try{var Oe=we.objectStore(B._dbInfo.storeName),Ce=!1,ke=Oe.openKeyCursor();ke.onsuccess=function(){var qe=ke.result;if(!qe){oe(null);return}M===0||Ce?oe(qe.key):(Ce=!0,qe.advance(M))},ke.onerror=function(){re(ke.error)}}catch(qe){re(qe)}})}).catch(re)});return f(ie,J),ie}function ut(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){j(J._dbInfo,E,function(re,ye){if(re)return oe(re);try{var we=ye.objectStore(J._dbInfo.storeName),Oe=we.openKeyCursor(),Ce=[];Oe.onsuccess=function(){var ke=Oe.result;if(!ke){ie(Ce);return}Ce.push(ke.key),ke.continue()},Oe.onerror=function(){oe(Oe.error)}}catch(ke){oe(ke)}})}).catch(oe)});return f(B,M),B}function Ye(M,J){J=p.apply(this,arguments);var B=this.config();M=typeof M!="function"&&M||{},M.name||(M.name=M.name||B.name,M.storeName=M.storeName||B.storeName);var ie=this,oe;if(!M.name)oe=d.reject("Invalid arguments");else{var re=M.name===B.name&&ie._dbInfo.db,ye=re?d.resolve(ie._dbInfo.db):L(M).then(function(we){var Oe=v[M.name],Ce=Oe.forages;Oe.db=we;for(var ke=0;ke<Ce.length;ke++)Ce[ke]._dbInfo.db=we;return we});M.storeName?oe=ye.then(function(we){if(we.objectStoreNames.contains(M.storeName)){var Oe=we.version+1;R(M);var Ce=v[M.name],ke=Ce.forages;we.close();for(var qe=0;qe<ke.length;qe++){var Ct=ke[qe];Ct._dbInfo.db=null,Ct._dbInfo.version=Oe}var Zt=new d(function(Yt,Rn){var Tn=c.open(M.name,Oe);Tn.onerror=function(Jr){var rl=Tn.result;rl.close(),Rn(Jr)},Tn.onupgradeneeded=function(){var Jr=Tn.result;Jr.deleteObjectStore(M.storeName)},Tn.onsuccess=function(){var Jr=Tn.result;Jr.close(),Yt(Jr)}});return Zt.then(function(Yt){Ce.db=Yt;for(var Rn=0;Rn<ke.length;Rn++){var Tn=ke[Rn];Tn._dbInfo.db=Yt,F(Tn._dbInfo)}}).catch(function(Yt){throw(V(M,Yt)||d.resolve()).catch(function(){}),Yt})}}):oe=ye.then(function(we){R(M);var Oe=v[M.name],Ce=Oe.forages;we.close();for(var ke=0;ke<Ce.length;ke++){var qe=Ce[ke];qe._dbInfo.db=null}var Ct=new d(function(Zt,Yt){var Rn=c.deleteDatabase(M.name);Rn.onerror=function(){var Tn=Rn.result;Tn&&Tn.close(),Yt(Rn.error)},Rn.onblocked=function(){console.warn('dropInstance blocked for database "'+M.name+'" until all open connections are closed')},Rn.onsuccess=function(){var Tn=Rn.result;Tn&&Tn.close(),Zt(Tn)}});return Ct.then(function(Zt){Oe.db=Zt;for(var Yt=0;Yt<Ce.length;Yt++){var Rn=Ce[Yt];F(Rn._dbInfo)}}).catch(function(Zt){throw(V(M,Zt)||d.resolve()).catch(function(){}),Zt})})}return f(oe,J),oe}var Ot={_driver:"asyncStorage",_initStorage:X,_support:u(),iterate:z,getItem:Z,setItem:le,removeItem:pe,clear:ve,length:je,key:ct,keys:ut,dropInstance:Ye};function O(){return typeof openDatabase=="function"}var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ae="~~local_forage_type~",W=/^~~local_forage_type~([^~]+)~/,I="__lfsc__:",A=I.length,G="arbf",Q="blob",H="si08",ee="ui08",de="uic8",fe="si16",De="si32",rt="ur16",Xe="ui32",tn="fl32",sr="fl64",vn=A+G.length,Zr=Object.prototype.toString;function Rt(M){var J=M.length*.75,B=M.length,ie,oe=0,re,ye,we,Oe;M[M.length-1]==="="&&(J--,M[M.length-2]==="="&&J--);var Ce=new ArrayBuffer(J),ke=new Uint8Array(Ce);for(ie=0;ie<B;ie+=4)re=he.indexOf(M[ie]),ye=he.indexOf(M[ie+1]),we=he.indexOf(M[ie+2]),Oe=he.indexOf(M[ie+3]),ke[oe++]=re<<2|ye>>4,ke[oe++]=(ye&15)<<4|we>>2,ke[oe++]=(we&3)<<6|Oe&63;return Ce}function Nr(M){var J=new Uint8Array(M),B="",ie;for(ie=0;ie<J.length;ie+=3)B+=he[J[ie]>>2],B+=he[(J[ie]&3)<<4|J[ie+1]>>4],B+=he[(J[ie+1]&15)<<2|J[ie+2]>>6],B+=he[J[ie+2]&63];return J.length%3===2?B=B.substring(0,B.length-1)+"=":J.length%3===1&&(B=B.substring(0,B.length-2)+"=="),B}function ai(M,J){var B="";if(M&&(B=Zr.call(M)),M&&(B==="[object ArrayBuffer]"||M.buffer&&Zr.call(M.buffer)==="[object ArrayBuffer]")){var ie,oe=I;M instanceof ArrayBuffer?(ie=M,oe+=G):(ie=M.buffer,B==="[object Int8Array]"?oe+=H:B==="[object Uint8Array]"?oe+=ee:B==="[object Uint8ClampedArray]"?oe+=de:B==="[object Int16Array]"?oe+=fe:B==="[object Uint16Array]"?oe+=rt:B==="[object Int32Array]"?oe+=De:B==="[object Uint32Array]"?oe+=Xe:B==="[object Float32Array]"?oe+=tn:B==="[object Float64Array]"?oe+=sr:J(new Error("Failed to get type for BinaryArray"))),J(oe+Nr(ie))}else if(B==="[object Blob]"){var re=new FileReader;re.onload=function(){var ye=ae+M.type+"~"+Nr(this.result);J(I+Q+ye)},re.readAsArrayBuffer(M)}else try{J(JSON.stringify(M))}catch(ye){console.error("Couldn't convert value into a JSON string: ",M),J(null,ye)}}function _r(M){if(M.substring(0,A)!==I)return JSON.parse(M);var J=M.substring(vn),B=M.substring(A,vn),ie;if(B===Q&&W.test(J)){var oe=J.match(W);ie=oe[1],J=J.substring(oe[0].length)}var re=Rt(J);switch(B){case G:return re;case Q:return l([re],{type:ie});case H:return new Int8Array(re);case ee:return new Uint8Array(re);case de:return new Uint8ClampedArray(re);case fe:return new Int16Array(re);case rt:return new Uint16Array(re);case De:return new Int32Array(re);case Xe:return new Uint32Array(re);case tn:return new Float32Array(re);case sr:return new Float64Array(re);default:throw new Error("Unkown type: "+B)}}var eo={serialize:ai,deserialize:_r,stringToBuffer:Rt,bufferToString:Nr};function ea(M,J,B,ie){M.executeSql("CREATE TABLE IF NOT EXISTS "+J.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],B,ie)}function to(M){var J=this,B={db:null};if(M)for(var ie in M)B[ie]=typeof M[ie]!="string"?M[ie].toString():M[ie];var oe=new d(function(re,ye){try{B.db=openDatabase(B.name,String(B.version),B.description,B.size)}catch(we){return ye(we)}B.db.transaction(function(we){ea(we,B,function(){J._dbInfo=B,re()},function(Oe,Ce){ye(Ce)})},ye)});return B.serializer=eo,oe}function Ar(M,J,B,ie,oe,re){M.executeSql(B,ie,oe,function(ye,we){we.code===we.SYNTAX_ERR?ye.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[J.storeName],function(Oe,Ce){Ce.rows.length?re(Oe,we):ea(Oe,J,function(){Oe.executeSql(B,ie,oe,re)},re)},re):re(ye,we)},re)}function no(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(we){Ar(we,ye,"SELECT * FROM "+ye.storeName+" WHERE key = ? LIMIT 1",[M],function(Oe,Ce){var ke=Ce.rows.length?Ce.rows.item(0).value:null;ke&&(ke=ye.serializer.deserialize(ke)),oe(ke)},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function ci(M,J){var B=this,ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(we){Ar(we,ye,"SELECT * FROM "+ye.storeName,[],function(Oe,Ce){for(var ke=Ce.rows,qe=ke.length,Ct=0;Ct<qe;Ct++){var Zt=ke.item(Ct),Yt=Zt.value;if(Yt&&(Yt=ye.serializer.deserialize(Yt)),Yt=M(Yt,Zt.key,Ct+1),Yt!==void 0){oe(Yt);return}}oe()},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function vs(M,J,B,ie){var oe=this;M=m(M);var re=new d(function(ye,we){oe.ready().then(function(){J===void 0&&(J=null);var Oe=J,Ce=oe._dbInfo;Ce.serializer.serialize(J,function(ke,qe){qe?we(qe):Ce.db.transaction(function(Ct){Ar(Ct,Ce,"INSERT OR REPLACE INTO "+Ce.storeName+" (key, value) VALUES (?, ?)",[M,ke],function(){ye(Oe)},function(Zt,Yt){we(Yt)})},function(Ct){if(Ct.code===Ct.QUOTA_ERR){if(ie>0){ye(vs.apply(oe,[M,Oe,B,ie-1]));return}we(Ct)}})})}).catch(we)});return f(re,B),re}function jf(M,J,B){return vs.apply(this,[M,J,B,1])}function Ag(M,J){var B=this;M=m(M);var ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(we){Ar(we,ye,"DELETE FROM "+ye.storeName+" WHERE key = ?",[M],function(){oe()},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function Uf(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){var re=J._dbInfo;re.db.transaction(function(ye){Ar(ye,re,"DELETE FROM "+re.storeName,[],function(){ie()},function(we,Oe){oe(Oe)})})}).catch(oe)});return f(B,M),B}function mc(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){var re=J._dbInfo;re.db.transaction(function(ye){Ar(ye,re,"SELECT COUNT(key) as c FROM "+re.storeName,[],function(we,Oe){var Ce=Oe.rows.item(0).c;ie(Ce)},function(we,Oe){oe(Oe)})})}).catch(oe)});return f(B,M),B}function gc(M,J){var B=this,ie=new d(function(oe,re){B.ready().then(function(){var ye=B._dbInfo;ye.db.transaction(function(we){Ar(we,ye,"SELECT key FROM "+ye.storeName+" WHERE id = ? LIMIT 1",[M+1],function(Oe,Ce){var ke=Ce.rows.length?Ce.rows.item(0).key:null;oe(ke)},function(Oe,Ce){re(Ce)})})}).catch(re)});return f(ie,J),ie}function Pg(M){var J=this,B=new d(function(ie,oe){J.ready().then(function(){var re=J._dbInfo;re.db.transaction(function(ye){Ar(ye,re,"SELECT key FROM "+re.storeName,[],function(we,Oe){for(var Ce=[],ke=0;ke<Oe.rows.length;ke++)Ce.push(Oe.rows.item(ke).key);ie(Ce)},function(we,Oe){oe(Oe)})})}).catch(oe)});return f(B,M),B}function Mg(M){return new d(function(J,B){M.transaction(function(ie){ie.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(oe,re){for(var ye=[],we=0;we<re.rows.length;we++)ye.push(re.rows.item(we).name);J({db:M,storeNames:ye})},function(oe,re){B(re)})},function(ie){B(ie)})})}function te(M,J){J=p.apply(this,arguments);var B=this.config();M=typeof M!="function"&&M||{},M.name||(M.name=M.name||B.name,M.storeName=M.storeName||B.storeName);var ie=this,oe;return M.name?oe=new d(function(re){var ye;M.name===B.name?ye=ie._dbInfo.db:ye=openDatabase(M.name,"","",0),M.storeName?re({db:ye,storeNames:[M.storeName]}):re(Mg(ye))}).then(function(re){return new d(function(ye,we){re.db.transaction(function(Oe){function Ce(Zt){return new d(function(Yt,Rn){Oe.executeSql("DROP TABLE IF EXISTS "+Zt,[],function(){Yt()},function(Tn,Jr){Rn(Jr)})})}for(var ke=[],qe=0,Ct=re.storeNames.length;qe<Ct;qe++)ke.push(Ce(re.storeNames[qe]));d.all(ke).then(function(){ye()}).catch(function(Zt){we(Zt)})},function(Oe){we(Oe)})})}):oe=d.reject("Invalid arguments"),f(oe,J),oe}var se={_driver:"webSQLStorage",_initStorage:to,_support:O(),iterate:ci,getItem:no,setItem:jf,removeItem:Ag,clear:Uf,length:mc,key:gc,keys:Pg,dropInstance:te};function ue(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function _e(M,J){var B=M.name+"/";return M.storeName!==J.storeName&&(B+=M.storeName+"/"),B}function Pe(){var M="_localforage_support_test";try{return localStorage.setItem(M,!0),localStorage.removeItem(M),!1}catch{return!0}}function Ke(){return!Pe()||localStorage.length>0}function ft(M){var J=this,B={};if(M)for(var ie in M)B[ie]=M[ie];return B.keyPrefix=_e(M,J._defaultConfig),Ke()?(J._dbInfo=B,B.serializer=eo,d.resolve()):d.reject()}function Ue(M){var J=this,B=J.ready().then(function(){for(var ie=J._dbInfo.keyPrefix,oe=localStorage.length-1;oe>=0;oe--){var re=localStorage.key(oe);re.indexOf(ie)===0&&localStorage.removeItem(re)}});return f(B,M),B}function Be(M,J){var B=this;M=m(M);var ie=B.ready().then(function(){var oe=B._dbInfo,re=localStorage.getItem(oe.keyPrefix+M);return re&&(re=oe.serializer.deserialize(re)),re});return f(ie,J),ie}function Fe(M,J){var B=this,ie=B.ready().then(function(){for(var oe=B._dbInfo,re=oe.keyPrefix,ye=re.length,we=localStorage.length,Oe=1,Ce=0;Ce<we;Ce++){var ke=localStorage.key(Ce);if(ke.indexOf(re)===0){var qe=localStorage.getItem(ke);if(qe&&(qe=oe.serializer.deserialize(qe)),qe=M(qe,ke.substring(ye),Oe++),qe!==void 0)return qe}}});return f(ie,J),ie}function Je(M,J){var B=this,ie=B.ready().then(function(){var oe=B._dbInfo,re;try{re=localStorage.key(M)}catch{re=null}return re&&(re=re.substring(oe.keyPrefix.length)),re});return f(ie,J),ie}function St(M){var J=this,B=J.ready().then(function(){for(var ie=J._dbInfo,oe=localStorage.length,re=[],ye=0;ye<oe;ye++){var we=localStorage.key(ye);we.indexOf(ie.keyPrefix)===0&&re.push(we.substring(ie.keyPrefix.length))}return re});return f(B,M),B}function Nt(M){var J=this,B=J.keys().then(function(ie){return ie.length});return f(B,M),B}function Mn(M,J){var B=this;M=m(M);var ie=B.ready().then(function(){var oe=B._dbInfo;localStorage.removeItem(oe.keyPrefix+M)});return f(ie,J),ie}function en(M,J,B){var ie=this;M=m(M);var oe=ie.ready().then(function(){J===void 0&&(J=null);var re=J;return new d(function(ye,we){var Oe=ie._dbInfo;Oe.serializer.serialize(J,function(Ce,ke){if(ke)we(ke);else try{localStorage.setItem(Oe.keyPrefix+M,Ce),ye(re)}catch(qe){(qe.name==="QuotaExceededError"||qe.name==="NS_ERROR_DOM_QUOTA_REACHED")&&we(qe),we(qe)}})})});return f(oe,B),oe}function zt(M,J){if(J=p.apply(this,arguments),M=typeof M!="function"&&M||{},!M.name){var B=this.config();M.name=M.name||B.name,M.storeName=M.storeName||B.storeName}var ie=this,oe;return M.name?oe=new d(function(re){M.storeName?re(_e(M,ie._defaultConfig)):re(M.name+"/")}).then(function(re){for(var ye=localStorage.length-1;ye>=0;ye--){var we=localStorage.key(ye);we.indexOf(re)===0&&localStorage.removeItem(we)}}):oe=d.reject("Invalid arguments"),f(oe,J),oe}var dn={_driver:"localStorageWrapper",_initStorage:ft,_support:ue(),iterate:Fe,getItem:Be,setItem:en,removeItem:Mn,clear:Ue,length:Nt,key:Je,keys:St,dropInstance:zt},ro=function(J,B){return J===B||typeof J=="number"&&typeof B=="number"&&isNaN(J)&&isNaN(B)},ta=function(J,B){for(var ie=J.length,oe=0;oe<ie;){if(ro(J[oe],B))return!0;oe++}return!1},Yr=Array.isArray||function(M){return Object.prototype.toString.call(M)==="[object Array]"},er={},yc={},Kr={INDEXEDDB:Ot,WEBSQL:se,LOCALSTORAGE:dn},bs=[Kr.INDEXEDDB._driver,Kr.WEBSQL._driver,Kr.LOCALSTORAGE._driver],_s=["dropInstance"],io=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_s),Ft={description:"",driver:bs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function fn(M,J){M[J]=function(){var B=arguments;return M.ready().then(function(){return M[J].apply(M,B)})}}function $i(){for(var M=1;M<arguments.length;M++){var J=arguments[M];if(J)for(var B in J)J.hasOwnProperty(B)&&(Yr(J[B])?arguments[0][B]=J[B].slice():arguments[0][B]=J[B])}return arguments[0]}var na=function(){function M(J){o(this,M);for(var B in Kr)if(Kr.hasOwnProperty(B)){var ie=Kr[B],oe=ie._driver;this[B]=oe,er[oe]||this.defineDriver(ie)}this._defaultConfig=$i({},Ft),this._config=$i({},this._defaultConfig,J),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return M.prototype.config=function(B){if((typeof B>"u"?"undefined":s(B))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ie in B){if(ie==="storeName"&&(B[ie]=B[ie].replace(/\W/g,"_")),ie==="version"&&typeof B[ie]!="number")return new Error("Database version must be a number.");this._config[ie]=B[ie]}return"driver"in B&&B.driver?this.setDriver(this._config.driver):!0}else return typeof B=="string"?this._config[B]:this._config},M.prototype.defineDriver=function(B,ie,oe){var re=new d(function(ye,we){try{var Oe=B._driver,Ce=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!B._driver){we(Ce);return}for(var ke=io.concat("_initStorage"),qe=0,Ct=ke.length;qe<Ct;qe++){var Zt=ke[qe],Yt=!ta(_s,Zt);if((Yt||B[Zt])&&typeof B[Zt]!="function"){we(Ce);return}}var Rn=function(){for(var rl=function(pP){return function(){var mP=new Error("Method "+pP+" is not implemented by the current driver"),D0=d.reject(mP);return f(D0,arguments[arguments.length-1]),D0}},Lg=0,hP=_s.length;Lg<hP;Lg++){var Fg=_s[Lg];B[Fg]||(B[Fg]=rl(Fg))}};Rn();var Tn=function(rl){er[Oe]&&console.info("Redefining LocalForage driver: "+Oe),er[Oe]=B,yc[Oe]=rl,ye()};"_support"in B?B._support&&typeof B._support=="function"?B._support().then(Tn,we):Tn(!!B._support):Tn(!0)}catch(Jr){we(Jr)}});return h(re,ie,oe),re},M.prototype.driver=function(){return this._driver||null},M.prototype.getDriver=function(B,ie,oe){var re=er[B]?d.resolve(er[B]):d.reject(new Error("Driver not found."));return h(re,ie,oe),re},M.prototype.getSerializer=function(B){var ie=d.resolve(eo);return h(ie,B),ie},M.prototype.ready=function(B){var ie=this,oe=ie._driverSet.then(function(){return ie._ready===null&&(ie._ready=ie._initDriver()),ie._ready});return h(oe,B,B),oe},M.prototype.setDriver=function(B,ie,oe){var re=this;Yr(B)||(B=[B]);var ye=this._getSupportedDrivers(B);function we(){re._config.driver=re.driver()}function Oe(qe){return re._extend(qe),we(),re._ready=re._initStorage(re._config),re._ready}function Ce(qe){return function(){var Ct=0;function Zt(){for(;Ct<qe.length;){var Yt=qe[Ct];return Ct++,re._dbInfo=null,re._ready=null,re.getDriver(Yt).then(Oe).catch(Zt)}we();var Rn=new Error("No available storage method found.");return re._driverSet=d.reject(Rn),re._driverSet}return Zt()}}var ke=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=ke.then(function(){var qe=ye[0];return re._dbInfo=null,re._ready=null,re.getDriver(qe).then(function(Ct){re._driver=Ct._driver,we(),re._wrapLibraryMethodsWithReady(),re._initDriver=Ce(ye)})}).catch(function(){we();var qe=new Error("No available storage method found.");return re._driverSet=d.reject(qe),re._driverSet}),h(this._driverSet,ie,oe),this._driverSet},M.prototype.supports=function(B){return!!yc[B]},M.prototype._extend=function(B){$i(this,B)},M.prototype._getSupportedDrivers=function(B){for(var ie=[],oe=0,re=B.length;oe<re;oe++){var ye=B[oe];this.supports(ye)&&ie.push(ye)}return ie},M.prototype._wrapLibraryMethodsWithReady=function(){for(var B=0,ie=io.length;B<ie;B++)fn(this,io[B])},M.prototype.createInstance=function(B){return new M(B)},M}(),bn=new na;r.exports=bn},{3:3}]},{},[4])(4)})})(MA);var Aee=MA.exports;const hT=tc(Aee),LA="HttpClient",Pee=(t={})=>{const e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:LA,setupOnce(){},setup(n){zee(n,e),Vee(n,e)}}},FA=Pee;Li(LA,FA);function Mee(t,e,n,r){if(jA(t,n.status,n.url)){const i=Hee(e,r);let s,o,a,c;BA()&&([{headers:s,cookies:a},{headers:o,cookies:c}]=[{cookieHeader:"Cookie",obj:i},{cookieHeader:"Set-Cookie",obj:n}].map(({cookieHeader:l,obj:d})=>{const f=$ee(d.headers);let h;try{const m=f[l]||f[l.toLowerCase()]||void 0;m&&(h=$A(m))}catch{af&&me.log(`Could not extract cookies from header ${l}`)}return{headers:f,cookies:h}}));const u=UA({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:o,requestCookies:a,responseCookies:c});yg(u)}}function Lee(t,e,n,r){if(jA(t,e.status,e.responseURL)){let i,s,o;if(BA()){try{const c=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;c&&(s=$A(c))}catch{af&&me.log("Could not extract cookies from response headers")}try{o=jee(e)}catch{af&&me.log("Could not extract headers from response")}i=r}const a=UA({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:o,responseCookies:s});yg(a)}}function Fee(t){if(t){const e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function $A(t){return t.split("; ").reduce((e,n)=>{const[r,i]=n.split("=");return e[r]=i,e},{})}function $ee(t){const e={};return t.forEach((n,r)=>{e[r]=n}),e}function jee(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
|
|
429
|
-
`).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i]=s,n},{}):{}}function Uee(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function Bee(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function zee(t,e){IR()&&dg(n=>{if(Lt()!==t)return;const{response:r,args:i}=n,[s,o]=i;r&&Mee(e,s,r,o)})}function Vee(t,e){"XMLHttpRequest"in Mt&&hg(n=>{if(Lt()!==t)return;const r=n.xhr,i=r[Ms];if(!i)return;const{method:s,request_headers:o}=i;try{Lee(e,r,s,o)}catch(a){af&&me.warn("Error while extracting response event form XHR response",a)}})}function jA(t,e,n){return Bee(t.failedRequestStatusCodes,e)&&Uee(t.failedRequestTargets,n)&&!oN(n,Lt())}function UA(t){const e=`HTTP Client Error with status code: ${t.status}`,n={message:e,exception:{values:[{type:"Error",value:e}]},request:{url:t.url,method:t.method,headers:t.requestHeaders,cookies:t.requestCookies},contexts:{response:{status_code:t.status,headers:t.responseHeaders,cookies:t.responseCookies,body_size:Fee(t.responseHeaders)}}};return Ka(n,{type:"http.client",handled:!1}),n}function Hee(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function BA(){const t=Lt();return t?!!t.getOptions().sendDefaultPii:!1}function Wee(t){const e={...t};aN(e,"react"),nJ(e)}function qee(t){const e=zY({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:i,createRoutesFromChildren:s,matchRoutes:o,stripBasename:a,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=t;return{...e,afterAllSetup(l){e.afterAllSetup(l);const d=Jt.location&&Jt.location.pathname;c&&d&&SN(l,{name:d,attributes:{[as]:"url",[Pl]:"pageload",[ga]:"auto.pageload.react.reactrouter_v6"}})}}}function Gee(...t){let e,n;const r=t.findIndex(i=>i instanceof Error);r?(e=t.at(r),n=t.slice(0,r).concat(t.slice(r+1))):t.length===1?e=t:t.length>1&&(e=t[0],n=t.slice(1)),!(e instanceof TypeError&&e.message==="Failed to fetch"&&!navigator.onLine)&&Df(e,n?{data:n}:void 0)}var Wi;class Zee{constructor(){bt(this,Wi,console);this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.trace=this.trace.bind(this)}set logger(e){ht(this,Wi,e)}log(...e){return ce(this,Wi).log(...e)}info(...e){return ce(this,Wi).info(...e)}warn(...e){return ce(this,Wi).warn(...e)}error(...e){return Gee(...e),ce(this,Wi).error(...e)}debug(...e){return ce(this,Wi).debug(...e)}trace(...e){return ce(this,Wi).trace(...e)}}Wi=new WeakMap;const Hn=new Zee;SH(Hn);function Yee(t){const e=gn(0),n=gn(()=>({i:0}),(c,u)=>{const l=c(n);return Object.assign(l,{m:!0,peek:c,set:u}),u(e,d=>d+1),()=>{l.m=!1,o(l),a(l)}});n.onMount=c=>c();const r=gn(c=>{c(e);const u=c(n);if(!u.m||u.irc||u.i&&!u.irf)return u.p;a(u);const l=new Map,d=p=>{const g=c(p);return l.set(p,g),g};d.peek=u.peek;const f=(...p)=>{try{return++u.i,u.set(...p)}finally{Array.from(l.keys(),c),--u.i}};f.recurse=(p,...g)=>{if(!u.fc)try{return u.irc=!0,u.set(p,...g)}finally{u.irc=!1,Array.from(l).some(h)&&s(u)}};function h([p,g]){return c(p)!==g}++u.i;function m(){try{if(u.irf=!1,!u.m)return;o(u),u.c=i.effect(d,f)}catch(p){u.e=p,s(u)}finally{u.p=void 0,--u.i}}return u.irf?m():u.p=Promise.resolve().then(m)}),i=gn(c=>void c(r));return i.effect=t,i;function s(c){try{c.irf=!0,c.set(e,u=>u+1)}finally{c.irf=!1}}function o(c){if(typeof c.c=="function")try{c.fc=!0,c.c()}finally{c.fc=!1,c.c=void 0}}function a(c){if("e"in c){const u=c.e;throw delete c.e,u}}}const kh=new WeakMap;function Kee(t,e=KC()){kh.has(e)||kh.set(e,new Map);const n=kh.get(e);let r=n.get(t);if(!r){const i=Yee(t);let s=e.sub(i,()=>{});r=()=>{s&&(n.delete(t),n.size===0&&kh.delete(e),s=void s())},n.set(t,r)}return r}const Jee="feature-flags-config",np=window.__VITE_ENVS.PH_CONNECT_ENABLED_EDITORS||void 0,Xee=np==null?void 0:np.split(","),rp=window.__VITE_ENVS.PH_CONNECT_DISABLED_EDITORS||void 0,Qee=rp==null?void 0:rp.split(","),zA={editors:{enabledEditors:np==="*"?"*":Xee,disabledEditors:rp==="*"?"*":Qee}},ete=Sf(Jee,zA),VA=()=>{const[t,e]=Ni(ete);return{config:{...zA,...t},setConfig:e}},tte=F9("theme","light",t=>{var e;typeof window<"u"&&((e=window.electronAPI)==null||e.setTheme(t))}),v0=K_(),nte=Sf("sidebar-collapsed",!1);gn(!1);const rte={sidebarCollapsedAtom:nte,themeAtom:tte};async function b0(){try{return(await Se(()=>import("PH:HMR_MODULE"),[])).default}catch{return}}const ite=window.__VITE_ENVS.LOAD_EXTERNAL_PACKAGES,ste=ite==="true";function ote(){return ste?Se(()=>import("PH:EXTERNAL_PACKAGES"),[]).then(t=>t.default):Promise.resolve([])}async function ate(t){const e=await b0(),n=r=>{const i=Se(()=>import(`${r.url}?t=${r.timestamp}`),[]);t(i.then(s=>s.default))};return e==null||e.on("studio:external-packages-updated",n),()=>{e==null||e.off("studio:external-packages-updated",n)}}const _0=J_(ote);let pT;_0.onMount=t=>{pT||(pT=ate(e=>{t(e)}))};const cte=()=>cc(_0),ute=window.__VITE_ENVS.LOCAL_DOCUMENT_MODELS,lte=[rR];function dte(...t){const e=new Map;for(const n of t)for(const r of n)e.set(r.documentModel.id,r);return Array.from(e.values())}function fte(t){return t.map(e=>e.documentModels).reduce((e,n)=>e.concat(n),[])}async function hte(){if(!ute)return[];try{const t=await Se(()=>import("LOCAL_DOCUMENT_MODELS"),[]);return console.log("Loaded local document models:",t),Object.values(t)}catch(t){return console.error("Error loading local document models",t),[]}}const pte=J_(hte),Cg=gn(async t=>{const e=await t(pte),n=await t(_0),r=fte(n);return dte(lte,r,e)}),mte=()=>cc(Cg),gte=tk(Cg),HA=()=>cc(gte),yte=function(t){const e=Kee(n=>{n(Cg).then(t).catch(i=>{throw i})},v0);return()=>e()};function vte(t,e){return e==null?void 0:e.find(n=>n.documentModel.id===t)}const bte=()=>{const t=HA();return e=>vte(e,t)},_te=()=>{const t=HA(),{config:e}=VA(),{enabledEditors:n,disabledEditors:r}=e.editors;if(!t)return;const i=t.filter(s=>s.documentModel.id!=="powerhouse/document-drive");return n==="*"?t:r==="*"?[]:r?i.filter(s=>!r.includes(s.documentModel.id)):n?i.filter(s=>n.includes(s.documentModel.id)):i};function wte(t){let e=!1;const n=Object.entries(t.operations).reduce((r,[i,s])=>{const o=i;for(const a of s){const c=Ete(a);r[o].push(c),c!==a&&(e=!0)}return r},{global:[],local:[]});return e?{...t,operations:n}:t}function Ete(t){var n;if(!((n=t.context)!=null&&n.signer)||t.context.signer.signatures)return t;const{signer:e}=t.context;if("signature"in e){const r=e.signature;return{...t,context:{...t.context,signer:{user:e.user,app:e.app,signatures:r!=null&&r.length?[r]:[]}}}}else return t}const Kn=class Kn{constructor(e){Ve(this,"db");this.db=hT.ready().then(()=>hT.createInstance({name:e?`${e}:${Kn.DBName}`:Kn.DBName}))}buildKey(...e){return e.join(Kn.SEP)}async checkDocumentExists(e,n){return!!await(await this.db).getItem(this.buildKey(e,n))}async getDocuments(e){const r=await(await this.db).keys(),i=`${e}${Kn.SEP}`;return r.filter(s=>s.startsWith(i)).map(s=>s.slice(i.length))}async getDocument(e,n){const r=await(await this.db).getItem(this.buildKey(e,n));if(!r)throw new Error(`Document with id ${n} not found`);return r}async createDocument(e,n,r){await(await this.db).setItem(this.buildKey(e,n),r)}async deleteDocument(e,n){await(await this.db).removeItem(this.buildKey(e,n))}async clearStorage(){return(await this.db).clear()}async addDocumentOperations(e,n,r,i){const s=await this.getDocument(e,n);if(!s)throw new Error(`Document with id ${n} not found`);const o=Qp(s.operations,r);await(await this.db).setItem(this.buildKey(e,n),{...s,...i,operations:o})}async getDrives(){return(await(await this.db).keys()).filter(r=>r.startsWith(Kn.DRIVES_KEY)).map(r=>r.slice(Kn.DRIVES_KEY.length+Kn.SEP.length))}async getDrive(e){const r=await(await this.db).getItem(this.buildKey(Kn.DRIVES_KEY,e));if(!r)throw new Wl(e);return r}async getDriveBySlug(e){const n=(await this.getDrives()).reverse();for(const r of n)if((await this.getDrive(r)).initialState.state.global.slug===e)return this.getDrive(r);throw new Error(`Drive with slug ${e} not found`)}async createDrive(e,n){await(await this.db).setItem(this.buildKey(Kn.DRIVES_KEY,e),n)}async deleteDrive(e){const n=await this.getDocuments(e);return await Promise.all(n.map(r=>this.deleteDocument(e,r))),(await this.db).removeItem(this.buildKey(Kn.DRIVES_KEY,e))}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=Qp(i.operations,n);await(await this.db).setItem(this.buildKey(Kn.DRIVES_KEY,e),{...i,...r,operations:s})}async getSynchronizationUnitsRevision(e){return(await Promise.allSettled(e.map(async r=>{try{const i=await(r.documentId?this.getDocument(r.driveId,r.documentId):this.getDrive(r.driveId));if(!i)return;const s=i.operations[r.scope].at(-1);if(s)return{driveId:r.driveId,documentId:r.documentId,scope:r.scope,branch:r.branch,lastUpdated:s.timestamp,revision:s.index}}catch{return}}))).reduce((r,i)=>(i.status==="fulfilled"&&i.value!==void 0&&r.push(i.value),r),[])}async migrateOperationSignatures(){const e=await this.getDrives();for(const n of e){await this.migrateDocument(Kn.DRIVES_KEY,n);const r=await this.getDocuments(n);await Promise.all(r.map(async i=>this.migrateDocument(n,i)))}}async migrateDocument(e,n){const r=await this.getDocument(e,n),i=wte(r);if(i!==r)return(await this.db).setItem(this.buildKey(e,n),i)}};Ve(Kn,"DBName","DOCUMENT_DRIVES"),Ve(Kn,"SEP",":"),Ve(Kn,"DRIVES_KEY","DRIVES");let Nb=Kn;const mT=window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL||void 0,Hy=mT?mT.split(","):[],Ste=()=>({defaultDrives:{remoteDrives:Hy.map(e=>({url:e,options:{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:e,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[],pullInterval:3e3}})),removeOldRemoteDrives:Hy.length>0?{strategy:"preserve-by-url-and-detach",urls:Hy}:{strategy:"preserve-all"}}});function xte(t,e){return new QW(t,new Nb(e),new sR,new aR(1,10),{...Ste()})}async function Tte(t){const e=await t.initialize(),n=e==null?void 0:e.at(0);if(n)throw n;!(await t.getDrives()).length&&Ns.drives.sections.LOCAL.enabled&&t.addDrive({global:{id:Vt.hashKey(),name:"My Local Drive",icon:null,slug:"my-local-drive"},local:{availableOffline:!1,sharingType:"private",listeners:[],triggers:[]}}).catch(Hn.error)}async function Ite(){var n;const t=await v0.get(Cg),e=((n=window.electronAPI)==null?void 0:n.documentDrive)??xte(t,Ns.routerBasename);return await Tte(e),e}const vm=J_(Ite),Ote=tk(vm),WA=()=>cc(Ote),Cte=()=>cc(qA),qA=gn(void 0);qA.onMount=t=>{const e=vm.onMount;vm.onMount=n=>(n(r=>(r.then(i=>t(i)).catch(console.error),r)),e==null?void 0:e(n))};let Wy;vm.onMount=t=>{Wy||t(async e=>{const n=await e;return Wy||(Wy=yte(r=>{n.setDocumentModels(r)})),n})};const ip=(async()=>{if(window.connectCrypto)return window.connectCrypto;const{ConnectCrypto:t}=await Se(async()=>{const{ConnectCrypto:r}=await import("./index-B38XkIrT.js");return{ConnectCrypto:r}},__vite__mapDeps([0,1,2,3])),{BrowserKeyStorage:e}=await Se(async()=>{const{BrowserKeyStorage:r}=await import("./browser-BbIPlSaA.js");return{BrowserKeyStorage:r}},[]),n=new t(new e);return await n.did(),n})();function w0(){return Pn(()=>({async regenerateDid(){return(await ip).regenerateDid()},async did(){return(await ip).did()},sign:async t=>await(await ip).sign(t)}),[])}const kte=gn(void 0);function Dte(){const[t,e]=Ni(kte);return Dt(()=>{t||ip.then(n=>n.did()).then(n=>e(n)).catch(Hn.error)}),t}const Rte=gn(window.renown?Promise.resolve(window.renown):void 0);function GA(){const[t,e]=Ni(Rte),{did:n}=w0();async function r(i){const s=await i();if(!s)return;const{initRenownBrowser:o}=await Se(async()=>{const{initRenownBrowser:u}=await import("./browser-camIpcNU.js");return{initRenownBrowser:u}},__vite__mapDeps([4,5,1,6,2,3])),a=o(s);return{user:function(){return Promise.resolve(a.user)},login:function(u){return a.login(u)},logout(){return Promise.resolve(a.logout())},on:{user(u){return a.on("user",u)}}}}return t||e(r(n)),t}let Dh=!1;const Nte=gn(void 0),kg=()=>{const[t,e]=Ni(Nte),n=GA();return Dt(()=>{var i;let r=null;if(t){const{credential:s,...o}=t;r={id:o.did,username:(i=o.ens)==null?void 0:i.name,...o}}CG(r)},[t]),Dt(()=>{if(Dh)return;Dh=!0,n==null||n.user().then(i=>{e(i||null)}).catch(()=>{e(null)});const r=n==null?void 0:n.on.user(i=>{e(i||null)});return()=>{r==null||r(),Dh=!1}},[n,Dh]),t},Ate=parseInt("50");function Sse(t,e,n=Hn.error){const[r,i]=We(e),[s,o]=We(),a=u=>{o(u),n(u)};return Dt(()=>{i(e)},[e]),[r,(u,l,d)=>{o(void 0),i(f=>{if(!t||!f)return f;try{const h=t(f,u),m=u.scope??"global",p=h.operations[m],g=p[p.length-1];if(g.error){const y=new Error(g.error);a(y),d==null||d(y)}return l==null||l(g,{prevState:{...f},newState:{...h}}),h}catch(h){return a(h),d==null||d(h),f}})},s]}async function Pte(t,e,n,r,i){let s;const o=new Promise(u=>{s=i.on("strandUpdate",l=>{var h;if(!(l.documentId===e&&l.scope==n))return;const f=(h=l.operations.at(-1))==null?void 0:h.index;f&&f>=r&&u()})}),a=new Promise((u,l)=>setTimeout(()=>l(new Error(`Timed out waiting for operation ${r} for document ${e}`)),t)),c=Promise.race([o,a]);return c.finally(()=>{s==null||s()}),c}async function Mte(t,e,n,r,i,s){const o=(s==null?void 0:s.operationsLimit)||Ate;for(const a of Object.values(n.operations))for(let c=0;c<a.length;c+=o){const u=a.slice(c,c+o),l=u.at(-1);if(!l)break;const{scope:d}=l;await i(t,e,u),s!=null&&s.waitForSync&&await Pte(1e4,e,d,l.index,r)}}const Lte=async t=>{(await Vt.createZip(t)).generateAsync({type:"blob"}).then(n=>{const r=window.document.createElement("a");r.style.display="none",r.href=URL.createObjectURL(n),r.download=`${t.name||"Untitled"}.zip`,window.document.body.appendChild(r),r.click(),window.document.body.removeChild(r)}).catch(Hn.error)};async function xse(t,e){var i,s;const n=e(t.documentType);if(!n)throw new Error(`Document model not supported: ${t.documentType}`);const r=n.utils.fileExtension;if(!window.showSaveFilePicker){await Lte(t);return}try{const o=await window.showSaveFilePicker({suggestedName:`${t.name||((i=t.state.global)==null?void 0:i.name)||"Untitled"}.${r?`${r}.`:""}zip`});await n.utils.saveToFileHandle(t,o);const a=(await o.getFile()).path;return typeof window<"u"&&((s=window.electronAPI)==null||s.fileSaved(t,a)),a}catch(o){if(!(o instanceof DOMException&&o.name==="AbortError"))throw o}}async function Fte(t,e){const n=await Vt.loadFromInput(t,i=>i,{checkHashes:!0}),r=e(n.documentType);if(!r)throw new Error(`Document "${n.documentType}" is not supported`);return r.utils.loadFromInput(t)}async function $te(t,e,n,r,i,s){if(!s||!t.context||!t.context.signer)return t;if(!i)return Hn.error(`Document model '${r.documentType}' does not have a reducer`),t;const o={documentId:n,signer:t.context.signer};return await Vt.buildSignedOperation(t,i,r,o,e)}function jte(t,e,n){return n?{context:{signer:{app:{name:"Connect",key:e||""},user:{address:n.address,networkId:n.networkId,chainId:n.chainId},signatures:[]}},...t}:t}const gT=gn(new Map);function Ute(t){return Object.keys(t.operations).map(e=>{var n;return`${e}:${t.operations[e].length}:${(n=t.operations[e].at(-1))==null?void 0:n.hash}`}).join(":")}function bm(t){return t.map(Ute).join("&")}const Bte=t=>()=>gn(e=>t?e(gT).get(t)??[]:[],(e,n,r)=>{n(gT,i=>{if(!t)return new Map;const s=i.get(t)??[];return s.length!==r.length||bm(s)!==bm(r)?new Map(i).set(t,r):i})}),zte=O9(()=>gn("INITIAL"));function Vte(){const t=WA(),[e,n]=Ni(Pn(Bte(t),[t])),r=He(async()=>{if(!t)return;const a=[];try{const c=await t.getDrives();for(const u of c)try{const l=await t.getDrive(u);a.push(l)}catch(l){Hn.error(l)}}catch(c){Hn.error(c)}finally{n(a)}},[t]),[i,s]=Ni(zte(t));i==="INITIAL"&&(s("LOADING"),r().then(()=>s("LOADED")).catch(()=>s("ERROR")));const o=He(a=>{if(!t)return;const c=t.on("syncStatus",async(f,h,m)=>{m&&Hn.error(m),await r()}),u=t.on("strandUpdate",()=>r()),l=t.on("clientStrandsError",a.strandsErrorHandler),d=t.on("defaultRemoteDrive",()=>r());return()=>{c(),u(),l(),d()}},[t,r]);return Pn(()=>[e,r,o,i],[e,i])}const Hte=window.__VITE_ENVS.PH_CONNECT_RENOWN_URL||"https://www.renown.id",Wte=window.__VITE_ENVS.PH_CONNECT_RENOWN_NETWORK_ID||"eip155",qte=window.__VITE_ENVS.PH_CONNECT_RENOWN_CHAIN_ID||"1",Gte=gn("initial"),E0=()=>{const[t,e]=Ni(Gte),n=kg(),r=GA(),{did:i}=w0(),s=He(async()=>{var l;const c=await i(),u=new URL(Hte);if(u.searchParams.set("connect",c),u.searchParams.set("network",Wte),u.searchParams.set("chain",qte),window.electronAPI){const d=await window.electronAPI.protocol();u.searchParams.set("deeplink",d),await window.electronAPI.openURL(u.toString())}else{const d=new URL(window.location.pathname,window.location.origin);u.searchParams.set("returnUrl",d.toJSON()),(l=window.open(u,"_self"))==null||l.focus()}},[i]),o=He(async c=>{if(r)try{e("checking");const u=await r.user();if((u==null?void 0:u.did)===c)return e("authorized"),u;const l=await r.login(c);if(l)return e("authorized"),l;e("not-authorized")}catch(u){e("not-authorized"),Hn.error(u)}},[r]);Dt(()=>{n&&t!=="authorized"&&e("authorized")},[n,t]);const a=He(async()=>{e("initial"),await(r==null?void 0:r.logout())},[r]);return Pn(()=>({openRenown:s,user:n,status:n?"authorized":t,login:r?o:void 0,logout:a}),[r,s,n,t,o,a])};function Zte(){const{user:t,status:e}=E0(),n=window.__VITE_ENVS.PH_CONNECT_ARBITRUM_ALLOW_LIST,r=window.__VITE_ENVS.PH_CONNECT_RWA_ALLOW_LIST,i=!!n&&n!=="",s=!!r&&r!=="";if(i&&s)throw new Error("Both Arbitrum and RWA allow lists are defined. Please only define one.");if(!i&&!s)return{isAllowed:!0,allowListType:"none"};if(t!==void 0){if(i){const o=n.split(",");return e!=="authorized"||!t?{isAllowed:!1,allowListType:"arbitrum"}:o.includes(t.address)?{isAllowed:!0,allowListType:"arbitrum"}:{isAllowed:!1,allowListType:"arbitrum"}}if(s){const o=r.split(",");return e!=="authorized"||!t?{isAllowed:!1,allowListType:"rwa"}:o.includes(t.address)?{isAllowed:!0,allowListType:"rwa"}:{isAllowed:!1,allowListType:"rwa"}}return{isAllowed:!0,allowListType:"none"}}}function ZA(){const t=Zte();if(!t)return;const{allowListType:e,isAllowed:n}=t;return e==="arbitrum"?{isAllowedToCreateDocuments:n,isAllowedToEditDocuments:!0}:e==="rwa"?{isAllowedToCreateDocuments:n,isAllowedToEditDocuments:n}:{isAllowedToCreateDocuments:!0,isAllowedToEditDocuments:!0}}function S0(){const{isAllowedToCreateDocuments:t,isAllowedToEditDocuments:e}=ZA()||{isAllowedToCreateDocuments:!1,isAllowedToEditDocuments:!1},n=kg()||void 0,r=Dte(),{sign:i}=w0(),s=WA(),o=bte(),[a,c,,u]=Vte(),l=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");const j=await s.getDocument($,q);if(!j)throw new Error(`There was an error opening file with id ${q} on drive ${$}`);return j},[s]),d=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");let j=a.find(pe=>pe.state.global.id===$);if(!j)throw new Error(`Drive with id ${$} not found`);const D={...j};j=Ga(j,jte(q,r,n));const X=q.scope??"global",z=j.operations[X].findLast(pe=>pe.type===q.type);if(!z)throw new Error("There was an error applying the operation");const le=await $te(z,i,$,D,Ga,n);try{const pe=await s.queueDriveOperation($,le);if(pe.status!=="SUCCESS"&&Hn.error(pe.error),pe.operations.length&&await c(),pe.document&&!aa(pe.document))throw new Error("Received document is not a Document Drive");return pe.document}catch(pe){return Hn.error(pe),j}},[a,c,s,i,n,r]),f=He(async($,q,j,D,X)=>{if(!t)throw new Error("User is not allowed to create documents");const Z=Vt.hashKey();let z=a.find(ve=>ve.state.global.id===$);if(!z)throw new Error(`Drive with id ${$} not found`);const le=Mw(z.state.global,{id:Z,name:q,parentFolder:D??null,documentType:j,document:X},["global"]);z=await d($,le);const pe=z==null?void 0:z.state.global.nodes.find(ve=>ve.id===Z);if(!pe||!Or(pe))throw new Error("There was an error adding document");return pe},[d,a,t]),h=He(async($,q,j)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(Z=>Z.state.global.id===$))throw new Error(`Drive with id ${$} not found`);return(await s.queueOperations($,q,j)).document},[a,e,s]),m=He(async($,q,j,D)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create files");const X=await Fte($,o),Z={...X.initialState,initialState:X.initialState,operations:{global:[],local:[]},clipboard:[]},z=await f(q,j||(typeof $=="string"?X.name:$.name),X.documentType,D,Z),le=a.find(ve=>ve.state.global.id===q),pe=le&&le.state.local.listeners.length>0;Mte(q,z.id,X,s,h,{waitForSync:pe}).catch(ve=>{throw ve})},[f,h,o,t,s]),p=He(async($,q,j,D,X)=>{if(!t)throw new Error("User is not allowed to update files");const Z=await d($,Jn.updateFile({id:q,name:D||void 0,parentFolder:X,documentType:j})),z=Z==null?void 0:Z.state.global.nodes.find(le=>le.id===q);if(!z||!Or(z))throw new Error("There was an error updating document");return z},[d,t]),g=He(async($,q,j)=>{if(!t)throw new Error("User is not allowed to create folders");const D=Vt.hashKey(),X=await d($,Jn.addFolder({id:D,name:q,parentFolder:j})),Z=X==null?void 0:X.state.global.nodes.find(z=>z.id===D);if(!Z||!ag(Z))throw new Error("There was an error adding folder");return Z},[d,t]),y=He(async($,q)=>{if(!t)throw new Error("User is not allowed to delete documents");await d($,Jn.deleteNode({id:q}))},[d,t]),v=He(async($,q,j)=>{if(!t)throw new Error("User is not allowed to rename documents");const D=await d($,Jn.updateNode({id:q,name:j})),X=D==null?void 0:D.state.global.nodes.find(Z=>Z.id===q);if(!X)throw new Error("There was an error renaming node");return X},[d,t]),b=He(async($,q)=>{if(!t)throw new Error("User is not allowed to move documents");q.kind===Gc||$.parentFolder===q.id||await d(q.driveId,Jn.moveNode({srcFolder:$.id,targetParentFolder:q.id}))},[d,t]),E=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to copy documents");if(q.kind===Gc)return;const j=a.find(le=>le.state.global.id===$.driveId);if(!j)return;const D=()=>Vt.hashKey(),Z=ef.generateNodesCopy({srcId:$.id,targetParentFolder:q.id,targetName:$.name},D,j.state.global.nodes).map(le=>Jn.copyNode(le)),z=await s.addDriveActions($.driveId,Z);z.operations.length?await c():z.status!=="SUCCESS"&&Hn.error(`Error copying files: ${z.status}`,z.error)},[a,t,c,s]),w=He(async($,q,j)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(Z=>Z.state.global.id===$))throw new Error(`Drive with id ${$} not found`);return(await s.addOperation($,q,j)).document},[a,e,s]),x=He(async $=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create drives");const q=$.global.id||Vt.hashKey();$=ef.createState($);const j=await s.addDrive({global:{...$.global,id:q},local:$.local});return await c(),j},[t,c,s]),_=He(async($,q)=>{if(!s)throw new Error("Reactor is not loaded");const j=await s.addRemoteDrive($,q);return await c(),j},[c,s]),k=He(async $=>{if(!t)throw new Error("User is not allowed to delete drives");if(!s)throw new Error("Reactor is not loaded");if(!a.find(j=>j.state.global.id===$))throw new Error(`Drive with id ${$} not found`);return await s.deleteDrive($),c()},[a,t,c,s]),R=He(async($,q)=>{if(!t)throw new Error("User is not allowed to rename drives");return d($,Jn.setDriveName({name:q}))},[d,t]),F=He(async($,q)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d($,Jn.setAvailableOffline({availableOffline:q}))},[d,t]),V=He(async($,q)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d($,Jn.setSharingType({type:q}))},[d,t]),T=He(async($,q)=>{if(q!==jb){if(!s)throw new Error("Reactor is not loaded");try{const j=s.getSyncStatus($);return j instanceof oR?"INITIAL_SYNC":j}catch(j){return console.error(j),P3}}},[s]),L=He($=>{if(!s)throw new Error("Reactor is not loaded");return s.on("strandUpdate",$)},[s]),S=He($=>{if(!s)throw new Error("Reactor is not loaded");return s.on("syncStatus",$)},[s]),C=He(async()=>{s&&(await s.clearStorage(),await c())},[c,s]),N=He(async($,q)=>{const j=await d($,Jn.removeTrigger({triggerId:q}));if(j==null?void 0:j.state.local.triggers.find(X=>X.id===q))throw new Error(`There was an error removing trigger ${q}`)},[d]),U=He(async($,q,j)=>{if(!s)throw new Error("Reactor is not loaded");return await s.registerPullResponderTrigger($,q,j)},[s]),K=He(async($,q)=>{const j=await d($,Jn.addTrigger({trigger:q}));if(!(j==null?void 0:j.state.local.triggers.find(X=>X.id===X.id)))throw new Error(`There was an error adding the trigger ${q.id}`)},[d]);return Pn(()=>({documentDrives:a,documentDrivesStatus:u,addDocument:f,openFile:l,addFile:m,updateFile:p,addFolder:g,deleteNode:y,renameNode:v,moveNode:b,copyNode:E,addOperation:w,addOperations:h,addDrive:x,addRemoteDrive:_,deleteDrive:k,renameDrive:R,setDriveAvailableOffline:F,setDriveSharingType:V,getSyncStatus:T,onStrandUpdate:L,onSyncStatus:S,clearStorage:C,removeTrigger:N,addTrigger:K,registerNewPullResponderTrigger:U}),[f,x,m,g,w,h,_,K,C,E,k,y,a,u,T,b,L,S,l,U,N,R,v,F,V,p])}function Yte(t){return t.replaceAll(/\s/g,"-")}const Kte=t=>{const{open:e,onClose:n,selectedParentNode:r,setSelectedNode:i,documentModel:s}=t,{addDocument:o}=S0();return P(C4,{open:e,onContinue:async c=>{if(n(),!r)throw new Error("No drive or folder selected");const u=await o(r.driveId,c||`New ${s.documentModel.name}`,s.documentModel.id,r.id);u&&i({...u,slug:Yte(u.name),kind:Gc,documentType:u.documentType,parentFolder:r.id,driveId:r.driveId,syncStatus:r.syncStatus,synchronizationUnits:[],sharingType:r.sharingType})},onOpenChange:c=>{if(!c)return n()}})},Jte=gn(Ns);function x0(){return Ni(Jte)}let Rh;const Xte=new Uint8Array(16);function Qte(){if(!Rh&&(Rh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Rh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Rh(Xte)}const Yn=[];for(let t=0;t<256;++t)Yn.push((t+256).toString(16).slice(1));function ene(t,e=0){return Yn[t[e+0]]+Yn[t[e+1]]+Yn[t[e+2]]+Yn[t[e+3]]+"-"+Yn[t[e+4]]+Yn[t[e+5]]+"-"+Yn[t[e+6]]+Yn[t[e+7]]+"-"+Yn[t[e+8]]+Yn[t[e+9]]+"-"+Yn[t[e+10]]+Yn[t[e+11]]+Yn[t[e+12]]+Yn[t[e+13]]+Yn[t[e+14]]+Yn[t[e+15]]}const tne=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),yT={randomUUID:tne};function vT(t,e,n){if(yT.randomUUID&&!t)return yT.randomUUID();t=t||{};const r=t.random||(t.rng||Qte)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ene(r)}const nne=t=>{var V;const[e]=x0(),{open:n,onClose:r}=t,i=localStorage.getItem("AUTO_REGISTER_PULL_RESPONDER")!=="false";console.log("autoRegisterPullResponder",i);const[s,o]=We(e.appVersion),[a,c]=We({label:zf.debug?"Enabled":"Disabled",value:zf.debug}),[u,l]=We(),[d,f]=We(null),[h,m]=We(""),[p,g]=We({label:i?"Enabled":"Disabled",value:i?"true":"false"}),{documentDrives:y,removeTrigger:v,addTrigger:b,registerNewPullResponderTrigger:E}=S0();Dt(()=>{zf.setDebug(a.value)},[a]),console.log("documentDrives",y),console.log("selectedDrive",u);const w=((V=y.find(T=>T.state.global.id===u))==null?void 0:V.state.local.triggers)||[],_=!u||h==="",k=async()=>{!d||!u||(await v(u,d.value),f(null))},R=async(T=!1)=>{if(!(!h||h===""||!u)){if(!T){const L=await E(u,h,{pullInterval:3e3});await b(u,L),m("");return}await b(u,{id:`invalid-trigger-${vT()}`,type:"PullResponder",data:{interval:"3000",listenerId:`ivalid-listener-${vT()}`,url:h}}),m("")}},F=T=>{g(T),localStorage.setItem("AUTO_REGISTER_PULL_RESPONDER",T.value)};return P(Xs,{open:n,onOpenChange:T=>{if(!T)return r()},contentProps:{className:"rounded-2xl"},children:Ee("div",{className:"w-[700px] rounded-2xl p-6",children:[Ee("div",{className:"mb-6 flex justify-between",children:[P("div",{className:"text-xl font-bold",children:"Debug Tools"}),P("button",{id:"close-modal",onClick:()=>r(),children:P(vt,{name:"Xmark",size:28})})]}),Ee("div",{className:"flex text-sm font-bold",children:[P(vt,{name:"Ring",size:22}),Ee("span",{className:"ml-2",children:["App Version: ",e.appVersion]})]}),Ee("div",{className:"mt-4 flex text-sm font-bold",children:[P(vt,{name:"Hdd",size:22}),P("span",{className:"ml-2",children:"Drive Tools:"})]}),Ee("div",{children:[P("label",{htmlFor:"selectedDrive",className:"text-xs",children:"Selected Drive:"}),P(wl,{id:"selectedDrive",onChange:T=>{if(!T||typeof T!="object"||!("value"in T)){l(void 0),f(null);return}l(T.value),f(null)},options:y.map(T=>({label:T.state.global.name,value:T.state.global.id}))})]}),P("div",{className:"mt-2 flex items-end justify-between pl-4",children:Ee("div",{className:"w-[400px]",children:[P("label",{htmlFor:"autoRegisterPullResponder",className:"text-xs",children:"Auto register pull responder:"}),P(wl,{id:"autoRegisterPullResponder",onChange:T=>{F(T)},value:p,options:[{label:"Enabled",value:"true"},{label:"Disabled",value:"false"}]})]})}),Ee("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ee("div",{className:"w-[400px]",children:[P("label",{htmlFor:"driveTrigger",className:"text-xs",children:"Drive trigger:"}),P(wl,{id:"driveTrigger",onChange:T=>{f(T)},value:d,options:w.map(T=>({label:`${T.id} - ${T.type}`,value:T.id}))})]}),P("div",{children:P(zn,{onClick:k,color:d?"red":"light",disabled:!d,size:"small",children:"Remove Trigger"})})]}),Ee("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ee("div",{className:"w-[400px]",children:[P("label",{htmlFor:"driveUrl",className:"text-xs",children:"Add drive trigger:"}),P(Pa,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"driveUrl",icon:P("div",{className:"flex h-full items-center text-xs",children:"URL:"}),value:h,onChange:T=>m(T.target.value)})]}),Ee("div",{className:"mb-1 flex items-center justify-center",children:[P(zn,{className:"mr-2",color:_?"light":"blue",size:"small",disabled:_,onClick:()=>R(),children:"Add Trigger"}),P(zn,{color:_?"light":"red",size:"small",disabled:_,onClick:()=>R(!0),children:"Add Invalid Trigger"})]})]}),Ee("div",{className:"mt-4 flex text-sm font-bold",children:[P(vt,{name:"Gear",size:22}),P("span",{className:"ml-2",children:"Service Worker Tools:"})]}),P("div",{className:"mt-2 flex items-end justify-between pl-4",children:Ee("div",{className:"w-[400px]",children:[P("label",{htmlFor:"serviceWorkerDebugMode",className:"text-xs",children:"Service Worker Debug Mode:"}),P(wl,{id:"serviceWorkerDebugMode",onChange:T=>{c(T)},value:a,options:[{label:"Enabled",value:!0},{label:"Disabled",value:!1}]})]})}),Ee("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ee("div",{className:"w-[400px]",children:[P("label",{htmlFor:"appVersion",className:"text-xs",children:"Set invalid app version:"}),P(Pa,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"appVersion",icon:P("div",{className:"flex h-full items-center text-xs",children:"Version:"}),value:s,onChange:T=>o(T.target.value)})]}),P("div",{className:"mb-1 flex items-center justify-center",children:P(zn,{color:s===""?"light":"red",size:"small",disabled:s==="",onClick:()=>{zf.sendMessage({type:"SET_APP_VERSION",version:s}),o("")},children:"Add Invalid App Version"})})]})]})})},rne=t=>{const{open:e,onClose:n,uiDriveNode:r,onDelete:i}=t,{t:s}=nc();return P(k4,{open:e,driveName:r.name,onCancel:n,header:s("modals.deleteDrive.title",{label:r.name}),body:s("modals.deleteDrive.body"),inputPlaceholder:s("modals.deleteDrive.inputPlaceholder"),cancelLabel:s("common.cancel"),continueLabel:s("common.delete"),onContinue:()=>i(n),onOpenChange:o=>{if(!o)return n()}})},ine=t=>{const{t:e}=nc(),{uiNode:n,open:r,onClose:i,onDelete:s}=t,{kind:o,name:a}=n;return P(D4,{open:r,onDelete:()=>s(i),onCancel:()=>i(),header:e(`modals.deleteItem.${o.toLowerCase()}.header`,{item:a}),body:e(`modals.deleteItem.${o.toLowerCase()}.body`),cancelLabel:e("common.cancel"),deleteLabel:e("common.delete")})},sne=t=>{const{open:e,onClose:n}=t,{t:r}=nc();return P(TO,{open:e,header:r("modals.disclaimer.title"),body:r("modals.disclaimer.body"),closeLabel:"Close",onContinue:()=>n()})};function one(t){const{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onClose:a}=t;return P(R4,{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onOpenChange:c=>{if(!c)return a()}})}async function ane(t){const e=await b0();e?e.send("studio:add-external-package",{name:t}):console.error("HMR not available.")}async function cne(){const t=await b0();t&&t.on("studio:external-package-added",e=>{console.log("External package added:",e)})}cne().catch(console.error);function une(){const[t,e]=We(""),n=cte();return Ee("div",{children:[Ee("label",{htmlFor:"add-external-package",className:"bg-gray-50 text-sm",children:["Add External Package:",P("input",{className:"border border-slate-50",name:"add-external-package",value:t,onChange:r=>e(r.target.value)})]}),P("button",{onClick:()=>ane(t),children:"Add"}),P("ul",{children:n.map((r,i)=>P("li",{children:r.documentModels.map(s=>s.documentModel.id).join(", ")},i))})]})}const lne="defaultDocumentModelEditor",dne=Sf(lne,{label:"V2",value:"document-model-editor-v2"}),fne=()=>Ni(dne),hne=t=>Y.createElement("svg",{width:126,height:24,viewBox:"0 0 126 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},Y.createElement("g",{id:"Group 1000003373"},Y.createElement("path",{id:"Vector",d:"M11.8372 0.488748C10.2978 5.70206 6.19289 9.81182 0.98589 11.3469C0.332828 11.5409 0.332828 12.4591 0.98589 12.6531C6.18997 14.1882 10.2978 18.2979 11.8372 23.5113C12.0296 24.1629 12.9597 24.1629 13.155 23.5113C14.6943 18.2979 18.7993 14.1882 24.0063 12.6531C24.6594 12.4591 24.6594 11.5409 24.0063 11.3469C18.8022 9.81182 14.6943 5.70206 13.155 0.488748C12.9626 -0.162916 12.0325 -0.162916 11.8372 0.488748Z",fill:"inherit"}),Y.createElement("g",{id:"Renown"},Y.createElement("path",{d:"M42.6238 2.65186C44.3678 2.65186 45.6958 3.05186 46.6078 3.85186C47.5198 4.63586 47.9758 5.65985 47.9758 6.92385C47.9758 7.29185 47.9438 7.63586 47.8798 7.95586C47.6878 9.07586 47.1998 10.0759 46.4158 10.9559C45.6318 11.8359 44.5838 12.4599 43.2718 12.8279L45.9838 19.4999H41.3518L38.9758 13.1399H37.9918L36.8638 19.4999H32.7598L35.7358 2.65186H42.6238ZM43.6798 8.12385C43.7118 7.86786 43.7278 7.69986 43.7278 7.61985C43.7278 7.10786 43.5598 6.71586 43.2238 6.44386C42.9038 6.15586 42.4238 6.01186 41.7838 6.01186H39.2398L38.4958 10.2359H41.0398C41.7918 10.2359 42.3838 10.0519 42.8158 9.68386C43.2638 9.31586 43.5518 8.79586 43.6798 8.12385Z",fill:"inherit"}),Y.createElement("path",{d:"M55.808 5.91585C57.536 5.91585 58.904 6.38785 59.912 7.33185C60.936 8.25985 61.448 9.53186 61.448 11.1479C61.448 11.6759 61.408 12.1479 61.328 12.5639C61.264 12.9319 61.168 13.3239 61.04 13.7399H51.752C51.736 13.8359 51.728 13.9879 51.728 14.1959C51.728 14.8999 51.92 15.4359 52.304 15.8039C52.688 16.1719 53.2 16.3559 53.84 16.3559C54.864 16.3559 55.648 15.9239 56.192 15.0599H60.56C59.984 16.4199 59.048 17.5319 57.752 18.3959C56.456 19.2599 55 19.6919 53.384 19.6919C51.656 19.6919 50.272 19.2119 49.232 18.2519C48.208 17.2919 47.696 15.9879 47.696 14.3399C47.696 13.8439 47.744 13.3319 47.84 12.8039C48.08 11.4119 48.576 10.1959 49.328 9.15586C50.08 8.11586 51.016 7.31586 52.136 6.75586C53.256 6.19586 54.48 5.91585 55.808 5.91585ZM57.296 11.6519C57.328 11.4279 57.344 11.2759 57.344 11.1959C57.344 10.5559 57.144 10.0679 56.744 9.73186C56.344 9.37986 55.816 9.20386 55.16 9.20386C54.456 9.20386 53.832 9.41986 53.288 9.85186C52.76 10.2679 52.376 10.8679 52.136 11.6519H57.296Z",fill:"inherit"}),Y.createElement("path",{d:"M71.8211 5.96386C73.1651 5.96386 74.2211 6.33986 74.9891 7.09186C75.7571 7.84385 76.1411 8.89186 76.1411 10.2359C76.1411 10.6839 76.0931 11.1639 75.9971 11.6759L74.6051 19.4999H70.5251L71.8211 12.2279C71.8691 11.9559 71.8931 11.7159 71.8931 11.5079C71.8931 10.8359 71.7011 10.3159 71.3171 9.94785C70.9491 9.57985 70.4291 9.39585 69.7571 9.39585C68.9571 9.39585 68.2851 9.64386 67.7411 10.1399C67.1971 10.6359 66.8451 11.3319 66.6851 12.2279V12.1079L65.3891 19.4999H61.2851L63.6371 6.10786H67.7411L67.4291 7.90786C67.9571 7.31586 68.5971 6.84385 69.3491 6.49185C70.1171 6.13986 70.9411 5.96386 71.8211 5.96386Z",fill:"inherit"}),Y.createElement("path",{d:"M82.617 19.6919C81.465 19.6919 80.441 19.4599 79.545 18.9959C78.649 18.5319 77.9529 17.8759 77.457 17.0279C76.977 16.1799 76.737 15.1959 76.737 14.0759C76.737 12.5559 77.097 11.1719 77.817 9.92386C78.537 8.67586 79.529 7.69986 80.793 6.99586C82.057 6.27586 83.465 5.91585 85.017 5.91585C86.169 5.91585 87.193 6.15586 88.089 6.63586C89.0009 7.09986 89.7049 7.75586 90.201 8.60386C90.697 9.45186 90.945 10.4359 90.945 11.5559C90.945 13.0919 90.577 14.4839 89.841 15.7319C89.121 16.9639 88.121 17.9319 86.841 18.6359C85.577 19.3399 84.169 19.6919 82.617 19.6919ZM83.193 16.1639C83.865 16.1639 84.465 15.9639 84.993 15.5639C85.5369 15.1479 85.9529 14.6199 86.241 13.9799C86.545 13.3239 86.697 12.6439 86.697 11.9399C86.697 11.1399 86.481 10.5239 86.049 10.0919C85.617 9.65985 85.073 9.44386 84.417 9.44386C83.729 9.44386 83.121 9.65186 82.593 10.0679C82.081 10.4679 81.681 10.9959 81.393 11.6519C81.105 12.3079 80.961 12.9959 80.961 13.7159C80.961 14.4999 81.169 15.1079 81.585 15.5399C82.001 15.9559 82.5369 16.1639 83.193 16.1639Z",fill:"inherit"}),Y.createElement("path",{d:"M112.418 6.10786L106.418 19.4999H101.882L101.306 10.8119L97.5862 19.4999H93.0742L91.8022 6.10786H95.9062L96.0982 15.6839L100.058 6.10786H104.402L105.002 15.6839L108.554 6.10786H112.418Z",fill:"inherit"}),Y.createElement("path",{d:"M121.183 5.96386C122.527 5.96386 123.583 6.33986 124.351 7.09186C125.119 7.84385 125.503 8.89186 125.503 10.2359C125.503 10.6839 125.455 11.1639 125.359 11.6759L123.967 19.4999H119.887L121.183 12.2279C121.231 11.9559 121.255 11.7159 121.255 11.5079C121.255 10.8359 121.063 10.3159 120.679 9.94785C120.311 9.57985 119.791 9.39585 119.119 9.39585C118.319 9.39585 117.647 9.64386 117.103 10.1399C116.559 10.6359 116.207 11.3319 116.047 12.2279V12.1079L114.751 19.4999H110.647L112.999 6.10786H117.103L116.791 7.90786C117.319 7.31586 117.959 6.84385 118.711 6.49185C119.479 6.13986 120.303 5.96386 121.183 5.96386Z",fill:"inherit"})))),pne=()=>{const[t,e]=We(0);return Dt(()=>{const n=setInterval(()=>{e(r=>r===3?0:r+1)},200);return()=>{clearInterval(n)}},[]),P("span",{children:new Array(t).fill(".").join("")})},mne=()=>{const t=kg(),{openRenown:e,status:n}=E0();return P("div",{children:n==="checking"?Ee("h2",{className:"px-4 py-5 text-center text-xl font-medium",children:[P("span",{children:"Checking Authorization"}),P("span",{className:"inline-block w-5 text-left",children:P(pne,{})})]}):n!=="authorized"?Ee("div",{className:"flex flex-col items-center",children:[P("h2",{className:"mb-1 text-2xl font-semibold",children:"Log in with"}),P(hne,{className:"mb-3"}),P("p",{className:"mb-5 text-center text-lg leading-6",children:"Click on the button below to start signing messages in Connect on behalf of your Ethereum identity"}),P(zn,{onClick:()=>e(),className:"mb-3 w-full p-0 text-white shadow-none transition-colors",children:P("p",{className:"block h-10 px-7 leading-10 text-slate-50",children:"Authorize Connect"})})]}):Ee("p",{className:"p-4 pb-5",children:["Logged in with address: ",t==null?void 0:t.address]})})},bT=t=>t.map(e=>({label:e.documentModel.name,value:e.documentModel.id})),gne=t=>{const{open:e,onClose:n,onRefresh:r}=t,{clearStorage:i}=S0(),{t:s}=nc(),o=_te(),a=mte(),{setConfig:c}=VA(),{showModal:u}=KA(),[l]=x0(),[d,f]=fne(),[h,m]=We(bT(o)),{logout:p,status:g}=E0(),y=kg(),v=()=>{c(E=>({...E,editors:{enabledEditors:h.map(w=>w.value)}})),n()},b=()=>{u("confirmationModal",{title:s("modals.connectSettings.clearStorage.confirmation.title"),body:s("modals.connectSettings.clearStorage.confirmation.body"),cancelLabel:s("common.cancel"),continueLabel:s("modals.connectSettings.clearStorage.confirmation.clearButton"),onContinue:()=>{i().then(()=>{r()}).catch(Hn.error)},onCancel:()=>u("settingsModal",{onRefresh:r})})};return Ee(f6,{open:e,title:s("modals.connectSettings.title"),body:s("modals.connectSettings.body"),cancelLabel:s("common.cancel"),saveLabel:s("common.save"),onSave:v,onOpenChange:E=>{if(!E)return n()},children:[P("div",{className:"rounded border border-gray-400 p-4",children:g==="authorized"?Ee(Us,{children:[Ee("p",{children:["Logged in with address:"," ",P("span",{className:"text-sm font-semibold",children:y==null?void 0:y.address})]}),P(zn,{className:"mt-2 w-full",onClick:p,children:"Logout"})]}):P(mne,{})}),P(une,{}),l.content.showDocumentModelSelectionSetting&&P(d6,{selected:h,onChange:E=>m(E),options:bT(a),title:s("modals.connectSettings.enabledDocumentTypes.title"),description:s("modals.connectSettings.enabledDocumentTypes.description"),selectProps:{overrideStrings:{allItemsAreSelected:s("modals.connectSettings.enabledDocumentTypes.allSelected")}}}),P(A4,{onClearStorage:b,buttonLabel:s("modals.connectSettings.clearStorage.button"),description:s("modals.connectSettings.clearStorage.description")}),Ee("div",{children:[P("label",{htmlFor:"default-document-model-editor",className:"text-sm",children:"Default Document Model Editor:"}),P(wl,{id:"default-document-model-editor",value:d,onChange:E=>f(E),options:[{label:"V1",value:"document-model-editor"},{label:"V2",value:"document-model-editor-v2"}]})]}),P(zB,{packageJson:TP})]})},yne=t=>{const{open:e,onClose:n,driveId:r}=t,{t:i}=nc();return P(h6,{open:e,onContinue:()=>{console.log("Upgrade drive: ",r),n()},header:i("modals.upgradeDrive.header"),body:i("modals.upgradeDrive.body"),cancelLabel:i("common.cancel"),continueLabel:i("common.continue"),onOpenChange:o=>{if(!o)return n()}})},vne={deleteItem:ine,upgradeDrive:yne,createDocument:Kte,addLocalDrive:V9,addRemoteDrive:TH,driveSettings:one,settingsModal:gne,confirmationModal:IH,deleteDriveModal:rne,debugSettingsModal:nne,disclaimerModal:sne,cookiesPolicy:OH},YA=$e.createContext({showModal:()=>{},closeModal:()=>{}}),KA=()=>Yo(YA),bne=t=>{const{children:e}=t,[n,r]=We(),[i,s]=We(),[o,a]=We(!1),c=He((f,h)=>{a(!0),r(h),s(f)},[]),u=He(()=>{a(!1)},[]),l=i?vne[i]:null,d=Pn(()=>({showModal:c,closeModal:u}),[u,c]);return Ee(YA.Provider,{value:d,children:[e,l&&P(l,{...n,open:o,onClose:u})]})},_ne=(t,e)=>t.some(n=>n.id===e&&n.value),wne=()=>{const{t}=nc(),{showModal:e}=KA(),[n,r]=z9(),[,i]=X_(),s=[{id:"analytics-cookie",label:t("cookieBanner.cookies.analytics"),value:!0}],o=c=>{r(!1),_ne(c,"analytics-cookie")&&i(u=>({...u,analytics:!0}))},a=()=>{r(!1),i({analytics:!1,functional:!1,marketing:!1})};return n?Ee("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[P("div",{className:"absolute inset-0 bg-black opacity-15"}),P("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:P(hj,{className:"max-w-[1024px] ",cookies:s,onSubmit:o,onReject:a,submitLabel:t("cookieBanner.accept"),rejectLabel:t("cookieBanner.reject"),children:P("p",{className:"font-semibold text-gray-500",children:P(XT,{i18nKey:"cookieBanner.message",components:{a:P("a",{onClick:()=>e("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"})}})})})})]}):null};var Ene=Object.defineProperty,Sne=Object.getOwnPropertyDescriptor,gs=(t,e,n,r)=>{for(var i=Sne(e,n),s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=o(e,n,i)||i);return i&&Ene(e,n,i),i};function ys(t,e,n){const r=n.value;n.value=function(...i){if(!this.server)throw new Error("Read mode document drive not initialized.");return r.apply(this,i)}}function xne(t){const e=Object.getPrototypeOf(t);Object.getOwnPropertyNames(e).forEach(r=>{const i=Object.getOwnPropertyDescriptor(e,r);i&&typeof i.value=="function"&&r!=="constructor"&&(t[r]=t[r].bind(t))})}class Fi{constructor(e){Ve(this,"server");xne(this),this.server=e}getServer(){return this.server}setDocumentDrive(e){this.server=e}migrateReadDrive(e,n){return this.server.migrateReadDrive(e,n)}addReadDrive(e,n){return this.server.addReadDrive(e,n)}getReadDrives(){return this.server.getReadDrives()}getReadDriveBySlug(e){return this.server.getReadDriveBySlug(e)}getReadDrive(e){return this.server.getReadDrive(e)}getReadDriveContext(e){return this.server.getReadDriveContext(e)}fetchDrive(e){return this.server.fetchDrive(e)}fetchDocument(e,n,r){return this.server.fetchDocument(e,n,r)}deleteReadDrive(e){return this.server.deleteReadDrive(e)}onReadDrivesUpdate(e){return this.server.onReadDrivesUpdate(e)}}gs([ys],Fi.prototype,"migrateReadDrive");gs([ys],Fi.prototype,"addReadDrive");gs([ys],Fi.prototype,"getReadDrives");gs([ys],Fi.prototype,"getReadDriveBySlug");gs([ys],Fi.prototype,"getReadDrive");gs([ys],Fi.prototype,"getReadDriveContext");gs([ys],Fi.prototype,"fetchDrive");gs([ys],Fi.prototype,"fetchDocument");gs([ys],Fi.prototype,"deleteReadDrive");gs([ys],Fi.prototype,"onReadDrivesUpdate");const Lc=new Fi,JA=Fu({...Lc,readDrives:[]});async function Tne(t){const e=await t.getReadDrives();return(await Promise.all(e.map(r=>t.getReadDrive(r)))).filter(r=>!(r instanceof ca))}const Ine=t=>{const e=Cte(),[n,r]=We([]),i=ZA(),[s,o]=We(!1);Dt(()=>{e&&(Lc.setDocumentDrive(e),o(!0))},[e]);const a=i===void 0?void 0:!(i.isAllowedToCreateDocuments||i.isAllowedToEditDocuments);Pn(()=>{if(!s||a===void 0)return;const u=a?"READ":"WRITE",l=Lc.getServer();l&&typeof l.setAllDefaultDrivesAccessLevel=="function"&&l.setAllDefaultDrivesAccessLevel(u).catch(Hn.error)},[a,s]),Dt(()=>{if(!s)return;Tne(Lc).then(l=>r(l)).catch(Hn.error);const u=Lc.onReadDrivesUpdate(l=>{r(d=>d.length!==l.length||bm(d)!==bm(l)?l:d)}).catch(Hn.error);return()=>{u.then(l=>l==null?void 0:l()).catch(Hn.error)}},[s]);const c=Pn(()=>({...Lc,readDrives:n}),[n]);return P(JA.Provider,{...t,value:c})},Tse=()=>Yo(JA);/**
|
|
430
|
-
* @remix-run/router v1.22.0
|
|
431
|
-
*
|
|
432
|
-
* Copyright (c) Remix Software Inc.
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the MIT license found in the
|
|
435
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
436
|
-
*
|
|
437
|
-
* @license MIT
|
|
438
|
-
*/function pn(){return pn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pn.apply(this,arguments)}var hn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(hn||(hn={}));const _T="popstate";function One(t){t===void 0&&(t={});let{initialEntries:e=["/"],initialIndex:n,v5Compat:r=!1}=t,i;i=e.map((h,m)=>l(h,typeof h=="string"?null:h.state,m===0?"default":void 0));let s=c(n??i.length-1),o=hn.Pop,a=null;function c(h){return Math.min(Math.max(h,0),i.length-1)}function u(){return i[s]}function l(h,m,p){m===void 0&&(m=null);let g=Lu(i?u().pathname:"/",h,m,p);return Xa(g.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(h)),g}function d(h){return typeof h=="string"?h:nl(h)}return{get index(){return s},get action(){return o},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let m=typeof h=="string"?Qs(h):h;return{pathname:m.pathname||"",search:m.search||"",hash:m.hash||""}},push(h,m){o=hn.Push;let p=l(h,m);s+=1,i.splice(s,i.length,p),r&&a&&a({action:o,location:p,delta:1})},replace(h,m){o=hn.Replace;let p=l(h,m);i[s]=p,r&&a&&a({action:o,location:p,delta:0})},go(h){o=hn.Pop;let m=c(s+h),p=i[m];s=m,a&&a({action:o,location:p,delta:h})},listen(h){return a=h,()=>{a=null}}}}function Ise(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return Lu("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:nl(i)}return kne(e,n,null,t)}function kt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Xa(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Cne(){return Math.random().toString(36).substr(2,8)}function wT(t,e){return{usr:t.state,key:t.key,idx:e}}function Lu(t,e,n,r){return n===void 0&&(n=null),pn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Qs(e):e,{state:n,key:e&&e.key||r||Cne()})}function nl(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Qs(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function kne(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=hn.Pop,c=null,u=l();u==null&&(u=0,o.replaceState(pn({},o.state,{idx:u}),""));function l(){return(o.state||{idx:null}).idx}function d(){a=hn.Pop;let g=l(),y=g==null?null:g-u;u=g,c&&c({action:a,location:p.location,delta:y})}function f(g,y){a=hn.Push;let v=Lu(p.location,g,y);u=l()+1;let b=wT(v,u),E=p.createHref(v);try{o.pushState(b,"",E)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(E)}s&&c&&c({action:a,location:p.location,delta:1})}function h(g,y){a=hn.Replace;let v=Lu(p.location,g,y);u=l();let b=wT(v,u),E=p.createHref(v);o.replaceState(b,"",E),s&&c&&c({action:a,location:p.location,delta:0})}function m(g){let y=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof g=="string"?g:nl(g);return v=v.replace(/ $/,"%20"),kt(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let p={get action(){return a},get location(){return t(i,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(_T,d),c=g,()=>{i.removeEventListener(_T,d),c=null}},createHref(g){return e(i,g)},createURL:m,encodeLocation(g){let y=m(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:h,go(g){return o.go(g)}};return p}var Kt;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Kt||(Kt={}));const Dne=new Set(["lazy","caseSensitive","path","id","index","children"]);function Rne(t){return t.index===!0}function _m(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,s)=>{let o=[...n,String(s)],a=typeof i.id=="string"?i.id:o.join("-");if(kt(i.index!==!0||!i.children,"Cannot specify children on an index route"),kt(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),Rne(i)){let c=pn({},i,e(i),{id:a});return r[a]=c,c}else{let c=pn({},i,e(i),{id:a,children:void 0});return r[a]=c,i.children&&(c.children=_m(i.children,e,o,r)),c}})}function wo(t,e,n){return n===void 0&&(n="/"),sp(t,e,n,!1)}function sp(t,e,n,r){let i=typeof e=="string"?Qs(e):e,s=$f(i.pathname||"/",n);if(s==null)return null;let o=XA(t);Ane(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let u=Hne(s);a=zne(o[c],u,r)}return a}function Nne(t,e){let{route:n,pathname:r,params:i}=t;return{id:n.id,pathname:r,params:i,data:e[n.id],handle:n.handle}}function XA(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(kt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Po([r,c.relativePath]),l=n.concat(c);s.children&&s.children.length>0&&(kt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),XA(s.children,e,l,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:Une(u,s.index),routesMeta:l})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of QA(s.path))i(s,o,c)}),e}function QA(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=QA(r.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function Ane(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:Bne(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Pne=/^:[\w-]+$/,Mne=3,Lne=2,Fne=1,$ne=10,jne=-2,ET=t=>t==="*";function Une(t,e){let n=t.split("/"),r=n.length;return n.some(ET)&&(r+=jne),e&&(r+=Lne),n.filter(i=>!ET(i)).reduce((i,s)=>i+(Pne.test(s)?Mne:s===""?Fne:$ne),r)}function Bne(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function zne(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],u=a===r.length-1,l=s==="/"?e:e.slice(s.length)||"/",d=ST({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},l),f=c.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=ST({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Po([s,d.pathname]),pathnameBase:Gne(Po([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=Po([s,d.pathnameBase]))}return o}function ST(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=Vne(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,l,d)=>{let{paramName:f,isOptional:h}=l;if(f==="*"){let p=a[d]||"";o=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}const m=a[d];return h&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:t}}function Vne(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Xa(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function Hne(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Xa(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function $f(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function Wne(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Qs(t):t;return{pathname:n?n.startsWith("/")?n:qne(n,e):e,search:Zne(r),hash:Yne(i)}}function qne(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function qy(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function eP(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function tP(t,e){let n=eP(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function nP(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Qs(t):(i=pn({},t),kt(!i.pathname||!i.pathname.includes("?"),qy("?","pathname","search",i)),kt(!i.pathname||!i.pathname.includes("#"),qy("#","pathname","hash",i)),kt(!i.search||!i.search.includes("#"),qy("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?e[d]:"/"}let c=Wne(i,a),u=o&&o!=="/"&&o.endsWith("/"),l=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||l)&&(c.pathname+="/"),c}const Po=t=>t.join("/").replace(/\/\/+/g,"/"),Gne=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Zne=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Yne=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Ab{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function cf(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const rP=["post","put","patch","delete"],Kne=new Set(rP),Jne=["get",...rP],Xne=new Set(Jne),Qne=new Set([301,302,303,307,308]),ere=new Set([307,308]),Gy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tre={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},T0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nre=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),iP="remix-router-transitions";function rre(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;kt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let te=t.detectErrorBoundary;i=se=>({hasErrorBoundary:te(se)})}else i=nre;let s={},o=_m(t.routes,i,void 0,s),a,c=t.basename||"/",u=t.dataStrategy||are,l=t.patchRoutesOnNavigation,d=pn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),f=null,h=new Set,m=null,p=null,g=null,y=t.hydrationData!=null,v=wo(o,t.history.location,c),b=!1,E=null;if(v==null&&!l){let te=Sr(404,{pathname:t.history.location.pathname}),{matches:se,route:ue}=PT(o);v=se,E={[ue.id]:te}}v&&!t.hydrationData&&mc(v,o,t.history.location.pathname).active&&(v=null);let w;if(v)if(v.some(te=>te.route.lazy))w=!1;else if(!v.some(te=>te.route.loader))w=!0;else if(d.v7_partialHydration){let te=t.hydrationData?t.hydrationData.loaderData:null,se=t.hydrationData?t.hydrationData.errors:null;if(se){let ue=v.findIndex(_e=>se[_e.route.id]!==void 0);w=v.slice(0,ue+1).every(_e=>!Mb(_e.route,te,se))}else w=v.every(ue=>!Mb(ue.route,te,se))}else w=t.hydrationData!=null;else if(w=!1,v=[],d.v7_partialHydration){let te=mc(null,o,t.history.location.pathname);te.active&&te.matches&&(b=!0,v=te.matches)}let x,_={historyAction:t.history.action,location:t.history.location,matches:v,initialized:w,navigation:Gy,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||E,fetchers:new Map,blockers:new Map},k=hn.Pop,R=!1,F,V=!1,T=new Map,L=null,S=!1,C=!1,N=[],U=new Set,K=new Map,$=0,q=-1,j=new Map,D=new Set,X=new Map,Z=new Map,z=new Set,le=new Map,pe=new Map,ve;function je(){if(f=t.history.listen(te=>{let{action:se,location:ue,delta:_e}=te;if(ve){ve(),ve=void 0;return}Xa(pe.size===0||_e!=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.");let Pe=Ar({currentLocation:_.location,nextLocation:ue,historyAction:se});if(Pe&&_e!=null){let Ke=new Promise(ft=>{ve=ft});t.history.go(_e*-1),to(Pe,{state:"blocked",location:ue,proceed(){to(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:ue}),Ke.then(()=>t.history.go(_e))},reset(){let ft=new Map(_.blockers);ft.set(Pe,vl),Ye({blockers:ft})}});return}return ae(se,ue)}),n){wre(e,T);let te=()=>Ere(e,T);e.addEventListener("pagehide",te),L=()=>e.removeEventListener("pagehide",te)}return _.initialized||ae(hn.Pop,_.location,{initialHydration:!0}),x}function ct(){f&&f(),L&&L(),h.clear(),F&&F.abort(),_.fetchers.forEach((te,se)=>vn(se)),_.blockers.forEach((te,se)=>ea(se))}function ut(te){return h.add(te),()=>h.delete(te)}function Ye(te,se){se===void 0&&(se={}),_=pn({},_,te);let ue=[],_e=[];d.v7_fetcherPersist&&_.fetchers.forEach((Pe,Ke)=>{Pe.state==="idle"&&(z.has(Ke)?_e.push(Ke):ue.push(Ke))}),z.forEach(Pe=>{!_.fetchers.has(Pe)&&!K.has(Pe)&&_e.push(Pe)}),[...h].forEach(Pe=>Pe(_,{deletedFetchers:_e,viewTransitionOpts:se.viewTransitionOpts,flushSync:se.flushSync===!0})),d.v7_fetcherPersist?(ue.forEach(Pe=>_.fetchers.delete(Pe)),_e.forEach(Pe=>vn(Pe))):_e.forEach(Pe=>z.delete(Pe))}function Ot(te,se,ue){var _e,Pe;let{flushSync:Ke}=ue===void 0?{}:ue,ft=_.actionData!=null&&_.navigation.formMethod!=null&&gi(_.navigation.formMethod)&&_.navigation.state==="loading"&&((_e=te.state)==null?void 0:_e._isRedirect)!==!0,Ue;se.actionData?Object.keys(se.actionData).length>0?Ue=se.actionData:Ue=null:ft?Ue=_.actionData:Ue=null;let Be=se.loaderData?NT(_.loaderData,se.loaderData,se.matches||[],se.errors):_.loaderData,Fe=_.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((Nt,Mn)=>Fe.set(Mn,vl)));let Je=R===!0||_.navigation.formMethod!=null&&gi(_.navigation.formMethod)&&((Pe=te.state)==null?void 0:Pe._isRedirect)!==!0;a&&(o=a,a=void 0),S||k===hn.Pop||(k===hn.Push?t.history.push(te,te.state):k===hn.Replace&&t.history.replace(te,te.state));let St;if(k===hn.Pop){let Nt=T.get(_.location.pathname);Nt&&Nt.has(te.pathname)?St={currentLocation:_.location,nextLocation:te}:T.has(te.pathname)&&(St={currentLocation:te,nextLocation:_.location})}else if(V){let Nt=T.get(_.location.pathname);Nt?Nt.add(te.pathname):(Nt=new Set([te.pathname]),T.set(_.location.pathname,Nt)),St={currentLocation:_.location,nextLocation:te}}Ye(pn({},se,{actionData:Ue,loaderData:Be,historyAction:k,location:te,initialized:!0,navigation:Gy,revalidation:"idle",restoreScrollPosition:Uf(te,se.matches||_.matches),preventScrollReset:Je,blockers:Fe}),{viewTransitionOpts:St,flushSync:Ke===!0}),k=hn.Pop,R=!1,V=!1,S=!1,C=!1,N=[]}async function O(te,se){if(typeof te=="number"){t.history.go(te);return}let ue=Pb(_.location,_.matches,c,d.v7_prependBasename,te,d.v7_relativeSplatPath,se==null?void 0:se.fromRouteId,se==null?void 0:se.relative),{path:_e,submission:Pe,error:Ke}=xT(d.v7_normalizeFormMethod,!1,ue,se),ft=_.location,Ue=Lu(_.location,_e,se&&se.state);Ue=pn({},Ue,t.history.encodeLocation(Ue));let Be=se&&se.replace!=null?se.replace:void 0,Fe=hn.Push;Be===!0?Fe=hn.Replace:Be===!1||Pe!=null&&gi(Pe.formMethod)&&Pe.formAction===_.location.pathname+_.location.search&&(Fe=hn.Replace);let Je=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,St=(se&&se.flushSync)===!0,Nt=Ar({currentLocation:ft,nextLocation:Ue,historyAction:Fe});if(Nt){to(Nt,{state:"blocked",location:Ue,proceed(){to(Nt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),O(te,se)},reset(){let Mn=new Map(_.blockers);Mn.set(Nt,vl),Ye({blockers:Mn})}});return}return await ae(Fe,Ue,{submission:Pe,pendingError:Ke,preventScrollReset:Je,replace:se&&se.replace,enableViewTransition:se&&se.viewTransition,flushSync:St})}function he(){if(rt(),Ye({revalidation:"loading"}),_.navigation.state!=="submitting"){if(_.navigation.state==="idle"){ae(_.historyAction,_.location,{startUninterruptedRevalidation:!0});return}ae(k||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:V===!0})}}async function ae(te,se,ue){F&&F.abort(),F=null,k=te,S=(ue&&ue.startUninterruptedRevalidation)===!0,Ag(_.location,_.matches),R=(ue&&ue.preventScrollReset)===!0,V=(ue&&ue.enableViewTransition)===!0;let _e=a||o,Pe=ue&&ue.overrideNavigation,Ke=ue!=null&&ue.initialHydration&&_.matches&&_.matches.length>0&&!b?_.matches:wo(_e,se,c),ft=(ue&&ue.flushSync)===!0,Ue=mc(Ke,_e,se.pathname);if(Ue.active&&Ue.matches&&(Ke=Ue.matches),!Ke){let{error:en,notFoundMatches:zt,route:dn}=no(se.pathname);Ot(se,{matches:zt,loaderData:{},errors:{[dn.id]:en}},{flushSync:ft});return}if(_.initialized&&!C&&hre(_.location,se)&&!(ue&&ue.submission&&gi(ue.submission.formMethod))){Ot(se,{matches:Ke},{flushSync:ft});return}F=new AbortController;let Be=kc(t.history,se,F.signal,ue&&ue.submission),Fe;if(ue&&ue.pendingError)Fe=[la(Ke).route.id,{type:Kt.error,error:ue.pendingError}];else if(ue&&ue.submission&&gi(ue.submission.formMethod)){let en=await W(Be,se,ue.submission,Ke,Ue.active,{replace:ue.replace,flushSync:ft});if(en.shortCircuited)return;if(en.pendingActionResult){let[zt,dn]=en.pendingActionResult;if(Pr(dn)&&cf(dn.error)&&dn.error.status===404){F=null,Ot(se,{matches:en.matches,loaderData:{},errors:{[zt]:dn.error}});return}}Ke=en.matches||Ke,Fe=en.pendingActionResult,Pe=Zy(se,ue.submission),ft=!1,Ue.active=!1,Be=kc(t.history,Be.url,Be.signal)}let{shortCircuited:Je,matches:St,loaderData:Nt,errors:Mn}=await I(Be,se,Ke,Ue.active,Pe,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,ft,Fe);Je||(F=null,Ot(se,pn({matches:St||Ke},AT(Fe),{loaderData:Nt,errors:Mn})))}async function W(te,se,ue,_e,Pe,Ke){Ke===void 0&&(Ke={}),rt();let ft=bre(se,ue);if(Ye({navigation:ft},{flushSync:Ke.flushSync===!0}),Pe){let Fe=await gc(_e,se.pathname,te.signal);if(Fe.type==="aborted")return{shortCircuited:!0};if(Fe.type==="error"){let Je=la(Fe.partialMatches).route.id;return{matches:Fe.partialMatches,pendingActionResult:[Je,{type:Kt.error,error:Fe.error}]}}else if(Fe.matches)_e=Fe.matches;else{let{notFoundMatches:Je,error:St,route:Nt}=no(se.pathname);return{matches:Je,pendingActionResult:[Nt.id,{type:Kt.error,error:St}]}}}let Ue,Be=Ll(_e,se);if(!Be.route.action&&!Be.route.lazy)Ue={type:Kt.error,error:Sr(405,{method:te.method,pathname:se.pathname,routeId:Be.route.id})};else if(Ue=(await fe("action",_,te,[Be],_e,null))[Be.route.id],te.signal.aborted)return{shortCircuited:!0};if(va(Ue)){let Fe;return Ke&&Ke.replace!=null?Fe=Ke.replace:Fe=kT(Ue.response.headers.get("Location"),new URL(te.url),c)===_.location.pathname+_.location.search,await de(te,Ue,!0,{submission:ue,replace:Fe}),{shortCircuited:!0}}if(ko(Ue))throw Sr(400,{type:"defer-action"});if(Pr(Ue)){let Fe=la(_e,Be.route.id);return(Ke&&Ke.replace)!==!0&&(k=hn.Push),{matches:_e,pendingActionResult:[Fe.route.id,Ue]}}return{matches:_e,pendingActionResult:[Be.route.id,Ue]}}async function I(te,se,ue,_e,Pe,Ke,ft,Ue,Be,Fe,Je){let St=Pe||Zy(se,Ke),Nt=Ke||ft||LT(St),Mn=!S&&(!d.v7_partialHydration||!Be);if(_e){if(Mn){let fn=A(Je);Ye(pn({navigation:St},fn!==void 0?{actionData:fn}:{}),{flushSync:Fe})}let Ft=await gc(ue,se.pathname,te.signal);if(Ft.type==="aborted")return{shortCircuited:!0};if(Ft.type==="error"){let fn=la(Ft.partialMatches).route.id;return{matches:Ft.partialMatches,loaderData:{},errors:{[fn]:Ft.error}}}else if(Ft.matches)ue=Ft.matches;else{let{error:fn,notFoundMatches:$i,route:na}=no(se.pathname);return{matches:$i,loaderData:{},errors:{[na.id]:fn}}}}let en=a||o,[zt,dn]=IT(t.history,_,ue,Nt,se,d.v7_partialHydration&&Be===!0,d.v7_skipActionErrorRevalidation,C,N,U,z,X,D,en,c,Je);if(ci(Ft=>!(ue&&ue.some(fn=>fn.route.id===Ft))||zt&&zt.some(fn=>fn.route.id===Ft)),q=++$,zt.length===0&&dn.length===0){let Ft=ai();return Ot(se,pn({matches:ue,loaderData:{},errors:Je&&Pr(Je[1])?{[Je[0]]:Je[1].error}:null},AT(Je),Ft?{fetchers:new Map(_.fetchers)}:{}),{flushSync:Fe}),{shortCircuited:!0}}if(Mn){let Ft={};if(!_e){Ft.navigation=St;let fn=A(Je);fn!==void 0&&(Ft.actionData=fn)}dn.length>0&&(Ft.fetchers=G(dn)),Ye(Ft,{flushSync:Fe})}dn.forEach(Ft=>{Rt(Ft.key),Ft.controller&&K.set(Ft.key,Ft.controller)});let ro=()=>dn.forEach(Ft=>Rt(Ft.key));F&&F.signal.addEventListener("abort",ro);let{loaderResults:ta,fetcherResults:Yr}=await De(_,ue,zt,dn,te);if(te.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",ro),dn.forEach(Ft=>K.delete(Ft.key));let er=Nh(ta);if(er)return await de(te,er.result,!0,{replace:Ue}),{shortCircuited:!0};if(er=Nh(Yr),er)return D.add(er.key),await de(te,er.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:yc,errors:Kr}=RT(_,ue,ta,Je,dn,Yr,le);le.forEach((Ft,fn)=>{Ft.subscribe($i=>{($i||Ft.done)&&le.delete(fn)})}),d.v7_partialHydration&&Be&&_.errors&&(Kr=pn({},_.errors,Kr));let bs=ai(),_s=_r(q),io=bs||_s||dn.length>0;return pn({matches:ue,loaderData:yc,errors:Kr},io?{fetchers:new Map(_.fetchers)}:{})}function A(te){if(te&&!Pr(te[1]))return{[te[0]]:te[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function G(te){return te.forEach(se=>{let ue=_.fetchers.get(se.key),_e=bl(void 0,ue?ue.data:void 0);_.fetchers.set(se.key,_e)}),new Map(_.fetchers)}function Q(te,se,ue,_e){if(r)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.");Rt(te);let Pe=(_e&&_e.flushSync)===!0,Ke=a||o,ft=Pb(_.location,_.matches,c,d.v7_prependBasename,ue,d.v7_relativeSplatPath,se,_e==null?void 0:_e.relative),Ue=wo(Ke,ft,c),Be=mc(Ue,Ke,ft);if(Be.active&&Be.matches&&(Ue=Be.matches),!Ue){tn(te,se,Sr(404,{pathname:ft}),{flushSync:Pe});return}let{path:Fe,submission:Je,error:St}=xT(d.v7_normalizeFormMethod,!0,ft,_e);if(St){tn(te,se,St,{flushSync:Pe});return}let Nt=Ll(Ue,Fe),Mn=(_e&&_e.preventScrollReset)===!0;if(Je&&gi(Je.formMethod)){H(te,se,Fe,Nt,Ue,Be.active,Pe,Mn,Je);return}X.set(te,{routeId:se,path:Fe}),ee(te,se,Fe,Nt,Ue,Be.active,Pe,Mn,Je)}async function H(te,se,ue,_e,Pe,Ke,ft,Ue,Be){rt(),X.delete(te);function Fe(bn){if(!bn.route.action&&!bn.route.lazy){let M=Sr(405,{method:Be.formMethod,pathname:ue,routeId:se});return tn(te,se,M,{flushSync:ft}),!0}return!1}if(!Ke&&Fe(_e))return;let Je=_.fetchers.get(te);Xe(te,_re(Be,Je),{flushSync:ft});let St=new AbortController,Nt=kc(t.history,ue,St.signal,Be);if(Ke){let bn=await gc(Pe,new URL(Nt.url).pathname,Nt.signal);if(bn.type==="aborted")return;if(bn.type==="error"){tn(te,se,bn.error,{flushSync:ft});return}else if(bn.matches){if(Pe=bn.matches,_e=Ll(Pe,ue),Fe(_e))return}else{tn(te,se,Sr(404,{pathname:ue}),{flushSync:ft});return}}K.set(te,St);let Mn=$,zt=(await fe("action",_,Nt,[_e],Pe,te))[_e.route.id];if(Nt.signal.aborted){K.get(te)===St&&K.delete(te);return}if(d.v7_fetcherPersist&&z.has(te)){if(va(zt)||Pr(zt)){Xe(te,ho(void 0));return}}else{if(va(zt))if(K.delete(te),q>Mn){Xe(te,ho(void 0));return}else return D.add(te),Xe(te,bl(Be)),de(Nt,zt,!1,{fetcherSubmission:Be,preventScrollReset:Ue});if(Pr(zt)){tn(te,se,zt.error);return}}if(ko(zt))throw Sr(400,{type:"defer-action"});let dn=_.navigation.location||_.location,ro=kc(t.history,dn,St.signal),ta=a||o,Yr=_.navigation.state!=="idle"?wo(ta,_.navigation.location,c):_.matches;kt(Yr,"Didn't find any matches after fetcher action");let er=++$;j.set(te,er);let yc=bl(Be,zt.data);_.fetchers.set(te,yc);let[Kr,bs]=IT(t.history,_,Yr,Be,dn,!1,d.v7_skipActionErrorRevalidation,C,N,U,z,X,D,ta,c,[_e.route.id,zt]);bs.filter(bn=>bn.key!==te).forEach(bn=>{let M=bn.key,J=_.fetchers.get(M),B=bl(void 0,J?J.data:void 0);_.fetchers.set(M,B),Rt(M),bn.controller&&K.set(M,bn.controller)}),Ye({fetchers:new Map(_.fetchers)});let _s=()=>bs.forEach(bn=>Rt(bn.key));St.signal.addEventListener("abort",_s);let{loaderResults:io,fetcherResults:Ft}=await De(_,Yr,Kr,bs,ro);if(St.signal.aborted)return;St.signal.removeEventListener("abort",_s),j.delete(te),K.delete(te),bs.forEach(bn=>K.delete(bn.key));let fn=Nh(io);if(fn)return de(ro,fn.result,!1,{preventScrollReset:Ue});if(fn=Nh(Ft),fn)return D.add(fn.key),de(ro,fn.result,!1,{preventScrollReset:Ue});let{loaderData:$i,errors:na}=RT(_,Yr,io,void 0,bs,Ft,le);if(_.fetchers.has(te)){let bn=ho(zt.data);_.fetchers.set(te,bn)}_r(er),_.navigation.state==="loading"&&er>q?(kt(k,"Expected pending action"),F&&F.abort(),Ot(_.navigation.location,{matches:Yr,loaderData:$i,errors:na,fetchers:new Map(_.fetchers)})):(Ye({errors:na,loaderData:NT(_.loaderData,$i,Yr,na),fetchers:new Map(_.fetchers)}),C=!1)}async function ee(te,se,ue,_e,Pe,Ke,ft,Ue,Be){let Fe=_.fetchers.get(te);Xe(te,bl(Be,Fe?Fe.data:void 0),{flushSync:ft});let Je=new AbortController,St=kc(t.history,ue,Je.signal);if(Ke){let zt=await gc(Pe,new URL(St.url).pathname,St.signal);if(zt.type==="aborted")return;if(zt.type==="error"){tn(te,se,zt.error,{flushSync:ft});return}else if(zt.matches)Pe=zt.matches,_e=Ll(Pe,ue);else{tn(te,se,Sr(404,{pathname:ue}),{flushSync:ft});return}}K.set(te,Je);let Nt=$,en=(await fe("loader",_,St,[_e],Pe,te))[_e.route.id];if(ko(en)&&(en=await I0(en,St.signal,!0)||en),K.get(te)===Je&&K.delete(te),!St.signal.aborted){if(z.has(te)){Xe(te,ho(void 0));return}if(va(en))if(q>Nt){Xe(te,ho(void 0));return}else{D.add(te),await de(St,en,!1,{preventScrollReset:Ue});return}if(Pr(en)){tn(te,se,en.error);return}kt(!ko(en),"Unhandled fetcher deferred data"),Xe(te,ho(en.data))}}async function de(te,se,ue,_e){let{submission:Pe,fetcherSubmission:Ke,preventScrollReset:ft,replace:Ue}=_e===void 0?{}:_e;se.response.headers.has("X-Remix-Revalidate")&&(C=!0);let Be=se.response.headers.get("Location");kt(Be,"Expected a Location header on the redirect Response"),Be=kT(Be,new URL(te.url),c);let Fe=Lu(_.location,Be,{_isRedirect:!0});if(n){let zt=!1;if(se.response.headers.has("X-Remix-Reload-Document"))zt=!0;else if(T0.test(Be)){const dn=t.history.createURL(Be);zt=dn.origin!==e.location.origin||$f(dn.pathname,c)==null}if(zt){Ue?e.location.replace(Be):e.location.assign(Be);return}}F=null;let Je=Ue===!0||se.response.headers.has("X-Remix-Replace")?hn.Replace:hn.Push,{formMethod:St,formAction:Nt,formEncType:Mn}=_.navigation;!Pe&&!Ke&&St&&Nt&&Mn&&(Pe=LT(_.navigation));let en=Pe||Ke;if(ere.has(se.response.status)&&en&&gi(en.formMethod))await ae(Je,Fe,{submission:pn({},en,{formAction:Be}),preventScrollReset:ft||R,enableViewTransition:ue?V:void 0});else{let zt=Zy(Fe,Pe);await ae(Je,Fe,{overrideNavigation:zt,fetcherSubmission:Ke,preventScrollReset:ft||R,enableViewTransition:ue?V:void 0})}}async function fe(te,se,ue,_e,Pe,Ke){let ft,Ue={};try{ft=await cre(u,te,se,ue,_e,Pe,Ke,s,i)}catch(Be){return _e.forEach(Fe=>{Ue[Fe.route.id]={type:Kt.error,error:Be}}),Ue}for(let[Be,Fe]of Object.entries(ft))if(pre(Fe)){let Je=Fe.result;Ue[Be]={type:Kt.redirect,response:dre(Je,ue,Be,Pe,c,d.v7_relativeSplatPath)}}else Ue[Be]=await lre(Fe);return Ue}async function De(te,se,ue,_e,Pe){let Ke=te.matches,ft=fe("loader",te,Pe,ue,se,null),Ue=Promise.all(_e.map(async Je=>{if(Je.matches&&Je.match&&Je.controller){let Nt=(await fe("loader",te,kc(t.history,Je.path,Je.controller.signal),[Je.match],Je.matches,Je.key))[Je.match.route.id];return{[Je.key]:Nt}}else return Promise.resolve({[Je.key]:{type:Kt.error,error:Sr(404,{pathname:Je.path})}})})),Be=await ft,Fe=(await Ue).reduce((Je,St)=>Object.assign(Je,St),{});return await Promise.all([yre(se,Be,Pe.signal,Ke,te.loaderData),vre(se,Fe,_e)]),{loaderResults:Be,fetcherResults:Fe}}function rt(){C=!0,N.push(...ci()),X.forEach((te,se)=>{K.has(se)&&U.add(se),Rt(se)})}function Xe(te,se,ue){ue===void 0&&(ue={}),_.fetchers.set(te,se),Ye({fetchers:new Map(_.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function tn(te,se,ue,_e){_e===void 0&&(_e={});let Pe=la(_.matches,se);vn(te),Ye({errors:{[Pe.route.id]:ue},fetchers:new Map(_.fetchers)},{flushSync:(_e&&_e.flushSync)===!0})}function sr(te){return Z.set(te,(Z.get(te)||0)+1),z.has(te)&&z.delete(te),_.fetchers.get(te)||tre}function vn(te){let se=_.fetchers.get(te);K.has(te)&&!(se&&se.state==="loading"&&j.has(te))&&Rt(te),X.delete(te),j.delete(te),D.delete(te),d.v7_fetcherPersist&&z.delete(te),U.delete(te),_.fetchers.delete(te)}function Zr(te){let se=(Z.get(te)||0)-1;se<=0?(Z.delete(te),z.add(te),d.v7_fetcherPersist||vn(te)):Z.set(te,se),Ye({fetchers:new Map(_.fetchers)})}function Rt(te){let se=K.get(te);se&&(se.abort(),K.delete(te))}function Nr(te){for(let se of te){let ue=sr(se),_e=ho(ue.data);_.fetchers.set(se,_e)}}function ai(){let te=[],se=!1;for(let ue of D){let _e=_.fetchers.get(ue);kt(_e,"Expected fetcher: "+ue),_e.state==="loading"&&(D.delete(ue),te.push(ue),se=!0)}return Nr(te),se}function _r(te){let se=[];for(let[ue,_e]of j)if(_e<te){let Pe=_.fetchers.get(ue);kt(Pe,"Expected fetcher: "+ue),Pe.state==="loading"&&(Rt(ue),j.delete(ue),se.push(ue))}return Nr(se),se.length>0}function eo(te,se){let ue=_.blockers.get(te)||vl;return pe.get(te)!==se&&pe.set(te,se),ue}function ea(te){_.blockers.delete(te),pe.delete(te)}function to(te,se){let ue=_.blockers.get(te)||vl;kt(ue.state==="unblocked"&&se.state==="blocked"||ue.state==="blocked"&&se.state==="blocked"||ue.state==="blocked"&&se.state==="proceeding"||ue.state==="blocked"&&se.state==="unblocked"||ue.state==="proceeding"&&se.state==="unblocked","Invalid blocker state transition: "+ue.state+" -> "+se.state);let _e=new Map(_.blockers);_e.set(te,se),Ye({blockers:_e})}function Ar(te){let{currentLocation:se,nextLocation:ue,historyAction:_e}=te;if(pe.size===0)return;pe.size>1&&Xa(!1,"A router only supports one blocker at a time");let Pe=Array.from(pe.entries()),[Ke,ft]=Pe[Pe.length-1],Ue=_.blockers.get(Ke);if(!(Ue&&Ue.state==="proceeding")&&ft({currentLocation:se,nextLocation:ue,historyAction:_e}))return Ke}function no(te){let se=Sr(404,{pathname:te}),ue=a||o,{matches:_e,route:Pe}=PT(ue);return ci(),{notFoundMatches:_e,route:Pe,error:se}}function ci(te){let se=[];return le.forEach((ue,_e)=>{(!te||te(_e))&&(ue.cancel(),se.push(_e),le.delete(_e))}),se}function vs(te,se,ue){if(m=te,g=se,p=ue||null,!y&&_.navigation===Gy){y=!0;let _e=Uf(_.location,_.matches);_e!=null&&Ye({restoreScrollPosition:_e})}return()=>{m=null,g=null,p=null}}function jf(te,se){return p&&p(te,se.map(_e=>Nne(_e,_.loaderData)))||te.key}function Ag(te,se){if(m&&g){let ue=jf(te,se);m[ue]=g()}}function Uf(te,se){if(m){let ue=jf(te,se),_e=m[ue];if(typeof _e=="number")return _e}return null}function mc(te,se,ue){if(l)if(te){if(Object.keys(te[0].params).length>0)return{active:!0,matches:sp(se,ue,c,!0)}}else return{active:!0,matches:sp(se,ue,c,!0)||[]};return{active:!1,matches:null}}async function gc(te,se,ue){if(!l)return{type:"success",matches:te};let _e=te;for(;;){let Pe=a==null,Ke=a||o,ft=s;try{await l({signal:ue,path:se,matches:_e,patch:(Fe,Je)=>{ue.aborted||CT(Fe,Je,Ke,ft,i)}})}catch(Fe){return{type:"error",error:Fe,partialMatches:_e}}finally{Pe&&!ue.aborted&&(o=[...o])}if(ue.aborted)return{type:"aborted"};let Ue=wo(Ke,se,c);if(Ue)return{type:"success",matches:Ue};let Be=sp(Ke,se,c,!0);if(!Be||_e.length===Be.length&&_e.every((Fe,Je)=>Fe.route.id===Be[Je].route.id))return{type:"success",matches:null};_e=Be}}function Pg(te){s={},a=_m(te,i,void 0,s)}function Mg(te,se){let ue=a==null;CT(te,se,a||o,s,i),ue&&(o=[...o],Ye({}))}return x={get basename(){return c},get future(){return d},get state(){return _},get routes(){return o},get window(){return e},initialize:je,subscribe:ut,enableScrollRestoration:vs,navigate:O,fetch:Q,revalidate:he,createHref:te=>t.history.createHref(te),encodeLocation:te=>t.history.encodeLocation(te),getFetcher:sr,deleteFetcher:Zr,dispose:ct,getBlocker:eo,deleteBlocker:ea,patchRoutes:Mg,_internalFetchControllers:K,_internalActiveDeferreds:le,_internalSetRoutes:Pg},x}function ire(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Pb(t,e,n,r,i,s,o,a){let c,u;if(o){c=[];for(let d of e)if(c.push(d),d.route.id===o){u=d;break}}else c=e,u=e[e.length-1];let l=nP(i||".",tP(c,s),$f(t.pathname,n)||t.pathname,a==="path");if(i==null&&(l.search=t.search,l.hash=t.hash),(i==null||i===""||i===".")&&u){let d=O0(l.search);if(u.route.index&&!d)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&d){let f=new URLSearchParams(l.search),h=f.getAll("index");f.delete("index"),h.filter(p=>p).forEach(p=>f.append("index",p));let m=f.toString();l.search=m?"?"+m:""}}return r&&n!=="/"&&(l.pathname=l.pathname==="/"?n:Po([n,l.pathname])),nl(l)}function xT(t,e,n,r){if(!r||!ire(r))return{path:n};if(r.formMethod&&!gre(r.formMethod))return{path:n,error:Sr(405,{method:r.formMethod})};let i=()=>({path:n,error:Sr(400,{type:"invalid-body"})}),s=r.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=aP(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!gi(o))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,m)=>{let[p,g]=m;return""+h+p+"="+g+`
|
|
439
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!gi(o))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}kt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=Lb(r.formData),u=r.formData;else if(r.body instanceof FormData)c=Lb(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=DT(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=DT(c)}catch{return i()}let l={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(gi(l.formMethod))return{path:n,submission:l};let d=Qs(n);return e&&d.search&&O0(d.search)&&c.append("index",""),d.search="?"+c,{path:nl(d),submission:l}}function TT(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(i=>i.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function IT(t,e,n,r,i,s,o,a,c,u,l,d,f,h,m,p){let g=p?Pr(p[1])?p[1].error:p[1].data:void 0,y=t.createURL(e.location),v=t.createURL(i),b=n;s&&e.errors?b=TT(n,Object.keys(e.errors)[0],!0):p&&Pr(p[1])&&(b=TT(n,p[0]));let E=p?p[1].statusCode:void 0,w=o&&E&&E>=400,x=b.filter((k,R)=>{let{route:F}=k;if(F.lazy)return!0;if(F.loader==null)return!1;if(s)return Mb(F,e.loaderData,e.errors);if(sre(e.loaderData,e.matches[R],k)||c.some(L=>L===k.route.id))return!0;let V=e.matches[R],T=k;return OT(k,pn({currentUrl:y,currentParams:V.params,nextUrl:v,nextParams:T.params},r,{actionResult:g,actionStatus:E,defaultShouldRevalidate:w?!1:a||y.pathname+y.search===v.pathname+v.search||y.search!==v.search||sP(V,T)}))}),_=[];return d.forEach((k,R)=>{if(s||!n.some(S=>S.route.id===k.routeId)||l.has(R))return;let F=wo(h,k.path,m);if(!F){_.push({key:R,routeId:k.routeId,path:k.path,matches:null,match:null,controller:null});return}let V=e.fetchers.get(R),T=Ll(F,k.path),L=!1;f.has(R)?L=!1:u.has(R)?(u.delete(R),L=!0):V&&V.state!=="idle"&&V.data===void 0?L=a:L=OT(T,pn({currentUrl:y,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:g,actionStatus:E,defaultShouldRevalidate:w?!1:a})),L&&_.push({key:R,routeId:k.routeId,path:k.path,matches:F,match:T,controller:new AbortController})}),[x,_]}function Mb(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,i=n!=null&&n[t.id]!==void 0;return!r&&i?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!i}function sre(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function sP(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function OT(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function CT(t,e,n,r,i){var s;let o;if(t){let u=r[t];kt(u,"No route found to patch children into: routeId = "+t),u.children||(u.children=[]),o=u.children}else o=n;let a=e.filter(u=>!o.some(l=>oP(u,l))),c=_m(a,i,[t||"_","patch",String(((s=o)==null?void 0:s.length)||"0")],r);o.push(...c)}function oP(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var i;return(i=e.children)==null?void 0:i.some(s=>oP(n,s))}):!1}async function ore(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];kt(i,"No route found in manifest");let s={};for(let o in r){let c=i[o]!==void 0&&o!=="hasErrorBoundary";Xa(!c,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!c&&!Dne.has(o)&&(s[o]=r[o])}Object.assign(i,s),Object.assign(i,pn({},e(i),{lazy:void 0}))}async function are(t){let{matches:e}=t,n=e.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,o)=>Object.assign(i,{[n[o].route.id]:s}),{})}async function cre(t,e,n,r,i,s,o,a,c,u){let l=s.map(h=>h.route.lazy?ore(h.route,c,a):void 0),d=s.map((h,m)=>{let p=l[m],g=i.some(v=>v.route.id===h.route.id);return pn({},h,{shouldLoad:g,resolve:async v=>(v&&r.method==="GET"&&(h.route.lazy||h.route.loader)&&(g=!0),g?ure(e,r,h,p,v,u):Promise.resolve({type:Kt.data,result:void 0}))})}),f=await t({matches:d,request:r,params:s[0].params,fetcherKey:o,context:u});try{await Promise.all(l)}catch{}return f}async function ure(t,e,n,r,i,s){let o,a,c=u=>{let l,d=new Promise((m,p)=>l=p);a=()=>l(),e.signal.addEventListener("abort",a);let f=m=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:s},...m!==void 0?[m]:[]),h=(async()=>{try{return{type:"data",result:await(i?i(p=>f(p)):f())}}catch(m){return{type:"error",result:m}}})();return Promise.race([h,d])};try{let u=n.route[t];if(r)if(u){let l,[d]=await Promise.all([c(u).catch(f=>{l=f}),r]);if(l!==void 0)throw l;o=d}else if(await r,u=n.route[t],u)o=await c(u);else if(t==="action"){let l=new URL(e.url),d=l.pathname+l.search;throw Sr(405,{method:e.method,pathname:d,routeId:n.route.id})}else return{type:Kt.data,result:void 0};else if(u)o=await c(u);else{let l=new URL(e.url),d=l.pathname+l.search;throw Sr(404,{pathname:d})}kt(o.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Kt.error,result:u}}finally{a&&e.signal.removeEventListener("abort",a)}return o}async function lre(t){let{result:e,type:n}=t;if(cP(e)){let d;try{let f=e.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?e.body==null?d=null:d=await e.json():d=await e.text()}catch(f){return{type:Kt.error,error:f}}return n===Kt.error?{type:Kt.error,error:new Ab(e.status,e.statusText,d),statusCode:e.status,headers:e.headers}:{type:Kt.data,data:d,statusCode:e.status,headers:e.headers}}if(n===Kt.error){if(MT(e)){var r,i;if(e.data instanceof Error){var s,o;return{type:Kt.error,error:e.data,statusCode:(s=e.init)==null?void 0:s.status,headers:(o=e.init)!=null&&o.headers?new Headers(e.init.headers):void 0}}return{type:Kt.error,error:new Ab(((r=e.init)==null?void 0:r.status)||500,void 0,e.data),statusCode:cf(e)?e.status:void 0,headers:(i=e.init)!=null&&i.headers?new Headers(e.init.headers):void 0}}return{type:Kt.error,error:e,statusCode:cf(e)?e.status:void 0}}if(mre(e)){var a,c;return{type:Kt.deferred,deferredData:e,statusCode:(a=e.init)==null?void 0:a.status,headers:((c=e.init)==null?void 0:c.headers)&&new Headers(e.init.headers)}}if(MT(e)){var u,l;return{type:Kt.data,data:e.data,statusCode:(u=e.init)==null?void 0:u.status,headers:(l=e.init)!=null&&l.headers?new Headers(e.init.headers):void 0}}return{type:Kt.data,data:e}}function dre(t,e,n,r,i,s){let o=t.headers.get("Location");if(kt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!T0.test(o)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=Pb(new URL(e.url),a,i,!0,o,s),t.headers.set("Location",o)}return t}function kT(t,e,n){if(T0.test(t)){let r=t,i=r.startsWith("//")?new URL(e.protocol+r):new URL(r),s=$f(i.pathname,n)!=null;if(i.origin===e.origin&&s)return i.pathname+i.search+i.hash}return t}function kc(t,e,n,r){let i=t.createURL(aP(e)).toString(),s={signal:n};if(r&&gi(r.formMethod)){let{formMethod:o,formEncType:a}=r;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(r.json)):a==="text/plain"?s.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?s.body=Lb(r.formData):s.body=r.formData}return new Request(i,s)}function Lb(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function DT(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function fre(t,e,n,r,i){let s={},o=null,a,c=!1,u={},l=n&&Pr(n[1])?n[1].error:void 0;return t.forEach(d=>{if(!(d.route.id in e))return;let f=d.route.id,h=e[f];if(kt(!va(h),"Cannot handle redirect results in processLoaderData"),Pr(h)){let m=h.error;l!==void 0&&(m=l,l=void 0),o=o||{};{let p=la(t,f);o[p.route.id]==null&&(o[p.route.id]=m)}s[f]=void 0,c||(c=!0,a=cf(h.error)?h.error.status:500),h.headers&&(u[f]=h.headers)}else ko(h)?(r.set(f,h.deferredData),s[f]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!c&&(a=h.statusCode),h.headers&&(u[f]=h.headers)):(s[f]=h.data,h.statusCode&&h.statusCode!==200&&!c&&(a=h.statusCode),h.headers&&(u[f]=h.headers))}),l!==void 0&&n&&(o={[n[0]]:l},s[n[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function RT(t,e,n,r,i,s,o){let{loaderData:a,errors:c}=fre(e,n,r,o);return i.forEach(u=>{let{key:l,match:d,controller:f}=u,h=s[l];if(kt(h,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Pr(h)){let m=la(t.matches,d==null?void 0:d.route.id);c&&c[m.route.id]||(c=pn({},c,{[m.route.id]:h.error})),t.fetchers.delete(l)}else if(va(h))kt(!1,"Unhandled fetcher revalidation redirect");else if(ko(h))kt(!1,"Unhandled fetcher deferred data");else{let m=ho(h.data);t.fetchers.set(l,m)}}),{loaderData:a,errors:c}}function NT(t,e,n,r){let i=pn({},e);for(let s of n){let o=s.route.id;if(e.hasOwnProperty(o)?e[o]!==void 0&&(i[o]=e[o]):t[o]!==void 0&&s.route.loader&&(i[o]=t[o]),r&&r.hasOwnProperty(o))break}return i}function AT(t){return t?Pr(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function la(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function PT(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Sr(t,e){let{pathname:n,routeId:r,method:i,type:s,message:o}=e===void 0?{}:e,a="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(a="Bad Request",i&&n&&r?c="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?c="defer() is not supported in actions":s==="invalid-body"&&(c="Unable to encode submission body")):t===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(a="Not Found",c='No route matches URL "'+n+'"'):t===405&&(a="Method Not Allowed",i&&n&&r?c="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(c='Invalid request method "'+i.toUpperCase()+'"')),new Ab(t||500,a,new Error(c),!0)}function Nh(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,i]=e[n];if(va(i))return{key:r,result:i}}}function aP(t){let e=typeof t=="string"?Qs(t):t;return nl(pn({},e,{hash:""}))}function hre(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function pre(t){return cP(t.result)&&Qne.has(t.result.status)}function ko(t){return t.type===Kt.deferred}function Pr(t){return t.type===Kt.error}function va(t){return(t&&t.type)===Kt.redirect}function MT(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function mre(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function cP(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function gre(t){return Xne.has(t.toLowerCase())}function gi(t){return Kne.has(t.toLowerCase())}async function yre(t,e,n,r,i){let s=Object.entries(e);for(let o=0;o<s.length;o++){let[a,c]=s[o],u=t.find(f=>(f==null?void 0:f.route.id)===a);if(!u)continue;let l=r.find(f=>f.route.id===u.route.id),d=l!=null&&!sP(l,u)&&(i&&i[u.route.id])!==void 0;ko(c)&&d&&await I0(c,n,!1).then(f=>{f&&(e[a]=f)})}}async function vre(t,e,n){for(let r=0;r<n.length;r++){let{key:i,routeId:s,controller:o}=n[r],a=e[i];t.find(u=>(u==null?void 0:u.route.id)===s)&&ko(a)&&(kt(o,"Expected an AbortController for revalidating fetcher deferred result"),await I0(a,o.signal,!0).then(u=>{u&&(e[i]=u)}))}}async function I0(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:Kt.data,data:t.deferredData.unwrappedData}}catch(i){return{type:Kt.error,error:i}}return{type:Kt.data,data:t.deferredData.data}}}function O0(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Ll(t,e){let n=typeof e=="string"?Qs(e).search:e.search;if(t[t.length-1].route.index&&O0(n||""))return t[t.length-1];let r=eP(t);return r[r.length-1]}function LT(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:s,json:o}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Zy(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bre(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function bl(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function _re(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function ho(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function wre(t,e){try{let n=t.sessionStorage.getItem(iP);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function Ere(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(iP,JSON.stringify(n))}catch(r){Xa(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
440
|
-
* React Router v6.29.0
|
|
441
|
-
*
|
|
442
|
-
* Copyright (c) Remix Software Inc.
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the MIT license found in the
|
|
445
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
446
|
-
*
|
|
447
|
-
* @license MIT
|
|
448
|
-
*/function uf(){return uf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},uf.apply(this,arguments)}const C0=Y.createContext(null),Sre=Y.createContext(null),Dg=Y.createContext(null),Rg=Y.createContext(null),Qo=Y.createContext({outlet:null,matches:[],isDataRoute:!1}),uP=Y.createContext(null);function Ng(){return Y.useContext(Rg)!=null}function k0(){return Ng()||kt(!1),Y.useContext(Rg).location}function xre(){return Y.useContext(Rg).navigationType}function lP(t){Y.useContext(Dg).static||Y.useLayoutEffect(t)}function Ose(){let{isDataRoute:t}=Y.useContext(Qo);return t?Fre():Tre()}function Tre(){Ng()||kt(!1);let t=Y.useContext(C0),{basename:e,future:n,navigator:r}=Y.useContext(Dg),{matches:i}=Y.useContext(Qo),{pathname:s}=k0(),o=JSON.stringify(tP(i,n.v7_relativeSplatPath)),a=Y.useRef(!1);return lP(()=>{a.current=!0}),Y.useCallback(function(u,l){if(l===void 0&&(l={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=nP(u,JSON.parse(o),s,l.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Po([e,d.pathname])),(l.replace?r.replace:r.push)(d,l.state,l)},[e,r,o,s,t])}const Ire=Y.createContext(null);function Ore(t){let e=Y.useContext(Qo).outlet;return e&&Y.createElement(Ire.Provider,{value:t},e)}function Cse(){let{matches:t}=Y.useContext(Qo),e=t[t.length-1];return e?e.params:{}}function kse(t,e,n,r){Ng()||kt(!1);let{navigator:i,static:s}=Y.useContext(Dg),{matches:o}=Y.useContext(Qo),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let l=k0(),d;d=l;let f=d.pathname||"/",h=f;if(u!=="/"){let g=u.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=!s&&n&&n.matches&&n.matches.length>0?n.matches:wo(t,{pathname:h});return Nre(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},c,g.params),pathname:Po([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Po([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r)}function Cre(){let t=Lre(),e=cf(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return Y.createElement(Y.Fragment,null,Y.createElement("h2",null,"Unexpected Application Error!"),Y.createElement("h3",{style:{fontStyle:"italic"}},e),n?Y.createElement("pre",{style:i},n):null,null)}const kre=Y.createElement(Cre,null);class Dre extends Y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?Y.createElement(Qo.Provider,{value:this.props.routeContext},Y.createElement(uP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Rre(t){let{routeContext:e,match:n,children:r}=t,i=Y.useContext(C0);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),Y.createElement(Qo.Provider,{value:e},r)}function Nre(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let l=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);l>=0||kt(!1),o=o.slice(0,Math.min(o.length,l+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let l=0;l<o.length;l++){let d=o[l];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=l),d.route.id){let{loaderData:f,errors:h}=n,m=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||m){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((l,d,f)=>{let h,m=!1,p=null,g=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||kre,c&&(u<0&&f===0?(m=!0,g=null):u===f&&(m=!0,g=d.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,f+1)),v=()=>{let b;return h?b=p:m?b=g:d.route.Component?b=Y.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=l,Y.createElement(Rre,{match:d,routeContext:{outlet:l,matches:y,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?Y.createElement(Dre,{location:n.location,revalidation:n.revalidation,component:p,error:h,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var dP=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(dP||{}),wm=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(wm||{});function Are(t){let e=Y.useContext(C0);return e||kt(!1),e}function Pre(t){let e=Y.useContext(Sre);return e||kt(!1),e}function Mre(t){let e=Y.useContext(Qo);return e||kt(!1),e}function fP(t){let e=Mre(),n=e.matches[e.matches.length-1];return n.route.id||kt(!1),n.route.id}function Lre(){var t;let e=Y.useContext(uP),n=Pre(wm.UseRouteError),r=fP(wm.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Fre(){let{router:t}=Are(dP.UseNavigateStable),e=fP(wm.UseNavigateStable),n=Y.useRef(!1);return lP(()=>{n.current=!0}),Y.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,uf({fromRouteId:e},s)))},[t,e])}function Dse(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function Rse(t){return Ore(t.context)}function $re(t){kt(!1)}function Nse(t){let{basename:e="/",children:n=null,location:r,navigationType:i=hn.Pop,navigator:s,static:o=!1,future:a}=t;Ng()&&kt(!1);let c=e.replace(/^\/*/,"/"),u=Y.useMemo(()=>({basename:c,navigator:s,static:o,future:uf({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof r=="string"&&(r=Qs(r));let{pathname:l="/",search:d="",hash:f="",state:h=null,key:m="default"}=r,p=Y.useMemo(()=>{let g=$f(l,c);return g==null?null:{location:{pathname:g,search:d,hash:f,state:h,key:m},navigationType:i}},[c,l,d,f,h,m,i]);return p==null?null:Y.createElement(Dg.Provider,{value:u},Y.createElement(Rg.Provider,{children:n,value:p}))}new Promise(()=>{});function Fb(t,e){e===void 0&&(e=[]);let n=[];return Y.Children.forEach(t,(r,i)=>{if(!Y.isValidElement(r))return;let s=[...e,i];if(r.type===Y.Fragment){n.push.apply(n,Fb(r.props.children,s));return}r.type!==$re&&kt(!1),!r.props.index||!r.props.children||kt(!1);let o={id:r.props.id||s.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&&(o.children=Fb(r.props.children,s)),n.push(o)}),n}function jre(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:Y.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:Y.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:Y.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function Ase(t,e){return rre({basename:e==null?void 0:e.basename,future:uf({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:One({initialEntries:e==null?void 0:e.initialEntries,initialIndex:e==null?void 0:e.initialIndex}),hydrationData:e==null?void 0:e.hydrationData,routes:t,mapRouteProperties:jre,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation}).initialize()}function Ure(){const[t]=X_(),{analytics:e}=t;Dt(()=>{const n=Lt();if(!e){n&&n.close();return}if(n||!Ns.sentry.dsn||Ns.sentry.dsn==="")return;const r=window.__VITE_ENVS.SENTRY_RELEASE,i=[FA(),PA({depth:5}),Iee(),NA({levels:["error"]})];Ns.sentry.tracing&&i.push(qee({useEffect:$e.useEffect,useLocation:k0,useNavigationType:xre,createRoutesFromChildren:Fb,matchRoutes:wo})),Wee({release:r,dsn:Ns.sentry.dsn,environment:Ns.sentry.env,integrations:i,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(s,o){const a=o.originalException;return a instanceof TypeError&&a.message.includes("Failed to fetch")&&!navigator.onLine?null:s}})},[e])}const Bre=({children:t})=>(Ure(),t);function FT(...t){var e;(e=window.dataLayer)==null||e.push(...t)}const zre=()=>{const[{gaTrackingId:t}]=x0(),[{analytics:e}]=X_(),n=t&&e;return Dt(()=>{if(n){const r=document.createElement("script");return r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[],FT("js",new Date),FT("config",t),()=>{document.head.removeChild(r)}}},[n,t]),null},Vre=$e.lazy(async()=>({default:await(await Se(()=>import("./router-B1NCyaFw.js").then(n=>n.r),__vite__mapDeps([7,1,2,3]))).default()})),Hre=()=>{for(const t of Object.values(rte))cc(t);return null},Wre=()=>P($e.StrictMode,{children:P(qT,{fallback:P(Us,{}),children:Ee(w9,{store:v0,children:[P(Hre,{}),P(h9,{children:P(Bre,{children:P(Ine,{children:Ee(l9,{children:[P(c9,{position:"bottom-right"}),Ee(bne,{children:[P(Vre,{}),P(wne,{}),P(zre,{})]})]})})})})]})})}),Pse=Object.freeze(Object.defineProperty({__proto__:null,default:Wre},Symbol.toStringTag,{value:"Module"}));export{UU as $,Oie as A,qn as B,V5 as C,C0 as D,Ab as E,RE as F,sy as G,uU as H,kU as I,xa as J,od as K,SU as L,J5 as M,T1 as N,OU as O,N1 as P,Tie as Q,Nse as R,qm as S,Cie as T,Die as U,Sie as V,th as W,FU as X,AU as Y,zu as Z,_S as _,Ose as a,Na as a$,Hte as a0,Hn as a1,wie as a2,U5 as a3,Y5 as a4,F5 as a5,Eie as a6,ic as a7,_ie as a8,Rie as a9,x0 as aA,Mie as aB,Bie as aC,Lie as aD,P3 as aE,Ni as aF,KA as aG,E0 as aH,nte as aI,Rse as aJ,tie as aK,BM as aL,pie as aM,bj as aN,rc as aO,u_ as aP,uie as aQ,nie as aR,rie as aS,iie as aT,sie as aU,oie as aV,aie as aW,cie as aX,ps as aY,yp as aZ,G2 as a_,S1 as aa,yu as ab,R1 as ac,CU as ad,Bt as ae,hie as af,Gc as ag,Zf as ah,bie as ai,vt as aj,fie as ak,die as al,o_ as am,a_ as an,Vm as ao,c_ as ap,QI as aq,t1 as ar,e1 as as,n1 as at,hf as au,nc as av,S0 as aw,Vte as ax,Tse as ay,Cte as az,Sre as b,UC as b$,wj as b0,Do as b1,ey as b2,Hm as b3,e5 as b4,Fj as b5,a1 as b6,s1 as b7,r1 as b8,v1 as b9,ZA as bA,_te as bB,bte as bC,Yte as bD,WP as bE,$ie as bF,Pie as bG,Fie as bH,ti as bI,Sj as bJ,T4 as bK,eie as bL,t4 as bM,zn as bN,Vt as bO,J_ as bP,tk as bQ,Vie as bR,_0 as bS,fne as bT,cc as bU,kg as bV,Dte as bW,w0 as bX,Sse as bY,tte as bZ,jte as b_,Cj as ba,u1 as bb,L1 as bc,u3 as bd,Gm as be,w3 as bf,p3 as bg,Nie as bh,HE as bi,fi as bj,Zm as bk,f3 as bl,h3 as bm,z1 as bn,T3 as bo,g3 as bp,dr as bq,Aie as br,gn as bs,Ute as bt,lie as bu,vie as bv,mie as bw,gie as bx,yie as by,zie as bz,kse as c,$te as c0,z9 as c1,XT as c2,Cse as c3,Xt as c4,BC as c5,RC as c6,NC as c7,vC as c8,x8 as c9,Dv as ca,bC as cb,Ef as cc,DC as cd,ac as ce,Rd as cf,xse as cg,h_ as ch,Fl as ci,ge as cj,Pse as ck,rre as d,Ise as e,Ase as f,Qre as g,tc as h,D1 as i,l_ as j,wU as k,Dse as l,jre as m,q5 as n,xie as o,x1 as p,E1 as q,vp as r,xU as s,Z5 as t,k0 as u,Iie as v,AE as w,I1 as x,Q5 as y,lU as z};
|
|
449
|
-
//# sourceMappingURL=app-DvSjLYs-.js.map
|