@powerhousedao/ph-clint-app 0.1.0-dev.92 → 0.1.0-dev.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-UB24DImi.js → ClearStorageModal-CXoNWmRe-CfudY7gP.js} +2 -2
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-UB24DImi.js.map → ClearStorageModal-CXoNWmRe-CfudY7gP.js.map} +1 -1
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-D0iQimch.js → DebugSettingsModal-5SDhy5gt-Oc_wrZVo.js} +2 -2
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-D0iQimch.js.map → DebugSettingsModal-5SDhy5gt-Oc_wrZVo.js.map} +1 -1
- package/dist/connect/assets/{InspectorModal-BsSihzuc-Bavb3r9J.js → InspectorModal-BsSihzuc-adr3q93h.js} +2 -2
- package/dist/connect/assets/{InspectorModal-BsSihzuc-Bavb3r9J.js.map → InspectorModal-BsSihzuc-adr3q93h.js.map} +1 -1
- package/dist/connect/assets/{SettingsModal-S_A5qf95-q6y3kJdv.js → SettingsModal-S_A5qf95-DqxCHnLy.js} +2 -2
- package/dist/connect/assets/{SettingsModal-S_A5qf95-q6y3kJdv.js.map → SettingsModal-S_A5qf95-DqxCHnLy.js.map} +1 -1
- package/dist/connect/assets/{components-ByEUkO4U-BWcOYd4s.js → components-ByEUkO4U-DHdzb1cM.js} +4 -4
- package/dist/connect/assets/{components-ByEUkO4U-BWcOYd4s.js.map → components-ByEUkO4U-DHdzb1cM.js.map} +1 -1
- package/dist/connect/assets/{connect.config-Bt4pvvWV-CRF9MQO6.js → connect.config-Bt4pvvWV-TF7SRwB1.js} +2 -2
- package/dist/connect/assets/{connect.config-Bt4pvvWV-CRF9MQO6.js.map → connect.config-Bt4pvvWV-TF7SRwB1.js.map} +1 -1
- package/dist/connect/assets/{index-D8arPQE9.js → index-Bgr9U9X9.js} +3 -3
- package/dist/connect/assets/{index-D8arPQE9.js.map → index-Bgr9U9X9.js.map} +1 -1
- package/dist/connect/assets/{load-BWibkoFV-CryaAPih.js → load-BWibkoFV-jV3p7MXQ.js} +2 -2
- package/dist/connect/assets/{load-BWibkoFV-CryaAPih.js.map → load-BWibkoFV-jV3p7MXQ.js.map} +1 -1
- package/dist/connect/assets/{module-BA2WsOHG.js → module-bwULLGwn.js} +2 -2
- package/dist/connect/assets/{module-BA2WsOHG.js.map → module-bwULLGwn.js.map} +1 -1
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-CPFa41Bn.js → pglite-seed-BWk7yOwr-BjLA_ztF.js} +2 -2
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-CPFa41Bn.js.map → pglite-seed-BWk7yOwr-BjLA_ztF.js.map} +1 -1
- package/dist/connect/assets/{reactor-BxNvHOKC-DRYvJVeI.js → reactor-BxNvHOKC-DEqXBEvK.js} +2 -2
- package/dist/connect/assets/{reactor-BxNvHOKC-DRYvJVeI.js.map → reactor-BxNvHOKC-DEqXBEvK.js.map} +1 -1
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-BDpTOs18.js → registerServiceWorker-D9l1kja7-DG9mrLlt.js} +2 -2
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-BDpTOs18.js.map → registerServiceWorker-D9l1kja7-DG9mrLlt.js.map} +1 -1
- package/dist/connect/index.html +1 -1
- package/dist/connect/powerhouse.config.json +1 -1
- package/package.json +1 -1
package/dist/connect/assets/{components-ByEUkO4U-BWcOYd4s.js → components-ByEUkO4U-DHdzb1cM.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-B47ain9H.js","assets/chunk-BNv3lrIs.js","assets/preload-helper-ca-nBW7U.js","assets/chunk-A7RFOIQ7-LfOdAcBB.js","assets/chunk-BTBUZ646-BwTZXBLs.js","assets/chunk-EADU5A67-BHbnANQy.js","assets/chunk-WGR4JCLS-CvmEYK_g.js","assets/pg_dump-BL-IQ0O5.js","assets/dist-xKhBcQ062.js","assets/esm-u3Hz2lzn.js","assets/esm-DdtVZ6G4.js","assets/AddDriveModal-BoKLJyUY-cGJwd_2F.js","assets/connect-CGvtDtZh.js","assets/dist-t-ezfpxv.js","assets/hmac-wnxCe4SN.js","assets/worker-XYrQaEmt-w0FhumYk.js","assets/error-info-Cpu4OY3o-DJ8lg6ye.js","assets/types-CxSpmNGK-BaNo7EHQ.js","assets/esm-0nAQjFUV.js","assets/errors-D3S6Eysd-DUmQAeoG.js","assets/dist-Cb4AoJ-8.js","assets/clsx-CtFH8AOT.js","assets/toast-BEy42aYx-Dg_jZf6v.js","assets/i18next-kqPoxo7u.js","assets/ClearStorageModal-CXoNWmRe-
|
|
2
|
-
import{A as e,At as t,Ct as n,F as r,Ft as i,Gt as a,I as o,It as s,J as c,K as l,Kt as u,L as d,Lt as f,Ot as p,Q as m,Rt as h,St as g,V as _,W as v,Y as y,Yt as b,_t as x,at as S,ct as C,g as w,k as T,kt as E,mt as D,on as ee,st as O,ut as te,v as k,wt as ne,xt as re,yt as A}from"./dist-t-ezfpxv.js";import{C as ie,E as ae,F as oe,L as j,M,R as N,S as P,T as se,_ as F,c as I,d as ce,h as le,j as ue,k as L,l as de,x as fe,y as pe,z as me}from"./connect-CGvtDtZh.js";import{n as he}from"./runtime-config-DL3QjcfM-D9g4VFtY.js";import{t as R}from"./preload-helper-ca-nBW7U.js";import{$ as ge,R as _e,U as ve,it as ye,rt as be}from"./types-CxSpmNGK-BaNo7EHQ.js";import{r as z}from"./dist-Cb4AoJ-8.js";import{l as xe}from"./worker-XYrQaEmt-w0FhumYk.js";import{t as Se}from"./dist-DC27BFRa.js";import{n as Ce}from"./clsx-CtFH8AOT.js";import{n as B,t as we}from"./toast-BEy42aYx-Dg_jZf6v.js";import{t as Te}from"./i18next-kqPoxo7u.js";import{a as Ee,i as De,r as V}from"./connect.config-Bt4pvvWV-CRF9MQO6.js";import{_ as Oe,h as ke,l as Ae,m as je,n as Me,o as Ne,r as Pe,t as Fe,u as Ie}from"./module-BA2WsOHG.js";import{t as Le}from"./Trans-DDyWfeQm.js";import{t as Re}from"./useTranslation-DQCCLfKw.js";import{t as ze}from"./registerServiceWorker-D9l1kja7-BDpTOs18.js";import{Fragment as Be,jsx as H,jsxs as U}from"react/jsx-runtime";import*as W from"react";import Ve,{Component as He,StrictMode as Ue,Suspense as We,createContext as Ge,createElement as Ke,lazy as G,useCallback as qe,useContext as Je,useEffect as K,useLayoutEffect as Ye,useMemo as Xe,useRef as Ze,useState as Qe,useSyncExternalStore as $e}from"react";import*as et from"react-dom";function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(this,arguments)}var J;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(J||={});var tt=`popstate`;function nt(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return ot(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:st(t)}return lt(t,n,null,e)}function Y(e,t){if(e===!1||e==null)throw Error(t)}function rt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function it(){return Math.random().toString(36).substr(2,8)}function at(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,n,r){return n===void 0&&(n=null),q({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?ct(t):t,{state:n,key:t&&t.key||r||it()})}function st(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function ct(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function lt(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=J.Pop,c=null,l=u();l??(l=0,o.replaceState(q({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=J.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=J.Push;let r=ot(h.location,e,t);n&&n(r,e),l=u()+1;let d=at(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=J.Replace;let r=ot(h.location,e,t);n&&n(r,e),l=u();let i=at(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:st(e);return n=n.replace(/ $/,`%20`),Y(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(tt,d),c=e,()=>{i.removeEventListener(tt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var X;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(X||={});var ut=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function dt(e){return e.index===!0}function ft(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((e,i)=>{let a=[...n,String(i)],o=typeof e.id==`string`?e.id:a.join(`-`);if(Y(e.index!==!0||!e.children,`Cannot specify children on an index route`),Y(!r[o],`Found a route id collision on id "`+o+`". Route id's must be globally unique within Data Router usages`),dt(e)){let n=q({},e,t(e),{id:o});return r[o]=n,n}else{let n=q({},e,t(e),{id:o,children:void 0});return r[o]=n,e.children&&(n.children=ft(e.children,t,a,r)),n}})}function pt(e,t,n){return n===void 0&&(n=`/`),mt(e,t,n,!1)}function mt(e,t,n,r){let i=Mt((typeof t==`string`?ct(t):t).pathname||`/`,n);if(i==null)return null;let a=gt(e);vt(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=jt(i);o=Ot(a[e],t,r)}return o}function ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function gt(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(Y(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Vt([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(Y(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),gt(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:Et(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of _t(e.path))i(e,t,n)}),t}function _t(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=_t(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function vt(e){e.sort((e,t)=>e.score===t.score?Dt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var yt=/^:[\w-]+$/,bt=3,xt=2,St=1,Ct=10,wt=-2,Tt=e=>e===`*`;function Et(e,t){let n=e.split(`/`),r=n.length;return n.some(Tt)&&(r+=wt),t&&(r+=xt),n.filter(e=>!Tt(e)).reduce((e,t)=>e+(yt.test(t)?bt:t===``?St:Ct),r)}function Dt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ot(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Vt([a,u.pathname]),pathnameBase:Ht(Vt([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Vt([a,u.pathnameBase]))}return o}function kt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=At(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function At(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),rt(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function jt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return rt(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function Mt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pt=e=>Nt.test(e);function Ft(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ct(e):e,a;if(n)if(Pt(n))a=n;else{if(n.includes(`//`)){let e=n;n=n.replace(/\/\/+/g,`/`),rt(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?It(n.substring(1),`/`):It(n,t)}else a=t;return{pathname:a,search:Ut(r),hash:Wt(i)}}function It(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Lt(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`]. Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function Rt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function zt(e,t){let n=Rt(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Bt(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=ct(e):(i=q({},e),Y(!i.pathname||!i.pathname.includes(`?`),Lt(`?`,`pathname`,`search`,i)),Y(!i.pathname||!i.pathname.includes(`#`),Lt(`#`,`pathname`,`hash`,i)),Y(!i.search||!i.search.includes(`#`),Lt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ft(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Vt=e=>e.join(`/`).replace(/\/\/+/g,`/`),Ht=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Ut=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Wt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Gt=class{constructor(e,t,n,r){r===void 0&&(r=!1),this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Kt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var qt=[`post`,`put`,`patch`,`delete`],Jt=new Set(qt),Yt=[`get`,...qt],Xt=new Set(Yt),Zt=new Set([301,302,303,307,308]),Qt=new Set([307,308]),$t={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},en={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tn={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},nn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),an=`remix-router-transitions`;function on(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0,r=!n;Y(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=rn;let a={},o=ft(e.routes,i,void 0,a),s,c=e.basename||`/`,l=e.dataStrategy||yn,u=e.patchRoutesOnNavigation,d=q({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=pt(o,e.history.location,c),y=!1,b=null;if(v==null&&!u){let t=Z(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Nn(o);v=n,b={[r.id]:t}}v&&!e.hydrationData&&H(v,o,e.history.location.pathname).active&&(v=null);let x;if(!v){if(x=!1,v=[],d.v7_partialHydration){let t=H(null,o,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}}else if(v.some(e=>e.route.lazy))x=!1;else if(!v.some(e=>e.route.loader))x=!0;else if(d.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);x=v.slice(0,e+1).every(e=>!fn(e.route,t,n))}else x=v.every(e=>!fn(e.route,t,n))}else x=e.hydrationData!=null;let S,C={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,navigation:$t,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},w=J.Pop,T=!1,E,D=!1,ee=new Map,O=null,te=!1,k=!1,ne=[],re=new Set,A=new Map,ie=0,ae=-1,oe=new Map,j=new Set,M=new Map,N=new Map,P=new Set,se=new Map,F=new Map,I;function ce(){if(f=e.history.listen(t=>{let{action:n,location:r,delta:i}=t;if(I){I(),I=void 0;return}rt(F.size===0||i!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=Pe({currentLocation:C.location,nextLocation:r,historyAction:n});if(a&&i!=null){let t=new Promise(e=>{I=e});e.history.go(i*-1),Ne(a,{state:`blocked`,location:r,proceed(){Ne(a,{state:`proceeding`,proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(i))},reset(){let e=new Map(C.blockers);e.set(a,tn),L({blockers:e})}});return}return me(n,r)}),n){tr(t,ee);let e=()=>nr(t,ee);t.addEventListener(`pagehide`,e),O=()=>t.removeEventListener(`pagehide`,e)}return C.initialized||me(J.Pop,C.location,{initialHydration:!0}),S}function le(){f&&f(),O&&O(),p.clear(),E&&E.abort(),C.fetchers.forEach((e,t)=>Ee(t)),C.blockers.forEach((e,t)=>Me(t))}function ue(e){return p.add(e),()=>p.delete(e)}function L(e,t){t===void 0&&(t={}),C=q({},C,e);let n=[],r=[];d.v7_fetcherPersist&&C.fetchers.forEach((e,t)=>{e.state===`idle`&&(P.has(t)?r.push(t):n.push(t))}),P.forEach(e=>{!C.fetchers.has(e)&&!A.has(e)&&r.push(e)}),[...p].forEach(e=>e(C,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),d.v7_fetcherPersist?(n.forEach(e=>C.fetchers.delete(e)),r.forEach(e=>Ee(e))):r.forEach(e=>P.delete(e))}function de(t,n,r){let{flushSync:i}=r===void 0?{}:r,a=C.actionData!=null&&C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&C.navigation.state===`loading`&&t.state?._isRedirect!==!0,c;c=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?C.actionData:null;let l=n.loaderData?An(C.loaderData,n.loaderData,n.matches||[],n.errors):C.loaderData,u=C.blockers;u.size>0&&(u=new Map(u),u.forEach((e,t)=>u.set(t,tn)));let d=T===!0||C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&t.state?._isRedirect!==!0;s&&=(o=s,void 0),te||w===J.Pop||(w===J.Push?e.history.push(t,t.state):w===J.Replace&&e.history.replace(t,t.state));let f;if(w===J.Pop){let e=ee.get(C.location.pathname);e&&e.has(t.pathname)?f={currentLocation:C.location,nextLocation:t}:ee.has(t.pathname)&&(f={currentLocation:t,nextLocation:C.location})}else if(D){let e=ee.get(C.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ee.set(C.location.pathname,e)),f={currentLocation:C.location,nextLocation:t}}L(q({},n,{actionData:c,loaderData:l,historyAction:w,location:t,initialized:!0,navigation:$t,revalidation:`idle`,restoreScrollPosition:Be(t,n.matches||C.matches),preventScrollReset:d,blockers:u}),{viewTransitionOpts:f,flushSync:i===!0}),w=J.Pop,T=!1,D=!1,te=!1,k=!1,ne=[]}async function fe(t,n){if(typeof t==`number`){e.history.go(t);return}let r=cn(C.location,C.matches,c,d.v7_prependBasename,t,d.v7_relativeSplatPath,n?.fromRouteId,n?.relative),{path:i,submission:a,error:o}=ln(d.v7_normalizeFormMethod,!1,r,n),s=C.location,l=ot(C.location,i,n&&n.state);l=q({},l,e.history.encodeLocation(l));let u=n&&n.replace!=null?n.replace:void 0,f=J.Push;u===!0?f=J.Replace:u===!1||a!=null&&$(a.formMethod)&&a.formAction===C.location.pathname+C.location.search&&(f=J.Replace);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Pe({currentLocation:s,nextLocation:l,historyAction:f});if(h){Ne(h,{state:`blocked`,location:l,proceed(){Ne(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),fe(t,n)},reset(){let e=new Map(C.blockers);e.set(h,tn),L({blockers:e})}});return}return await me(f,l,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m})}function pe(){if(Ce(),L({revalidation:`loading`}),C.navigation.state!==`submitting`){if(C.navigation.state===`idle`){me(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}me(w||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:D===!0})}}async function me(t,n,r){E&&E.abort(),E=null,w=t,te=(r&&r.startUninterruptedRevalidation)===!0,ze(C.location,C.matches),T=(r&&r.preventScrollReset)===!0,D=(r&&r.enableViewTransition)===!0;let i=s||o,a=r&&r.overrideNavigation,l=r!=null&&r.initialHydration&&C.matches&&C.matches.length>0&&!y?C.matches:pt(i,n,c),u=(r&&r.flushSync)===!0;if(l&&C.initialized&&!k&&In(C.location,n)&&!(r&&r.submission&&$(r.submission.formMethod))){de(n,{matches:l},{flushSync:u});return}let d=H(l,i,n.pathname);if(d.active&&d.matches&&(l=d.matches),!l){let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);de(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}E=new AbortController;let f=Tn(e.history,n,E.signal,r&&r.submission),p;if(r&&r.pendingError)p=[Mn(l).route.id,{type:X.error,error:r.pendingError}];else if(r&&r.submission&&$(r.submission.formMethod)){let t=await he(f,n,r.submission,l,d.active,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Q(r)&&Kt(r.error)&&r.error.status===404){E=null,de(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}l=t.matches||l,p=t.pendingActionResult,a=Xn(n,r.submission),u=!1,d.active=!1,f=Tn(e.history,f.url,f.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_}=await R(f,n,l,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,p);m||(E=null,de(n,q({matches:h||l},jn(p),{loaderData:g,errors:_})))}async function he(t,n,r,i,a,o){if(o===void 0&&(o={}),Ce(),L({navigation:Zn(n,r)},{flushSync:o.flushSync===!0}),a){let e=await U(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Mn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:X.error,error:e.error}]}}else if(e.matches)i=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Fe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:X.error,error:t}]}}}let s,l=Jn(i,n);if(!l.route.action&&!l.route.lazy)s={type:X.error,error:Z(405,{method:t.method,pathname:n.pathname,routeId:l.route.id})};else if(s=(await xe(`action`,C,t,[l],i,null))[l.route.id],t.signal.aborted)return{shortCircuited:!0};if(zn(s)){let n;return n=o&&o.replace!=null?o.replace:wn(s.response.headers.get(`Location`),new URL(t.url),c,e.history)===C.location.pathname+C.location.search,await z(t,s,!0,{submission:r,replace:n}),{shortCircuited:!0}}if(Rn(s))throw Z(400,{type:`defer-action`});if(Q(s)){let e=Mn(i,l.route.id);return(o&&o.replace)!==!0&&(w=J.Push),{matches:i,pendingActionResult:[e.route.id,s]}}return{matches:i,pendingActionResult:[l.route.id,s]}}async function R(t,n,r,i,a,l,u,f,p,m,h){let g=a||Xn(n,l),_=l||u||Yn(g),v=!te&&(!d.v7_partialHydration||!p);if(i){if(v){let e=ge(h);L(q({navigation:g},e===void 0?{}:{actionData:e}),{flushSync:m})}let e=await U(r,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Mn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)r=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let y=s||o,[b,x]=dn(e.history,C,r,_,n,d.v7_partialHydration&&p===!0,d.v7_skipActionErrorRevalidation,k,ne,re,P,M,j,y,c,h);if(Ie(e=>!(r&&r.some(t=>t.route.id===e))||b&&b.some(t=>t.route.id===e)),ae=++ie,b.length===0&&x.length===0){let e=ke();return de(n,q({matches:r,loaderData:{},errors:h&&Q(h[1])?{[h[0]]:h[1].error}:null},jn(h),e?{fetchers:new Map(C.fetchers)}:{}),{flushSync:m}),{shortCircuited:!0}}if(v){let e={};if(!i){e.navigation=g;let t=ge(h);t!==void 0&&(e.actionData=t)}x.length>0&&(e.fetchers=_e(x)),L(e,{flushSync:m})}x.forEach(e=>{V(e.key),e.controller&&A.set(e.key,e.controller)});let S=()=>x.forEach(e=>V(e.key));E&&E.signal.addEventListener(`abort`,S);let{loaderResults:w,fetcherResults:T}=await Se(C,r,b,x,t);if(t.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener(`abort`,S),x.forEach(e=>A.delete(e.key));let D=Pn(w);if(D)return await z(t,D.result,!0,{replace:f}),{shortCircuited:!0};if(D=Pn(T),D)return j.add(D.key),await z(t,D.result,!0,{replace:f}),{shortCircuited:!0};let{loaderData:ee,errors:O}=kn(C,r,w,h,x,T,se);se.forEach((e,t)=>{e.subscribe(n=>{(n||e.done)&&se.delete(t)})}),d.v7_partialHydration&&p&&C.errors&&(O=q({},C.errors,O));let oe=ke(),N=Ae(ae),F=oe||N||x.length>0;return q({matches:r,loaderData:ee,errors:O},F?{fetchers:new Map(C.fetchers)}:{})}function ge(e){if(e&&!Q(e[1]))return{[e[0]]:e[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function _e(e){return e.forEach(e=>{let t=C.fetchers.get(e.key),n=Qn(void 0,t?t.data:void 0);C.fetchers.set(e.key,n)}),new Map(C.fetchers)}function ve(e,t,n,i){if(r)throw Error(`router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.`);V(e);let a=(i&&i.flushSync)===!0,l=s||o,u=cn(C.location,C.matches,c,d.v7_prependBasename,n,d.v7_relativeSplatPath,t,i?.relative),f=pt(l,u,c),p=H(f,l,u);if(p.active&&p.matches&&(f=p.matches),!f){we(e,t,Z(404,{pathname:u}),{flushSync:a});return}let{path:m,submission:h,error:g}=ln(d.v7_normalizeFormMethod,!0,u,i);if(g){we(e,t,g,{flushSync:a});return}let _=Jn(f,m),v=(i&&i.preventScrollReset)===!0;if(h&&$(h.formMethod)){ye(e,t,m,_,f,p.active,a,v,h);return}M.set(e,{routeId:t,path:m}),be(e,t,m,_,f,p.active,a,v,h)}async function ye(t,n,r,i,a,l,u,f,p){Ce(),M.delete(t);function m(e){return!e.route.action&&!e.route.lazy?(we(t,n,Z(405,{method:p.formMethod,pathname:r,routeId:n}),{flushSync:u}),!0):!1}if(!l&&m(i))return;B(t,$n(p,C.fetchers.get(t)),{flushSync:u});let h=new AbortController,g=Tn(e.history,r,h.signal,p);if(l){let e=await U(a,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:u});return}else if(!e.matches){we(t,n,Z(404,{pathname:r}),{flushSync:u});return}else if(a=e.matches,i=Jn(a,r),m(i))return}A.set(t,h);let _=ie,v=(await xe(`action`,C,g,[i],a,t))[i.route.id];if(g.signal.aborted){A.get(t)===h&&A.delete(t);return}if(d.v7_fetcherPersist&&P.has(t)){if(zn(v)||Q(v)){B(t,er(void 0));return}}else{if(zn(v))if(A.delete(t),ae>_){B(t,er(void 0));return}else return j.add(t),B(t,Qn(p)),z(g,v,!1,{fetcherSubmission:p,preventScrollReset:f});if(Q(v)){we(t,n,v.error);return}}if(Rn(v))throw Z(400,{type:`defer-action`});let y=C.navigation.location||C.location,b=Tn(e.history,y,h.signal),x=s||o,S=C.navigation.state===`idle`?C.matches:pt(x,C.navigation.location,c);Y(S,`Didn't find any matches after fetcher action`);let T=++ie;oe.set(t,T);let D=Qn(p,v.data);C.fetchers.set(t,D);let[ee,O]=dn(e.history,C,S,p,y,!1,d.v7_skipActionErrorRevalidation,k,ne,re,P,M,j,x,c,[i.route.id,v]);O.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=C.fetchers.get(t),r=Qn(void 0,n?n.data:void 0);C.fetchers.set(t,r),V(t),e.controller&&A.set(t,e.controller)}),L({fetchers:new Map(C.fetchers)});let te=()=>O.forEach(e=>V(e.key));h.signal.addEventListener(`abort`,te);let{loaderResults:N,fetcherResults:F}=await Se(C,S,ee,O,b);if(h.signal.aborted)return;h.signal.removeEventListener(`abort`,te),oe.delete(t),A.delete(t),O.forEach(e=>A.delete(e.key));let I=Pn(N);if(I)return z(b,I.result,!1,{preventScrollReset:f});if(I=Pn(F),I)return j.add(I.key),z(b,I.result,!1,{preventScrollReset:f});let{loaderData:ce,errors:le}=kn(C,S,N,void 0,O,F,se);if(C.fetchers.has(t)){let e=er(v.data);C.fetchers.set(t,e)}Ae(T),C.navigation.state===`loading`&&T>ae?(Y(w,`Expected pending action`),E&&E.abort(),de(C.navigation.location,{matches:S,loaderData:ce,errors:le,fetchers:new Map(C.fetchers)})):(L({errors:le,loaderData:An(C.loaderData,ce,S,le),fetchers:new Map(C.fetchers)}),k=!1)}async function be(t,n,r,i,a,o,s,c,l){let u=C.fetchers.get(t);B(t,Qn(l,u?u.data:void 0),{flushSync:s});let d=new AbortController,f=Tn(e.history,r,d.signal);if(o){let e=await U(a,new URL(f.url).pathname,f.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:s});return}else if(e.matches)a=e.matches,i=Jn(a,r);else{we(t,n,Z(404,{pathname:r}),{flushSync:s});return}}A.set(t,d);let p=ie,m=(await xe(`loader`,C,f,[i],a,t))[i.route.id];if(Rn(m)&&(m=await Kn(m,f.signal,!0)||m),A.get(t)===d&&A.delete(t),!f.signal.aborted){if(P.has(t)){B(t,er(void 0));return}if(zn(m))if(ae>p){B(t,er(void 0));return}else{j.add(t),await z(f,m,!1,{preventScrollReset:c});return}if(Q(m)){we(t,n,m.error);return}Y(!Rn(m),`Unhandled fetcher deferred data`),B(t,er(m.data))}}async function z(r,i,a,o){let{submission:s,fetcherSubmission:l,preventScrollReset:u,replace:d}=o===void 0?{}:o;i.response.headers.has(`X-Remix-Revalidate`)&&(k=!0);let f=i.response.headers.get(`Location`);Y(f,`Expected a Location header on the redirect Response`),f=wn(f,new URL(r.url),c,e.history);let p=ot(C.location,f,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))n=!0;else if(nn.test(f)){let r=e.history.createURL(f);n=r.origin!==t.location.origin||Mt(r.pathname,c)==null}if(n){d?t.location.replace(f):t.location.assign(f);return}}E=null;let m=d===!0||i.response.headers.has(`X-Remix-Replace`)?J.Replace:J.Push,{formMethod:h,formAction:g,formEncType:_}=C.navigation;!s&&!l&&h&&g&&_&&(s=Yn(C.navigation));let v=s||l;Qt.has(i.response.status)&&v&&$(v.formMethod)?await me(m,p,{submission:q({},v,{formAction:f}),preventScrollReset:u||T,enableViewTransition:a?D:void 0}):await me(m,p,{overrideNavigation:Xn(p,s),fetcherSubmission:l,preventScrollReset:u||T,enableViewTransition:a?D:void 0})}async function xe(e,t,n,r,o,s){let u,f={};try{u=await bn(l,e,t,n,r,o,s,a,i)}catch(e){return r.forEach(t=>{f[t.route.id]={type:X.error,error:e}}),f}for(let[e,t]of Object.entries(u))if(Ln(t)){let r=t.result;f[e]={type:X.redirect,response:Cn(r,n,e,o,c,d.v7_relativeSplatPath)}}else f[e]=await Sn(t);return f}async function Se(t,n,r,i,a){let o=t.matches,s=xe(`loader`,t,a,r,n,null),c=Promise.all(i.map(async n=>{if(n.matches&&n.match&&n.controller){let r=(await xe(`loader`,t,Tn(e.history,n.path,n.controller.signal),[n.match],n.matches,n.key))[n.match.route.id];return{[n.key]:r}}else return Promise.resolve({[n.key]:{type:X.error,error:Z(404,{pathname:n.path})}})})),l=await s,u=(await c).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([Wn(n,l,a.signal,o,t.loaderData),Gn(n,u,i)]),{loaderResults:l,fetcherResults:u}}function Ce(){k=!0,ne.push(...Ie()),M.forEach((e,t)=>{A.has(t)&&re.add(t),V(t)})}function B(e,t,n){n===void 0&&(n={}),C.fetchers.set(e,t),L({fetchers:new Map(C.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function we(e,t,n,r){r===void 0&&(r={});let i=Mn(C.matches,t);Ee(e),L({errors:{[i.route.id]:n},fetchers:new Map(C.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Te(e){return N.set(e,(N.get(e)||0)+1),P.has(e)&&P.delete(e),C.fetchers.get(e)||en}function Ee(e){let t=C.fetchers.get(e);A.has(e)&&!(t&&t.state===`loading`&&oe.has(e))&&V(e),M.delete(e),oe.delete(e),j.delete(e),d.v7_fetcherPersist&&P.delete(e),re.delete(e),C.fetchers.delete(e)}function De(e){let t=(N.get(e)||0)-1;t<=0?(N.delete(e),P.add(e),d.v7_fetcherPersist||Ee(e)):N.set(e,t),L({fetchers:new Map(C.fetchers)})}function V(e){let t=A.get(e);t&&(t.abort(),A.delete(e))}function Oe(e){for(let t of e){let e=er(Te(t).data);C.fetchers.set(t,e)}}function ke(){let e=[],t=!1;for(let n of j){let r=C.fetchers.get(n);Y(r,`Expected fetcher: `+n),r.state===`loading`&&(j.delete(n),e.push(n),t=!0)}return Oe(e),t}function Ae(e){let t=[];for(let[n,r]of oe)if(r<e){let e=C.fetchers.get(n);Y(e,`Expected fetcher: `+n),e.state===`loading`&&(V(n),oe.delete(n),t.push(n))}return Oe(t),t.length>0}function je(e,t){let n=C.blockers.get(e)||tn;return F.get(e)!==t&&F.set(e,t),n}function Me(e){C.blockers.delete(e),F.delete(e)}function Ne(e,t){let n=C.blockers.get(e)||tn;Y(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: `+n.state+` -> `+t.state);let r=new Map(C.blockers);r.set(e,t),L({blockers:r})}function Pe(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(F.size===0)return;F.size>1&&rt(!1,`A router only supports one blocker at a time`);let i=Array.from(F.entries()),[a,o]=i[i.length-1],s=C.blockers.get(a);if(!(s&&s.state===`proceeding`)&&o({currentLocation:t,nextLocation:n,historyAction:r}))return a}function Fe(e){let t=Z(404,{pathname:e}),{matches:n,route:r}=Nn(s||o);return Ie(),{notFoundMatches:n,route:r,error:t}}function Ie(e){let t=[];return se.forEach((n,r)=>{(!e||e(r))&&(n.cancel(),t.push(r),se.delete(r))}),t}function Le(e,t,n){if(m=e,g=t,h=n||null,!_&&C.navigation===$t){_=!0;let e=Be(C.location,C.matches);e!=null&&L({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Re(e,t){return h&&h(e,t.map(e=>ht(e,C.loaderData)))||e.key}function ze(e,t){if(m&&g){let n=Re(e,t);m[n]=g()}}function Be(e,t){if(m){let n=Re(e,t),r=m[n];if(typeof r==`number`)return r}return null}function H(e,t,n){if(u){if(!e)return{active:!0,matches:mt(t,n,c,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:mt(t,n,c,!0)}}return{active:!1,matches:null}}async function U(e,t,n,r){if(!u)return{type:`success`,matches:e};let l=e;for(;;){let e=s==null,d=s||o,f=a;try{await u({signal:n,path:t,matches:l,fetcherKey:r,patch:(e,t)=>{n.aborted||gn(e,t,d,f,i)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}finally{e&&!n.aborted&&(o=[...o])}if(n.aborted)return{type:`aborted`};let p=pt(d,t,c);if(p)return{type:`success`,matches:p};let m=mt(d,t,c,!0);if(!m||l.length===m.length&&l.every((e,t)=>e.route.id===m[t].route.id))return{type:`success`,matches:null};l=m}}function W(e){a={},s=ft(e,i,void 0,a)}function Ve(e,t){let n=s==null;gn(e,t,s||o,a,i),n&&(o=[...o],L({}))}return S={get basename(){return c},get future(){return d},get state(){return C},get routes(){return o},get window(){return t},initialize:ce,subscribe:ue,enableScrollRestoration:Le,navigate:fe,fetch:ve,revalidate:pe,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Te,deleteFetcher:De,dispose:le,getBlocker:je,deleteBlocker:Me,patchRoutes:Ve,_internalFetchControllers:A,_internalActiveDeferreds:se,_internalSetRoutes:W},S}function sn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function cn(e,t,n,r,i,a,o,s){let c,l;if(o){c=[];for(let e of t)if(c.push(e),e.route.id===o){l=e;break}}else c=t,l=t[t.length-1];let u=Bt(i||`.`,zt(c,a),Mt(e.pathname,n)||e.pathname,s===`path`);if(i??(u.search=e.search,u.hash=e.hash),(i==null||i===``||i===`.`)&&l){let e=qn(u.search);if(l.route.index&&!e)u.search=u.search?u.search.replace(/^\?/,`?index&`):`?index`;else if(!l.route.index&&e){let e=new URLSearchParams(u.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();u.search=n?`?`+n:``}}return r&&n!==`/`&&(u.pathname=u.pathname===`/`?n:Vt([n,u.pathname])),st(u)}function ln(e,t,n,r){if(!r||!sn(r))return{path:n};if(r.formMethod&&!Un(r.formMethod))return{path:n,error:Z(405,{method:r.formMethod})};let i=()=>({path:n,error:Z(400,{type:`invalid-body`})}),a=r.formMethod||`get`,o=e?a.toUpperCase():a.toLowerCase(),s=Fn(n);if(r.body!==void 0){if(r.formEncType===`text/plain`){if(!$(o))return i();let e=typeof r.body==`string`?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,t)=>{let[n,r]=t;return``+e+n+`=`+r+`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-B47ain9H.js","assets/chunk-BNv3lrIs.js","assets/preload-helper-ca-nBW7U.js","assets/chunk-A7RFOIQ7-LfOdAcBB.js","assets/chunk-BTBUZ646-BwTZXBLs.js","assets/chunk-EADU5A67-BHbnANQy.js","assets/chunk-WGR4JCLS-CvmEYK_g.js","assets/pg_dump-BL-IQ0O5.js","assets/dist-xKhBcQ062.js","assets/esm-u3Hz2lzn.js","assets/esm-DdtVZ6G4.js","assets/AddDriveModal-BoKLJyUY-cGJwd_2F.js","assets/connect-CGvtDtZh.js","assets/dist-t-ezfpxv.js","assets/hmac-wnxCe4SN.js","assets/worker-XYrQaEmt-w0FhumYk.js","assets/error-info-Cpu4OY3o-DJ8lg6ye.js","assets/types-CxSpmNGK-BaNo7EHQ.js","assets/esm-0nAQjFUV.js","assets/errors-D3S6Eysd-DUmQAeoG.js","assets/dist-Cb4AoJ-8.js","assets/clsx-CtFH8AOT.js","assets/toast-BEy42aYx-Dg_jZf6v.js","assets/i18next-kqPoxo7u.js","assets/ClearStorageModal-CXoNWmRe-CfudY7gP.js","assets/reactor-BxNvHOKC-DEqXBEvK.js","assets/connect.config-Bt4pvvWV-TF7SRwB1.js","assets/runtime-config-DL3QjcfM-D9g4VFtY.js","assets/module-bwULLGwn.js","assets/dist-DXM8ccKa-DV1gto78.js","assets/parser-CkF6Qt8V-CqvnWRuI.js","assets/chunk-pbuEa-1d-KEQyMDN_.js","assets/module-1hr_ne9w-CWAVsMzZ.js","assets/module-CRq_lUkG-D61oeRlC.js","assets/module-DP3bVbak-VbUPIBZP.js","assets/utils-BiV3cs9Y-B7i9WJ1b.js","assets/utils-CkWB3DRk-BURJYofr.js","assets/dist-DMXkjzve.js","assets/useTranslation-DQCCLfKw.js","assets/CookiesPolicyModal-1nOh6oN3-kK_sx5mz.js","assets/Trans-DDyWfeQm.js","assets/CreateDocumentModal-nQbLVDq3-DFAye2CX.js","assets/DebugSettingsModal-5SDhy5gt-Oc_wrZVo.js","assets/build-info-cc1PjSvF-DtAGzh0W.js","assets/registerServiceWorker-D9l1kja7-DG9mrLlt.js","assets/DeleteDriveModal-6P0T1QgD-CK6cPXbT.js","assets/DeleteItemModal-BmV1aQyZ-Ld9lHNhl.js","assets/DisclaimerModal-CVTFfN0_-D7N9TDI4.js","assets/DriveSettingsModal-CsNFEJ9E-BR2vyeU8.js","assets/DownloadDocumentWithErrorsModal-CXeFUtaz-CYIIl42M.js","assets/SettingsModal-S_A5qf95-DqxCHnLy.js","assets/package-BZLLR0Ma-B7vswMvI.js","assets/useRegistryPackages-B-gFECmd-C8h2M5qM.js","assets/UpgradeDriveModal-C7lV4rAX-CTIf4duw.js","assets/InspectorModal-BsSihzuc-adr3q93h.js","assets/pglite-seed-BWk7yOwr-BjLA_ztF.js","assets/MissingPackageModal-Bn036mWQ-C021G1nV.js","assets/DriveAuthRequiredModal-B3VdLwSH-fqmI_4sF.js","assets/load-BWibkoFV-jV3p7MXQ.js","assets/reload-connect-toast-CwvSc6F--BQcqGaN_.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{A as e,At as t,Ct as n,F as r,Ft as i,Gt as a,I as o,It as s,J as c,K as l,Kt as u,L as d,Lt as f,Ot as p,Q as m,Rt as h,St as g,V as _,W as v,Y as y,Yt as b,_t as x,at as S,ct as C,g as w,k as T,kt as E,mt as D,on as ee,st as O,ut as te,v as k,wt as ne,xt as re,yt as A}from"./dist-t-ezfpxv.js";import{C as ie,E as ae,F as oe,L as j,M,R as N,S as P,T as se,_ as F,c as I,d as ce,h as le,j as ue,k as L,l as de,x as fe,y as pe,z as me}from"./connect-CGvtDtZh.js";import{n as he}from"./runtime-config-DL3QjcfM-D9g4VFtY.js";import{t as R}from"./preload-helper-ca-nBW7U.js";import{$ as ge,R as _e,U as ve,it as ye,rt as be}from"./types-CxSpmNGK-BaNo7EHQ.js";import{r as z}from"./dist-Cb4AoJ-8.js";import{l as xe}from"./worker-XYrQaEmt-w0FhumYk.js";import{t as Se}from"./dist-DC27BFRa.js";import{n as Ce}from"./clsx-CtFH8AOT.js";import{n as B,t as we}from"./toast-BEy42aYx-Dg_jZf6v.js";import{t as Te}from"./i18next-kqPoxo7u.js";import{a as Ee,i as De,r as V}from"./connect.config-Bt4pvvWV-TF7SRwB1.js";import{_ as Oe,h as ke,l as Ae,m as je,n as Me,o as Ne,r as Pe,t as Fe,u as Ie}from"./module-bwULLGwn.js";import{t as Le}from"./Trans-DDyWfeQm.js";import{t as Re}from"./useTranslation-DQCCLfKw.js";import{t as ze}from"./registerServiceWorker-D9l1kja7-DG9mrLlt.js";import{Fragment as Be,jsx as H,jsxs as U}from"react/jsx-runtime";import*as W from"react";import Ve,{Component as He,StrictMode as Ue,Suspense as We,createContext as Ge,createElement as Ke,lazy as G,useCallback as qe,useContext as Je,useEffect as K,useLayoutEffect as Ye,useMemo as Xe,useRef as Ze,useState as Qe,useSyncExternalStore as $e}from"react";import*as et from"react-dom";function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(this,arguments)}var J;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(J||={});var tt=`popstate`;function nt(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return ot(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:st(t)}return lt(t,n,null,e)}function Y(e,t){if(e===!1||e==null)throw Error(t)}function rt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function it(){return Math.random().toString(36).substr(2,8)}function at(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,n,r){return n===void 0&&(n=null),q({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?ct(t):t,{state:n,key:t&&t.key||r||it()})}function st(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function ct(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function lt(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=J.Pop,c=null,l=u();l??(l=0,o.replaceState(q({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=J.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=J.Push;let r=ot(h.location,e,t);n&&n(r,e),l=u()+1;let d=at(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=J.Replace;let r=ot(h.location,e,t);n&&n(r,e),l=u();let i=at(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:st(e);return n=n.replace(/ $/,`%20`),Y(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(tt,d),c=e,()=>{i.removeEventListener(tt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var X;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(X||={});var ut=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function dt(e){return e.index===!0}function ft(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((e,i)=>{let a=[...n,String(i)],o=typeof e.id==`string`?e.id:a.join(`-`);if(Y(e.index!==!0||!e.children,`Cannot specify children on an index route`),Y(!r[o],`Found a route id collision on id "`+o+`". Route id's must be globally unique within Data Router usages`),dt(e)){let n=q({},e,t(e),{id:o});return r[o]=n,n}else{let n=q({},e,t(e),{id:o,children:void 0});return r[o]=n,e.children&&(n.children=ft(e.children,t,a,r)),n}})}function pt(e,t,n){return n===void 0&&(n=`/`),mt(e,t,n,!1)}function mt(e,t,n,r){let i=Mt((typeof t==`string`?ct(t):t).pathname||`/`,n);if(i==null)return null;let a=gt(e);vt(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=jt(i);o=Ot(a[e],t,r)}return o}function ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function gt(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(Y(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Vt([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(Y(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),gt(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:Et(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of _t(e.path))i(e,t,n)}),t}function _t(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=_t(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function vt(e){e.sort((e,t)=>e.score===t.score?Dt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var yt=/^:[\w-]+$/,bt=3,xt=2,St=1,Ct=10,wt=-2,Tt=e=>e===`*`;function Et(e,t){let n=e.split(`/`),r=n.length;return n.some(Tt)&&(r+=wt),t&&(r+=xt),n.filter(e=>!Tt(e)).reduce((e,t)=>e+(yt.test(t)?bt:t===``?St:Ct),r)}function Dt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ot(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Vt([a,u.pathname]),pathnameBase:Ht(Vt([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Vt([a,u.pathnameBase]))}return o}function kt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=At(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function At(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),rt(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function jt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return rt(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function Mt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pt=e=>Nt.test(e);function Ft(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ct(e):e,a;if(n)if(Pt(n))a=n;else{if(n.includes(`//`)){let e=n;n=n.replace(/\/\/+/g,`/`),rt(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?It(n.substring(1),`/`):It(n,t)}else a=t;return{pathname:a,search:Ut(r),hash:Wt(i)}}function It(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Lt(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`]. Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function Rt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function zt(e,t){let n=Rt(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Bt(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=ct(e):(i=q({},e),Y(!i.pathname||!i.pathname.includes(`?`),Lt(`?`,`pathname`,`search`,i)),Y(!i.pathname||!i.pathname.includes(`#`),Lt(`#`,`pathname`,`hash`,i)),Y(!i.search||!i.search.includes(`#`),Lt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ft(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Vt=e=>e.join(`/`).replace(/\/\/+/g,`/`),Ht=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Ut=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Wt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Gt=class{constructor(e,t,n,r){r===void 0&&(r=!1),this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Kt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var qt=[`post`,`put`,`patch`,`delete`],Jt=new Set(qt),Yt=[`get`,...qt],Xt=new Set(Yt),Zt=new Set([301,302,303,307,308]),Qt=new Set([307,308]),$t={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},en={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tn={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},nn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),an=`remix-router-transitions`;function on(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0,r=!n;Y(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=rn;let a={},o=ft(e.routes,i,void 0,a),s,c=e.basename||`/`,l=e.dataStrategy||yn,u=e.patchRoutesOnNavigation,d=q({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=pt(o,e.history.location,c),y=!1,b=null;if(v==null&&!u){let t=Z(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Nn(o);v=n,b={[r.id]:t}}v&&!e.hydrationData&&H(v,o,e.history.location.pathname).active&&(v=null);let x;if(!v){if(x=!1,v=[],d.v7_partialHydration){let t=H(null,o,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}}else if(v.some(e=>e.route.lazy))x=!1;else if(!v.some(e=>e.route.loader))x=!0;else if(d.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);x=v.slice(0,e+1).every(e=>!fn(e.route,t,n))}else x=v.every(e=>!fn(e.route,t,n))}else x=e.hydrationData!=null;let S,C={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,navigation:$t,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},w=J.Pop,T=!1,E,D=!1,ee=new Map,O=null,te=!1,k=!1,ne=[],re=new Set,A=new Map,ie=0,ae=-1,oe=new Map,j=new Set,M=new Map,N=new Map,P=new Set,se=new Map,F=new Map,I;function ce(){if(f=e.history.listen(t=>{let{action:n,location:r,delta:i}=t;if(I){I(),I=void 0;return}rt(F.size===0||i!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=Pe({currentLocation:C.location,nextLocation:r,historyAction:n});if(a&&i!=null){let t=new Promise(e=>{I=e});e.history.go(i*-1),Ne(a,{state:`blocked`,location:r,proceed(){Ne(a,{state:`proceeding`,proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(i))},reset(){let e=new Map(C.blockers);e.set(a,tn),L({blockers:e})}});return}return me(n,r)}),n){tr(t,ee);let e=()=>nr(t,ee);t.addEventListener(`pagehide`,e),O=()=>t.removeEventListener(`pagehide`,e)}return C.initialized||me(J.Pop,C.location,{initialHydration:!0}),S}function le(){f&&f(),O&&O(),p.clear(),E&&E.abort(),C.fetchers.forEach((e,t)=>Ee(t)),C.blockers.forEach((e,t)=>Me(t))}function ue(e){return p.add(e),()=>p.delete(e)}function L(e,t){t===void 0&&(t={}),C=q({},C,e);let n=[],r=[];d.v7_fetcherPersist&&C.fetchers.forEach((e,t)=>{e.state===`idle`&&(P.has(t)?r.push(t):n.push(t))}),P.forEach(e=>{!C.fetchers.has(e)&&!A.has(e)&&r.push(e)}),[...p].forEach(e=>e(C,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),d.v7_fetcherPersist?(n.forEach(e=>C.fetchers.delete(e)),r.forEach(e=>Ee(e))):r.forEach(e=>P.delete(e))}function de(t,n,r){let{flushSync:i}=r===void 0?{}:r,a=C.actionData!=null&&C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&C.navigation.state===`loading`&&t.state?._isRedirect!==!0,c;c=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?C.actionData:null;let l=n.loaderData?An(C.loaderData,n.loaderData,n.matches||[],n.errors):C.loaderData,u=C.blockers;u.size>0&&(u=new Map(u),u.forEach((e,t)=>u.set(t,tn)));let d=T===!0||C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&t.state?._isRedirect!==!0;s&&=(o=s,void 0),te||w===J.Pop||(w===J.Push?e.history.push(t,t.state):w===J.Replace&&e.history.replace(t,t.state));let f;if(w===J.Pop){let e=ee.get(C.location.pathname);e&&e.has(t.pathname)?f={currentLocation:C.location,nextLocation:t}:ee.has(t.pathname)&&(f={currentLocation:t,nextLocation:C.location})}else if(D){let e=ee.get(C.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ee.set(C.location.pathname,e)),f={currentLocation:C.location,nextLocation:t}}L(q({},n,{actionData:c,loaderData:l,historyAction:w,location:t,initialized:!0,navigation:$t,revalidation:`idle`,restoreScrollPosition:Be(t,n.matches||C.matches),preventScrollReset:d,blockers:u}),{viewTransitionOpts:f,flushSync:i===!0}),w=J.Pop,T=!1,D=!1,te=!1,k=!1,ne=[]}async function fe(t,n){if(typeof t==`number`){e.history.go(t);return}let r=cn(C.location,C.matches,c,d.v7_prependBasename,t,d.v7_relativeSplatPath,n?.fromRouteId,n?.relative),{path:i,submission:a,error:o}=ln(d.v7_normalizeFormMethod,!1,r,n),s=C.location,l=ot(C.location,i,n&&n.state);l=q({},l,e.history.encodeLocation(l));let u=n&&n.replace!=null?n.replace:void 0,f=J.Push;u===!0?f=J.Replace:u===!1||a!=null&&$(a.formMethod)&&a.formAction===C.location.pathname+C.location.search&&(f=J.Replace);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Pe({currentLocation:s,nextLocation:l,historyAction:f});if(h){Ne(h,{state:`blocked`,location:l,proceed(){Ne(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),fe(t,n)},reset(){let e=new Map(C.blockers);e.set(h,tn),L({blockers:e})}});return}return await me(f,l,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m})}function pe(){if(Ce(),L({revalidation:`loading`}),C.navigation.state!==`submitting`){if(C.navigation.state===`idle`){me(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}me(w||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:D===!0})}}async function me(t,n,r){E&&E.abort(),E=null,w=t,te=(r&&r.startUninterruptedRevalidation)===!0,ze(C.location,C.matches),T=(r&&r.preventScrollReset)===!0,D=(r&&r.enableViewTransition)===!0;let i=s||o,a=r&&r.overrideNavigation,l=r!=null&&r.initialHydration&&C.matches&&C.matches.length>0&&!y?C.matches:pt(i,n,c),u=(r&&r.flushSync)===!0;if(l&&C.initialized&&!k&&In(C.location,n)&&!(r&&r.submission&&$(r.submission.formMethod))){de(n,{matches:l},{flushSync:u});return}let d=H(l,i,n.pathname);if(d.active&&d.matches&&(l=d.matches),!l){let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);de(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}E=new AbortController;let f=Tn(e.history,n,E.signal,r&&r.submission),p;if(r&&r.pendingError)p=[Mn(l).route.id,{type:X.error,error:r.pendingError}];else if(r&&r.submission&&$(r.submission.formMethod)){let t=await he(f,n,r.submission,l,d.active,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Q(r)&&Kt(r.error)&&r.error.status===404){E=null,de(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}l=t.matches||l,p=t.pendingActionResult,a=Xn(n,r.submission),u=!1,d.active=!1,f=Tn(e.history,f.url,f.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_}=await R(f,n,l,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,p);m||(E=null,de(n,q({matches:h||l},jn(p),{loaderData:g,errors:_})))}async function he(t,n,r,i,a,o){if(o===void 0&&(o={}),Ce(),L({navigation:Zn(n,r)},{flushSync:o.flushSync===!0}),a){let e=await U(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Mn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:X.error,error:e.error}]}}else if(e.matches)i=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Fe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:X.error,error:t}]}}}let s,l=Jn(i,n);if(!l.route.action&&!l.route.lazy)s={type:X.error,error:Z(405,{method:t.method,pathname:n.pathname,routeId:l.route.id})};else if(s=(await xe(`action`,C,t,[l],i,null))[l.route.id],t.signal.aborted)return{shortCircuited:!0};if(zn(s)){let n;return n=o&&o.replace!=null?o.replace:wn(s.response.headers.get(`Location`),new URL(t.url),c,e.history)===C.location.pathname+C.location.search,await z(t,s,!0,{submission:r,replace:n}),{shortCircuited:!0}}if(Rn(s))throw Z(400,{type:`defer-action`});if(Q(s)){let e=Mn(i,l.route.id);return(o&&o.replace)!==!0&&(w=J.Push),{matches:i,pendingActionResult:[e.route.id,s]}}return{matches:i,pendingActionResult:[l.route.id,s]}}async function R(t,n,r,i,a,l,u,f,p,m,h){let g=a||Xn(n,l),_=l||u||Yn(g),v=!te&&(!d.v7_partialHydration||!p);if(i){if(v){let e=ge(h);L(q({navigation:g},e===void 0?{}:{actionData:e}),{flushSync:m})}let e=await U(r,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Mn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)r=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let y=s||o,[b,x]=dn(e.history,C,r,_,n,d.v7_partialHydration&&p===!0,d.v7_skipActionErrorRevalidation,k,ne,re,P,M,j,y,c,h);if(Ie(e=>!(r&&r.some(t=>t.route.id===e))||b&&b.some(t=>t.route.id===e)),ae=++ie,b.length===0&&x.length===0){let e=ke();return de(n,q({matches:r,loaderData:{},errors:h&&Q(h[1])?{[h[0]]:h[1].error}:null},jn(h),e?{fetchers:new Map(C.fetchers)}:{}),{flushSync:m}),{shortCircuited:!0}}if(v){let e={};if(!i){e.navigation=g;let t=ge(h);t!==void 0&&(e.actionData=t)}x.length>0&&(e.fetchers=_e(x)),L(e,{flushSync:m})}x.forEach(e=>{V(e.key),e.controller&&A.set(e.key,e.controller)});let S=()=>x.forEach(e=>V(e.key));E&&E.signal.addEventListener(`abort`,S);let{loaderResults:w,fetcherResults:T}=await Se(C,r,b,x,t);if(t.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener(`abort`,S),x.forEach(e=>A.delete(e.key));let D=Pn(w);if(D)return await z(t,D.result,!0,{replace:f}),{shortCircuited:!0};if(D=Pn(T),D)return j.add(D.key),await z(t,D.result,!0,{replace:f}),{shortCircuited:!0};let{loaderData:ee,errors:O}=kn(C,r,w,h,x,T,se);se.forEach((e,t)=>{e.subscribe(n=>{(n||e.done)&&se.delete(t)})}),d.v7_partialHydration&&p&&C.errors&&(O=q({},C.errors,O));let oe=ke(),N=Ae(ae),F=oe||N||x.length>0;return q({matches:r,loaderData:ee,errors:O},F?{fetchers:new Map(C.fetchers)}:{})}function ge(e){if(e&&!Q(e[1]))return{[e[0]]:e[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function _e(e){return e.forEach(e=>{let t=C.fetchers.get(e.key),n=Qn(void 0,t?t.data:void 0);C.fetchers.set(e.key,n)}),new Map(C.fetchers)}function ve(e,t,n,i){if(r)throw Error(`router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.`);V(e);let a=(i&&i.flushSync)===!0,l=s||o,u=cn(C.location,C.matches,c,d.v7_prependBasename,n,d.v7_relativeSplatPath,t,i?.relative),f=pt(l,u,c),p=H(f,l,u);if(p.active&&p.matches&&(f=p.matches),!f){we(e,t,Z(404,{pathname:u}),{flushSync:a});return}let{path:m,submission:h,error:g}=ln(d.v7_normalizeFormMethod,!0,u,i);if(g){we(e,t,g,{flushSync:a});return}let _=Jn(f,m),v=(i&&i.preventScrollReset)===!0;if(h&&$(h.formMethod)){ye(e,t,m,_,f,p.active,a,v,h);return}M.set(e,{routeId:t,path:m}),be(e,t,m,_,f,p.active,a,v,h)}async function ye(t,n,r,i,a,l,u,f,p){Ce(),M.delete(t);function m(e){return!e.route.action&&!e.route.lazy?(we(t,n,Z(405,{method:p.formMethod,pathname:r,routeId:n}),{flushSync:u}),!0):!1}if(!l&&m(i))return;B(t,$n(p,C.fetchers.get(t)),{flushSync:u});let h=new AbortController,g=Tn(e.history,r,h.signal,p);if(l){let e=await U(a,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:u});return}else if(!e.matches){we(t,n,Z(404,{pathname:r}),{flushSync:u});return}else if(a=e.matches,i=Jn(a,r),m(i))return}A.set(t,h);let _=ie,v=(await xe(`action`,C,g,[i],a,t))[i.route.id];if(g.signal.aborted){A.get(t)===h&&A.delete(t);return}if(d.v7_fetcherPersist&&P.has(t)){if(zn(v)||Q(v)){B(t,er(void 0));return}}else{if(zn(v))if(A.delete(t),ae>_){B(t,er(void 0));return}else return j.add(t),B(t,Qn(p)),z(g,v,!1,{fetcherSubmission:p,preventScrollReset:f});if(Q(v)){we(t,n,v.error);return}}if(Rn(v))throw Z(400,{type:`defer-action`});let y=C.navigation.location||C.location,b=Tn(e.history,y,h.signal),x=s||o,S=C.navigation.state===`idle`?C.matches:pt(x,C.navigation.location,c);Y(S,`Didn't find any matches after fetcher action`);let T=++ie;oe.set(t,T);let D=Qn(p,v.data);C.fetchers.set(t,D);let[ee,O]=dn(e.history,C,S,p,y,!1,d.v7_skipActionErrorRevalidation,k,ne,re,P,M,j,x,c,[i.route.id,v]);O.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=C.fetchers.get(t),r=Qn(void 0,n?n.data:void 0);C.fetchers.set(t,r),V(t),e.controller&&A.set(t,e.controller)}),L({fetchers:new Map(C.fetchers)});let te=()=>O.forEach(e=>V(e.key));h.signal.addEventListener(`abort`,te);let{loaderResults:N,fetcherResults:F}=await Se(C,S,ee,O,b);if(h.signal.aborted)return;h.signal.removeEventListener(`abort`,te),oe.delete(t),A.delete(t),O.forEach(e=>A.delete(e.key));let I=Pn(N);if(I)return z(b,I.result,!1,{preventScrollReset:f});if(I=Pn(F),I)return j.add(I.key),z(b,I.result,!1,{preventScrollReset:f});let{loaderData:ce,errors:le}=kn(C,S,N,void 0,O,F,se);if(C.fetchers.has(t)){let e=er(v.data);C.fetchers.set(t,e)}Ae(T),C.navigation.state===`loading`&&T>ae?(Y(w,`Expected pending action`),E&&E.abort(),de(C.navigation.location,{matches:S,loaderData:ce,errors:le,fetchers:new Map(C.fetchers)})):(L({errors:le,loaderData:An(C.loaderData,ce,S,le),fetchers:new Map(C.fetchers)}),k=!1)}async function be(t,n,r,i,a,o,s,c,l){let u=C.fetchers.get(t);B(t,Qn(l,u?u.data:void 0),{flushSync:s});let d=new AbortController,f=Tn(e.history,r,d.signal);if(o){let e=await U(a,new URL(f.url).pathname,f.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:s});return}else if(e.matches)a=e.matches,i=Jn(a,r);else{we(t,n,Z(404,{pathname:r}),{flushSync:s});return}}A.set(t,d);let p=ie,m=(await xe(`loader`,C,f,[i],a,t))[i.route.id];if(Rn(m)&&(m=await Kn(m,f.signal,!0)||m),A.get(t)===d&&A.delete(t),!f.signal.aborted){if(P.has(t)){B(t,er(void 0));return}if(zn(m))if(ae>p){B(t,er(void 0));return}else{j.add(t),await z(f,m,!1,{preventScrollReset:c});return}if(Q(m)){we(t,n,m.error);return}Y(!Rn(m),`Unhandled fetcher deferred data`),B(t,er(m.data))}}async function z(r,i,a,o){let{submission:s,fetcherSubmission:l,preventScrollReset:u,replace:d}=o===void 0?{}:o;i.response.headers.has(`X-Remix-Revalidate`)&&(k=!0);let f=i.response.headers.get(`Location`);Y(f,`Expected a Location header on the redirect Response`),f=wn(f,new URL(r.url),c,e.history);let p=ot(C.location,f,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))n=!0;else if(nn.test(f)){let r=e.history.createURL(f);n=r.origin!==t.location.origin||Mt(r.pathname,c)==null}if(n){d?t.location.replace(f):t.location.assign(f);return}}E=null;let m=d===!0||i.response.headers.has(`X-Remix-Replace`)?J.Replace:J.Push,{formMethod:h,formAction:g,formEncType:_}=C.navigation;!s&&!l&&h&&g&&_&&(s=Yn(C.navigation));let v=s||l;Qt.has(i.response.status)&&v&&$(v.formMethod)?await me(m,p,{submission:q({},v,{formAction:f}),preventScrollReset:u||T,enableViewTransition:a?D:void 0}):await me(m,p,{overrideNavigation:Xn(p,s),fetcherSubmission:l,preventScrollReset:u||T,enableViewTransition:a?D:void 0})}async function xe(e,t,n,r,o,s){let u,f={};try{u=await bn(l,e,t,n,r,o,s,a,i)}catch(e){return r.forEach(t=>{f[t.route.id]={type:X.error,error:e}}),f}for(let[e,t]of Object.entries(u))if(Ln(t)){let r=t.result;f[e]={type:X.redirect,response:Cn(r,n,e,o,c,d.v7_relativeSplatPath)}}else f[e]=await Sn(t);return f}async function Se(t,n,r,i,a){let o=t.matches,s=xe(`loader`,t,a,r,n,null),c=Promise.all(i.map(async n=>{if(n.matches&&n.match&&n.controller){let r=(await xe(`loader`,t,Tn(e.history,n.path,n.controller.signal),[n.match],n.matches,n.key))[n.match.route.id];return{[n.key]:r}}else return Promise.resolve({[n.key]:{type:X.error,error:Z(404,{pathname:n.path})}})})),l=await s,u=(await c).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([Wn(n,l,a.signal,o,t.loaderData),Gn(n,u,i)]),{loaderResults:l,fetcherResults:u}}function Ce(){k=!0,ne.push(...Ie()),M.forEach((e,t)=>{A.has(t)&&re.add(t),V(t)})}function B(e,t,n){n===void 0&&(n={}),C.fetchers.set(e,t),L({fetchers:new Map(C.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function we(e,t,n,r){r===void 0&&(r={});let i=Mn(C.matches,t);Ee(e),L({errors:{[i.route.id]:n},fetchers:new Map(C.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Te(e){return N.set(e,(N.get(e)||0)+1),P.has(e)&&P.delete(e),C.fetchers.get(e)||en}function Ee(e){let t=C.fetchers.get(e);A.has(e)&&!(t&&t.state===`loading`&&oe.has(e))&&V(e),M.delete(e),oe.delete(e),j.delete(e),d.v7_fetcherPersist&&P.delete(e),re.delete(e),C.fetchers.delete(e)}function De(e){let t=(N.get(e)||0)-1;t<=0?(N.delete(e),P.add(e),d.v7_fetcherPersist||Ee(e)):N.set(e,t),L({fetchers:new Map(C.fetchers)})}function V(e){let t=A.get(e);t&&(t.abort(),A.delete(e))}function Oe(e){for(let t of e){let e=er(Te(t).data);C.fetchers.set(t,e)}}function ke(){let e=[],t=!1;for(let n of j){let r=C.fetchers.get(n);Y(r,`Expected fetcher: `+n),r.state===`loading`&&(j.delete(n),e.push(n),t=!0)}return Oe(e),t}function Ae(e){let t=[];for(let[n,r]of oe)if(r<e){let e=C.fetchers.get(n);Y(e,`Expected fetcher: `+n),e.state===`loading`&&(V(n),oe.delete(n),t.push(n))}return Oe(t),t.length>0}function je(e,t){let n=C.blockers.get(e)||tn;return F.get(e)!==t&&F.set(e,t),n}function Me(e){C.blockers.delete(e),F.delete(e)}function Ne(e,t){let n=C.blockers.get(e)||tn;Y(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: `+n.state+` -> `+t.state);let r=new Map(C.blockers);r.set(e,t),L({blockers:r})}function Pe(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(F.size===0)return;F.size>1&&rt(!1,`A router only supports one blocker at a time`);let i=Array.from(F.entries()),[a,o]=i[i.length-1],s=C.blockers.get(a);if(!(s&&s.state===`proceeding`)&&o({currentLocation:t,nextLocation:n,historyAction:r}))return a}function Fe(e){let t=Z(404,{pathname:e}),{matches:n,route:r}=Nn(s||o);return Ie(),{notFoundMatches:n,route:r,error:t}}function Ie(e){let t=[];return se.forEach((n,r)=>{(!e||e(r))&&(n.cancel(),t.push(r),se.delete(r))}),t}function Le(e,t,n){if(m=e,g=t,h=n||null,!_&&C.navigation===$t){_=!0;let e=Be(C.location,C.matches);e!=null&&L({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Re(e,t){return h&&h(e,t.map(e=>ht(e,C.loaderData)))||e.key}function ze(e,t){if(m&&g){let n=Re(e,t);m[n]=g()}}function Be(e,t){if(m){let n=Re(e,t),r=m[n];if(typeof r==`number`)return r}return null}function H(e,t,n){if(u){if(!e)return{active:!0,matches:mt(t,n,c,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:mt(t,n,c,!0)}}return{active:!1,matches:null}}async function U(e,t,n,r){if(!u)return{type:`success`,matches:e};let l=e;for(;;){let e=s==null,d=s||o,f=a;try{await u({signal:n,path:t,matches:l,fetcherKey:r,patch:(e,t)=>{n.aborted||gn(e,t,d,f,i)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}finally{e&&!n.aborted&&(o=[...o])}if(n.aborted)return{type:`aborted`};let p=pt(d,t,c);if(p)return{type:`success`,matches:p};let m=mt(d,t,c,!0);if(!m||l.length===m.length&&l.every((e,t)=>e.route.id===m[t].route.id))return{type:`success`,matches:null};l=m}}function W(e){a={},s=ft(e,i,void 0,a)}function Ve(e,t){let n=s==null;gn(e,t,s||o,a,i),n&&(o=[...o],L({}))}return S={get basename(){return c},get future(){return d},get state(){return C},get routes(){return o},get window(){return t},initialize:ce,subscribe:ue,enableScrollRestoration:Le,navigate:fe,fetch:ve,revalidate:pe,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Te,deleteFetcher:De,dispose:le,getBlocker:je,deleteBlocker:Me,patchRoutes:Ve,_internalFetchControllers:A,_internalActiveDeferreds:se,_internalSetRoutes:W},S}function sn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function cn(e,t,n,r,i,a,o,s){let c,l;if(o){c=[];for(let e of t)if(c.push(e),e.route.id===o){l=e;break}}else c=t,l=t[t.length-1];let u=Bt(i||`.`,zt(c,a),Mt(e.pathname,n)||e.pathname,s===`path`);if(i??(u.search=e.search,u.hash=e.hash),(i==null||i===``||i===`.`)&&l){let e=qn(u.search);if(l.route.index&&!e)u.search=u.search?u.search.replace(/^\?/,`?index&`):`?index`;else if(!l.route.index&&e){let e=new URLSearchParams(u.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();u.search=n?`?`+n:``}}return r&&n!==`/`&&(u.pathname=u.pathname===`/`?n:Vt([n,u.pathname])),st(u)}function ln(e,t,n,r){if(!r||!sn(r))return{path:n};if(r.formMethod&&!Un(r.formMethod))return{path:n,error:Z(405,{method:r.formMethod})};let i=()=>({path:n,error:Z(400,{type:`invalid-body`})}),a=r.formMethod||`get`,o=e?a.toUpperCase():a.toLowerCase(),s=Fn(n);if(r.body!==void 0){if(r.formEncType===`text/plain`){if(!$(o))return i();let e=typeof r.body==`string`?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,t)=>{let[n,r]=t;return``+e+n+`=`+r+`
|
|
3
3
|
`},``):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if(r.formEncType===`application/json`){if(!$(o))return i();try{let e=typeof r.body==`string`?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch{return i()}}}Y(typeof FormData==`function`,`FormData is not available in this environment`);let c,l;if(r.formData)c=En(r.formData),l=r.formData;else if(r.body instanceof FormData)c=En(r.body),l=r.body;else if(r.body instanceof URLSearchParams)c=r.body,l=Dn(c);else if(r.body==null)c=new URLSearchParams,l=new FormData;else try{c=new URLSearchParams(r.body),l=Dn(c)}catch{return i()}let u={formMethod:o,formAction:s,formEncType:r&&r.formEncType||`application/x-www-form-urlencoded`,formData:l,json:void 0,text:void 0};if($(u.formMethod))return{path:n,submission:u};let d=ct(n);return t&&d.search&&qn(d.search)&&c.append(`index`,``),d.search=`?`+c,{path:st(d),submission:u}}function un(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(e=>e.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function dn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=h?Q(h[1])?h[1].error:h[1].data:void 0,_=e.createURL(t.location),v=e.createURL(i),y=n;a&&t.errors?y=un(n,Object.keys(t.errors)[0],!0):h&&Q(h[1])&&(y=un(n,h[0]));let b=h?h[1].statusCode:void 0,x=o&&b&&b>=400,S=y.filter((e,n)=>{let{route:i}=e;if(i.lazy)return!0;if(i.loader==null)return!1;if(a)return fn(i,t.loaderData,t.errors);if(pn(t.loaderData,t.matches[n],e)||c.some(t=>t===e.route.id))return!0;let o=t.matches[n],l=e;return hn(e,q({currentUrl:_,currentParams:o.params,nextUrl:v,nextParams:l.params},r,{actionResult:g,actionStatus:b,defaultShouldRevalidate:x?!1:s||_.pathname+_.search===v.pathname+v.search||_.search!==v.search||mn(o,l)}))}),C=[];return d.forEach((e,i)=>{if(a||!n.some(t=>t.route.id===e.routeId)||u.has(i))return;let o=pt(p,e.path,m);if(!o){C.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});return}let c=t.fetchers.get(i),d=Jn(o,e.path),h=!1;f.has(i)?h=!1:l.has(i)?(l.delete(i),h=!0):h=c&&c.state!==`idle`&&c.data===void 0?s:hn(d,q({currentUrl:_,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:g,actionStatus:b,defaultShouldRevalidate:x?!1:s})),h&&C.push({key:i,routeId:e.routeId,path:e.path,matches:o,match:d,controller:new AbortController})}),[S,C]}function fn(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader==`function`&&e.loader.hydrate===!0?!0:!r&&!i}function pn(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function mn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function hn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function gn(e,t,n,r,i){let a;if(e){let t=r[e];Y(t,`No route found to patch children into: routeId = `+e),t.children||=[],a=t.children}else a=n;let o=ft(t.filter(e=>!a.some(t=>_n(e,t))),i,[e||`_`,`patch`,String(a?.length||`0`)],r);a.push(...o)}function _n(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((e,n)=>t.children?.some(t=>_n(e,t))):!1}async function vn(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];Y(i,`No route found in manifest`);let a={};for(let e in r){let t=i[e]!==void 0&&e!==`hasErrorBoundary`;rt(!t,`Route "`+i.id+`" has a static property "`+e+`" defined but its lazy function is also returning a value for this property. `+(`The lazy route property "`+e+`" will be ignored.`)),!t&&!ut.has(e)&&(a[e]=r[e])}Object.assign(i,a),Object.assign(i,q({},t(i),{lazy:void 0}))}async function yn(e){let{matches:t}=e,n=t.filter(e=>e.shouldLoad);return(await Promise.all(n.map(e=>e.resolve()))).reduce((e,t,r)=>Object.assign(e,{[n[r].route.id]:t}),{})}async function bn(e,t,n,r,i,a,o,s,c,l){let u=a.map(e=>e.route.lazy?vn(e.route,c,s):void 0),d=await e({matches:a.map((e,n)=>{let a=u[n],o=i.some(t=>t.route.id===e.route.id);return q({},e,{shouldLoad:o,resolve:async n=>(n&&r.method===`GET`&&(e.route.lazy||e.route.loader)&&(o=!0),o?xn(t,r,e,a,n,l):Promise.resolve({type:X.data,result:void 0}))})}),request:r,params:a[0].params,fetcherKey:o,context:l});try{await Promise.all(u)}catch{}return d}async function xn(e,t,n,r,i,a){let o,s,c=r=>{let o,c=new Promise((e,t)=>o=t);s=()=>o(),t.signal.addEventListener(`abort`,s);let l=i=>typeof r==`function`?r({request:t,params:n.params,context:a},...i===void 0?[]:[i]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean `+(`"`+e+`" [routeId: `+n.route.id+`]`))),u=(async()=>{try{return{type:`data`,result:await(i?i(e=>l(e)):l())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([u,c])};try{let i=n.route[e];if(r)if(i){let e,[t]=await Promise.all([c(i).catch(t=>{e=t}),r]);if(e!==void 0)throw e;o=t}else if(await r,i=n.route[e],i)o=await c(i);else if(e===`action`){let e=new URL(t.url),r=e.pathname+e.search;throw Z(405,{method:t.method,pathname:r,routeId:n.route.id})}else return{type:X.data,result:void 0};else if(i)o=await c(i);else{let e=new URL(t.url);throw Z(404,{pathname:e.pathname+e.search})}Y(o.result!==void 0,`You defined `+(e===`action`?`an action`:`a loader`)+` for route `+(`"`+n.route.id+`" but didn't return anything from your \``+e+"` ")+"function. Please return a value or `null`.")}catch(e){return{type:X.error,result:e}}finally{s&&t.signal.removeEventListener(`abort`,s)}return o}async function Sn(e){let{result:t,type:n}=e;if(Hn(t)){let e;try{let n=t.headers.get(`Content-Type`);e=n&&/\bapplication\/json\b/.test(n)?t.body==null?null:await t.json():await t.text()}catch(e){return{type:X.error,error:e}}return n===X.error?{type:X.error,error:new Gt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:X.data,data:e,statusCode:t.status,headers:t.headers}}if(n===X.error){if(Bn(t)){var r;if(t.data instanceof Error){var i;return{type:X.error,error:t.data,statusCode:t.init?.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:X.error,error:new Gt(t.init?.status||500,void 0,t.data),statusCode:Kt(t)?t.status:void 0,headers:(r=t.init)!=null&&r.headers?new Headers(t.init.headers):void 0}}return{type:X.error,error:t,statusCode:Kt(t)?t.status:void 0}}if(Vn(t))return{type:X.deferred,deferredData:t,statusCode:t.init?.status,headers:t.init?.headers&&new Headers(t.init.headers)};if(Bn(t)){var a;return{type:X.data,data:t.data,statusCode:t.init?.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:X.data,data:t}}function Cn(e,t,n,r,i,a){let o=e.headers.get(`Location`);if(Y(o,`Redirects returned/thrown from loaders/actions must have a Location header`),!nn.test(o)){let s=r.slice(0,r.findIndex(e=>e.route.id===n)+1);o=cn(new URL(t.url),s,i,!0,o,a),e.headers.set(`Location`,o)}return e}function wn(e,t,n,r){let i=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];if(nn.test(e)){let r=e,a=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(i.includes(a.protocol))throw Error(`Invalid redirect location`);let o=Mt(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}try{let t=r.createURL(e);if(i.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function Tn(e,t,n,r){let i=e.createURL(Fn(t)).toString(),a={signal:n};if(r&&$(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=En(r.formData):a.body=r.formData}return new Request(i,a)}function En(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Dn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function On(e,t,n,r,i){let a={},o=null,s,c=!1,l={},u=n&&Q(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(Y(!zn(f),`Cannot handle redirect results in processLoaderData`),Q(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Mn(e,d);o[n.route.id]??(o[n.route.id]=t)}a[d]=void 0,c||(c=!0,s=Kt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else Rn(f)?(r.set(d,f.deferredData),a[d]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)):(a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers))}),u!==void 0&&n&&(o={[n[0]]:u},a[n[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function kn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=On(t,n,r,o,!1);return i.forEach(t=>{let{key:n,match:r,controller:i}=t,o=a[n];if(Y(o,`Did not find corresponding fetcher result`),!(i&&i.signal.aborted))if(Q(o)){let t=Mn(e.matches,r?.route.id);c&&c[t.route.id]||(c=q({},c,{[t.route.id]:o.error})),e.fetchers.delete(n)}else if(zn(o))Y(!1,`Unhandled fetcher revalidation redirect`);else if(Rn(o))Y(!1,`Unhandled fetcher deferred data`);else{let t=er(o.data);e.fetchers.set(n,t)}}),{loaderData:s,errors:c}}function An(e,t,n,r){let i=q({},t);for(let a of n){let n=a.route.id;if(t.hasOwnProperty(n)?t[n]!==void 0&&(i[n]=t[n]):e[n]!==void 0&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function jn(e){return e?Q(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Mn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Nn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Z(e,t){let{pathname:n,routeId:r,method:i,type:a,message:o}=t===void 0?{}:t,s=`Unknown Server Error`,c=`Unknown @remix-run/router error`;return e===400?(s=`Bad Request`,i&&n&&r?c=`You made a `+i+` request to "`+n+`" but `+('did not provide a `loader` for route "'+r+`", `)+`so there is no way to handle the request.`:a===`defer-action`?c=`defer() is not supported in actions`:a===`invalid-body`&&(c=`Unable to encode submission body`)):e===403?(s=`Forbidden`,c=`Route "`+r+`" does not match URL "`+n+`"`):e===404?(s=`Not Found`,c=`No route matches URL "`+n+`"`):e===405&&(s=`Method Not Allowed`,i&&n&&r?c=`You made a `+i.toUpperCase()+` request to "`+n+`" but `+('did not provide an `action` for route "'+r+`", `)+`so there is no way to handle the request.`:i&&(c=`Invalid request method "`+i.toUpperCase()+`"`)),new Gt(e||500,s,Error(c),!0)}function Pn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(zn(r))return{key:n,result:r}}}function Fn(e){let t=typeof e==`string`?ct(e):e;return st(q({},t,{hash:``}))}function In(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function Ln(e){return Hn(e.result)&&Zt.has(e.result.status)}function Rn(e){return e.type===X.deferred}function Q(e){return e.type===X.error}function zn(e){return(e&&e.type)===X.redirect}function Bn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Vn(e){let t=e;return t&&typeof t==`object`&&typeof t.data==`object`&&typeof t.subscribe==`function`&&typeof t.cancel==`function`&&typeof t.resolveData==`function`}function Hn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Un(e){return Xt.has(e.toLowerCase())}function $(e){return Jt.has(e.toLowerCase())}async function Wn(e,t,n,r,i){let a=Object.entries(t);for(let o=0;o<a.length;o++){let[s,c]=a[o],l=e.find(e=>e?.route.id===s);if(!l)continue;let u=r.find(e=>e.route.id===l.route.id),d=u!=null&&!mn(u,l)&&(i&&i[l.route.id])!==void 0;Rn(c)&&d&&await Kn(c,n,!1).then(e=>{e&&(t[s]=e)})}}async function Gn(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:a,controller:o}=n[r],s=t[i];e.find(e=>e?.route.id===a)&&Rn(s)&&(Y(o,`Expected an AbortController for revalidating fetcher deferred result`),await Kn(s,o.signal,!0).then(e=>{e&&(t[i]=e)}))}}async function Kn(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:X.data,data:e.deferredData.unwrappedData}}catch(e){return{type:X.error,error:e}}return{type:X.data,data:e.deferredData.data}}}function qn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Jn(e,t){let n=typeof t==`string`?ct(t).search:t.search;if(e[e.length-1].route.index&&qn(n||``))return e[e.length-1];let r=Rt(e);return r[r.length-1]}function Yn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Xn(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Zn(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Qn(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function $n(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function er(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function tr(e,t){try{let n=e.sessionStorage.getItem(an);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function nr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(an,JSON.stringify(n))}catch(e){rt(!1,`Failed to save applied view transitions in sessionStorage (`+e+`).`)}}}function rr(){return rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rr.apply(this,arguments)}var ir=W.createContext(null),ar=W.createContext(null),or=W.createContext(null),sr=W.createContext(null),cr=W.createContext({outlet:null,matches:[],isDataRoute:!1}),lr=W.createContext(null);function ur(){return W.useContext(sr)!=null}function dr(){return!ur()&&Y(!1),W.useContext(sr).location}function fr(){return W.useContext(sr).navigationType}var pr=W.createContext(null);function mr(e){let t=W.useContext(cr).outlet;return t&&W.createElement(pr.Provider,{value:e},t)}function hr(e,t,n,r){!ur()&&Y(!1);let{navigator:i}=W.useContext(or),{matches:a}=W.useContext(cr),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=dr(),u;if(t){let e=typeof t==`string`?ct(t):t;!(c===`/`||e.pathname?.startsWith(c))&&Y(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=pt(e,{pathname:f}),m=br(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Vt([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Vt([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?W.createElement(sr.Provider,{value:{location:rr({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:J.Pop}},m):m}function gr(){let e=Tr(),t=Kt(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return W.createElement(W.Fragment,null,W.createElement(`h2`,null,`Unexpected Application Error!`),W.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?W.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var _r=W.createElement(gr,null),vr=class extends W.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,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:W.createElement(cr.Provider,{value:this.props.routeContext},W.createElement(lr.Provider,{value:this.state.error,children:this.props.component}))}};function yr(e){let{routeContext:t,match:n,children:r}=e,i=W.useContext(ir);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(cr.Provider,{value:t},r)}function br(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&Y(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||_r,s&&(c<0&&i===0?(Dr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?W.createElement(r.route.Component,null):r.route.element?r.route.element:e,W.createElement(yr,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?W.createElement(vr,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var xr=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(xr||{});function Sr(e){let t=W.useContext(ar);return!t&&Y(!1),t}function Cr(e){let t=W.useContext(cr);return!t&&Y(!1),t}function wr(e){let t=Cr(e),n=t.matches[t.matches.length-1];return!n.route.id&&Y(!1),n.route.id}function Tr(){let e=W.useContext(lr),t=Sr(xr.UseRouteError),n=wr(xr.UseRouteError);return e===void 0?t.errors?.[n]:e}var Er={};function Dr(e,t,n){!t&&!Er[e]&&(Er[e]=!0)}var Or=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function kr(e,t){e?.v7_startTransition===void 0&&Or(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&Or(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&Or(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&Or(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&Or(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&Or(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}function Ar(e){return mr(e.context)}function jr(e){Y(!1)}function Mr(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=J.Pop,navigator:a,static:o=!1,future:s}=e;ur()&&Y(!1);let c=t.replace(/^\/*/,`/`),l=W.useMemo(()=>({basename:c,navigator:a,static:o,future:rr({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=ct(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=W.useMemo(()=>{let e=Mt(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:W.createElement(or.Provider,{value:l},W.createElement(sr.Provider,{children:n,value:h}))}var Nr=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(Nr||{});new Promise(()=>{}),W.Component;function Pr(e,t){t===void 0&&(t=[]);let n=[];return W.Children.forEach(e,(e,r)=>{if(!W.isValidElement(e))return;let i=[...t,r];if(e.type===W.Fragment){n.push.apply(n,Pr(e.props.children,i));return}e.type!==jr&&Y(!1),!(!e.props.index||!e.props.children)&&Y(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Pr(e.props.children,i)),n.push(a)}),n}function Fr(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:W.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:W.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:W.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Ir(){return Ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ir.apply(this,arguments)}var Lr=`6`;try{window.__reactRouterVersion=Lr}catch{}function Rr(e,t){return on({basename:t?.basename,future:Ir({},t?.future,{v7_prependBasename:!0}),history:nt({window:t?.window}),hydrationData:t?.hydrationData||zr(),routes:e,mapRouteProperties:Fr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function zr(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e=Ir({},e,{errors:Br(e.errors)})),e}function Br(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Gt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var Vr=W.createContext({isTransitioning:!1}),Hr=W.createContext(new Map),Ur=W.startTransition,Wr=et.flushSync;function Gr(e){Ur?Ur(e):e()}function Kr(e){Wr?Wr(e):e()}var qr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Jr(e){let{fallbackElement:t,router:n,future:r}=e,[i,a]=W.useState(n.state),[o,s]=W.useState(),[c,l]=W.useState({isTransitioning:!1}),[u,d]=W.useState(),[f,p]=W.useState(),[m,h]=W.useState(),g=W.useRef(new Map),{v7_startTransition:_}=r||{},v=W.useCallback(e=>{_?Gr(e):e()},[_]),y=W.useCallback((e,t)=>{let{deletedFetchers:r,flushSync:i,viewTransitionOpts:o}=t;e.fetchers.forEach((e,t)=>{e.data!==void 0&&g.current.set(t,e.data)}),r.forEach(e=>g.current.delete(e));let c=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!=`function`;if(!o||c){i?Kr(()=>a(e)):v(()=>a(e));return}if(i){Kr(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})});let t=n.window.document.startViewTransition(()=>{Kr(()=>a(e))});t.finished.finally(()=>{Kr(()=>{d(void 0),p(void 0),s(void 0),l({isTransitioning:!1})})}),Kr(()=>p(t));return}f?(u&&u.resolve(),f.skipTransition(),h({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),l({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))},[n.window,f,u,g,v]);W.useLayoutEffect(()=>n.subscribe(y),[n,y]),W.useEffect(()=>{c.isTransitioning&&!c.flushSync&&d(new qr)},[c]),W.useEffect(()=>{if(u&&o&&n.window){let e=o,t=u.promise,r=n.window.document.startViewTransition(async()=>{v(()=>a(e)),await t});r.finished.finally(()=>{d(void 0),p(void 0),s(void 0),l({isTransitioning:!1})}),p(r)}},[v,o,u,n.window]),W.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,f,i.location,o]),W.useEffect(()=>{!c.isTransitioning&&m&&(s(m.state),l({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),h(void 0))},[c.isTransitioning,m]),W.useEffect(()=>{},[]);let b=W.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:r?.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:r?.preventScrollReset})}),[n]),x=n.basename||`/`,S=W.useMemo(()=>({router:n,navigator:b,static:!1,basename:x}),[n,b,x]),C=W.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return W.useEffect(()=>kr(r,n.future),[r,n.future]),W.createElement(W.Fragment,null,W.createElement(ir.Provider,{value:S},W.createElement(ar.Provider,{value:i},W.createElement(Hr.Provider,{value:g.current},W.createElement(Vr.Provider,{value:c},W.createElement(Mr,{basename:x,location:i.location,navigationType:i.historyAction,navigator:b,future:C},i.initialized||n.future.v7_partialHydration?W.createElement(Yr,{routes:n.routes,future:n.future,state:i}):t))))),null)}var Yr=W.memo(Xr);function Xr(e){let{routes:t,future:n,state:r}=e;return hr(t,void 0,r,n)}typeof window<`u`&&window.document!==void 0&&window.document.createElement;var Zr;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(Zr||={});var Qr;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(Qr||={});function $r(){return $r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$r.apply(null,arguments)}var ei=[`shift`,`alt`,`meta`,`mod`,`ctrl`],ti={esc:`escape`,return:`enter`,".":`period`,",":`comma`,"-":`slash`," ":`space`,"`":`backquote`,"#":`backslash`,"+":`bracketright`,ShiftLeft:`shift`,ShiftRight:`shift`,AltLeft:`alt`,AltRight:`alt`,MetaLeft:`meta`,MetaRight:`meta`,OSLeft:`meta`,OSRight:`meta`,ControlLeft:`ctrl`,ControlRight:`ctrl`};function ni(e){return(e&&ti[e]||e||``).trim().toLowerCase().replace(/key|digit|numpad|arrow/,``)}function ri(e){return ei.includes(e)}function ii(e,t){return t===void 0&&(t=`,`),e.split(t)}function ai(e,t,n){t===void 0&&(t=`+`);var r=e.toLocaleLowerCase().split(t).map(function(e){return ni(e)}),i={alt:r.includes(`alt`),ctrl:r.includes(`ctrl`)||r.includes(`control`),shift:r.includes(`shift`),meta:r.includes(`meta`),mod:r.includes(`mod`)},a=r.filter(function(e){return!ei.includes(e)});return $r({},i,{keys:a,description:n,hotkey:e})}(function(){typeof document<`u`&&(document.addEventListener(`keydown`,function(e){e.key!==void 0&&li([ni(e.key),ni(e.code)])}),document.addEventListener(`keyup`,function(e){e.key!==void 0&&ui([ni(e.key),ni(e.code)])})),typeof window<`u`&&window.addEventListener(`blur`,function(){oi.clear()})})();var oi=new Set;function si(e){return Array.isArray(e)}function ci(e,t){return t===void 0&&(t=`,`),(si(e)?e:e.split(t)).every(function(e){return oi.has(e.trim().toLowerCase())})}function li(e){var t=Array.isArray(e)?e:[e];oi.has(`meta`)&&oi.forEach(function(e){return!ri(e)&&oi.delete(e.toLowerCase())}),t.forEach(function(e){return oi.add(e.toLowerCase())})}function ui(e){e===`meta`?oi.clear():(Array.isArray(e)?e:[e]).forEach(function(e){return oi.delete(e.toLowerCase())})}function di(e,t,n){(typeof n==`function`&&n(e,t)||n===!0)&&e.preventDefault()}function fi(e,t,n){return typeof n==`function`?n(e,t):n===!0||n===void 0}function pi(e){return mi(e,[`input`,`textarea`,`select`])}function mi(e,t){t===void 0&&(t=!1);var n=e.target,r=e.composed,i=null;return i=hi(n)&&r?e.composedPath()[0]&&e.composedPath()[0].tagName:n&&n.tagName,si(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i?.toLowerCase()})):!!(i&&t&&t)}function hi(e){return!!e.tagName&&!e.tagName.startsWith(`-`)&&e.tagName.includes(`-`)}function gi(e,t){return e.length===0&&t?(console.warn(`A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>`),!0):t?e.some(function(e){return t.includes(e)})||e.includes(`*`):!0}var _i=function(e,t,n){n===void 0&&(n=!1);var r=t.alt,i=t.meta,a=t.mod,o=t.shift,s=t.ctrl,c=t.keys,l=e.key,u=e.code,d=e.ctrlKey,f=e.metaKey,p=e.shiftKey,m=e.altKey,h=ni(u),g=l.toLowerCase();if(!(c!=null&&c.includes(h))&&!(c!=null&&c.includes(g))&&![`ctrl`,`control`,`unknown`,`meta`,`alt`,`shift`,`os`].includes(h))return!1;if(!n){if(r===!m&&g!==`alt`||o===!p&&g!==`shift`)return!1;if(a){if(!f&&!d)return!1}else if(i===!f&&g!==`meta`&&g!==`os`||s===!d&&g!==`ctrl`&&g!==`control`)return!1}return c&&c.length===1&&(c.includes(g)||c.includes(h))?!0:c?ci(c):!c},vi=Ge(void 0),yi=function(){return Je(vi)};function bi(e,t){return e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&bi(e[r],t[r])},!0):e===t}var xi=Ge({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Si=function(){return Je(xi)};function Ci(e){var t=Ze(void 0);return bi(t.current,e)||(t.current=e),t.current}var wi=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Ti=typeof window<`u`?Ye:K;function Ei(e,t,n,r){var i=Qe(null),a=i[0],o=i[1],s=Ze(!1),c=n instanceof Array?r instanceof Array?void 0:r:n,l=si(e)?e.join(c?.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,d=qe(t,u??[]),f=Ze(d);u?f.current=d:f.current=t;var p=Ci(c),m=Si().enabledScopes,h=yi();return Ti(function(){if(!(p?.enabled===!1||!gi(m,p?.scopes))){var e=function(e,t){var n;if(t===void 0&&(t=!1),!(pi(e)&&!mi(e,p?.enableOnFormTags))){if(a!==null){var r=a.getRootNode();if((r instanceof Document||r instanceof ShadowRoot)&&r.activeElement!==a&&!a.contains(r.activeElement)){wi(e);return}}(n=e.target)!=null&&n.isContentEditable&&!(p!=null&&p.enableOnContentEditable)||ii(l,p?.splitKey).forEach(function(n){var r,i=ai(n,p?.combinationKey);if(_i(e,i,p?.ignoreModifiers)||(r=i.keys)!=null&&r.includes(`*`)){if(p!=null&&p.ignoreEventWhen!=null&&p.ignoreEventWhen(e)||t&&s.current)return;if(di(e,i,p?.preventDefault),!fi(e,i,p?.enabled)){wi(e);return}f.current(e,i),t||(s.current=!0)}})}},t=function(t){t.key!==void 0&&(li(ni(t.code)),(p?.keydown===void 0&&p?.keyup!==!0||p!=null&&p.keydown)&&e(t))},n=function(t){t.key!==void 0&&(ui(ni(t.code)),s.current=!1,p!=null&&p.keyup&&e(t,!0))},r=a||c?.document||document;return r.addEventListener(`keyup`,n,c?.eventListenerOptions),r.addEventListener(`keydown`,t,c?.eventListenerOptions),h&&ii(l,p?.splitKey).forEach(function(e){return h.addHotkey(ai(e,p?.combinationKey,p?.description))}),function(){r.removeEventListener(`keyup`,n,c?.eventListenerOptions),r.removeEventListener(`keydown`,t,c?.eventListenerOptions),h&&ii(l,p?.splitKey).forEach(function(e){return h.removeHotkey(ai(e,p?.combinationKey,p?.description))})}}},[a,l,p,m]),o}var Di=Ge(null),Oi={didCatch:!1,error:null},ki=class extends He{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Oi}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(e!==null){var t,n,r=[...arguments];(t=(n=this.props).onReset)==null||t.call(n,{args:r,reason:`imperative-api`}),this.setState(Oi)}}componentDidCatch(e,t){var n,r;(n=(r=this.props).onError)==null||n.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;if(n&&t.error!==null&&Ai(e.resetKeys,r)){var i,a;(i=(a=this.props).onReset)==null||i.call(a,{next:r,prev:e.resetKeys,reason:`keys`}),this.setState(Oi)}}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=Ke(n,e);else if(r!==void 0)o=r;else throw a}return Ke(Di.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function Ai(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`d8903a21-c874-5d84-a70b-2014249dd0ad`)}catch{}})();function ji(){return typeof document>`u`?`/`:document.querySelector(`base`)?.getAttribute(`href`)||`/`}var Mi=null,Ni=new Set;function Pi(e){Mi=e;for(let e of Ni)e()}function Fi(){return Mi}function Ii(e){return Ni.add(e),()=>{Ni.delete(e)}}var Li=`ph-pglite-backup::`,Ri=`ph:pglite-backups`,zi=720*60*60*1e3,Bi={16:async()=>{let[{PGlite:e},{pgDump:t}]=await Promise.all([R(()=>import(`./dist-B47ain9H.js`),__vite__mapDeps([0,1,2,3,4,5,6])),R(()=>import(`./pg_dump-BL-IQ0O5.js`),__vite__mapDeps([7,1,2]))]);return async n=>{let r=new e(`idb://${n.replace(/^\/pglite\//,``)}`);try{return await r.waitReady,await(await t({pg:r})).text()}finally{await r.close()}}}};function Vi(e,t=15e3){return new Promise((n,r)=>{let i=indexedDB.deleteDatabase(e),a=!1,o=e=>{a||(a=!0,e())},s=setTimeout(()=>o(()=>r(Error(`IDB delete timed out for ${e} after ${t}ms`))),t);i.onsuccess=()=>o(()=>{clearTimeout(s),n()}),i.onerror=()=>o(()=>{clearTimeout(s),r(Ie(i,`IDB delete failed for ${e}`))})})}async function Hi(e){let t=await je(e,21,Ne);try{await new Promise((n,r)=>{let i=t.transaction(Me,`readwrite`);i.oncomplete=()=>n(),i.onerror=()=>r(Ie(i,`FILE_DATA clear failed for ${e}`)),i.onabort=()=>r(Ie(i,`FILE_DATA clear aborted for ${e}`)),i.objectStore(Me).clear()})}finally{t.close()}}async function Ui(e,t){let n=await je(e,21,Ne);try{let r=await je(t,21,Ne);try{let i=n.transaction(Me,`readonly`).objectStore(Me),a=await new Promise((t,n)=>{let r=[],a=i.openCursor();a.onerror=()=>n(Ie(a,`FILE_DATA read cursor failed for ${e}`)),a.onsuccess=()=>{let e=a.result;if(!e)return t(r);r.push({key:e.key,value:e.value}),e.continue()}});await new Promise((e,n)=>{let i=r.transaction(Me,`readwrite`);i.oncomplete=()=>e(),i.onerror=()=>n(Ie(i,`FILE_DATA write failed for ${t}`)),i.onabort=()=>n(Ie(i,`FILE_DATA write aborted for ${t}`));let o=i.objectStore(Me);o.clear();for(let{key:e,value:t}of a)o.put(t,e)})}finally{r.close()}}finally{n.close()}}function Wi(){try{let e=localStorage.getItem(Ri);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function Gi(e){try{localStorage.setItem(Ri,JSON.stringify(e))}catch{}}function Ki(e){Gi([...Wi(),e])}function qi(e){Gi(Wi().filter(t=>t.name!==e))}async function Ji(){let e=Date.now()-zi,t=[];for(let n of Wi()){if(n.createdAt>=e){t.push(n);continue}try{await Vi(n.name)}catch(e){console.warn(`Failed to delete expired pglite backup ${n.name}`,e),t.push(n)}}Gi(t)}function Yi(e,t){Pi({idbName:e,phase:t})}async function Xi(e){let t=await ke(e);if(t===null||t===17)return;let n=Bi[t];if(!n)throw Error(`Unsupported legacy PGlite data dir: PG_VERSION=${t} for ${e}`);let r=`${Li}${e}::${new Date().toISOString()}`,i={name:r,idbName:e,createdAt:Date.now()};Yi(e,`clone`),await Ui(e,r),Ki(i);let a;try{Yi(e,`dump`),a=await(await n())(e)}catch(e){throw await Vi(r).catch(()=>{}),qi(r),e}try{await Hi(e),Yi(e,`restore`);let t=new Se(`idb://${e.replace(/^\/pglite\//,``)}`,{relaxedDurability:!1});try{await t.waitReady,console.info(`[pglite-migration] Dump preamble (first 500 chars):\n${a.slice(0,500)}`);try{await t.exec(`SET standard_conforming_strings = off;`)}catch(e){console.warn(`[pglite-migration] Could not force standard_conforming_strings=off`,e)}try{await t.exec(a)}catch(t){throw Zi(e,a,t),t}}finally{await t.close()}}catch(t){throw await Qi(e,r,t),t}}function Zi(e,t,n){let r=n,i=typeof r.position==`string`?parseInt(r.position,10):typeof r.position==`number`?r.position:NaN;if(console.error(`[pglite-migration] Restore failed for ${e}`,{message:r.message,code:r.code,severity:r.severity,detail:r.detail,where:r.where,position:r.position,sqlLength:t.length}),Number.isFinite(i)&&i>0){let e=i-1,n=Math.max(0,e-200),r=Math.min(t.length,e+200),a=t.slice(n,e),o=t.slice(e,e+1),s=t.slice(e+1,r);console.error(`[pglite-migration] SQL context around position ${i}:\n${a}»${o}«${s}`);let c=t.lastIndexOf(`
|
|
4
4
|
`,e)+1,l=t.indexOf(`
|
|
5
5
|
`,e),u=t.slice(c,l===-1?t.length:l);console.error(`[pglite-migration] Failing line (truncated to 500 chars):\n${u.slice(0,500)}`)}else console.error(`[pglite-migration] No position info. First 2000 chars of dump:\n${t.slice(0,2e3)}`)}async function Qi(e,t,n){try{await Hi(e).catch(()=>{}),await Ui(t,e)}catch(t){console.error(`PGlite migration failed AND rollback failed for ${e}. Primary error:`,n,`Rollback error:`,t);return}await Vi(t).catch(()=>{}),qi(t)}async function $i(){for(let e of Pe)await Xi(e);Pi(null)}async function ea(){if(Ji().catch(e=>console.warn(`PGlite backup janitor failed`,e)),!(typeof navigator<`u`&&`locks`in navigator&&typeof navigator.locks.request==`function`)){await $i();return}await navigator.locks.request(`ph-pglite-migration`,{mode:`exclusive`},async()=>{await $i()})}var ta=`${V.routerBasename}:acceptedCookies`,na=new Set,ra=ia();function ia(){try{let e=localStorage.getItem(ta);return e?JSON.parse(e):{analytics:!1,marketing:!1,functional:!1}}catch{return{analytics:!1,marketing:!1,functional:!1}}}function aa(){return ra}function oa(e){ra=e(ra),localStorage.setItem(ta,JSON.stringify(ra)),na.forEach(e=>e())}function sa(e){return na.add(e),()=>na.delete(e)}var ca=()=>[$e(sa,aa,aa),oa],la=[],ua;function da(e){console.warn(`[useOpenPanelAnalytics] track failed:`,e)}function fa(e,t,n){try{Promise.resolve(e.track(t,n)).catch(e=>(ua??da)(e))}catch(e){(ua??da)(e)}}function pa(e,t){ua=t;let n=la.splice(0,la.length);for(let[t,r]of n)fa(e,t,r)}function ma(){la.length=0,ua=void 0}var ha;async function ga(e){if(!e.clientId)return;if(ha)return ha;let{OpenPanel:t}=await R(async()=>{let{OpenPanel:e}=await import(`./dist-xKhBcQ062.js`);return{OpenPanel:e}},__vite__mapDeps([8,2]));return ha=new t({clientId:e.clientId,...e.apiUrl?{apiUrl:e.apiUrl}:{},trackScreenViews:!0,trackOutgoingLinks:!0}),ha.setGlobalProperties({app:`connect`}),pa(ha),ha}function _a(){ha=void 0,ma()}var va=[{documentType:`powerhouse/document-drive`,actionTypes:[`ADD_FOLDER`,`DELETE_NODE`,`ADD_FILE`,`UPDATE_FILE`,`COPY_NODE`,`MOVE_NODE`,`SET_DRIVE_NAME`,`SET_DRIVE_ICON`]},{documentType:`powerhouse/document-model`,actionTypes:[`SET_MODEL_NAME`,`SET_MODEL_ID`,`ADD_MODULE`,`DELETE_MODULE`,`ADD_OPERATION`,`DELETE_OPERATION`]},{documentType:`powerhouse/reactor-drive`,actionTypes:[`ADD_FOLDER`,`REMOVE_FOLDER`,`UPDATE_FOLDER`]}],ya=ge(be({documentType:ye().min(1),actionTypes:ge(ye().min(1)).min(1),alias:ye().optional()}).strict()).readonly();function ba(e=va){let t=ya.safeParse(e);if(!t.success)throw Error(`Invalid OpenPanel events.json: ${t.error.message}`);let n=t.data,r=new Map;for(let e of n){let t=r.get(e.documentType);t||(t=new Map,r.set(e.documentType,t));for(let n of e.actionTypes){if(t.has(n))throw Error(`Duplicate OpenPanel event mapping for ${e.documentType}/${n}`);t.set(n,e)}}return{mappings:n,lookupMap:r}}var{mappings:xa,lookupMap:Sa}=ba(),Ca=xa,wa=Sa;function Ta(e){return e.toLowerCase().replace(/\//g,`.`).replace(/[^a-z0-9._-]/g,``)}function Ea(e,t){return e.alias?e.alias:`${Ta(t.context.documentType)}.${t.operation.action.type.toLowerCase()}`}function Da(e){return{documentType:e.context.documentType,actionType:e.operation.action.type,documentId:e.context.documentId,scope:e.context.scope,branch:e.context.branch}}var Oa=class{constructor(e,t,n=e=>console.warn(`[OpenPanelProcessor] Error tracking event:`,e)){this.client=e,this.lookupMap=t,this.onError=n}async onOperations(e){for(let t of e){let e=this.lookupMap.get(t.context.documentType);if(!e)continue;let n=e.get(t.operation.action.type);if(!n)continue;let r=Ea(n,t),i=Da(t);try{await this.client.track(r,i)}catch(e){this.onError(e,t)}}}onDisconnect(){return this.client.flush?.(),Promise.resolve()}};function ka(e){return function(t){let n=Array.from(e.events.lookupMap.keys());return[{processor:new Oa(e.client,e.events.lookupMap,e.onError),filter:{documentType:n},startFrom:e.startFrom??`current`}]}}function Aa(){if(typeof window>`u`)return!1;try{let e=new URLSearchParams(window.location.search).get(`embed`);return e!==null&&e!==`0`&&e!==`false`}catch{return!1}}function ja(){return Aa()}var Ma=`${V.routerBasename}:display-cookie-banner`,Na=new Set,Pa=Fa();function Fa(){if(Aa())return!1;try{return localStorage.getItem(Ma)!==`false`}catch(e){return console.error(e),!0}}function Ia(){return Pa}function La(e){Pa=e,localStorage.setItem(Ma,JSON.stringify(e))}function Ra(e){return Na.add(e),()=>Na.delete(e)}var za=()=>[$e(Ra,Ia,Ia),La],Ba=[];function Va(){let e=A();return $e(t=>e?.subscribeFailed(t)??(()=>{}),()=>e?.getFailedInstallations()??Ba)}var Ha=z([`sentry`]),Ua=!1;async function Wa(){return await R(()=>import(`./esm-u3Hz2lzn.js`),__vite__mapDeps([9,10,1]))}async function Ga(){let e=await Wa(),t=[e.httpClientIntegration(),e.extraErrorDataIntegration({depth:5}),e.replayIntegration(),e.captureConsoleIntegration({levels:[`error`]})];V.sentry.tracing&&t.push(e.reactRouterV6BrowserTracingIntegration({useEffect:Ve.useEffect,useLocation:dr,useNavigationType:fr,createRoutesFromChildren:Pr,matchRoutes:pt})),e.init({release:V.sentry.release,dsn:V.sentry.dsn??void 0,environment:V.sentry.env,integrations:t,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(e,t){let n=t.originalException;return n instanceof TypeError&&n.message.includes(`Failed to fetch`)&&!navigator.onLine?null:e}}),Ua=!0}async function Ka(){if(Ua)return(await Wa()).getClient()?.close()}function qa(){let[e]=ca(),{analytics:t}=e;K(()=>{if(!t){Ka().catch(e=>Ha.error(`@error`,e));return}Ua||V.sentry.dsn===null||V.sentry.dsn===void 0||V.sentry.dsn===``||Ga().catch(e=>Ha.error(`@error`,e))},[t])}var Ja=[];function Ya(){let e=A(),t=Ze(Ja);return $e(t=>e?.subscribePending(t)??(()=>{}),qe(()=>{if(!e)return Ja;let n=e.getPendingInstallations()??Ja,r=t.current;return n===r||n.length===r.length&&n.every((e,t)=>e===r[t])?r:(t.current=n,n)},[e]))}var Xa=e=>{let{undo:t,redo:n,canRedo:r,canUndo:i}=e,a=window.navigator.userAgent.includes(`Mac`),o=`ctrl+z`,s=`ctrl+y`;a&&(o=`mod+z`,s=`mod+shift+z`),Ei(o,e=>{e.preventDefault(),i&&t()},{},[i,t]),Ei(s,e=>{e.preventDefault(),r&&n()},{},[r,n])},Za=250,Qa={clone:`Backing up local database…`,dump:`Exporting data from previous version…`,restore:`Restoring data into the new database…`},$a=()=>{let e=$e(Ii,Fi,()=>null);return e?H(`div`,{className:`absolute inset-0 z-20 flex items-center justify-center`,children:U(`div`,{className:`rounded-lg bg-card/90 px-6 py-4 text-sm text-foreground shadow-lg`,children:[H(`div`,{className:`font-medium`,children:`Upgrading local database…`}),H(`div`,{className:`text-foreground`,children:Qa[e.phase]})]})}):null},eo=({delay:e=Za})=>{let t=typeof window>`u`,n=typeof document<`u`&&document.body.getAttribute(`data-show-loader`)===`true`;t||k();let[r,i]=Qe(!e||n);return K(()=>{let t=setTimeout(()=>{i(!0)},e);return()=>clearTimeout(t)},[]),U(`div`,{className:`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${r?``:`hidden`}`,children:[H(`div`,{className:`animate-pulse overflow-hidden rounded-full shadow-lg`,children:H(se,{})}),t?H(`script`,{dangerouslySetInnerHTML:{__html:`setTimeout(() => {
|
|
@@ -11,5 +11,5 @@ import{A as e,At as t,Ct as n,F as r,Ft as i,Gt as a,I as o,It as s,J as c,K as
|
|
|
11
11
|
const basePath = href || '/';
|
|
12
12
|
if (window.location.pathname === basePath) {
|
|
13
13
|
document.querySelector('.home-screen')?.classList.remove('hidden')
|
|
14
|
-
}`}}):null,e.children?null:H(eo,{}),H($a,{})]})},no=z([`Connect`]);function ro(e){return`fallbackRender`in e}function io(){return null}function ao({message:e=`Something went wrong`}){return H(`div`,{className:`text-center`,children:e})}function oo({error:e,resetErrorBoundary:t}){let n=e instanceof Error?e.message:String(e),r=e instanceof Error?e.stack??String(e.cause):JSON.stringify(e,null,2);return H(`div`,{className:`z-10 mx-auto flex max-w-[80%] flex-1 items-center justify-center p-6`,children:U(`div`,{className:`w-full max-w-lg rounded-lg border border-border bg-background p-6 shadow-sm`,children:[U(`div`,{className:`mb-3 flex items-center gap-2`,children:[H(Ce,{name:`Error`,className:`size-5 shrink-0`}),H(`h1`,{className:`text-lg font-semibold`,children:`Something went wrong`})]}),H(`p`,{className:`mb-4 text-sm text-foreground`,children:n}),r!==`{}`&&U(`details`,{className:`group`,children:[H(`summary`,{className:`cursor-pointer text-sm font-medium text-foreground underline select-none hover:hover-effect`,children:`Show details`}),H(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded-sm bg-muted p-3 text-xs`,children:r})]}),H(N,{type:`button`,onClick:t,className:`mt-4 px-3 py-1.5 text-base font-medium`,children:`Try again`})]})})}function so({error:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e instanceof Error?e.message:String(e)})})}function co(e,t){switch(e){case`silent`:return io;case`text`:return()=>H(ao,{message:t});case`detailed`:return oo;default:return so}}function lo(e){let{children:t,onError:n,resetKeys:r,loggerContext:i}=e;return H(ki,{fallbackRender:ro(e)?e.fallbackRender:co(e.variant,e.fallbackMessage),onError:(e,t)=>{if(e.message.includes(`Failed to fetch dynamically imported module`)&&e.message.includes(`node_modules/.vite`)){console.error(e),console.log(`Outdated chunk detected, reloading page...`),window.location.reload();return}(i?z(i):no).error(`@error @info`,e,t),n?.(e,t)},resetKeys:r,children:t})}function uo(...e){window.dataLayer?.push(...e)}var fo=()=>{let e=V.gaTrackingId,[{analytics:t}]=ca(),n=e&&t;return K(()=>{if(n){let t=document.createElement(`script`);return t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,t.async=!0,document.head.appendChild(t),window.dataLayer=window.dataLayer||[],uo(`js`,new Date),uo(`config`,e),()=>{document.head.removeChild(t)}}},[n,e]),null};function po(e){let{credential:t,...n}=e,r={address:n.address,did:n.did,networkId:n.networkId,chainId:n.chainId,caip2:`${n.networkId}:${n.chainId}`};return n.ens?.name!=null&&(r.ensName=n.ens.name),n.ens?.avatarUrl!=null&&(r.ensAvatar=n.ens.avatarUrl),n.profile?.username!=null&&(r.username=n.profile.username),n.profile?.userImage!=null&&(r.userImage=n.profile.userImage),n.profile?.documentId!=null&&(r.profileDocumentId=n.profile.documentId),n.profile?.createdAt!=null&&(r.profileCreatedAt=n.profile.createdAt),r}function mo(e){let t=e.profile?.userImage??e.ens?.avatarUrl,n=e.ens?.name??e.profile?.username;return{profileId:e.address,...t==null?{}:{avatar:t},...n==null?{}:{firstName:n},properties:po(e)}}function ho(){let[{analytics:e}]=ca(),t=b(),n=re(),[r,i]=Qe(),a=Ze(void 0),o=e&&!!V.openPanel.clientId,s=n?.reactorModule?.processorManager;return K(()=>{if(!o)return;let e=!1,t=()=>e;return(async()=>{let e;try{e=await ga(V.openPanel)}catch(e){console.warn(`[OpenPanel] Failed to build client:`,e);return}if(!(t()||!e)&&(i(e),window.openPanel=e,V.openPanel.trackOperations&&s))try{await s.registerFactory(`openpanel`,ka({client:e,events:{mappings:Ca,lookupMap:wa},startFrom:`current`})),t()&&await s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister factory after cancellation:`,e))}catch(e){console.warn(`[OpenPanel] Failed to register processor factory:`,e)}})(),()=>{e=!0,a.current=void 0,V.openPanel.trackOperations&&s&&s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister processor factory:`,e)),_a(),window.openPanel=void 0,i(void 0)}},[o,s]),K(()=>{if(!o||!r)return;let e=a.current;if(a.current=t,!e&&t)try{r.identify(mo(t))}catch(e){console.warn(`[OpenPanel] Failed to identify user:`,e)}else if(e&&!t)try{r.clear()}catch(e){console.warn(`[OpenPanel] Failed to clear user:`,e)}},[r,t,o]),null}function go(){let[e]=n(),t=D(e.header.id);return Xe(()=>async()=>{},[]),qe(()=>{d(t)},[t]),H(`div`,{id:`document-editor-container`,className:`flex-1`,"data-document-type":e.header.documentType,children:H(Ao,{document:e})})}function _o(e){let[t,n]=Qe(!1);if(K(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;let{customEditorLoader:r,...i}=e;return r?H(Be,{children:r}):H(le,{...i})}function vo(){let[e]=p(),t=ne(),n=v(e?.header.meta?.preferredEditor),r=c();if(!e)return H(_o,{});let i=n?.Component??r?.Component??Fe.Component;if(!i)throw Error(`No app component found`);return H(lo,{variant:`detailed`,resetKeys:[e.header.id],loggerContext:[`Connect`,`App`],children:H(We,{fallback:H(_o,{}),children:H(pe,{className:`flex h-full flex-col overflow-auto`,children:H(i,{children:t?H(go,{}):null})})})})}var yo=({children:e})=>(qa(),e),bo={"no-registry":`No package registry is configured.`,"not-in-registry":`No matching package found in the registry.`,"registry-error":`Couldn't reach the package registry.`,"install-failed":`Package failed to install.`,dismissed:`Installation was dismissed.`};function xo(e){return e!==`no-registry`}function So(){let e=Va(),[t,n]=Qe(!1);return e.length===0?null:U(Be,{children:[U(`div`,{className:`flex items-center justify-between gap-3 bg-warning/10 px-4 py-2 text-sm text-warning`,children:[H(`span`,{children:e.length===1?`1 document type couldn't load (missing model).`:`${e.length} document types couldn't load (missing models).`}),H(`button`,{type:`button`,onClick:()=>n(!0),className:`rounded-md border border-warning bg-background px-3 py-1 text-warning hover:hover-effect`,children:`View`})]}),H(Co,{open:t,failed:e,onClose:()=>n(!1)})]})}function Co(e){let{open:t,failed:n,onClose:r}=e,i=A(),[a,o]=Qe(()=>new Set);async function s(e){if(i){o(t=>new Set(t).add(e));try{await i.retryInstallation(e)}finally{o(t=>{let n=new Set(t);return n.delete(e),n})}}}return H(j,{open:t,onOpenChange:e=>{e||r()},contentProps:{className:`rounded-3xl`},children:U(`div`,{className:`w-[520px] max-w-[90vw] bg-background p-6`,children:[H(`div`,{className:`border-b border-border pb-2 text-2xl font-bold text-foreground`,children:`Missing document models`}),H(`div`,{className:`my-4 text-sm text-foreground`,children:`The following document types couldn't be loaded. Documents using them won't display until the underlying package is installed.`}),n.length===0?H(`div`,{className:`rounded-xl bg-background p-4 text-sm text-foreground`,children:`No outstanding failures.`}):H(`div`,{className:`flex max-h-[60vh] flex-col gap-3 overflow-y-auto`,children:n.map(e=>{let t=a.has(e.documentType),n=!xo(e.reason)||t;return U(`div`,{className:`rounded-xl bg-background p-4`,children:[H(`div`,{className:`mb-1 font-mono text-sm font-semibold text-foreground`,children:e.documentType}),H(`div`,{className:`mb-2 text-xs text-foreground`,children:bo[e.reason]}),e.packageNames.length>0?U(`div`,{className:`mb-2 text-xs text-muted-foreground`,children:[`Package`,e.packageNames.length>1?`s`:``,`:`,` `,e.packageNames.join(`, `)]}):null,e.error?H(`div`,{className:`mb-2 font-mono text-xs wrap-break-word text-destructive`,children:e.error.message}):null,H(`div`,{className:`flex justify-end`,children:H(`button`,{type:`button`,onClick:()=>void s(e.documentType),disabled:n,title:xo(e.reason)?void 0:`No registry is configured; nothing to retry against.`,className:me(`min-h-[32px] rounded-xl px-3 py-1 text-sm font-semibold text-foreground transition-all hover:hover-effect`,n?`cursor-not-allowed bg-secondary hover:hover-effect`:`bg-primary text-primary-foreground active:active-effect`),children:t?`Retrying...`:`Try install again`})})]},e.documentType)})}),H(`div`,{className:`mt-4 flex justify-end`,children:H(`button`,{type:`button`,onClick:r,className:`min-h-[36px] rounded-xl border border-border bg-background px-4 py-2 text-sm font-semibold text-foreground hover:hover-effect`,children:`Close`})})]})})}function wo(){let e=Ya(),t=A();return!t||e.length===0?null:H(ae,{pendingInstallations:e.flatMap(e=>e.packageNames.map(t=>({documentType:e.documentType,packageName:t}))),onInstall:e=>t.approveInstallation(e),onDismiss:e=>t.dismissInstallation(e)})}var To=()=>(s(),K(()=>{let e=e=>{let t=e.payload,n=(t instanceof Error?t.message:typeof t==`string`?t:``).match(/https?:\/\/[^\s"']+/)?.[0];if(n&&!n.startsWith(window.location.origin)){console.debug(`[Connect] Skipping reload — vite:preloadError for off-origin URL: ${n}`);return}console.log(`Outdated chunks detected, reloading page...`),window.location.reload()};return window.addEventListener(`vite:preloadError`,e),()=>{window.removeEventListener(`vite:preloadError`,e)}},[]),K(()=>{ze.registerServiceWorker(!1)},[]),U(yo,{children:[H(we,{position:`bottom-right`}),H(So,{}),H(Vo,{}),H(wo,{}),H(fo,{}),H(ho,{})]})),Eo=(e,t)=>e.some(e=>e.id===t&&e.value),Do=()=>{let{t:e}=Re(void 0,{useSuspense:!0,i18n:Te}),[t,n]=za(),[,r]=ca(),i=[{id:`analytics-cookie`,label:e(`cookieBanner.cookies.analytics`),value:!0}];return t?U(`div`,{className:`absolute inset-0 z-10000 backdrop-blur-sm`,children:[H(`div`,{className:`absolute inset-0 bg-primary opacity-15`}),H(`div`,{className:`absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 shadow-lg`,children:H(ce,{className:`max-w-[1024px]`,cookies:i,onSubmit:e=>{n(!1),Eo(e,`analytics-cookie`)&&r(e=>({...e,analytics:!0}))},onReject:()=>{n(!1),r(()=>({analytics:!1,functional:!1,marketing:!1}))},submitLabel:e(`cookieBanner.accept`),rejectLabel:e(`cookieBanner.reject`),children:H(`p`,{className:`font-semibold text-muted-foreground`,children:H(Le,{i18nKey:`cookieBanner.message`,components:{a:H(`a`,{onClick:()=>_({type:`cookiesPolicy`}),className:`cursor-pointer text-foreground hover:underline`},`cookieBanner.message-link`)}},`cookieBanner.message`)})})})]}):null};function Oo({drive:e}){let t=i(),n=Xe(()=>e?t.some(t=>t.collectionId.equals(xe.forDrive(e.header.id))):!1,[t,e]),r=e?.state.global.icon;return r?H(`img`,{src:r,alt:e.header.name,height:32,width:32}):n?H(Ce,{name:`Server`,size:32}):H(Ce,{name:`Hdd`,size:32})}function ko({message:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e})})}var Ao=e=>{let{document:n}=e,i=t(),a=g(),[o,s]=ee(n.header.id),c=o?.header.id??void 0,l=o?.header.name??void 0,u=o?.header.documentType??void 0,d=o?.header.meta?.preferredEditor??void 0,{globalOperations:p,localOperations:v,isLoading:b,refetch:x}=m(c);K(()=>{a&&x()},[a,x]);let S=o?.header.revision.global??0,T=o?.header.revision.local??0,E=y(u),D=O(d),te=C(u),k=D??te,ne=h(),re=f(),A=k?ne.find(e=>e.editors.includes(k))?.manifest.name:void 0,ie=A&&re?re.getPackageVersion(A):void 0,ae=A?`${A}@${ie??`unknown`}`:k?.config.id??`no-editor`,oe=!o,j=k&&u&&!k.documentTypes.includes(u)&&!k.documentTypes.includes(`*`);Xa({undo:()=>s(ve()),redo:()=>s(_e()),canUndo:S>0||T>0,canRedo:!!o?.clipboard.length}),K(()=>()=>{window.documentEditorDebugTools?.clear()},[]);let[M,N]=Qe(void 0);K(()=>{M&&M.documentId!==c&&N(void 0)},[M,c]);let P=(e,t)=>{N({error:e,documentId:c,info:t})};if(j)return H(_o,{message:`Loading editor`});if(oe)return H(_o,{message:`Loading document`});if(!E)return H(ko,{message:U(`div`,{className:`text-center leading-10`,children:[U(`p`,{children:[`Unable to open the document because the document model "`,u,`" is not supported.`]}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{_({type:`settings`})},children:`package manager`}),` `,`to install this document model`]})]})});if(!k)return H(ko,{message:U(`div`,{className:`text-center leading-10`,children:[H(`p`,{children:`Unable to open the document because no editor has been found`}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{_({type:`settings`})},children:`package manager`}),` `,`an editor for the "$`,u,`" document type`]})]})});let se=k.Component;return H(`div`,{className:`relative h-full`,id:`document-editor-context`,"data-editor":k.config.id,"data-document-type":u,children:a?b?H(_o,{message:`Loading operations`}):H(L,{documentTitle:l??``,documentId:c??``,globalOperations:p,localOperations:v,onClose:()=>r(!1),documentState:o.state,onCopyState:()=>{B(`Copied document state to clipboard`,{type:`success`})},onCopyDocId:()=>{B(`Copied document ID to clipboard`,{type:`success`})}},c):H(We,{fallback:H(_o,{message:`Loading editor`}),name:`EditorLoader`,children:H(lo,{fallbackRender:so,resetKeys:[c],onError:P,loggerContext:[`Connect`,`DocumentEditor`],children:!M?.error&&H(se,{context:{readMode:!!i,selectedTimelineRevision:w(i?.startDate,i?.endDate,p)},documentId:o.header.id},`${ae}:${c}`)})})})};function jo(){return H(`div`,{className:`h-screen bg-background`,children:H(`div`,{className:`flex h-screen items-stretch overflow-auto`,role:`presentation`,tabIndex:0,children:U(We,{name:`Root`,children:[!ja()&&H(Ho,{}),H(`div`,{className:`relative flex-1 overflow-auto`,children:H(Ar,{})})]})})})}function Mo(e,t){if(e)return!1;for(let e of t.values())if(e.state===`error`)return!0;return!1}function No(){let e=b(),t=l();return{needsLogin:Mo(!!e,t)}}function Po(){let{needsLogin:t}=No(),[n]=p(),r=E(),i=ne();return K(()=>{i||e(Ee)},[i]),K(()=>{n||T(De)},[n]),H(Fo,{children:t?H(`div`,{className:`flex h-full items-center justify-center p-4`,children:H(F,{onLogin:u})}):H(!i&&!n&&!r?Lo:vo,{})})}function Fo({children:e}){return H(`div`,{className:`flex h-full flex-col overflow-auto`,id:`content-view`,children:e})}function Io({drive:e}){let t=v(e.header.meta?.preferredEditor)?.config.name||`Drive Explorer App`;return H(ie,{title:e.state.global.name||e.header.name,description:t,icon:H(Oo,{drive:e}),onClick:()=>o(e)},e.header.id)}function Lo(){let e=S(),t=te(),n=he().connect?.branding?.homeBackground;return U(fe,{homeBackground:n,children:[e?.map(e=>H(Io,{drive:e},e.header.id)),t&&H(P,{})]})}function Ro(e){let t=V.routerBasename;return Rr(e,{basename:t,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function zo(){return[{element:H(We,{name:`RouteRoot`,children:H(jo,{})}),children:[{index:!0,path:`d?/:driveId?/*?`,element:H(We,{name:`Drive`,children:H(Po,{})})}]}]}var Bo=Ro(zo()),Vo=()=>H(Jr,{router:Bo});function Ho(){let e=b(),t=S(),n=te(),[r]=p(),i=localStorage.getItem(`CONNECT_DEBUG`)===`true`,s=e?.ens?.name||e?.profile?.username||void 0,c=e?.ens?.avatarUrl||e?.profile?.userImage||void 0,l=oe(c?void 0:e?.address),d=()=>{_({type:`settings`})},f=()=>{_({type:`addDrive`})},m=e?.address?`https://etherscan.io/address/${e.address}`:``;return H(de,{children:H(I,{id:`sidebar`,onClick:()=>o(void 0),onClickSettings:d,address:e?.address,onLogin:u,onDisconnect:()=>{a()},ensName:s||l.data?.ens,avatarUrl:c||l.data?.avatar_small||l.data?.avatar_url||void 0,etherscanUrl:m,showDebug:i,onDebugClick:()=>_({type:`debugSettings`}),children:U(lo,{variant:`text`,fallbackMessage:`There was an error loading drives`,loggerContext:[`Connect`,`Sidebar`],children:[t?.map((e,t)=>H(M,{title:e.header.name,onClick:()=>o(e),active:r?.header.id===e.header.id,icon:H(Oo,{drive:e})},t)),n&&H(ue,{onClick:f})]})})})}var Uo=!1,Wo=new Set;function Go(){for(let e of Wo)e()}function Ko(){Uo=!0,Go()}function qo(e){return Wo.add(e),()=>{Wo.delete(e)}}function Jo(){return Uo}var Yo=()=>{let e=$e(qo,Jo,()=>!1),t=$e(Oe,Ae,()=>void 0),[n,r]=Qe(!1),[i,a]=Qe(null);return t==null||t===17||e?null:H(`div`,{className:`absolute inset-x-0 top-0 z-30 flex justify-center p-3`,children:U(`div`,{className:`flex max-w-3xl items-center gap-3 rounded-lg border border-warning bg-warning px-4 py-3 text-sm text-warning-foreground shadow-lg`,children:[U(`div`,{className:`flex-1`,children:[U(`div`,{className:`font-semibold`,children:[`Your local database uses Postgres `,t,`.`]}),U(`div`,{className:`text-foreground`,children:[`Migrate to Postgres `,17,` to pick up the latest features. Your data will be backed up first.`]}),i&&U(`div`,{className:`mt-2 font-medium text-destructive`,children:[`Migration failed: `,i]})]}),H(`button`,{type:`button`,disabled:n,onClick:()=>{a(null),r(!0),ea().then(()=>{window.location.reload()}).catch(e=>{a(e instanceof Error?e.message:String(e)),r(!1)})},className:`rounded-sm bg-primary px-3 py-1 text-sm font-medium text-primary-foreground hover:hover-effect disabled:disabled-effect`,children:n?`Migrating…`:`Migrate now`}),H(`button`,{type:`button`,disabled:n,onClick:Ko,className:`rounded-sm border border-foreground bg-transparent px-3 py-1 text-sm font-medium text-foreground hover:hover-effect disabled:disabled-effect`,children:`Dismiss`})]})})},Xo=G(()=>R(()=>import(`./AddDriveModal-BoKLJyUY-cGJwd_2F.js`).then(e=>({default:e.AddDriveModal})),__vite__mapDeps([11,12,1,2,13,14,15,16,17,18,19,20,21,22,23]))),Zo=G(()=>R(()=>import(`./ClearStorageModal-CXoNWmRe-UB24DImi.js`).then(e=>({default:e.ClearStorageModal})),__vite__mapDeps([24,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,38]))),Qo=G(()=>R(()=>import(`./CookiesPolicyModal-1nOh6oN3-kK_sx5mz.js`).then(e=>({default:e.CookiesPolicyModal})),__vite__mapDeps([39,12,1,2,13,14,15,16,17,18,19,20,21,40,23,38]))),$o=G(()=>R(()=>import(`./CreateDocumentModal-nQbLVDq3-DFAye2CX.js`).then(e=>({default:e.CreateDocumentModal})),__vite__mapDeps([41,12,1,2,13,14,15,16,17,18,19,20,21]))),es=G(()=>R(()=>import(`./DebugSettingsModal-5SDhy5gt-D0iQimch.js`).then(e=>({default:e.DebugSettingsModal})),__vite__mapDeps([42,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,44]))),ts=G(()=>R(()=>import(`./DeleteDriveModal-6P0T1QgD-CK6cPXbT.js`).then(e=>({default:e.DeleteDriveModal})),__vite__mapDeps([45,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),ns=G(()=>R(()=>import(`./DeleteItemModal-BmV1aQyZ-Ld9lHNhl.js`).then(e=>({default:e.DeleteItemModal})),__vite__mapDeps([46,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),rs=G(()=>R(()=>import(`./DisclaimerModal-CVTFfN0_-D7N9TDI4.js`).then(e=>({default:e.DisclaimerModal})),__vite__mapDeps([47,12,1,2,13,14,15,16,17,18,19,20,21,38]))),is=G(()=>R(()=>import(`./DriveSettingsModal-CsNFEJ9E-BR2vyeU8.js`).then(e=>({default:e.DriveSettingsModal})),__vite__mapDeps([48,12,1,2,13,14,15,16,17,18,19,20,21]))),as=G(()=>R(()=>import(`./DownloadDocumentWithErrorsModal-CXeFUtaz-CYIIl42M.js`).then(e=>({default:e.DownloadDocumentWithErrorsModal})),__vite__mapDeps([49,12,1,2,13,14,15,16,17,18,19,20,21,38]))),os=G(()=>R(()=>import(`./SettingsModal-S_A5qf95-q6y3kJdv.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([50,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,51,22,52,23]))),ss=G(()=>R(()=>import(`./UpgradeDriveModal-C7lV4rAX-CTIf4duw.js`).then(e=>({default:e.UpgradeDriveModal})),__vite__mapDeps([53,12,1,2,13,14,15,16,17,18,19,20,21,38]))),cs={addDrive:Xo,clearStorage:Zo,cookiesPolicy:Qo,createDocument:$o,debugSettings:es,deleteDrive:ts,deleteItem:ns,disclaimer:rs,driveSettings:is,downloadDocumentWithErrors:as,inspector:G(()=>R(()=>import(`./InspectorModal-BsSihzuc-Bavb3r9J.js`).then(e=>({default:e.InspectorModal})),__vite__mapDeps([54,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,55]))),settings:os,upgradeDrive:ss,missingPackage:G(()=>R(()=>import(`./MissingPackageModal-Bn036mWQ-C021G1nV.js`).then(e=>({default:e.ConnectMissingPackageModal})),__vite__mapDeps([56,12,1,2,13,14,15,16,17,18,19,20,21,52,27]))),driveAuthRequired:G(()=>R(()=>import(`./DriveAuthRequiredModal-B3VdLwSH-fqmI_4sF.js`).then(e=>({default:e.DriveAuthRequiredModal})),__vite__mapDeps([57,12,1,2,13,14,15,16,17,18,19,20,21])))},ls=G(()=>Promise.resolve({default:()=>{let e=x();if(!e?.type)return null;let t=cs[e.type];return t?H(lo,{variant:`silent`,loggerContext:[`Connect`,`Modals`],children:H(We,{fallback:null,children:H(t,{})})}):null}})),us=e=>{let t=G(()=>R(()=>import(`./load-BWibkoFV-CryaAPih.js`).then(t=>t.loadComponent(e.localPackage)),__vite__mapDeps([58,13,1,2,14,15,16,17,18,19,20,25,26,27,28,22,21,29,30,31,32,33,34,35,36,37,51,55,59,23,38,10])));return H(Ue,{children:U(lo,{fallbackRender:e=>H(to,{children:H(oo,{...e})}),resetKeys:[e.localPackage],loggerContext:[`Connect`],children:[H(We,{fallback:H(to,{}),name:`AppLoader`,children:H(t,{...e,children:H(To,{})})}),H(We,{name:`CookieBanner`,children:H(Do,{})}),H(We,{name:`ModalsContainer`,children:H(ls,{})}),H(Yo,{})]})})};(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`fcb7df54-2462-50db-a1bb-353258cba8ed`)}catch{}})();export{us as AppLoader};
|
|
15
|
-
//# sourceMappingURL=components-ByEUkO4U-
|
|
14
|
+
}`}}):null,e.children?null:H(eo,{}),H($a,{})]})},no=z([`Connect`]);function ro(e){return`fallbackRender`in e}function io(){return null}function ao({message:e=`Something went wrong`}){return H(`div`,{className:`text-center`,children:e})}function oo({error:e,resetErrorBoundary:t}){let n=e instanceof Error?e.message:String(e),r=e instanceof Error?e.stack??String(e.cause):JSON.stringify(e,null,2);return H(`div`,{className:`z-10 mx-auto flex max-w-[80%] flex-1 items-center justify-center p-6`,children:U(`div`,{className:`w-full max-w-lg rounded-lg border border-border bg-background p-6 shadow-sm`,children:[U(`div`,{className:`mb-3 flex items-center gap-2`,children:[H(Ce,{name:`Error`,className:`size-5 shrink-0`}),H(`h1`,{className:`text-lg font-semibold`,children:`Something went wrong`})]}),H(`p`,{className:`mb-4 text-sm text-foreground`,children:n}),r!==`{}`&&U(`details`,{className:`group`,children:[H(`summary`,{className:`cursor-pointer text-sm font-medium text-foreground underline select-none hover:hover-effect`,children:`Show details`}),H(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded-sm bg-muted p-3 text-xs`,children:r})]}),H(N,{type:`button`,onClick:t,className:`mt-4 px-3 py-1.5 text-base font-medium`,children:`Try again`})]})})}function so({error:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e instanceof Error?e.message:String(e)})})}function co(e,t){switch(e){case`silent`:return io;case`text`:return()=>H(ao,{message:t});case`detailed`:return oo;default:return so}}function lo(e){let{children:t,onError:n,resetKeys:r,loggerContext:i}=e;return H(ki,{fallbackRender:ro(e)?e.fallbackRender:co(e.variant,e.fallbackMessage),onError:(e,t)=>{if(e.message.includes(`Failed to fetch dynamically imported module`)&&e.message.includes(`node_modules/.vite`)){console.error(e),console.log(`Outdated chunk detected, reloading page...`),window.location.reload();return}(i?z(i):no).error(`@error @info`,e,t),n?.(e,t)},resetKeys:r,children:t})}function uo(...e){window.dataLayer?.push(...e)}var fo=()=>{let e=V.gaTrackingId,[{analytics:t}]=ca(),n=e&&t;return K(()=>{if(n){let t=document.createElement(`script`);return t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,t.async=!0,document.head.appendChild(t),window.dataLayer=window.dataLayer||[],uo(`js`,new Date),uo(`config`,e),()=>{document.head.removeChild(t)}}},[n,e]),null};function po(e){let{credential:t,...n}=e,r={address:n.address,did:n.did,networkId:n.networkId,chainId:n.chainId,caip2:`${n.networkId}:${n.chainId}`};return n.ens?.name!=null&&(r.ensName=n.ens.name),n.ens?.avatarUrl!=null&&(r.ensAvatar=n.ens.avatarUrl),n.profile?.username!=null&&(r.username=n.profile.username),n.profile?.userImage!=null&&(r.userImage=n.profile.userImage),n.profile?.documentId!=null&&(r.profileDocumentId=n.profile.documentId),n.profile?.createdAt!=null&&(r.profileCreatedAt=n.profile.createdAt),r}function mo(e){let t=e.profile?.userImage??e.ens?.avatarUrl,n=e.ens?.name??e.profile?.username;return{profileId:e.address,...t==null?{}:{avatar:t},...n==null?{}:{firstName:n},properties:po(e)}}function ho(){let[{analytics:e}]=ca(),t=b(),n=re(),[r,i]=Qe(),a=Ze(void 0),o=e&&!!V.openPanel.clientId,s=n?.reactorModule?.processorManager;return K(()=>{if(!o)return;let e=!1,t=()=>e;return(async()=>{let e;try{e=await ga(V.openPanel)}catch(e){console.warn(`[OpenPanel] Failed to build client:`,e);return}if(!(t()||!e)&&(i(e),window.openPanel=e,V.openPanel.trackOperations&&s))try{await s.registerFactory(`openpanel`,ka({client:e,events:{mappings:Ca,lookupMap:wa},startFrom:`current`})),t()&&await s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister factory after cancellation:`,e))}catch(e){console.warn(`[OpenPanel] Failed to register processor factory:`,e)}})(),()=>{e=!0,a.current=void 0,V.openPanel.trackOperations&&s&&s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister processor factory:`,e)),_a(),window.openPanel=void 0,i(void 0)}},[o,s]),K(()=>{if(!o||!r)return;let e=a.current;if(a.current=t,!e&&t)try{r.identify(mo(t))}catch(e){console.warn(`[OpenPanel] Failed to identify user:`,e)}else if(e&&!t)try{r.clear()}catch(e){console.warn(`[OpenPanel] Failed to clear user:`,e)}},[r,t,o]),null}function go(){let[e]=n(),t=D(e.header.id);return Xe(()=>async()=>{},[]),qe(()=>{d(t)},[t]),H(`div`,{id:`document-editor-container`,className:`flex-1`,"data-document-type":e.header.documentType,children:H(Ao,{document:e})})}function _o(e){let[t,n]=Qe(!1);if(K(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;let{customEditorLoader:r,...i}=e;return r?H(Be,{children:r}):H(le,{...i})}function vo(){let[e]=p(),t=ne(),n=v(e?.header.meta?.preferredEditor),r=c();if(!e)return H(_o,{});let i=n?.Component??r?.Component??Fe.Component;if(!i)throw Error(`No app component found`);return H(lo,{variant:`detailed`,resetKeys:[e.header.id],loggerContext:[`Connect`,`App`],children:H(We,{fallback:H(_o,{}),children:H(pe,{className:`flex h-full flex-col overflow-auto`,children:H(i,{children:t?H(go,{}):null})})})})}var yo=({children:e})=>(qa(),e),bo={"no-registry":`No package registry is configured.`,"not-in-registry":`No matching package found in the registry.`,"registry-error":`Couldn't reach the package registry.`,"install-failed":`Package failed to install.`,dismissed:`Installation was dismissed.`};function xo(e){return e!==`no-registry`}function So(){let e=Va(),[t,n]=Qe(!1);return e.length===0?null:U(Be,{children:[U(`div`,{className:`flex items-center justify-between gap-3 bg-warning/10 px-4 py-2 text-sm text-warning`,children:[H(`span`,{children:e.length===1?`1 document type couldn't load (missing model).`:`${e.length} document types couldn't load (missing models).`}),H(`button`,{type:`button`,onClick:()=>n(!0),className:`rounded-md border border-warning bg-background px-3 py-1 text-warning hover:hover-effect`,children:`View`})]}),H(Co,{open:t,failed:e,onClose:()=>n(!1)})]})}function Co(e){let{open:t,failed:n,onClose:r}=e,i=A(),[a,o]=Qe(()=>new Set);async function s(e){if(i){o(t=>new Set(t).add(e));try{await i.retryInstallation(e)}finally{o(t=>{let n=new Set(t);return n.delete(e),n})}}}return H(j,{open:t,onOpenChange:e=>{e||r()},contentProps:{className:`rounded-3xl`},children:U(`div`,{className:`w-[520px] max-w-[90vw] bg-background p-6`,children:[H(`div`,{className:`border-b border-border pb-2 text-2xl font-bold text-foreground`,children:`Missing document models`}),H(`div`,{className:`my-4 text-sm text-foreground`,children:`The following document types couldn't be loaded. Documents using them won't display until the underlying package is installed.`}),n.length===0?H(`div`,{className:`rounded-xl bg-background p-4 text-sm text-foreground`,children:`No outstanding failures.`}):H(`div`,{className:`flex max-h-[60vh] flex-col gap-3 overflow-y-auto`,children:n.map(e=>{let t=a.has(e.documentType),n=!xo(e.reason)||t;return U(`div`,{className:`rounded-xl bg-background p-4`,children:[H(`div`,{className:`mb-1 font-mono text-sm font-semibold text-foreground`,children:e.documentType}),H(`div`,{className:`mb-2 text-xs text-foreground`,children:bo[e.reason]}),e.packageNames.length>0?U(`div`,{className:`mb-2 text-xs text-muted-foreground`,children:[`Package`,e.packageNames.length>1?`s`:``,`:`,` `,e.packageNames.join(`, `)]}):null,e.error?H(`div`,{className:`mb-2 font-mono text-xs wrap-break-word text-destructive`,children:e.error.message}):null,H(`div`,{className:`flex justify-end`,children:H(`button`,{type:`button`,onClick:()=>void s(e.documentType),disabled:n,title:xo(e.reason)?void 0:`No registry is configured; nothing to retry against.`,className:me(`min-h-[32px] rounded-xl px-3 py-1 text-sm font-semibold text-foreground transition-all hover:hover-effect`,n?`cursor-not-allowed bg-secondary hover:hover-effect`:`bg-primary text-primary-foreground active:active-effect`),children:t?`Retrying...`:`Try install again`})})]},e.documentType)})}),H(`div`,{className:`mt-4 flex justify-end`,children:H(`button`,{type:`button`,onClick:r,className:`min-h-[36px] rounded-xl border border-border bg-background px-4 py-2 text-sm font-semibold text-foreground hover:hover-effect`,children:`Close`})})]})})}function wo(){let e=Ya(),t=A();return!t||e.length===0?null:H(ae,{pendingInstallations:e.flatMap(e=>e.packageNames.map(t=>({documentType:e.documentType,packageName:t}))),onInstall:e=>t.approveInstallation(e),onDismiss:e=>t.dismissInstallation(e)})}var To=()=>(s(),K(()=>{let e=e=>{let t=e.payload,n=(t instanceof Error?t.message:typeof t==`string`?t:``).match(/https?:\/\/[^\s"']+/)?.[0];if(n&&!n.startsWith(window.location.origin)){console.debug(`[Connect] Skipping reload — vite:preloadError for off-origin URL: ${n}`);return}console.log(`Outdated chunks detected, reloading page...`),window.location.reload()};return window.addEventListener(`vite:preloadError`,e),()=>{window.removeEventListener(`vite:preloadError`,e)}},[]),K(()=>{ze.registerServiceWorker(!1)},[]),U(yo,{children:[H(we,{position:`bottom-right`}),H(So,{}),H(Vo,{}),H(wo,{}),H(fo,{}),H(ho,{})]})),Eo=(e,t)=>e.some(e=>e.id===t&&e.value),Do=()=>{let{t:e}=Re(void 0,{useSuspense:!0,i18n:Te}),[t,n]=za(),[,r]=ca(),i=[{id:`analytics-cookie`,label:e(`cookieBanner.cookies.analytics`),value:!0}];return t?U(`div`,{className:`absolute inset-0 z-10000 backdrop-blur-sm`,children:[H(`div`,{className:`absolute inset-0 bg-primary opacity-15`}),H(`div`,{className:`absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 shadow-lg`,children:H(ce,{className:`max-w-[1024px]`,cookies:i,onSubmit:e=>{n(!1),Eo(e,`analytics-cookie`)&&r(e=>({...e,analytics:!0}))},onReject:()=>{n(!1),r(()=>({analytics:!1,functional:!1,marketing:!1}))},submitLabel:e(`cookieBanner.accept`),rejectLabel:e(`cookieBanner.reject`),children:H(`p`,{className:`font-semibold text-muted-foreground`,children:H(Le,{i18nKey:`cookieBanner.message`,components:{a:H(`a`,{onClick:()=>_({type:`cookiesPolicy`}),className:`cursor-pointer text-foreground hover:underline`},`cookieBanner.message-link`)}},`cookieBanner.message`)})})})]}):null};function Oo({drive:e}){let t=i(),n=Xe(()=>e?t.some(t=>t.collectionId.equals(xe.forDrive(e.header.id))):!1,[t,e]),r=e?.state.global.icon;return r?H(`img`,{src:r,alt:e.header.name,height:32,width:32}):n?H(Ce,{name:`Server`,size:32}):H(Ce,{name:`Hdd`,size:32})}function ko({message:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e})})}var Ao=e=>{let{document:n}=e,i=t(),a=g(),[o,s]=ee(n.header.id),c=o?.header.id??void 0,l=o?.header.name??void 0,u=o?.header.documentType??void 0,d=o?.header.meta?.preferredEditor??void 0,{globalOperations:p,localOperations:v,isLoading:b,refetch:x}=m(c);K(()=>{a&&x()},[a,x]);let S=o?.header.revision.global??0,T=o?.header.revision.local??0,E=y(u),D=O(d),te=C(u),k=D??te,ne=h(),re=f(),A=k?ne.find(e=>e.editors.includes(k))?.manifest.name:void 0,ie=A&&re?re.getPackageVersion(A):void 0,ae=A?`${A}@${ie??`unknown`}`:k?.config.id??`no-editor`,oe=!o,j=k&&u&&!k.documentTypes.includes(u)&&!k.documentTypes.includes(`*`);Xa({undo:()=>s(ve()),redo:()=>s(_e()),canUndo:S>0||T>0,canRedo:!!o?.clipboard.length}),K(()=>()=>{window.documentEditorDebugTools?.clear()},[]);let[M,N]=Qe(void 0);K(()=>{M&&M.documentId!==c&&N(void 0)},[M,c]);let P=(e,t)=>{N({error:e,documentId:c,info:t})};if(j)return H(_o,{message:`Loading editor`});if(oe)return H(_o,{message:`Loading document`});if(!E)return H(ko,{message:U(`div`,{className:`text-center leading-10`,children:[U(`p`,{children:[`Unable to open the document because the document model "`,u,`" is not supported.`]}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{_({type:`settings`})},children:`package manager`}),` `,`to install this document model`]})]})});if(!k)return H(ko,{message:U(`div`,{className:`text-center leading-10`,children:[H(`p`,{children:`Unable to open the document because no editor has been found`}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{_({type:`settings`})},children:`package manager`}),` `,`an editor for the "$`,u,`" document type`]})]})});let se=k.Component;return H(`div`,{className:`relative h-full`,id:`document-editor-context`,"data-editor":k.config.id,"data-document-type":u,children:a?b?H(_o,{message:`Loading operations`}):H(L,{documentTitle:l??``,documentId:c??``,globalOperations:p,localOperations:v,onClose:()=>r(!1),documentState:o.state,onCopyState:()=>{B(`Copied document state to clipboard`,{type:`success`})},onCopyDocId:()=>{B(`Copied document ID to clipboard`,{type:`success`})}},c):H(We,{fallback:H(_o,{message:`Loading editor`}),name:`EditorLoader`,children:H(lo,{fallbackRender:so,resetKeys:[c],onError:P,loggerContext:[`Connect`,`DocumentEditor`],children:!M?.error&&H(se,{context:{readMode:!!i,selectedTimelineRevision:w(i?.startDate,i?.endDate,p)},documentId:o.header.id},`${ae}:${c}`)})})})};function jo(){return H(`div`,{className:`h-screen bg-background`,children:H(`div`,{className:`flex h-screen items-stretch overflow-auto`,role:`presentation`,tabIndex:0,children:U(We,{name:`Root`,children:[!ja()&&H(Ho,{}),H(`div`,{className:`relative flex-1 overflow-auto`,children:H(Ar,{})})]})})})}function Mo(e,t){if(e)return!1;for(let e of t.values())if(e.state===`error`)return!0;return!1}function No(){let e=b(),t=l();return{needsLogin:Mo(!!e,t)}}function Po(){let{needsLogin:t}=No(),[n]=p(),r=E(),i=ne();return K(()=>{i||e(Ee)},[i]),K(()=>{n||T(De)},[n]),H(Fo,{children:t?H(`div`,{className:`flex h-full items-center justify-center p-4`,children:H(F,{onLogin:u})}):H(!i&&!n&&!r?Lo:vo,{})})}function Fo({children:e}){return H(`div`,{className:`flex h-full flex-col overflow-auto`,id:`content-view`,children:e})}function Io({drive:e}){let t=v(e.header.meta?.preferredEditor)?.config.name||`Drive Explorer App`;return H(ie,{title:e.state.global.name||e.header.name,description:t,icon:H(Oo,{drive:e}),onClick:()=>o(e)},e.header.id)}function Lo(){let e=S(),t=te(),n=he().connect?.branding?.homeBackground;return U(fe,{homeBackground:n,children:[e?.map(e=>H(Io,{drive:e},e.header.id)),t&&H(P,{})]})}function Ro(e){let t=V.routerBasename;return Rr(e,{basename:t,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function zo(){return[{element:H(We,{name:`RouteRoot`,children:H(jo,{})}),children:[{index:!0,path:`d?/:driveId?/*?`,element:H(We,{name:`Drive`,children:H(Po,{})})}]}]}var Bo=Ro(zo()),Vo=()=>H(Jr,{router:Bo});function Ho(){let e=b(),t=S(),n=te(),[r]=p(),i=localStorage.getItem(`CONNECT_DEBUG`)===`true`,s=e?.ens?.name||e?.profile?.username||void 0,c=e?.ens?.avatarUrl||e?.profile?.userImage||void 0,l=oe(c?void 0:e?.address),d=()=>{_({type:`settings`})},f=()=>{_({type:`addDrive`})},m=e?.address?`https://etherscan.io/address/${e.address}`:``;return H(de,{children:H(I,{id:`sidebar`,onClick:()=>o(void 0),onClickSettings:d,address:e?.address,onLogin:u,onDisconnect:()=>{a()},ensName:s||l.data?.ens,avatarUrl:c||l.data?.avatar_small||l.data?.avatar_url||void 0,etherscanUrl:m,showDebug:i,onDebugClick:()=>_({type:`debugSettings`}),children:U(lo,{variant:`text`,fallbackMessage:`There was an error loading drives`,loggerContext:[`Connect`,`Sidebar`],children:[t?.map((e,t)=>H(M,{title:e.header.name,onClick:()=>o(e),active:r?.header.id===e.header.id,icon:H(Oo,{drive:e})},t)),n&&H(ue,{onClick:f})]})})})}var Uo=!1,Wo=new Set;function Go(){for(let e of Wo)e()}function Ko(){Uo=!0,Go()}function qo(e){return Wo.add(e),()=>{Wo.delete(e)}}function Jo(){return Uo}var Yo=()=>{let e=$e(qo,Jo,()=>!1),t=$e(Oe,Ae,()=>void 0),[n,r]=Qe(!1),[i,a]=Qe(null);return t==null||t===17||e?null:H(`div`,{className:`absolute inset-x-0 top-0 z-30 flex justify-center p-3`,children:U(`div`,{className:`flex max-w-3xl items-center gap-3 rounded-lg border border-warning bg-warning px-4 py-3 text-sm text-warning-foreground shadow-lg`,children:[U(`div`,{className:`flex-1`,children:[U(`div`,{className:`font-semibold`,children:[`Your local database uses Postgres `,t,`.`]}),U(`div`,{className:`text-foreground`,children:[`Migrate to Postgres `,17,` to pick up the latest features. Your data will be backed up first.`]}),i&&U(`div`,{className:`mt-2 font-medium text-destructive`,children:[`Migration failed: `,i]})]}),H(`button`,{type:`button`,disabled:n,onClick:()=>{a(null),r(!0),ea().then(()=>{window.location.reload()}).catch(e=>{a(e instanceof Error?e.message:String(e)),r(!1)})},className:`rounded-sm bg-primary px-3 py-1 text-sm font-medium text-primary-foreground hover:hover-effect disabled:disabled-effect`,children:n?`Migrating…`:`Migrate now`}),H(`button`,{type:`button`,disabled:n,onClick:Ko,className:`rounded-sm border border-foreground bg-transparent px-3 py-1 text-sm font-medium text-foreground hover:hover-effect disabled:disabled-effect`,children:`Dismiss`})]})})},Xo=G(()=>R(()=>import(`./AddDriveModal-BoKLJyUY-cGJwd_2F.js`).then(e=>({default:e.AddDriveModal})),__vite__mapDeps([11,12,1,2,13,14,15,16,17,18,19,20,21,22,23]))),Zo=G(()=>R(()=>import(`./ClearStorageModal-CXoNWmRe-CfudY7gP.js`).then(e=>({default:e.ClearStorageModal})),__vite__mapDeps([24,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,38]))),Qo=G(()=>R(()=>import(`./CookiesPolicyModal-1nOh6oN3-kK_sx5mz.js`).then(e=>({default:e.CookiesPolicyModal})),__vite__mapDeps([39,12,1,2,13,14,15,16,17,18,19,20,21,40,23,38]))),$o=G(()=>R(()=>import(`./CreateDocumentModal-nQbLVDq3-DFAye2CX.js`).then(e=>({default:e.CreateDocumentModal})),__vite__mapDeps([41,12,1,2,13,14,15,16,17,18,19,20,21]))),es=G(()=>R(()=>import(`./DebugSettingsModal-5SDhy5gt-Oc_wrZVo.js`).then(e=>({default:e.DebugSettingsModal})),__vite__mapDeps([42,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,44]))),ts=G(()=>R(()=>import(`./DeleteDriveModal-6P0T1QgD-CK6cPXbT.js`).then(e=>({default:e.DeleteDriveModal})),__vite__mapDeps([45,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),ns=G(()=>R(()=>import(`./DeleteItemModal-BmV1aQyZ-Ld9lHNhl.js`).then(e=>({default:e.DeleteItemModal})),__vite__mapDeps([46,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),rs=G(()=>R(()=>import(`./DisclaimerModal-CVTFfN0_-D7N9TDI4.js`).then(e=>({default:e.DisclaimerModal})),__vite__mapDeps([47,12,1,2,13,14,15,16,17,18,19,20,21,38]))),is=G(()=>R(()=>import(`./DriveSettingsModal-CsNFEJ9E-BR2vyeU8.js`).then(e=>({default:e.DriveSettingsModal})),__vite__mapDeps([48,12,1,2,13,14,15,16,17,18,19,20,21]))),as=G(()=>R(()=>import(`./DownloadDocumentWithErrorsModal-CXeFUtaz-CYIIl42M.js`).then(e=>({default:e.DownloadDocumentWithErrorsModal})),__vite__mapDeps([49,12,1,2,13,14,15,16,17,18,19,20,21,38]))),os=G(()=>R(()=>import(`./SettingsModal-S_A5qf95-DqxCHnLy.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([50,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,51,22,52,23]))),ss=G(()=>R(()=>import(`./UpgradeDriveModal-C7lV4rAX-CTIf4duw.js`).then(e=>({default:e.UpgradeDriveModal})),__vite__mapDeps([53,12,1,2,13,14,15,16,17,18,19,20,21,38]))),cs={addDrive:Xo,clearStorage:Zo,cookiesPolicy:Qo,createDocument:$o,debugSettings:es,deleteDrive:ts,deleteItem:ns,disclaimer:rs,driveSettings:is,downloadDocumentWithErrors:as,inspector:G(()=>R(()=>import(`./InspectorModal-BsSihzuc-adr3q93h.js`).then(e=>({default:e.InspectorModal})),__vite__mapDeps([54,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,55]))),settings:os,upgradeDrive:ss,missingPackage:G(()=>R(()=>import(`./MissingPackageModal-Bn036mWQ-C021G1nV.js`).then(e=>({default:e.ConnectMissingPackageModal})),__vite__mapDeps([56,12,1,2,13,14,15,16,17,18,19,20,21,52,27]))),driveAuthRequired:G(()=>R(()=>import(`./DriveAuthRequiredModal-B3VdLwSH-fqmI_4sF.js`).then(e=>({default:e.DriveAuthRequiredModal})),__vite__mapDeps([57,12,1,2,13,14,15,16,17,18,19,20,21])))},ls=G(()=>Promise.resolve({default:()=>{let e=x();if(!e?.type)return null;let t=cs[e.type];return t?H(lo,{variant:`silent`,loggerContext:[`Connect`,`Modals`],children:H(We,{fallback:null,children:H(t,{})})}):null}})),us=e=>{let t=G(()=>R(()=>import(`./load-BWibkoFV-jV3p7MXQ.js`).then(t=>t.loadComponent(e.localPackage)),__vite__mapDeps([58,13,1,2,14,15,16,17,18,19,20,25,26,27,28,22,21,29,30,31,32,33,34,35,36,37,51,55,59,23,38,10])));return H(Ue,{children:U(lo,{fallbackRender:e=>H(to,{children:H(oo,{...e})}),resetKeys:[e.localPackage],loggerContext:[`Connect`],children:[H(We,{fallback:H(to,{}),name:`AppLoader`,children:H(t,{...e,children:H(To,{})})}),H(We,{name:`CookieBanner`,children:H(Do,{})}),H(We,{name:`ModalsContainer`,children:H(ls,{})}),H(Yo,{})]})})};(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`fcb7df54-2462-50db-a1bb-353258cba8ed`)}catch{}})();export{us as AppLoader};
|
|
15
|
+
//# sourceMappingURL=components-ByEUkO4U-DHdzb1cM.js.map
|