@powerhousedao/connect 1.0.0-dev.196 → 1.0.0-dev.197
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/README.md +1 -0
- package/dist/assets/{app-DMbRv48W.js → app-C-N9ep4R.js} +5 -5
- package/dist/assets/{app-DMbRv48W.js.map → app-C-N9ep4R.js.map} +1 -1
- package/dist/assets/{app-loader-B-7H_0n2.js → app-loader-Brlfz2zT.js} +3 -3
- package/dist/assets/{app-loader-B-7H_0n2.js.map → app-loader-Brlfz2zT.js.map} +1 -1
- package/dist/assets/{browser-fQq8R1F1.js → browser-DvOVpOMz.js} +4 -4
- package/dist/assets/{browser-fQq8R1F1.js.map → browser-DvOVpOMz.js.map} +1 -1
- package/dist/assets/{ccip-BkRKvmCn.js → ccip-C4G3RX_v.js} +2 -2
- package/dist/assets/{ccip-BkRKvmCn.js.map → ccip-C4G3RX_v.js.map} +1 -1
- package/dist/assets/{content-CY1t5ZPS.js → content-B93-efMy.js} +3 -3
- package/dist/assets/{content-CY1t5ZPS.js.map → content-B93-efMy.js.map} +1 -1
- package/dist/assets/{editor-C9za-U8_.js → editor-7taYNObZ.js} +2 -2
- package/dist/assets/{editor-C9za-U8_.js.map → editor-7taYNObZ.js.map} +1 -1
- package/dist/assets/{editor-DO9jbAMx.js → editor-CleaRQR3.js} +2 -2
- package/dist/assets/{editor-DO9jbAMx.js.map → editor-CleaRQR3.js.map} +1 -1
- package/dist/assets/{editor-BU_HPUTO.js → editor-CqKuexTp.js} +2 -2
- package/dist/assets/{editor-BU_HPUTO.js.map → editor-CqKuexTp.js.map} +1 -1
- package/dist/assets/{editors-COXpwqHa.js → editors-DGf1QT5j.js} +4 -4
- package/dist/assets/{editors-COXpwqHa.js.map → editors-DGf1QT5j.js.map} +1 -1
- package/dist/assets/{index-D1LwEkcT.js → index-BP5QkxUa.js} +3 -3
- package/dist/assets/{index-D1LwEkcT.js.map → index-BP5QkxUa.js.map} +1 -1
- package/dist/assets/{index-Ds4JuW6y.js → index-DaiqEkhm.js} +2 -2
- package/dist/assets/{index-Ds4JuW6y.js.map → index-DaiqEkhm.js.map} +1 -1
- package/dist/assets/{main.DInypdBk.js → main.xvWSq1ZZ.js} +2 -2
- package/dist/assets/{main.DInypdBk.js.map → main.xvWSq1ZZ.js.map} +1 -1
- package/dist/assets/{root-CiI1Fw1i.js → root-a74RhEgM.js} +2 -2
- package/dist/assets/{root-CiI1Fw1i.js.map → root-a74RhEgM.js.map} +1 -1
- package/dist/assets/{router-yYGizFGD.js → router-BuelYVsv.js} +4 -4
- package/dist/assets/{router-yYGizFGD.js.map → router-BuelYVsv.js.map} +1 -1
- package/dist/assets/{useUiNodes-CQcKl7SU.js → useUiNodes-e_GEEaOb.js} +2 -2
- package/dist/assets/{useUiNodes-CQcKl7SU.js.map → useUiNodes-e_GEEaOb.js.map} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/dist/swEnv.js +2 -2
- package/dist/vite-envs.sh +5 -5
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -48,3 +48,4 @@ npm run make:windows # Create package for Windows
|
|
|
48
48
|
- To use yarn via Windows PowerShell, check [this guide](https://bobbyhadz.com/blog/yarn-cannot-be-loaded-running-scripts-disabled)
|
|
49
49
|
|
|
50
50
|
- For any other issues, reach out to our discord server [`#ask-powerhouse-team`](https://discord.com/channels/815917281728659516/883285185595047937) channel for help.
|
|
51
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
var HO=Object.defineProperty;var Gg=t=>{throw TypeError(t)};var WO=(t,e,n)=>e in t?HO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var qe=(t,e,n)=>WO(t,typeof e!="symbol"?e+"":e,n),$f=(t,e,n)=>e.has(t)||Gg("Cannot "+n);var Dt=(t,e,n)=>($f(t,e,"read from private field"),n?n.call(t):e.get(t)),jr=(t,e,n)=>e.has(t)?Gg("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ma=(t,e,n,r)=>($f(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),mr=(t,e,n)=>($f(t,e,"access private method"),n);import{_ as Ko}from"./main.DInypdBk.js";import{jsx as Te,jsxs as Ft,Fragment as C_}from"react/jsx-runtime";import{AddLocalDriveModal as qO,AddRemoteDriveModal as ZO,ConnectConfirmationModal as GO,ReadRequiredModal as M_,FILE as bp,LOCAL as YO,ERROR as JO,CreateDocumentModal as XO,Modal as KO,Icon as Vl,Combobox as Za,Button as Mo,FormInput as Yg,ConnectDeleteDriveModal as QO,ConnectDeleteItemModal as e1,DriveSettingsModal as t1,SettingsModal as n1,DocumentSelectSettingsRow as r1,ClearStorageSettingsRow as i1,DependencyVersions as s1,ConnectUpgradeDriveModal as o1,CookieBanner as a1,WagmiContext as c1,UiNodesContextProvider as l1,ToastContainer as u1}from"@powerhousedao/design-system";import*as Fe from"react";import wi,{createElement as lc,isValidElement as Pu,cloneElement as d1,Children as f1,createContext as Ph,useContext as yl,useState as xn,useRef as Fu,useEffect as Pn,useReducer as p1,useDebugValue as h1,useCallback as Rt,useMemo as is,Suspense as m1}from"react";import{g as L_,a as Fh,c as vi,s as Hl,p as g1}from"./app-loader-B-7H_0n2.js";function y1(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 Ep(){return Ep=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},Ep.apply(null,arguments)}var ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qV(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 v1={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 _1=vl(v1);var b1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Jg(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(_1[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(b1),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 E1=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,S1=/^\s*$/,w1=Object.create(null);function P_(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(P_,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var T1={parse:function(t,e){e||(e={}),e.components||(e.components=w1);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(E1,function(c,l){if(o){if(c!=="</"+n.name+">")return;o=!1}var u,d=c.charAt(1)!=="/",f=c.startsWith("<!--"),p=l+c.length,h=t.charAt(p);if(f){var m=Jg(c);return s<0?(r.push(m),r):((u=i[s]).children.push(m),r)}if(d&&(s++,(n=Jg(c)).type==="tag"&&e.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!h||h==="<"||n.children.push({type:"text",content:t.slice(p,t.indexOf("<",p))}),s===0&&r.push(n),(u=i[s-1])&&u.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&&h!=="<"&&h)){u=s===-1?r:i[s].children;var v=t.indexOf("<",p),y=t.slice(p,v===-1?void 0:v);S1.test(y)&&(y=" "),(v>-1&&s+u.length>=0||y!==" ")&&u.push({type:"text",content:y})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+P_("",n)},"")}};function _u(){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 Xg={};function $u(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&Xg[e[0]]||(typeof e[0]=="string"&&(Xg[e[0]]=new Date),_u(...e))}const F_=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function Kg(t,e,n){t.loadNamespaces(e,F_(t,n))}function Qg(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,F_(t,r))}function I1(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 l=e.services.backendConnector.state[`${a}|${c}`];return l===-1||l===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 x1(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?($u("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}}):I1(t,e,n)}function jf(t,e){if(!t)return!1;const n=t.props?t.props.children:t.children;return e?n.length>0:!!n}function Uf(t){if(!t)return[];const e=t.props?t.props.children:t.children;return t.props&&t.props.i18nIsDynamicList?Lo(e):e}function O1(t){return Object.prototype.toString.call(t)!=="[object Array]"?!1:t.every(e=>Pu(e))}function Lo(t){return Array.isArray(t)?t:[t]}function D1(t,e){const n={...e};return n.props=Object.assign(t.props,e.props),n}function $_(t,e){if(!t)return"";let n="";const r=Lo(t),i=e.transSupportBasicHtmlNodes&&e.transKeepBasicHtmlNodesFor?e.transKeepBasicHtmlNodesFor:[];return r.forEach((s,o)=>{if(typeof s=="string")n+=`${s}`;else if(Pu(s)){const a=Object.keys(s.props).length,c=i.indexOf(s.type)>-1,l=s.props.children;if(!l&&c&&a===0)n+=`<${s.type}/>`;else if(!l&&(!c||a!==0))n+=`<${o}></${o}>`;else if(s.props.i18nIsDynamicList)n+=`<${o}></${o}>`;else if(c&&a===1&&typeof l=="string")n+=`<${s.type}>${l}</${s.type}>`;else{const u=$_(l,e);n+=`<${o}>${u}</${o}>`}}else if(s===null)_u("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof s=="object"){const{format:a,...c}=s,l=Object.keys(c);if(l.length===1){const u=a?`${l[0]}, ${a}`:l[0];n+=`{{${u}}}`}else _u("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",s)}else _u("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 R1(t,e,n,r,i,s){if(e==="")return[];const o=r.transKeepBasicHtmlNodesFor||[],a=e&&new RegExp(o.map(v=>`<${v}`).join("|")).test(e);if(!t&&!a&&!s)return[e];const c={};function l(v){Lo(v).forEach(g=>{typeof g!="string"&&(jf(g)?l(Uf(g)):typeof g=="object"&&!Pu(g)&&Object.assign(c,g))})}l(t);const u=T1.parse(`<0>${e}</0>`),d={...c,...i};function f(v,y,g){const _=Uf(v),T=h(_,y.children,g);return O1(_)&&T.length===0||v.props&&v.props.i18nIsDynamicList?_:T}function p(v,y,g,_,T){v.dummy?(v.children=y,g.push(d1(v,{key:_},T?void 0:y))):g.push(...f1.map([v],w=>{const E={...w.props};return delete E.i18nIsDynamicList,wi.createElement(w.type,Ep({},E,{key:_,ref:w.ref},T?{}:{children:y}))}))}function h(v,y,g){const _=Lo(v);return Lo(y).reduce((w,E,R)=>{const j=E.children&&E.children[0]&&E.children[0].content&&n.services.interpolator.interpolate(E.children[0].content,d,n.language);if(E.type==="tag"){let M=_[parseInt(E.name,10)];g.length===1&&!M&&(M=g[0][E.name]),M||(M={});const $=Object.keys(E.attrs).length!==0?D1({props:E.attrs},M):M,ne=Pu($),x=ne&&jf(E,!0)&&!E.voidElement,G=a&&typeof $=="object"&&$.dummy&&!ne,S=typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,E.name);if(typeof $=="string"){const k=n.services.interpolator.interpolate($,d,n.language);w.push(k)}else if(jf($)||x){const k=f($,E,g);p($,k,w,R)}else if(G){const k=h(_,E.children,g);p($,k,w,R)}else if(Number.isNaN(parseFloat(E.name)))if(S){const k=f($,E,g);p($,k,w,R,E.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(E.name)>-1)if(E.voidElement)w.push(lc(E.name,{key:`${E.name}-${R}`}));else{const k=h(_,E.children,g);w.push(lc(E.name,{key:`${E.name}-${R}`},k))}else if(E.voidElement)w.push(`<${E.name} />`);else{const k=h(_,E.children,g);w.push(`<${E.name}>${k}</${E.name}>`)}else if(typeof $=="object"&&!ne){const k=E.children[0]?j:null;k&&w.push(k)}else p($,j,w,R,E.children.length!==1||!j)}else if(E.type==="text"){const M=r.transWrapTextNodes,$=s?r.unescape(n.services.interpolator.interpolate(E.content,d,n.language)):n.services.interpolator.interpolate(E.content,d,n.language);M?w.push(lc(M,{key:`${E.name}-${R}`},$)):w.push($)}return w},[])}const m=h([{dummy:!0,children:t||[]}],u,Lo(t||[]));return Uf(m[0])}function k1(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:l,ns:u,i18n:d,t:f,shouldUnescape:p,...h}=t;const m=d||Fh();if(!m)return $u("You will need to pass in an i18next instance by using i18nextReactModule"),e;const v=f||m.t.bind(m)||(x=>x);s&&(o.context=s);const y={...L_(),...m.options&&m.options.react};let g=u||v.ns||m.options&&m.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"];const _=$_(e,y),T=c||_||y.transEmptyNodeValue||i,{hashTransKey:w}=y,E=i||(w?w(_||T):_||T);m.options&&m.options.interpolation&&m.options.interpolation.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...m.options.interpolation.defaultVariables}:{...m.options.interpolation.defaultVariables});const R=a?o.interpolation:{interpolation:{...o.interpolation,prefix:"#$?",suffix:"?$#"}},j={...o,count:n,...a,...R,defaultValue:T,ns:g},M=E?v(E,j):T;l&&Object.keys(l).forEach(x=>{const G=l[x];if(typeof G.type=="function"||!G.props||!G.props.children||M.indexOf(`${x}/>`)<0&&M.indexOf(`${x} />`)<0)return;function S(){return wi.createElement(wi.Fragment,null,G)}l[x]=wi.createElement(S,null)});const $=R1(l||e,M,m,y,j,p),ne=r!==void 0?r:y.defaultTransParent;return ne?lc(ne,h,$):$}const j_=Ph();class N1{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function U_(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:l,ns:u,i18n:d,t:f,shouldUnescape:p,...h}=t;const{i18n:m,defaultNS:v}=yl(j_)||{},y=d||m||Fh(),g=f||y&&y.t.bind(y);return k1({children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o,values:a,defaults:c,components:l,ns:u||g&&g.ns||v||y&&y.options&&y.options.defaultNS,i18n:y,t:f,shouldUnescape:p,...h})}const A1=(t,e)=>{const n=Fu();return Pn(()=>{n.current=t},[t,e]),n.current};function so(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:r,defaultNS:i}=yl(j_)||{},s=n||r||Fh();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new N1),!s){$u("You will need to pass in an i18next instance by using initReactI18next");const _=(w,E)=>typeof E=="string"?E:E&&typeof E=="object"&&typeof E.defaultValue=="string"?E.defaultValue:Array.isArray(w)?w[w.length-1]:w,T=[_,{},!1];return T.t=_,T.i18n={},T.ready=!1,T}s.options.react&&s.options.react.wait!==void 0&&$u("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...L_(),...s.options.react,...e},{useSuspense:a,keyPrefix:c}=o;let l=i||s.options&&s.options.defaultNS;l=typeof l=="string"?[l]:l||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(l);const u=(s.isInitialized||s.initializedStoreOnce)&&l.every(_=>x1(_,s,o));function d(){return s.getFixedT(e.lng||null,o.nsMode==="fallback"?l:l[0],c)}const[f,p]=xn(d);let h=l.join();e.lng&&(h=`${e.lng}${h}`);const m=A1(h),v=Fu(!0);Pn(()=>{const{bindI18n:_,bindI18nStore:T}=o;v.current=!0,!u&&!a&&(e.lng?Qg(s,e.lng,l,()=>{v.current&&p(d)}):Kg(s,l,()=>{v.current&&p(d)})),u&&m&&m!==h&&v.current&&p(d);function w(){v.current&&p(d)}return _&&s&&s.on(_,w),T&&s&&s.store.on(T,w),()=>{v.current=!1,_&&s&&_.split(" ").forEach(E=>s.off(E,w)),T&&s&&T.split(" ").forEach(E=>s.store.off(E,w))}},[s,h]);const y=Fu(!0);Pn(()=>{v.current&&!y.current&&p(d),y.current=!1},[s,c]);const g=[f,s,u];if(g.t=f,g.i18n=s,g.ready=u,u||!u&&!a)return g;throw new Promise(_=>{e.lng?Qg(s,e.lng,l,()=>_()):Kg(s,l,()=>_())})}let C1=0;function yn(t,e){const n=`atom${++C1}`,r={toString(){return n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=M1,r.write=L1),e&&(r.write=e),r}function M1(t){return t(this)}function L1(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const ey=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,ty=t=>"init"in t,ny=t=>!!t.write,ju=new WeakMap,Sp=t=>{var e;return wp(t)&&!((e=ju.get(t))!=null&&e[1])},P1=(t,e)=>{const n=ju.get(t);n&&(n[1]=!0,n[0].forEach(r=>r(e)))},F1=t=>{if(ju.has(t))return;const e=[new Set,!1];ju.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},wp=t=>typeof(t==null?void 0:t.then)=="function",ry=t=>"v"in t||"e"in t,Wl=t=>{if("e"in t)throw t.e;return t.v},B_=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},iy=(t,e,n,r,i)=>{var s;n.d.set(r,i.n),Sp(n.v)&&B_(e,n.v,i),(s=i.m)==null||s.t.add(e),t&&$1(t,r,e)},La=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),uc=(t,e,n)=>{t[e].add(n)},sy=(t,e,n)=>{t.D.has(e)||(t.D.set(e,new Set),uc(t,"M",()=>{var r;(r=n.m)==null||r.l.forEach(i=>uc(t,"M",i))}))},$1=(t,e,n)=>{const r=t.D.get(e);r&&r.add(n)},j1=(t,e)=>t.D.get(e),Ss=t=>{let e,n=!1;const r=i=>{try{i()}catch(s){n||(e=s,n=!0)}};for(;t.H.size||t.M.size||t.L.size;)t.D.clear(),t.H.forEach(r),t.H.clear(),t.M.forEach(r),t.M.clear(),t.L.forEach(r),t.L.clear();if(n)throw e},z_=(...[t,e,n,r])=>{const i=(y,g,_)=>{const T="v"in g,w=g.v,E=Sp(g.v)?g.v:null;if(wp(_)){F1(_);for(const R of g.d.keys())B_(y,_,t(R));g.v=_}else g.v=_;delete g.e,delete g.x,(!T||!Object.is(w,g.v))&&(++g.n,E&&P1(E,_))},s=(y,g)=>{var _;const T=t(g);if(ry(T)&&(T.m&&!T.x||Array.from(T.d).every(([$,ne])=>s(y,$).n===ne)))return T;T.d.clear();let w=!0;const E=$=>{if(ey(g,$)){const x=t($);if(!ry(x))if(ty($))i($,x,$.init);else throw new Error("no atom init");return Wl(x)}const ne=s(y,$);try{return Wl(ne)}finally{if(w)iy(y,g,T,$,ne);else{const x=La();iy(x,g,T,$,ne),d(x,g,T),Ss(x)}}};let R,j;const M={get signal(){return R||(R=new AbortController),R.signal},get setSelf(){return!j&&ny(g)&&(j=(...$)=>{if(!w)return u(g,...$)}),j}};try{const $=e(g,E,M);if(i(g,T,$),wp($)){(_=$.onCancel)==null||_.call($,()=>R==null?void 0:R.abort());const ne=()=>{if(T.m){const x=La();d(x,g,T),Ss(x)}};$.then(ne,ne)}return T}catch($){return delete T.v,T.e=$,delete T.x,++T.n,T}finally{w=!1}},o=y=>Wl(s(void 0,y)),a=(y,g,_)=>{var T,w;const E=new Map;for(const R of((T=_.m)==null?void 0:T.t)||[]){const j=t(R);j.m&&E.set(R,j)}for(const R of _.p)E.set(R,t(R));return(w=j1(y,g))==null||w.forEach(R=>{E.set(R,t(R))}),E},c=(y,g,_)=>{const T=[],w=new Set,E=new Set,R=[[g,_]];for(;R.length>0;){const[j,M]=R[R.length-1];if(E.has(j)){R.pop();continue}if(w.has(j)){T.push([j,M,M.n]),E.add(j),M.x=!0,R.pop();continue}w.add(j);for(const[$,ne]of a(y,j,M))j!==$&&!w.has($)&&R.push([$,ne])}uc(y,"H",()=>{const j=new Set([g]);for(let M=T.length-1;M>=0;--M){const[$,ne,x]=T[M];let G=!1;for(const S of ne.d.keys())if(S!==$&&j.has(S)){G=!0;break}G&&(s(y,$),d(y,$,ne),x!==ne.n&&(sy(y,$,ne),j.add($))),delete ne.x}})},l=(y,g,..._)=>{let T=!0;const w=R=>Wl(s(y,R)),E=(R,...j)=>{const M=t(R);try{if(ey(g,R)){if(!ty(R))throw new Error("atom not writable");const $=M.n,ne=j[0];i(R,M,ne),d(y,R,M),$!==M.n&&(sy(y,R,M),c(y,R,M));return}else return l(y,R,...j)}finally{T||Ss(y)}};try{return n(g,w,E,..._)}finally{T=!1}},u=(y,...g)=>{const _=La();try{return l(_,y,...g)}finally{Ss(_)}},d=(y,g,_)=>{if(_.m&&!Sp(_.v)){for(const T of _.d.keys())_.m.d.has(T)||(f(y,T,t(T)).t.add(g),_.m.d.add(T));for(const T of _.m.d||[])if(!_.d.has(T)){_.m.d.delete(T);const w=p(y,T,t(T));w==null||w.t.delete(g)}}},f=(y,g,_)=>{if(!_.m){s(y,g);for(const T of _.d.keys())f(y,T,t(T)).t.add(g);if(_.m={l:new Set,d:new Set(_.d.keys()),t:new Set},ny(g)){const T=_.m;let w;const E=(R,j)=>{let M=!0;w=(...$)=>{try{return l(R,g,...$)}finally{M||Ss(R)}};try{return j()}finally{M=!1}};uc(y,"L",()=>{const R=E(y,()=>r(g,(...j)=>w(...j)));R&&(T.u=j=>E(j,R))})}}return _.m},p=(y,g,_)=>{if(_.m&&!_.m.l.size&&!Array.from(_.m.t).some(T=>{var w;return(w=t(T).m)==null?void 0:w.d.has(g)})){const T=_.m.u;T&&uc(y,"L",()=>T(y)),delete _.m;for(const w of _.d.keys()){const E=p(y,w,t(w));E==null||E.t.delete(g)}return}return _.m};return{get:o,set:u,sub:(y,g)=>{const _=La(),T=t(y),E=f(_,y,T).l;return E.add(g),Ss(_),()=>{E.delete(g);const R=La();p(R,y,T),Ss(R)}},unstable_derive:y=>z_(...y(t,e,n,r))}},$h=()=>{const t=new WeakMap;return z_(r=>{let i=t.get(r);return i||(i={d:new Map,p:new Set,n:0},t.set(r,i)),i},(r,...i)=>r.read(...i),(r,...i)=>r.write(...i),(r,...i)=>{var s;return(s=r.onMount)==null?void 0:s.call(r,...i)})};let Bf;const U1=()=>(Bf||(Bf=$h()),Bf),V_=Ph(void 0),H_=t=>yl(V_)||U1(),B1=({children:t,store:e})=>{const n=Fu(void 0);return!e&&!n.current&&(n.current=$h()),lc(V_.Provider,{value:e||n.current},t)},W_=t=>typeof(t==null?void 0:t.then)=="function",z1=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},V1=wi.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(z1(t),t)}),zf=new WeakMap,H1=t=>{let e=zf.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>l=>{i===c&&n(l)},o=c=>l=>{i===c&&r(l)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(l=>{W_(l)?(zf.set(l,e),i=l,l.then(s(l),o(l)),a(l)):n(l)})};t.then(s(t),o(t)),a(t)}),zf.set(t,e)),e};function _l(t,e){const n=H_(),[[r,i,s],o]=p1(l=>{const u=n.get(t);return Object.is(l[0],u)&&l[1]===n&&l[2]===t?l:[u,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),Pn(()=>{const l=n.sub(t,()=>{o()});return o(),l},[n,t,void 0]),h1(a),W_(a)){const l=H1(a);return V1(l)}return a}function W1(t,e){const n=H_();return Rt((...i)=>n.set(t,...i),[n,t])}function Nr(t,e){return[_l(t),W1(t)]}const q1=Symbol("");function Z1(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 l=t(a);return r.set(a,[l,Date.now()]),o("CREATE",a,l),l};function o(a,c,l){for(const u of i)u({type:a,param:c,atom:l})}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,[l,u]]of r)n(u,c)&&(r.delete(c),o("REMOVE",c,l))},s}const G1=t=>typeof(t==null?void 0:t.then)=="function";function Y1(t=()=>{try{return window.localStorage}catch{return}},e){var n;let r,i;const s={getItem:(c,l)=>{var u,d;const f=h=>{if(h=h||"",r!==h){try{i=JSON.parse(h,e==null?void 0:e.reviver)}catch{return l}r=h}return i},p=(d=(u=t())==null?void 0:u.getItem(c))!=null?d:null;return G1(p)?p.then(f):f(p)},setItem:(c,l)=>{var u;return(u=t())==null?void 0:u.setItem(c,JSON.stringify(l,void 0))},removeItem:c=>{var l;return(l=t())==null?void 0:l.removeItem(c)}},o=c=>(l,u,d)=>c(l,f=>{let p;try{p=JSON.parse(f||"")}catch{p=d}u(p)});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,l)=>{if(!(t()instanceof window.Storage))return()=>{};const u=d=>{d.storageArea===t()&&d.key===c&&l(d.newValue)};return window.addEventListener("storage",u),()=>{window.removeEventListener("storage",u)}}),a&&(s.subscribe=o(a)),s}const J1=Y1();function q_(t,e,n=J1,r){const i=yn(e);return i.onMount=o=>{o(n.getItem(t,e));let a;return n.subscribe&&(a=n.subscribe(t,o,e)),a},yn(o=>o(i),(o,a,c)=>{const l=typeof c=="function"?c(o(i)):c;return l===q1?(a(i,e),n.removeItem(t)):l instanceof Promise?l.then(u=>(a(i,u),n.setItem(t,u))):(a(i,l),n.setItem(t,l))})}const oy=(t,e,n)=>(e.has(n)?e:e.set(n,t())).get(n),X1=new WeakMap,K1=(t,e,n)=>{const r=oy(()=>new WeakMap,X1,e);return oy(t,r,n)},Q1=t=>t instanceof Promise,eD=()=>{};function Z_(t,e=eD){return K1(()=>{const n=new WeakMap,r=new WeakMap,i=yn(0),s=yn((o,{setSelf:a})=>{o(i);const c=o(s),l=o(t);if(!Q1(l))return{v:l};if(l!==(c==null?void 0:c.p)&&l.then(u=>{r.set(l,u),a()},u=>{n.set(l,u),a()}),n.has(l))throw n.get(l);return r.has(l)?{p:l,v:r.get(l)}:c&&"v"in c?{p:l,f:e(c.v),v:c.v}:{p:l,f:e()}},(o,a)=>{a(i,c=>c+1)});return s.init=void 0,yn(o=>{const a=o(s);return"f"in a?a.f:a.v},(o,a,...c)=>a(t,...c))},t,e)}const Ga=vi.routerBasename,bl=(t,e,n,r)=>q_(`${Ga}:${t}`,e,void 0),tD=(t,e,n)=>q_(t,e,{getItem(r,i){const s=localStorage.getItem(`${Ga}:${r}`);return s?JSON.parse(s):i},setItem(r,i){localStorage.setItem(`${Ga}:${r}`,JSON.stringify(i)),n(i)},removeItem(r){localStorage.removeItem(`${Ga}:${r}`)},subscribe(r,i){if(typeof window.addEventListener>"u")return()=>null;function s(o){o.storageArea===localStorage&&o.key===`${Ga}:${r}`&&i(o.newValue??"")}return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)}}),nD="acceptedCookies",rD=bl(nD,{analytics:!1,marketing:!1,functional:!1}),jh=()=>Nr(rD),iD="display-cookie-banner",sD=bl(iD,!0),oD=()=>Nr(sD);function aD(t){const{open:e,onAddLocalDrive:n,onClose:r}=t;async function i(s){await n(s),r()}return Te(qO,{open:e,onSubmit:i,onOpenChange:s=>{if(!s)return r()}})}const cD=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),lD=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),uD=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),dD=/[^\p{L}\d]+/giu,ay="$1\0$2",cy="";function G_(t){let e=t.trim();e=e.replace(cD,ay).replace(lD,ay),e=e.replace(dD,"\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 fD(t){const e=G_(t);for(let n=0;n<e.length;n++){const r=e[n],i=uD.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 Y_(t,e){const[n,r,i]=gD(t,e),s=pD(e==null?void 0:e.locale),o=hD(e==null?void 0:e.locale),a=mD(s,o);return n+r.map(a).join("")+i}function pD(t){return e=>e.toLocaleLowerCase(t)}function hD(t){return e=>e.toLocaleUpperCase(t)}function mD(t,e){return(n,r)=>{const i=n[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(n.slice(1))}}function gD(t,e={}){const n=e.split??(e.separateNumbers?fD:G_),r=e.prefixCharacters??cy,i=e.suffixCharacters??cy;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 kt(t,e){if(!!!t)throw new Error(e)}function Bs(t){return typeof t=="object"&&t!==null}function xr(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const yD=/\r\n|[\n\r]/g;function Tp(t,e){let n=0,r=1;for(const i of t.body.matchAll(yD)){if(typeof i.index=="number"||xr(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function vD(t){return J_(t.source,Tp(t.source,t.start))}function J_(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,l=`${t.name}:${o}:${c}
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DaiqEkhm.js","assets/main.xvWSq1ZZ.js","assets/app-loader-Brlfz2zT.js","assets/app-loader-D5wPX62N.css","assets/browser-DvOVpOMz.js","assets/router-BuelYVsv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var HO=Object.defineProperty;var Gg=t=>{throw TypeError(t)};var WO=(t,e,n)=>e in t?HO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var qe=(t,e,n)=>WO(t,typeof e!="symbol"?e+"":e,n),$f=(t,e,n)=>e.has(t)||Gg("Cannot "+n);var Dt=(t,e,n)=>($f(t,e,"read from private field"),n?n.call(t):e.get(t)),jr=(t,e,n)=>e.has(t)?Gg("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ma=(t,e,n,r)=>($f(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),mr=(t,e,n)=>($f(t,e,"access private method"),n);import{_ as Ko}from"./main.xvWSq1ZZ.js";import{jsx as Te,jsxs as Ft,Fragment as C_}from"react/jsx-runtime";import{AddLocalDriveModal as qO,AddRemoteDriveModal as ZO,ConnectConfirmationModal as GO,ReadRequiredModal as M_,FILE as bp,LOCAL as YO,ERROR as JO,CreateDocumentModal as XO,Modal as KO,Icon as Vl,Combobox as Za,Button as Mo,FormInput as Yg,ConnectDeleteDriveModal as QO,ConnectDeleteItemModal as e1,DriveSettingsModal as t1,SettingsModal as n1,DocumentSelectSettingsRow as r1,ClearStorageSettingsRow as i1,DependencyVersions as s1,ConnectUpgradeDriveModal as o1,CookieBanner as a1,WagmiContext as c1,UiNodesContextProvider as l1,ToastContainer as u1}from"@powerhousedao/design-system";import*as Fe from"react";import wi,{createElement as lc,isValidElement as Pu,cloneElement as d1,Children as f1,createContext as Ph,useContext as yl,useState as xn,useRef as Fu,useEffect as Pn,useReducer as p1,useDebugValue as h1,useCallback as Rt,useMemo as is,Suspense as m1}from"react";import{g as L_,a as Fh,c as vi,s as Hl,p as g1}from"./app-loader-Brlfz2zT.js";function y1(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 Ep(){return Ep=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},Ep.apply(null,arguments)}var ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qV(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 v1={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 _1=vl(v1);var b1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Jg(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(_1[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(b1),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 E1=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,S1=/^\s*$/,w1=Object.create(null);function P_(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(P_,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var T1={parse:function(t,e){e||(e={}),e.components||(e.components=w1);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(E1,function(c,l){if(o){if(c!=="</"+n.name+">")return;o=!1}var u,d=c.charAt(1)!=="/",f=c.startsWith("<!--"),p=l+c.length,h=t.charAt(p);if(f){var m=Jg(c);return s<0?(r.push(m),r):((u=i[s]).children.push(m),r)}if(d&&(s++,(n=Jg(c)).type==="tag"&&e.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!h||h==="<"||n.children.push({type:"text",content:t.slice(p,t.indexOf("<",p))}),s===0&&r.push(n),(u=i[s-1])&&u.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&&h!=="<"&&h)){u=s===-1?r:i[s].children;var v=t.indexOf("<",p),y=t.slice(p,v===-1?void 0:v);S1.test(y)&&(y=" "),(v>-1&&s+u.length>=0||y!==" ")&&u.push({type:"text",content:y})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+P_("",n)},"")}};function _u(){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 Xg={};function $u(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&Xg[e[0]]||(typeof e[0]=="string"&&(Xg[e[0]]=new Date),_u(...e))}const F_=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function Kg(t,e,n){t.loadNamespaces(e,F_(t,n))}function Qg(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,F_(t,r))}function I1(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 l=e.services.backendConnector.state[`${a}|${c}`];return l===-1||l===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 x1(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?($u("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}}):I1(t,e,n)}function jf(t,e){if(!t)return!1;const n=t.props?t.props.children:t.children;return e?n.length>0:!!n}function Uf(t){if(!t)return[];const e=t.props?t.props.children:t.children;return t.props&&t.props.i18nIsDynamicList?Lo(e):e}function O1(t){return Object.prototype.toString.call(t)!=="[object Array]"?!1:t.every(e=>Pu(e))}function Lo(t){return Array.isArray(t)?t:[t]}function D1(t,e){const n={...e};return n.props=Object.assign(t.props,e.props),n}function $_(t,e){if(!t)return"";let n="";const r=Lo(t),i=e.transSupportBasicHtmlNodes&&e.transKeepBasicHtmlNodesFor?e.transKeepBasicHtmlNodesFor:[];return r.forEach((s,o)=>{if(typeof s=="string")n+=`${s}`;else if(Pu(s)){const a=Object.keys(s.props).length,c=i.indexOf(s.type)>-1,l=s.props.children;if(!l&&c&&a===0)n+=`<${s.type}/>`;else if(!l&&(!c||a!==0))n+=`<${o}></${o}>`;else if(s.props.i18nIsDynamicList)n+=`<${o}></${o}>`;else if(c&&a===1&&typeof l=="string")n+=`<${s.type}>${l}</${s.type}>`;else{const u=$_(l,e);n+=`<${o}>${u}</${o}>`}}else if(s===null)_u("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof s=="object"){const{format:a,...c}=s,l=Object.keys(c);if(l.length===1){const u=a?`${l[0]}, ${a}`:l[0];n+=`{{${u}}}`}else _u("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",s)}else _u("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 R1(t,e,n,r,i,s){if(e==="")return[];const o=r.transKeepBasicHtmlNodesFor||[],a=e&&new RegExp(o.map(v=>`<${v}`).join("|")).test(e);if(!t&&!a&&!s)return[e];const c={};function l(v){Lo(v).forEach(g=>{typeof g!="string"&&(jf(g)?l(Uf(g)):typeof g=="object"&&!Pu(g)&&Object.assign(c,g))})}l(t);const u=T1.parse(`<0>${e}</0>`),d={...c,...i};function f(v,y,g){const _=Uf(v),T=h(_,y.children,g);return O1(_)&&T.length===0||v.props&&v.props.i18nIsDynamicList?_:T}function p(v,y,g,_,T){v.dummy?(v.children=y,g.push(d1(v,{key:_},T?void 0:y))):g.push(...f1.map([v],w=>{const E={...w.props};return delete E.i18nIsDynamicList,wi.createElement(w.type,Ep({},E,{key:_,ref:w.ref},T?{}:{children:y}))}))}function h(v,y,g){const _=Lo(v);return Lo(y).reduce((w,E,R)=>{const j=E.children&&E.children[0]&&E.children[0].content&&n.services.interpolator.interpolate(E.children[0].content,d,n.language);if(E.type==="tag"){let M=_[parseInt(E.name,10)];g.length===1&&!M&&(M=g[0][E.name]),M||(M={});const $=Object.keys(E.attrs).length!==0?D1({props:E.attrs},M):M,ne=Pu($),x=ne&&jf(E,!0)&&!E.voidElement,G=a&&typeof $=="object"&&$.dummy&&!ne,S=typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,E.name);if(typeof $=="string"){const k=n.services.interpolator.interpolate($,d,n.language);w.push(k)}else if(jf($)||x){const k=f($,E,g);p($,k,w,R)}else if(G){const k=h(_,E.children,g);p($,k,w,R)}else if(Number.isNaN(parseFloat(E.name)))if(S){const k=f($,E,g);p($,k,w,R,E.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(E.name)>-1)if(E.voidElement)w.push(lc(E.name,{key:`${E.name}-${R}`}));else{const k=h(_,E.children,g);w.push(lc(E.name,{key:`${E.name}-${R}`},k))}else if(E.voidElement)w.push(`<${E.name} />`);else{const k=h(_,E.children,g);w.push(`<${E.name}>${k}</${E.name}>`)}else if(typeof $=="object"&&!ne){const k=E.children[0]?j:null;k&&w.push(k)}else p($,j,w,R,E.children.length!==1||!j)}else if(E.type==="text"){const M=r.transWrapTextNodes,$=s?r.unescape(n.services.interpolator.interpolate(E.content,d,n.language)):n.services.interpolator.interpolate(E.content,d,n.language);M?w.push(lc(M,{key:`${E.name}-${R}`},$)):w.push($)}return w},[])}const m=h([{dummy:!0,children:t||[]}],u,Lo(t||[]));return Uf(m[0])}function k1(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:l,ns:u,i18n:d,t:f,shouldUnescape:p,...h}=t;const m=d||Fh();if(!m)return $u("You will need to pass in an i18next instance by using i18nextReactModule"),e;const v=f||m.t.bind(m)||(x=>x);s&&(o.context=s);const y={...L_(),...m.options&&m.options.react};let g=u||v.ns||m.options&&m.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"];const _=$_(e,y),T=c||_||y.transEmptyNodeValue||i,{hashTransKey:w}=y,E=i||(w?w(_||T):_||T);m.options&&m.options.interpolation&&m.options.interpolation.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...m.options.interpolation.defaultVariables}:{...m.options.interpolation.defaultVariables});const R=a?o.interpolation:{interpolation:{...o.interpolation,prefix:"#$?",suffix:"?$#"}},j={...o,count:n,...a,...R,defaultValue:T,ns:g},M=E?v(E,j):T;l&&Object.keys(l).forEach(x=>{const G=l[x];if(typeof G.type=="function"||!G.props||!G.props.children||M.indexOf(`${x}/>`)<0&&M.indexOf(`${x} />`)<0)return;function S(){return wi.createElement(wi.Fragment,null,G)}l[x]=wi.createElement(S,null)});const $=R1(l||e,M,m,y,j,p),ne=r!==void 0?r:y.defaultTransParent;return ne?lc(ne,h,$):$}const j_=Ph();class N1{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function U_(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:l,ns:u,i18n:d,t:f,shouldUnescape:p,...h}=t;const{i18n:m,defaultNS:v}=yl(j_)||{},y=d||m||Fh(),g=f||y&&y.t.bind(y);return k1({children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o,values:a,defaults:c,components:l,ns:u||g&&g.ns||v||y&&y.options&&y.options.defaultNS,i18n:y,t:f,shouldUnescape:p,...h})}const A1=(t,e)=>{const n=Fu();return Pn(()=>{n.current=t},[t,e]),n.current};function so(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:r,defaultNS:i}=yl(j_)||{},s=n||r||Fh();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new N1),!s){$u("You will need to pass in an i18next instance by using initReactI18next");const _=(w,E)=>typeof E=="string"?E:E&&typeof E=="object"&&typeof E.defaultValue=="string"?E.defaultValue:Array.isArray(w)?w[w.length-1]:w,T=[_,{},!1];return T.t=_,T.i18n={},T.ready=!1,T}s.options.react&&s.options.react.wait!==void 0&&$u("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...L_(),...s.options.react,...e},{useSuspense:a,keyPrefix:c}=o;let l=i||s.options&&s.options.defaultNS;l=typeof l=="string"?[l]:l||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(l);const u=(s.isInitialized||s.initializedStoreOnce)&&l.every(_=>x1(_,s,o));function d(){return s.getFixedT(e.lng||null,o.nsMode==="fallback"?l:l[0],c)}const[f,p]=xn(d);let h=l.join();e.lng&&(h=`${e.lng}${h}`);const m=A1(h),v=Fu(!0);Pn(()=>{const{bindI18n:_,bindI18nStore:T}=o;v.current=!0,!u&&!a&&(e.lng?Qg(s,e.lng,l,()=>{v.current&&p(d)}):Kg(s,l,()=>{v.current&&p(d)})),u&&m&&m!==h&&v.current&&p(d);function w(){v.current&&p(d)}return _&&s&&s.on(_,w),T&&s&&s.store.on(T,w),()=>{v.current=!1,_&&s&&_.split(" ").forEach(E=>s.off(E,w)),T&&s&&T.split(" ").forEach(E=>s.store.off(E,w))}},[s,h]);const y=Fu(!0);Pn(()=>{v.current&&!y.current&&p(d),y.current=!1},[s,c]);const g=[f,s,u];if(g.t=f,g.i18n=s,g.ready=u,u||!u&&!a)return g;throw new Promise(_=>{e.lng?Qg(s,e.lng,l,()=>_()):Kg(s,l,()=>_())})}let C1=0;function yn(t,e){const n=`atom${++C1}`,r={toString(){return n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=M1,r.write=L1),e&&(r.write=e),r}function M1(t){return t(this)}function L1(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const ey=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,ty=t=>"init"in t,ny=t=>!!t.write,ju=new WeakMap,Sp=t=>{var e;return wp(t)&&!((e=ju.get(t))!=null&&e[1])},P1=(t,e)=>{const n=ju.get(t);n&&(n[1]=!0,n[0].forEach(r=>r(e)))},F1=t=>{if(ju.has(t))return;const e=[new Set,!1];ju.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},wp=t=>typeof(t==null?void 0:t.then)=="function",ry=t=>"v"in t||"e"in t,Wl=t=>{if("e"in t)throw t.e;return t.v},B_=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},iy=(t,e,n,r,i)=>{var s;n.d.set(r,i.n),Sp(n.v)&&B_(e,n.v,i),(s=i.m)==null||s.t.add(e),t&&$1(t,r,e)},La=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),uc=(t,e,n)=>{t[e].add(n)},sy=(t,e,n)=>{t.D.has(e)||(t.D.set(e,new Set),uc(t,"M",()=>{var r;(r=n.m)==null||r.l.forEach(i=>uc(t,"M",i))}))},$1=(t,e,n)=>{const r=t.D.get(e);r&&r.add(n)},j1=(t,e)=>t.D.get(e),Ss=t=>{let e,n=!1;const r=i=>{try{i()}catch(s){n||(e=s,n=!0)}};for(;t.H.size||t.M.size||t.L.size;)t.D.clear(),t.H.forEach(r),t.H.clear(),t.M.forEach(r),t.M.clear(),t.L.forEach(r),t.L.clear();if(n)throw e},z_=(...[t,e,n,r])=>{const i=(y,g,_)=>{const T="v"in g,w=g.v,E=Sp(g.v)?g.v:null;if(wp(_)){F1(_);for(const R of g.d.keys())B_(y,_,t(R));g.v=_}else g.v=_;delete g.e,delete g.x,(!T||!Object.is(w,g.v))&&(++g.n,E&&P1(E,_))},s=(y,g)=>{var _;const T=t(g);if(ry(T)&&(T.m&&!T.x||Array.from(T.d).every(([$,ne])=>s(y,$).n===ne)))return T;T.d.clear();let w=!0;const E=$=>{if(ey(g,$)){const x=t($);if(!ry(x))if(ty($))i($,x,$.init);else throw new Error("no atom init");return Wl(x)}const ne=s(y,$);try{return Wl(ne)}finally{if(w)iy(y,g,T,$,ne);else{const x=La();iy(x,g,T,$,ne),d(x,g,T),Ss(x)}}};let R,j;const M={get signal(){return R||(R=new AbortController),R.signal},get setSelf(){return!j&&ny(g)&&(j=(...$)=>{if(!w)return u(g,...$)}),j}};try{const $=e(g,E,M);if(i(g,T,$),wp($)){(_=$.onCancel)==null||_.call($,()=>R==null?void 0:R.abort());const ne=()=>{if(T.m){const x=La();d(x,g,T),Ss(x)}};$.then(ne,ne)}return T}catch($){return delete T.v,T.e=$,delete T.x,++T.n,T}finally{w=!1}},o=y=>Wl(s(void 0,y)),a=(y,g,_)=>{var T,w;const E=new Map;for(const R of((T=_.m)==null?void 0:T.t)||[]){const j=t(R);j.m&&E.set(R,j)}for(const R of _.p)E.set(R,t(R));return(w=j1(y,g))==null||w.forEach(R=>{E.set(R,t(R))}),E},c=(y,g,_)=>{const T=[],w=new Set,E=new Set,R=[[g,_]];for(;R.length>0;){const[j,M]=R[R.length-1];if(E.has(j)){R.pop();continue}if(w.has(j)){T.push([j,M,M.n]),E.add(j),M.x=!0,R.pop();continue}w.add(j);for(const[$,ne]of a(y,j,M))j!==$&&!w.has($)&&R.push([$,ne])}uc(y,"H",()=>{const j=new Set([g]);for(let M=T.length-1;M>=0;--M){const[$,ne,x]=T[M];let G=!1;for(const S of ne.d.keys())if(S!==$&&j.has(S)){G=!0;break}G&&(s(y,$),d(y,$,ne),x!==ne.n&&(sy(y,$,ne),j.add($))),delete ne.x}})},l=(y,g,..._)=>{let T=!0;const w=R=>Wl(s(y,R)),E=(R,...j)=>{const M=t(R);try{if(ey(g,R)){if(!ty(R))throw new Error("atom not writable");const $=M.n,ne=j[0];i(R,M,ne),d(y,R,M),$!==M.n&&(sy(y,R,M),c(y,R,M));return}else return l(y,R,...j)}finally{T||Ss(y)}};try{return n(g,w,E,..._)}finally{T=!1}},u=(y,...g)=>{const _=La();try{return l(_,y,...g)}finally{Ss(_)}},d=(y,g,_)=>{if(_.m&&!Sp(_.v)){for(const T of _.d.keys())_.m.d.has(T)||(f(y,T,t(T)).t.add(g),_.m.d.add(T));for(const T of _.m.d||[])if(!_.d.has(T)){_.m.d.delete(T);const w=p(y,T,t(T));w==null||w.t.delete(g)}}},f=(y,g,_)=>{if(!_.m){s(y,g);for(const T of _.d.keys())f(y,T,t(T)).t.add(g);if(_.m={l:new Set,d:new Set(_.d.keys()),t:new Set},ny(g)){const T=_.m;let w;const E=(R,j)=>{let M=!0;w=(...$)=>{try{return l(R,g,...$)}finally{M||Ss(R)}};try{return j()}finally{M=!1}};uc(y,"L",()=>{const R=E(y,()=>r(g,(...j)=>w(...j)));R&&(T.u=j=>E(j,R))})}}return _.m},p=(y,g,_)=>{if(_.m&&!_.m.l.size&&!Array.from(_.m.t).some(T=>{var w;return(w=t(T).m)==null?void 0:w.d.has(g)})){const T=_.m.u;T&&uc(y,"L",()=>T(y)),delete _.m;for(const w of _.d.keys()){const E=p(y,w,t(w));E==null||E.t.delete(g)}return}return _.m};return{get:o,set:u,sub:(y,g)=>{const _=La(),T=t(y),E=f(_,y,T).l;return E.add(g),Ss(_),()=>{E.delete(g);const R=La();p(R,y,T),Ss(R)}},unstable_derive:y=>z_(...y(t,e,n,r))}},$h=()=>{const t=new WeakMap;return z_(r=>{let i=t.get(r);return i||(i={d:new Map,p:new Set,n:0},t.set(r,i)),i},(r,...i)=>r.read(...i),(r,...i)=>r.write(...i),(r,...i)=>{var s;return(s=r.onMount)==null?void 0:s.call(r,...i)})};let Bf;const U1=()=>(Bf||(Bf=$h()),Bf),V_=Ph(void 0),H_=t=>yl(V_)||U1(),B1=({children:t,store:e})=>{const n=Fu(void 0);return!e&&!n.current&&(n.current=$h()),lc(V_.Provider,{value:e||n.current},t)},W_=t=>typeof(t==null?void 0:t.then)=="function",z1=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},V1=wi.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(z1(t),t)}),zf=new WeakMap,H1=t=>{let e=zf.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>l=>{i===c&&n(l)},o=c=>l=>{i===c&&r(l)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(l=>{W_(l)?(zf.set(l,e),i=l,l.then(s(l),o(l)),a(l)):n(l)})};t.then(s(t),o(t)),a(t)}),zf.set(t,e)),e};function _l(t,e){const n=H_(),[[r,i,s],o]=p1(l=>{const u=n.get(t);return Object.is(l[0],u)&&l[1]===n&&l[2]===t?l:[u,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),Pn(()=>{const l=n.sub(t,()=>{o()});return o(),l},[n,t,void 0]),h1(a),W_(a)){const l=H1(a);return V1(l)}return a}function W1(t,e){const n=H_();return Rt((...i)=>n.set(t,...i),[n,t])}function Nr(t,e){return[_l(t),W1(t)]}const q1=Symbol("");function Z1(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 l=t(a);return r.set(a,[l,Date.now()]),o("CREATE",a,l),l};function o(a,c,l){for(const u of i)u({type:a,param:c,atom:l})}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,[l,u]]of r)n(u,c)&&(r.delete(c),o("REMOVE",c,l))},s}const G1=t=>typeof(t==null?void 0:t.then)=="function";function Y1(t=()=>{try{return window.localStorage}catch{return}},e){var n;let r,i;const s={getItem:(c,l)=>{var u,d;const f=h=>{if(h=h||"",r!==h){try{i=JSON.parse(h,e==null?void 0:e.reviver)}catch{return l}r=h}return i},p=(d=(u=t())==null?void 0:u.getItem(c))!=null?d:null;return G1(p)?p.then(f):f(p)},setItem:(c,l)=>{var u;return(u=t())==null?void 0:u.setItem(c,JSON.stringify(l,void 0))},removeItem:c=>{var l;return(l=t())==null?void 0:l.removeItem(c)}},o=c=>(l,u,d)=>c(l,f=>{let p;try{p=JSON.parse(f||"")}catch{p=d}u(p)});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,l)=>{if(!(t()instanceof window.Storage))return()=>{};const u=d=>{d.storageArea===t()&&d.key===c&&l(d.newValue)};return window.addEventListener("storage",u),()=>{window.removeEventListener("storage",u)}}),a&&(s.subscribe=o(a)),s}const J1=Y1();function q_(t,e,n=J1,r){const i=yn(e);return i.onMount=o=>{o(n.getItem(t,e));let a;return n.subscribe&&(a=n.subscribe(t,o,e)),a},yn(o=>o(i),(o,a,c)=>{const l=typeof c=="function"?c(o(i)):c;return l===q1?(a(i,e),n.removeItem(t)):l instanceof Promise?l.then(u=>(a(i,u),n.setItem(t,u))):(a(i,l),n.setItem(t,l))})}const oy=(t,e,n)=>(e.has(n)?e:e.set(n,t())).get(n),X1=new WeakMap,K1=(t,e,n)=>{const r=oy(()=>new WeakMap,X1,e);return oy(t,r,n)},Q1=t=>t instanceof Promise,eD=()=>{};function Z_(t,e=eD){return K1(()=>{const n=new WeakMap,r=new WeakMap,i=yn(0),s=yn((o,{setSelf:a})=>{o(i);const c=o(s),l=o(t);if(!Q1(l))return{v:l};if(l!==(c==null?void 0:c.p)&&l.then(u=>{r.set(l,u),a()},u=>{n.set(l,u),a()}),n.has(l))throw n.get(l);return r.has(l)?{p:l,v:r.get(l)}:c&&"v"in c?{p:l,f:e(c.v),v:c.v}:{p:l,f:e()}},(o,a)=>{a(i,c=>c+1)});return s.init=void 0,yn(o=>{const a=o(s);return"f"in a?a.f:a.v},(o,a,...c)=>a(t,...c))},t,e)}const Ga=vi.routerBasename,bl=(t,e,n,r)=>q_(`${Ga}:${t}`,e,void 0),tD=(t,e,n)=>q_(t,e,{getItem(r,i){const s=localStorage.getItem(`${Ga}:${r}`);return s?JSON.parse(s):i},setItem(r,i){localStorage.setItem(`${Ga}:${r}`,JSON.stringify(i)),n(i)},removeItem(r){localStorage.removeItem(`${Ga}:${r}`)},subscribe(r,i){if(typeof window.addEventListener>"u")return()=>null;function s(o){o.storageArea===localStorage&&o.key===`${Ga}:${r}`&&i(o.newValue??"")}return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)}}),nD="acceptedCookies",rD=bl(nD,{analytics:!1,marketing:!1,functional:!1}),jh=()=>Nr(rD),iD="display-cookie-banner",sD=bl(iD,!0),oD=()=>Nr(sD);function aD(t){const{open:e,onAddLocalDrive:n,onClose:r}=t;async function i(s){await n(s),r()}return Te(qO,{open:e,onSubmit:i,onOpenChange:s=>{if(!s)return r()}})}const cD=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),lD=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),uD=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),dD=/[^\p{L}\d]+/giu,ay="$1\0$2",cy="";function G_(t){let e=t.trim();e=e.replace(cD,ay).replace(lD,ay),e=e.replace(dD,"\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 fD(t){const e=G_(t);for(let n=0;n<e.length;n++){const r=e[n],i=uD.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 Y_(t,e){const[n,r,i]=gD(t,e),s=pD(e==null?void 0:e.locale),o=hD(e==null?void 0:e.locale),a=mD(s,o);return n+r.map(a).join("")+i}function pD(t){return e=>e.toLocaleLowerCase(t)}function hD(t){return e=>e.toLocaleUpperCase(t)}function mD(t,e){return(n,r)=>{const i=n[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(n.slice(1))}}function gD(t,e={}){const n=e.split??(e.separateNumbers?fD:G_),r=e.prefixCharacters??cy,i=e.suffixCharacters??cy;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 kt(t,e){if(!!!t)throw new Error(e)}function Bs(t){return typeof t=="object"&&t!==null}function xr(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const yD=/\r\n|[\n\r]/g;function Tp(t,e){let n=0,r=1;for(const i of t.body.matchAll(yD)){if(typeof i.index=="number"||xr(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function vD(t){return J_(t.source,Tp(t.source,t.start))}function J_(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,l=`${t.name}:${o}:${c}
|
|
3
3
|
`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){const f=Math.floor(c/80),p=c%80,h=[];for(let m=0;m<d.length;m+=80)h.push(d.slice(m,m+80));return l+ly([[`${o} |`,h[0]],...h.slice(1,f+1).map(m=>["|",m]),["|","^".padStart(p)],["|",h[f+1]]])}return l+ly([[`${o-1} |`,u[i-1]],[`${o} |`,d],["|","^".padStart(c)],[`${o+1} |`,u[i+1]]])}function ly(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(`
|
|
4
4
|
`)}function _D(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 _e extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:c,path:l,originalError:u,extensions:d}=_D(n);super(e),this.name="GraphQLError",this.path=l??void 0,this.originalError=u??void 0,this.nodes=uy(Array.isArray(o)?o:o?[o]:void 0);const f=uy((r=this.nodes)===null||r===void 0?void 0:r.map(h=>h.loc).filter(h=>h!=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(h=>h.start)),this.locations=c&&a?c.map(h=>Tp(a,h)):f==null?void 0:f.map(h=>Tp(h.source,h.start));const p=Bs(u==null?void 0:u.extensions)?u==null?void 0:u.extensions:void 0;this.extensions=(s=d??p)!==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}}),u!=null&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,_e):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+=`
|
|
5
5
|
|
|
@@ -819,7 +819,7 @@ enum ReactionType {
|
|
|
819
819
|
"modules": []
|
|
820
820
|
}
|
|
821
821
|
]
|
|
822
|
-
}`,examples:[]},local:{schema:"",initialValue:"{}",examples:[]}}}]},j6=t=>t!=null;te.any().refine(t=>j6(t));function U6(){return te.object({__typename:te.literal("AddChangeLogItemInput").optional(),content:te.string(),id:te.string(),insertBefore:te.string().nullable()})}function B6(){return te.object({description:te.string().nullish(),id:te.string(),name:te.string()})}function z6(){return te.object({errorCode:te.string().nullish(),errorDescription:te.string().nullish(),errorName:te.string().nullish(),errorTemplate:te.string().nullish(),id:te.string(),operationId:te.string()})}function V6(){return te.object({example:te.string(),id:te.string(),operationId:te.string()})}function H6(){return te.object({description:te.string().nullish(),id:te.string(),moduleId:te.string(),name:te.string(),reducer:te.string().nullish(),schema:te.string().nullish(),template:te.string().nullish(),scope:wx().nullish()})}function W6(){return te.object({scope:te.string(),example:te.string(),id:te.string(),insertBefore:te.string().nullish()})}function q6(){return te.object({__typename:te.literal("DeleteChangeLogItemInput").optional(),id:te.string()})}function Z6(){return te.object({id:te.string()})}function G6(){return te.object({id:te.string()})}function Y6(){return te.object({id:te.string()})}function J6(){return te.object({id:te.string()})}function X6(){return te.object({scope:te.string(),id:te.string()})}function wx(){return te.literal("global").or(te.literal("local"))}function K6(){return te.object({newModuleId:te.string(),operationId:te.string()})}function Q6(){return te.object({__typename:te.literal("ReorderChangeLogItemsInput").optional(),order:te.array(te.string())})}function e4(){return te.object({moduleId:te.string(),order:te.array(te.string())})}function t4(){return te.object({order:te.array(te.string())})}function n4(){return te.object({operationId:te.string(),order:te.array(te.string())})}function r4(){return te.object({operationId:te.string(),order:te.array(te.string())})}function i4(){return te.object({scope:te.string(),order:te.array(te.string())})}function s4(){return te.object({authorName:te.string()})}function o4(){return te.object({authorWebsite:te.string()})}function a4(){return te.object({scope:te.string(),initialValue:te.string()})}function c4(){return te.object({description:te.string()})}function l4(){return te.object({extension:te.string()})}function u4(){return te.object({id:te.string()})}function d4(){return te.object({name:te.string()})}function f4(){return te.object({description:te.string().nullish(),id:te.string()})}function p4(){return te.object({id:te.string(),name:te.string().nullish()})}function h4(){return te.object({description:te.string().nullish(),id:te.string()})}function m4(){return te.object({errorCode:te.string().nullish(),id:te.string()})}function g4(){return te.object({errorDescription:te.string().nullish(),id:te.string()})}function y4(){return te.object({errorName:te.string().nullish(),id:te.string()})}function v4(){return te.object({errorTemplate:te.string().nullish(),id:te.string()})}function _4(){return te.object({id:te.string(),name:te.string().nullish()})}function b4(){return te.object({id:te.string(),scope:wx()})}function E4(){return te.object({id:te.string(),reducer:te.string().nullish()})}function S4(){return te.object({id:te.string(),schema:te.string().nullish()})}function w4(){return te.object({id:te.string(),template:te.string().nullish()})}function T4(){return te.object({scope:te.string(),schema:te.string()})}function I4(){return te.object({__typename:te.literal("UpdateChangeLogItemInput").optional(),id:te.string(),newContent:te.string()})}function x4(){return te.object({example:te.string(),id:te.string()})}function O4(){return te.object({scope:te.string(),id:te.string(),newExample:te.string()})}const wo={setModelNameOperation(t,e){t.name=e.input.name},setModelIdOperation(t,e){t.id=e.input.id},setModelExtensionOperation(t,e){t.extension=e.input.extension},setModelDescriptionOperation(t,e){t.description=e.input.description},setAuthorNameOperation(t,e){t.author=t.author||{name:"",website:null},t.author.name=e.input.authorName},setAuthorWebsiteOperation(t,e){t.author=t.author||{name:"",website:null},t.author.website=e.input.authorWebsite}},Va={addChangeLogItemOperation(t,e){throw new Error('Reducer "addChangeLogItemOperation" not yet implemented')},updateChangeLogItemOperation(t,e){throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented')},deleteChangeLogItemOperation(t,e){throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented')},reorderChangeLogItemsOperation(t,e){throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented')},releaseNewVersionOperation(t,e){throw new Error('Reducer "releaseNewVersionOperation" not yet implemented')}},D4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Ha={addModuleOperation(t,e){t.specifications[t.specifications.length-1].modules.push({id:e.input.id,name:e.input.name,description:e.input.description||"",operations:[]})},setModuleNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id===e.input.id&&(n.modules[r].name=e.input.name||"")},setModuleDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id===e.input.id&&(n.modules[r].description=e.input.description||"")},deleteModuleOperation(t,e){const n=t.specifications[t.specifications.length-1];n.modules=n.modules.filter(r=>r.id!=e.input.id)},reorderModulesOperation(t,e){t.specifications[t.specifications.length-1].modules.sort(D4(e.input.order))}},R4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},xs={addOperationErrorOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].errors.push({id:e.input.id,name:e.input.errorName||"",code:e.input.errorCode||"",description:e.input.errorDescription||"",template:e.input.errorTemplate||""})},setOperationErrorCodeOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].code=e.input.errorCode||"")},setOperationErrorNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].name=e.input.errorName||"")},setOperationErrorDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].description=e.input.errorDescription||"")},setOperationErrorTemplateOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].template=e.input.errorTemplate||"")},deleteOperationErrorOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].errors=n.modules[r].operations[i].errors.filter(s=>s.id!=e.input.id)},reorderOperationErrorsOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].errors.sort(R4(e.input.order))}},k4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},mu={addOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].examples.push({id:e.input.id,value:e.input.example})},updateOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].examples.length;s++)n.modules[r].operations[i].examples[s].id==e.input.id&&(n.modules[r].operations[i].examples[s].value=e.input.example)},deleteOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].examples=n.modules[r].operations[i].examples.filter(s=>s.id!=e.input.id)},reorderOperationExamplesOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].examples.sort(k4(e.input.order))}},N4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Br={addOperationOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id==e.input.moduleId&&n.modules[r].operations.push({id:e.input.id,name:e.input.name,description:e.input.description||"",schema:e.input.schema||"",template:e.input.template||e.input.description||"",reducer:e.input.reducer||"",errors:[],examples:[],scope:e.input.scope||"global"})},setOperationNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].name=e.input.name||"")},setOperationScopeOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].scope=e.input.scope||"global")},setOperationSchemaOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].schema=e.input.schema||"")},setOperationDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].description=e.input.description||"")},setOperationTemplateOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].template=e.input.template||"")},setOperationReducerOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].reducer=e.input.reducer||"")},moveOperationOperation(t,e){const n=[],r=t.specifications[t.specifications.length-1];for(let i=0;i<r.modules.length;i++)r.modules[i].operations=r.modules[i].operations.filter(s=>s.id==e.input.operationId?(n.push(s),!1):!0);for(let i=0;i<r.modules.length;i++)r.modules[i].id==e.input.newModuleId&&r.modules[i].operations.push(...n)},deleteOperationOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].operations=n.modules[r].operations.filter(i=>i.id!=e.input.id)},reorderModuleOperationsOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id==e.input.moduleId&&n.modules[r].operations.sort(N4(e.input.order))}},A4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},To={setStateSchemaOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].schema=e.input.schema;else throw new Error(`Invalid scope: ${e.input.scope}`)},setInitialStateOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].initialValue=e.input.initialValue;else throw new Error(`Invalid scope: ${e.input.scope}`)},addStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples.push({id:e.input.id,value:e.input.example});else throw new Error(`Invalid scope: ${e.input.scope}`)},updateStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(!Object.keys(n.state).includes(e.input.scope))throw new Error(`Invalid scope: ${e.input.scope}`);const r=n.state[e.input.scope].examples;for(let i=0;i<r.length;i++)r[i].id==e.input.id&&(r[i].value=e.input.newExample)},deleteStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples=n.state[e.input.scope].examples.filter(r=>r.id!=e.input.id);else throw new Error(`Invalid scope: ${e.input.scope}`)},reorderStateExamplesOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples.sort(A4(e.input.order));else throw new Error(`Invalid scope: ${e.input.scope}`)}},C4=(t,e)=>{if(ra(e))return t;switch(e.type){case"SET_MODEL_NAME":d4().parse(e.input),wo.setModelNameOperation(t.global,e);break;case"SET_MODEL_ID":u4().parse(e.input),wo.setModelIdOperation(t.global,e);break;case"SET_MODEL_EXTENSION":l4().parse(e.input),wo.setModelExtensionOperation(t.global,e);break;case"SET_MODEL_DESCRIPTION":c4().parse(e.input),wo.setModelDescriptionOperation(t.global,e);break;case"SET_AUTHOR_NAME":s4().parse(e.input),wo.setAuthorNameOperation(t.global,e);break;case"SET_AUTHOR_WEBSITE":o4().parse(e.input),wo.setAuthorWebsiteOperation(t.global,e);break;case"ADD_CHANGE_LOG_ITEM":U6().parse(e.input),Va.addChangeLogItemOperation(t.global,e);break;case"UPDATE_CHANGE_LOG_ITEM":I4().parse(e.input),Va.updateChangeLogItemOperation(t.global,e);break;case"DELETE_CHANGE_LOG_ITEM":q6().parse(e.input),Va.deleteChangeLogItemOperation(t.global,e);break;case"REORDER_CHANGE_LOG_ITEMS":Q6().parse(e.input),Va.reorderChangeLogItemsOperation(t.global,e);break;case"RELEASE_NEW_VERSION":if(Object.keys(e.input).length>0)throw new Error("Expected empty input for action RELEASE_NEW_VERSION");Va.releaseNewVersionOperation(t.global,e);break;case"ADD_MODULE":B6().parse(e.input),Ha.addModuleOperation(t.global,e);break;case"SET_MODULE_NAME":p4().parse(e.input),Ha.setModuleNameOperation(t.global,e);break;case"SET_MODULE_DESCRIPTION":f4().parse(e.input),Ha.setModuleDescriptionOperation(t.global,e);break;case"DELETE_MODULE":Z6().parse(e.input),Ha.deleteModuleOperation(t.global,e);break;case"REORDER_MODULES":t4().parse(e.input),Ha.reorderModulesOperation(t.global,e);break;case"ADD_OPERATION_ERROR":z6().parse(e.input),xs.addOperationErrorOperation(t.global,e);break;case"SET_OPERATION_ERROR_CODE":m4().parse(e.input),xs.setOperationErrorCodeOperation(t.global,e);break;case"SET_OPERATION_ERROR_NAME":y4().parse(e.input),xs.setOperationErrorNameOperation(t.global,e);break;case"SET_OPERATION_ERROR_DESCRIPTION":g4().parse(e.input),xs.setOperationErrorDescriptionOperation(t.global,e);break;case"SET_OPERATION_ERROR_TEMPLATE":v4().parse(e.input),xs.setOperationErrorTemplateOperation(t.global,e);break;case"DELETE_OPERATION_ERROR":G6().parse(e.input),xs.deleteOperationErrorOperation(t.global,e);break;case"REORDER_OPERATION_ERRORS":n4().parse(e.input),xs.reorderOperationErrorsOperation(t.global,e);break;case"ADD_OPERATION_EXAMPLE":V6().parse(e.input),mu.addOperationExampleOperation(t.global,e);break;case"UPDATE_OPERATION_EXAMPLE":x4().parse(e.input),mu.updateOperationExampleOperation(t.global,e);break;case"DELETE_OPERATION_EXAMPLE":Y6().parse(e.input),mu.deleteOperationExampleOperation(t.global,e);break;case"REORDER_OPERATION_EXAMPLES":r4().parse(e.input),mu.reorderOperationExamplesOperation(t.global,e);break;case"ADD_OPERATION":H6().parse(e.input),Br.addOperationOperation(t.global,e);break;case"SET_OPERATION_NAME":_4().parse(e.input),Br.setOperationNameOperation(t.global,e);break;case"SET_OPERATION_SCOPE":b4().parse(e.input),Br.setOperationScopeOperation(t.global,e);break;case"SET_OPERATION_SCHEMA":S4().parse(e.input),Br.setOperationSchemaOperation(t.global,e);break;case"SET_OPERATION_DESCRIPTION":h4().parse(e.input),Br.setOperationDescriptionOperation(t.global,e);break;case"SET_OPERATION_TEMPLATE":w4().parse(e.input),Br.setOperationTemplateOperation(t.global,e);break;case"SET_OPERATION_REDUCER":E4().parse(e.input),Br.setOperationReducerOperation(t.global,e);break;case"MOVE_OPERATION":K6().parse(e.input),Br.moveOperationOperation(t.global,e);break;case"DELETE_OPERATION":J6().parse(e.input),Br.deleteOperationOperation(t.global,e);break;case"REORDER_MODULE_OPERATIONS":e4().parse(e.input),Br.reorderModuleOperationsOperation(t.global,e);break;case"SET_STATE_SCHEMA":T4().parse(e.input),To.setStateSchemaOperation(t.global,e);break;case"SET_INITIAL_STATE":a4().parse(e.input),To.setInitialStateOperation(t.global,e);break;case"ADD_STATE_EXAMPLE":W6().parse(e.input),To.addStateExampleOperation(t.global,e);break;case"UPDATE_STATE_EXAMPLE":O4().parse(e.input),To.updateStateExampleOperation(t.global,e);break;case"DELETE_STATE_EXAMPLE":X6().parse(e.input),To.deleteStateExampleOperation(t.global,e);break;case"REORDER_STATE_EXAMPLES":i4().parse(e.input),To.reorderStateExamplesOperation(t.global,e);break;default:return t}},Ad=ym(C4),M4={id:"",name:"",extension:"",description:"",author:{name:"",website:""},specifications:[{version:1,changeLog:[],state:{global:{schema:"",initialValue:"",examples:[]},local:{schema:"",initialValue:"",examples:[]}},modules:[]}]},L4={},Tc={fileExtension:"phdm",createState(t){return{global:{...M4,...t==null?void 0:t.global},local:{...L4,...t==null?void 0:t.local}}},createExtendedState(t){return vm({...t,documentType:"powerhouse/document-model"},Tc.createState)},createDocument(t){return _m(Tc.createExtendedState(t),Tc.createState)},saveToFile(t,e,n){return mm(t,e,"phdm",n)},saveToFileHandle(t,e){return kE(t,e)},loadFromFile(t){return Qu(t,Ad)},loadFromInput(t){return gm(t,Ad)}},Tx=t=>Je("SET_MODEL_NAME",{...t}),Ix=t=>Je("SET_MODEL_ID",{...t}),xx=t=>Je("SET_MODEL_EXTENSION",{...t}),Ox=t=>Je("SET_MODEL_DESCRIPTION",{...t}),Dx=t=>Je("SET_AUTHOR_NAME",{...t}),Rx=t=>Je("SET_AUTHOR_WEBSITE",{...t});class P4 extends Yt{setModelName(e,n){return this.dispatch(Tx(e),n)}setModelId(e,n){return this.dispatch(Ix(e),n)}setModelExtension(e,n){return this.dispatch(xx(e),n)}setModelDescription(e,n){return this.dispatch(Ox(e),n)}setAuthorName(e,n){return this.dispatch(Dx(e),n)}setAuthorWebsite(e,n){return this.dispatch(Rx(e),n)}}const kx=t=>Je("ADD_CHANGE_LOG_ITEM",{...t}),Nx=t=>Je("UPDATE_CHANGE_LOG_ITEM",{...t}),Ax=t=>Je("DELETE_CHANGE_LOG_ITEM",{...t}),Cx=t=>Je("REORDER_CHANGE_LOG_ITEMS",{...t}),Mx=()=>Je("RELEASE_NEW_VERSION");class F4 extends Yt{addChangeLogItem(e,n){return this.dispatch(kx(e),n)}updateChangeLogItem(e,n){return this.dispatch(Nx(e),n)}deleteChangeLogItem(e,n){return this.dispatch(Ax(e),n)}reorderChangeLogItems(e,n){return this.dispatch(Cx(e),n)}releaseNewVersion(e){return this.dispatch(Mx(),e)}}const Lx=t=>Je("ADD_MODULE",{...t}),Px=t=>Je("SET_MODULE_NAME",{...t}),Fx=t=>Je("SET_MODULE_DESCRIPTION",{...t}),$x=t=>Je("DELETE_MODULE",{...t}),jx=t=>Je("REORDER_MODULES",{...t});class $4 extends Yt{addModule(e,n){return this.dispatch(Lx(e),n)}setModuleName(e,n){return this.dispatch(Px(e),n)}setModuleDescription(e,n){return this.dispatch(Fx(e),n)}deleteModule(e,n){return this.dispatch($x(e),n)}reorderModules(e,n){return this.dispatch(jx(e),n)}}const Ux=t=>Je("ADD_OPERATION_ERROR",{...t}),Bx=t=>Je("SET_OPERATION_ERROR_CODE",{...t}),zx=t=>Je("SET_OPERATION_ERROR_NAME",{...t}),Vx=t=>Je("SET_OPERATION_ERROR_DESCRIPTION",{...t}),Hx=t=>Je("SET_OPERATION_ERROR_TEMPLATE",{...t}),Wx=t=>Je("DELETE_OPERATION_ERROR",{...t}),qx=t=>Je("REORDER_OPERATION_ERRORS",{...t});class j4 extends Yt{addOperationError(e,n){return this.dispatch(Ux(e),n)}setOperationErrorCode(e,n){return this.dispatch(Bx(e),n)}setOperationErrorName(e,n){return this.dispatch(zx(e),n)}setOperationErrorDescription(e,n){return this.dispatch(Vx(e),n)}setOperationErrorTemplate(e,n){return this.dispatch(Hx(e),n)}deleteOperationError(e,n){return this.dispatch(Wx(e),n)}reorderOperationErrors(e,n){return this.dispatch(qx(e),n)}}const Zx=t=>Je("ADD_OPERATION_EXAMPLE",{...t}),Gx=t=>Je("UPDATE_OPERATION_EXAMPLE",{...t}),Yx=t=>Je("DELETE_OPERATION_EXAMPLE",{...t}),Jx=t=>Je("REORDER_OPERATION_EXAMPLES",{...t});class U4 extends Yt{addOperationExample(e,n){return this.dispatch(Zx(e),n)}updateOperationExample(e,n){return this.dispatch(Gx(e),n)}deleteOperationExample(e,n){return this.dispatch(Yx(e),n)}reorderOperationExamples(e,n){return this.dispatch(Jx(e),n)}}const Xx=t=>Je("ADD_OPERATION",{...t}),Kx=t=>Je("SET_OPERATION_NAME",{...t}),Qx=t=>Je("SET_OPERATION_SCOPE",{...t}),eO=t=>Je("SET_OPERATION_SCHEMA",{...t}),tO=t=>Je("SET_OPERATION_DESCRIPTION",{...t}),nO=t=>Je("SET_OPERATION_TEMPLATE",{...t}),rO=t=>Je("SET_OPERATION_REDUCER",{...t}),iO=t=>Je("MOVE_OPERATION",{...t}),sO=t=>Je("DELETE_OPERATION",{...t}),oO=t=>Je("REORDER_MODULE_OPERATIONS",{...t});class B4 extends Yt{addOperation(e,n){return this.dispatch(Xx(e),n)}setOperationName(e,n){return this.dispatch(Kx(e),n)}setOperationScope(e,n){return this.dispatch(Qx(e),n)}setOperationSchema(e,n){return this.dispatch(eO(e),n)}setOperationDescription(e,n){return this.dispatch(tO(e),n)}setOperationTemplate(e,n){return this.dispatch(nO(e),n)}setOperationReducer(e,n){return this.dispatch(rO(e),n)}moveOperation(e,n){return this.dispatch(iO(e),n)}deleteOperation(e,n){return this.dispatch(sO(e),n)}reorderModuleOperations(e,n){return this.dispatch(oO(e),n)}}const aO=t=>Je("SET_STATE_SCHEMA",{...t}),cO=t=>Je("SET_INITIAL_STATE",{...t}),lO=t=>Je("ADD_STATE_EXAMPLE",{...t}),uO=t=>Je("UPDATE_STATE_EXAMPLE",{...t}),dO=t=>Je("DELETE_STATE_EXAMPLE",{...t}),fO=t=>Je("REORDER_STATE_EXAMPLES",{...t});class z4 extends Yt{setStateSchema(e,n){return this.dispatch(aO(e),n)}setInitialState(e,n){return this.dispatch(cO(e),n)}addStateExample(e,n){return this.dispatch(lO(e),n)}updateStateExample(e,n){return this.dispatch(uO(e),n)}deleteStateExample(e,n){return this.dispatch(dO(e),n)}reorderStateExamples(e,n){return this.dispatch(fO(e),n)}}let pO=(hu=class extends Yt{constructor(t,e){super(Ad,Tc.createDocument(t),e)}saveToFile(t,e){return super.saveToFile(t,hu.fileExtension,e)}loadFromFile(t){return super.loadFromFile(t)}static async fromFile(t){const e=new this;return await e.loadFromFile(t),e}},T6(hu,"fileExtension","phdm"),hu);wa(pO,[P4,F4,$4,j4,U4,B4,z4]);const V4=Object.freeze(Object.defineProperty({__proto__:null,addChangeLogItem:kx,addModule:Lx,addOperation:Xx,addOperationError:Ux,addOperationExample:Zx,addStateExample:lO,deleteChangeLogItem:Ax,deleteModule:$x,deleteOperation:sO,deleteOperationError:Wx,deleteOperationExample:Yx,deleteStateExample:dO,moveOperation:iO,releaseNewVersion:Mx,reorderChangeLogItems:Cx,reorderModuleOperations:oO,reorderModules:jx,reorderOperationErrors:qx,reorderOperationExamples:Jx,reorderStateExamples:fO,setAuthorName:Dx,setAuthorWebsite:Rx,setInitialState:cO,setModelDescription:Ox,setModelExtension:xx,setModelId:Ix,setModelName:Tx,setModuleDescription:Fx,setModuleName:Px,setOperationDescription:tO,setOperationErrorCode:Bx,setOperationErrorDescription:Vx,setOperationErrorName:zx,setOperationErrorTemplate:Hx,setOperationName:Kx,setOperationReducer:rO,setOperationSchema:eO,setOperationScope:Qx,setOperationTemplate:nO,setStateSchema:aO,updateChangeLogItem:Nx,updateOperationExample:Gx,updateStateExample:uO},Symbol.toStringTag,{value:"Module"})),H4=pO,W4={...Tc,...F6},q4={...Sa,...V4},Z4={Document:H4,reducer:Ad,actions:q4,utils:W4,documentModel:$6},G4="feature-flags-config",Au=window.__VITE_ENVS.PH_CONNECT_ENABLED_EDITORS||void 0,Y4=Au==null?void 0:Au.split(","),Cu=window.__VITE_ENVS.PH_CONNECT_DISABLED_EDITORS||void 0,J4=Cu==null?void 0:Cu.split(","),hO={editors:{enabledEditors:Au==="*"?"*":Y4,disabledEditors:Cu==="*"?"*":J4}},X4=bl(G4,hO),mO=()=>{const[t,e]=Nr(X4);return{config:{...hO,...t},setConfig:e}},K4=tD("theme","light",t=>{var e;typeof window<"u"&&((e=window.electronAPI)==null||e.setTheme(t))}),pl=$h(),Q4=bl("sidebar-collapsed",!1);yn(!1);const e8={sidebarCollapsedAtom:Q4,themeAtom:K4},t8=window.__VITE_ENVS.LOCAL_DOCUMENT_MODELS,c_=window.__VITE_ENVS.LOAD_EXTERNAL_PROJECTS;async function n8(){if(!c_||c_!=="true")return[];try{return(await Ko(()=>import("EXTERNAL_PROJECTS"),[])).default}catch(t){return console.error("Error loading external projects",t),[]}}function r8(t){return t.filter(e=>!!e.documentModels).map(e=>e.documentModels).reduce((e,n)=>e.concat(n),[])}async function i8(){if(!t8)return[];try{const t=await Ko(()=>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 s8={DocumentModel:Z4,...E6},gO=Object.values(s8),yO=i8(),o8=n8(),a8=yn(yO),c8=yn(o8),hl=yn(async t=>{const e=await t(a8),n=await t(c8),r=e.map(i=>i.documentModel.id);return[...gO.filter(i=>!r.includes(i.documentModel.id)),...e,...r8(n)]}),l8=()=>_l(hl),u8=Z_(hl),vO=()=>_l(u8),d8=()=>yO,f8=function(t){return pl.sub(hl,()=>{pl.get(hl).then(t).catch(e=>{throw e})})};function p8(t,e){return e==null?void 0:e.find(n=>n.documentModel.id===t)}const h8=()=>{const t=vO();return e=>p8(e,t)},m8=()=>{const t=vO(),{config:e}=mO(),{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 g8(t){let e=!1;const n=Object.entries(t.operations).reduce((r,[i,s])=>{const o=i;for(const a of s){const c=y8(a);r[o].push(c),c!==a&&(e=!0)}return r},{global:[],local:[]});return e?{...t,operations:n}:t}function y8(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 wn=class wn{constructor(e){qe(this,"db");this.db=e_.ready().then(()=>e_.createInstance({name:e?`${e}:${wn.DBName}`:wn.DBName}))}buildKey(...e){return e.join(wn.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}${wn.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=ud(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(wn.DRIVES_KEY)).map(r=>r.slice(wn.DRIVES_KEY.length+wn.SEP.length))}async getDrive(e){const r=await(await this.db).getItem(this.buildKey(wn.DRIVES_KEY,e));if(!r)throw new mc(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(wn.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(wn.DRIVES_KEY,e))}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=ud(i.operations,n);await(await this.db).setItem(this.buildKey(wn.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(wn.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=g8(r);if(i!==r)return(await this.db).setItem(this.buildKey(e,n),i)}};qe(wn,"DBName","DOCUMENT_DRIVES"),qe(wn,"SEP",":"),qe(wn,"DRIVES_KEY","DRIVES");let kh=wn;const l_=window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL||void 0,gp=l_?l_.split(","):[],v8=()=>({defaultDrives:{remoteDrives:gp.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:gp.length>0?{strategy:"preserve-by-url-and-detach",urls:gp}:{strategy:"preserve-all"}}});function _8(t,e){return new aP(t,new kh(e),new iw,new ow(1,10),{...v8()})}async function b8(t){const e=await t.initialize(),n=e==null?void 0:e.at(0);if(n)throw n;!(await t.getDrives()).length&&vi.drives.sections.LOCAL.enabled&&t.addDrive({global:{id:Ce.hashKey(),name:"My Local Drive",icon:null,slug:"my-local-drive"},local:{availableOffline:!1,sharingType:"private",listeners:[],triggers:[]}}).catch(dn.error)}const Fg=(async()=>{var e;const t=((e=window.electronAPI)==null?void 0:e.documentDrive)??_8(gO,vi.routerBasename);return await b8(t),t})(),_O=yn(Fg),E8=Z_(_O),bO=()=>_l(E8),S8=()=>Fg;f8(async t=>{(await pl.get(_O)).setDocumentModels(t)});async function w8(){await d8();const t=await pl.get(hl);(await Fg).setDocumentModels(t)}w8().catch(console.error);const Mu=(async()=>{if(window.connectCrypto)return window.connectCrypto;const{ConnectCrypto:t}=await Ko(async()=>{const{ConnectCrypto:r}=await import("./index-Ds4JuW6y.js");return{ConnectCrypto:r}},__vite__mapDeps([0,1,2,3])),{BrowserKeyStorage:e}=await Ko(async()=>{const{BrowserKeyStorage:r}=await import("./browser-Dmr6AWWk.js");return{BrowserKeyStorage:r}},[]),n=new t(new e);return await n.did(),n})();function $g(){return is(()=>({async regenerateDid(){return(await Mu).regenerateDid()},async did(){return(await Mu).did()},sign:async t=>await(await Mu).sign(t)}),[])}const T8=yn(void 0);function I8(){const[t,e]=Nr(T8);return Pn(()=>{t||Mu.then(n=>n.did()).then(n=>e(n)).catch(dn.error)}),t}const x8=yn(window.renown?Promise.resolve(window.renown):void 0);function EO(){const[t,e]=Nr(x8),{did:n}=$g();async function r(i){const s=await i();if(!s)return;const{initRenownBrowser:o}=await Ko(async()=>{const{initRenownBrowser:l}=await import("./browser-fQq8R1F1.js").then(u=>u.f);return{initRenownBrowser:l}},__vite__mapDeps([4,1,2,3])),a=o(s);return{user:function(){return Promise.resolve(a.user)},login:function(l){return a.login(l)},logout(){return Promise.resolve(a.logout())},on:{user(l){return a.on("user",l)}}}}return t||e(r(n)),t}let gu=!1;const O8=yn(void 0),Df=()=>{const[t,e]=Nr(O8),n=EO();return Pn(()=>{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}}P2(r)},[t]),Pn(()=>{if(gu)return;gu=!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(),gu=!1}},[n,gu]),t},D8=parseInt("50");function kH(t,e,n=dn.error){const[r,i]=xn(e),[s,o]=xn(),a=l=>{o(l),n(l)};return Pn(()=>{i(e)},[e]),[r,(l,u,d)=>{o(void 0),i(f=>{if(!t||!f)return f;try{const p=t(f,l),h=l.scope??"global",m=p.operations[h],v=m[m.length-1];if(v.error){const y=new Error(v.error);a(y),d==null||d(y)}return u==null||u(v,{prevState:{...f},newState:{...p}}),p}catch(p){return a(p),d==null||d(p),f}})},s]}async function R8(t,e,n,r,i){let s;const o=new Promise(l=>{s=i.on("strandUpdate",u=>{var p;if(!(u.documentId===e&&u.scope==n))return;const f=(p=u.operations.at(-1))==null?void 0:p.index;f&&f>=r&&l()})}),a=new Promise((l,u)=>setTimeout(()=>u(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 k8(t,e,n,r,i,s){const o=(s==null?void 0:s.operationsLimit)||D8;for(const a of Object.values(n.operations))for(let c=0;c<a.length;c+=o){const l=a.slice(c,c+o),u=l.at(-1);if(!u)break;const{scope:d}=u;await i(t,e,l),s!=null&&s.waitForSync&&await R8(1e4,e,d,u.index,r)}}const N8=async t=>{(await Ce.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(dn.error)};async function NH(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 N8(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 A8(t,e){const n=await Ce.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 C8(t,e,n,r,i,s){if(!s||!t.context||!t.context.signer)return t;if(!i)return dn.error(`Document model '${r.documentType}' does not have a reducer`),t;const o={documentId:n,signer:t.context.signer};return await Ce.buildSignedOperation(t,i,r,o,e)}function M8(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 u_=yn(new Map);function L8(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 Cd(t){return t.map(L8).join("&")}const P8=t=>()=>yn(e=>t?e(u_).get(t)??[]:[],(e,n,r)=>{n(u_,i=>{if(!t)return new Map;const s=i.get(t)??[];return s.length!==r.length||Cd(s)!==Cd(r)?new Map(i).set(t,r):i})}),F8=Z1(()=>yn("INITIAL"));function $8(){const t=bO(),[e,n]=Nr(is(P8(t),[t])),r=Rt(async()=>{if(!t)return;const a=[];try{const c=await t.getDrives();for(const l of c)try{const u=await t.getDrive(l);a.push(u)}catch(u){dn.error(u)}}catch(c){dn.error(c)}finally{n(a)}},[t]),[i,s]=Nr(F8(t));i==="INITIAL"&&(s("LOADING"),r().then(()=>s("LOADED")).catch(()=>s("ERROR")));const o=Rt(a=>{if(!t)return;const c=t.on("syncStatus",async(f,p,h)=>{h&&dn.error(h),await r()}),l=t.on("strandUpdate",()=>r()),u=t.on("clientStrandsError",a.strandsErrorHandler),d=t.on("defaultRemoteDrive",()=>r());return()=>{c(),l(),u(),d()}},[t,r]);return is(()=>[e,r,o,i],[e,i])}const j8=window.__VITE_ENVS.PH_CONNECT_RENOWN_URL||"https://www.renown.id",U8=window.__VITE_ENVS.PH_CONNECT_RENOWN_NETWORK_ID||"eip155",B8=window.__VITE_ENVS.PH_CONNECT_RENOWN_CHAIN_ID||"1",z8=yn("initial"),jg=()=>{const[t,e]=Nr(z8),n=Df(),r=EO(),{did:i}=$g(),s=Rt(async()=>{var u;const c=await i(),l=new URL(j8);if(l.searchParams.set("connect",c),l.searchParams.set("network",U8),l.searchParams.set("chain",B8),window.electronAPI){const d=await window.electronAPI.protocol();l.searchParams.set("deeplink",d),await window.electronAPI.openURL(l.toString())}else{const d=new URL(window.location.pathname,window.location.origin);l.searchParams.set("returnUrl",d.toJSON()),(u=window.open(l,"_self"))==null||u.focus()}},[i]),o=Rt(async c=>{if(r)try{e("checking");const l=await r.user();if((l==null?void 0:l.did)===c)return e("authorized"),l;const u=await r.login(c);if(u)return e("authorized"),u;e("not-authorized")}catch(l){e("not-authorized"),dn.error(l)}},[r]);Pn(()=>{n&&t!=="authorized"&&e("authorized")},[n,t]);const a=Rt(async()=>{e("initial"),await(r==null?void 0:r.logout())},[r]);return is(()=>({openRenown:s,user:n,status:n?"authorized":t,login:r?o:void 0,logout:a}),[r,s,n,t,o,a])};function V8(){const{user:t,status:e}=jg(),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 SO(){const t=V8();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 Ug(){const{isAllowedToCreateDocuments:t,isAllowedToEditDocuments:e}=SO()||{isAllowedToCreateDocuments:!1,isAllowedToEditDocuments:!1},n=Df()||void 0,r=I8(),{sign:i}=$g(),s=bO(),o=h8(),[a,c,,l]=$8(),u=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");const L=await s.getDocument(F,Z);if(!L)throw new Error(`There was an error opening file with id ${Z} on drive ${F}`);return L},[s]),d=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");let L=a.find(he=>he.state.global.id===F);if(!L)throw new Error(`Drive with id ${F} not found`);const I={...L};L=Ks(L,M8(Z,r,n));const X=Z.scope??"global",H=L.operations[X].findLast(he=>he.type===Z.type);if(!H)throw new Error("There was an error applying the operation");const ve=await C8(H,i,F,I,Ks,n);try{const he=await s.queueDriveOperation(F,ve);if(he.status!=="SUCCESS"&&dn.error(he.error),he.operations.length&&await c(),he.document&&!Ds(he.document))throw new Error("Received document is not a Document Drive");return he.document}catch(he){return dn.error(he),L}},[a,c,s,i,n,r]),f=Rt(async(F,Z,L,I,X)=>{if(!t)throw new Error("User is not allowed to create documents");const B=Ce.hashKey();let H=a.find(Ee=>Ee.state.global.id===F);if(!H)throw new Error(`Drive with id ${F} not found`);const ve=qm(H.state.global,{id:B,name:Z,parentFolder:I??null,documentType:L,document:X},["global"]);H=await d(F,ve);const he=H==null?void 0:H.state.global.nodes.find(Ee=>Ee.id===B);if(!he||!Vn(he))throw new Error("There was an error adding document");return he},[d,a,t]),p=Rt(async(F,Z,L)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(B=>B.state.global.id===F))throw new Error(`Drive with id ${F} not found`);return(await s.queueOperations(F,Z,L)).document},[a,e,s]),h=Rt(async(F,Z,L,I)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create files");const X=await A8(F,o),B={...X.initialState,initialState:X.initialState,operations:{global:[],local:[]},clipboard:[]},H=await f(Z,L||(typeof F=="string"?X.name:F.name),X.documentType,I,B),ve=a.find(Ee=>Ee.state.global.id===Z),he=ve&&ve.state.local.listeners.length>0;k8(Z,H.id,X,s,p,{waitForSync:he}).catch(Ee=>{throw Ee})},[f,p,o,t,s]),m=Rt(async(F,Z,L,I,X)=>{if(!t)throw new Error("User is not allowed to update files");const B=await d(F,Tn.updateFile({id:Z,name:I||void 0,parentFolder:X,documentType:L})),H=B==null?void 0:B.state.global.nodes.find(ve=>ve.id===Z);if(!H||!Vn(H))throw new Error("There was an error updating document");return H},[d,t]),v=Rt(async(F,Z,L)=>{if(!t)throw new Error("User is not allowed to create folders");const I=Ce.hashKey(),X=await d(F,Tn.addFolder({id:I,name:Z,parentFolder:L})),B=X==null?void 0:X.state.global.nodes.find(H=>H.id===I);if(!B||!qd(B))throw new Error("There was an error adding folder");return B},[d,t]),y=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to delete documents");await d(F,Tn.deleteNode({id:Z}))},[d,t]),g=Rt(async(F,Z,L)=>{if(!t)throw new Error("User is not allowed to rename documents");const I=await d(F,Tn.updateNode({id:Z,name:L})),X=I==null?void 0:I.state.global.nodes.find(B=>B.id===Z);if(!X)throw new Error("There was an error renaming node");return X},[d,t]),_=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to move documents");Z.kind===bp||F.parentFolder===Z.id||await d(Z.driveId,Tn.moveNode({srcFolder:F.id,targetParentFolder:Z.id}))},[d,t]),T=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to copy documents");if(Z.kind===bp)return;const L=a.find(ve=>ve.state.global.id===F.driveId);if(!L)return;const I=()=>Ce.hashKey(),B=ol.generateNodesCopy({srcId:F.id,targetParentFolder:Z.id,targetName:F.name},I,L.state.global.nodes).map(ve=>Tn.copyNode(ve)),H=await s.addDriveActions(F.driveId,B);H.operations.length?await c():H.status!=="SUCCESS"&&dn.error(`Error copying files: ${H.status}`,H.error)},[a,t,c,s]),w=Rt(async(F,Z,L)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(B=>B.state.global.id===F))throw new Error(`Drive with id ${F} not found`);return(await s.addOperation(F,Z,L)).document},[a,e,s]),E=Rt(async F=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create drives");const Z=F.global.id||Ce.hashKey();F=ol.createState(F);const L=await s.addDrive({global:{...F.global,id:Z},local:F.local});return await c(),L},[t,c,s]),R=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");const L=await s.addRemoteDrive(F,Z);return await c(),L},[c,s]),j=Rt(async F=>{if(!t)throw new Error("User is not allowed to delete drives");if(!s)throw new Error("Reactor is not loaded");if(!a.find(L=>L.state.global.id===F))throw new Error(`Drive with id ${F} not found`);return await s.deleteDrive(F),c()},[a,t,c,s]),M=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to rename drives");return d(F,Tn.setDriveName({name:Z}))},[d,t]),$=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d(F,Tn.setAvailableOffline({availableOffline:Z}))},[d,t]),ne=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d(F,Tn.setSharingType({type:Z}))},[d,t]),x=Rt(async(F,Z)=>{if(Z!==YO){if(!s)throw new Error("Reactor is not loaded");try{const L=s.getSyncStatus(F);return L instanceof sw?"INITIAL_SYNC":L}catch(L){return console.error(L),JO}}},[s]),G=Rt(F=>{if(!s)throw new Error("Reactor is not loaded");return s.on("strandUpdate",F)},[s]),S=Rt(F=>{if(!s)throw new Error("Reactor is not loaded");return s.on("syncStatus",F)},[s]),k=Rt(async()=>{s&&(await s.clearStorage(),await c())},[c,s]),C=Rt(async(F,Z)=>{const L=await d(F,Tn.removeTrigger({triggerId:Z}));if(L==null?void 0:L.state.local.triggers.find(X=>X.id===Z))throw new Error(`There was an error removing trigger ${Z}`)},[d]),U=Rt(async(F,Z,L)=>{if(!s)throw new Error("Reactor is not loaded");return await s.registerPullResponderTrigger(F,Z,L)},[s]),oe=Rt(async(F,Z)=>{const L=await d(F,Tn.addTrigger({trigger:Z}));if(!(L==null?void 0:L.state.local.triggers.find(X=>X.id===X.id)))throw new Error(`There was an error adding the trigger ${Z.id}`)},[d]);return is(()=>({documentDrives:a,documentDrivesStatus:l,addDocument:f,openFile:u,addFile:h,updateFile:m,addFolder:v,deleteNode:y,renameNode:g,moveNode:_,copyNode:T,addOperation:w,addOperations:p,addDrive:E,addRemoteDrive:R,deleteDrive:j,renameDrive:M,setDriveAvailableOffline:$,setDriveSharingType:ne,getSyncStatus:x,onStrandUpdate:G,onSyncStatus:S,clearStorage:k,removeTrigger:C,addTrigger:oe,registerNewPullResponderTrigger:U}),[f,E,h,v,w,p,R,oe,k,T,j,y,a,l,x,_,G,S,u,U,C,M,g,$,ne,m])}function H8(t){return t.replaceAll(/\s/g,"-")}const W8=t=>{const{open:e,onClose:n,selectedParentNode:r,setSelectedNode:i,documentModel:s}=t,{addDocument:o}=Ug();return Te(XO,{open:e,onContinue:async c=>{if(n(),!r)throw new Error("No drive or folder selected");const l=await o(r.driveId,c||`New ${s.documentModel.name}`,s.documentModel.id,r.id);l&&i({...l,slug:H8(l.name),kind:bp,documentType:l.documentType,parentFolder:r.id,driveId:r.driveId,syncStatus:r.syncStatus,synchronizationUnits:[],sharingType:r.sharingType})},onOpenChange:c=>{if(!c)return n()}})},q8=yn(vi);function Bg(){return Nr(q8)}let yu;const Z8=new Uint8Array(16);function G8(){if(!yu&&(yu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yu(Z8)}const Sn=[];for(let t=0;t<256;++t)Sn.push((t+256).toString(16).slice(1));function Y8(t,e=0){return Sn[t[e+0]]+Sn[t[e+1]]+Sn[t[e+2]]+Sn[t[e+3]]+"-"+Sn[t[e+4]]+Sn[t[e+5]]+"-"+Sn[t[e+6]]+Sn[t[e+7]]+"-"+Sn[t[e+8]]+Sn[t[e+9]]+"-"+Sn[t[e+10]]+Sn[t[e+11]]+Sn[t[e+12]]+Sn[t[e+13]]+Sn[t[e+14]]+Sn[t[e+15]]}const J8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),d_={randomUUID:J8};function f_(t,e,n){if(d_.randomUUID&&!e&&!t)return d_.randomUUID();t=t||{};const r=t.random||(t.rng||G8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Y8(r)}const X8=t=>{var ne;const[e]=Bg(),{open:n,onClose:r}=t,i=localStorage.getItem("AUTO_REGISTER_PULL_RESPONDER")!=="false";console.log("autoRegisterPullResponder",i);const[s,o]=xn(e.appVersion),[a,c]=xn({label:Hl.debug?"Enabled":"Disabled",value:Hl.debug}),[l,u]=xn(),[d,f]=xn(null),[p,h]=xn(""),[m,v]=xn({label:i?"Enabled":"Disabled",value:i?"true":"false"}),{documentDrives:y,removeTrigger:g,addTrigger:_,registerNewPullResponderTrigger:T}=Ug();Pn(()=>{Hl.setDebug(a.value)},[a]),console.log("documentDrives",y),console.log("selectedDrive",l);const w=((ne=y.find(x=>x.state.global.id===l))==null?void 0:ne.state.local.triggers)||[],R=!l||p==="",j=async()=>{!d||!l||(await g(l,d.value),f(null))},M=async(x=!1)=>{if(!(!p||p===""||!l)){if(!x){const G=await T(l,p,{pullInterval:3e3});await _(l,G),h("");return}await _(l,{id:`invalid-trigger-${f_()}`,type:"PullResponder",data:{interval:"3000",listenerId:`ivalid-listener-${f_()}`,url:p}}),h("")}},$=x=>{v(x),localStorage.setItem("AUTO_REGISTER_PULL_RESPONDER",x.value)};return Te(KO,{open:n,onOpenChange:x=>{if(!x)return r()},contentProps:{className:"rounded-2xl"},children:Ft("div",{className:"w-[700px] rounded-2xl p-6",children:[Ft("div",{className:"mb-6 flex justify-between",children:[Te("div",{className:"text-xl font-bold",children:"Debug Tools"}),Te("button",{id:"close-modal",onClick:()=>r(),children:Te(Vl,{name:"Xmark",size:28})})]}),Ft("div",{className:"flex text-sm font-bold",children:[Te(Vl,{name:"Ring",size:22}),Ft("span",{className:"ml-2",children:["App Version: ",e.appVersion]})]}),Ft("div",{className:"mt-4 flex text-sm font-bold",children:[Te(Vl,{name:"Hdd",size:22}),Te("span",{className:"ml-2",children:"Drive Tools:"})]}),Ft("div",{children:[Te("label",{htmlFor:"selectedDrive",className:"text-xs",children:"Selected Drive:"}),Te(Za,{id:"selectedDrive",onChange:x=>{if(!x||typeof x!="object"||!("value"in x)){u(void 0),f(null);return}u(x.value),f(null)},options:y.map(x=>({label:x.state.global.name,value:x.state.global.id}))})]}),Te("div",{className:"mt-2 flex items-end justify-between pl-4",children:Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"autoRegisterPullResponder",className:"text-xs",children:"Auto register pull responder:"}),Te(Za,{id:"autoRegisterPullResponder",onChange:x=>{$(x)},value:m,options:[{label:"Enabled",value:"true"},{label:"Disabled",value:"false"}]})]})}),Ft("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"driveTrigger",className:"text-xs",children:"Drive trigger:"}),Te(Za,{id:"driveTrigger",onChange:x=>{f(x)},value:d,options:w.map(x=>({label:`${x.id} - ${x.type}`,value:x.id}))})]}),Te("div",{children:Te(Mo,{onClick:j,color:d?"red":"light",disabled:!d,size:"small",children:"Remove Trigger"})})]}),Ft("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"driveUrl",className:"text-xs",children:"Add drive trigger:"}),Te(Yg,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"driveUrl",icon:Te("div",{className:"flex h-full items-center text-xs",children:"URL:"}),value:p,onChange:x=>h(x.target.value)})]}),Ft("div",{className:"mb-1 flex items-center justify-center",children:[Te(Mo,{className:"mr-2",color:R?"light":"blue",size:"small",disabled:R,onClick:()=>M(),children:"Add Trigger"}),Te(Mo,{color:R?"light":"red",size:"small",disabled:R,onClick:()=>M(!0),children:"Add Invalid Trigger"})]})]}),Ft("div",{className:"mt-4 flex text-sm font-bold",children:[Te(Vl,{name:"Gear",size:22}),Te("span",{className:"ml-2",children:"Service Worker Tools:"})]}),Te("div",{className:"mt-2 flex items-end justify-between pl-4",children:Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"serviceWorkerDebugMode",className:"text-xs",children:"Service Worker Debug Mode:"}),Te(Za,{id:"serviceWorkerDebugMode",onChange:x=>{c(x)},value:a,options:[{label:"Enabled",value:!0},{label:"Disabled",value:!1}]})]})}),Ft("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"appVersion",className:"text-xs",children:"Set invalid app version:"}),Te(Yg,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"appVersion",icon:Te("div",{className:"flex h-full items-center text-xs",children:"Version:"}),value:s,onChange:x=>o(x.target.value)})]}),Te("div",{className:"mb-1 flex items-center justify-center",children:Te(Mo,{color:s===""?"light":"red",size:"small",disabled:s==="",onClick:()=>{Hl.sendMessage({type:"SET_APP_VERSION",version:s}),o("")},children:"Add Invalid App Version"})})]})]})})},K8=t=>{const{open:e,onClose:n,uiDriveNode:r,onDelete:i}=t,{t:s}=so();return Te(QO,{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()}})},Q8=t=>{const{t:e}=so(),{uiNode:n,open:r,onClose:i,onDelete:s}=t,{kind:o,name:a}=n;return Te(e1,{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")})},ez=t=>{const{open:e,onClose:n}=t,{t:r}=so();return Te(M_,{open:e,header:r("modals.disclaimer.title"),body:r("modals.disclaimer.body"),closeLabel:"Close",onContinue:()=>n()})};function tz(t){const{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onClose:a}=t;return Te(t1,{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onOpenChange:c=>{if(!c)return a()}})}const nz="defaultDocumentModelEditor",rz=bl(nz,{label:"V2",value:"document-model-editor-v2"}),iz=()=>Nr(rz),sz=t=>Fe.createElement("svg",{width:126,height:24,viewBox:"0 0 126 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},Fe.createElement("g",{id:"Group 1000003373"},Fe.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"}),Fe.createElement("g",{id:"Renown"},Fe.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"}),Fe.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"}),Fe.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"}),Fe.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"}),Fe.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"}),Fe.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"})))),oz=()=>{const[t,e]=xn(0);return Pn(()=>{const n=setInterval(()=>{e(r=>r===3?0:r+1)},200);return()=>{clearInterval(n)}},[]),Te("span",{children:new Array(t).fill(".").join("")})},az=()=>{const t=Df(),{openRenown:e,status:n}=jg();return Te("div",{children:n==="checking"?Ft("h2",{className:"px-4 py-5 text-center text-xl font-medium",children:[Te("span",{children:"Checking Authorization"}),Te("span",{className:"inline-block w-5 text-left",children:Te(oz,{})})]}):n!=="authorized"?Ft("div",{className:"flex flex-col items-center",children:[Te("h2",{className:"mb-1 text-2xl font-semibold",children:"Log in with"}),Te(sz,{className:"mb-3"}),Te("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"}),Te(Mo,{onClick:()=>e(),className:"mb-3 w-full p-0 text-white shadow-none transition-colors",children:Te("p",{className:"block h-10 px-7 leading-10 text-slate-50",children:"Authorize Connect"})})]}):Ft("p",{className:"p-4 pb-5",children:["Logged in with address: ",t==null?void 0:t.address]})})},p_=t=>t.map(e=>({label:e.documentModel.name,value:e.documentModel.id})),cz=t=>{const{open:e,onClose:n,onRefresh:r}=t,{clearStorage:i}=Ug(),{t:s}=so(),o=m8(),a=l8(),{setConfig:c}=mO(),{showModal:l}=TO(),[u]=Bg(),[d,f]=iz(),[p,h]=xn(p_(o)),{logout:m,status:v}=jg(),y=Df(),g=()=>{c(T=>({...T,editors:{enabledEditors:p.map(w=>w.value)}})),n()},_=()=>{l("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(dn.error)},onCancel:()=>l("settingsModal",{onRefresh:r})})};return Ft(n1,{open:e,title:s("modals.connectSettings.title"),body:s("modals.connectSettings.body"),cancelLabel:s("common.cancel"),saveLabel:s("common.save"),onSave:g,onOpenChange:T=>{if(!T)return n()},children:[Te("div",{className:"rounded border border-gray-400 p-4",children:v==="authorized"?Ft(C_,{children:[Ft("p",{children:["Logged in with address:"," ",Te("span",{className:"text-sm font-semibold",children:y==null?void 0:y.address})]}),Te(Mo,{className:"mt-2 w-full",onClick:m,children:"Logout"})]}):Te(az,{})}),u.content.showDocumentModelSelectionSetting&&Te(r1,{selected:p,onChange:T=>h(T),options:p_(a),title:s("modals.connectSettings.enabledDocumentTypes.title"),description:s("modals.connectSettings.enabledDocumentTypes.description"),selectProps:{overrideStrings:{allItemsAreSelected:s("modals.connectSettings.enabledDocumentTypes.allSelected")}}}),Te(i1,{onClearStorage:_,buttonLabel:s("modals.connectSettings.clearStorage.button"),description:s("modals.connectSettings.clearStorage.description")}),Ft("div",{children:[Te("label",{htmlFor:"default-document-model-editor",className:"text-sm",children:"Default Document Model Editor:"}),Te(Za,{id:"default-document-model-editor",value:d,onChange:T=>f(T),options:[{label:"V1",value:"document-model-editor"},{label:"V2",value:"document-model-editor-v2"}]})]}),Te(s1,{packageJson:g1})]})},lz=t=>{const{open:e,onClose:n,driveId:r}=t,{t:i}=so();return Te(o1,{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()}})},uz={deleteItem:Q8,upgradeDrive:lz,createDocument:W8,addLocalDrive:aD,addRemoteDrive:Vk,driveSettings:tz,settingsModal:cz,confirmationModal:Hk,deleteDriveModal:K8,debugSettingsModal:X8,disclaimerModal:ez,cookiesPolicy:Wk},wO=wi.createContext({showModal:()=>{},closeModal:()=>{}}),TO=()=>yl(wO),dz=t=>{const{children:e}=t,[n,r]=xn(),[i,s]=xn(),[o,a]=xn(!1),c=Rt((f,p)=>{a(!0),r(p),s(f)},[]),l=Rt(()=>{a(!1)},[]),u=i?uz[i]:null,d=is(()=>({showModal:c,closeModal:l}),[l,c]);return Ft(wO.Provider,{value:d,children:[e,u&&Te(u,{...n,open:o,onClose:l})]})},fz=(t,e)=>t.some(n=>n.id===e&&n.value),pz=()=>{const{t}=so(),{showModal:e}=TO(),[n,r]=oD(),[,i]=jh(),s=[{id:"analytics-cookie",label:t("cookieBanner.cookies.analytics"),value:!0}],o=c=>{r(!1),fz(c,"analytics-cookie")&&i(l=>({...l,analytics:!0}))},a=()=>{r(!1),i({analytics:!1,functional:!1,marketing:!1})};return n?Ft("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[Te("div",{className:"absolute inset-0 bg-black opacity-15"}),Te("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:Te(a1,{className:"max-w-[1024px] ",cookies:s,onSubmit:o,onReject:a,submitLabel:t("cookieBanner.accept"),rejectLabel:t("cookieBanner.reject"),children:Te("p",{className:"font-semibold text-gray-500",children:Te(U_,{i18nKey:"cookieBanner.message",components:{a:Te("a",{onClick:()=>e("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"})}})})})})]}):null};var hz=Object.defineProperty,mz=Object.getOwnPropertyDescriptor,ii=(t,e,n,r)=>{for(var i=mz(e,n),s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=o(e,n,i)||i);return i&&hz(e,n,i),i};function si(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 gz(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 Fr{constructor(e){qe(this,"server");gz(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)}}ii([si],Fr.prototype,"migrateReadDrive");ii([si],Fr.prototype,"addReadDrive");ii([si],Fr.prototype,"getReadDrives");ii([si],Fr.prototype,"getReadDriveBySlug");ii([si],Fr.prototype,"getReadDrive");ii([si],Fr.prototype,"getReadDriveContext");ii([si],Fr.prototype,"fetchDrive");ii([si],Fr.prototype,"fetchDocument");ii([si],Fr.prototype,"deleteReadDrive");ii([si],Fr.prototype,"onReadDrivesUpdate");const Co=new Fr,IO=Ph({...Co,readDrives:[]});async function yz(t){const e=await t.getReadDrives();return(await Promise.all(e.map(r=>t.getReadDrive(r)))).filter(r=>!(r instanceof Rs))}const vz=t=>{const e=S8(),[n,r]=xn([]),i=SO(),[s,o]=xn(!1);Pn(()=>{e.then(l=>{Co.setDocumentDrive(l),o(!0)}).catch(dn.error)},[e]);const a=i===void 0?void 0:!(i.isAllowedToCreateDocuments||i.isAllowedToEditDocuments);is(()=>{if(!s||a===void 0)return;const l=a?"READ":"WRITE",u=Co.getServer();u&&typeof u.setAllDefaultDrivesAccessLevel=="function"&&u.setAllDefaultDrivesAccessLevel(l).catch(dn.error)},[a,s]),Pn(()=>{if(!s)return;yz(Co).then(u=>r(u)).catch(dn.error);const l=Co.onReadDrivesUpdate(u=>{r(d=>d.length!==u.length||Cd(d)!==Cd(u)?u:d)}).catch(dn.error);return()=>{l.then(u=>u==null?void 0:u()).catch(dn.error)}},[s]);const c=is(()=>({...Co,readDrives:n}),[n]);return Te(IO.Provider,{...t,value:c})},AH=()=>yl(IO);/**
|
|
822
|
+
}`,examples:[]},local:{schema:"",initialValue:"{}",examples:[]}}}]},j6=t=>t!=null;te.any().refine(t=>j6(t));function U6(){return te.object({__typename:te.literal("AddChangeLogItemInput").optional(),content:te.string(),id:te.string(),insertBefore:te.string().nullable()})}function B6(){return te.object({description:te.string().nullish(),id:te.string(),name:te.string()})}function z6(){return te.object({errorCode:te.string().nullish(),errorDescription:te.string().nullish(),errorName:te.string().nullish(),errorTemplate:te.string().nullish(),id:te.string(),operationId:te.string()})}function V6(){return te.object({example:te.string(),id:te.string(),operationId:te.string()})}function H6(){return te.object({description:te.string().nullish(),id:te.string(),moduleId:te.string(),name:te.string(),reducer:te.string().nullish(),schema:te.string().nullish(),template:te.string().nullish(),scope:wx().nullish()})}function W6(){return te.object({scope:te.string(),example:te.string(),id:te.string(),insertBefore:te.string().nullish()})}function q6(){return te.object({__typename:te.literal("DeleteChangeLogItemInput").optional(),id:te.string()})}function Z6(){return te.object({id:te.string()})}function G6(){return te.object({id:te.string()})}function Y6(){return te.object({id:te.string()})}function J6(){return te.object({id:te.string()})}function X6(){return te.object({scope:te.string(),id:te.string()})}function wx(){return te.literal("global").or(te.literal("local"))}function K6(){return te.object({newModuleId:te.string(),operationId:te.string()})}function Q6(){return te.object({__typename:te.literal("ReorderChangeLogItemsInput").optional(),order:te.array(te.string())})}function e4(){return te.object({moduleId:te.string(),order:te.array(te.string())})}function t4(){return te.object({order:te.array(te.string())})}function n4(){return te.object({operationId:te.string(),order:te.array(te.string())})}function r4(){return te.object({operationId:te.string(),order:te.array(te.string())})}function i4(){return te.object({scope:te.string(),order:te.array(te.string())})}function s4(){return te.object({authorName:te.string()})}function o4(){return te.object({authorWebsite:te.string()})}function a4(){return te.object({scope:te.string(),initialValue:te.string()})}function c4(){return te.object({description:te.string()})}function l4(){return te.object({extension:te.string()})}function u4(){return te.object({id:te.string()})}function d4(){return te.object({name:te.string()})}function f4(){return te.object({description:te.string().nullish(),id:te.string()})}function p4(){return te.object({id:te.string(),name:te.string().nullish()})}function h4(){return te.object({description:te.string().nullish(),id:te.string()})}function m4(){return te.object({errorCode:te.string().nullish(),id:te.string()})}function g4(){return te.object({errorDescription:te.string().nullish(),id:te.string()})}function y4(){return te.object({errorName:te.string().nullish(),id:te.string()})}function v4(){return te.object({errorTemplate:te.string().nullish(),id:te.string()})}function _4(){return te.object({id:te.string(),name:te.string().nullish()})}function b4(){return te.object({id:te.string(),scope:wx()})}function E4(){return te.object({id:te.string(),reducer:te.string().nullish()})}function S4(){return te.object({id:te.string(),schema:te.string().nullish()})}function w4(){return te.object({id:te.string(),template:te.string().nullish()})}function T4(){return te.object({scope:te.string(),schema:te.string()})}function I4(){return te.object({__typename:te.literal("UpdateChangeLogItemInput").optional(),id:te.string(),newContent:te.string()})}function x4(){return te.object({example:te.string(),id:te.string()})}function O4(){return te.object({scope:te.string(),id:te.string(),newExample:te.string()})}const wo={setModelNameOperation(t,e){t.name=e.input.name},setModelIdOperation(t,e){t.id=e.input.id},setModelExtensionOperation(t,e){t.extension=e.input.extension},setModelDescriptionOperation(t,e){t.description=e.input.description},setAuthorNameOperation(t,e){t.author=t.author||{name:"",website:null},t.author.name=e.input.authorName},setAuthorWebsiteOperation(t,e){t.author=t.author||{name:"",website:null},t.author.website=e.input.authorWebsite}},Va={addChangeLogItemOperation(t,e){throw new Error('Reducer "addChangeLogItemOperation" not yet implemented')},updateChangeLogItemOperation(t,e){throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented')},deleteChangeLogItemOperation(t,e){throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented')},reorderChangeLogItemsOperation(t,e){throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented')},releaseNewVersionOperation(t,e){throw new Error('Reducer "releaseNewVersionOperation" not yet implemented')}},D4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Ha={addModuleOperation(t,e){t.specifications[t.specifications.length-1].modules.push({id:e.input.id,name:e.input.name,description:e.input.description||"",operations:[]})},setModuleNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id===e.input.id&&(n.modules[r].name=e.input.name||"")},setModuleDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id===e.input.id&&(n.modules[r].description=e.input.description||"")},deleteModuleOperation(t,e){const n=t.specifications[t.specifications.length-1];n.modules=n.modules.filter(r=>r.id!=e.input.id)},reorderModulesOperation(t,e){t.specifications[t.specifications.length-1].modules.sort(D4(e.input.order))}},R4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},xs={addOperationErrorOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].errors.push({id:e.input.id,name:e.input.errorName||"",code:e.input.errorCode||"",description:e.input.errorDescription||"",template:e.input.errorTemplate||""})},setOperationErrorCodeOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].code=e.input.errorCode||"")},setOperationErrorNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].name=e.input.errorName||"")},setOperationErrorDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].description=e.input.errorDescription||"")},setOperationErrorTemplateOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].template=e.input.errorTemplate||"")},deleteOperationErrorOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].errors=n.modules[r].operations[i].errors.filter(s=>s.id!=e.input.id)},reorderOperationErrorsOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].errors.sort(R4(e.input.order))}},k4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},mu={addOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].examples.push({id:e.input.id,value:e.input.example})},updateOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].examples.length;s++)n.modules[r].operations[i].examples[s].id==e.input.id&&(n.modules[r].operations[i].examples[s].value=e.input.example)},deleteOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].examples=n.modules[r].operations[i].examples.filter(s=>s.id!=e.input.id)},reorderOperationExamplesOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].examples.sort(k4(e.input.order))}},N4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Br={addOperationOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id==e.input.moduleId&&n.modules[r].operations.push({id:e.input.id,name:e.input.name,description:e.input.description||"",schema:e.input.schema||"",template:e.input.template||e.input.description||"",reducer:e.input.reducer||"",errors:[],examples:[],scope:e.input.scope||"global"})},setOperationNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].name=e.input.name||"")},setOperationScopeOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].scope=e.input.scope||"global")},setOperationSchemaOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].schema=e.input.schema||"")},setOperationDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].description=e.input.description||"")},setOperationTemplateOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].template=e.input.template||"")},setOperationReducerOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].reducer=e.input.reducer||"")},moveOperationOperation(t,e){const n=[],r=t.specifications[t.specifications.length-1];for(let i=0;i<r.modules.length;i++)r.modules[i].operations=r.modules[i].operations.filter(s=>s.id==e.input.operationId?(n.push(s),!1):!0);for(let i=0;i<r.modules.length;i++)r.modules[i].id==e.input.newModuleId&&r.modules[i].operations.push(...n)},deleteOperationOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].operations=n.modules[r].operations.filter(i=>i.id!=e.input.id)},reorderModuleOperationsOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id==e.input.moduleId&&n.modules[r].operations.sort(N4(e.input.order))}},A4=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},To={setStateSchemaOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].schema=e.input.schema;else throw new Error(`Invalid scope: ${e.input.scope}`)},setInitialStateOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].initialValue=e.input.initialValue;else throw new Error(`Invalid scope: ${e.input.scope}`)},addStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples.push({id:e.input.id,value:e.input.example});else throw new Error(`Invalid scope: ${e.input.scope}`)},updateStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(!Object.keys(n.state).includes(e.input.scope))throw new Error(`Invalid scope: ${e.input.scope}`);const r=n.state[e.input.scope].examples;for(let i=0;i<r.length;i++)r[i].id==e.input.id&&(r[i].value=e.input.newExample)},deleteStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples=n.state[e.input.scope].examples.filter(r=>r.id!=e.input.id);else throw new Error(`Invalid scope: ${e.input.scope}`)},reorderStateExamplesOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples.sort(A4(e.input.order));else throw new Error(`Invalid scope: ${e.input.scope}`)}},C4=(t,e)=>{if(ra(e))return t;switch(e.type){case"SET_MODEL_NAME":d4().parse(e.input),wo.setModelNameOperation(t.global,e);break;case"SET_MODEL_ID":u4().parse(e.input),wo.setModelIdOperation(t.global,e);break;case"SET_MODEL_EXTENSION":l4().parse(e.input),wo.setModelExtensionOperation(t.global,e);break;case"SET_MODEL_DESCRIPTION":c4().parse(e.input),wo.setModelDescriptionOperation(t.global,e);break;case"SET_AUTHOR_NAME":s4().parse(e.input),wo.setAuthorNameOperation(t.global,e);break;case"SET_AUTHOR_WEBSITE":o4().parse(e.input),wo.setAuthorWebsiteOperation(t.global,e);break;case"ADD_CHANGE_LOG_ITEM":U6().parse(e.input),Va.addChangeLogItemOperation(t.global,e);break;case"UPDATE_CHANGE_LOG_ITEM":I4().parse(e.input),Va.updateChangeLogItemOperation(t.global,e);break;case"DELETE_CHANGE_LOG_ITEM":q6().parse(e.input),Va.deleteChangeLogItemOperation(t.global,e);break;case"REORDER_CHANGE_LOG_ITEMS":Q6().parse(e.input),Va.reorderChangeLogItemsOperation(t.global,e);break;case"RELEASE_NEW_VERSION":if(Object.keys(e.input).length>0)throw new Error("Expected empty input for action RELEASE_NEW_VERSION");Va.releaseNewVersionOperation(t.global,e);break;case"ADD_MODULE":B6().parse(e.input),Ha.addModuleOperation(t.global,e);break;case"SET_MODULE_NAME":p4().parse(e.input),Ha.setModuleNameOperation(t.global,e);break;case"SET_MODULE_DESCRIPTION":f4().parse(e.input),Ha.setModuleDescriptionOperation(t.global,e);break;case"DELETE_MODULE":Z6().parse(e.input),Ha.deleteModuleOperation(t.global,e);break;case"REORDER_MODULES":t4().parse(e.input),Ha.reorderModulesOperation(t.global,e);break;case"ADD_OPERATION_ERROR":z6().parse(e.input),xs.addOperationErrorOperation(t.global,e);break;case"SET_OPERATION_ERROR_CODE":m4().parse(e.input),xs.setOperationErrorCodeOperation(t.global,e);break;case"SET_OPERATION_ERROR_NAME":y4().parse(e.input),xs.setOperationErrorNameOperation(t.global,e);break;case"SET_OPERATION_ERROR_DESCRIPTION":g4().parse(e.input),xs.setOperationErrorDescriptionOperation(t.global,e);break;case"SET_OPERATION_ERROR_TEMPLATE":v4().parse(e.input),xs.setOperationErrorTemplateOperation(t.global,e);break;case"DELETE_OPERATION_ERROR":G6().parse(e.input),xs.deleteOperationErrorOperation(t.global,e);break;case"REORDER_OPERATION_ERRORS":n4().parse(e.input),xs.reorderOperationErrorsOperation(t.global,e);break;case"ADD_OPERATION_EXAMPLE":V6().parse(e.input),mu.addOperationExampleOperation(t.global,e);break;case"UPDATE_OPERATION_EXAMPLE":x4().parse(e.input),mu.updateOperationExampleOperation(t.global,e);break;case"DELETE_OPERATION_EXAMPLE":Y6().parse(e.input),mu.deleteOperationExampleOperation(t.global,e);break;case"REORDER_OPERATION_EXAMPLES":r4().parse(e.input),mu.reorderOperationExamplesOperation(t.global,e);break;case"ADD_OPERATION":H6().parse(e.input),Br.addOperationOperation(t.global,e);break;case"SET_OPERATION_NAME":_4().parse(e.input),Br.setOperationNameOperation(t.global,e);break;case"SET_OPERATION_SCOPE":b4().parse(e.input),Br.setOperationScopeOperation(t.global,e);break;case"SET_OPERATION_SCHEMA":S4().parse(e.input),Br.setOperationSchemaOperation(t.global,e);break;case"SET_OPERATION_DESCRIPTION":h4().parse(e.input),Br.setOperationDescriptionOperation(t.global,e);break;case"SET_OPERATION_TEMPLATE":w4().parse(e.input),Br.setOperationTemplateOperation(t.global,e);break;case"SET_OPERATION_REDUCER":E4().parse(e.input),Br.setOperationReducerOperation(t.global,e);break;case"MOVE_OPERATION":K6().parse(e.input),Br.moveOperationOperation(t.global,e);break;case"DELETE_OPERATION":J6().parse(e.input),Br.deleteOperationOperation(t.global,e);break;case"REORDER_MODULE_OPERATIONS":e4().parse(e.input),Br.reorderModuleOperationsOperation(t.global,e);break;case"SET_STATE_SCHEMA":T4().parse(e.input),To.setStateSchemaOperation(t.global,e);break;case"SET_INITIAL_STATE":a4().parse(e.input),To.setInitialStateOperation(t.global,e);break;case"ADD_STATE_EXAMPLE":W6().parse(e.input),To.addStateExampleOperation(t.global,e);break;case"UPDATE_STATE_EXAMPLE":O4().parse(e.input),To.updateStateExampleOperation(t.global,e);break;case"DELETE_STATE_EXAMPLE":X6().parse(e.input),To.deleteStateExampleOperation(t.global,e);break;case"REORDER_STATE_EXAMPLES":i4().parse(e.input),To.reorderStateExamplesOperation(t.global,e);break;default:return t}},Ad=ym(C4),M4={id:"",name:"",extension:"",description:"",author:{name:"",website:""},specifications:[{version:1,changeLog:[],state:{global:{schema:"",initialValue:"",examples:[]},local:{schema:"",initialValue:"",examples:[]}},modules:[]}]},L4={},Tc={fileExtension:"phdm",createState(t){return{global:{...M4,...t==null?void 0:t.global},local:{...L4,...t==null?void 0:t.local}}},createExtendedState(t){return vm({...t,documentType:"powerhouse/document-model"},Tc.createState)},createDocument(t){return _m(Tc.createExtendedState(t),Tc.createState)},saveToFile(t,e,n){return mm(t,e,"phdm",n)},saveToFileHandle(t,e){return kE(t,e)},loadFromFile(t){return Qu(t,Ad)},loadFromInput(t){return gm(t,Ad)}},Tx=t=>Je("SET_MODEL_NAME",{...t}),Ix=t=>Je("SET_MODEL_ID",{...t}),xx=t=>Je("SET_MODEL_EXTENSION",{...t}),Ox=t=>Je("SET_MODEL_DESCRIPTION",{...t}),Dx=t=>Je("SET_AUTHOR_NAME",{...t}),Rx=t=>Je("SET_AUTHOR_WEBSITE",{...t});class P4 extends Yt{setModelName(e,n){return this.dispatch(Tx(e),n)}setModelId(e,n){return this.dispatch(Ix(e),n)}setModelExtension(e,n){return this.dispatch(xx(e),n)}setModelDescription(e,n){return this.dispatch(Ox(e),n)}setAuthorName(e,n){return this.dispatch(Dx(e),n)}setAuthorWebsite(e,n){return this.dispatch(Rx(e),n)}}const kx=t=>Je("ADD_CHANGE_LOG_ITEM",{...t}),Nx=t=>Je("UPDATE_CHANGE_LOG_ITEM",{...t}),Ax=t=>Je("DELETE_CHANGE_LOG_ITEM",{...t}),Cx=t=>Je("REORDER_CHANGE_LOG_ITEMS",{...t}),Mx=()=>Je("RELEASE_NEW_VERSION");class F4 extends Yt{addChangeLogItem(e,n){return this.dispatch(kx(e),n)}updateChangeLogItem(e,n){return this.dispatch(Nx(e),n)}deleteChangeLogItem(e,n){return this.dispatch(Ax(e),n)}reorderChangeLogItems(e,n){return this.dispatch(Cx(e),n)}releaseNewVersion(e){return this.dispatch(Mx(),e)}}const Lx=t=>Je("ADD_MODULE",{...t}),Px=t=>Je("SET_MODULE_NAME",{...t}),Fx=t=>Je("SET_MODULE_DESCRIPTION",{...t}),$x=t=>Je("DELETE_MODULE",{...t}),jx=t=>Je("REORDER_MODULES",{...t});class $4 extends Yt{addModule(e,n){return this.dispatch(Lx(e),n)}setModuleName(e,n){return this.dispatch(Px(e),n)}setModuleDescription(e,n){return this.dispatch(Fx(e),n)}deleteModule(e,n){return this.dispatch($x(e),n)}reorderModules(e,n){return this.dispatch(jx(e),n)}}const Ux=t=>Je("ADD_OPERATION_ERROR",{...t}),Bx=t=>Je("SET_OPERATION_ERROR_CODE",{...t}),zx=t=>Je("SET_OPERATION_ERROR_NAME",{...t}),Vx=t=>Je("SET_OPERATION_ERROR_DESCRIPTION",{...t}),Hx=t=>Je("SET_OPERATION_ERROR_TEMPLATE",{...t}),Wx=t=>Je("DELETE_OPERATION_ERROR",{...t}),qx=t=>Je("REORDER_OPERATION_ERRORS",{...t});class j4 extends Yt{addOperationError(e,n){return this.dispatch(Ux(e),n)}setOperationErrorCode(e,n){return this.dispatch(Bx(e),n)}setOperationErrorName(e,n){return this.dispatch(zx(e),n)}setOperationErrorDescription(e,n){return this.dispatch(Vx(e),n)}setOperationErrorTemplate(e,n){return this.dispatch(Hx(e),n)}deleteOperationError(e,n){return this.dispatch(Wx(e),n)}reorderOperationErrors(e,n){return this.dispatch(qx(e),n)}}const Zx=t=>Je("ADD_OPERATION_EXAMPLE",{...t}),Gx=t=>Je("UPDATE_OPERATION_EXAMPLE",{...t}),Yx=t=>Je("DELETE_OPERATION_EXAMPLE",{...t}),Jx=t=>Je("REORDER_OPERATION_EXAMPLES",{...t});class U4 extends Yt{addOperationExample(e,n){return this.dispatch(Zx(e),n)}updateOperationExample(e,n){return this.dispatch(Gx(e),n)}deleteOperationExample(e,n){return this.dispatch(Yx(e),n)}reorderOperationExamples(e,n){return this.dispatch(Jx(e),n)}}const Xx=t=>Je("ADD_OPERATION",{...t}),Kx=t=>Je("SET_OPERATION_NAME",{...t}),Qx=t=>Je("SET_OPERATION_SCOPE",{...t}),eO=t=>Je("SET_OPERATION_SCHEMA",{...t}),tO=t=>Je("SET_OPERATION_DESCRIPTION",{...t}),nO=t=>Je("SET_OPERATION_TEMPLATE",{...t}),rO=t=>Je("SET_OPERATION_REDUCER",{...t}),iO=t=>Je("MOVE_OPERATION",{...t}),sO=t=>Je("DELETE_OPERATION",{...t}),oO=t=>Je("REORDER_MODULE_OPERATIONS",{...t});class B4 extends Yt{addOperation(e,n){return this.dispatch(Xx(e),n)}setOperationName(e,n){return this.dispatch(Kx(e),n)}setOperationScope(e,n){return this.dispatch(Qx(e),n)}setOperationSchema(e,n){return this.dispatch(eO(e),n)}setOperationDescription(e,n){return this.dispatch(tO(e),n)}setOperationTemplate(e,n){return this.dispatch(nO(e),n)}setOperationReducer(e,n){return this.dispatch(rO(e),n)}moveOperation(e,n){return this.dispatch(iO(e),n)}deleteOperation(e,n){return this.dispatch(sO(e),n)}reorderModuleOperations(e,n){return this.dispatch(oO(e),n)}}const aO=t=>Je("SET_STATE_SCHEMA",{...t}),cO=t=>Je("SET_INITIAL_STATE",{...t}),lO=t=>Je("ADD_STATE_EXAMPLE",{...t}),uO=t=>Je("UPDATE_STATE_EXAMPLE",{...t}),dO=t=>Je("DELETE_STATE_EXAMPLE",{...t}),fO=t=>Je("REORDER_STATE_EXAMPLES",{...t});class z4 extends Yt{setStateSchema(e,n){return this.dispatch(aO(e),n)}setInitialState(e,n){return this.dispatch(cO(e),n)}addStateExample(e,n){return this.dispatch(lO(e),n)}updateStateExample(e,n){return this.dispatch(uO(e),n)}deleteStateExample(e,n){return this.dispatch(dO(e),n)}reorderStateExamples(e,n){return this.dispatch(fO(e),n)}}let pO=(hu=class extends Yt{constructor(t,e){super(Ad,Tc.createDocument(t),e)}saveToFile(t,e){return super.saveToFile(t,hu.fileExtension,e)}loadFromFile(t){return super.loadFromFile(t)}static async fromFile(t){const e=new this;return await e.loadFromFile(t),e}},T6(hu,"fileExtension","phdm"),hu);wa(pO,[P4,F4,$4,j4,U4,B4,z4]);const V4=Object.freeze(Object.defineProperty({__proto__:null,addChangeLogItem:kx,addModule:Lx,addOperation:Xx,addOperationError:Ux,addOperationExample:Zx,addStateExample:lO,deleteChangeLogItem:Ax,deleteModule:$x,deleteOperation:sO,deleteOperationError:Wx,deleteOperationExample:Yx,deleteStateExample:dO,moveOperation:iO,releaseNewVersion:Mx,reorderChangeLogItems:Cx,reorderModuleOperations:oO,reorderModules:jx,reorderOperationErrors:qx,reorderOperationExamples:Jx,reorderStateExamples:fO,setAuthorName:Dx,setAuthorWebsite:Rx,setInitialState:cO,setModelDescription:Ox,setModelExtension:xx,setModelId:Ix,setModelName:Tx,setModuleDescription:Fx,setModuleName:Px,setOperationDescription:tO,setOperationErrorCode:Bx,setOperationErrorDescription:Vx,setOperationErrorName:zx,setOperationErrorTemplate:Hx,setOperationName:Kx,setOperationReducer:rO,setOperationSchema:eO,setOperationScope:Qx,setOperationTemplate:nO,setStateSchema:aO,updateChangeLogItem:Nx,updateOperationExample:Gx,updateStateExample:uO},Symbol.toStringTag,{value:"Module"})),H4=pO,W4={...Tc,...F6},q4={...Sa,...V4},Z4={Document:H4,reducer:Ad,actions:q4,utils:W4,documentModel:$6},G4="feature-flags-config",Au=window.__VITE_ENVS.PH_CONNECT_ENABLED_EDITORS||void 0,Y4=Au==null?void 0:Au.split(","),Cu=window.__VITE_ENVS.PH_CONNECT_DISABLED_EDITORS||void 0,J4=Cu==null?void 0:Cu.split(","),hO={editors:{enabledEditors:Au==="*"?"*":Y4,disabledEditors:Cu==="*"?"*":J4}},X4=bl(G4,hO),mO=()=>{const[t,e]=Nr(X4);return{config:{...hO,...t},setConfig:e}},K4=tD("theme","light",t=>{var e;typeof window<"u"&&((e=window.electronAPI)==null||e.setTheme(t))}),pl=$h(),Q4=bl("sidebar-collapsed",!1);yn(!1);const e8={sidebarCollapsedAtom:Q4,themeAtom:K4},t8=window.__VITE_ENVS.LOCAL_DOCUMENT_MODELS,c_=window.__VITE_ENVS.LOAD_EXTERNAL_PROJECTS;async function n8(){if(!c_||c_!=="true")return[];try{return(await Ko(()=>import("EXTERNAL_PROJECTS"),[])).default}catch(t){return console.error("Error loading external projects",t),[]}}function r8(t){return t.filter(e=>!!e.documentModels).map(e=>e.documentModels).reduce((e,n)=>e.concat(n),[])}async function i8(){if(!t8)return[];try{const t=await Ko(()=>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 s8={DocumentModel:Z4,...E6},gO=Object.values(s8),yO=i8(),o8=n8(),a8=yn(yO),c8=yn(o8),hl=yn(async t=>{const e=await t(a8),n=await t(c8),r=e.map(i=>i.documentModel.id);return[...gO.filter(i=>!r.includes(i.documentModel.id)),...e,...r8(n)]}),l8=()=>_l(hl),u8=Z_(hl),vO=()=>_l(u8),d8=()=>yO,f8=function(t){return pl.sub(hl,()=>{pl.get(hl).then(t).catch(e=>{throw e})})};function p8(t,e){return e==null?void 0:e.find(n=>n.documentModel.id===t)}const h8=()=>{const t=vO();return e=>p8(e,t)},m8=()=>{const t=vO(),{config:e}=mO(),{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 g8(t){let e=!1;const n=Object.entries(t.operations).reduce((r,[i,s])=>{const o=i;for(const a of s){const c=y8(a);r[o].push(c),c!==a&&(e=!0)}return r},{global:[],local:[]});return e?{...t,operations:n}:t}function y8(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 wn=class wn{constructor(e){qe(this,"db");this.db=e_.ready().then(()=>e_.createInstance({name:e?`${e}:${wn.DBName}`:wn.DBName}))}buildKey(...e){return e.join(wn.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}${wn.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=ud(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(wn.DRIVES_KEY)).map(r=>r.slice(wn.DRIVES_KEY.length+wn.SEP.length))}async getDrive(e){const r=await(await this.db).getItem(this.buildKey(wn.DRIVES_KEY,e));if(!r)throw new mc(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(wn.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(wn.DRIVES_KEY,e))}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=ud(i.operations,n);await(await this.db).setItem(this.buildKey(wn.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(wn.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=g8(r);if(i!==r)return(await this.db).setItem(this.buildKey(e,n),i)}};qe(wn,"DBName","DOCUMENT_DRIVES"),qe(wn,"SEP",":"),qe(wn,"DRIVES_KEY","DRIVES");let kh=wn;const l_=window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL||void 0,gp=l_?l_.split(","):[],v8=()=>({defaultDrives:{remoteDrives:gp.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:gp.length>0?{strategy:"preserve-by-url-and-detach",urls:gp}:{strategy:"preserve-all"}}});function _8(t,e){return new aP(t,new kh(e),new iw,new ow(1,10),{...v8()})}async function b8(t){const e=await t.initialize(),n=e==null?void 0:e.at(0);if(n)throw n;!(await t.getDrives()).length&&vi.drives.sections.LOCAL.enabled&&t.addDrive({global:{id:Ce.hashKey(),name:"My Local Drive",icon:null,slug:"my-local-drive"},local:{availableOffline:!1,sharingType:"private",listeners:[],triggers:[]}}).catch(dn.error)}const Fg=(async()=>{var e;const t=((e=window.electronAPI)==null?void 0:e.documentDrive)??_8(gO,vi.routerBasename);return await b8(t),t})(),_O=yn(Fg),E8=Z_(_O),bO=()=>_l(E8),S8=()=>Fg;f8(async t=>{(await pl.get(_O)).setDocumentModels(t)});async function w8(){await d8();const t=await pl.get(hl);(await Fg).setDocumentModels(t)}w8().catch(console.error);const Mu=(async()=>{if(window.connectCrypto)return window.connectCrypto;const{ConnectCrypto:t}=await Ko(async()=>{const{ConnectCrypto:r}=await import("./index-DaiqEkhm.js");return{ConnectCrypto:r}},__vite__mapDeps([0,1,2,3])),{BrowserKeyStorage:e}=await Ko(async()=>{const{BrowserKeyStorage:r}=await import("./browser-Dmr6AWWk.js");return{BrowserKeyStorage:r}},[]),n=new t(new e);return await n.did(),n})();function $g(){return is(()=>({async regenerateDid(){return(await Mu).regenerateDid()},async did(){return(await Mu).did()},sign:async t=>await(await Mu).sign(t)}),[])}const T8=yn(void 0);function I8(){const[t,e]=Nr(T8);return Pn(()=>{t||Mu.then(n=>n.did()).then(n=>e(n)).catch(dn.error)}),t}const x8=yn(window.renown?Promise.resolve(window.renown):void 0);function EO(){const[t,e]=Nr(x8),{did:n}=$g();async function r(i){const s=await i();if(!s)return;const{initRenownBrowser:o}=await Ko(async()=>{const{initRenownBrowser:l}=await import("./browser-DvOVpOMz.js").then(u=>u.f);return{initRenownBrowser:l}},__vite__mapDeps([4,1,2,3])),a=o(s);return{user:function(){return Promise.resolve(a.user)},login:function(l){return a.login(l)},logout(){return Promise.resolve(a.logout())},on:{user(l){return a.on("user",l)}}}}return t||e(r(n)),t}let gu=!1;const O8=yn(void 0),Df=()=>{const[t,e]=Nr(O8),n=EO();return Pn(()=>{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}}P2(r)},[t]),Pn(()=>{if(gu)return;gu=!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(),gu=!1}},[n,gu]),t},D8=parseInt("50");function kH(t,e,n=dn.error){const[r,i]=xn(e),[s,o]=xn(),a=l=>{o(l),n(l)};return Pn(()=>{i(e)},[e]),[r,(l,u,d)=>{o(void 0),i(f=>{if(!t||!f)return f;try{const p=t(f,l),h=l.scope??"global",m=p.operations[h],v=m[m.length-1];if(v.error){const y=new Error(v.error);a(y),d==null||d(y)}return u==null||u(v,{prevState:{...f},newState:{...p}}),p}catch(p){return a(p),d==null||d(p),f}})},s]}async function R8(t,e,n,r,i){let s;const o=new Promise(l=>{s=i.on("strandUpdate",u=>{var p;if(!(u.documentId===e&&u.scope==n))return;const f=(p=u.operations.at(-1))==null?void 0:p.index;f&&f>=r&&l()})}),a=new Promise((l,u)=>setTimeout(()=>u(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 k8(t,e,n,r,i,s){const o=(s==null?void 0:s.operationsLimit)||D8;for(const a of Object.values(n.operations))for(let c=0;c<a.length;c+=o){const l=a.slice(c,c+o),u=l.at(-1);if(!u)break;const{scope:d}=u;await i(t,e,l),s!=null&&s.waitForSync&&await R8(1e4,e,d,u.index,r)}}const N8=async t=>{(await Ce.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(dn.error)};async function NH(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 N8(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 A8(t,e){const n=await Ce.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 C8(t,e,n,r,i,s){if(!s||!t.context||!t.context.signer)return t;if(!i)return dn.error(`Document model '${r.documentType}' does not have a reducer`),t;const o={documentId:n,signer:t.context.signer};return await Ce.buildSignedOperation(t,i,r,o,e)}function M8(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 u_=yn(new Map);function L8(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 Cd(t){return t.map(L8).join("&")}const P8=t=>()=>yn(e=>t?e(u_).get(t)??[]:[],(e,n,r)=>{n(u_,i=>{if(!t)return new Map;const s=i.get(t)??[];return s.length!==r.length||Cd(s)!==Cd(r)?new Map(i).set(t,r):i})}),F8=Z1(()=>yn("INITIAL"));function $8(){const t=bO(),[e,n]=Nr(is(P8(t),[t])),r=Rt(async()=>{if(!t)return;const a=[];try{const c=await t.getDrives();for(const l of c)try{const u=await t.getDrive(l);a.push(u)}catch(u){dn.error(u)}}catch(c){dn.error(c)}finally{n(a)}},[t]),[i,s]=Nr(F8(t));i==="INITIAL"&&(s("LOADING"),r().then(()=>s("LOADED")).catch(()=>s("ERROR")));const o=Rt(a=>{if(!t)return;const c=t.on("syncStatus",async(f,p,h)=>{h&&dn.error(h),await r()}),l=t.on("strandUpdate",()=>r()),u=t.on("clientStrandsError",a.strandsErrorHandler),d=t.on("defaultRemoteDrive",()=>r());return()=>{c(),l(),u(),d()}},[t,r]);return is(()=>[e,r,o,i],[e,i])}const j8=window.__VITE_ENVS.PH_CONNECT_RENOWN_URL||"https://www.renown.id",U8=window.__VITE_ENVS.PH_CONNECT_RENOWN_NETWORK_ID||"eip155",B8=window.__VITE_ENVS.PH_CONNECT_RENOWN_CHAIN_ID||"1",z8=yn("initial"),jg=()=>{const[t,e]=Nr(z8),n=Df(),r=EO(),{did:i}=$g(),s=Rt(async()=>{var u;const c=await i(),l=new URL(j8);if(l.searchParams.set("connect",c),l.searchParams.set("network",U8),l.searchParams.set("chain",B8),window.electronAPI){const d=await window.electronAPI.protocol();l.searchParams.set("deeplink",d),await window.electronAPI.openURL(l.toString())}else{const d=new URL(window.location.pathname,window.location.origin);l.searchParams.set("returnUrl",d.toJSON()),(u=window.open(l,"_self"))==null||u.focus()}},[i]),o=Rt(async c=>{if(r)try{e("checking");const l=await r.user();if((l==null?void 0:l.did)===c)return e("authorized"),l;const u=await r.login(c);if(u)return e("authorized"),u;e("not-authorized")}catch(l){e("not-authorized"),dn.error(l)}},[r]);Pn(()=>{n&&t!=="authorized"&&e("authorized")},[n,t]);const a=Rt(async()=>{e("initial"),await(r==null?void 0:r.logout())},[r]);return is(()=>({openRenown:s,user:n,status:n?"authorized":t,login:r?o:void 0,logout:a}),[r,s,n,t,o,a])};function V8(){const{user:t,status:e}=jg(),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 SO(){const t=V8();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 Ug(){const{isAllowedToCreateDocuments:t,isAllowedToEditDocuments:e}=SO()||{isAllowedToCreateDocuments:!1,isAllowedToEditDocuments:!1},n=Df()||void 0,r=I8(),{sign:i}=$g(),s=bO(),o=h8(),[a,c,,l]=$8(),u=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");const L=await s.getDocument(F,Z);if(!L)throw new Error(`There was an error opening file with id ${Z} on drive ${F}`);return L},[s]),d=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");let L=a.find(he=>he.state.global.id===F);if(!L)throw new Error(`Drive with id ${F} not found`);const I={...L};L=Ks(L,M8(Z,r,n));const X=Z.scope??"global",H=L.operations[X].findLast(he=>he.type===Z.type);if(!H)throw new Error("There was an error applying the operation");const ve=await C8(H,i,F,I,Ks,n);try{const he=await s.queueDriveOperation(F,ve);if(he.status!=="SUCCESS"&&dn.error(he.error),he.operations.length&&await c(),he.document&&!Ds(he.document))throw new Error("Received document is not a Document Drive");return he.document}catch(he){return dn.error(he),L}},[a,c,s,i,n,r]),f=Rt(async(F,Z,L,I,X)=>{if(!t)throw new Error("User is not allowed to create documents");const B=Ce.hashKey();let H=a.find(Ee=>Ee.state.global.id===F);if(!H)throw new Error(`Drive with id ${F} not found`);const ve=qm(H.state.global,{id:B,name:Z,parentFolder:I??null,documentType:L,document:X},["global"]);H=await d(F,ve);const he=H==null?void 0:H.state.global.nodes.find(Ee=>Ee.id===B);if(!he||!Vn(he))throw new Error("There was an error adding document");return he},[d,a,t]),p=Rt(async(F,Z,L)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(B=>B.state.global.id===F))throw new Error(`Drive with id ${F} not found`);return(await s.queueOperations(F,Z,L)).document},[a,e,s]),h=Rt(async(F,Z,L,I)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create files");const X=await A8(F,o),B={...X.initialState,initialState:X.initialState,operations:{global:[],local:[]},clipboard:[]},H=await f(Z,L||(typeof F=="string"?X.name:F.name),X.documentType,I,B),ve=a.find(Ee=>Ee.state.global.id===Z),he=ve&&ve.state.local.listeners.length>0;k8(Z,H.id,X,s,p,{waitForSync:he}).catch(Ee=>{throw Ee})},[f,p,o,t,s]),m=Rt(async(F,Z,L,I,X)=>{if(!t)throw new Error("User is not allowed to update files");const B=await d(F,Tn.updateFile({id:Z,name:I||void 0,parentFolder:X,documentType:L})),H=B==null?void 0:B.state.global.nodes.find(ve=>ve.id===Z);if(!H||!Vn(H))throw new Error("There was an error updating document");return H},[d,t]),v=Rt(async(F,Z,L)=>{if(!t)throw new Error("User is not allowed to create folders");const I=Ce.hashKey(),X=await d(F,Tn.addFolder({id:I,name:Z,parentFolder:L})),B=X==null?void 0:X.state.global.nodes.find(H=>H.id===I);if(!B||!qd(B))throw new Error("There was an error adding folder");return B},[d,t]),y=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to delete documents");await d(F,Tn.deleteNode({id:Z}))},[d,t]),g=Rt(async(F,Z,L)=>{if(!t)throw new Error("User is not allowed to rename documents");const I=await d(F,Tn.updateNode({id:Z,name:L})),X=I==null?void 0:I.state.global.nodes.find(B=>B.id===Z);if(!X)throw new Error("There was an error renaming node");return X},[d,t]),_=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to move documents");Z.kind===bp||F.parentFolder===Z.id||await d(Z.driveId,Tn.moveNode({srcFolder:F.id,targetParentFolder:Z.id}))},[d,t]),T=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to copy documents");if(Z.kind===bp)return;const L=a.find(ve=>ve.state.global.id===F.driveId);if(!L)return;const I=()=>Ce.hashKey(),B=ol.generateNodesCopy({srcId:F.id,targetParentFolder:Z.id,targetName:F.name},I,L.state.global.nodes).map(ve=>Tn.copyNode(ve)),H=await s.addDriveActions(F.driveId,B);H.operations.length?await c():H.status!=="SUCCESS"&&dn.error(`Error copying files: ${H.status}`,H.error)},[a,t,c,s]),w=Rt(async(F,Z,L)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(B=>B.state.global.id===F))throw new Error(`Drive with id ${F} not found`);return(await s.addOperation(F,Z,L)).document},[a,e,s]),E=Rt(async F=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create drives");const Z=F.global.id||Ce.hashKey();F=ol.createState(F);const L=await s.addDrive({global:{...F.global,id:Z},local:F.local});return await c(),L},[t,c,s]),R=Rt(async(F,Z)=>{if(!s)throw new Error("Reactor is not loaded");const L=await s.addRemoteDrive(F,Z);return await c(),L},[c,s]),j=Rt(async F=>{if(!t)throw new Error("User is not allowed to delete drives");if(!s)throw new Error("Reactor is not loaded");if(!a.find(L=>L.state.global.id===F))throw new Error(`Drive with id ${F} not found`);return await s.deleteDrive(F),c()},[a,t,c,s]),M=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to rename drives");return d(F,Tn.setDriveName({name:Z}))},[d,t]),$=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d(F,Tn.setAvailableOffline({availableOffline:Z}))},[d,t]),ne=Rt(async(F,Z)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d(F,Tn.setSharingType({type:Z}))},[d,t]),x=Rt(async(F,Z)=>{if(Z!==YO){if(!s)throw new Error("Reactor is not loaded");try{const L=s.getSyncStatus(F);return L instanceof sw?"INITIAL_SYNC":L}catch(L){return console.error(L),JO}}},[s]),G=Rt(F=>{if(!s)throw new Error("Reactor is not loaded");return s.on("strandUpdate",F)},[s]),S=Rt(F=>{if(!s)throw new Error("Reactor is not loaded");return s.on("syncStatus",F)},[s]),k=Rt(async()=>{s&&(await s.clearStorage(),await c())},[c,s]),C=Rt(async(F,Z)=>{const L=await d(F,Tn.removeTrigger({triggerId:Z}));if(L==null?void 0:L.state.local.triggers.find(X=>X.id===Z))throw new Error(`There was an error removing trigger ${Z}`)},[d]),U=Rt(async(F,Z,L)=>{if(!s)throw new Error("Reactor is not loaded");return await s.registerPullResponderTrigger(F,Z,L)},[s]),oe=Rt(async(F,Z)=>{const L=await d(F,Tn.addTrigger({trigger:Z}));if(!(L==null?void 0:L.state.local.triggers.find(X=>X.id===X.id)))throw new Error(`There was an error adding the trigger ${Z.id}`)},[d]);return is(()=>({documentDrives:a,documentDrivesStatus:l,addDocument:f,openFile:u,addFile:h,updateFile:m,addFolder:v,deleteNode:y,renameNode:g,moveNode:_,copyNode:T,addOperation:w,addOperations:p,addDrive:E,addRemoteDrive:R,deleteDrive:j,renameDrive:M,setDriveAvailableOffline:$,setDriveSharingType:ne,getSyncStatus:x,onStrandUpdate:G,onSyncStatus:S,clearStorage:k,removeTrigger:C,addTrigger:oe,registerNewPullResponderTrigger:U}),[f,E,h,v,w,p,R,oe,k,T,j,y,a,l,x,_,G,S,u,U,C,M,g,$,ne,m])}function H8(t){return t.replaceAll(/\s/g,"-")}const W8=t=>{const{open:e,onClose:n,selectedParentNode:r,setSelectedNode:i,documentModel:s}=t,{addDocument:o}=Ug();return Te(XO,{open:e,onContinue:async c=>{if(n(),!r)throw new Error("No drive or folder selected");const l=await o(r.driveId,c||`New ${s.documentModel.name}`,s.documentModel.id,r.id);l&&i({...l,slug:H8(l.name),kind:bp,documentType:l.documentType,parentFolder:r.id,driveId:r.driveId,syncStatus:r.syncStatus,synchronizationUnits:[],sharingType:r.sharingType})},onOpenChange:c=>{if(!c)return n()}})},q8=yn(vi);function Bg(){return Nr(q8)}let yu;const Z8=new Uint8Array(16);function G8(){if(!yu&&(yu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yu(Z8)}const Sn=[];for(let t=0;t<256;++t)Sn.push((t+256).toString(16).slice(1));function Y8(t,e=0){return Sn[t[e+0]]+Sn[t[e+1]]+Sn[t[e+2]]+Sn[t[e+3]]+"-"+Sn[t[e+4]]+Sn[t[e+5]]+"-"+Sn[t[e+6]]+Sn[t[e+7]]+"-"+Sn[t[e+8]]+Sn[t[e+9]]+"-"+Sn[t[e+10]]+Sn[t[e+11]]+Sn[t[e+12]]+Sn[t[e+13]]+Sn[t[e+14]]+Sn[t[e+15]]}const J8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),d_={randomUUID:J8};function f_(t,e,n){if(d_.randomUUID&&!e&&!t)return d_.randomUUID();t=t||{};const r=t.random||(t.rng||G8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Y8(r)}const X8=t=>{var ne;const[e]=Bg(),{open:n,onClose:r}=t,i=localStorage.getItem("AUTO_REGISTER_PULL_RESPONDER")!=="false";console.log("autoRegisterPullResponder",i);const[s,o]=xn(e.appVersion),[a,c]=xn({label:Hl.debug?"Enabled":"Disabled",value:Hl.debug}),[l,u]=xn(),[d,f]=xn(null),[p,h]=xn(""),[m,v]=xn({label:i?"Enabled":"Disabled",value:i?"true":"false"}),{documentDrives:y,removeTrigger:g,addTrigger:_,registerNewPullResponderTrigger:T}=Ug();Pn(()=>{Hl.setDebug(a.value)},[a]),console.log("documentDrives",y),console.log("selectedDrive",l);const w=((ne=y.find(x=>x.state.global.id===l))==null?void 0:ne.state.local.triggers)||[],R=!l||p==="",j=async()=>{!d||!l||(await g(l,d.value),f(null))},M=async(x=!1)=>{if(!(!p||p===""||!l)){if(!x){const G=await T(l,p,{pullInterval:3e3});await _(l,G),h("");return}await _(l,{id:`invalid-trigger-${f_()}`,type:"PullResponder",data:{interval:"3000",listenerId:`ivalid-listener-${f_()}`,url:p}}),h("")}},$=x=>{v(x),localStorage.setItem("AUTO_REGISTER_PULL_RESPONDER",x.value)};return Te(KO,{open:n,onOpenChange:x=>{if(!x)return r()},contentProps:{className:"rounded-2xl"},children:Ft("div",{className:"w-[700px] rounded-2xl p-6",children:[Ft("div",{className:"mb-6 flex justify-between",children:[Te("div",{className:"text-xl font-bold",children:"Debug Tools"}),Te("button",{id:"close-modal",onClick:()=>r(),children:Te(Vl,{name:"Xmark",size:28})})]}),Ft("div",{className:"flex text-sm font-bold",children:[Te(Vl,{name:"Ring",size:22}),Ft("span",{className:"ml-2",children:["App Version: ",e.appVersion]})]}),Ft("div",{className:"mt-4 flex text-sm font-bold",children:[Te(Vl,{name:"Hdd",size:22}),Te("span",{className:"ml-2",children:"Drive Tools:"})]}),Ft("div",{children:[Te("label",{htmlFor:"selectedDrive",className:"text-xs",children:"Selected Drive:"}),Te(Za,{id:"selectedDrive",onChange:x=>{if(!x||typeof x!="object"||!("value"in x)){u(void 0),f(null);return}u(x.value),f(null)},options:y.map(x=>({label:x.state.global.name,value:x.state.global.id}))})]}),Te("div",{className:"mt-2 flex items-end justify-between pl-4",children:Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"autoRegisterPullResponder",className:"text-xs",children:"Auto register pull responder:"}),Te(Za,{id:"autoRegisterPullResponder",onChange:x=>{$(x)},value:m,options:[{label:"Enabled",value:"true"},{label:"Disabled",value:"false"}]})]})}),Ft("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"driveTrigger",className:"text-xs",children:"Drive trigger:"}),Te(Za,{id:"driveTrigger",onChange:x=>{f(x)},value:d,options:w.map(x=>({label:`${x.id} - ${x.type}`,value:x.id}))})]}),Te("div",{children:Te(Mo,{onClick:j,color:d?"red":"light",disabled:!d,size:"small",children:"Remove Trigger"})})]}),Ft("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"driveUrl",className:"text-xs",children:"Add drive trigger:"}),Te(Yg,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"driveUrl",icon:Te("div",{className:"flex h-full items-center text-xs",children:"URL:"}),value:p,onChange:x=>h(x.target.value)})]}),Ft("div",{className:"mb-1 flex items-center justify-center",children:[Te(Mo,{className:"mr-2",color:R?"light":"blue",size:"small",disabled:R,onClick:()=>M(),children:"Add Trigger"}),Te(Mo,{color:R?"light":"red",size:"small",disabled:R,onClick:()=>M(!0),children:"Add Invalid Trigger"})]})]}),Ft("div",{className:"mt-4 flex text-sm font-bold",children:[Te(Vl,{name:"Gear",size:22}),Te("span",{className:"ml-2",children:"Service Worker Tools:"})]}),Te("div",{className:"mt-2 flex items-end justify-between pl-4",children:Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"serviceWorkerDebugMode",className:"text-xs",children:"Service Worker Debug Mode:"}),Te(Za,{id:"serviceWorkerDebugMode",onChange:x=>{c(x)},value:a,options:[{label:"Enabled",value:!0},{label:"Disabled",value:!1}]})]})}),Ft("div",{className:"mt-2 flex items-end justify-between pl-4",children:[Ft("div",{className:"w-[400px]",children:[Te("label",{htmlFor:"appVersion",className:"text-xs",children:"Set invalid app version:"}),Te(Yg,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"appVersion",icon:Te("div",{className:"flex h-full items-center text-xs",children:"Version:"}),value:s,onChange:x=>o(x.target.value)})]}),Te("div",{className:"mb-1 flex items-center justify-center",children:Te(Mo,{color:s===""?"light":"red",size:"small",disabled:s==="",onClick:()=>{Hl.sendMessage({type:"SET_APP_VERSION",version:s}),o("")},children:"Add Invalid App Version"})})]})]})})},K8=t=>{const{open:e,onClose:n,uiDriveNode:r,onDelete:i}=t,{t:s}=so();return Te(QO,{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()}})},Q8=t=>{const{t:e}=so(),{uiNode:n,open:r,onClose:i,onDelete:s}=t,{kind:o,name:a}=n;return Te(e1,{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")})},ez=t=>{const{open:e,onClose:n}=t,{t:r}=so();return Te(M_,{open:e,header:r("modals.disclaimer.title"),body:r("modals.disclaimer.body"),closeLabel:"Close",onContinue:()=>n()})};function tz(t){const{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onClose:a}=t;return Te(t1,{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onOpenChange:c=>{if(!c)return a()}})}const nz="defaultDocumentModelEditor",rz=bl(nz,{label:"V2",value:"document-model-editor-v2"}),iz=()=>Nr(rz),sz=t=>Fe.createElement("svg",{width:126,height:24,viewBox:"0 0 126 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},Fe.createElement("g",{id:"Group 1000003373"},Fe.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"}),Fe.createElement("g",{id:"Renown"},Fe.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"}),Fe.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"}),Fe.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"}),Fe.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"}),Fe.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"}),Fe.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"})))),oz=()=>{const[t,e]=xn(0);return Pn(()=>{const n=setInterval(()=>{e(r=>r===3?0:r+1)},200);return()=>{clearInterval(n)}},[]),Te("span",{children:new Array(t).fill(".").join("")})},az=()=>{const t=Df(),{openRenown:e,status:n}=jg();return Te("div",{children:n==="checking"?Ft("h2",{className:"px-4 py-5 text-center text-xl font-medium",children:[Te("span",{children:"Checking Authorization"}),Te("span",{className:"inline-block w-5 text-left",children:Te(oz,{})})]}):n!=="authorized"?Ft("div",{className:"flex flex-col items-center",children:[Te("h2",{className:"mb-1 text-2xl font-semibold",children:"Log in with"}),Te(sz,{className:"mb-3"}),Te("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"}),Te(Mo,{onClick:()=>e(),className:"mb-3 w-full p-0 text-white shadow-none transition-colors",children:Te("p",{className:"block h-10 px-7 leading-10 text-slate-50",children:"Authorize Connect"})})]}):Ft("p",{className:"p-4 pb-5",children:["Logged in with address: ",t==null?void 0:t.address]})})},p_=t=>t.map(e=>({label:e.documentModel.name,value:e.documentModel.id})),cz=t=>{const{open:e,onClose:n,onRefresh:r}=t,{clearStorage:i}=Ug(),{t:s}=so(),o=m8(),a=l8(),{setConfig:c}=mO(),{showModal:l}=TO(),[u]=Bg(),[d,f]=iz(),[p,h]=xn(p_(o)),{logout:m,status:v}=jg(),y=Df(),g=()=>{c(T=>({...T,editors:{enabledEditors:p.map(w=>w.value)}})),n()},_=()=>{l("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(dn.error)},onCancel:()=>l("settingsModal",{onRefresh:r})})};return Ft(n1,{open:e,title:s("modals.connectSettings.title"),body:s("modals.connectSettings.body"),cancelLabel:s("common.cancel"),saveLabel:s("common.save"),onSave:g,onOpenChange:T=>{if(!T)return n()},children:[Te("div",{className:"rounded border border-gray-400 p-4",children:v==="authorized"?Ft(C_,{children:[Ft("p",{children:["Logged in with address:"," ",Te("span",{className:"text-sm font-semibold",children:y==null?void 0:y.address})]}),Te(Mo,{className:"mt-2 w-full",onClick:m,children:"Logout"})]}):Te(az,{})}),u.content.showDocumentModelSelectionSetting&&Te(r1,{selected:p,onChange:T=>h(T),options:p_(a),title:s("modals.connectSettings.enabledDocumentTypes.title"),description:s("modals.connectSettings.enabledDocumentTypes.description"),selectProps:{overrideStrings:{allItemsAreSelected:s("modals.connectSettings.enabledDocumentTypes.allSelected")}}}),Te(i1,{onClearStorage:_,buttonLabel:s("modals.connectSettings.clearStorage.button"),description:s("modals.connectSettings.clearStorage.description")}),Ft("div",{children:[Te("label",{htmlFor:"default-document-model-editor",className:"text-sm",children:"Default Document Model Editor:"}),Te(Za,{id:"default-document-model-editor",value:d,onChange:T=>f(T),options:[{label:"V1",value:"document-model-editor"},{label:"V2",value:"document-model-editor-v2"}]})]}),Te(s1,{packageJson:g1})]})},lz=t=>{const{open:e,onClose:n,driveId:r}=t,{t:i}=so();return Te(o1,{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()}})},uz={deleteItem:Q8,upgradeDrive:lz,createDocument:W8,addLocalDrive:aD,addRemoteDrive:Vk,driveSettings:tz,settingsModal:cz,confirmationModal:Hk,deleteDriveModal:K8,debugSettingsModal:X8,disclaimerModal:ez,cookiesPolicy:Wk},wO=wi.createContext({showModal:()=>{},closeModal:()=>{}}),TO=()=>yl(wO),dz=t=>{const{children:e}=t,[n,r]=xn(),[i,s]=xn(),[o,a]=xn(!1),c=Rt((f,p)=>{a(!0),r(p),s(f)},[]),l=Rt(()=>{a(!1)},[]),u=i?uz[i]:null,d=is(()=>({showModal:c,closeModal:l}),[l,c]);return Ft(wO.Provider,{value:d,children:[e,u&&Te(u,{...n,open:o,onClose:l})]})},fz=(t,e)=>t.some(n=>n.id===e&&n.value),pz=()=>{const{t}=so(),{showModal:e}=TO(),[n,r]=oD(),[,i]=jh(),s=[{id:"analytics-cookie",label:t("cookieBanner.cookies.analytics"),value:!0}],o=c=>{r(!1),fz(c,"analytics-cookie")&&i(l=>({...l,analytics:!0}))},a=()=>{r(!1),i({analytics:!1,functional:!1,marketing:!1})};return n?Ft("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[Te("div",{className:"absolute inset-0 bg-black opacity-15"}),Te("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:Te(a1,{className:"max-w-[1024px] ",cookies:s,onSubmit:o,onReject:a,submitLabel:t("cookieBanner.accept"),rejectLabel:t("cookieBanner.reject"),children:Te("p",{className:"font-semibold text-gray-500",children:Te(U_,{i18nKey:"cookieBanner.message",components:{a:Te("a",{onClick:()=>e("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"})}})})})})]}):null};var hz=Object.defineProperty,mz=Object.getOwnPropertyDescriptor,ii=(t,e,n,r)=>{for(var i=mz(e,n),s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=o(e,n,i)||i);return i&&hz(e,n,i),i};function si(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 gz(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 Fr{constructor(e){qe(this,"server");gz(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)}}ii([si],Fr.prototype,"migrateReadDrive");ii([si],Fr.prototype,"addReadDrive");ii([si],Fr.prototype,"getReadDrives");ii([si],Fr.prototype,"getReadDriveBySlug");ii([si],Fr.prototype,"getReadDrive");ii([si],Fr.prototype,"getReadDriveContext");ii([si],Fr.prototype,"fetchDrive");ii([si],Fr.prototype,"fetchDocument");ii([si],Fr.prototype,"deleteReadDrive");ii([si],Fr.prototype,"onReadDrivesUpdate");const Co=new Fr,IO=Ph({...Co,readDrives:[]});async function yz(t){const e=await t.getReadDrives();return(await Promise.all(e.map(r=>t.getReadDrive(r)))).filter(r=>!(r instanceof Rs))}const vz=t=>{const e=S8(),[n,r]=xn([]),i=SO(),[s,o]=xn(!1);Pn(()=>{e.then(l=>{Co.setDocumentDrive(l),o(!0)}).catch(dn.error)},[e]);const a=i===void 0?void 0:!(i.isAllowedToCreateDocuments||i.isAllowedToEditDocuments);is(()=>{if(!s||a===void 0)return;const l=a?"READ":"WRITE",u=Co.getServer();u&&typeof u.setAllDefaultDrivesAccessLevel=="function"&&u.setAllDefaultDrivesAccessLevel(l).catch(dn.error)},[a,s]),Pn(()=>{if(!s)return;yz(Co).then(u=>r(u)).catch(dn.error);const l=Co.onReadDrivesUpdate(u=>{r(d=>d.length!==u.length||Cd(d)!==Cd(u)?u:d)}).catch(dn.error);return()=>{l.then(u=>u==null?void 0:u()).catch(dn.error)}},[s]);const c=is(()=>({...Co,readDrives:n}),[n]);return Te(IO.Provider,{...t,value:c})},AH=()=>yl(IO);/**
|
|
823
823
|
* @remix-run/router v1.21.1
|
|
824
824
|
*
|
|
825
825
|
* Copyright (c) Remix Software Inc.
|
|
@@ -838,5 +838,5 @@ enum ReactionType {
|
|
|
838
838
|
* LICENSE.md file in the root directory of this source tree.
|
|
839
839
|
*
|
|
840
840
|
* @license MIT
|
|
841
|
-
*/function ml(){return ml=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},ml.apply(this,arguments)}const Wg=Fe.createContext(null),mV=Fe.createContext(null),kf=Fe.createContext(null),Nf=Fe.createContext(null),bs=Fe.createContext({outlet:null,matches:[],isDataRoute:!1}),FO=Fe.createContext(null);function Af(){return Fe.useContext(Nf)!=null}function qg(){return Af()||yt(!1),Fe.useContext(Nf).location}function gV(){return Fe.useContext(Nf).navigationType}function $O(t){Fe.useContext(kf).static||Fe.useLayoutEffect(t)}function MH(){let{isDataRoute:t}=Fe.useContext(bs);return t?RV():yV()}function yV(){Af()||yt(!1);let t=Fe.useContext(Wg),{basename:e,future:n,navigator:r}=Fe.useContext(kf),{matches:i}=Fe.useContext(bs),{pathname:s}=qg(),o=JSON.stringify(RO(i,n.v7_relativeSplatPath)),a=Fe.useRef(!1);return $O(()=>{a.current=!0}),Fe.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=kO(l,JSON.parse(o),s,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:rs([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,o,s,t])}const vV=Fe.createContext(null);function _V(t){let e=Fe.useContext(bs).outlet;return e&&Fe.createElement(vV.Provider,{value:t},e)}function LH(){let{matches:t}=Fe.useContext(bs),e=t[t.length-1];return e?e.params:{}}function PH(t,e,n,r){Af()||yt(!1);let{navigator:i}=Fe.useContext(kf),{matches:s}=Fe.useContext(bs),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=qg(),u;u=l;let d=u.pathname||"/",f=d;if(c!=="/"){let m=c.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(m.length).join("/")}let p=Ki(t,{pathname:f});return TV(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:rs([c,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?c:rs([c,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),s,n,r)}function bV(){let t=DV(),e=Rf(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 Fe.createElement(Fe.Fragment,null,Fe.createElement("h2",null,"Unexpected Application Error!"),Fe.createElement("h3",{style:{fontStyle:"italic"}},e),n?Fe.createElement("pre",{style:i},n):null,null)}const EV=Fe.createElement(bV,null);class SV extends Fe.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?Fe.createElement(bs.Provider,{value:this.props.routeContext},Fe.createElement(FO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function wV(t){let{routeContext:e,match:n,children:r}=t,i=Fe.useContext(Wg);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),Fe.createElement(bs.Provider,{value:e},r)}function TV(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 u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||yt(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:p}=n,h=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||h){c=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let p,h=!1,m=null,v=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,m=d.route.errorElement||EV,c&&(l<0&&f===0?(h=!0,v=null):l===f&&(h=!0,v=d.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,f+1)),g=()=>{let _;return p?_=m:h?_=v:d.route.Component?_=Fe.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=u,Fe.createElement(wV,{match:d,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:_})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?Fe.createElement(SV,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):g()},null)}var jO=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(jO||{}),Ld=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}(Ld||{});function IV(t){let e=Fe.useContext(Wg);return e||yt(!1),e}function xV(t){let e=Fe.useContext(mV);return e||yt(!1),e}function OV(t){let e=Fe.useContext(bs);return e||yt(!1),e}function UO(t){let e=OV(),n=e.matches[e.matches.length-1];return n.route.id||yt(!1),n.route.id}function DV(){var t;let e=Fe.useContext(FO),n=xV(Ld.UseRouteError),r=UO(Ld.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function RV(){let{router:t}=IV(jO.UseNavigateStable),e=UO(Ld.UseNavigateStable),n=Fe.useRef(!1);return $O(()=>{n.current=!0}),Fe.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,ml({fromRouteId:e},s)))},[t,e])}const N_={};function kV(t,e){N_[e]||(N_[e]=!0,console.warn(e))}const xo=(t,e,n)=>kV(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function FH(t,e){(t==null?void 0:t.v7_startTransition)===void 0&&xo("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||!e.v7_relativeSplatPath)&&xo("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),e&&(e.v7_fetcherPersist===void 0&&xo("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),e.v7_normalizeFormMethod===void 0&&xo("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),e.v7_partialHydration===void 0&&xo("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),e.v7_skipActionErrorRevalidation===void 0&&xo("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function $H(t){return _V(t.context)}function NV(t){yt(!1)}function jH(t){let{basename:e="/",children:n=null,location:r,navigationType:i=qt.Pop,navigator:s,static:o=!1,future:a}=t;Af()&&yt(!1);let c=e.replace(/^\/*/,"/"),l=Fe.useMemo(()=>({basename:c,navigator:s,static:o,future:ml({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof r=="string"&&(r=Mi(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:h="default"}=r,m=Fe.useMemo(()=>{let v=Bl(u,c);return v==null?null:{location:{pathname:v,search:d,hash:f,state:p,key:h},navigationType:i}},[c,u,d,f,p,h,i]);return m==null?null:Fe.createElement(kf.Provider,{value:l},Fe.createElement(Nf.Provider,{children:n,value:m}))}new Promise(()=>{});function Lh(t,e){e===void 0&&(e=[]);let n=[];return Fe.Children.forEach(t,(r,i)=>{if(!Fe.isValidElement(r))return;let s=[...e,i];if(r.type===Fe.Fragment){n.push.apply(n,Lh(r.props.children,s));return}r.type!==NV&&yt(!1),!r.props.index||!r.props.children||yt(!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=Lh(r.props.children,s)),n.push(o)}),n}function AV(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:Fe.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:Fe.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:Fe.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function UH(t,e){return Yz({basename:e==null?void 0:e.basename,future:ml({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:_z({initialEntries:e==null?void 0:e.initialEntries,initialIndex:e==null?void 0:e.initialIndex}),hydrationData:e==null?void 0:e.hydrationData,routes:t,mapRouteProperties:AV,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation}).initialize()}function CV(){const[t]=jh(),{analytics:e}=t;Pn(()=>{const n=wt();if(!e){n&&n.close();return}if(n||!vi.sentry.dsn||vi.sentry.dsn==="")return;const r=window.__VITE_ENVS.SENTRY_RELEASE,i=[PT(),CT({depth:5}),MB(),NT({levels:["error"]})];vi.sentry.tracing&&i.push(c9({useEffect:wi.useEffect,useLocation:qg,useNavigationType:gV,createRoutesFromChildren:Lh,matchRoutes:Ki})),QB({release:r,dsn:vi.sentry.dsn,environment:vi.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 MV=({children:t})=>(CV(),t);function A_(...t){var e;(e=window.dataLayer)==null||e.push(...t)}const LV=()=>{const[{gaTrackingId:t}]=Bg(),[{analytics:e}]=jh(),n=t&&e;return Pn(()=>{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||[],A_("js",new Date),A_("config",t),()=>{document.head.removeChild(r)}}},[n,t]),null},PV=wi.lazy(async()=>({default:await(await Ko(()=>import("./router-yYGizFGD.js").then(n=>n.r),__vite__mapDeps([5,1,2,3]))).default()})),FV=()=>{for(const t of Object.values(e8))_l(t);return null},$V=()=>Te(wi.StrictMode,{children:Te(m1,{fallback:Te(C_,{}),children:Ft(B1,{store:pl,children:[Te(FV,{}),Te(c1,{children:Te(MV,{children:Te(vz,{children:Ft(l1,{children:[Te(u1,{position:"bottom-right"}),Ft(dz,{children:[Te(PV,{}),Te(pz,{}),Te(LV,{})]})]})})})})]})})}),BH=Object.freeze(Object.defineProperty({__proto__:null,default:$V},Symbol.toStringTag,{value:"Module"}));export{_6 as $,iz as A,_l as B,Df as C,Wg as D,Nh as E,I8 as F,$g as G,h8 as H,kH as I,SO as J,K4 as K,M8 as L,Sa as M,C8 as N,$H as O,oD as P,LH as Q,jH as R,W4 as S,U_ as T,NH as U,L8 as V,m8 as W,H8 as X,Ce as Y,D as Z,q4 as _,MH as a,L9 as a0,r6 as a1,BH as a2,mV as b,PH as c,Yz as d,CH as e,UH as f,qV as g,vl as h,j8 as i,dn as j,so as k,FH as l,AV as m,Ug as n,$8 as o,AH as p,bO as q,Bg as r,Nr as s,TO as t,qg as u,jg as v,Q4 as w,yn as x,Z_ as y,n8 as z};
|
|
842
|
-
//# sourceMappingURL=app-
|
|
841
|
+
*/function ml(){return ml=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},ml.apply(this,arguments)}const Wg=Fe.createContext(null),mV=Fe.createContext(null),kf=Fe.createContext(null),Nf=Fe.createContext(null),bs=Fe.createContext({outlet:null,matches:[],isDataRoute:!1}),FO=Fe.createContext(null);function Af(){return Fe.useContext(Nf)!=null}function qg(){return Af()||yt(!1),Fe.useContext(Nf).location}function gV(){return Fe.useContext(Nf).navigationType}function $O(t){Fe.useContext(kf).static||Fe.useLayoutEffect(t)}function MH(){let{isDataRoute:t}=Fe.useContext(bs);return t?RV():yV()}function yV(){Af()||yt(!1);let t=Fe.useContext(Wg),{basename:e,future:n,navigator:r}=Fe.useContext(kf),{matches:i}=Fe.useContext(bs),{pathname:s}=qg(),o=JSON.stringify(RO(i,n.v7_relativeSplatPath)),a=Fe.useRef(!1);return $O(()=>{a.current=!0}),Fe.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=kO(l,JSON.parse(o),s,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:rs([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,o,s,t])}const vV=Fe.createContext(null);function _V(t){let e=Fe.useContext(bs).outlet;return e&&Fe.createElement(vV.Provider,{value:t},e)}function LH(){let{matches:t}=Fe.useContext(bs),e=t[t.length-1];return e?e.params:{}}function PH(t,e,n,r){Af()||yt(!1);let{navigator:i}=Fe.useContext(kf),{matches:s}=Fe.useContext(bs),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=qg(),u;u=l;let d=u.pathname||"/",f=d;if(c!=="/"){let m=c.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(m.length).join("/")}let p=Ki(t,{pathname:f});return TV(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:rs([c,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?c:rs([c,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),s,n,r)}function bV(){let t=DV(),e=Rf(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 Fe.createElement(Fe.Fragment,null,Fe.createElement("h2",null,"Unexpected Application Error!"),Fe.createElement("h3",{style:{fontStyle:"italic"}},e),n?Fe.createElement("pre",{style:i},n):null,null)}const EV=Fe.createElement(bV,null);class SV extends Fe.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?Fe.createElement(bs.Provider,{value:this.props.routeContext},Fe.createElement(FO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function wV(t){let{routeContext:e,match:n,children:r}=t,i=Fe.useContext(Wg);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),Fe.createElement(bs.Provider,{value:e},r)}function TV(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 u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||yt(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:p}=n,h=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||h){c=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let p,h=!1,m=null,v=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,m=d.route.errorElement||EV,c&&(l<0&&f===0?(h=!0,v=null):l===f&&(h=!0,v=d.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,f+1)),g=()=>{let _;return p?_=m:h?_=v:d.route.Component?_=Fe.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=u,Fe.createElement(wV,{match:d,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:_})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?Fe.createElement(SV,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):g()},null)}var jO=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(jO||{}),Ld=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}(Ld||{});function IV(t){let e=Fe.useContext(Wg);return e||yt(!1),e}function xV(t){let e=Fe.useContext(mV);return e||yt(!1),e}function OV(t){let e=Fe.useContext(bs);return e||yt(!1),e}function UO(t){let e=OV(),n=e.matches[e.matches.length-1];return n.route.id||yt(!1),n.route.id}function DV(){var t;let e=Fe.useContext(FO),n=xV(Ld.UseRouteError),r=UO(Ld.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function RV(){let{router:t}=IV(jO.UseNavigateStable),e=UO(Ld.UseNavigateStable),n=Fe.useRef(!1);return $O(()=>{n.current=!0}),Fe.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,ml({fromRouteId:e},s)))},[t,e])}const N_={};function kV(t,e){N_[e]||(N_[e]=!0,console.warn(e))}const xo=(t,e,n)=>kV(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function FH(t,e){(t==null?void 0:t.v7_startTransition)===void 0&&xo("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||!e.v7_relativeSplatPath)&&xo("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),e&&(e.v7_fetcherPersist===void 0&&xo("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),e.v7_normalizeFormMethod===void 0&&xo("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),e.v7_partialHydration===void 0&&xo("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),e.v7_skipActionErrorRevalidation===void 0&&xo("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function $H(t){return _V(t.context)}function NV(t){yt(!1)}function jH(t){let{basename:e="/",children:n=null,location:r,navigationType:i=qt.Pop,navigator:s,static:o=!1,future:a}=t;Af()&&yt(!1);let c=e.replace(/^\/*/,"/"),l=Fe.useMemo(()=>({basename:c,navigator:s,static:o,future:ml({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof r=="string"&&(r=Mi(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:h="default"}=r,m=Fe.useMemo(()=>{let v=Bl(u,c);return v==null?null:{location:{pathname:v,search:d,hash:f,state:p,key:h},navigationType:i}},[c,u,d,f,p,h,i]);return m==null?null:Fe.createElement(kf.Provider,{value:l},Fe.createElement(Nf.Provider,{children:n,value:m}))}new Promise(()=>{});function Lh(t,e){e===void 0&&(e=[]);let n=[];return Fe.Children.forEach(t,(r,i)=>{if(!Fe.isValidElement(r))return;let s=[...e,i];if(r.type===Fe.Fragment){n.push.apply(n,Lh(r.props.children,s));return}r.type!==NV&&yt(!1),!r.props.index||!r.props.children||yt(!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=Lh(r.props.children,s)),n.push(o)}),n}function AV(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:Fe.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:Fe.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:Fe.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function UH(t,e){return Yz({basename:e==null?void 0:e.basename,future:ml({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:_z({initialEntries:e==null?void 0:e.initialEntries,initialIndex:e==null?void 0:e.initialIndex}),hydrationData:e==null?void 0:e.hydrationData,routes:t,mapRouteProperties:AV,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation}).initialize()}function CV(){const[t]=jh(),{analytics:e}=t;Pn(()=>{const n=wt();if(!e){n&&n.close();return}if(n||!vi.sentry.dsn||vi.sentry.dsn==="")return;const r=window.__VITE_ENVS.SENTRY_RELEASE,i=[PT(),CT({depth:5}),MB(),NT({levels:["error"]})];vi.sentry.tracing&&i.push(c9({useEffect:wi.useEffect,useLocation:qg,useNavigationType:gV,createRoutesFromChildren:Lh,matchRoutes:Ki})),QB({release:r,dsn:vi.sentry.dsn,environment:vi.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 MV=({children:t})=>(CV(),t);function A_(...t){var e;(e=window.dataLayer)==null||e.push(...t)}const LV=()=>{const[{gaTrackingId:t}]=Bg(),[{analytics:e}]=jh(),n=t&&e;return Pn(()=>{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||[],A_("js",new Date),A_("config",t),()=>{document.head.removeChild(r)}}},[n,t]),null},PV=wi.lazy(async()=>({default:await(await Ko(()=>import("./router-BuelYVsv.js").then(n=>n.r),__vite__mapDeps([5,1,2,3]))).default()})),FV=()=>{for(const t of Object.values(e8))_l(t);return null},$V=()=>Te(wi.StrictMode,{children:Te(m1,{fallback:Te(C_,{}),children:Ft(B1,{store:pl,children:[Te(FV,{}),Te(c1,{children:Te(MV,{children:Te(vz,{children:Ft(l1,{children:[Te(u1,{position:"bottom-right"}),Ft(dz,{children:[Te(PV,{}),Te(pz,{}),Te(LV,{})]})]})})})})]})})}),BH=Object.freeze(Object.defineProperty({__proto__:null,default:$V},Symbol.toStringTag,{value:"Module"}));export{_6 as $,iz as A,_l as B,Df as C,Wg as D,Nh as E,I8 as F,$g as G,h8 as H,kH as I,SO as J,K4 as K,M8 as L,Sa as M,C8 as N,$H as O,oD as P,LH as Q,jH as R,W4 as S,U_ as T,NH as U,L8 as V,m8 as W,H8 as X,Ce as Y,D as Z,q4 as _,MH as a,L9 as a0,r6 as a1,BH as a2,mV as b,PH as c,Yz as d,CH as e,UH as f,qV as g,vl as h,j8 as i,dn as j,so as k,FH as l,AV as m,Ug as n,$8 as o,AH as p,bO as q,Bg as r,Nr as s,TO as t,qg as u,jg as v,Q4 as w,yn as x,Z_ as y,n8 as z};
|
|
842
|
+
//# sourceMappingURL=app-C-N9ep4R.js.map
|