@jingyi0605/codingns 0.5.0 → 0.5.5
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/public/assets/AdaptiveButlerPage-CUyNL98E.js +3 -0
- package/dist/public/assets/App-BFP7LCSC.js +30 -0
- package/dist/public/assets/{BootstrapPage-Vu5oEJ8z.js → BootstrapPage-G74dX2Us.js} +1 -1
- package/dist/public/assets/ConversationPage-Bz0_tvvM.js +2 -0
- package/dist/public/assets/{DesktopDetachPreviewPage-BgeEqbc5.js → DesktopDetachPreviewPage-IV7oEdOX.js} +1 -1
- package/dist/public/assets/DesktopWindowPage-BBmHyRg5.js +2 -0
- package/dist/public/assets/FileContextPanel--FVTxDrq.js +1 -0
- package/dist/public/assets/GitSidebar-DAiSi9oc.js +6 -0
- package/dist/public/assets/{MobileCreateSessionSheet-DLq5qPkx.js → MobileCreateSessionSheet-DqVwz_Hp.js} +1 -1
- package/dist/public/assets/MobileSheet-D1lMrcvD.js +1 -0
- package/dist/public/assets/{MobileTopHeaderFrame-DArgZI7L.js → MobileTopHeaderFrame-COTc7cRr.js} +1 -1
- package/dist/public/assets/{MobileWorkspaceSwitcherHeader-0ywJKfBQ.js → MobileWorkspaceSwitcherHeader-DJPV9ym2.js} +1 -1
- package/dist/public/assets/RelayConnectEntryPage-dSwU8VzK.js +1 -0
- package/dist/public/assets/{ServerSettingsModal-izoYMx9U.js → ServerSettingsModal-B34ms3ze.js} +1 -1
- package/dist/public/assets/{SessionIndexPage-C5aG8FIv.js → SessionIndexPage-D3tG1gmM.js} +1 -1
- package/dist/public/assets/SettingsPage-B3-6-5GL.js +1 -0
- package/dist/public/assets/TerminalManagerPanel-DhuTEdzV.js +1 -0
- package/dist/public/assets/{TerminalPage-CtKXIU0h.js → TerminalPage-DpsvQQVR.js} +19 -19
- package/dist/public/assets/{TerminalRuntimeFallbackModal-CRhOQOsT.js → TerminalRuntimeFallbackModal-CNzOt5v5.js} +1 -1
- package/dist/public/assets/{ToolFilesPage-DcYPsS-e.js → ToolFilesPage-BX9QDi9Y.js} +1 -1
- package/dist/public/assets/{ToolGitPage-CsPl89ty.js → ToolGitPage-4VtFox3p.js} +1 -1
- package/dist/public/assets/{ToolProcessesPage-D0dvR8xK.js → ToolProcessesPage-DZJC6Qnt.js} +1 -1
- package/dist/public/assets/{ToolsHomePage-4fP-KRiv.js → ToolsHomePage-D7JbrAWv.js} +1 -1
- package/dist/public/assets/{WorkbenchLandingPage-kvlfyxRo.js → WorkbenchLandingPage-C0yqnzqh.js} +1 -1
- package/dist/public/assets/WorkbenchLayout-Brlj8K3i.js +3 -0
- package/dist/public/assets/{WorkbenchModal-Ctob14VR.js → WorkbenchModal-CbDxaCOR.js} +1 -1
- package/dist/public/assets/WorkbenchShellRoute-BMcnFadA.css +1 -0
- package/dist/public/assets/WorkbenchShellRoute-puGpdDFY.js +1 -0
- package/dist/public/assets/{WorkspaceDebugDetailPage-Com5kEXJ.js → WorkspaceDebugDetailPage-fTGweC9N.js} +1 -1
- package/dist/public/assets/WorkspaceDetailPage-BtaIzSDB.js +1 -0
- package/dist/public/assets/WorkspaceHomePage-CUmmYDrM.js +1 -0
- package/dist/public/assets/client-runtime-manager-RHFa_iWo.js +1 -0
- package/dist/public/assets/{default-session-permission-mode-CcGwR4Kk.js → default-session-permission-mode-Cu5SreTG.js} +1 -1
- package/dist/public/assets/file-tree-icon-BMKuc5pw.js +31 -0
- package/dist/public/assets/index-Cq3ue0za.css +1 -0
- package/dist/public/assets/index-DEbFT-Aq.js +42 -0
- package/dist/public/assets/{preferences-service-KIYeE2gk.js → preferences-service-gv_9vGKz.js} +1 -1
- package/dist/public/assets/session-runtime-machine-Bfnxkk9B.js +17 -0
- package/dist/public/assets/{terminal-runtime-meta-AWXJpN4r.js → terminal-runtime-meta-B9xJGY__.js} +1 -1
- package/dist/public/assets/{useRegisteredDebugTemplates-DBDRdptr.js → useRegisteredDebugTemplates-CDfl54Wt.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/server/config/env.d.ts +1 -0
- package/dist/server/config/env.js +36 -0
- package/dist/server/config/env.js.map +1 -1
- package/dist/server/modules/client/client-controller.js +1 -1
- package/dist/server/modules/client/client-controller.js.map +1 -1
- package/dist/server/modules/client/client-service.d.ts +16 -2
- package/dist/server/modules/client/client-service.js +21 -3
- package/dist/server/modules/client/client-service.js.map +1 -1
- package/dist/server/modules/relay-tunnel/crypto/relay-tunnel-packets.d.ts +16 -1
- package/dist/server/modules/relay-tunnel/crypto/relay-tunnel-packets.js.map +1 -1
- package/dist/server/modules/relay-tunnel/crypto/relay-tunnel-protocol.d.ts +2 -1
- package/dist/server/modules/relay-tunnel/crypto/relay-tunnel-protocol.js +18 -0
- package/dist/server/modules/relay-tunnel/crypto/relay-tunnel-protocol.js.map +1 -1
- package/dist/server/modules/relay-tunnel/relay-tunnel-client-context.d.ts +13 -0
- package/dist/server/modules/relay-tunnel/relay-tunnel-client-context.js +2 -0
- package/dist/server/modules/relay-tunnel/relay-tunnel-client-context.js.map +1 -0
- package/dist/server/modules/relay-tunnel/relay-tunnel-gateway-service.d.ts +6 -0
- package/dist/server/modules/relay-tunnel/relay-tunnel-gateway-service.js +110 -10
- package/dist/server/modules/relay-tunnel/relay-tunnel-gateway-service.js.map +1 -1
- package/dist/server/modules/relay-tunnel/relay-tunnel-runtime-adapter.d.ts +16 -4
- package/dist/server/modules/relay-tunnel/relay-tunnel-runtime-adapter.js +216 -101
- package/dist/server/modules/relay-tunnel/relay-tunnel-runtime-adapter.js.map +1 -1
- package/dist/server/modules/relay-tunnel/relay-tunnel-service.d.ts +6 -2
- package/dist/server/modules/relay-tunnel/relay-tunnel-service.js +457 -40
- package/dist/server/modules/relay-tunnel/relay-tunnel-service.js.map +1 -1
- package/dist/server/modules/sessions/session-activity-inspector.js +6 -8
- package/dist/server/modules/sessions/session-activity-inspector.js.map +1 -1
- package/dist/server/modules/sessions/session-history-service.d.ts +1 -0
- package/dist/server/modules/sessions/session-history-service.js +62 -7
- package/dist/server/modules/sessions/session-history-service.js.map +1 -1
- package/dist/server/modules/workbench/snapshot-revision.d.ts +4 -0
- package/dist/server/modules/workbench/snapshot-revision.js +13 -0
- package/dist/server/modules/workbench/snapshot-revision.js.map +1 -0
- package/dist/server/modules/workbench/workbench-service.d.ts +33 -2
- package/dist/server/modules/workbench/workbench-service.js +39 -4
- package/dist/server/modules/workbench/workbench-service.js.map +1 -1
- package/dist/server/modules/workbench/workspace-panel-snapshot-service.d.ts +6 -1
- package/dist/server/modules/workbench/workspace-panel-snapshot-service.js +10 -8
- package/dist/server/modules/workbench/workspace-panel-snapshot-service.js.map +1 -1
- package/dist/server/server/create-server.js +11 -6
- package/dist/server/server/create-server.js.map +1 -1
- package/dist/server/types/domain.d.ts +9 -0
- package/dist/server/ws/workbench-ws-hub.js +295 -43
- package/dist/server/ws/workbench-ws-hub.js.map +1 -1
- package/dist/server/ws/ws-server.js +141 -8
- package/dist/server/ws/ws-server.js.map +1 -1
- package/node_modules/@codingns/session-sync-core/dist/providers/codex.js +33 -6
- package/node_modules/@codingns/session-sync-core/dist/providers/codex.js.map +1 -1
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js +78 -36
- package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js.map +1 -1
- package/package.json +1 -1
- package/dist/public/assets/AdaptiveButlerPage-R-XZw7pd.js +0 -3
- package/dist/public/assets/App-DkvE5EyM.js +0 -30
- package/dist/public/assets/ConversationPage-Cjpg6g0J.js +0 -2
- package/dist/public/assets/DesktopWindowPage-1WelvxdH.js +0 -2
- package/dist/public/assets/FileContextPanel-D_ghXJuW.js +0 -1
- package/dist/public/assets/GitSidebar-D9f9Jxwr.js +0 -6
- package/dist/public/assets/MobileSheet-DLg-gX1t.js +0 -1
- package/dist/public/assets/SettingsPage-HJIC-P-4.js +0 -1
- package/dist/public/assets/TerminalManagerPanel-DpyUTo9k.js +0 -1
- package/dist/public/assets/WorkbenchLayout-ByFw4eeu.js +0 -3
- package/dist/public/assets/WorkbenchShellRoute-BUITtdAg.css +0 -1
- package/dist/public/assets/WorkbenchShellRoute-Kw7JEZI3.js +0 -1
- package/dist/public/assets/WorkspaceDetailPage-D0Lrx4Uz.js +0 -1
- package/dist/public/assets/WorkspaceHomePage-wR8d3aP9.js +0 -1
- package/dist/public/assets/file-tree-icon-UFVoVzhM.js +0 -31
- package/dist/public/assets/index-Byp9hJ0c.js +0 -42
- package/dist/public/assets/index-_52jxu4a.css +0 -1
- package/dist/public/assets/session-runtime-machine-0KNSSPp5.js +0 -17
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/window-BWqRixxq.js","assets/event-DvH9tcej.js","assets/ServerSettingsModal-izoYMx9U.js","assets/index-Byp9hJ0c.js","assets/index-_52jxu4a.css","assets/WorkbenchModal-Ctob14VR.js","assets/BootstrapPage-Vu5oEJ8z.js","assets/DesktopDetachPreviewPage-BgeEqbc5.js","assets/DesktopWindowPage-1WelvxdH.js","assets/MobileSheet-DLg-gX1t.js","assets/FileContextPanel-D_ghXJuW.js","assets/WorkbenchLayout-ByFw4eeu.js","assets/file-tree-icon-UFVoVzhM.js","assets/GitSidebar-D9f9Jxwr.js","assets/default-session-permission-mode-CcGwR4Kk.js","assets/TerminalManagerPanel-DpyUTo9k.js","assets/terminal-runtime-meta-AWXJpN4r.js","assets/TerminalRuntimeFallbackModal-CRhOQOsT.js","assets/TerminalPage-CtKXIU0h.js","assets/MobileWorkspaceSwitcherHeader-0ywJKfBQ.js","assets/MobileTopHeaderFrame-DArgZI7L.js","assets/TerminalPage-6GBZ9nXN.css","assets/WorkbenchShellRoute-Kw7JEZI3.js","assets/WorkbenchShellRoute-BUITtdAg.css","assets/WorkbenchLandingPage-kvlfyxRo.js","assets/WorkspaceHomePage-wR8d3aP9.js","assets/butler-records-events-DgWCG364.js","assets/MobileCreateSessionSheet-DLq5qPkx.js","assets/WorkspaceDetailPage-D0Lrx4Uz.js","assets/useRegisteredDebugTemplates-DBDRdptr.js","assets/WorkspaceDebugDetailPage-Com5kEXJ.js","assets/SessionIndexPage-C5aG8FIv.js","assets/styles-CSUx5LGe.js","assets/styles-BWPBZvze.css","assets/ConversationPage-Cjpg6g0J.js","assets/session-runtime-machine-0KNSSPp5.js","assets/ToolsHomePage-4fP-KRiv.js","assets/ToolFilesPage-DcYPsS-e.js","assets/ToolGitPage-CsPl89ty.js","assets/ToolProcessesPage-D0dvR8xK.js","assets/AdaptiveButlerPage-R-XZw7pd.js","assets/AdaptiveButlerPage-B153lk5H.css","assets/SettingsPage-HJIC-P-4.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Un=Object.defineProperty;var On=(e,t,r)=>t in e?Un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var he=(e,t,r)=>On(e,typeof t!="symbol"?t+"":t,r);import{u as Je,j as g,t as it,a as Gt,g as An,r as kn,b as f,R as Fn,c as lt,_ as J,d as Vn,e as ce,f as Rt,h as zt,i as _t,n as Wr,k as $r,l as zn,m as St,o as Bn,p as Hn,s as Wn,q as $n,v as Kr,w as Kn,x as Yn,y as Gn,A as Jn,I as Xn}from"./index-Byp9hJ0c.js";function qn(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Qn=[{id:"zh-CN",labelKey:"locale.zhCN"},{id:"en-US",labelKey:"locale.enUS"}];function Zn({variant:e="default",className:t}){const r=Je(a=>a.profile.language);function n(a){a!==r&&Gt({language:a}).catch(()=>{})}return g.jsxs("label",{className:`language-switcher language-switcher-${e}${t?` ${t}`:""}`,children:[g.jsx("span",{className:"language-switcher-label",children:it("common.language")}),g.jsx("div",{className:"language-switcher-options",role:"group","aria-label":it("common.language"),children:Qn.map(a=>g.jsx("button",{type:"button",className:`language-switcher-option${r===a.id?" active":""}`,"aria-pressed":r===a.id,onClick:()=>n(a.id),children:it(a.labelKey)},a.id))})]})}var Yr=kn();const ea=An(Yr),ta=qn({__proto__:null,default:ea},[Yr]);/**
|
|
3
|
-
* @remix-run/router v1.23.2
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Remix Software Inc.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
9
|
-
*
|
|
10
|
-
* @license MIT
|
|
11
|
-
*/function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y.apply(this,arguments)}var ee;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ee||(ee={}));const vr="popstate";function ra(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:l}=n.location;return ot("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ct(a)}return aa(t,r,null,e)}function U(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Be(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function na(){return Math.random().toString(36).substr(2,8)}function gr(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,r,n){return r===void 0&&(r=null),Y({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Me(t):t,{state:r,key:t&&t.key||n||na()})}function ct(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Me(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function aa(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=ee.Pop,c=null,d=m();d==null&&(d=0,o.replaceState(Y({},o.state,{idx:d}),""));function m(){return(o.state||{idx:null}).idx}function p(){l=ee.Pop;let D=m(),k=D==null?null:D-d;d=D,c&&c({action:l,location:S.location,delta:k})}function b(D,k){l=ee.Push;let L=ot(S.location,D,k);d=m()+1;let K=gr(L,d),te=S.createHref(L);try{o.pushState(K,"",te)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;a.location.assign(te)}i&&c&&c({action:l,location:S.location,delta:1})}function w(D,k){l=ee.Replace;let L=ot(S.location,D,k);d=m();let K=gr(L,d),te=S.createHref(L);o.replaceState(K,"",te),i&&c&&c({action:l,location:S.location,delta:0})}function P(D){let k=a.location.origin!=="null"?a.location.origin:a.location.href,L=typeof D=="string"?D:ct(D);return L=L.replace(/ $/,"%20"),U(k,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,k)}let S={get action(){return l},get location(){return e(a,o)},listen(D){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(vr,p),c=D,()=>{a.removeEventListener(vr,p),c=null}},createHref(D){return t(a,D)},createURL:P,encodeLocation(D){let k=P(D);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:b,replace:w,go(D){return o.go(D)}};return S}var B;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(B||(B={}));const ia=new Set(["lazy","caseSensitive","path","id","index","children"]);function oa(e){return e.index===!0}function Ct(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,i)=>{let o=[...r,String(i)],l=typeof a.id=="string"?a.id:o.join("-");if(U(a.index!==!0||!a.children,"Cannot specify children on an index route"),U(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),oa(a)){let c=Y({},a,t(a),{id:l});return n[l]=c,c}else{let c=Y({},a,t(a),{id:l,children:void 0});return n[l]=c,a.children&&(c.children=Ct(a.children,t,o,n)),c}})}function Fe(e,t,r){return r===void 0&&(r="/"),Tt(e,t,r,!1)}function Tt(e,t,r,n){let a=typeof t=="string"?Me(t):t,i=ut(a.pathname||"/",r);if(i==null)return null;let o=Gr(e);la(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=ba(i);l=ga(o[c],d,n)}return l}function sa(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function Gr(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(U(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=Ne([n,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(U(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Gr(i.children,t,m,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:pa(d,i.index),routesMeta:m})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of Jr(i.path))a(i,o,c)}),t}function Jr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=Jr(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function la(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:va(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const ca=/^:[\w-]+$/,ua=3,da=2,fa=1,ha=10,ma=-2,yr=e=>e==="*";function pa(e,t){let r=e.split("/"),n=r.length;return r.some(yr)&&(n+=ma),t&&(n+=da),r.filter(a=>!yr(a)).reduce((a,i)=>a+(ca.test(i)?ua:i===""?fa:ha),n)}function va(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function ga(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],d=l===n.length-1,m=i==="/"?t:t.slice(i.length)||"/",p=br({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},m),b=c.route;if(!p&&d&&r&&!n[n.length-1].route.index&&(p=br({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Ne([i,p.pathname]),pathnameBase:Ea(Ne([i,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(i=Ne([i,p.pathnameBase]))}return o}function br(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=ya(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((d,m,p)=>{let{paramName:b,isOptional:w}=m;if(b==="*"){let S=l[p]||"";o=i.slice(0,i.length-S.length).replace(/(.)\/+$/,"$1")}const P=l[p];return w&&!P?d[b]=void 0:d[b]=(P||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function ya(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Be(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function ba(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Be(!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 ut(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const wa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xa=e=>wa.test(e);function Sa(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Me(e):e,i;if(r)if(xa(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Be(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=wr(r.substring(1),"/"):i=wr(r,t)}else i=t;return{pathname:i,search:Ra(n),hash:Ta(a)}}function wr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function At(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Xr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Jt(e,t){let r=Xr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Xt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Me(e):(a=Y({},e),U(!a.pathname||!a.pathname.includes("?"),At("?","pathname","search",a)),U(!a.pathname||!a.pathname.includes("#"),At("#","pathname","hash",a)),U(!a.search||!a.search.includes("#"),At("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let p=t.length-1;if(!n&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),p-=1;a.pathname=b.join("/")}l=p>=0?t[p]:"/"}let c=Sa(a,l),d=o&&o!=="/"&&o.endsWith("/"),m=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}const Ne=e=>e.join("/").replace(/\/\/+/g,"/"),Ea=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ra=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ta=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Dt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function st(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qr=["post","put","patch","delete"],Pa=new Set(qr),_a=["get",...qr],Ca=new Set(_a),Da=new Set([301,302,303,307,308]),La=new Set([307,308]),kt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ja={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Na=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Qr="remix-router-transitions";function Ma(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;U(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let s=e.detectErrorBoundary;a=u=>({hasErrorBoundary:s(u)})}else a=Na;let i={},o=Ct(e.routes,a,void 0,i),l,c=e.basename||"/",d=e.dataStrategy||Aa,m=e.patchRoutesOnNavigation,p=Y({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,w=new Set,P=null,S=null,D=null,k=e.hydrationData!=null,L=Fe(o,e.history.location,c),K=!1,te=null;if(L==null&&!m){let s=le(404,{pathname:e.history.location.pathname}),{matches:u,route:h}=jr(o);L=u,te={[h.id]:s}}L&&!e.hydrationData&&yt(L,o,e.history.location.pathname).active&&(L=null);let $;if(L)if(L.some(s=>s.route.lazy))$=!1;else if(!L.some(s=>s.route.loader))$=!0;else if(p.v7_partialHydration){let s=e.hydrationData?e.hydrationData.loaderData:null,u=e.hydrationData?e.hydrationData.errors:null;if(u){let h=L.findIndex(y=>u[y.route.id]!==void 0);$=L.slice(0,h+1).every(y=>!Ht(y.route,s,u))}else $=L.every(h=>!Ht(h.route,s,u))}else $=e.hydrationData!=null;else if($=!1,L=[],p.v7_partialHydration){let s=yt(null,o,e.history.location.pathname);s.active&&s.matches&&(K=!0,L=s.matches)}let pe,v={historyAction:e.history.action,location:e.history.location,matches:L,initialized:$,navigation:kt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||te,fetchers:new Map,blockers:new Map},N=ee.Pop,F=!1,I,re=!1,G=new Map,oe=null,ne=!1,se=!1,He=[],We=new Set,Q=new Map,Te=0,Pe=-1,we=new Map,ue=new Set,_e=new Map,Ie=new Map,de=new Set,xe=new Map,ge=new Map,Ue;function mt(){if(b=e.history.listen(s=>{let{action:u,location:h,delta:y}=s;if(Ue){Ue(),Ue=void 0;return}Be(ge.size===0||y!=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 x=fr({currentLocation:v.location,nextLocation:h,historyAction:u});if(x&&y!=null){let C=new Promise(j=>{Ue=j});e.history.go(y*-1),gt(x,{state:"blocked",location:h,proceed(){gt(x,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),C.then(()=>e.history.go(y))},reset(){let j=new Map(v.blockers);j.set(x,tt),H({blockers:j})}});return}return Oe(u,h)}),r){qa(t,G);let s=()=>Qa(t,G);t.addEventListener("pagehide",s),oe=()=>t.removeEventListener("pagehide",s)}return v.initialized||Oe(ee.Pop,v.location,{initialHydration:!0}),pe}function V(){b&&b(),oe&&oe(),w.clear(),I&&I.abort(),v.fetchers.forEach((s,u)=>vt(u)),v.blockers.forEach((s,u)=>dr(u))}function fe(s){return w.add(s),()=>w.delete(s)}function H(s,u){u===void 0&&(u={}),v=Y({},v,s);let h=[],y=[];p.v7_fetcherPersist&&v.fetchers.forEach((x,C)=>{x.state==="idle"&&(de.has(C)?y.push(C):h.push(C))}),de.forEach(x=>{!v.fetchers.has(x)&&!Q.has(x)&&y.push(x)}),[...w].forEach(x=>x(v,{deletedFetchers:y,viewTransitionOpts:u.viewTransitionOpts,flushSync:u.flushSync===!0})),p.v7_fetcherPersist?(h.forEach(x=>v.fetchers.delete(x)),y.forEach(x=>vt(x))):y.forEach(x=>de.delete(x))}function ye(s,u,h){var y,x;let{flushSync:C}=h===void 0?{}:h,j=v.actionData!=null&&v.navigation.formMethod!=null&&ve(v.navigation.formMethod)&&v.navigation.state==="loading"&&((y=s.state)==null?void 0:y._isRedirect)!==!0,R;u.actionData?Object.keys(u.actionData).length>0?R=u.actionData:R=null:j?R=v.actionData:R=null;let T=u.loaderData?Dr(v.loaderData,u.loaderData,u.matches||[],u.errors):v.loaderData,E=v.blockers;E.size>0&&(E=new Map(E),E.forEach((O,ie)=>E.set(ie,tt)));let _=F===!0||v.navigation.formMethod!=null&&ve(v.navigation.formMethod)&&((x=s.state)==null?void 0:x._isRedirect)!==!0;l&&(o=l,l=void 0),ne||N===ee.Pop||(N===ee.Push?e.history.push(s,s.state):N===ee.Replace&&e.history.replace(s,s.state));let M;if(N===ee.Pop){let O=G.get(v.location.pathname);O&&O.has(s.pathname)?M={currentLocation:v.location,nextLocation:s}:G.has(s.pathname)&&(M={currentLocation:s,nextLocation:v.location})}else if(re){let O=G.get(v.location.pathname);O?O.add(s.pathname):(O=new Set([s.pathname]),G.set(v.location.pathname,O)),M={currentLocation:v.location,nextLocation:s}}H(Y({},u,{actionData:R,loaderData:T,historyAction:N,location:s,initialized:!0,navigation:kt,revalidation:"idle",restoreScrollPosition:mr(s,u.matches||v.matches),preventScrollReset:_,blockers:E}),{viewTransitionOpts:M,flushSync:C===!0}),N=ee.Pop,F=!1,re=!1,ne=!1,se=!1,He=[]}async function pt(s,u){if(typeof s=="number"){e.history.go(s);return}let h=Bt(v.location,v.matches,c,p.v7_prependBasename,s,p.v7_relativeSplatPath,u==null?void 0:u.fromRouteId,u==null?void 0:u.relative),{path:y,submission:x,error:C}=xr(p.v7_normalizeFormMethod,!1,h,u),j=v.location,R=ot(v.location,y,u&&u.state);R=Y({},R,e.history.encodeLocation(R));let T=u&&u.replace!=null?u.replace:void 0,E=ee.Push;T===!0?E=ee.Replace:T===!1||x!=null&&ve(x.formMethod)&&x.formAction===v.location.pathname+v.location.search&&(E=ee.Replace);let _=u&&"preventScrollReset"in u?u.preventScrollReset===!0:void 0,M=(u&&u.flushSync)===!0,O=fr({currentLocation:j,nextLocation:R,historyAction:E});if(O){gt(O,{state:"blocked",location:R,proceed(){gt(O,{state:"proceeding",proceed:void 0,reset:void 0,location:R}),pt(s,u)},reset(){let ie=new Map(v.blockers);ie.set(O,tt),H({blockers:ie})}});return}return await Oe(E,R,{submission:x,pendingError:C,preventScrollReset:_,replace:u&&u.replace,enableViewTransition:u&&u.viewTransition,flushSync:M})}function xn(){if(Mt(),H({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){Oe(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}Oe(N||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation,enableViewTransition:re===!0})}}async function Oe(s,u,h){I&&I.abort(),I=null,N=s,ne=(h&&h.startUninterruptedRevalidation)===!0,jn(v.location,v.matches),F=(h&&h.preventScrollReset)===!0,re=(h&&h.enableViewTransition)===!0;let y=l||o,x=h&&h.overrideNavigation,C=h!=null&&h.initialHydration&&v.matches&&v.matches.length>0&&!K?v.matches:Fe(y,u,c),j=(h&&h.flushSync)===!0;if(C&&v.initialized&&!se&&Ha(v.location,u)&&!(h&&h.submission&&ve(h.submission.formMethod))){ye(u,{matches:C},{flushSync:j});return}let R=yt(C,y,u.pathname);if(R.active&&R.matches&&(C=R.matches),!C){let{error:W,notFoundMatches:z,route:X}=It(u.pathname);ye(u,{matches:z,loaderData:{},errors:{[X.id]:W}},{flushSync:j});return}I=new AbortController;let T=Ge(e.history,u,I.signal,h&&h.submission),E;if(h&&h.pendingError)E=[Ve(C).route.id,{type:B.error,error:h.pendingError}];else if(h&&h.submission&&ve(h.submission.formMethod)){let W=await Sn(T,u,h.submission,C,R.active,{replace:h.replace,flushSync:j});if(W.shortCircuited)return;if(W.pendingActionResult){let[z,X]=W.pendingActionResult;if(me(X)&&st(X.error)&&X.error.status===404){I=null,ye(u,{matches:W.matches,loaderData:{},errors:{[z]:X.error}});return}}C=W.matches||C,E=W.pendingActionResult,x=Ft(u,h.submission),j=!1,R.active=!1,T=Ge(e.history,T.url,T.signal)}let{shortCircuited:_,matches:M,loaderData:O,errors:ie}=await En(T,u,C,R.active,x,h&&h.submission,h&&h.fetcherSubmission,h&&h.replace,h&&h.initialHydration===!0,j,E);_||(I=null,ye(u,Y({matches:M||C},Lr(E),{loaderData:O,errors:ie})))}async function Sn(s,u,h,y,x,C){C===void 0&&(C={}),Mt();let j=Ja(u,h);if(H({navigation:j},{flushSync:C.flushSync===!0}),x){let E=await bt(y,u.pathname,s.signal);if(E.type==="aborted")return{shortCircuited:!0};if(E.type==="error"){let _=Ve(E.partialMatches).route.id;return{matches:E.partialMatches,pendingActionResult:[_,{type:B.error,error:E.error}]}}else if(E.matches)y=E.matches;else{let{notFoundMatches:_,error:M,route:O}=It(u.pathname);return{matches:_,pendingActionResult:[O.id,{type:B.error,error:M}]}}}let R,T=at(y,u);if(!T.route.action&&!T.route.lazy)R={type:B.error,error:le(405,{method:s.method,pathname:u.pathname,routeId:T.route.id})};else if(R=(await qe("action",v,s,[T],y,null))[T.route.id],s.signal.aborted)return{shortCircuited:!0};if(ze(R)){let E;return C&&C.replace!=null?E=C.replace:E=Pr(R.response.headers.get("Location"),new URL(s.url),c,e.history)===v.location.pathname+v.location.search,await Ae(s,R,!0,{submission:h,replace:E}),{shortCircuited:!0}}if(je(R))throw le(400,{type:"defer-action"});if(me(R)){let E=Ve(y,T.route.id);return(C&&C.replace)!==!0&&(N=ee.Push),{matches:y,pendingActionResult:[E.route.id,R]}}return{matches:y,pendingActionResult:[T.route.id,R]}}async function En(s,u,h,y,x,C,j,R,T,E,_){let M=x||Ft(u,C),O=C||j||Mr(M),ie=!ne&&(!p.v7_partialHydration||!T);if(y){if(ie){let q=ir(_);H(Y({navigation:M},q!==void 0?{actionData:q}:{}),{flushSync:E})}let A=await bt(h,u.pathname,s.signal);if(A.type==="aborted")return{shortCircuited:!0};if(A.type==="error"){let q=Ve(A.partialMatches).route.id;return{matches:A.partialMatches,loaderData:{},errors:{[q]:A.error}}}else if(A.matches)h=A.matches;else{let{error:q,notFoundMatches:Ke,route:et}=It(u.pathname);return{matches:Ke,loaderData:{},errors:{[et.id]:q}}}}let W=l||o,[z,X]=Er(e.history,v,h,O,u,p.v7_partialHydration&&T===!0,p.v7_skipActionErrorRevalidation,se,He,We,de,_e,ue,W,c,_);if(Ut(A=>!(h&&h.some(q=>q.route.id===A))||z&&z.some(q=>q.route.id===A)),Pe=++Te,z.length===0&&X.length===0){let A=cr();return ye(u,Y({matches:h,loaderData:{},errors:_&&me(_[1])?{[_[0]]:_[1].error}:null},Lr(_),A?{fetchers:new Map(v.fetchers)}:{}),{flushSync:E}),{shortCircuited:!0}}if(ie){let A={};if(!y){A.navigation=M;let q=ir(_);q!==void 0&&(A.actionData=q)}X.length>0&&(A.fetchers=Rn(X)),H(A,{flushSync:E})}X.forEach(A=>{De(A.key),A.controller&&Q.set(A.key,A.controller)});let $e=()=>X.forEach(A=>De(A.key));I&&I.signal.addEventListener("abort",$e);let{loaderResults:Qe,fetcherResults:Ee}=await or(v,h,z,X,s);if(s.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",$e),X.forEach(A=>Q.delete(A.key));let be=Et(Qe);if(be)return await Ae(s,be.result,!0,{replace:R}),{shortCircuited:!0};if(be=Et(Ee),be)return ue.add(be.key),await Ae(s,be.result,!0,{replace:R}),{shortCircuited:!0};let{loaderData:Ot,errors:Ze}=Cr(v,h,Qe,_,X,Ee,xe);xe.forEach((A,q)=>{A.subscribe(Ke=>{(Ke||A.done)&&xe.delete(q)})}),p.v7_partialHydration&&T&&v.errors&&(Ze=Y({},v.errors,Ze));let ke=cr(),wt=ur(Pe),xt=ke||wt||X.length>0;return Y({matches:h,loaderData:Ot,errors:Ze},xt?{fetchers:new Map(v.fetchers)}:{})}function ir(s){if(s&&!me(s[1]))return{[s[0]]:s[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function Rn(s){return s.forEach(u=>{let h=v.fetchers.get(u.key),y=rt(void 0,h?h.data:void 0);v.fetchers.set(u.key,y)}),new Map(v.fetchers)}function Tn(s,u,h,y){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");De(s);let x=(y&&y.flushSync)===!0,C=l||o,j=Bt(v.location,v.matches,c,p.v7_prependBasename,h,p.v7_relativeSplatPath,u,y==null?void 0:y.relative),R=Fe(C,j,c),T=yt(R,C,j);if(T.active&&T.matches&&(R=T.matches),!R){Se(s,u,le(404,{pathname:j}),{flushSync:x});return}let{path:E,submission:_,error:M}=xr(p.v7_normalizeFormMethod,!0,j,y);if(M){Se(s,u,M,{flushSync:x});return}let O=at(R,E),ie=(y&&y.preventScrollReset)===!0;if(_&&ve(_.formMethod)){Pn(s,u,E,O,R,T.active,x,ie,_);return}_e.set(s,{routeId:u,path:E}),_n(s,u,E,O,R,T.active,x,ie,_)}async function Pn(s,u,h,y,x,C,j,R,T){Mt(),_e.delete(s);function E(Z){if(!Z.route.action&&!Z.route.lazy){let Ye=le(405,{method:T.formMethod,pathname:h,routeId:u});return Se(s,u,Ye,{flushSync:j}),!0}return!1}if(!C&&E(y))return;let _=v.fetchers.get(s);Ce(s,Xa(T,_),{flushSync:j});let M=new AbortController,O=Ge(e.history,h,M.signal,T);if(C){let Z=await bt(x,new URL(O.url).pathname,O.signal,s);if(Z.type==="aborted")return;if(Z.type==="error"){Se(s,u,Z.error,{flushSync:j});return}else if(Z.matches){if(x=Z.matches,y=at(x,h),E(y))return}else{Se(s,u,le(404,{pathname:h}),{flushSync:j});return}}Q.set(s,M);let ie=Te,z=(await qe("action",v,O,[y],x,s))[y.route.id];if(O.signal.aborted){Q.get(s)===M&&Q.delete(s);return}if(p.v7_fetcherPersist&&de.has(s)){if(ze(z)||me(z)){Ce(s,Le(void 0));return}}else{if(ze(z))if(Q.delete(s),Pe>ie){Ce(s,Le(void 0));return}else return ue.add(s),Ce(s,rt(T)),Ae(O,z,!1,{fetcherSubmission:T,preventScrollReset:R});if(me(z)){Se(s,u,z.error);return}}if(je(z))throw le(400,{type:"defer-action"});let X=v.navigation.location||v.location,$e=Ge(e.history,X,M.signal),Qe=l||o,Ee=v.navigation.state!=="idle"?Fe(Qe,v.navigation.location,c):v.matches;U(Ee,"Didn't find any matches after fetcher action");let be=++Te;we.set(s,be);let Ot=rt(T,z.data);v.fetchers.set(s,Ot);let[Ze,ke]=Er(e.history,v,Ee,T,X,!1,p.v7_skipActionErrorRevalidation,se,He,We,de,_e,ue,Qe,c,[y.route.id,z]);ke.filter(Z=>Z.key!==s).forEach(Z=>{let Ye=Z.key,pr=v.fetchers.get(Ye),In=rt(void 0,pr?pr.data:void 0);v.fetchers.set(Ye,In),De(Ye),Z.controller&&Q.set(Ye,Z.controller)}),H({fetchers:new Map(v.fetchers)});let wt=()=>ke.forEach(Z=>De(Z.key));M.signal.addEventListener("abort",wt);let{loaderResults:xt,fetcherResults:A}=await or(v,Ee,Ze,ke,$e);if(M.signal.aborted)return;M.signal.removeEventListener("abort",wt),we.delete(s),Q.delete(s),ke.forEach(Z=>Q.delete(Z.key));let q=Et(xt);if(q)return Ae($e,q.result,!1,{preventScrollReset:R});if(q=Et(A),q)return ue.add(q.key),Ae($e,q.result,!1,{preventScrollReset:R});let{loaderData:Ke,errors:et}=Cr(v,Ee,xt,void 0,ke,A,xe);if(v.fetchers.has(s)){let Z=Le(z.data);v.fetchers.set(s,Z)}ur(be),v.navigation.state==="loading"&&be>Pe?(U(N,"Expected pending action"),I&&I.abort(),ye(v.navigation.location,{matches:Ee,loaderData:Ke,errors:et,fetchers:new Map(v.fetchers)})):(H({errors:et,loaderData:Dr(v.loaderData,Ke,Ee,et),fetchers:new Map(v.fetchers)}),se=!1)}async function _n(s,u,h,y,x,C,j,R,T){let E=v.fetchers.get(s);Ce(s,rt(T,E?E.data:void 0),{flushSync:j});let _=new AbortController,M=Ge(e.history,h,_.signal);if(C){let z=await bt(x,new URL(M.url).pathname,M.signal,s);if(z.type==="aborted")return;if(z.type==="error"){Se(s,u,z.error,{flushSync:j});return}else if(z.matches)x=z.matches,y=at(x,h);else{Se(s,u,le(404,{pathname:h}),{flushSync:j});return}}Q.set(s,_);let O=Te,W=(await qe("loader",v,M,[y],x,s))[y.route.id];if(je(W)&&(W=await Qt(W,M.signal,!0)||W),Q.get(s)===_&&Q.delete(s),!M.signal.aborted){if(de.has(s)){Ce(s,Le(void 0));return}if(ze(W))if(Pe>O){Ce(s,Le(void 0));return}else{ue.add(s),await Ae(M,W,!1,{preventScrollReset:R});return}if(me(W)){Se(s,u,W.error);return}U(!je(W),"Unhandled fetcher deferred data"),Ce(s,Le(W.data))}}async function Ae(s,u,h,y){let{submission:x,fetcherSubmission:C,preventScrollReset:j,replace:R}=y===void 0?{}:y;u.response.headers.has("X-Remix-Revalidate")&&(se=!0);let T=u.response.headers.get("Location");U(T,"Expected a Location header on the redirect Response"),T=Pr(T,new URL(s.url),c,e.history);let E=ot(v.location,T,{_isRedirect:!0});if(r){let z=!1;if(u.response.headers.has("X-Remix-Reload-Document"))z=!0;else if(qt.test(T)){const X=e.history.createURL(T);z=X.origin!==t.location.origin||ut(X.pathname,c)==null}if(z){R?t.location.replace(T):t.location.assign(T);return}}I=null;let _=R===!0||u.response.headers.has("X-Remix-Replace")?ee.Replace:ee.Push,{formMethod:M,formAction:O,formEncType:ie}=v.navigation;!x&&!C&&M&&O&&ie&&(x=Mr(v.navigation));let W=x||C;if(La.has(u.response.status)&&W&&ve(W.formMethod))await Oe(_,E,{submission:Y({},W,{formAction:T}),preventScrollReset:j||F,enableViewTransition:h?re:void 0});else{let z=Ft(E,x);await Oe(_,E,{overrideNavigation:z,fetcherSubmission:C,preventScrollReset:j||F,enableViewTransition:h?re:void 0})}}async function qe(s,u,h,y,x,C){let j,R={};try{j=await ka(d,s,u,h,y,x,C,i,a)}catch(T){return y.forEach(E=>{R[E.route.id]={type:B.error,error:T}}),R}for(let[T,E]of Object.entries(j))if(Wa(E)){let _=E.result;R[T]={type:B.redirect,response:za(_,h,T,x,c,p.v7_relativeSplatPath)}}else R[T]=await Va(E);return R}async function or(s,u,h,y,x){let C=s.matches,j=qe("loader",s,x,h,u,null),R=Promise.all(y.map(async _=>{if(_.matches&&_.match&&_.controller){let O=(await qe("loader",s,Ge(e.history,_.path,_.controller.signal),[_.match],_.matches,_.key))[_.match.route.id];return{[_.key]:O}}else return Promise.resolve({[_.key]:{type:B.error,error:le(404,{pathname:_.path})}})})),T=await j,E=(await R).reduce((_,M)=>Object.assign(_,M),{});return await Promise.all([Ya(u,T,x.signal,C,s.loaderData),Ga(u,E,y)]),{loaderResults:T,fetcherResults:E}}function Mt(){se=!0,He.push(...Ut()),_e.forEach((s,u)=>{Q.has(u)&&We.add(u),De(u)})}function Ce(s,u,h){h===void 0&&(h={}),v.fetchers.set(s,u),H({fetchers:new Map(v.fetchers)},{flushSync:(h&&h.flushSync)===!0})}function Se(s,u,h,y){y===void 0&&(y={});let x=Ve(v.matches,u);vt(s),H({errors:{[x.route.id]:h},fetchers:new Map(v.fetchers)},{flushSync:(y&&y.flushSync)===!0})}function sr(s){return Ie.set(s,(Ie.get(s)||0)+1),de.has(s)&&de.delete(s),v.fetchers.get(s)||ja}function vt(s){let u=v.fetchers.get(s);Q.has(s)&&!(u&&u.state==="loading"&&we.has(s))&&De(s),_e.delete(s),we.delete(s),ue.delete(s),p.v7_fetcherPersist&&de.delete(s),We.delete(s),v.fetchers.delete(s)}function Cn(s){let u=(Ie.get(s)||0)-1;u<=0?(Ie.delete(s),de.add(s),p.v7_fetcherPersist||vt(s)):Ie.set(s,u),H({fetchers:new Map(v.fetchers)})}function De(s){let u=Q.get(s);u&&(u.abort(),Q.delete(s))}function lr(s){for(let u of s){let h=sr(u),y=Le(h.data);v.fetchers.set(u,y)}}function cr(){let s=[],u=!1;for(let h of ue){let y=v.fetchers.get(h);U(y,"Expected fetcher: "+h),y.state==="loading"&&(ue.delete(h),s.push(h),u=!0)}return lr(s),u}function ur(s){let u=[];for(let[h,y]of we)if(y<s){let x=v.fetchers.get(h);U(x,"Expected fetcher: "+h),x.state==="loading"&&(De(h),we.delete(h),u.push(h))}return lr(u),u.length>0}function Dn(s,u){let h=v.blockers.get(s)||tt;return ge.get(s)!==u&&ge.set(s,u),h}function dr(s){v.blockers.delete(s),ge.delete(s)}function gt(s,u){let h=v.blockers.get(s)||tt;U(h.state==="unblocked"&&u.state==="blocked"||h.state==="blocked"&&u.state==="blocked"||h.state==="blocked"&&u.state==="proceeding"||h.state==="blocked"&&u.state==="unblocked"||h.state==="proceeding"&&u.state==="unblocked","Invalid blocker state transition: "+h.state+" -> "+u.state);let y=new Map(v.blockers);y.set(s,u),H({blockers:y})}function fr(s){let{currentLocation:u,nextLocation:h,historyAction:y}=s;if(ge.size===0)return;ge.size>1&&Be(!1,"A router only supports one blocker at a time");let x=Array.from(ge.entries()),[C,j]=x[x.length-1],R=v.blockers.get(C);if(!(R&&R.state==="proceeding")&&j({currentLocation:u,nextLocation:h,historyAction:y}))return C}function It(s){let u=le(404,{pathname:s}),h=l||o,{matches:y,route:x}=jr(h);return Ut(),{notFoundMatches:y,route:x,error:u}}function Ut(s){let u=[];return xe.forEach((h,y)=>{(!s||s(y))&&(h.cancel(),u.push(y),xe.delete(y))}),u}function Ln(s,u,h){if(P=s,D=u,S=h||null,!k&&v.navigation===kt){k=!0;let y=mr(v.location,v.matches);y!=null&&H({restoreScrollPosition:y})}return()=>{P=null,D=null,S=null}}function hr(s,u){return S&&S(s,u.map(y=>sa(y,v.loaderData)))||s.key}function jn(s,u){if(P&&D){let h=hr(s,u);P[h]=D()}}function mr(s,u){if(P){let h=hr(s,u),y=P[h];if(typeof y=="number")return y}return null}function yt(s,u,h){if(m)if(s){if(Object.keys(s[0].params).length>0)return{active:!0,matches:Tt(u,h,c,!0)}}else return{active:!0,matches:Tt(u,h,c,!0)||[]};return{active:!1,matches:null}}async function bt(s,u,h,y){if(!m)return{type:"success",matches:s};let x=s;for(;;){let C=l==null,j=l||o,R=i;try{await m({signal:h,path:u,matches:x,fetcherKey:y,patch:(_,M)=>{h.aborted||Tr(_,M,j,R,a)}})}catch(_){return{type:"error",error:_,partialMatches:x}}finally{C&&!h.aborted&&(o=[...o])}if(h.aborted)return{type:"aborted"};let T=Fe(j,u,c);if(T)return{type:"success",matches:T};let E=Tt(j,u,c,!0);if(!E||x.length===E.length&&x.every((_,M)=>_.route.id===E[M].route.id))return{type:"success",matches:null};x=E}}function Nn(s){i={},l=Ct(s,a,void 0,i)}function Mn(s,u){let h=l==null;Tr(s,u,l||o,i,a),h&&(o=[...o],H({}))}return pe={get basename(){return c},get future(){return p},get state(){return v},get routes(){return o},get window(){return t},initialize:mt,subscribe:fe,enableScrollRestoration:Ln,navigate:pt,fetch:Tn,revalidate:xn,createHref:s=>e.history.createHref(s),encodeLocation:s=>e.history.encodeLocation(s),getFetcher:sr,deleteFetcher:Cn,dispose:V,getBlocker:Dn,deleteBlocker:dr,patchRoutes:Mn,_internalFetchControllers:Q,_internalActiveDeferreds:xe,_internalSetRoutes:Nn},pe}function Ia(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Bt(e,t,r,n,a,i,o,l){let c,d;if(o){c=[];for(let p of t)if(c.push(p),p.route.id===o){d=p;break}}else c=t,d=t[t.length-1];let m=Xt(a||".",Jt(c,i),ut(e.pathname,r)||e.pathname,l==="path");if(a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&d){let p=Zt(m.search);if(d.route.index&&!p)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let b=new URLSearchParams(m.search),w=b.getAll("index");b.delete("index"),w.filter(S=>S).forEach(S=>b.append("index",S));let P=b.toString();m.search=P?"?"+P:""}}return n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Ne([r,m.pathname])),ct(m)}function xr(e,t,r,n){if(!n||!Ia(n))return{path:r};if(n.formMethod&&!Ka(n.formMethod))return{path:r,error:le(405,{method:n.formMethod})};let a=()=>({path:r,error:le(400,{type:"invalid-body"})}),i=n.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),l=tn(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ve(o))return a();let b=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,P)=>{let[S,D]=P;return""+w+S+"="+D+`
|
|
12
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:b}}}else if(n.formEncType==="application/json"){if(!ve(o))return a();try{let b=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:b,text:void 0}}}catch{return a()}}}U(typeof FormData=="function","FormData is not available in this environment");let c,d;if(n.formData)c=Wt(n.formData),d=n.formData;else if(n.body instanceof FormData)c=Wt(n.body),d=n.body;else if(n.body instanceof URLSearchParams)c=n.body,d=_r(c);else if(n.body==null)c=new URLSearchParams,d=new FormData;else try{c=new URLSearchParams(n.body),d=_r(c)}catch{return a()}let m={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(ve(m.formMethod))return{path:r,submission:m};let p=Me(r);return t&&p.search&&Zt(p.search)&&c.append("index",""),p.search="?"+c,{path:ct(p),submission:m}}function Sr(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function Er(e,t,r,n,a,i,o,l,c,d,m,p,b,w,P,S){let D=S?me(S[1])?S[1].error:S[1].data:void 0,k=e.createURL(t.location),L=e.createURL(a),K=r;i&&t.errors?K=Sr(r,Object.keys(t.errors)[0],!0):S&&me(S[1])&&(K=Sr(r,S[0]));let te=S?S[1].statusCode:void 0,$=o&&te&&te>=400,pe=K.filter((N,F)=>{let{route:I}=N;if(I.lazy)return!0;if(I.loader==null)return!1;if(i)return Ht(I,t.loaderData,t.errors);if(Ua(t.loaderData,t.matches[F],N)||c.some(oe=>oe===N.route.id))return!0;let re=t.matches[F],G=N;return Rr(N,Y({currentUrl:k,currentParams:re.params,nextUrl:L,nextParams:G.params},n,{actionResult:D,actionStatus:te,defaultShouldRevalidate:$?!1:l||k.pathname+k.search===L.pathname+L.search||k.search!==L.search||Zr(re,G)}))}),v=[];return p.forEach((N,F)=>{if(i||!r.some(ne=>ne.route.id===N.routeId)||m.has(F))return;let I=Fe(w,N.path,P);if(!I){v.push({key:F,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let re=t.fetchers.get(F),G=at(I,N.path),oe=!1;b.has(F)?oe=!1:d.has(F)?(d.delete(F),oe=!0):re&&re.state!=="idle"&&re.data===void 0?oe=l:oe=Rr(G,Y({currentUrl:k,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:r[r.length-1].params},n,{actionResult:D,actionStatus:te,defaultShouldRevalidate:$?!1:l})),oe&&v.push({key:F,routeId:N.routeId,path:N.path,matches:I,match:G,controller:new AbortController})}),[pe,v]}function Ht(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Ua(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Zr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Rr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Tr(e,t,r,n,a){var i;let o;if(e){let d=n[e];U(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),o=d.children}else o=r;let l=t.filter(d=>!o.some(m=>en(d,m))),c=Ct(l,a,[e||"_","patch",String(((i=o)==null?void 0:i.length)||"0")],n);o.push(...c)}function en(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((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(i=>en(r,i))}):!1}async function Oa(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];U(a,"No route found in manifest");let i={};for(let o in n){let c=a[o]!==void 0&&o!=="hasErrorBoundary";Be(!c,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!c&&!ia.has(o)&&(i[o]=n[o])}Object.assign(a,i),Object.assign(a,Y({},t(a),{lazy:void 0}))}async function Aa(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,i,o)=>Object.assign(a,{[r[o].route.id]:i}),{})}async function ka(e,t,r,n,a,i,o,l,c,d){let m=i.map(w=>w.route.lazy?Oa(w.route,c,l):void 0),p=i.map((w,P)=>{let S=m[P],D=a.some(L=>L.route.id===w.route.id);return Y({},w,{shouldLoad:D,resolve:async L=>(L&&n.method==="GET"&&(w.route.lazy||w.route.loader)&&(D=!0),D?Fa(t,n,w,S,L,d):Promise.resolve({type:B.data,result:void 0}))})}),b=await e({matches:p,request:n,params:i[0].params,fetcherKey:o,context:d});try{await Promise.all(m)}catch{}return b}async function Fa(e,t,r,n,a,i){let o,l,c=d=>{let m,p=new Promise((P,S)=>m=S);l=()=>m(),t.signal.addEventListener("abort",l);let b=P=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:i},...P!==void 0?[P]:[]),w=(async()=>{try{return{type:"data",result:await(a?a(S=>b(S)):b())}}catch(P){return{type:"error",result:P}}})();return Promise.race([w,p])};try{let d=r.route[e];if(n)if(d){let m,[p]=await Promise.all([c(d).catch(b=>{m=b}),n]);if(m!==void 0)throw m;o=p}else if(await n,d=r.route[e],d)o=await c(d);else if(e==="action"){let m=new URL(t.url),p=m.pathname+m.search;throw le(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:B.data,result:void 0};else if(d)o=await c(d);else{let m=new URL(t.url),p=m.pathname+m.search;throw le(404,{pathname:p})}U(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:B.error,result:d}}finally{l&&t.signal.removeEventListener("abort",l)}return o}async function Va(e){let{result:t,type:r}=e;if(rn(t)){let p;try{let b=t.headers.get("Content-Type");b&&/\bapplication\/json\b/.test(b)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(b){return{type:B.error,error:b}}return r===B.error?{type:B.error,error:new Dt(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:B.data,data:p,statusCode:t.status,headers:t.headers}}if(r===B.error){if(Nr(t)){var n,a;if(t.data instanceof Error){var i,o;return{type:B.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:B.error,error:new Dt(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:st(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:B.error,error:t,statusCode:st(t)?t.status:void 0}}if($a(t)){var l,c;return{type:B.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((c=t.init)==null?void 0:c.headers)&&new Headers(t.init.headers)}}if(Nr(t)){var d,m;return{type:B.data,data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(m=t.init)!=null&&m.headers?new Headers(t.init.headers):void 0}}return{type:B.data,data:t}}function za(e,t,r,n,a,i){let o=e.headers.get("Location");if(U(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!qt.test(o)){let l=n.slice(0,n.findIndex(c=>c.route.id===r)+1);o=Bt(new URL(t.url),l,a,!0,o,i),e.headers.set("Location",o)}return e}function Pr(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(qt.test(e)){let i=e,o=i.startsWith("//")?new URL(t.protocol+i):new URL(i);if(a.includes(o.protocol))throw new Error("Invalid redirect location");let l=ut(o.pathname,r)!=null;if(o.origin===t.origin&&l)return o.pathname+o.search+o.hash}try{let i=n.createURL(e);if(a.includes(i.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ge(e,t,r,n){let a=e.createURL(tn(t)).toString(),i={signal:r};if(n&&ve(n.formMethod)){let{formMethod:o,formEncType:l}=n;i.method=o.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(n.json)):l==="text/plain"?i.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?i.body=Wt(n.formData):i.body=n.formData}return new Request(a,i)}function Wt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function _r(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ba(e,t,r,n,a){let i={},o=null,l,c=!1,d={},m=r&&me(r[1])?r[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let b=p.route.id,w=t[b];if(U(!ze(w),"Cannot handle redirect results in processLoaderData"),me(w)){let P=w.error;m!==void 0&&(P=m,m=void 0),o=o||{};{let S=Ve(e,b);o[S.route.id]==null&&(o[S.route.id]=P)}i[b]=void 0,c||(c=!0,l=st(w.error)?w.error.status:500),w.headers&&(d[b]=w.headers)}else je(w)?(n.set(b,w.deferredData),i[b]=w.deferredData.data,w.statusCode!=null&&w.statusCode!==200&&!c&&(l=w.statusCode),w.headers&&(d[b]=w.headers)):(i[b]=w.data,w.statusCode&&w.statusCode!==200&&!c&&(l=w.statusCode),w.headers&&(d[b]=w.headers))}),m!==void 0&&r&&(o={[r[0]]:m},i[r[0]]=void 0),{loaderData:i,errors:o,statusCode:l||200,loaderHeaders:d}}function Cr(e,t,r,n,a,i,o){let{loaderData:l,errors:c}=Ba(t,r,n,o);return a.forEach(d=>{let{key:m,match:p,controller:b}=d,w=i[m];if(U(w,"Did not find corresponding fetcher result"),!(b&&b.signal.aborted))if(me(w)){let P=Ve(e.matches,p==null?void 0:p.route.id);c&&c[P.route.id]||(c=Y({},c,{[P.route.id]:w.error})),e.fetchers.delete(m)}else if(ze(w))U(!1,"Unhandled fetcher revalidation redirect");else if(je(w))U(!1,"Unhandled fetcher deferred data");else{let P=Le(w.data);e.fetchers.set(m,P)}}),{loaderData:l,errors:c}}function Dr(e,t,r,n){let a=Y({},t);for(let i of r){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&i.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function Lr(e){return e?me(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ve(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function jr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function le(e,t){let{pathname:r,routeId:n,method:a,type:i,message:o}=t===void 0?{}:t,l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&r&&n?c="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c='Route "'+n+'" does not match URL "'+r+'"'):e===404?(l="Not Found",c='No route matches URL "'+r+'"'):e===405&&(l="Method Not Allowed",a&&r&&n?c="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(c='Invalid request method "'+a.toUpperCase()+'"')),new Dt(e||500,l,new Error(c),!0)}function Et(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(ze(a))return{key:n,result:a}}}function tn(e){let t=typeof e=="string"?Me(e):e;return ct(Y({},t,{hash:""}))}function Ha(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Wa(e){return rn(e.result)&&Da.has(e.result.status)}function je(e){return e.type===B.deferred}function me(e){return e.type===B.error}function ze(e){return(e&&e.type)===B.redirect}function Nr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function $a(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 rn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ka(e){return Ca.has(e.toLowerCase())}function ve(e){return Pa.has(e.toLowerCase())}async function Ya(e,t,r,n,a){let i=Object.entries(t);for(let o=0;o<i.length;o++){let[l,c]=i[o],d=e.find(b=>(b==null?void 0:b.route.id)===l);if(!d)continue;let m=n.find(b=>b.route.id===d.route.id),p=m!=null&&!Zr(m,d)&&(a&&a[d.route.id])!==void 0;je(c)&&p&&await Qt(c,r,!1).then(b=>{b&&(t[l]=b)})}}async function Ga(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:i,controller:o}=r[n],l=t[a];e.find(d=>(d==null?void 0:d.route.id)===i)&&je(l)&&(U(o,"Expected an AbortController for revalidating fetcher deferred result"),await Qt(l,o.signal,!0).then(d=>{d&&(t[a]=d)}))}}async function Qt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:B.data,data:e.deferredData.unwrappedData}}catch(a){return{type:B.error,error:a}}return{type:B.data,data:e.deferredData.data}}}function Zt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function at(e,t){let r=typeof t=="string"?Me(t).search:t.search;if(e[e.length-1].route.index&&Zt(r||""))return e[e.length-1];let n=Xr(e);return n[n.length-1]}function Mr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:i,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Ft(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 Ja(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 rt(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 Xa(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 Le(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 qa(e,t){try{let r=e.sessionStorage.getItem(Qr);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function Qa(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Qr,JSON.stringify(r))}catch(n){Be(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
|
|
13
|
-
* React Router v6.30.3
|
|
14
|
-
*
|
|
15
|
-
* Copyright (c) Remix Software Inc.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
19
|
-
*
|
|
20
|
-
* @license MIT
|
|
21
|
-
*/function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lt.apply(this,arguments)}const Nt=f.createContext(null),nn=f.createContext(null),dt=f.createContext(null),er=f.createContext(null),Re=f.createContext({outlet:null,matches:[],isDataRoute:!1}),an=f.createContext(null);function ft(){return f.useContext(er)!=null}function ht(){return ft()||U(!1),f.useContext(er).location}function on(e){f.useContext(dt).static||f.useLayoutEffect(e)}function tr(){let{isDataRoute:e}=f.useContext(Re);return e?fi():Za()}function Za(){ft()||U(!1);let e=f.useContext(Nt),{basename:t,future:r,navigator:n}=f.useContext(dt),{matches:a}=f.useContext(Re),{pathname:i}=ht(),o=JSON.stringify(Jt(a,r.v7_relativeSplatPath)),l=f.useRef(!1);return on(()=>{l.current=!0}),f.useCallback(function(d,m){if(m===void 0&&(m={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Xt(d,JSON.parse(o),i,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ne([t,p.pathname])),(m.replace?n.replace:n.push)(p,m.state,m)},[t,n,o,i,e])}const ei=f.createContext(null);function ti(e){let t=f.useContext(Re).outlet;return t&&f.createElement(ei.Provider,{value:e},t)}function Ho(){let{matches:e}=f.useContext(Re),t=e[e.length-1];return t?t.params:{}}function ri(e,t,r,n){ft()||U(!1);let{navigator:a}=f.useContext(dt),{matches:i}=f.useContext(Re),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=ht(),m;m=d;let p=m.pathname||"/",b=p;if(c!=="/"){let S=c.replace(/^\//,"").split("/");b="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=Fe(e,{pathname:b});return si(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Ne([c,a.encodeLocation?a.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:Ne([c,a.encodeLocation?a.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,r,n)}function ni(){let e=di(),t=st(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:a},r):null,null)}const ai=f.createElement(ni,null);class ii extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?f.createElement(Re.Provider,{value:this.props.routeContext},f.createElement(an.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oi(e){let{routeContext:t,match:r,children:n}=e,a=f.useContext(Nt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(Re.Provider,{value:t},n)}function si(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let m=o.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);m>=0||U(!1),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let m=0;m<o.length;m++){let p=o[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=m),p.route.id){let{loaderData:b,errors:w}=r,P=p.route.loader&&b[p.route.id]===void 0&&(!w||w[p.route.id]===void 0);if(p.route.lazy||P){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((m,p,b)=>{let w,P=!1,S=null,D=null;r&&(w=l&&p.route.id?l[p.route.id]:void 0,S=p.route.errorElement||ai,c&&(d<0&&b===0?(hi("route-fallback"),P=!0,D=null):d===b&&(P=!0,D=p.route.hydrateFallbackElement||null)));let k=t.concat(o.slice(0,b+1)),L=()=>{let K;return w?K=S:P?K=D:p.route.Component?K=f.createElement(p.route.Component,null):p.route.element?K=p.route.element:K=m,f.createElement(oi,{match:p,routeContext:{outlet:m,matches:k,isDataRoute:r!=null},children:K})};return r&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?f.createElement(ii,{location:r.location,revalidation:r.revalidation,component:S,error:w,children:L(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):L()},null)}var sn=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(sn||{}),ln=(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})(ln||{});function li(e){let t=f.useContext(Nt);return t||U(!1),t}function ci(e){let t=f.useContext(nn);return t||U(!1),t}function ui(e){let t=f.useContext(Re);return t||U(!1),t}function cn(e){let t=ui(),r=t.matches[t.matches.length-1];return r.route.id||U(!1),r.route.id}function di(){var e;let t=f.useContext(an),r=ci(ln.UseRouteError),n=cn();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function fi(){let{router:e}=li(sn.UseNavigateStable),t=cn(),r=f.useRef(!1);return on(()=>{r.current=!0}),f.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Lt({fromRouteId:t},i)))},[e,t])}const Ir={};function hi(e,t,r){Ir[e]||(Ir[e]=!0)}function mi(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function un(e){let{to:t,replace:r,state:n,relative:a}=e;ft()||U(!1);let{future:i,static:o}=f.useContext(dt),{matches:l}=f.useContext(Re),{pathname:c}=ht(),d=tr(),m=Xt(t,Jt(l,i.v7_relativeSplatPath),c,a==="path"),p=JSON.stringify(m);return f.useEffect(()=>d(JSON.parse(p),{replace:r,state:n,relative:a}),[d,p,a,r,n]),null}function pi(e){return ti(e.context)}function vi(e){let{basename:t="/",children:r=null,location:n,navigationType:a=ee.Pop,navigator:i,static:o=!1,future:l}=e;ft()&&U(!1);let c=t.replace(/^\/*/,"/"),d=f.useMemo(()=>({basename:c,navigator:i,static:o,future:Lt({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=Me(n));let{pathname:m="/",search:p="",hash:b="",state:w=null,key:P="default"}=n,S=f.useMemo(()=>{let D=ut(m,c);return D==null?null:{location:{pathname:D,search:p,hash:b,state:w,key:P},navigationType:a}},[c,m,p,b,w,P,a]);return S==null?null:f.createElement(dt.Provider,{value:d},f.createElement(er.Provider,{children:r,value:S}))}new Promise(()=>{});function gi(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
22
|
-
* React Router DOM v6.30.3
|
|
23
|
-
*
|
|
24
|
-
* Copyright (c) Remix Software Inc.
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the MIT license found in the
|
|
27
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
28
|
-
*
|
|
29
|
-
* @license MIT
|
|
30
|
-
*/function jt(){return jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jt.apply(this,arguments)}function $t(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function yi(e,t){let r=$t(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const bi="6";try{window.__reactRouterVersion=bi}catch{}function wi(e,t){return Ma({basename:void 0,future:jt({},void 0,{v7_prependBasename:!0}),history:ra({window:void 0}),hydrationData:xi(),routes:e,mapRouteProperties:gi,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function xi(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=jt({},t,{errors:Si(t.errors)})),t}function Si(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new Dt(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let i=window[a.__subType];if(typeof i=="function")try{let o=new i(a.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let i=new Error(a.message);i.stack="",r[n]=i}}else r[n]=a;return r}const Ei=f.createContext({isTransitioning:!1}),Ri=f.createContext(new Map),Ti="startTransition",Ur=Fn[Ti],Pi="flushSync",Or=ta[Pi];function _i(e){Ur?Ur(e):e()}function nt(e){Or?Or(e):e()}class Ci{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function Di(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=f.useState(r.state),[o,l]=f.useState(),[c,d]=f.useState({isTransitioning:!1}),[m,p]=f.useState(),[b,w]=f.useState(),[P,S]=f.useState(),D=f.useRef(new Map),{v7_startTransition:k}=n||{},L=f.useCallback(N=>{k?_i(N):N()},[k]),K=f.useCallback((N,F)=>{let{deletedFetchers:I,flushSync:re,viewTransitionOpts:G}=F;N.fetchers.forEach((ne,se)=>{ne.data!==void 0&&D.current.set(se,ne.data)}),I.forEach(ne=>D.current.delete(ne));let oe=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!G||oe){re?nt(()=>i(N)):L(()=>i(N));return}if(re){nt(()=>{b&&(m&&m.resolve(),b.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let ne=r.window.document.startViewTransition(()=>{nt(()=>i(N))});ne.finished.finally(()=>{nt(()=>{p(void 0),w(void 0),l(void 0),d({isTransitioning:!1})})}),nt(()=>w(ne));return}b?(m&&m.resolve(),b.skipTransition(),S({state:N,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(l(N),d({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[r.window,b,m,D,L]);f.useLayoutEffect(()=>r.subscribe(K),[r,K]),f.useEffect(()=>{c.isTransitioning&&!c.flushSync&&p(new Ci)},[c]),f.useEffect(()=>{if(m&&o&&r.window){let N=o,F=m.promise,I=r.window.document.startViewTransition(async()=>{L(()=>i(N)),await F});I.finished.finally(()=>{p(void 0),w(void 0),l(void 0),d({isTransitioning:!1})}),w(I)}},[L,o,m,r.window]),f.useEffect(()=>{m&&o&&a.location.key===o.location.key&&m.resolve()},[m,b,a.location,o]),f.useEffect(()=>{!c.isTransitioning&&P&&(l(P.state),d({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),S(void 0))},[c.isTransitioning,P]),f.useEffect(()=>{},[]);let te=f.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:N=>r.navigate(N),push:(N,F,I)=>r.navigate(N,{state:F,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(N,F,I)=>r.navigate(N,{replace:!0,state:F,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[r]),$=r.basename||"/",pe=f.useMemo(()=>({router:r,navigator:te,static:!1,basename:$}),[r,te,$]),v=f.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return f.useEffect(()=>mi(n,r.future),[n,r.future]),f.createElement(f.Fragment,null,f.createElement(Nt.Provider,{value:pe},f.createElement(nn.Provider,{value:a},f.createElement(Ri.Provider,{value:D.current},f.createElement(Ei.Provider,{value:c},f.createElement(vi,{basename:$,location:a.location,navigationType:a.historyAction,navigator:te,future:v},a.initialized||r.future.v7_partialHydration?f.createElement(Li,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Li=f.memo(ji);function ji(e){let{routes:t,future:r,state:n}=e;return ri(t,void 0,n,r)}var Ar;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ar||(Ar={}));var kr;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kr||(kr={}));function Ni(e){let t=f.useRef($t(e)),r=f.useRef(!1),n=ht(),a=f.useMemo(()=>yi(n.search,r.current?null:t.current),[n.search]),i=tr(),o=f.useCallback((l,c)=>{const d=$t(typeof l=="function"?l(a):l);r.current=!0,i("?"+d,c)},[i,a]);return[a,o]}const Mi="desktop://window-lifecycle",Ii=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function Ui(e){return e instanceof HTMLInputElement?!Ii.has(e.type.toLowerCase()):!1}function Oi(e){const t=e.activeElement;if(Ui(t)||t instanceof HTMLTextAreaElement){const r=t.selectionStart??0,n=t.selectionEnd??r;return n<=r?null:t.value.slice(r,n)}return null}function Ai(e){const t=Oi(e);if(t!==null)return t;const r=e.getSelection();if(!r||r.isCollapsed)return null;const n=r.toString();return n.length>0?n:null}function ki(e,t){var a;const r=(a=e.execCommand)==null?void 0:a.bind(e);if(typeof r!="function")return!1;const n=e.createElement("textarea");n.value=t,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.top="-9999px",n.style.opacity="0",e.body.append(n),n.select();try{return r("copy")}catch{return!1}finally{n.remove()}}async function Fi(e,t,r){var a,i;try{if(await r(t))return}catch{}const n=(a=e.defaultView)==null?void 0:a.navigator;if((i=n==null?void 0:n.clipboard)!=null&&i.writeText)try{await n.clipboard.writeText(t);return}catch{}ki(e,t)}function Vi(e){const{window:t,document:r,writeClipboardText:n}=e;function a(i){if(i.defaultPrevented||!i.metaKey||i.ctrlKey||i.altKey||i.key.toLowerCase()!=="c")return;const o=Ai(r);o&&(i.preventDefault(),Fi(r,o,n))}return t.addEventListener("keydown",a,!0),()=>{t.removeEventListener("keydown",a,!0)}}const dn=f.createContext(null),zi=["--desktop-macos-traffic-light-center-y","--desktop-macos-traffic-light-leading-inset","--desktop-macos-traffic-light-safe-zone-width","--desktop-macos-titlebar-height","--desktop-macos-traffic-light-button-diameter"];function Bi(e){if(typeof document>"u")return;const{documentElement:t,body:r}=document;t.dataset.runtimePlatform=e.platform,t.dataset.osFamily=e.ui.osFamily,t.dataset.windowControls=e.ui.windowControlsStyle,t.dataset.viewportClass=e.viewportClass,t.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar),r&&(r.dataset.runtimePlatform=e.platform,r.dataset.osFamily=e.ui.osFamily,r.dataset.windowControls=e.ui.windowControlsStyle,r.dataset.viewportClass=e.viewportClass,r.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar))}function Kt(){var e;if(!(typeof document>"u"))for(const t of zi)document.documentElement.style.removeProperty(t),(e=document.body)==null||e.style.removeProperty(t)}function Hi(e){if(typeof document>"u")return;if(!e){Kt();return}const t=[document.documentElement,document.body].filter(n=>!!n),r=[["--desktop-macos-traffic-light-center-y",`${e.trafficLightCenterY}px`],["--desktop-macos-traffic-light-leading-inset",`${e.trafficLightLeadingInset}px`],["--desktop-macos-traffic-light-safe-zone-width",`${e.trafficLightSafeZoneWidth}px`],["--desktop-macos-titlebar-height",`${e.titlebarHeight}px`],["--desktop-macos-traffic-light-button-diameter",`${e.trafficLightButtonDiameter}px`]];for(const n of t)for(const[a,i]of r)n.style.setProperty(a,i)}function Wi(){if(!(typeof window>"u"))return window.innerWidth}function $i({children:e}){const[t,r]=f.useState(()=>Wi()),n=f.useMemo(()=>lt({viewportWidth:t}),[t]);return f.useEffect(()=>{if(typeof window>"u")return;function a(){r(window.innerWidth)}return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[]),f.useEffect(()=>{Bi(n)},[n]),f.useEffect(()=>{if(!(typeof window>"u"||typeof document>"u")&&!(!n.isDesktop||n.ui.osFamily!=="macos"||!n.bridge.supported))return Vi({window,document,writeClipboardText:async a=>(await n.bridge.writeClipboardText(a)).ok})},[n]),f.useEffect(()=>()=>{Kt()},[]),f.useEffect(()=>{let a=!1,i=null;return!n.isDesktop||!n.bridge.supported?()=>{a=!0}:(J(()=>import("./event-DvH9tcej.js").then(o=>o.c),[]).then(async({listen:o})=>{const l=await o(Mi,c=>{const d=c.payload,m=d==null?void 0:d.descriptor;m!=null&&m.windowId&&(n.windows.registerDescriptor(m),d.isOpen?n.windows.markWindowOpen(m.windowId):n.windows.markWindowClosed(m.windowId))});if(a){l();return}i=l}).catch(()=>{}),()=>{a=!0,i==null||i()})},[n]),f.useEffect(()=>{let a=!1,i=null;async function o(){var c,d;const l=await n.bridge.getRuntimeInfo();a||Hi(l.ok?(d=(c=l.value)==null?void 0:c.windowChrome)==null?void 0:d.macosTitlebar:null)}return!n.isDesktop||n.ui.osFamily!=="macos"||!n.ui.prefersOverlayTitlebar?(Kt(),()=>{a=!0}):(o(),J(()=>import("./window-BWqRixxq.js").then(l=>l.w),__vite__mapDeps([0,1])).then(async({getCurrentWindow:l})=>{const c=await l().onScaleChanged(()=>{o()});if(a){c();return}i=c}).catch(()=>{}),()=>{a=!0,i==null||i()})},[n]),g.jsx(dn.Provider,{value:n,children:e})}function rr(){return f.useContext(dn)??lt()}const Wo=[{id:"light",labelKey:"theme.light",color:"#f6f4ef"},{id:"dark",labelKey:"theme.dark",color:"#1b1b1b"},{id:"sky-blue",labelKey:"theme.skyBlue",color:"#00f0ff"},{id:"eye-green",labelKey:"theme.eyeGreen",color:"#16a34a"}];function $o(e){return it(e.labelKey)}function Ki(){return typeof window>"u"||typeof window.matchMedia!="function"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function fn(e,t){return t?Ki():e}function Yi(){const{theme:e,autoTheme:t}=Vn.getState().profile;return fn(e,t)}function Gi(e){Gt({theme:e,autoTheme:!1}).catch(()=>{})}function Ji(e){Gt({autoTheme:e}).catch(()=>{})}function hn(e){typeof window>"u"||document.documentElement.setAttribute("data-theme",e)}function Xi(){const e=Je(n=>n.profile.theme),t=Je(n=>n.profile.autoTheme);return{theme:fn(e,t),selectedTheme:e,autoTheme:t,setTheme:Gi,setAutoTheme:Ji}}function qi(){hn(Yi())}function Qi({children:e}){const t=Je(n=>n.profile.theme),r=Je(n=>n.profile.autoTheme);return f.useEffect(()=>{qi()},[t,r]),f.useEffect(()=>{if(!r||typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{hn(n.matches?"dark":"light")};return a(),typeof n.addEventListener=="function"?(n.addEventListener("change",a),()=>n.removeEventListener("change",a)):(n.addListener(a),()=>n.removeListener(a))},[r]),g.jsx(g.Fragment,{children:e})}const Zi={showToast:()=>"",dismissToast:()=>{}},mn=f.createContext(Zi);function eo(){return`toast-${Math.random().toString(36).slice(2,10)}`}function to({toast:e,onDismiss:t}){const{id:r,title:n,description:a,tone:i,durationMs:o,action:l}=e;return f.useEffect(()=>{if(o===null)return;const c=window.setTimeout(()=>{t(r)},o);return()=>{window.clearTimeout(c)}},[o,r,t,n,a,i]),g.jsxs("article",{className:"toast-card","data-tone":i,role:i==="error"?"alert":"status",children:[g.jsxs("div",{className:"toast-body",children:[g.jsx("strong",{className:"toast-title",children:n}),a?g.jsx("p",{className:"toast-description",children:a}):null]}),g.jsxs("div",{className:"toast-actions",children:[l?g.jsx("button",{className:"toast-action",type:"button",onClick:()=>{l.onClick(),t(r)},children:l.label}):null,g.jsx("button",{className:"toast-dismiss",type:"button","aria-label":"关闭通知",onClick:()=>t(r),children:"×"})]})]})}function ro({children:e}){const[t,r]=f.useState([]),n=f.useCallback(o=>{r(l=>l.filter(c=>c.id!==o))},[]),a=f.useCallback(o=>{const l=o.id??eo(),c={id:l,title:o.title,description:o.description,tone:o.tone??"info",durationMs:o.durationMs===void 0?4200:o.durationMs,action:o.action};return r(d=>{const m=d.findIndex(b=>b.id===l);if(m===-1)return[...d,c];const p=[...d];return p[m]=c,p}),l},[]),i=f.useMemo(()=>({showToast:a,dismissToast:n}),[n,a]);return g.jsxs(mn.Provider,{value:i,children:[e,g.jsx("div",{className:"toast-viewport","aria-live":"polite","aria-atomic":"false",children:t.map(o=>g.jsx(to,{toast:o,onDismiss:n},o.id))})]})}function Ko(){return f.useContext(mn)}const Pt="0.5.0",pn=f.createContext(Pt);function no({children:e}){const t=rr(),[r,n]=f.useState(Pt);return f.useEffect(()=>{let a=!1;return t.isDesktop?(t.bridge.getRuntimeInfo().then(i=>{var l,c;if(a)return;const o=i.ok?(c=(l=i.value)==null?void 0:l.version)==null?void 0:c.trim():"";n(o||Pt)}),()=>{a=!0}):(n(Pt),()=>{a=!0})},[t]),g.jsx(pn.Provider,{value:r,children:e})}function ao(){return f.useContext(pn)}const Fr={latestState:null,lastNotifiedVersion:null,pendingRestartVersion:null};class io{constructor(){he(this,"state",Fr);he(this,"listeners",new Set);he(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));he(this,"getState",()=>this.state)}recordState(t){const r=Vt(this.state.pendingRestartVersion),n=Vt(t.currentVersion);this.state={latestState:t,lastNotifiedVersion:t.hasUpdate?this.state.lastNotifiedVersion:null,pendingRestartVersion:r&&r===n?null:this.state.pendingRestartVersion},this.emit()}markVersionNotified(t){this.state.lastNotifiedVersion!==t&&(this.state={...this.state,lastNotifiedVersion:t},this.emit())}markRestartPending(t){const r=Vt(t);!r||this.state.pendingRestartVersion===r||(this.state={...this.state,pendingRestartVersion:r},this.emit())}reset(){this.state=Fr,this.emit()}emit(){for(const t of this.listeners)t()}}const Xe=new io;function Vt(e){const t=e==null?void 0:e.trim();return t||null}function oo(e){return f.useSyncExternalStore(Xe.subscribe,()=>e(Xe.getState()))}function so(){return Xe.getState()}function lo(e){Xe.recordState(e)}function co(e){Xe.markVersionNotified(e)}function uo(e){Xe.markRestartPending(e)}async function fo(){const e=lt(),t=ce.getState(),r=await e.bridge.checkForUpdate(t.releaseChannel);if(!r.ok||!r.value)throw new Error(r.detail??"更新检查失败。");return r.value}async function ho(e={}){const t=e.notify??"never",r=await fo();return lo(r),await mo(r,t),r}async function Yo(){const e=lt(),t=ce.getState();return e.bridge.installUpdate(t.releaseChannel)}function Go(e){uo(e)}async function Jo(){var e;if(typeof window>"u"||typeof((e=window.__TAURI_INTERNALS__)==null?void 0:e.invoke)!="function")throw new Error("当前运行环境不支持桌面应用重启。");try{await window.__TAURI_INTERNALS__.invoke("restart_application")}catch(t){throw new Error(t instanceof Error?t.message:"重启应用失败。")}}async function mo(e,t){var i,o,l;if(!e.hasUpdate||t==="never")return;const r=((o=(i=e.manifest)==null?void 0:i.version)==null?void 0:o.trim())||e.currentVersion.trim();if(!r)return;const n=so().lastNotifiedVersion;if(t==="always"||n!==r)try{(await lt().bridge.showNotification(it("settings.releaseUpdateReady"),((l=e.manifest)==null?void 0:l.version)??e.currentVersion)).ok&&co(r)}catch{}}const po=3600*1e3;function vo(){const e=Rt(a=>a.platform),t=Rt(a=>a.autoCheckUpdate),r=Rt(a=>a.releaseChannel),n=oo(a=>a.pendingRestartVersion);return f.useEffect(()=>{if(e!=="desktop"||!t||n)return;async function a(){try{await ho({notify:"if-new"})}catch{}}a();const i=window.setInterval(()=>{a()},po);return()=>{window.clearInterval(i)}},[t,n,e,r]),null}class go{constructor(){he(this,"state",{epoch:0,activeHostId:zt(ce.getState()),connectionSignature:zr(ce.getState())});he(this,"listeners",new Set);he(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));he(this,"getState",()=>this.state);ce.subscribe(()=>{const t=ce.getState(),r=zt(t),n=zr(t);r===this.state.activeHostId&&n===this.state.connectionSignature||(this.state={epoch:this.state.epoch+1,activeHostId:r,connectionSignature:n},this.emit())})}emit(){for(const t of this.listeners)t()}}const Vr=new go;function yo(){return f.useSyncExternalStore(Vr.subscribe,()=>{const e=Vr.getState();return`${e.activeHostId??"anonymous"}:${e.epoch}`})}function zr(e){const t=_t(e);return t?JSON.stringify({id:t.id,baseUrl:t.baseUrl,relayTunnel:t.relayTunnel}):"no-host"}const vn="codingns.server.base-url.history",nr=6,gn="__custom__";function yn(){return typeof window<"u"&&typeof window.localStorage<"u"}function bn(){return typeof window>"u"||!window.location.origin?null:window.location.origin}function ar(e){if(!e)return null;try{return Wr(e)}catch{return null}}function wn(){if(!yn())return[];const e=window.localStorage.getItem(vn);if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.map(r=>typeof r=="string"?ar(r):null).filter(r=>!!r):[]}catch{return[]}}function bo(e){const t=new Set,r=[];for(const n of e)!n||t.has(n)||(t.add(n),r.push(n));return r}function wo(e){const t=new Set,r=[];for(const n of e)!n||t.has(n.value)||(t.add(n.value),r.push(n));return r}function xo(e,t){const r=wn();return bo([e,...t,...r,ar(bn())]).slice(0,nr)}function So(e){const t=_t(e),r=wn().map(l=>({value:l,source:"history"})),n=ar(bn()),a=e.hosts.map(l=>({value:l.baseUrl,source:"saved"})),i=zn(e).map(l=>({value:l.baseUrl,source:"discovered"})),o=t?{value:t.baseUrl,source:$r(t)?"discovered":"saved"}:null;return wo([o,...a,...i,...r,n?{value:n,source:"origin"}:null]).slice(0,nr)}function Eo(e){yn()&&window.localStorage.setItem(vn,JSON.stringify(e.slice(0,nr)))}class Ro{constructor(){he(this,"state",this.createState(ce.getState()));he(this,"listeners",new Set);he(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));he(this,"getState",()=>this.state);ce.subscribe(()=>{const t=this.createState(ce.getState());t.baseUrl===this.state.baseUrl&&t.options.length===this.state.options.length&&t.options.every((r,n)=>r===this.state.options[n])&&t.presetOptions.length===this.state.presetOptions.length&&t.presetOptions.every((r,n)=>{const a=this.state.presetOptions[n];return(a==null?void 0:a.value)===r.value&&(a==null?void 0:a.source)===r.source})||(this.state=t,this.emit())})}setBaseUrl(t){const r=ce.getState(),n=_t(r);if(!n)return!1;const a=Wr(t),i=a!==n.baseUrl;if($r(n))return ce.updateRuntime({discoveredHosts:r.discoveredHosts.map(l=>l.id===n.id?{...l,baseUrl:a,name:new URL(a).host,updatedAt:new Date().toISOString()}:l)}),this.state=this.createState(ce.getState()),this.emit(),i;const o=r.hosts.map(l=>l.id===n.id?{...l,baseUrl:a,name:new URL(a).host,updatedAt:new Date().toISOString()}:l);return this.state=this.createState({...r,hosts:o}),this.emit(),ce.update({hosts:o}),i}reset(){this.state=this.createState(ce.getState()),this.emit()}createState(t){const r=_t(t),n=(r==null?void 0:r.baseUrl)??"",a=So(t),i=xo(n,a.map(o=>o.value));return Eo(i),{baseUrl:n,options:i,presetOptions:a}}emit(){for(const t of this.listeners)t()}}const Yt=new Ro;function To(e){return f.useSyncExternalStore(Yt.subscribe,()=>e(Yt.getState()))}function Xo(e,t){return t.includes(e)?e:gn}function qo(){return gn}const Po={login(e,t){return St.login(e,t)},bootstrap(e,t,r){return St.bootstrap(e,t,r)},refresh(){return St.refresh()},logout(){St.clear()}},_o=f.lazy(async()=>({default:(await J(()=>import("./ServerSettingsModal-izoYMx9U.js"),__vite__mapDeps([2,3,4,5]))).ServerSettingsModal})),Br="width=device-width, initial-scale=1.0, viewport-fit=cover",Co="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover";function Do(){const e=f.useRef(null);return f.useEffect(()=>{const t=e.current;if(!t)return;const r=t.getContext("2d");if(!r)return;let n;const a=()=>{o(),l()};let i=[];const o=()=>{t.width=window.innerWidth,t.height=window.innerHeight},l=()=>{i=[];const d=Math.min(50,Math.floor(t.width*t.height/25e3));for(let m=0;m<d;m++)i.push({x:Math.random()*t.width,y:Math.random()*t.height,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.5,size:Math.random()*2+1,opacity:Math.random()*.5+.2})},c=()=>{r.clearRect(0,0,t.width,t.height),i.forEach((d,m)=>{d.x+=d.vx,d.y+=d.vy,d.x<0&&(d.x=t.width),d.x>t.width&&(d.x=0),d.y<0&&(d.y=t.height),d.y>t.height&&(d.y=0),r.beginPath(),r.arc(d.x,d.y,d.size,0,Math.PI*2),r.fillStyle=`rgba(10, 132, 255, ${d.opacity})`,r.fill(),i.slice(m+1).forEach(p=>{const b=d.x-p.x,w=d.y-p.y,P=Math.sqrt(b*b+w*w);P<150&&(r.beginPath(),r.moveTo(d.x,d.y),r.lineTo(p.x,p.y),r.strokeStyle=`rgba(10, 132, 255, ${.1*(1-P/150)})`,r.stroke())})}),n=requestAnimationFrame(c)};return o(),l(),c(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),cancelAnimationFrame(n)}},[]),g.jsx("canvas",{ref:e,className:"particle-canvas"})}function Lo({text:e}){return g.jsx("span",{className:"glitch-text","data-text":e,children:e})}function jo({text:e}){const[t,r]=f.useState(""),[n,a]=f.useState(!0);return f.useEffect(()=>{let i=0,o=null;const l=setInterval(()=>{i<=e.length?(r(e.slice(0,i)),i++):(clearInterval(l),o=window.setTimeout(()=>a(!1),1e3))},50);return()=>{clearInterval(l),o!==null&&window.clearTimeout(o)}},[e]),g.jsxs("span",{className:"typewriter-text",children:[t,n&&g.jsx("span",{className:"typewriter-cursor",children:"_"})]})}function No(e){const t=e==null?void 0:e.captcha;if(typeof t!="object"||t===null)return null;const r=t.captchaId,n=t.imageDataUrl;return typeof r!="string"||typeof n!="string"?null:{captchaId:r,imageDataUrl:n}}function Mo(){const e=tr(),t=Bn(),[r]=Ni(),n=rr(),a=ao(),i=Rt(V=>zt(V)),o=Hn(n.platform),l=f.useMemo(()=>Wn(n),[n]),c=f.useMemo(()=>l?$n(i):{credentials:null,legacyServerBaseUrl:null},[i,l]),d=c.credentials,m=c.legacyServerBaseUrl,[p,b]=f.useState(()=>(d==null?void 0:d.username)??"admin"),[w,P]=f.useState(()=>(d==null?void 0:d.password)??""),[S,D]=f.useState(null),[k,L]=f.useState(""),[K,te]=f.useState(()=>!!d),$=To(V=>V.baseUrl),[pe,v]=f.useState($),[N,F]=f.useState(null),[I,re]=f.useState(!1),[G,oe]=f.useState(!1),[ne,se]=f.useState(null),[He,We]=f.useState(!1),Q=Kr(V=>V.session),Te=f.useMemo(()=>r.get("returnTo")??"/",[r]),{theme:Pe}=Xi(),we=f.useRef(!1),ue=n.isNativeMobile,_e=f.useMemo(()=>Pe==="light"?"light":"dark",[Pe]);f.useEffect(()=>{b((d==null?void 0:d.username)??"admin"),P((d==null?void 0:d.password)??""),D(null),L(""),te(!!d)},[d]),f.useEffect(()=>{if(typeof document>"u")return;const V=document.querySelector('meta[name="viewport"]');if(!(V instanceof HTMLMetaElement))return;const fe=V.getAttribute("content")??Br;return ue?V.setAttribute("content",Co):V.setAttribute("content",Br),()=>{V.setAttribute("content",fe)}},[ue]),f.useEffect(()=>{we.current||(we.current=!0,!(!l||!m||m===$)&&(Yt.setBaseUrl(m),v(m)))},[$,l,m]),f.useEffect(()=>{if(Q){e(Te,{replace:!0});return}if(!pe)return;let V=!1;const fe=window.setTimeout(()=>{J(async()=>{const{probeHost:H}=await import("./index-Byp9hJ0c.js").then(ye=>ye.Q);return{probeHost:H}},__vite__mapDeps([3,4])).then(({probeHost:H})=>H(pe)).then(H=>{V||(H.demoMode&&(We(!0),Kn()&&F(t("auth.demoSessionExpired"))),H.reachable&&!H.initialized&&e("/bootstrap",{replace:!0}))}).catch(()=>{V||F(t("auth.authUnavailable"))})},0);return()=>{V=!0,window.clearTimeout(fe)}},[Q,e,pe,Te,t]);async function Ie(V){V.preventDefault(),re(!0),F(null),v($),l&&!K&&i&&Yn(i);try{const fe=S?{username:p,password:w,captchaId:S.captchaId,captchaCode:k}:{username:p,password:w};await Po.login(fe,$),D(null),L("");const{userPreferenceStore:H}=await J(async()=>{const{userPreferenceStore:ye}=await import("./index-Byp9hJ0c.js").then(pt=>pt.P);return{userPreferenceStore:ye}},__vite__mapDeps([3,4]));await H.refreshForAuthenticatedUser(),l&&K&&i&&Gn({hostId:i,username:p,password:w}),e(Te,{replace:!0})}catch(fe){if(fe instanceof Jn){if(fe.errorCode==="BOOTSTRAP_REQUIRED"){e("/bootstrap",{replace:!0});return}const H=No(fe.data);H?(D(H),L("")):fe.errorCode==="INVALID_CREDENTIALS"&&(D(null),L("")),F(fe.message)}else F(t("auth.authUnavailable"))}finally{re(!1)}}function de(V){b(V),S&&(D(null),L(""))}function xe(V){v(V),F(null)}const ge="login-username",Ue="login-password",mt="login-captcha";return g.jsxs("main",{className:"cyber-login-page","data-theme":_e,"data-native-mobile":ue?"true":"false",children:[g.jsxs("div",{className:"cyber-bg",children:[g.jsx("div",{className:"cyber-grid"}),g.jsx("div",{className:"cyber-glow cyber-glow-1"}),g.jsx("div",{className:"cyber-glow cyber-glow-2"}),g.jsx(Do,{})]}),g.jsx("div",{className:"scanlines"}),g.jsxs("div",{className:"cyber-login-container",children:[g.jsx("div",{className:"cyber-login-toolbar",children:g.jsx(Zn,{variant:"compact"})}),g.jsxs("div",{className:"cyber-login-content",children:[g.jsxs("div",{className:"cyber-brand",children:[g.jsx("div",{className:"cyber-logo",children:g.jsx("img",{src:"/logo.png",alt:"CodingNS",className:"cyber-logo-svg"})}),g.jsx("h1",{className:"cyber-brand-title",children:g.jsx(Lo,{text:"CodingNS"})}),g.jsx("p",{className:"cyber-brand-subtitle",children:g.jsx(jo,{text:t("auth.loginSubtitle")})})]}),g.jsxs("div",{className:"cyber-card",children:[g.jsx("div",{className:"cyber-corner corner-tl"}),g.jsx("div",{className:"cyber-corner corner-tr"}),g.jsx("div",{className:"cyber-corner corner-bl"}),g.jsx("div",{className:"cyber-corner corner-br"}),g.jsxs("div",{className:"cyber-card-header",children:[g.jsx("div",{className:"cyber-line"}),g.jsx("span",{className:"cyber-card-label",children:t("auth.loginTitle").toUpperCase()}),g.jsx("div",{className:"cyber-line"})]}),He?g.jsxs("div",{className:"cyber-demo-banner",children:[g.jsx("span",{className:"cyber-demo-icon",children:"⚠"}),g.jsx("span",{children:t("auth.demoBanner")})]}):null,g.jsxs("form",{className:"cyber-form",onSubmit:Ie,children:[g.jsxs("div",{className:`cyber-field ${ne==="username"?"focused":""}`,children:[g.jsx("div",{className:"cyber-field-border",children:g.jsx("div",{className:"cyber-field-border-glow"})}),g.jsxs("label",{className:"cyber-field-label",htmlFor:ge,children:[g.jsx("span",{className:"cyber-field-icon",children:"❯"}),t("auth.username")]}),g.jsx("input",{id:ge,"aria-label":t("auth.username"),className:"cyber-input",value:p,onChange:V=>de(V.target.value),onFocus:()=>se("username"),onBlur:()=>se(null),autoComplete:"username"})]}),g.jsxs("div",{className:`cyber-field ${ne==="password"?"focused":""}`,children:[g.jsx("div",{className:"cyber-field-border",children:g.jsx("div",{className:"cyber-field-border-glow"})}),g.jsxs("label",{className:"cyber-field-label",htmlFor:Ue,children:[g.jsx("span",{className:"cyber-field-icon",children:"⚷"}),t("auth.password")]}),g.jsx("input",{id:Ue,"aria-label":t("auth.password"),className:"cyber-input",type:"password",value:w,onChange:V=>P(V.target.value),onFocus:()=>se("password"),onBlur:()=>se(null),autoComplete:"current-password"})]}),S?g.jsxs("div",{className:"cyber-captcha-panel",children:[g.jsx("img",{alt:t("auth.captchaImageAlt"),className:"cyber-captcha-image",draggable:!1,src:S.imageDataUrl}),g.jsx("p",{className:"cyber-captcha-hint",children:t("auth.captchaHint")}),g.jsxs("div",{className:`cyber-field ${ne==="captcha"?"focused":""}`,children:[g.jsx("div",{className:"cyber-field-border",children:g.jsx("div",{className:"cyber-field-border-glow"})}),g.jsxs("label",{className:"cyber-field-label",htmlFor:mt,children:[g.jsx("span",{className:"cyber-field-icon",children:"#"}),t("auth.captcha")]}),g.jsx("input",{id:mt,"aria-label":t("auth.captcha"),className:"cyber-input",placeholder:t("auth.captchaPlaceholder"),value:k,onChange:V=>L(V.target.value),onFocus:()=>se("captcha"),onBlur:()=>se(null),autoComplete:"one-time-code"})]})]}):null,l?g.jsxs("label",{className:"cyber-remember-toggle",children:[g.jsx("input",{"aria-label":t("auth.rememberPassword"),type:"checkbox",checked:K,onChange:V=>te(V.target.checked)}),g.jsx("span",{children:t("auth.rememberPassword")})]}):null,N?g.jsxs("div",{className:"cyber-status","data-tone":"error",children:[g.jsx("span",{className:"cyber-status-icon",children:"⚠"}),g.jsx("span",{children:N})]}):null,g.jsxs("button",{className:`cyber-submit ${I?"loading":""}`,type:"submit",disabled:I,children:[g.jsx("span",{className:"cyber-submit-glow"}),g.jsx("span",{className:"cyber-submit-border"}),g.jsx("span",{className:"cyber-submit-text",children:I?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"cyber-spinner"}),t("common.loading")]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"cyber-submit-icon",children:"➤"}),t("auth.submitLogin")]})})]})]}),o?g.jsxs("div",{className:"cyber-footer",children:[g.jsxs("div",{className:"cyber-divider",children:[g.jsx("span",{className:"cyber-divider-line"}),g.jsx("span",{className:"cyber-divider-text",children:"//"}),g.jsx("span",{className:"cyber-divider-line"})]}),g.jsxs("button",{className:"cyber-server-btn",onClick:()=>oe(!0),type:"button",children:[g.jsx("span",{className:"cyber-server-icon",children:"⚙"}),g.jsx("span",{className:"cyber-server-text",children:t("auth.serverSettings")}),g.jsx("span",{className:"cyber-server-current",children:$})]})]}):null]})]}),g.jsxs("div",{className:"cyber-version",children:[g.jsxs("span",{className:"cyber-version-text",children:["v",a]}),g.jsx("span",{className:"cyber-version-divider",children:"|"}),g.jsx("span",{className:"cyber-version-text",children:"SYSTEM READY"})]})]}),o&&G?g.jsx(f.Suspense,{fallback:null,children:g.jsx(_o,{isOpen:G,onClose:()=>oe(!1),onSave:xe})}):null]})}function Io({isDesktop:e,viewportClass:t}){return e||t==="expanded"?"desktop":"mobile"}function Uo({runtimeKey:e,children:t}){return g.jsx("div",{children:t},e)}function Oo(){const e=yo();return g.jsx(Uo,{runtimeKey:e,children:g.jsx(pi,{})})}function Ao(){const e=Kr(r=>r.session),t=ht();if(!e){const r=`${t.pathname}${t.search}`;return g.jsx(un,{to:`/login?returnTo=${encodeURIComponent(r)}`,replace:!0})}return g.jsx(Oo,{})}function Hr(){const e=rr(),t=Io(e);return g.jsx(un,{to:t==="mobile"?"/workspaces":"/landing",replace:!0})}function ae(e,t){return async()=>({Component:(await e())[t]})}const ko=[{path:"/bootstrap",lazy:ae(()=>J(()=>import("./BootstrapPage-Vu5oEJ8z.js"),__vite__mapDeps([6,3,4])),"BootstrapPage")},{path:"/login",element:g.jsx(Mo,{})},{path:"/desktop-window-preview",lazy:ae(()=>J(()=>import("./DesktopDetachPreviewPage-BgeEqbc5.js"),__vite__mapDeps([7,3,4])),"DesktopDetachPreviewPage")},{path:"/",element:g.jsx(Ao,{}),children:[{path:"desktop-window/:windowId",lazy:ae(()=>J(()=>import("./DesktopWindowPage-1WelvxdH.js"),__vite__mapDeps([8,3,4,9,10,11,0,1,5,12,13,14,15,16,17,18,19,20,21])),"DesktopWindowPage")},{lazy:ae(()=>J(()=>import("./WorkbenchShellRoute-Kw7JEZI3.js"),__vite__mapDeps([22,3,4,11,9,0,1,5,23])),"WorkbenchShellRoute"),children:[{index:!0,element:g.jsx(Hr,{})},{path:"landing",lazy:ae(()=>J(()=>import("./WorkbenchLandingPage-kvlfyxRo.js"),__vite__mapDeps([24,3,4,11,9,0,1,5])),"WorkbenchLandingPage")},{path:"workspaces",lazy:ae(()=>J(()=>import("./WorkspaceHomePage-wR8d3aP9.js"),__vite__mapDeps([25,3,4,11,9,0,1,5,26,19,20,27])),"WorkspaceHomePage")},{path:"workspaces/:workspaceId",lazy:ae(()=>J(()=>import("./WorkspaceDetailPage-D0Lrx4Uz.js"),__vite__mapDeps([28,3,4,11,9,0,1,5,29,16,19,20,27])),"WorkspaceDetailPage")},{path:"workspaces/:workspaceId/debug",lazy:ae(()=>J(()=>import("./WorkspaceDebugDetailPage-Com5kEXJ.js"),__vite__mapDeps([30,3,4,29,9,16,11,0,1,5])),"WorkspaceDebugDetailPage")},{path:"workspaces/:workspaceId/sessions",lazy:ae(()=>J(()=>import("./SessionIndexPage-C5aG8FIv.js"),__vite__mapDeps([31,3,4,9,11,0,1,5,19,20,27,32,33])),"SessionIndexPage")},{path:"workspaces/:workspaceId/sessions/:sessionId",lazy:ae(()=>J(()=>import("./ConversationPage-Cjpg6g0J.js"),__vite__mapDeps([34,3,4,5,9,14,11,0,1,35,12,10,13,15,16,17,19,20,32,33])),"ConversationPage")},{path:"workspaces/:workspaceId/tools",lazy:ae(()=>J(()=>import("./ToolsHomePage-4fP-KRiv.js"),__vite__mapDeps([36,3,4,11,9,0,1,5])),"ToolsHomePage")},{path:"workspaces/:workspaceId/tools/files",lazy:ae(()=>J(()=>import("./ToolFilesPage-DcYPsS-e.js"),__vite__mapDeps([37,3,4,11,9,0,1,5])),"ToolFilesPage")},{path:"workspaces/:workspaceId/tools/git",lazy:ae(()=>J(()=>import("./ToolGitPage-CsPl89ty.js"),__vite__mapDeps([38,3,4,11,9,0,1,5])),"ToolGitPage")},{path:"workspaces/:workspaceId/tools/processes",lazy:ae(()=>J(()=>import("./ToolProcessesPage-D0dvR8xK.js"),__vite__mapDeps([39,3,4,11,9,0,1,5])),"ToolProcessesPage")},{path:"workspaces/:workspaceId/terminals",lazy:ae(()=>J(()=>import("./TerminalPage-CtKXIU0h.js"),__vite__mapDeps([18,3,4,9,11,0,1,5,19,20,16,17,21])),"TerminalPage")},{path:"workspaces/:workspaceId/butler",lazy:ae(()=>J(()=>import("./AdaptiveButlerPage-R-XZw7pd.js"),__vite__mapDeps([40,3,4,11,9,0,1,5,35,12,10,26,14,19,20,41])),"AdaptiveButlerPage")},{path:"settings",lazy:ae(()=>J(()=>import("./SettingsPage-HJIC-P-4.js"),__vite__mapDeps([42,3,4,9,5,20])),"SettingsPage")},{path:"settings/:section",lazy:ae(()=>J(()=>import("./SettingsPage-HJIC-P-4.js"),__vite__mapDeps([42,3,4,9,5,20])),"SettingsPage")},{path:"*",element:g.jsx(Hr,{})}]}]}];function Fo(){return wi(ko)}function Vo(){const e=Je(r=>r.profile.language),t=f.useMemo(()=>Fo(),[]);return g.jsx($i,{children:g.jsx(no,{children:g.jsx(Xn,{language:e,children:g.jsx(Qi,{children:g.jsxs(ro,{children:[g.jsx(vo,{}),g.jsx(Di,{router:t})]})})})})})}const Qo=Object.freeze(Object.defineProperty({__proto__:null,App:Vo},Symbol.toStringTag,{value:"Module"}));export{Qo as A,Zn as L,un as N,pi as O,Wo as T,To as a,Po as b,Ho as c,rr as d,Ko as e,Yr as f,ht as g,oo as h,Xi as i,ho as j,Yo as k,Go as l,br as m,Jo as n,ao as o,$o as p,Xo as q,Io as r,qo as s,Yt as t,tr as u};
|