@jingyi0605/codingns 0.5.1 → 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-SffCV4Vb.js → AdaptiveButlerPage-CUyNL98E.js} +1 -1
- package/dist/public/assets/App-BFP7LCSC.js +30 -0
- package/dist/public/assets/{BootstrapPage--zExdgfM.js → BootstrapPage-G74dX2Us.js} +1 -1
- package/dist/public/assets/ConversationPage-Bz0_tvvM.js +2 -0
- package/dist/public/assets/{DesktopDetachPreviewPage-DvI9CIKi.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-CXSKMnYn.js → MobileCreateSessionSheet-DqVwz_Hp.js} +1 -1
- package/dist/public/assets/MobileSheet-D1lMrcvD.js +1 -0
- package/dist/public/assets/{MobileTopHeaderFrame-BWorAJ1C.js → MobileTopHeaderFrame-COTc7cRr.js} +1 -1
- package/dist/public/assets/{MobileWorkspaceSwitcherHeader-DOr4pTUq.js → MobileWorkspaceSwitcherHeader-DJPV9ym2.js} +1 -1
- package/dist/public/assets/RelayConnectEntryPage-dSwU8VzK.js +1 -0
- package/dist/public/assets/{ServerSettingsModal-BYB0GvTl.js → ServerSettingsModal-B34ms3ze.js} +1 -1
- package/dist/public/assets/{SessionIndexPage-CR3IARXX.js → SessionIndexPage-D3tG1gmM.js} +1 -1
- package/dist/public/assets/SettingsPage-B3-6-5GL.js +1 -0
- package/dist/public/assets/{TerminalManagerPanel-PQ-EM64j.js → TerminalManagerPanel-DhuTEdzV.js} +1 -1
- package/dist/public/assets/{TerminalPage-CvnHXBhw.js → TerminalPage-DpsvQQVR.js} +19 -19
- package/dist/public/assets/{TerminalRuntimeFallbackModal-D7Aq186N.js → TerminalRuntimeFallbackModal-CNzOt5v5.js} +1 -1
- package/dist/public/assets/{ToolFilesPage-Qzkc6K2I.js → ToolFilesPage-BX9QDi9Y.js} +1 -1
- package/dist/public/assets/{ToolGitPage-BdNDN-cV.js → ToolGitPage-4VtFox3p.js} +1 -1
- package/dist/public/assets/{ToolProcessesPage-EXJ9DHWI.js → ToolProcessesPage-DZJC6Qnt.js} +1 -1
- package/dist/public/assets/{ToolsHomePage-CjF3CWzR.js → ToolsHomePage-D7JbrAWv.js} +1 -1
- package/dist/public/assets/{WorkbenchLandingPage-DZPk4SmX.js → WorkbenchLandingPage-C0yqnzqh.js} +1 -1
- package/dist/public/assets/WorkbenchLayout-Brlj8K3i.js +3 -0
- package/dist/public/assets/{WorkbenchModal-B09hC9b5.js → WorkbenchModal-CbDxaCOR.js} +1 -1
- package/dist/public/assets/{WorkbenchShellRoute-DsW4mBTX.css → WorkbenchShellRoute-BMcnFadA.css} +1 -1
- package/dist/public/assets/WorkbenchShellRoute-puGpdDFY.js +1 -0
- package/dist/public/assets/{WorkspaceDebugDetailPage-Bcq8s-Ma.js → WorkspaceDebugDetailPage-fTGweC9N.js} +1 -1
- package/dist/public/assets/{WorkspaceDetailPage-DNAa8pKr.js → WorkspaceDetailPage-BtaIzSDB.js} +1 -1
- package/dist/public/assets/{WorkspaceHomePage-BoiLuACV.js → WorkspaceHomePage-CUmmYDrM.js} +1 -1
- package/dist/public/assets/{client-runtime-manager-CRQ-F5d2.js → client-runtime-manager-RHFa_iWo.js} +1 -1
- package/dist/public/assets/{default-session-permission-mode-D0wZ9Jek.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-gOt2ZjKZ.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-BMT-rSEe.js → terminal-runtime-meta-B9xJGY__.js} +1 -1
- package/dist/public/assets/{useRegisteredDebugTemplates-zMcEOGca.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/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 +4 -1
- package/dist/server/modules/relay-tunnel/relay-tunnel-service.js +256 -34
- 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/workbench-service.d.ts +32 -2
- package/dist/server/modules/workbench/workbench-service.js +36 -2
- package/dist/server/modules/workbench/workbench-service.js.map +1 -1
- package/dist/server/server/create-server.js +10 -5
- package/dist/server/server/create-server.js.map +1 -1
- package/dist/server/ws/workbench-ws-hub.js +166 -16
- 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/App-WOLwMld_.js +0 -30
- package/dist/public/assets/ConversationPage-D9pzRmOg.js +0 -2
- package/dist/public/assets/DesktopWindowPage-D8FpOSLE.js +0 -2
- package/dist/public/assets/FileContextPanel-C8T7oqRN.js +0 -1
- package/dist/public/assets/GitSidebar-Bze7DNnc.js +0 -6
- package/dist/public/assets/MobileSheet-Gzc14EpR.js +0 -1
- package/dist/public/assets/SettingsPage-B_BQtnwE.js +0 -1
- package/dist/public/assets/WorkbenchLayout-rwQib5In.js +0 -3
- package/dist/public/assets/WorkbenchShellRoute-Cerk5uK7.js +0 -1
- package/dist/public/assets/file-tree-icon-Dp_xhVfD.js +0 -31
- package/dist/public/assets/index-C2G8Gmf1.js +0 -42
- package/dist/public/assets/index-CpPTUeA3.css +0 -1
- package/dist/public/assets/session-runtime-machine-Dq3pW-UF.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-BYB0GvTl.js","assets/index-C2G8Gmf1.js","assets/index-CpPTUeA3.css","assets/WorkbenchModal-B09hC9b5.js","assets/BootstrapPage--zExdgfM.js","assets/DesktopDetachPreviewPage-DvI9CIKi.js","assets/DesktopWindowPage-D8FpOSLE.js","assets/MobileSheet-Gzc14EpR.js","assets/FileContextPanel-C8T7oqRN.js","assets/WorkbenchLayout-rwQib5In.js","assets/file-tree-icon-Dp_xhVfD.js","assets/GitSidebar-Bze7DNnc.js","assets/default-session-permission-mode-D0wZ9Jek.js","assets/TerminalManagerPanel-PQ-EM64j.js","assets/terminal-runtime-meta-BMT-rSEe.js","assets/TerminalRuntimeFallbackModal-D7Aq186N.js","assets/TerminalPage-CvnHXBhw.js","assets/MobileWorkspaceSwitcherHeader-DOr4pTUq.js","assets/MobileTopHeaderFrame-BWorAJ1C.js","assets/TerminalPage-6GBZ9nXN.css","assets/WorkbenchShellRoute-Cerk5uK7.js","assets/WorkbenchShellRoute-DsW4mBTX.css","assets/WorkbenchLandingPage-DZPk4SmX.js","assets/WorkspaceHomePage-BoiLuACV.js","assets/butler-records-events-DgWCG364.js","assets/MobileCreateSessionSheet-CXSKMnYn.js","assets/WorkspaceDetailPage-DNAa8pKr.js","assets/useRegisteredDebugTemplates-zMcEOGca.js","assets/WorkspaceDebugDetailPage-Bcq8s-Ma.js","assets/SessionIndexPage-CR3IARXX.js","assets/styles-CSUx5LGe.js","assets/styles-BWPBZvze.css","assets/ConversationPage-D9pzRmOg.js","assets/session-runtime-machine-Dq3pW-UF.js","assets/ToolsHomePage-CjF3CWzR.js","assets/ToolFilesPage-Qzkc6K2I.js","assets/ToolGitPage-BdNDN-cV.js","assets/ToolProcessesPage-EXJ9DHWI.js","assets/AdaptiveButlerPage-SffCV4Vb.js","assets/AdaptiveButlerPage-B153lk5H.css","assets/SettingsPage-B_BQtnwE.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Nn=Object.defineProperty;var Mn=(e,t,r)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Se=(e,t,r)=>Mn(e,typeof t!="symbol"?t+"":t,r);import{u as Je,j as g,t as it,a as Yt,g as In,r as Un,b as h,R as On,c as lt,_ as J,d as An,e as ye,f as Rt,h as Vt,n as zr,i as Br,k as kn,l as Et,m as Fn,o as Vn,p as zn,s as Bn,q as Hn,v as Hr,w as Wn,x as $n,y as Kn,A as Yn,z as Gn,I as Jn}from"./index-C2G8Gmf1.js";function Xn(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 Qn({variant:e="default",className:t}){const r=Je(a=>a.profile.language);function n(a){a!==r&&Yt({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 Wr=Un();const Zn=In(Wr),ea=Xn({__proto__:null,default:Zn},[Wr]);/**
|
|
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 pr="popstate";function ta(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 na(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 ra(){return Math.random().toString(36).substr(2,8)}function vr(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||ra()})}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 na(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:E.location,delta:k})}function b(D,k){l=ee.Push;let L=ot(E.location,D,k);d=m()+1;let K=vr(L,d),te=E.createHref(L);try{o.pushState(K,"",te)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;a.location.assign(te)}i&&c&&c({action:l,location:E.location,delta:1})}function w(D,k){l=ee.Replace;let L=ot(E.location,D,k);d=m();let K=vr(L,d),te=E.createHref(L);o.replaceState(K,"",te),i&&c&&c({action:l,location:E.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 E={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(pr,p),c=D,()=>{a.removeEventListener(pr,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 E}var B;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(B||(B={}));const aa=new Set(["lazy","caseSensitive","path","id","index","children"]);function ia(e){return e.index===!0}function _t(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`),ia(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=_t(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=$r(e);sa(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=ya(i);l=va(o[c],d,n)}return l}function oa(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 $r(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+'".')),$r(i.children,t,m,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:ma(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 Kr(i.path))a(i,o,c)}),t}function Kr(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=Kr(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 sa(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:pa(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const la=/^:[\w-]+$/,ca=3,ua=2,da=1,fa=10,ha=-2,gr=e=>e==="*";function ma(e,t){let r=e.split("/"),n=r.length;return r.some(gr)&&(n+=ha),t&&(n+=ua),r.filter(a=>!gr(a)).reduce((a,i)=>a+(la.test(i)?ca:i===""?da:fa),n)}function pa(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 va(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=yr({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},m),b=c.route;if(!p&&d&&r&&!n[n.length-1].route.index&&(p=yr({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 yr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=ga(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 E=l[p]||"";o=i.slice(0,i.length-E.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 ga(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 ya(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 ba=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wa=e=>ba.test(e);function xa(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Me(e):e,i;if(r)if(wa(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=br(r.substring(1),"/"):i=br(r,t)}else i=t;return{pathname:i,search:Sa(n),hash:Ra(a)}}function br(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 Ot(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 Yr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Gt(e,t){let r=Yr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Jt(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("?"),Ot("?","pathname","search",a)),U(!a.pathname||!a.pathname.includes("#"),Ot("#","pathname","hash",a)),U(!a.search||!a.search.includes("#"),Ot("#","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=xa(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(/^\/*/,"/"),Sa=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ra=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Ct{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 Gr=["post","put","patch","delete"],Ta=new Set(Gr),Pa=["get",...Gr],_a=new Set(Pa),Ca=new Set([301,302,303,307,308]),Da=new Set([307,308]),At={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},La={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},Xt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ja=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Jr="remix-router-transitions";function Na(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=ja;let i={},o=_t(e.routes,a,void 0,i),l,c=e.basename||"/",d=e.dataStrategy||Oa,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,E=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:f}=Lr(o);L=u,te={[f.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 f=L.findIndex(y=>u[y.route.id]!==void 0);$=L.slice(0,f+1).every(y=>!Bt(y.route,s,u))}else $=L.every(f=>!Bt(f.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 he,v={historyAction:e.history.action,location:e.history.location,matches:L,initialized:$,navigation:At,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,be=new Map,ce=new Set,_e=new Map,Ie=new Map,ue=new Set,we=new Map,pe=new Map,Ue;function mt(){if(b=e.history.listen(s=>{let{action:u,location:f,delta:y}=s;if(Ue){Ue(),Ue=void 0;return}Be(pe.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=dr({currentLocation:v.location,nextLocation:f,historyAction:u});if(x&&y!=null){let C=new Promise(j=>{Ue=j});e.history.go(y*-1),gt(x,{state:"blocked",location:f,proceed(){gt(x,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),C.then(()=>e.history.go(y))},reset(){let j=new Map(v.blockers);j.set(x,tt),H({blockers:j})}});return}return Oe(u,f)}),r){Xa(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}),he}function V(){b&&b(),oe&&oe(),w.clear(),I&&I.abort(),v.fetchers.forEach((s,u)=>vt(u)),v.blockers.forEach((s,u)=>ur(u))}function de(s){return w.add(s),()=>w.delete(s)}function H(s,u){u===void 0&&(u={}),v=Y({},v,s);let f=[],y=[];p.v7_fetcherPersist&&v.fetchers.forEach((x,C)=>{x.state==="idle"&&(ue.has(C)?y.push(C):f.push(C))}),ue.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?(f.forEach(x=>v.fetchers.delete(x)),y.forEach(x=>vt(x))):y.forEach(x=>ue.delete(x))}function ve(s,u,f){var y,x;let{flushSync:C}=f===void 0?{}:f,j=v.actionData!=null&&v.navigation.formMethod!=null&&me(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?Cr(v.loaderData,u.loaderData,u.matches||[],u.errors):v.loaderData,S=v.blockers;S.size>0&&(S=new Map(S),S.forEach((O,ie)=>S.set(ie,tt)));let _=F===!0||v.navigation.formMethod!=null&&me(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:At,revalidation:"idle",restoreScrollPosition:hr(s,u.matches||v.matches),preventScrollReset:_,blockers:S}),{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 f=zt(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}=wr(p.v7_normalizeFormMethod,!1,f,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,S=ee.Push;T===!0?S=ee.Replace:T===!1||x!=null&&me(x.formMethod)&&x.formAction===v.location.pathname+v.location.search&&(S=ee.Replace);let _=u&&"preventScrollReset"in u?u.preventScrollReset===!0:void 0,M=(u&&u.flushSync)===!0,O=dr({currentLocation:j,nextLocation:R,historyAction:S});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(S,R,{submission:x,pendingError:C,preventScrollReset:_,replace:u&&u.replace,enableViewTransition:u&&u.viewTransition,flushSync:M})}function yn(){if(Nt(),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,f){I&&I.abort(),I=null,N=s,ne=(f&&f.startUninterruptedRevalidation)===!0,Cn(v.location,v.matches),F=(f&&f.preventScrollReset)===!0,re=(f&&f.enableViewTransition)===!0;let y=l||o,x=f&&f.overrideNavigation,C=f!=null&&f.initialHydration&&v.matches&&v.matches.length>0&&!K?v.matches:Fe(y,u,c),j=(f&&f.flushSync)===!0;if(C&&v.initialized&&!se&&Ba(v.location,u)&&!(f&&f.submission&&me(f.submission.formMethod))){ve(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}=Mt(u.pathname);ve(u,{matches:z,loaderData:{},errors:{[X.id]:W}},{flushSync:j});return}I=new AbortController;let T=Ge(e.history,u,I.signal,f&&f.submission),S;if(f&&f.pendingError)S=[Ve(C).route.id,{type:B.error,error:f.pendingError}];else if(f&&f.submission&&me(f.submission.formMethod)){let W=await bn(T,u,f.submission,C,R.active,{replace:f.replace,flushSync:j});if(W.shortCircuited)return;if(W.pendingActionResult){let[z,X]=W.pendingActionResult;if(fe(X)&&st(X.error)&&X.error.status===404){I=null,ve(u,{matches:W.matches,loaderData:{},errors:{[z]:X.error}});return}}C=W.matches||C,S=W.pendingActionResult,x=kt(u,f.submission),j=!1,R.active=!1,T=Ge(e.history,T.url,T.signal)}let{shortCircuited:_,matches:M,loaderData:O,errors:ie}=await wn(T,u,C,R.active,x,f&&f.submission,f&&f.fetcherSubmission,f&&f.replace,f&&f.initialHydration===!0,j,S);_||(I=null,ve(u,Y({matches:M||C},Dr(S),{loaderData:O,errors:ie})))}async function bn(s,u,f,y,x,C){C===void 0&&(C={}),Nt();let j=Ga(u,f);if(H({navigation:j},{flushSync:C.flushSync===!0}),x){let S=await bt(y,u.pathname,s.signal);if(S.type==="aborted")return{shortCircuited:!0};if(S.type==="error"){let _=Ve(S.partialMatches).route.id;return{matches:S.partialMatches,pendingActionResult:[_,{type:B.error,error:S.error}]}}else if(S.matches)y=S.matches;else{let{notFoundMatches:_,error:M,route:O}=Mt(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 S;return C&&C.replace!=null?S=C.replace:S=Tr(R.response.headers.get("Location"),new URL(s.url),c,e.history)===v.location.pathname+v.location.search,await Ae(s,R,!0,{submission:f,replace:S}),{shortCircuited:!0}}if(je(R))throw le(400,{type:"defer-action"});if(fe(R)){let S=Ve(y,T.route.id);return(C&&C.replace)!==!0&&(N=ee.Push),{matches:y,pendingActionResult:[S.route.id,R]}}return{matches:y,pendingActionResult:[T.route.id,R]}}async function wn(s,u,f,y,x,C,j,R,T,S,_){let M=x||kt(u,C),O=C||j||Nr(M),ie=!ne&&(!p.v7_partialHydration||!T);if(y){if(ie){let q=ar(_);H(Y({navigation:M},q!==void 0?{actionData:q}:{}),{flushSync:S})}let A=await bt(f,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)f=A.matches;else{let{error:q,notFoundMatches:Ke,route:et}=Mt(u.pathname);return{matches:Ke,loaderData:{},errors:{[et.id]:q}}}}let W=l||o,[z,X]=Er(e.history,v,f,O,u,p.v7_partialHydration&&T===!0,p.v7_skipActionErrorRevalidation,se,He,We,ue,_e,ce,W,c,_);if(It(A=>!(f&&f.some(q=>q.route.id===A))||z&&z.some(q=>q.route.id===A)),Pe=++Te,z.length===0&&X.length===0){let A=lr();return ve(u,Y({matches:f,loaderData:{},errors:_&&fe(_[1])?{[_[0]]:_[1].error}:null},Dr(_),A?{fetchers:new Map(v.fetchers)}:{}),{flushSync:S}),{shortCircuited:!0}}if(ie){let A={};if(!y){A.navigation=M;let q=ar(_);q!==void 0&&(A.actionData=q)}X.length>0&&(A.fetchers=xn(X)),H(A,{flushSync:S})}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 ir(v,f,z,X,s);if(s.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",$e),X.forEach(A=>Q.delete(A.key));let ge=St(Qe);if(ge)return await Ae(s,ge.result,!0,{replace:R}),{shortCircuited:!0};if(ge=St(Ee),ge)return ce.add(ge.key),await Ae(s,ge.result,!0,{replace:R}),{shortCircuited:!0};let{loaderData:Ut,errors:Ze}=_r(v,f,Qe,_,X,Ee,we);we.forEach((A,q)=>{A.subscribe(Ke=>{(Ke||A.done)&&we.delete(q)})}),p.v7_partialHydration&&T&&v.errors&&(Ze=Y({},v.errors,Ze));let ke=lr(),wt=cr(Pe),xt=ke||wt||X.length>0;return Y({matches:f,loaderData:Ut,errors:Ze},xt?{fetchers:new Map(v.fetchers)}:{})}function ar(s){if(s&&!fe(s[1]))return{[s[0]]:s[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function xn(s){return s.forEach(u=>{let f=v.fetchers.get(u.key),y=rt(void 0,f?f.data:void 0);v.fetchers.set(u.key,y)}),new Map(v.fetchers)}function En(s,u,f,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=zt(v.location,v.matches,c,p.v7_prependBasename,f,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){xe(s,u,le(404,{pathname:j}),{flushSync:x});return}let{path:S,submission:_,error:M}=wr(p.v7_normalizeFormMethod,!0,j,y);if(M){xe(s,u,M,{flushSync:x});return}let O=at(R,S),ie=(y&&y.preventScrollReset)===!0;if(_&&me(_.formMethod)){Sn(s,u,S,O,R,T.active,x,ie,_);return}_e.set(s,{routeId:u,path:S}),Rn(s,u,S,O,R,T.active,x,ie,_)}async function Sn(s,u,f,y,x,C,j,R,T){Nt(),_e.delete(s);function S(Z){if(!Z.route.action&&!Z.route.lazy){let Ye=le(405,{method:T.formMethod,pathname:f,routeId:u});return xe(s,u,Ye,{flushSync:j}),!0}return!1}if(!C&&S(y))return;let _=v.fetchers.get(s);Ce(s,Ja(T,_),{flushSync:j});let M=new AbortController,O=Ge(e.history,f,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"){xe(s,u,Z.error,{flushSync:j});return}else if(Z.matches){if(x=Z.matches,y=at(x,f),S(y))return}else{xe(s,u,le(404,{pathname:f}),{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&&ue.has(s)){if(ze(z)||fe(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 ce.add(s),Ce(s,rt(T)),Ae(O,z,!1,{fetcherSubmission:T,preventScrollReset:R});if(fe(z)){xe(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 ge=++Te;be.set(s,ge);let Ut=rt(T,z.data);v.fetchers.set(s,Ut);let[Ze,ke]=Er(e.history,v,Ee,T,X,!1,p.v7_skipActionErrorRevalidation,se,He,We,ue,_e,ce,Qe,c,[y.route.id,z]);ke.filter(Z=>Z.key!==s).forEach(Z=>{let Ye=Z.key,mr=v.fetchers.get(Ye),jn=rt(void 0,mr?mr.data:void 0);v.fetchers.set(Ye,jn),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 ir(v,Ee,Ze,ke,$e);if(M.signal.aborted)return;M.signal.removeEventListener("abort",wt),be.delete(s),Q.delete(s),ke.forEach(Z=>Q.delete(Z.key));let q=St(xt);if(q)return Ae($e,q.result,!1,{preventScrollReset:R});if(q=St(A),q)return ce.add(q.key),Ae($e,q.result,!1,{preventScrollReset:R});let{loaderData:Ke,errors:et}=_r(v,Ee,xt,void 0,ke,A,we);if(v.fetchers.has(s)){let Z=Le(z.data);v.fetchers.set(s,Z)}cr(ge),v.navigation.state==="loading"&&ge>Pe?(U(N,"Expected pending action"),I&&I.abort(),ve(v.navigation.location,{matches:Ee,loaderData:Ke,errors:et,fetchers:new Map(v.fetchers)})):(H({errors:et,loaderData:Cr(v.loaderData,Ke,Ee,et),fetchers:new Map(v.fetchers)}),se=!1)}async function Rn(s,u,f,y,x,C,j,R,T){let S=v.fetchers.get(s);Ce(s,rt(T,S?S.data:void 0),{flushSync:j});let _=new AbortController,M=Ge(e.history,f,_.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"){xe(s,u,z.error,{flushSync:j});return}else if(z.matches)x=z.matches,y=at(x,f);else{xe(s,u,le(404,{pathname:f}),{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(ue.has(s)){Ce(s,Le(void 0));return}if(ze(W))if(Pe>O){Ce(s,Le(void 0));return}else{ce.add(s),await Ae(M,W,!1,{preventScrollReset:R});return}if(fe(W)){xe(s,u,W.error);return}U(!je(W),"Unhandled fetcher deferred data"),Ce(s,Le(W.data))}}async function Ae(s,u,f,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=Tr(T,new URL(s.url),c,e.history);let S=ot(v.location,T,{_isRedirect:!0});if(r){let z=!1;if(u.response.headers.has("X-Remix-Reload-Document"))z=!0;else if(Xt.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=Nr(v.navigation));let W=x||C;if(Da.has(u.response.status)&&W&&me(W.formMethod))await Oe(_,S,{submission:Y({},W,{formAction:T}),preventScrollReset:j||F,enableViewTransition:f?re:void 0});else{let z=kt(S,x);await Oe(_,S,{overrideNavigation:z,fetcherSubmission:C,preventScrollReset:j||F,enableViewTransition:f?re:void 0})}}async function qe(s,u,f,y,x,C){let j,R={};try{j=await Aa(d,s,u,f,y,x,C,i,a)}catch(T){return y.forEach(S=>{R[S.route.id]={type:B.error,error:T}}),R}for(let[T,S]of Object.entries(j))if(Ha(S)){let _=S.result;R[T]={type:B.redirect,response:Va(_,f,T,x,c,p.v7_relativeSplatPath)}}else R[T]=await Fa(S);return R}async function ir(s,u,f,y,x){let C=s.matches,j=qe("loader",s,x,f,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,S=(await R).reduce((_,M)=>Object.assign(_,M),{});return await Promise.all([Ka(u,T,x.signal,C,s.loaderData),Ya(u,S,y)]),{loaderResults:T,fetcherResults:S}}function Nt(){se=!0,He.push(...It()),_e.forEach((s,u)=>{Q.has(u)&&We.add(u),De(u)})}function Ce(s,u,f){f===void 0&&(f={}),v.fetchers.set(s,u),H({fetchers:new Map(v.fetchers)},{flushSync:(f&&f.flushSync)===!0})}function xe(s,u,f,y){y===void 0&&(y={});let x=Ve(v.matches,u);vt(s),H({errors:{[x.route.id]:f},fetchers:new Map(v.fetchers)},{flushSync:(y&&y.flushSync)===!0})}function or(s){return Ie.set(s,(Ie.get(s)||0)+1),ue.has(s)&&ue.delete(s),v.fetchers.get(s)||La}function vt(s){let u=v.fetchers.get(s);Q.has(s)&&!(u&&u.state==="loading"&&be.has(s))&&De(s),_e.delete(s),be.delete(s),ce.delete(s),p.v7_fetcherPersist&&ue.delete(s),We.delete(s),v.fetchers.delete(s)}function Tn(s){let u=(Ie.get(s)||0)-1;u<=0?(Ie.delete(s),ue.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 sr(s){for(let u of s){let f=or(u),y=Le(f.data);v.fetchers.set(u,y)}}function lr(){let s=[],u=!1;for(let f of ce){let y=v.fetchers.get(f);U(y,"Expected fetcher: "+f),y.state==="loading"&&(ce.delete(f),s.push(f),u=!0)}return sr(s),u}function cr(s){let u=[];for(let[f,y]of be)if(y<s){let x=v.fetchers.get(f);U(x,"Expected fetcher: "+f),x.state==="loading"&&(De(f),be.delete(f),u.push(f))}return sr(u),u.length>0}function Pn(s,u){let f=v.blockers.get(s)||tt;return pe.get(s)!==u&&pe.set(s,u),f}function ur(s){v.blockers.delete(s),pe.delete(s)}function gt(s,u){let f=v.blockers.get(s)||tt;U(f.state==="unblocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="proceeding"||f.state==="blocked"&&u.state==="unblocked"||f.state==="proceeding"&&u.state==="unblocked","Invalid blocker state transition: "+f.state+" -> "+u.state);let y=new Map(v.blockers);y.set(s,u),H({blockers:y})}function dr(s){let{currentLocation:u,nextLocation:f,historyAction:y}=s;if(pe.size===0)return;pe.size>1&&Be(!1,"A router only supports one blocker at a time");let x=Array.from(pe.entries()),[C,j]=x[x.length-1],R=v.blockers.get(C);if(!(R&&R.state==="proceeding")&&j({currentLocation:u,nextLocation:f,historyAction:y}))return C}function Mt(s){let u=le(404,{pathname:s}),f=l||o,{matches:y,route:x}=Lr(f);return It(),{notFoundMatches:y,route:x,error:u}}function It(s){let u=[];return we.forEach((f,y)=>{(!s||s(y))&&(f.cancel(),u.push(y),we.delete(y))}),u}function _n(s,u,f){if(P=s,D=u,E=f||null,!k&&v.navigation===At){k=!0;let y=hr(v.location,v.matches);y!=null&&H({restoreScrollPosition:y})}return()=>{P=null,D=null,E=null}}function fr(s,u){return E&&E(s,u.map(y=>oa(y,v.loaderData)))||s.key}function Cn(s,u){if(P&&D){let f=fr(s,u);P[f]=D()}}function hr(s,u){if(P){let f=fr(s,u),y=P[f];if(typeof y=="number")return y}return null}function yt(s,u,f){if(m)if(s){if(Object.keys(s[0].params).length>0)return{active:!0,matches:Tt(u,f,c,!0)}}else return{active:!0,matches:Tt(u,f,c,!0)||[]};return{active:!1,matches:null}}async function bt(s,u,f,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:f,path:u,matches:x,fetcherKey:y,patch:(_,M)=>{f.aborted||Rr(_,M,j,R,a)}})}catch(_){return{type:"error",error:_,partialMatches:x}}finally{C&&!f.aborted&&(o=[...o])}if(f.aborted)return{type:"aborted"};let T=Fe(j,u,c);if(T)return{type:"success",matches:T};let S=Tt(j,u,c,!0);if(!S||x.length===S.length&&x.every((_,M)=>_.route.id===S[M].route.id))return{type:"success",matches:null};x=S}}function Dn(s){i={},l=_t(s,a,void 0,i)}function Ln(s,u){let f=l==null;Rr(s,u,l||o,i,a),f&&(o=[...o],H({}))}return he={get basename(){return c},get future(){return p},get state(){return v},get routes(){return o},get window(){return t},initialize:mt,subscribe:de,enableScrollRestoration:_n,navigate:pt,fetch:En,revalidate:yn,createHref:s=>e.history.createHref(s),encodeLocation:s=>e.history.encodeLocation(s),getFetcher:or,deleteFetcher:Tn,dispose:V,getBlocker:Pn,deleteBlocker:ur,patchRoutes:Ln,_internalFetchControllers:Q,_internalActiveDeferreds:we,_internalSetRoutes:Dn},he}function Ma(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function zt(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=Jt(a||".",Gt(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=Qt(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(E=>E).forEach(E=>b.append("index",E));let P=b.toString();m.search=P?"?"+P:""}}return n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Ne([r,m.pathname])),ct(m)}function wr(e,t,r,n){if(!n||!Ma(n))return{path:r};if(n.formMethod&&!$a(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=Qr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!me(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[E,D]=P;return""+w+E+"="+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(!me(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=Ht(n.formData),d=n.formData;else if(n.body instanceof FormData)c=Ht(n.body),d=n.body;else if(n.body instanceof URLSearchParams)c=n.body,d=Pr(c);else if(n.body==null)c=new URLSearchParams,d=new FormData;else try{c=new URLSearchParams(n.body),d=Pr(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(me(m.formMethod))return{path:r,submission:m};let p=Me(r);return t&&p.search&&Qt(p.search)&&c.append("index",""),p.search="?"+c,{path:ct(p),submission:m}}function xr(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,E){let D=E?fe(E[1])?E[1].error:E[1].data:void 0,k=e.createURL(t.location),L=e.createURL(a),K=r;i&&t.errors?K=xr(r,Object.keys(t.errors)[0],!0):E&&fe(E[1])&&(K=xr(r,E[0]));let te=E?E[1].statusCode:void 0,$=o&&te&&te>=400,he=K.filter((N,F)=>{let{route:I}=N;if(I.lazy)return!0;if(I.loader==null)return!1;if(i)return Bt(I,t.loaderData,t.errors);if(Ia(t.loaderData,t.matches[F],N)||c.some(oe=>oe===N.route.id))return!0;let re=t.matches[F],G=N;return Sr(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||Xr(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=Sr(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})}),[he,v]}function Bt(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 Ia(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Xr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Sr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Rr(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=>qr(d,m))),c=_t(l,a,[e||"_","patch",String(((i=o)==null?void 0:i.length)||"0")],n);o.push(...c)}function qr(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=>qr(r,i))}):!1}async function Ua(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&&!aa.has(o)&&(i[o]=n[o])}Object.assign(a,i),Object.assign(a,Y({},t(a),{lazy:void 0}))}async function Oa(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 Aa(e,t,r,n,a,i,o,l,c,d){let m=i.map(w=>w.route.lazy?Ua(w.route,c,l):void 0),p=i.map((w,P)=>{let E=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?ka(t,n,w,E,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 ka(e,t,r,n,a,i){let o,l,c=d=>{let m,p=new Promise((P,E)=>m=E);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(E=>b(E)):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 Fa(e){let{result:t,type:r}=e;if(Zr(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 Ct(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(jr(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 Ct(((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(Wa(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(jr(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 Va(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"),!Xt.test(o)){let l=n.slice(0,n.findIndex(c=>c.route.id===r)+1);o=zt(new URL(t.url),l,a,!0,o,i),e.headers.set("Location",o)}return e}function Tr(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Xt.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(Qr(t)).toString(),i={signal:r};if(n&&me(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=Ht(n.formData):i.body=n.formData}return new Request(a,i)}function Ht(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Pr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function za(e,t,r,n,a){let i={},o=null,l,c=!1,d={},m=r&&fe(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"),fe(w)){let P=w.error;m!==void 0&&(P=m,m=void 0),o=o||{};{let E=Ve(e,b);o[E.route.id]==null&&(o[E.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 _r(e,t,r,n,a,i,o){let{loaderData:l,errors:c}=za(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(fe(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 Cr(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 Dr(e){return e?fe(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 Lr(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 Ct(e||500,l,new Error(c),!0)}function St(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 Qr(e){let t=typeof e=="string"?Me(e):e;return ct(Y({},t,{hash:""}))}function Ba(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ha(e){return Zr(e.result)&&Ca.has(e.result.status)}function je(e){return e.type===B.deferred}function fe(e){return e.type===B.error}function ze(e){return(e&&e.type)===B.redirect}function jr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Wa(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 Zr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function $a(e){return _a.has(e.toLowerCase())}function me(e){return Ta.has(e.toLowerCase())}async function Ka(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&&!Xr(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 Ya(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 Qt(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&&Qt(r||""))return e[e.length-1];let n=Yr(e);return n[n.length-1]}function Nr(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 kt(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 Ga(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 Ja(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 Xa(e,t){try{let r=e.sessionStorage.getItem(Jr);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(Jr,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 Dt(){return Dt=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},Dt.apply(this,arguments)}const jt=h.createContext(null),en=h.createContext(null),dt=h.createContext(null),Zt=h.createContext(null),Re=h.createContext({outlet:null,matches:[],isDataRoute:!1}),tn=h.createContext(null);function ft(){return h.useContext(Zt)!=null}function ht(){return ft()||U(!1),h.useContext(Zt).location}function rn(e){h.useContext(dt).static||h.useLayoutEffect(e)}function er(){let{isDataRoute:e}=h.useContext(Re);return e?di():Qa()}function Qa(){ft()||U(!1);let e=h.useContext(jt),{basename:t,future:r,navigator:n}=h.useContext(dt),{matches:a}=h.useContext(Re),{pathname:i}=ht(),o=JSON.stringify(Gt(a,r.v7_relativeSplatPath)),l=h.useRef(!1);return rn(()=>{l.current=!0}),h.useCallback(function(d,m){if(m===void 0&&(m={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Jt(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 Za=h.createContext(null);function ei(e){let t=h.useContext(Re).outlet;return t&&h.createElement(Za.Provider,{value:e},t)}function Vo(){let{matches:e}=h.useContext(Re),t=e[e.length-1];return t?t.params:{}}function ti(e,t,r,n){ft()||U(!1);let{navigator:a}=h.useContext(dt),{matches:i}=h.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 E=c.replace(/^\//,"").split("/");b="/"+p.replace(/^\//,"").split("/").slice(E.length).join("/")}let w=Fe(e,{pathname:b});return oi(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:Ne([c,a.encodeLocation?a.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?c:Ne([c,a.encodeLocation?a.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),i,r,n)}function ri(){let e=ui(),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 h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,null)}const ni=h.createElement(ri,null);class ai extends h.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?h.createElement(Re.Provider,{value:this.props.routeContext},h.createElement(tn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ii(e){let{routeContext:t,match:r,children:n}=e,a=h.useContext(jt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(Re.Provider,{value:t},n)}function oi(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,E=null,D=null;r&&(w=l&&p.route.id?l[p.route.id]:void 0,E=p.route.errorElement||ni,c&&(d<0&&b===0?(fi("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=E:P?K=D:p.route.Component?K=h.createElement(p.route.Component,null):p.route.element?K=p.route.element:K=m,h.createElement(ii,{match:p,routeContext:{outlet:m,matches:k,isDataRoute:r!=null},children:K})};return r&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?h.createElement(ai,{location:r.location,revalidation:r.revalidation,component:E,error:w,children:L(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):L()},null)}var nn=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(nn||{}),an=(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})(an||{});function si(e){let t=h.useContext(jt);return t||U(!1),t}function li(e){let t=h.useContext(en);return t||U(!1),t}function ci(e){let t=h.useContext(Re);return t||U(!1),t}function on(e){let t=ci(),r=t.matches[t.matches.length-1];return r.route.id||U(!1),r.route.id}function ui(){var e;let t=h.useContext(tn),r=li(an.UseRouteError),n=on();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function di(){let{router:e}=si(nn.UseNavigateStable),t=on(),r=h.useRef(!1);return rn(()=>{r.current=!0}),h.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Dt({fromRouteId:t},i)))},[e,t])}const Mr={};function fi(e,t,r){Mr[e]||(Mr[e]=!0)}function hi(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 sn(e){let{to:t,replace:r,state:n,relative:a}=e;ft()||U(!1);let{future:i,static:o}=h.useContext(dt),{matches:l}=h.useContext(Re),{pathname:c}=ht(),d=er(),m=Jt(t,Gt(l,i.v7_relativeSplatPath),c,a==="path"),p=JSON.stringify(m);return h.useEffect(()=>d(JSON.parse(p),{replace:r,state:n,relative:a}),[d,p,a,r,n]),null}function mi(e){return ei(e.context)}function pi(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=h.useMemo(()=>({basename:c,navigator:i,static:o,future:Dt({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,E=h.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 E==null?null:h.createElement(dt.Provider,{value:d},h.createElement(Zt.Provider,{children:r,value:E}))}new Promise(()=>{});function vi(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:h.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:h.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 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)}function Wt(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 gi(e,t){let r=Wt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const yi="6";try{window.__reactRouterVersion=yi}catch{}function bi(e,t){return Na({basename:void 0,future:Lt({},void 0,{v7_prependBasename:!0}),history:ta({window:void 0}),hydrationData:wi(),routes:e,mapRouteProperties:vi,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function wi(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Lt({},t,{errors:xi(t.errors)})),t}function xi(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 Ct(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=h.createContext({isTransitioning:!1}),Si=h.createContext(new Map),Ri="startTransition",Ir=On[Ri],Ti="flushSync",Ur=ea[Ti];function Pi(e){Ir?Ir(e):e()}function nt(e){Ur?Ur(e):e()}class _i{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 Ci(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=h.useState(r.state),[o,l]=h.useState(),[c,d]=h.useState({isTransitioning:!1}),[m,p]=h.useState(),[b,w]=h.useState(),[P,E]=h.useState(),D=h.useRef(new Map),{v7_startTransition:k}=n||{},L=h.useCallback(N=>{k?Pi(N):N()},[k]),K=h.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(),E({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]);h.useLayoutEffect(()=>r.subscribe(K),[r,K]),h.useEffect(()=>{c.isTransitioning&&!c.flushSync&&p(new _i)},[c]),h.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]),h.useEffect(()=>{m&&o&&a.location.key===o.location.key&&m.resolve()},[m,b,a.location,o]),h.useEffect(()=>{!c.isTransitioning&&P&&(l(P.state),d({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),E(void 0))},[c.isTransitioning,P]),h.useEffect(()=>{},[]);let te=h.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||"/",he=h.useMemo(()=>({router:r,navigator:te,static:!1,basename:$}),[r,te,$]),v=h.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return h.useEffect(()=>hi(n,r.future),[n,r.future]),h.createElement(h.Fragment,null,h.createElement(jt.Provider,{value:he},h.createElement(en.Provider,{value:a},h.createElement(Si.Provider,{value:D.current},h.createElement(Ei.Provider,{value:c},h.createElement(pi,{basename:$,location:a.location,navigationType:a.historyAction,navigator:te,future:v},a.initialized||r.future.v7_partialHydration?h.createElement(Di,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Di=h.memo(Li);function Li(e){let{routes:t,future:r,state:n}=e;return ti(t,void 0,n,r)}var Or;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Or||(Or={}));var Ar;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ar||(Ar={}));function ji(e){let t=h.useRef(Wt(e)),r=h.useRef(!1),n=ht(),a=h.useMemo(()=>gi(n.search,r.current?null:t.current),[n.search]),i=er(),o=h.useCallback((l,c)=>{const d=Wt(typeof l=="function"?l(a):l);r.current=!0,i("?"+d,c)},[i,a]);return[a,o]}const Ni="desktop://window-lifecycle",Mi=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function Ii(e){return e instanceof HTMLInputElement?!Mi.has(e.type.toLowerCase()):!1}function Ui(e){const t=e.activeElement;if(Ii(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 Oi(e){const t=Ui(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 Ai(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 ki(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{}Ai(e,t)}function Fi(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=Oi(r);o&&(i.preventDefault(),ki(r,o,n))}return t.addEventListener("keydown",a,!0),()=>{t.removeEventListener("keydown",a,!0)}}const ln=h.createContext(null),Vi=["--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 zi(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 $t(){var e;if(!(typeof document>"u"))for(const t of Vi)document.documentElement.style.removeProperty(t),(e=document.body)==null||e.style.removeProperty(t)}function Bi(e){if(typeof document>"u")return;if(!e){$t();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 Hi(){if(!(typeof window>"u"))return window.innerWidth}function Wi({children:e}){const[t,r]=h.useState(()=>Hi()),n=h.useMemo(()=>lt({viewportWidth:t}),[t]);return h.useEffect(()=>{if(typeof window>"u")return;function a(){r(window.innerWidth)}return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[]),h.useEffect(()=>{zi(n)},[n]),h.useEffect(()=>{if(!(typeof window>"u"||typeof document>"u")&&!(!n.isDesktop||n.ui.osFamily!=="macos"||!n.bridge.supported))return Fi({window,document,writeClipboardText:async a=>(await n.bridge.writeClipboardText(a)).ok})},[n]),h.useEffect(()=>()=>{$t()},[]),h.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(Ni,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]),h.useEffect(()=>{let a=!1,i=null;async function o(){var c,d;const l=await n.bridge.getRuntimeInfo();a||Bi(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?($t(),()=>{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(ln.Provider,{value:n,children:e})}function tr(){return h.useContext(ln)??lt()}const zo=[{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 Bo(e){return it(e.labelKey)}function $i(){return typeof window>"u"||typeof window.matchMedia!="function"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function cn(e,t){return t?$i():e}function Ki(){const{theme:e,autoTheme:t}=An.getState().profile;return cn(e,t)}function Yi(e){Yt({theme:e,autoTheme:!1}).catch(()=>{})}function Gi(e){Yt({autoTheme:e}).catch(()=>{})}function un(e){typeof window>"u"||document.documentElement.setAttribute("data-theme",e)}function Ji(){const e=Je(n=>n.profile.theme),t=Je(n=>n.profile.autoTheme);return{theme:cn(e,t),selectedTheme:e,autoTheme:t,setTheme:Yi,setAutoTheme:Gi}}function Xi(){un(Ki())}function qi({children:e}){const t=Je(n=>n.profile.theme),r=Je(n=>n.profile.autoTheme);return h.useEffect(()=>{Xi()},[t,r]),h.useEffect(()=>{if(!r||typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{un(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 Qi={showToast:()=>"",dismissToast:()=>{}},dn=h.createContext(Qi);function Zi(){return`toast-${Math.random().toString(36).slice(2,10)}`}function eo({toast:e,onDismiss:t}){const{id:r,title:n,description:a,tone:i,durationMs:o,action:l}=e;return h.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 to({children:e}){const[t,r]=h.useState([]),n=h.useCallback(o=>{r(l=>l.filter(c=>c.id!==o))},[]),a=h.useCallback(o=>{const l=o.id??Zi(),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=h.useMemo(()=>({showToast:a,dismissToast:n}),[n,a]);return g.jsxs(dn.Provider,{value:i,children:[e,g.jsx("div",{className:"toast-viewport","aria-live":"polite","aria-atomic":"false",children:t.map(o=>g.jsx(eo,{toast:o,onDismiss:n},o.id))})]})}function Ho(){return h.useContext(dn)}const Pt="0.5.1",fn=h.createContext(Pt);function ro({children:e}){const t=tr(),[r,n]=h.useState(Pt);return h.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(fn.Provider,{value:r,children:e})}function no(){return h.useContext(fn)}const kr={latestState:null,lastNotifiedVersion:null,pendingRestartVersion:null};class ao{constructor(){Se(this,"state",kr);Se(this,"listeners",new Set);Se(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Se(this,"getState",()=>this.state)}recordState(t){const r=Ft(this.state.pendingRestartVersion),n=Ft(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=Ft(t);!r||this.state.pendingRestartVersion===r||(this.state={...this.state,pendingRestartVersion:r},this.emit())}reset(){this.state=kr,this.emit()}emit(){for(const t of this.listeners)t()}}const Xe=new ao;function Ft(e){const t=e==null?void 0:e.trim();return t||null}function io(e){return h.useSyncExternalStore(Xe.subscribe,()=>e(Xe.getState()))}function oo(){return Xe.getState()}function so(e){Xe.recordState(e)}function lo(e){Xe.markVersionNotified(e)}function co(e){Xe.markRestartPending(e)}async function uo(){const e=lt(),t=ye.getState(),r=await e.bridge.checkForUpdate(t.releaseChannel);if(!r.ok||!r.value)throw new Error(r.detail??"更新检查失败。");return r.value}async function fo(e={}){const t=e.notify??"never",r=await uo();return so(r),await ho(r,t),r}async function Wo(){const e=lt(),t=ye.getState();return e.bridge.installUpdate(t.releaseChannel)}function $o(e){co(e)}async function Ko(){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 ho(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=oo().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&&lo(r)}catch{}}const mo=3600*1e3;function po(){const e=Rt(a=>a.platform),t=Rt(a=>a.autoCheckUpdate),r=Rt(a=>a.releaseChannel),n=io(a=>a.pendingRestartVersion);return h.useEffect(()=>{if(e!=="desktop"||!t||n)return;async function a(){try{await fo({notify:"if-new"})}catch{}}a();const i=window.setInterval(()=>{a()},mo);return()=>{window.clearInterval(i)}},[t,n,e,r]),null}const hn="codingns.server.base-url.history",rr=6,mn="__custom__";function pn(){return typeof window<"u"&&typeof window.localStorage<"u"}function vn(){return typeof window>"u"||!window.location.origin?null:window.location.origin}function nr(e){if(!e)return null;try{return zr(e)}catch{return null}}function gn(){if(!pn())return[];const e=window.localStorage.getItem(hn);if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.map(r=>typeof r=="string"?nr(r):null).filter(r=>!!r):[]}catch{return[]}}function vo(e){const t=new Set,r=[];for(const n of e)!n||t.has(n)||(t.add(n),r.push(n));return r}function go(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 yo(e,t){const r=gn();return vo([e,...t,...r,nr(vn())]).slice(0,rr)}function bo(e){const t=Vt(e),r=gn().map(l=>({value:l,source:"history"})),n=nr(vn()),a=e.hosts.map(l=>({value:l.baseUrl,source:"saved"})),i=kn(e).map(l=>({value:l.baseUrl,source:"discovered"})),o=t?{value:t.baseUrl,source:Br(t)?"discovered":"saved"}:null;return go([o,...a,...i,...r,n?{value:n,source:"origin"}:null]).slice(0,rr)}function wo(e){pn()&&window.localStorage.setItem(hn,JSON.stringify(e.slice(0,rr)))}class xo{constructor(){Se(this,"state",this.createState(ye.getState()));Se(this,"listeners",new Set);Se(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Se(this,"getState",()=>this.state);ye.subscribe(()=>{const t=this.createState(ye.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=ye.getState(),n=Vt(r);if(!n)return!1;const a=zr(t),i=a!==n.baseUrl;if(Br(n))return ye.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(ye.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(),ye.update({hosts:o}),i}reset(){this.state=this.createState(ye.getState()),this.emit()}createState(t){const r=Vt(t),n=(r==null?void 0:r.baseUrl)??"",a=bo(t),i=yo(n,a.map(o=>o.value));return wo(i),{baseUrl:n,options:i,presetOptions:a}}emit(){for(const t of this.listeners)t()}}const Kt=new xo;function Eo(e){return h.useSyncExternalStore(Kt.subscribe,()=>e(Kt.getState()))}function Yo(e,t){return t.includes(e)?e:mn}function Go(){return mn}const So={login(e,t){return Et.login(e,t)},bootstrap(e,t,r){return Et.bootstrap(e,t,r)},refresh(){return Et.refresh()},logout(){Et.clear()}},Ro=h.lazy(async()=>({default:(await J(()=>import("./ServerSettingsModal-BYB0GvTl.js"),__vite__mapDeps([2,3,4,5]))).ServerSettingsModal})),Fr="width=device-width, initial-scale=1.0, viewport-fit=cover",To="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover";function Po(){const e=h.useRef(null);return h.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 _o({text:e}){return g.jsx("span",{className:"glitch-text","data-text":e,children:e})}function Co({text:e}){const[t,r]=h.useState(""),[n,a]=h.useState(!0);return h.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 Do(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 Lo(){const e=er(),t=Fn(),[r]=ji(),n=tr(),a=no(),i=Rt(V=>Vn(V)),o=zn(n.platform),l=h.useMemo(()=>Bn(n),[n]),c=h.useMemo(()=>l?Hn(i):{credentials:null,legacyServerBaseUrl:null},[i,l]),d=c.credentials,m=c.legacyServerBaseUrl,[p,b]=h.useState(()=>(d==null?void 0:d.username)??"admin"),[w,P]=h.useState(()=>(d==null?void 0:d.password)??""),[E,D]=h.useState(null),[k,L]=h.useState(""),[K,te]=h.useState(()=>!!d),$=Eo(V=>V.baseUrl),[he,v]=h.useState($),[N,F]=h.useState(null),[I,re]=h.useState(!1),[G,oe]=h.useState(!1),[ne,se]=h.useState(null),[He,We]=h.useState(!1),Q=Hr(V=>V.session),Te=h.useMemo(()=>r.get("returnTo")??"/",[r]),{theme:Pe}=Ji(),be=h.useRef(!1),ce=n.isNativeMobile,_e=h.useMemo(()=>Pe==="light"?"light":"dark",[Pe]);h.useEffect(()=>{b((d==null?void 0:d.username)??"admin"),P((d==null?void 0:d.password)??""),D(null),L(""),te(!!d)},[d]),h.useEffect(()=>{if(typeof document>"u")return;const V=document.querySelector('meta[name="viewport"]');if(!(V instanceof HTMLMetaElement))return;const de=V.getAttribute("content")??Fr;return ce?V.setAttribute("content",To):V.setAttribute("content",Fr),()=>{V.setAttribute("content",de)}},[ce]),h.useEffect(()=>{be.current||(be.current=!0,!(!l||!m||m===$)&&(Kt.setBaseUrl(m),v(m)))},[$,l,m]),h.useEffect(()=>{if(Q){e(Te,{replace:!0});return}if(!he)return;let V=!1;const de=window.setTimeout(()=>{J(async()=>{const{probeHost:H}=await import("./index-C2G8Gmf1.js").then(ve=>ve.U);return{probeHost:H}},__vite__mapDeps([3,4])).then(({probeHost:H})=>H(he)).then(H=>{V||(H.demoMode&&(We(!0),Wn()&&F(t("auth.demoSessionExpired"))),H.reachable&&!H.initialized&&e("/bootstrap",{replace:!0}))}).catch(()=>{V||F(t("auth.authUnavailable"))})},0);return()=>{V=!0,window.clearTimeout(de)}},[Q,e,he,Te,t]);async function Ie(V){V.preventDefault(),re(!0),F(null),v($),l&&!K&&i&&$n(i);try{const de=E?{username:p,password:w,captchaId:E.captchaId,captchaCode:k}:{username:p,password:w};await So.login(de,$),D(null),L("");const{userPreferenceStore:H}=await J(async()=>{const{userPreferenceStore:ve}=await import("./index-C2G8Gmf1.js").then(pt=>pt.T);return{userPreferenceStore:ve}},__vite__mapDeps([3,4]));await H.refreshForAuthenticatedUser(),l&&K&&i&&Kn({hostId:i,username:p,password:w}),e(Te,{replace:!0})}catch(de){if(de instanceof Yn){if(de.errorCode==="BOOTSTRAP_REQUIRED"){e("/bootstrap",{replace:!0});return}const H=Do(de.data);H?(D(H),L("")):de.errorCode==="INVALID_CREDENTIALS"&&(D(null),L("")),F(de.message)}else F(t("auth.authUnavailable"))}finally{re(!1)}}function ue(V){b(V),E&&(D(null),L(""))}function we(V){v(V),F(null)}const pe="login-username",Ue="login-password",mt="login-captcha";return g.jsxs("main",{className:"cyber-login-page","data-theme":_e,"data-native-mobile":ce?"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(Po,{})]}),g.jsx("div",{className:"scanlines"}),g.jsxs("div",{className:"cyber-login-container",children:[g.jsx("div",{className:"cyber-login-toolbar",children:g.jsx(Qn,{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(_o,{text:"CodingNS"})}),g.jsx("p",{className:"cyber-brand-subtitle",children:g.jsx(Co,{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:pe,children:[g.jsx("span",{className:"cyber-field-icon",children:"❯"}),t("auth.username")]}),g.jsx("input",{id:pe,"aria-label":t("auth.username"),className:"cyber-input",value:p,onChange:V=>ue(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"})]}),E?g.jsxs("div",{className:"cyber-captcha-panel",children:[g.jsx("img",{alt:t("auth.captchaImageAlt"),className:"cyber-captcha-image",draggable:!1,src:E.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(h.Suspense,{fallback:null,children:g.jsx(Ro,{isOpen:G,onClose:()=>oe(!1),onSave:we})}):null]})}function jo({isDesktop:e,viewportClass:t}){return e||t==="expanded"?"desktop":"mobile"}function No({runtimeKey:e,children:t}){return g.jsx("div",{children:t},e)}function Mo(){const e=Gn();return g.jsx(No,{runtimeKey:e,children:g.jsx(mi,{})})}function Io(){const e=Hr(r=>r.session),t=ht();if(!e){const r=`${t.pathname}${t.search}`;return g.jsx(sn,{to:`/login?returnTo=${encodeURIComponent(r)}`,replace:!0})}return g.jsx(Mo,{})}function Vr(){const e=tr(),t=jo(e);return g.jsx(sn,{to:t==="mobile"?"/workspaces":"/landing",replace:!0})}function ae(e,t){return async()=>({Component:(await e())[t]})}const Uo=[{path:"/bootstrap",lazy:ae(()=>J(()=>import("./BootstrapPage--zExdgfM.js"),__vite__mapDeps([6,3,4])),"BootstrapPage")},{path:"/login",element:g.jsx(Lo,{})},{path:"/desktop-window-preview",lazy:ae(()=>J(()=>import("./DesktopDetachPreviewPage-DvI9CIKi.js"),__vite__mapDeps([7,3,4])),"DesktopDetachPreviewPage")},{path:"/",element:g.jsx(Io,{}),children:[{path:"desktop-window/:windowId",lazy:ae(()=>J(()=>import("./DesktopWindowPage-D8FpOSLE.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-Cerk5uK7.js"),__vite__mapDeps([22,3,4,11,9,0,1,5,23])),"WorkbenchShellRoute"),children:[{index:!0,element:g.jsx(Vr,{})},{path:"landing",lazy:ae(()=>J(()=>import("./WorkbenchLandingPage-DZPk4SmX.js"),__vite__mapDeps([24,3,4,11,9,0,1,5])),"WorkbenchLandingPage")},{path:"workspaces",lazy:ae(()=>J(()=>import("./WorkspaceHomePage-BoiLuACV.js"),__vite__mapDeps([25,3,4,11,9,0,1,5,26,19,20,27])),"WorkspaceHomePage")},{path:"workspaces/:workspaceId",lazy:ae(()=>J(()=>import("./WorkspaceDetailPage-DNAa8pKr.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-Bcq8s-Ma.js"),__vite__mapDeps([30,3,4,29,9,16,11,0,1,5])),"WorkspaceDebugDetailPage")},{path:"workspaces/:workspaceId/sessions",lazy:ae(()=>J(()=>import("./SessionIndexPage-CR3IARXX.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-D9pzRmOg.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-CjF3CWzR.js"),__vite__mapDeps([36,3,4,11,9,0,1,5])),"ToolsHomePage")},{path:"workspaces/:workspaceId/tools/files",lazy:ae(()=>J(()=>import("./ToolFilesPage-Qzkc6K2I.js"),__vite__mapDeps([37,3,4,11,9,0,1,5])),"ToolFilesPage")},{path:"workspaces/:workspaceId/tools/git",lazy:ae(()=>J(()=>import("./ToolGitPage-BdNDN-cV.js"),__vite__mapDeps([38,3,4,11,9,0,1,5])),"ToolGitPage")},{path:"workspaces/:workspaceId/tools/processes",lazy:ae(()=>J(()=>import("./ToolProcessesPage-EXJ9DHWI.js"),__vite__mapDeps([39,3,4,11,9,0,1,5])),"ToolProcessesPage")},{path:"workspaces/:workspaceId/terminals",lazy:ae(()=>J(()=>import("./TerminalPage-CvnHXBhw.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-SffCV4Vb.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-B_BQtnwE.js"),__vite__mapDeps([42,3,4,9,5,20])),"SettingsPage")},{path:"settings/:section",lazy:ae(()=>J(()=>import("./SettingsPage-B_BQtnwE.js"),__vite__mapDeps([42,3,4,9,5,20])),"SettingsPage")},{path:"*",element:g.jsx(Vr,{})}]}]}];function Oo(){return bi(Uo)}function Ao(){const e=Je(r=>r.profile.language),t=h.useMemo(()=>Oo(),[]);return g.jsx(Wi,{children:g.jsx(ro,{children:g.jsx(Jn,{language:e,children:g.jsx(qi,{children:g.jsxs(to,{children:[g.jsx(po,{}),g.jsx(Ci,{router:t})]})})})})})}const Jo=Object.freeze(Object.defineProperty({__proto__:null,App:Ao},Symbol.toStringTag,{value:"Module"}));export{Jo as A,Qn as L,sn as N,mi as O,zo as T,Eo as a,So as b,Vo as c,tr as d,Ho as e,Wr as f,ht as g,io as h,Ji as i,fo as j,Wo as k,$o as l,yr as m,Ko as n,no as o,Bo as p,Yo as q,jo as r,Go as s,Kt as t,er as u};
|