@codeyam/codeyam-cli 0.1.28 → 0.1.29

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.
Files changed (92) hide show
  1. package/analyzer-template/.build-info.json +6 -6
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +1 -1
  4. package/analyzer-template/packages/aws/package.json +5 -5
  5. package/codeyam-cli/src/commands/editor.js +213 -5
  6. package/codeyam-cli/src/commands/editor.js.map +1 -1
  7. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +136 -0
  8. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  9. package/codeyam-cli/src/utils/__tests__/editorRoadmap.test.js +398 -0
  10. package/codeyam-cli/src/utils/__tests__/editorRoadmap.test.js.map +1 -0
  11. package/codeyam-cli/src/utils/designSystemShowcase.js +810 -0
  12. package/codeyam-cli/src/utils/designSystemShowcase.js.map +1 -0
  13. package/codeyam-cli/src/utils/editorAudit.js +6 -1
  14. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  15. package/codeyam-cli/src/utils/editorRoadmap.js +301 -0
  16. package/codeyam-cli/src/utils/editorRoadmap.js.map +1 -0
  17. package/codeyam-cli/src/utils/editorScenarios.js +10 -0
  18. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  19. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js +1 -0
  20. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js.map +1 -1
  21. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CLe80MMu.js → CopyButton-DTBZZfSk.js} +1 -1
  22. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-Crt_KN_U.js → EntityItem-BxclONWq.js} +1 -1
  23. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CD7lGABo.js → EntityTypeIcon-BsnEOJZ_.js} +1 -1
  24. package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-CgTNOhnu.js → InlineSpinner-ByaELMbv.js} +1 -1
  25. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-DtYTSPL2.js → InteractivePreview-6WjVfhxX.js} +2 -2
  26. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-D3s1MFkb.js → LibraryFunctionPreview-ChX-Hp7W.js} +1 -1
  27. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CM5zg40N.js → LogViewer-C-9zQdXg.js} +1 -1
  28. package/codeyam-cli/src/webserver/build/client/assets/{MiniClaudeChat-CQENLSrF.js → MiniClaudeChat-BusrvT2F.js} +1 -1
  29. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-C2PLkej3.js → ReportIssueModal-DQsceHVv.js} +1 -1
  30. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DanvyBPb.js → SafeScreenshot-DThcm_9M.js} +1 -1
  31. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CefgqbCr.js → ScenarioViewer-Cl4oOA3A.js} +1 -1
  32. package/codeyam-cli/src/webserver/build/client/assets/{Spinner-Bc8BG-Lw.js → Spinner-CIil5-gb.js} +1 -1
  33. package/codeyam-cli/src/webserver/build/client/assets/{ViewportInspectBar-BA_Ry-rs.js → ViewportInspectBar-BqkA9zyZ.js} +1 -1
  34. package/codeyam-cli/src/webserver/build/client/assets/{_index-C1YkzTAV.js → _index-DnOgyseQ.js} +1 -1
  35. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-yH46LLUz.js → activity.(_tab)-DqM9hbNE.js} +1 -1
  36. package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-CHx25PAe.js → addon-web-links-C58dYPwR.js} +1 -1
  37. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-Bg3e7q4S.js → agent-transcripts-B8NCeOrm.js} +1 -1
  38. package/codeyam-cli/src/webserver/build/client/assets/api.editor-roadmap-l0sNRNKZ.js +1 -0
  39. package/codeyam-cli/src/webserver/build/client/assets/{book-open-CL-lMgHh.js → book-open-BFSIqZgO.js} +1 -1
  40. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-GmAjGS9-.js → chevron-down-B9fDzFVh.js} +1 -1
  41. package/codeyam-cli/src/webserver/build/client/assets/chunk-UVKPFVEO-Bmq2apuh.js +43 -0
  42. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DFcQkN5j.js → circle-check-DLPObLUx.js} +1 -1
  43. package/codeyam-cli/src/webserver/build/client/assets/{copy-C6iF61Xs.js → copy-DXEmO0TD.js} +1 -1
  44. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-4ImjHTVC.js → createLucideIcon-BwyFiRot.js} +1 -1
  45. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-CRepiabR.js → dev.empty-iRhRIFlp.js} +1 -1
  46. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-BZPBzV73.js +1 -0
  47. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-785deXbZ.js +147 -0
  48. package/codeyam-cli/src/webserver/build/client/assets/{editorPreview-CluPkvXJ.js → editorPreview-C6fEYHrh.js} +6 -6
  49. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-DYJRGiDI.js → entity._sha._-Ce1s4OQ1.js} +1 -1
  50. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-wdiwx5-Z.js → entity._sha.scenarios._scenarioId.dev-C8AyYgYT.js} +1 -1
  51. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-BrkN-40Y.js → entity._sha.scenarios._scenarioId.fullscreen-DziaVQX1.js} +1 -1
  52. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-DxfhekTZ.js → entity._sha_.create-scenario-BTcpgIpC.js} +1 -1
  53. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CRXJWmpB.js → entity._sha_.edit._scenarioId-D_O_ajfZ.js} +1 -1
  54. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-SuW9syRS.js → entry.client-j1Vi0bco.js} +6 -6
  55. package/codeyam-cli/src/webserver/build/client/assets/{files-D-xGrg29.js → files-kuny2Q_s.js} +1 -1
  56. package/codeyam-cli/src/webserver/build/client/assets/{git-Bq_fbXP5.js → git-DgCZPMie.js} +1 -1
  57. package/codeyam-cli/src/webserver/build/client/assets/globals-Bt7TsgQz.css +1 -0
  58. package/codeyam-cli/src/webserver/build/client/assets/{index-Bp1l4hSv.js → index-BliGSSpl.js} +1 -1
  59. package/codeyam-cli/src/webserver/build/client/assets/{index-DE3jI_dv.js → index-SqjQKTdH.js} +1 -1
  60. package/codeyam-cli/src/webserver/build/client/assets/{index-CWV9XZiG.js → index-vyrZD2g4.js} +1 -1
  61. package/codeyam-cli/src/webserver/build/client/assets/{labs-B_IX45ih.js → labs-c3yLxSEp.js} +1 -1
  62. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-De-7qQ2u.js → loader-circle-D-q28GLF.js} +1 -1
  63. package/codeyam-cli/src/webserver/build/client/assets/manifest-3d8cde80.js +1 -0
  64. package/codeyam-cli/src/webserver/build/client/assets/{memory-Cx2xEx7s.js → memory-CEWIUC4t.js} +1 -1
  65. package/codeyam-cli/src/webserver/build/client/assets/{pause-CFxEKL1u.js → pause-BP6fitdh.js} +1 -1
  66. package/codeyam-cli/src/webserver/build/client/assets/{root-dKFRTYcy.js → root-CVjDQwjJ.js} +6 -6
  67. package/codeyam-cli/src/webserver/build/client/assets/{search-BdBb5aqc.js → search-BooqacKS.js} +1 -1
  68. package/codeyam-cli/src/webserver/build/client/assets/{settings-DdE-Untf.js → settings-BM0nbryO.js} +1 -1
  69. package/codeyam-cli/src/webserver/build/client/assets/{simulations-DSCdE99u.js → simulations-ovy6FjRY.js} +1 -1
  70. package/codeyam-cli/src/webserver/build/client/assets/{terminal-CrplD4b1.js → terminal-DHemCJIs.js} +1 -1
  71. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DqJ0j69l.js → triangle-alert-D87ekDl8.js} +1 -1
  72. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-DhXHbEjP.js → useCustomSizes-Dk0Tciqg.js} +1 -1
  73. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-D9QZKaLJ.js → useLastLogLine-C8QvIe05.js} +1 -1
  74. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-Cy5Qg_UR.js → useReportContext-jkCytuYz.js} +1 -1
  75. package/codeyam-cli/src/webserver/build/client/assets/{useToast-5HR2j9ZE.js → useToast-BgqkixU9.js} +1 -1
  76. package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-OLsM110H.js → analysisRunner-CTJYMVFP.js} +1 -1
  77. package/codeyam-cli/src/webserver/build/server/assets/{index-WHdB6WTN.js → index-CCth4Hgw.js} +1 -1
  78. package/codeyam-cli/src/webserver/build/server/assets/{init-DbSiZoE6.js → init-UXl-3vVp.js} +1 -1
  79. package/codeyam-cli/src/webserver/build/server/assets/{server-build-DZbLY6O_.js → server-build-DSW2mE30.js} +198 -147
  80. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  81. package/codeyam-cli/src/webserver/build-info.json +5 -5
  82. package/codeyam-cli/src/webserver/server.js +67 -0
  83. package/codeyam-cli/src/webserver/server.js.map +1 -1
  84. package/codeyam-cli/src/webserver/terminalServer.js +21 -0
  85. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  86. package/codeyam-cli/templates/editor-step-hook.py +4 -4
  87. package/package.json +1 -1
  88. package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BAdwhyCx.js +0 -43
  89. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +0 -1
  90. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-CRxPi2BB.js +0 -96
  91. package/codeyam-cli/src/webserver/build/client/assets/globals-BsGHu8WX.css +0 -1
  92. package/codeyam-cli/src/webserver/build/client/assets/manifest-9032538f.js +0 -1
@@ -0,0 +1,43 @@
1
+ function Jn(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(a,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ss=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kt={exports:{}},Y={};/**
2
+ * @license React
3
+ * react.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Vr;function Kn(){if(Vr)return Y;Vr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),m=Symbol.iterator;function g(p){return p===null||typeof p!="object"?null:(p=m&&p[m]||p["@@iterator"],typeof p=="function"?p:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function P(p,S,F){this.props=p,this.context=S,this.refs=w,this.updater=F||R}P.prototype.isReactComponent={},P.prototype.setState=function(p,S){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,S,"setState")},P.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function C(){}C.prototype=P.prototype;function D(p,S,F){this.props=p,this.context=S,this.refs=w,this.updater=F||R}var I=D.prototype=new C;I.constructor=D,b(I,P.prototype),I.isPureReactComponent=!0;var x=Array.isArray;function _(){}var T={H:null,A:null,T:null,S:null},v=Object.prototype.hasOwnProperty;function B(p,S,F){var $=F.ref;return{$$typeof:e,type:p,key:S,ref:$!==void 0?$:null,props:F}}function U(p,S){return B(p.type,S,p.props)}function oe(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function G(p){var S={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(F){return S[F]})}var ie=/\/+/g;function q(p,S){return typeof p=="object"&&p!==null&&p.key!=null?G(""+p.key):S.toString(36)}function ae(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(_,_):(p.status="pending",p.then(function(S){p.status==="pending"&&(p.status="fulfilled",p.value=S)},function(S){p.status==="pending"&&(p.status="rejected",p.reason=S)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function K(p,S,F,$,W){var J=typeof p;(J==="undefined"||J==="boolean")&&(p=null);var ee=!1;if(p===null)ee=!0;else switch(J){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(p.$$typeof){case e:case t:ee=!0;break;case h:return ee=p._init,K(ee(p._payload),S,F,$,W)}}if(ee)return W=W(p),ee=$===""?"."+q(p,0):$,x(W)?(F="",ee!=null&&(F=ee.replace(ie,"$&/")+"/"),K(W,S,F,"",function(Wt){return Wt})):W!=null&&(oe(W)&&(W=U(W,F+(W.key==null||p&&p.key===W.key?"":(""+W.key).replace(ie,"$&/")+"/")+ee)),S.push(W)),1;ee=0;var ye=$===""?".":$+":";if(x(p))for(var ue=0;ue<p.length;ue++)$=p[ue],J=ye+q($,ue),ee+=K($,S,F,J,W);else if(ue=g(p),typeof ue=="function")for(p=ue.call(p),ue=0;!($=p.next()).done;)$=$.value,J=ye+q($,ue++),ee+=K($,S,F,J,W);else if(J==="object"){if(typeof p.then=="function")return K(ae(p),S,F,$,W);throw S=String(p),Error("Objects are not valid as a React child (found: "+(S==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":S)+"). If you meant to render a collection of children, use an array instead.")}return ee}function Z(p,S,F){if(p==null)return p;var $=[],W=0;return K(p,$,"","",function(J){return S.call(F,J,W++)}),$}function we(p){if(p._status===-1){var S=p._result;S=S(),S.then(function(F){(p._status===0||p._status===-1)&&(p._status=1,p._result=F)},function(F){(p._status===0||p._status===-1)&&(p._status=2,p._result=F)}),p._status===-1&&(p._status=0,p._result=S)}if(p._status===1)return p._result.default;throw p._result}var re=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var S=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(S))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},de={map:Z,forEach:function(p,S,F){Z(p,function(){S.apply(this,arguments)},F)},count:function(p){var S=0;return Z(p,function(){S++}),S},toArray:function(p){return Z(p,function(S){return S})||[]},only:function(p){if(!oe(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return Y.Activity=c,Y.Children=de,Y.Component=P,Y.Fragment=r,Y.Profiler=n,Y.PureComponent=D,Y.StrictMode=a,Y.Suspense=s,Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Y.__COMPILER_RUNTIME={__proto__:null,c:function(p){return T.H.useMemoCache(p)}},Y.cache=function(p){return function(){return p.apply(null,arguments)}},Y.cacheSignal=function(){return null},Y.cloneElement=function(p,S,F){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var $=b({},p.props),W=p.key;if(S!=null)for(J in S.key!==void 0&&(W=""+S.key),S)!v.call(S,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&S.ref===void 0||($[J]=S[J]);var J=arguments.length-2;if(J===1)$.children=F;else if(1<J){for(var ee=Array(J),ye=0;ye<J;ye++)ee[ye]=arguments[ye+2];$.children=ee}return B(p.type,W,$)},Y.createContext=function(p){return p={$$typeof:i,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:o,_context:p},p},Y.createElement=function(p,S,F){var $,W={},J=null;if(S!=null)for($ in S.key!==void 0&&(J=""+S.key),S)v.call(S,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(W[$]=S[$]);var ee=arguments.length-2;if(ee===1)W.children=F;else if(1<ee){for(var ye=Array(ee),ue=0;ue<ee;ue++)ye[ue]=arguments[ue+2];W.children=ye}if(p&&p.defaultProps)for($ in ee=p.defaultProps,ee)W[$]===void 0&&(W[$]=ee[$]);return B(p,J,W)},Y.createRef=function(){return{current:null}},Y.forwardRef=function(p){return{$$typeof:l,render:p}},Y.isValidElement=oe,Y.lazy=function(p){return{$$typeof:h,_payload:{_status:-1,_result:p},_init:we}},Y.memo=function(p,S){return{$$typeof:u,type:p,compare:S===void 0?null:S}},Y.startTransition=function(p){var S=T.T,F={};T.T=F;try{var $=p(),W=T.S;W!==null&&W(F,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(_,re)}catch(J){re(J)}finally{S!==null&&F.types!==null&&(S.types=F.types),T.T=S}},Y.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Y.use=function(p){return T.H.use(p)},Y.useActionState=function(p,S,F){return T.H.useActionState(p,S,F)},Y.useCallback=function(p,S){return T.H.useCallback(p,S)},Y.useContext=function(p){return T.H.useContext(p)},Y.useDebugValue=function(){},Y.useDeferredValue=function(p,S){return T.H.useDeferredValue(p,S)},Y.useEffect=function(p,S){return T.H.useEffect(p,S)},Y.useEffectEvent=function(p){return T.H.useEffectEvent(p)},Y.useId=function(){return T.H.useId()},Y.useImperativeHandle=function(p,S,F){return T.H.useImperativeHandle(p,S,F)},Y.useInsertionEffect=function(p,S){return T.H.useInsertionEffect(p,S)},Y.useLayoutEffect=function(p,S){return T.H.useLayoutEffect(p,S)},Y.useMemo=function(p,S){return T.H.useMemo(p,S)},Y.useOptimistic=function(p,S){return T.H.useOptimistic(p,S)},Y.useReducer=function(p,S,F){return T.H.useReducer(p,S,F)},Y.useRef=function(p){return T.H.useRef(p)},Y.useState=function(p){return T.H.useState(p)},Y.useSyncExternalStore=function(p,S,F){return T.H.useSyncExternalStore(p,S,F)},Y.useTransition=function(){return T.H.useTransition()},Y.version="19.2.3",Y}var Jr;function Xn(){return Jr||(Jr=1,Kt.exports=Kn()),Kt.exports}var d=Xn();const qn=Gn(d),Qn=Jn({__proto__:null,default:qn},[d]);/**
10
+ * react-router v7.13.2
11
+ *
12
+ * Copyright (c) Remix Software Inc.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE.md file in the root directory of this source tree.
16
+ *
17
+ * @license MIT
18
+ */var xa=e=>{throw TypeError(e)},Zn=(e,t,r)=>t.has(e)||xa("Cannot "+r),Xt=(e,t,r)=>(Zn(e,t,"read from private field"),r?r.call(e):t.get(e)),eo=(e,t,r)=>t.has(e)?xa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Gr="popstate";function Kr(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function us(e={}){function t(a,n){var u;let o=(u=n.state)==null?void 0:u.masked,{pathname:i,search:l,hash:s}=o||a.location;return dt("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:Te(n)}return ro(t,r,null,e)}function V(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function se(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function to(){return Math.random().toString(36).substring(2,10)}function Xr(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function dt(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?_e(t):t,state:r,key:t&&t.key||a||to(),unstable_mask:n}}function Te({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function _e(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function ro(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function c(){l="POP";let w=h(),P=w==null?null:w-u;u=w,s&&s({action:l,location:b.location,delta:P})}function m(w,P){l="PUSH";let C=Kr(w)?w:dt(b.location,w,P);u=h()+1;let D=Xr(C,u),I=b.createHref(C.unstable_mask||C);try{i.pushState(D,"",I)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;n.location.assign(I)}o&&s&&s({action:l,location:b.location,delta:1})}function g(w,P){l="REPLACE";let C=Kr(w)?w:dt(b.location,w,P);u=h();let D=Xr(C,u),I=b.createHref(C.unstable_mask||C);i.replaceState(D,"",I),o&&s&&s({action:l,location:b.location,delta:0})}function R(w){return Pa(w)}let b={get action(){return l},get location(){return e(n,i)},listen(w){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Gr,c),s=w,()=>{n.removeEventListener(Gr,c),s=null}},createHref(w){return t(n,w)},createURL:R,encodeLocation(w){let P=R(w);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:m,replace:g,go(w){return i.go(w)}};return b}function Pa(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),V(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Te(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var st,qr=class{constructor(e){if(eo(this,st,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Xt(this,st).has(e))return Xt(this,st).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Xt(this,st).set(e,t)}};st=new WeakMap;var ao=new Set(["lazy","caseSensitive","path","id","index","children"]);function no(e){return ao.has(e)}var oo=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function io(e){return oo.has(e)}function lo(e){return e.index===!0}function ft(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let l=[...r,String(i)],s=typeof o.id=="string"?o.id:l.join("-");if(V(o.index!==!0||!o.children,"Cannot specify children on an index route"),V(n||!a[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),lo(o)){let u={...o,id:s};return a[s]=Qr(u,t(u)),u}else{let u={...o,id:s,children:void 0};return a[s]=Qr(u,t(u)),o.children&&(u.children=ft(o.children,t,l,a,n)),u}})}function Qr(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ie(e,t,r="/"){return ut(e,t,r,!1)}function ut(e,t,r,a){let n=typeof t=="string"?_e(t):t,o=Se(n.pathname||"/",r);if(o==null)return null;let i=Ma(e);so(i);let l=null;for(let s=0;l==null&&s<i.length;++s){let u=wo(o);l=go(i[s],u,a)}return l}function Ta(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Ma(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(a)&&s)return;V(h.relativePath.startsWith(a),`Absolute route path "${h.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(a.length)}let c=Pe([a,h.relativePath]),m=r.concat(h);i.children&&i.children.length>0&&(V(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Ma(i.children,t,m,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:yo(c,i.index),routesMeta:m})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let u of _a(i.path))o(i,l,!0,u)}),t}function _a(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=_a(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function so(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:vo(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var uo=/^:[\w-]+$/,co=3,fo=2,ho=1,mo=10,po=-2,Zr=e=>e==="*";function yo(e,t){let r=e.split("/"),a=r.length;return r.some(Zr)&&(a+=po),t&&(a+=fo),r.filter(n=>!Zr(n)).reduce((n,o)=>n+(uo.test(o)?co:o===""?ho:mo),a)}function vo(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function go(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,h=o==="/"?t:t.slice(o.length)||"/",c=Ft({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},h),m=s.route;if(!c&&u&&r&&!a[a.length-1].route.index&&(c=Ft({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},h)),!c)return null;Object.assign(n,c.params),i.push({params:n,pathname:Pe([o,c.pathname]),pathnameBase:bo(Pe([o,c.pathnameBase])),route:m}),c.pathnameBase!=="/"&&(o=Pe([o,c.pathnameBase]))}return i}function Ft(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Da(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),l=n.slice(1);return{params:a.reduce((u,{paramName:h,isOptional:c},m)=>{if(h==="*"){let R=l[m]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=l[m];return c&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Da(e,t=!1,r=!0){se(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 a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,h)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let c=h.charAt(u+i.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function wo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return se(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Se(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Eo({basename:e,pathname:t}){return t==="/"?e:Pe([e,t])}var Oa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vr=e=>Oa.test(e);function Ro(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?_e(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=ea(r.substring(1),"/"):o=ea(r,t)):o=t,{pathname:o,search:So(a),hash:Lo(n)}}function ea(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function qt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 ka(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function gr(e){let t=ka(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Nt(e,t,r,a=!1){let n;typeof e=="string"?n=_e(e):(n={...e},V(!n.pathname||!n.pathname.includes("?"),qt("?","pathname","search",n)),V(!n.pathname||!n.pathname.includes("#"),qt("#","pathname","hash",n)),V(!n.search||!n.search.includes("#"),qt("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),c-=1;n.pathname=m.join("/")}l=c>=0?t[c]:"/"}let s=Ro(n,l),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||h)&&(s.pathname+="/"),s}var Pe=e=>e.join("/").replace(/\/\/+/g,"/"),bo=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),So=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Lo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Co=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function xo(e,t){return new Co(e,typeof t=="number"?{status:t}:t)}var Po=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,{...r,headers:a})},je=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ve(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Fa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ia(e,t){let r=e;if(typeof r!="string"||!Oa.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Fa)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=Se(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{se(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var $e=Symbol("Uninstrumented");function To(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(n=>n({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let l of i)o[l]&&r[l].push(o[l])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=Qe(r.lazy,t.lazy,()=>{});n&&(a.lazy=n)}if(typeof t.lazy=="object"){let n=t.lazy;["middleware","loader","action"].forEach(o=>{let i=n[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let s=Qe(l,i,()=>{});s&&(a.lazy=Object.assign(a.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let i=o[$e]??o,l=Qe(r[n],i,(...s)=>ta(s[0]));l&&(n==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[$e]=i,a[n]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[$e]??n,i=Qe(r.middleware,o,(...l)=>ta(l[0]));return i?(i[$e]=o,i):n})),a}function Mo(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(n){let o=Object.keys(n);for(let i of o)n[i]&&r[i].push(n[i])}})),r.navigate.length>0){let a=e.navigate[$e]??e.navigate,n=Qe(r.navigate,a,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Te(i):".",...ra(e,l??{})}});n&&(n[$e]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[$e]??e.fetch,n=Qe(r.fetch,a,(...o)=>{let[i,,l,s]=o;return{href:l??".",fetcherKey:i,...ra(e,s??{})}});n&&(n[$e]=a,e.fetch=n)}return e}function Qe(e,t,r){return e.length===0?null:async(...a)=>{let n=await Aa(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function Aa(e,t,r,a){let n=e[a],o;if(n){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Aa(e,t,r,a-1),o=await i,V(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(l,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await l(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function ta(e){let{request:t,context:r,params:a,unstable_pattern:n}=e;return{request:_o(t),params:{...a},unstable_pattern:n,context:Do(r)}}function ra(e,t){return{currentUrl:Te(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function _o(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Do(e){if(ko(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Oo=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ko(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Oo}var Na=["POST","PUT","PATCH","DELETE"],Fo=new Set(Na),Io=["GET",...Na],Ao=new Set(Io),$a=new Set([301,302,303,307,308]),No=new Set([307,308]),Qt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ja={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},$o=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ua="remix-router-transitions",Ha=Symbol("ResetLoaderData");function cs(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";V(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||$o,o=n;if(e.unstable_instrumentations){let f=e.unstable_instrumentations;o=y=>({...n(y),...To(f.map(E=>E.route).filter(Boolean),y)})}let i={},l=ft(e.routes,o,void 0,i),s,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let h=e.dataStrategy||Bo,c={unstable_passThroughRequests:!1,...e.future},m=null,g=new Set,R=null,b=null,w=null,P=e.hydrationData!=null,C=Ie(l,e.history.location,u),D=!1,I=null,x,_;if(C==null&&!e.patchRoutesOnNavigation){let f=Le(404,{pathname:e.history.location.pathname}),{matches:y,route:E}=Lt(l);x=!0,_=!x,C=y,I={[E.id]:f}}else if(C&&!e.hydrationData&&wt(C,l,e.history.location.pathname).active&&(C=null),C)if(C.some(f=>f.route.lazy))x=!1,_=!x;else if(!C.some(f=>wr(f.route)))x=!0,_=!x;else{let f=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null,E=C;if(y){let L=C.findIndex(M=>y[M.route.id]!==void 0);E=E.slice(0,L+1)}_=!1,x=!0,E.forEach(L=>{let M=za(L.route,f,y);_=_||M.renderFallback,x=x&&!M.shouldLoad})}else{x=!1,_=!x,C=[];let f=wt(null,l,e.history.location.pathname);f.active&&f.matches&&(D=!0,C=f.matches)}let T,v={historyAction:e.history.action,location:e.history.location,matches:C,initialized:x,renderFallback:_,navigation:Qt,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||I,fetchers:new Map,blockers:new Map},B="POP",U=null,oe=!1,G,ie=!1,q=new Map,ae=null,K=!1,Z=!1,we=new Set,re=new Map,de=0,p=-1,S=new Map,F=new Set,$=new Map,W=new Map,J=new Set,ee=new Map,ye,ue=null;function Wt(){if(m=e.history.listen(({action:f,location:y,delta:E})=>{if(ye){ye(),ye=void 0;return}se(ee.size===0||E!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let L=Hr({currentLocation:v.location,nextLocation:y,historyAction:f});if(L&&E!=null){let M=new Promise(j=>{ye=j});e.history.go(E*-1),gt(L,{state:"blocked",location:y,proceed(){gt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),M.then(()=>e.history.go(E))},reset(){let j=new Map(v.blockers);j.set(L,ot),he({blockers:j})}}),U==null||U.resolve(),U=null;return}return Ue(f,y)}),r){li(t,q);let f=()=>si(t,q);t.addEventListener("pagehide",f),ae=()=>t.removeEventListener("pagehide",f)}return v.initialized||Ue("POP",v.location,{initialHydration:!0}),T}function _n(){m&&m(),ae&&ae(),g.clear(),G&&G.abort(),v.fetchers.forEach((f,y)=>Vt(y)),v.blockers.forEach((f,y)=>Ur(y))}function Dn(f){return g.add(f),()=>g.delete(f)}function he(f,y={}){f.matches&&(f.matches=f.matches.map(M=>{let j=i[M.route.id],A=M.route;return A.element!==j.element||A.errorElement!==j.errorElement||A.hydrateFallbackElement!==j.hydrateFallbackElement?{...M,route:j}:M})),v={...v,...f};let E=[],L=[];v.fetchers.forEach((M,j)=>{M.state==="idle"&&(J.has(j)?E.push(j):L.push(j))}),J.forEach(M=>{!v.fetchers.has(M)&&!re.has(M)&&E.push(M)}),[...g].forEach(M=>M(v,{deletedFetchers:E,newErrors:f.errors??null,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),E.forEach(M=>Vt(M)),L.forEach(M=>v.fetchers.delete(M))}function Ke(f,y,{flushSync:E}={}){var z,N;let L=v.actionData!=null&&v.navigation.formMethod!=null&&pe(v.navigation.formMethod)&&v.navigation.state==="loading"&&((z=f.state)==null?void 0:z._isRedirect)!==!0,M;y.actionData?Object.keys(y.actionData).length>0?M=y.actionData:M=null:L?M=v.actionData:M=null;let j=y.loaderData?ha(v.loaderData,y.loaderData,y.matches||[],y.errors):v.loaderData,A=v.blockers;A.size>0&&(A=new Map(A),A.forEach((X,Q)=>A.set(Q,ot)));let H=K?!1:Br(f,y.matches||v.matches),k=oe===!0||v.navigation.formMethod!=null&&pe(v.navigation.formMethod)&&((N=f.state)==null?void 0:N._isRedirect)!==!0;s&&(l=s,s=void 0),K||B==="POP"||(B==="PUSH"?e.history.push(f,f.state):B==="REPLACE"&&e.history.replace(f,f.state));let O;if(B==="POP"){let X=q.get(v.location.pathname);X&&X.has(f.pathname)?O={currentLocation:v.location,nextLocation:f}:q.has(f.pathname)&&(O={currentLocation:f,nextLocation:v.location})}else if(ie){let X=q.get(v.location.pathname);X?X.add(f.pathname):(X=new Set([f.pathname]),q.set(v.location.pathname,X)),O={currentLocation:v.location,nextLocation:f}}he({...y,actionData:M,loaderData:j,historyAction:B,location:f,initialized:!0,renderFallback:!1,navigation:Qt,revalidation:"idle",restoreScrollPosition:H,preventScrollReset:k,blockers:A},{viewTransitionOpts:O,flushSync:E===!0}),B="POP",oe=!1,ie=!1,K=!1,Z=!1,U==null||U.resolve(),U=null,ue==null||ue.resolve(),ue=null}async function kr(f,y){if(U==null||U.resolve(),U=null,typeof f=="number"){U||(U=ya());let le=U.promise;return e.history.go(f),le}let E=or(v.location,v.matches,u,f,y==null?void 0:y.fromRouteId,y==null?void 0:y.relative),{path:L,submission:M,error:j}=aa(!1,E,y),A;y!=null&&y.unstable_mask&&(A={pathname:"",search:"",hash:"",...typeof y.unstable_mask=="string"?_e(y.unstable_mask):{...v.location.unstable_mask,...y.unstable_mask}});let H=v.location,k=dt(H,L,y&&y.state,void 0,A);k={...k,...e.history.encodeLocation(k)};let O=y&&y.replace!=null?y.replace:void 0,z="PUSH";O===!0?z="REPLACE":O===!1||M!=null&&pe(M.formMethod)&&M.formAction===v.location.pathname+v.location.search&&(z="REPLACE");let N=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,X=(y&&y.flushSync)===!0,Q=Hr({currentLocation:H,nextLocation:k,historyAction:z});if(Q){gt(Q,{state:"blocked",location:k,proceed(){gt(Q,{state:"proceeding",proceed:void 0,reset:void 0,location:k}),kr(f,y)},reset(){let le=new Map(v.blockers);le.set(Q,ot),he({blockers:le})}});return}await Ue(z,k,{submission:M,pendingError:j,preventScrollReset:N,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:X,callSiteDefaultShouldRevalidate:y&&y.unstable_defaultShouldRevalidate})}function On(){ue||(ue=ya()),Yt(),he({revalidation:"loading"});let f=ue.promise;return v.navigation.state==="submitting"?f:v.navigation.state==="idle"?(Ue(v.historyAction,v.location,{startUninterruptedRevalidation:!0}),f):(Ue(B||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation,enableViewTransition:ie===!0}),f)}async function Ue(f,y,E){G&&G.abort(),G=null,B=f,K=(E&&E.startUninterruptedRevalidation)===!0,Bn(v.location,v.matches),oe=(E&&E.preventScrollReset)===!0,ie=(E&&E.enableViewTransition)===!0;let L=s||l,M=E&&E.overrideNavigation,j=E!=null&&E.initialHydration&&v.matches&&v.matches.length>0&&!D?v.matches:Ie(L,y,u),A=(E&&E.flushSync)===!0;if(j&&v.initialized&&!Z&&qo(v.location,y)&&!(E&&E.submission&&pe(E.submission.formMethod))){Ke(y,{matches:j},{flushSync:A});return}let H=wt(j,L,y.pathname);if(H.active&&H.matches&&(j=H.matches),!j){let{error:fe,notFoundMatches:ve,route:ne}=Jt(y.pathname);Ke(y,{matches:ve,loaderData:{},errors:{[ne.id]:fe}},{flushSync:A});return}G=new AbortController;let k=qe(e.history,y,G.signal,E&&E.submission),O=e.getContext?await e.getContext():new qr,z;if(E&&E.pendingError)z=[Ne(j).route.id,{type:"error",error:E.pendingError}];else if(E&&E.submission&&pe(E.submission.formMethod)){let fe=await kn(k,y,E.submission,j,O,H.active,E&&E.initialHydration===!0,{replace:E.replace,flushSync:A});if(fe.shortCircuited)return;if(fe.pendingActionResult){let[ve,ne]=fe.pendingActionResult;if(be(ne)&&Ve(ne.error)&&ne.error.status===404){G=null,Ke(y,{matches:fe.matches,loaderData:{},errors:{[ve]:ne.error}});return}}j=fe.matches||j,z=fe.pendingActionResult,M=Zt(y,E.submission),A=!1,H.active=!1,k=qe(e.history,k.url,k.signal)}let{shortCircuited:N,matches:X,loaderData:Q,errors:le}=await Fn(k,y,j,O,H.active,M,E&&E.submission,E&&E.fetcherSubmission,E&&E.replace,E&&E.initialHydration===!0,A,z,E&&E.callSiteDefaultShouldRevalidate);N||(G=null,Ke(y,{matches:X||j,...ma(z),loaderData:Q,errors:le}))}async function kn(f,y,E,L,M,j,A,H={}){Yt();let k=oi(y,E);if(he({navigation:k},{flushSync:H.flushSync===!0}),j){let N=await Et(L,y.pathname,f.signal);if(N.type==="aborted")return{shortCircuited:!0};if(N.type==="error"){if(N.partialMatches.length===0){let{matches:Q,route:le}=Lt(l);return{matches:Q,pendingActionResult:[le.id,{type:"error",error:N.error}]}}let X=Ne(N.partialMatches).route.id;return{matches:N.partialMatches,pendingActionResult:[X,{type:"error",error:N.error}]}}else if(N.matches)L=N.matches;else{let{notFoundMatches:X,error:Q,route:le}=Jt(y.pathname);return{matches:X,pendingActionResult:[le.id,{type:"error",error:Q}]}}}let O,z=_t(L,y);if(!z.route.action&&!z.route.lazy)O={type:"error",error:Le(405,{method:f.method,pathname:y.pathname,routeId:z.route.id})};else{let N=Ze(o,i,f,y,L,z,A?[]:a,M),X=await rt(f,y,N,M,null);if(O=X[z.route.id],!O){for(let Q of L)if(X[Q.route.id]){O=X[Q.route.id];break}}if(f.signal.aborted)return{shortCircuited:!0}}if(Ye(O)){let N;return H&&H.replace!=null?N=H.replace:N=ca(O.response.headers.get("Location"),new URL(f.url),u,e.history)===v.location.pathname+v.location.search,await He(f,O,!0,{submission:E,replace:N}),{shortCircuited:!0}}if(be(O)){let N=Ne(L,z.route.id);return(H&&H.replace)!==!0&&(B="PUSH"),{matches:L,pendingActionResult:[N.route.id,O,z.route.id]}}return{matches:L,pendingActionResult:[z.route.id,O]}}async function Fn(f,y,E,L,M,j,A,H,k,O,z,N,X){let Q=j||Zt(y,A),le=A||H||pa(Q),fe=!K&&!O;if(M){if(fe){let me=Fr(N);he({navigation:Q,...me!==void 0?{actionData:me}:{}},{flushSync:z})}let te=await Et(E,y.pathname,f.signal);if(te.type==="aborted")return{shortCircuited:!0};if(te.type==="error"){if(te.partialMatches.length===0){let{matches:Xe,route:We}=Lt(l);return{matches:Xe,loaderData:{},errors:{[We.id]:te.error}}}let me=Ne(te.partialMatches).route.id;return{matches:te.partialMatches,loaderData:{},errors:{[me]:te.error}}}else if(te.matches)E=te.matches;else{let{error:me,notFoundMatches:Xe,route:We}=Jt(y.pathname);return{matches:Xe,loaderData:{},errors:{[We.id]:me}}}}let ve=s||l,{dsMatches:ne,revalidatingFetchers:Re}=na(f,L,o,i,e.history,v,E,le,y,O?[]:a,O===!0,Z,we,J,$,F,ve,u,e.patchRoutesOnNavigation!=null,N,X);if(p=++de,!e.dataStrategy&&!ne.some(te=>te.shouldLoad)&&!ne.some(te=>te.route.middleware&&te.route.middleware.length>0)&&Re.length===0){let te=$r();return Ke(y,{matches:E,loaderData:{},errors:N&&be(N[1])?{[N[0]]:N[1].error}:null,...ma(N),...te?{fetchers:new Map(v.fetchers)}:{}},{flushSync:z}),{shortCircuited:!0}}if(fe){let te={};if(!M){te.navigation=Q;let me=Fr(N);me!==void 0&&(te.actionData=me)}Re.length>0&&(te.fetchers=In(Re)),he(te,{flushSync:z})}Re.forEach(te=>{ke(te.key),te.controller&&re.set(te.key,te.controller)});let ze=()=>Re.forEach(te=>ke(te.key));G&&G.signal.addEventListener("abort",ze);let{loaderResults:at,fetcherResults:Ae}=await Ir(ne,Re,f,y,L);if(f.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",ze),Re.forEach(te=>re.delete(te.key));let Me=Ct(at);if(Me)return await He(f,Me.result,!0,{replace:k}),{shortCircuited:!0};if(Me=Ct(Ae),Me)return F.add(Me.key),await He(f,Me.result,!0,{replace:k}),{shortCircuited:!0};let{loaderData:Gt,errors:nt}=fa(v,E,at,N,Re,Ae);O&&v.errors&&(nt={...v.errors,...nt});let Be=$r(),Rt=jr(p),bt=Be||Rt||Re.length>0;return{matches:E,loaderData:Gt,errors:nt,...bt?{fetchers:new Map(v.fetchers)}:{}}}function Fr(f){if(f&&!be(f[1]))return{[f[0]]:f[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function In(f){return f.forEach(y=>{let E=v.fetchers.get(y.key),L=it(void 0,E?E.data:void 0);v.fetchers.set(y.key,L)}),new Map(v.fetchers)}async function An(f,y,E,L){ke(f);let M=(L&&L.flushSync)===!0,j=s||l,A=or(v.location,v.matches,u,E,y,L==null?void 0:L.relative),H=Ie(j,A,u),k=wt(H,j,A);if(k.active&&k.matches&&(H=k.matches),!H){Oe(f,y,Le(404,{pathname:A}),{flushSync:M});return}let{path:O,submission:z,error:N}=aa(!0,A,L);if(N){Oe(f,y,N,{flushSync:M});return}let X=e.getContext?await e.getContext():new qr,Q=(L&&L.preventScrollReset)===!0;if(z&&pe(z.formMethod)){await Nn(f,y,O,H,X,k.active,M,Q,z,L&&L.unstable_defaultShouldRevalidate);return}$.set(f,{routeId:y,path:O}),await $n(f,y,O,H,X,k.active,M,Q,z)}async function Nn(f,y,E,L,M,j,A,H,k,O){Yt(),$.delete(f);let z=v.fetchers.get(f);De(f,ii(k,z),{flushSync:A});let N=new AbortController,X=qe(e.history,E,N.signal,k);if(j){let ce=await Et(L,new URL(X.url).pathname,X.signal,f);if(ce.type==="aborted")return;if(ce.type==="error"){Oe(f,y,ce.error,{flushSync:A});return}else if(ce.matches)L=ce.matches;else{Oe(f,y,Le(404,{pathname:E}),{flushSync:A});return}}let Q=_t(L,E);if(!Q.route.action&&!Q.route.lazy){let ce=Le(405,{method:k.formMethod,pathname:E,routeId:y});Oe(f,y,ce,{flushSync:A});return}re.set(f,N);let le=de,fe=Ze(o,i,X,E,L,Q,a,M),ve=await rt(X,E,fe,M,f),ne=ve[Q.route.id];if(!ne){for(let ce of fe)if(ve[ce.route.id]){ne=ve[ce.route.id];break}}if(X.signal.aborted){re.get(f)===N&&re.delete(f);return}if(J.has(f)){if(Ye(ne)||be(ne)){De(f,Fe(void 0));return}}else{if(Ye(ne))if(re.delete(f),p>le){De(f,Fe(void 0));return}else return F.add(f),De(f,it(k)),He(X,ne,!1,{fetcherSubmission:k,preventScrollReset:H});if(be(ne)){Oe(f,y,ne.error);return}}let Re=v.navigation.location||v.location,ze=qe(e.history,Re,N.signal),at=s||l,Ae=v.navigation.state!=="idle"?Ie(at,v.navigation.location,u):v.matches;V(Ae,"Didn't find any matches after fetcher action");let Me=++de;S.set(f,Me);let Gt=it(k,ne.data);v.fetchers.set(f,Gt);let{dsMatches:nt,revalidatingFetchers:Be}=na(ze,M,o,i,e.history,v,Ae,k,Re,a,!1,Z,we,J,$,F,at,u,e.patchRoutesOnNavigation!=null,[Q.route.id,ne],O);Be.filter(ce=>ce.key!==f).forEach(ce=>{let St=ce.key,Yr=v.fetchers.get(St),Vn=it(void 0,Yr?Yr.data:void 0);v.fetchers.set(St,Vn),ke(St),ce.controller&&re.set(St,ce.controller)}),he({fetchers:new Map(v.fetchers)});let Rt=()=>Be.forEach(ce=>ke(ce.key));N.signal.addEventListener("abort",Rt);let{loaderResults:bt,fetcherResults:te}=await Ir(nt,Be,ze,Re,M);if(N.signal.aborted)return;if(N.signal.removeEventListener("abort",Rt),S.delete(f),re.delete(f),Be.forEach(ce=>re.delete(ce.key)),v.fetchers.has(f)){let ce=Fe(ne.data);v.fetchers.set(f,ce)}let me=Ct(bt);if(me)return He(ze,me.result,!1,{preventScrollReset:H});if(me=Ct(te),me)return F.add(me.key),He(ze,me.result,!1,{preventScrollReset:H});let{loaderData:Xe,errors:We}=fa(v,Ae,bt,void 0,Be,te);jr(Me),v.navigation.state==="loading"&&Me>p?(V(B,"Expected pending action"),G&&G.abort(),Ke(v.navigation.location,{matches:Ae,loaderData:Xe,errors:We,fetchers:new Map(v.fetchers)})):(he({errors:We,loaderData:ha(v.loaderData,Xe,Ae,We),fetchers:new Map(v.fetchers)}),Z=!1)}async function $n(f,y,E,L,M,j,A,H,k){let O=v.fetchers.get(f);De(f,it(k,O?O.data:void 0),{flushSync:A});let z=new AbortController,N=qe(e.history,E,z.signal);if(j){let ne=await Et(L,new URL(N.url).pathname,N.signal,f);if(ne.type==="aborted")return;if(ne.type==="error"){Oe(f,y,ne.error,{flushSync:A});return}else if(ne.matches)L=ne.matches;else{Oe(f,y,Le(404,{pathname:E}),{flushSync:A});return}}let X=_t(L,E);re.set(f,z);let Q=de,le=Ze(o,i,N,E,L,X,a,M),ve=(await rt(N,E,le,M,f))[X.route.id];if(re.get(f)===z&&re.delete(f),!N.signal.aborted){if(J.has(f)){De(f,Fe(void 0));return}if(Ye(ve))if(p>Q){De(f,Fe(void 0));return}else{F.add(f),await He(N,ve,!1,{preventScrollReset:H});return}if(be(ve)){Oe(f,y,ve.error);return}De(f,Fe(ve.data))}}async function He(f,y,E,{submission:L,fetcherSubmission:M,preventScrollReset:j,replace:A}={}){E||(U==null||U.resolve(),U=null),y.response.headers.has("X-Remix-Revalidate")&&(Z=!0);let H=y.response.headers.get("Location");V(H,"Expected a Location header on the redirect Response"),H=ca(H,new URL(f.url),u,e.history);let k=dt(v.location,H,{_isRedirect:!0});if(r){let le=!1;if(y.response.headers.has("X-Remix-Reload-Document"))le=!0;else if(vr(H)){const fe=Pa(H,!0);le=fe.origin!==t.location.origin||Se(fe.pathname,u)==null}if(le){A?t.location.replace(H):t.location.assign(H);return}}G=null;let O=A===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:z,formAction:N,formEncType:X}=v.navigation;!L&&!M&&z&&N&&X&&(L=pa(v.navigation));let Q=L||M;if(No.has(y.response.status)&&Q&&pe(Q.formMethod))await Ue(O,k,{submission:{...Q,formAction:H},preventScrollReset:j||oe,enableViewTransition:E?ie:void 0});else{let le=Zt(k,L);await Ue(O,k,{overrideNavigation:le,fetcherSubmission:M,preventScrollReset:j||oe,enableViewTransition:E?ie:void 0})}}async function rt(f,y,E,L,M){var H;let j,A={};try{j=await Yo(h,f,y,E,M,L,!1)}catch(k){return E.filter(O=>O.shouldLoad).forEach(O=>{A[O.route.id]={type:"error",error:k}}),A}if(f.signal.aborted)return A;if(!pe(f.method))for(let k of E){if(((H=j[k.route.id])==null?void 0:H.type)==="error")break;!j.hasOwnProperty(k.route.id)&&!v.loaderData.hasOwnProperty(k.route.id)&&(!v.errors||!v.errors.hasOwnProperty(k.route.id))&&k.shouldCallHandler()&&(j[k.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${k.route.id}`)})}for(let[k,O]of Object.entries(j))if(ti(O)){let z=O.result;A[k]={type:"redirect",response:Ko(z,f,k,E,u)}}else A[k]=await Go(O);return A}async function Ir(f,y,E,L,M){let j=rt(E,L,f,M,null),A=Promise.all(y.map(async O=>{if(O.matches&&O.match&&O.request&&O.controller){let N=(await rt(O.request,O.path,O.matches,M,O.key))[O.match.route.id];return{[O.key]:N}}else return Promise.resolve({[O.key]:{type:"error",error:Le(404,{pathname:O.path})}})})),H=await j,k=(await A).reduce((O,z)=>Object.assign(O,z),{});return{loaderResults:H,fetcherResults:k}}function Yt(){Z=!0,$.forEach((f,y)=>{re.has(y)&&we.add(y),ke(y)})}function De(f,y,E={}){v.fetchers.set(f,y),he({fetchers:new Map(v.fetchers)},{flushSync:(E&&E.flushSync)===!0})}function Oe(f,y,E,L={}){let M=Ne(v.matches,y);Vt(f),he({errors:{[M.route.id]:E},fetchers:new Map(v.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function Ar(f){return W.set(f,(W.get(f)||0)+1),J.has(f)&&J.delete(f),v.fetchers.get(f)||ja}function jn(f,y){ke(f,y==null?void 0:y.reason),De(f,Fe(null))}function Vt(f){let y=v.fetchers.get(f);re.has(f)&&!(y&&y.state==="loading"&&S.has(f))&&ke(f),$.delete(f),S.delete(f),F.delete(f),J.delete(f),we.delete(f),v.fetchers.delete(f)}function Un(f){let y=(W.get(f)||0)-1;y<=0?(W.delete(f),J.add(f)):W.set(f,y),he({fetchers:new Map(v.fetchers)})}function ke(f,y){let E=re.get(f);E&&(E.abort(y),re.delete(f))}function Nr(f){for(let y of f){let E=Ar(y),L=Fe(E.data);v.fetchers.set(y,L)}}function $r(){let f=[],y=!1;for(let E of F){let L=v.fetchers.get(E);V(L,`Expected fetcher: ${E}`),L.state==="loading"&&(F.delete(E),f.push(E),y=!0)}return Nr(f),y}function jr(f){let y=[];for(let[E,L]of S)if(L<f){let M=v.fetchers.get(E);V(M,`Expected fetcher: ${E}`),M.state==="loading"&&(ke(E),S.delete(E),y.push(E))}return Nr(y),y.length>0}function Hn(f,y){let E=v.blockers.get(f)||ot;return ee.get(f)!==y&&ee.set(f,y),E}function Ur(f){v.blockers.delete(f),ee.delete(f)}function gt(f,y){let E=v.blockers.get(f)||ot;V(E.state==="unblocked"&&y.state==="blocked"||E.state==="blocked"&&y.state==="blocked"||E.state==="blocked"&&y.state==="proceeding"||E.state==="blocked"&&y.state==="unblocked"||E.state==="proceeding"&&y.state==="unblocked",`Invalid blocker state transition: ${E.state} -> ${y.state}`);let L=new Map(v.blockers);L.set(f,y),he({blockers:L})}function Hr({currentLocation:f,nextLocation:y,historyAction:E}){if(ee.size===0)return;ee.size>1&&se(!1,"A router only supports one blocker at a time");let L=Array.from(ee.entries()),[M,j]=L[L.length-1],A=v.blockers.get(M);if(!(A&&A.state==="proceeding")&&j({currentLocation:f,nextLocation:y,historyAction:E}))return M}function Jt(f){let y=Le(404,{pathname:f}),E=s||l,{matches:L,route:M}=Lt(E);return{notFoundMatches:L,route:M,error:y}}function zn(f,y,E){if(R=f,w=y,b=E||null,!P&&v.navigation===Qt){P=!0;let L=Br(v.location,v.matches);L!=null&&he({restoreScrollPosition:L})}return()=>{R=null,w=null,b=null}}function zr(f,y){return b&&b(f,y.map(L=>Ta(L,v.loaderData)))||f.key}function Bn(f,y){if(R&&w){let E=zr(f,y);R[E]=w()}}function Br(f,y){if(R){let E=zr(f,y),L=R[E];if(typeof L=="number")return L}return null}function wt(f,y,E){if(e.patchRoutesOnNavigation)if(f){if(Object.keys(f[0].params).length>0)return{active:!0,matches:ut(y,E,u,!0)}}else return{active:!0,matches:ut(y,E,u,!0)||[]};return{active:!1,matches:null}}async function Et(f,y,E,L){if(!e.patchRoutesOnNavigation)return{type:"success",matches:f};let M=f;for(;;){let j=s==null,A=s||l,H=i;try{await e.patchRoutesOnNavigation({signal:E,path:y,matches:M,fetcherKey:L,patch:(z,N)=>{E.aborted||oa(z,N,A,H,o,!1)}})}catch(z){return{type:"error",error:z,partialMatches:M}}finally{j&&!E.aborted&&(l=[...l])}if(E.aborted)return{type:"aborted"};let k=Ie(A,y,u),O=null;if(k){if(Object.keys(k[0].params).length===0)return{type:"success",matches:k};if(O=ut(A,y,u,!0),!(O&&M.length<O.length&&Wr(M,O.slice(0,M.length))))return{type:"success",matches:k}}if(O||(O=ut(A,y,u,!0)),!O||Wr(M,O))return{type:"success",matches:null};M=O}}function Wr(f,y){return f.length===y.length&&f.every((E,L)=>E.route.id===y[L].route.id)}function Wn(f){i={},s=ft(f,o,void 0,i)}function Yn(f,y,E=!1){let L=s==null;oa(f,y,s||l,i,o,E),L&&(l=[...l],he({}))}return T={get basename(){return u},get future(){return c},get state(){return v},get routes(){return l},get window(){return t},initialize:Wt,subscribe:Dn,enableScrollRestoration:zn,navigate:kr,fetch:An,revalidate:On,createHref:f=>e.history.createHref(f),encodeLocation:f=>e.history.encodeLocation(f),getFetcher:Ar,resetFetcher:jn,deleteFetcher:Un,dispose:_n,getBlocker:Hn,deleteBlocker:Ur,patchRoutes:Yn,_internalFetchControllers:re,_internalSetRoutes:Wn,_internalSetStateDoNotUseOrYouWillBreakYourApp(f){he(f)}},e.unstable_instrumentations&&(T=Mo(T,e.unstable_instrumentations.map(f=>f.router).filter(Boolean))),T}function jo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function or(e,t,r,a,n,o){let i,l;if(n){i=[];for(let u of t)if(i.push(u),u.route.id===n){l=u;break}}else i=t,l=t[t.length-1];let s=Nt(a||".",gr(i),Se(e.pathname,r)||e.pathname,o==="path");if(a==null&&(s.search=e.search,s.hash=e.hash),(a==null||a===""||a===".")&&l){let u=Er(s.search);if(l.route.index&&!u)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let h=new URLSearchParams(s.search),c=h.getAll("index");h.delete("index"),c.filter(g=>g).forEach(g=>h.append("index",g));let m=h.toString();s.search=m?`?${m}`:""}}return r!=="/"&&(s.pathname=Eo({basename:r,pathname:s.pathname})),Te(s)}function aa(e,t,r){if(!r||!jo(r))return{path:t};if(r.formMethod&&!ni(r.formMethod))return{path:t,error:Le(405,{method:r.formMethod})};let a=()=>({path:t,error:Le(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Ka(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!pe(o))return a();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,[g,R])=>`${m}${g}=${R}
19
+ `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:c}}}else if(r.formEncType==="application/json"){if(!pe(o))return a();try{let c=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:c,text:void 0}}}catch{return a()}}}V(typeof FormData=="function","FormData is not available in this environment");let l,s;if(r.formData)l=lr(r.formData),s=r.formData;else if(r.body instanceof FormData)l=lr(r.body),s=r.body;else if(r.body instanceof URLSearchParams)l=r.body,s=da(l);else if(r.body==null)l=new URLSearchParams,s=new FormData;else try{l=new URLSearchParams(r.body),s=da(l)}catch{return a()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(pe(u.formMethod))return{path:t,submission:u};let h=_e(t);return e&&h.search&&Er(h.search)&&l.append("index",""),h.search=`?${l}`,{path:Te(h),submission:u}}function na(e,t,r,a,n,o,i,l,s,u,h,c,m,g,R,b,w,P,C,D,I){var ae;let x=D?be(D[1])?D[1].error:D[1].data:void 0,_=n.createURL(o.location),T=n.createURL(s),v;if(h&&o.errors){let K=Object.keys(o.errors)[0];v=i.findIndex(Z=>Z.route.id===K)}else if(D&&be(D[1])){let K=D[0];v=i.findIndex(Z=>Z.route.id===K)-1}let B=D?D[1].statusCode:void 0,U=B&&B>=400,oe={currentUrl:_,currentParams:((ae=o.matches[0])==null?void 0:ae.params)||{},nextUrl:T,nextParams:i[0].params,...l,actionResult:x,actionStatus:B},G=mt(i),ie=i.map((K,Z)=>{let{route:we}=K,re=null;if(v!=null&&Z>v)re=!1;else if(we.lazy)re=!0;else if(!wr(we))re=!1;else if(h){let{shouldLoad:F}=za(we,o.loaderData,o.errors);re=F}else Uo(o.loaderData,o.matches[Z],K)&&(re=!0);if(re!==null)return ir(r,a,e,s,G,K,u,t,re);let de=!1;typeof I=="boolean"?de=I:U?de=!1:(c||_.pathname+_.search===T.pathname+T.search||_.search!==T.search||Ho(o.matches[Z],K))&&(de=!0);let p={...oe,defaultShouldRevalidate:de},S=ct(K,p);return ir(r,a,e,s,G,K,u,t,S,p,I)}),q=[];return R.forEach((K,Z)=>{if(h||!i.some(W=>W.route.id===K.routeId)||g.has(Z))return;let we=o.fetchers.get(Z),re=we&&we.state!=="idle"&&we.data===void 0,de=Ie(w,K.path,P);if(!de){if(C&&re)return;q.push({key:Z,routeId:K.routeId,path:K.path,matches:null,match:null,request:null,controller:null});return}if(b.has(Z))return;let p=_t(de,K.path),S=new AbortController,F=qe(n,K.path,S.signal),$=null;if(m.has(Z))m.delete(Z),$=Ze(r,a,F,K.path,de,p,u,t);else if(re)c&&($=Ze(r,a,F,K.path,de,p,u,t));else{let W;typeof I=="boolean"?W=I:U?W=!1:W=c;let J={...oe,defaultShouldRevalidate:W};ct(p,J)&&($=Ze(r,a,F,K.path,de,p,u,t,J))}$&&q.push({key:Z,routeId:K.routeId,path:K.path,matches:$,match:p,request:F,controller:S})}),{dsMatches:ie,revalidatingFetchers:q}}function wr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function za(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!wr(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;if(!a&&n)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!n;return{shouldLoad:o,renderFallback:o}}function Uo(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function Ho(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ct(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function oa(e,t,r,a,n,o){let i;if(e){let u=a[e];V(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let l=[],s=[];if(t.forEach(u=>{let h=i.find(c=>Ba(u,c));h?s.push({existingRoute:h,newRoute:u}):l.push(u)}),l.length>0){let u=ft(l,n,[e||"_","patch",String((i==null?void 0:i.length)||"0")],a);i.push(...u)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:h,newRoute:c}=s[u],m=h,[g]=ft([c],n,[],{},!0);Object.assign(m,{element:g.element?g.element:m.element,errorElement:g.errorElement?g.errorElement:m.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:m.hydrateFallbackElement})}}function Ba(e,t){var r;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:((r=e.children)==null?void 0:r.every((a,n)=>{var o;return(o=t.children)==null?void 0:o.some(i=>Ba(a,i))}))??!1:!1}var ia=new WeakMap,Wa=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(V(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let i=ia.get(n);i||(i={},ia.set(n,i));let l=i[e];if(l)return l;let s=(async()=>{let u=no(e),c=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)se(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)se(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await o();m!=null&&(Object.assign(n,{[e]:m}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(m=>m===void 0)&&(n.lazy=void 0))})();return i[e]=s,s},la=new WeakMap;function zo(e,t,r,a,n){let o=r[e.id];if(V(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=la.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let c=(async()=>{V(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),g={};for(let R in m){let b=m[R];if(b===void 0)continue;let w=io(R),C=o[R]!==void 0&&R!=="hasErrorBoundary";w?se(!w,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):C?se(!C,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):g[R]=b}Object.assign(o,g),Object.assign(o,{...a(o),lazy:void 0})})();return la.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),l=[],s;for(let h of i){if(n&&n.includes(h))continue;let c=Wa({key:h,route:e,manifest:r,mapRouteProperties:a});c&&(l.push(c),h===t&&(s=c))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u==null||u.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:s}}async function sa(e){let t=e.matches.filter(n=>n.shouldLoad),r={};return(await Promise.all(t.map(n=>n.resolve()))).forEach((n,o)=>{r[t[o].route.id]=n}),r}async function Bo(e){return e.matches.some(t=>t.route.middleware)?Ya(e,()=>sa(e)):sa(e)}function Ya(e,t){return Wo(e,t,a=>{if(ai(a))throw a;return a},Zo,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===n),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),s=Ne(i,i[l].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:a}})}}}async function Wo(e,t,r,a,n){let{matches:o,...i}=e,l=o.flatMap(u=>u.route.middleware?u.route.middleware.map(h=>[u.route.id,h]):[]);return await Va(i,l,t,r,a,n)}async function Va(e,t,r,a,n,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let s=t[i];if(!s)return await r();let[u,h]=s,c,m=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await Va(e,t,r,a,n,o,i+1)},c.value}catch(g){return c={value:await o(g,u,c)},c.value}};try{let g=await h(e,m),R=g!=null?a(g):void 0;return n(R)?R:c?R??c.value:(c={value:await m()},c.value)}catch(g){return await o(g,u,c)}}function Ja(e,t,r,a,n){let o=Wa({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=zo(a.route,pe(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ir(e,t,r,a,n,o,i,l,s,u=null,h){let c=!1,m=Ja(e,t,r,o,i);return{...o,_lazyPromises:m,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler(g){return c=!0,u?typeof h=="boolean"?ct(o,{...u,defaultShouldRevalidate:h}):typeof g=="boolean"?ct(o,{...u,defaultShouldRevalidate:g}):ct(o,u):s},resolve(g){let{lazy:R,loader:b,middleware:w}=o.route,P=c||s||g&&!pe(r.method)&&(R||b),C=w&&w.length>0&&!b&&!R;return P&&(pe(r.method)||!C)?Vo({request:r,path:a,unstable_pattern:n,match:o,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:g,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Ze(e,t,r,a,n,o,i,l,s=null){return n.map(u=>u.route.id!==o.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:Ja(e,t,r,u,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ir(e,t,r,a,mt(n),u,i,l,!0,s))}async function Yo(e,t,r,a,n,o,i){a.some(h=>{var c;return(c=h._lazyPromises)==null?void 0:c.middleware})&&await Promise.all(a.map(h=>{var c;return(c=h._lazyPromises)==null?void 0:c.middleware}));let l={request:t,unstable_url:Ga(t,r),unstable_pattern:mt(a),params:a[0].params,context:o,matches:a},u=await e({...l,fetcherKey:n,runClientMiddleware:h=>{let c=l;return Ya(c,()=>h({...c,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(h=>{var c,m;return[(c=h._lazyPromises)==null?void 0:c.handler,(m=h._lazyPromises)==null?void 0:m.route]}))}catch{}return u}async function Vo({request:e,path:t,unstable_pattern:r,match:a,lazyHandlerPromise:n,lazyRoutePromise:o,handlerOverride:i,scopedContext:l}){let s,u,h=pe(e.method),c=h?"action":"loader",m=g=>{let R,b=new Promise((C,D)=>R=D);u=()=>R(),e.signal.addEventListener("abort",u);let w=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${c}" [routeId: ${a.route.id}]`)):g({request:e,unstable_url:Ga(e,t),unstable_pattern:r,params:a.params,context:l},...C!==void 0?[C]:[]),P=(async()=>{try{return{type:"data",result:await(i?i(D=>w(D)):w())}}catch(C){return{type:"error",result:C}}})();return Promise.race([P,b])};try{let g=h?a.route.action:a.route.loader;if(n||o)if(g){let R,[b]=await Promise.all([m(g).catch(w=>{R=w}),n,o]);if(R!==void 0)throw R;s=b}else{await n;let R=h?a.route.action:a.route.loader;if(R)[s]=await Promise.all([m(R),o]);else if(c==="action"){let b=new URL(e.url),w=b.pathname+b.search;throw Le(405,{method:e.method,pathname:w,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(g)s=await m(g);else{let R=new URL(e.url),b=R.pathname+R.search;throw Le(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return s}async function Jo(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Go(e){var a,n,o,i,l;let{result:t,type:r}=e;if($t(t)){let s;try{s=await Jo(t)}catch(u){return{type:"error",error:u}}return r==="error"?{type:"error",error:new je(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?sr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(n=t.init)!=null&&n.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Qo(t),statusCode:Ve(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ve(t)?t.status:void 0}:sr(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Ko(e,t,r,a,n){let o=e.headers.get("Location");if(V(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!vr(o)){let i=a.slice(0,a.findIndex(l=>l.route.id===r)+1);o=or(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}var ua=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ca(e,t,r,a){if(vr(e)){let n=e,o=n.startsWith("//")?new URL(t.protocol+n):new URL(n);if(ua.includes(o.protocol))throw new Error("Invalid redirect location");let i=Se(o.pathname,r)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}try{let n=a.createURL(e);if(ua.includes(n.protocol))throw new Error("Invalid redirect location")}catch{}return e}function qe(e,t,r,a){let n=e.createURL(Ka(t)).toString(),o={signal:r};if(a&&pe(a.formMethod)){let{formMethod:i,formEncType:l}=a;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(a.json)):l==="text/plain"?o.body=a.text:l==="application/x-www-form-urlencoded"&&a.formData?o.body=lr(a.formData):o.body=a.formData}return new Request(n,o)}function Ga(e,t){let r=new URL(e.url),a=typeof t=="string"?_e(t):t;if(r.pathname=a.pathname||"/",a.search){let n=new URLSearchParams(a.search),o=n.getAll("index");n.delete("index");for(let i of o.filter(Boolean))n.append("index",i);r.search=n.size?`?${n.toString()}`:""}else r.search="";return r.hash=a.hash||"",r}function lr(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function da(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Xo(e,t,r,a=!1,n=!1){let o={},i=null,l,s=!1,u={},h=r&&be(r[1])?r[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let m=c.route.id,g=t[m];if(V(!Ye(g),"Cannot handle redirect results in processLoaderData"),be(g)){let R=g.error;if(h!==void 0&&(R=h,h=void 0),i=i||{},n)i[m]=R;else{let b=Ne(e,m);i[b.route.id]==null&&(i[b.route.id]=R)}a||(o[m]=Ha),s||(s=!0,l=Ve(g.error)?g.error.status:500),g.headers&&(u[m]=g.headers)}else o[m]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(l=g.statusCode),g.headers&&(u[m]=g.headers)}),h!==void 0&&r&&(i={[r[0]]:h},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:u}}function fa(e,t,r,a,n,o){let{loaderData:i,errors:l}=Xo(t,r,a);return n.filter(s=>!s.matches||s.matches.some(u=>u.shouldLoad)).forEach(s=>{let{key:u,match:h,controller:c}=s;if(c&&c.signal.aborted)return;let m=o[u];if(V(m,"Did not find corresponding fetcher result"),be(m)){let g=Ne(e.matches,h==null?void 0:h.route.id);l&&l[g.route.id]||(l={...l,[g.route.id]:m.error}),e.fetchers.delete(u)}else if(Ye(m))V(!1,"Unhandled fetcher revalidation redirect");else{let g=Fe(m.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:l}}function ha(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Ha).reduce((o,[i,l])=>(o[i]=l,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(n[i]=e[i]),a&&a.hasOwnProperty(i))break}return n}function ma(e){return e?be(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ne(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Lt(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,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&r?l=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&r?l=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(l=`Invalid request method "${a.toUpperCase()}"`)),new je(e||500,i,new Error(l),!0)}function Ct(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Ye(n))return{key:a,result:n}}}function Ka(e){let t=typeof e=="string"?_e(e):e;return Te({...t,hash:""})}function qo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Qo(e){var t,r;return new je(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function Zo(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&ei(r))}function ei(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function ti(e){return $t(e.result)&&$a.has(e.result.status)}function be(e){return e.type==="error"}function Ye(e){return(e&&e.type)==="redirect"}function sr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function $t(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function ri(e){return $a.has(e)}function ai(e){return $t(e)&&ri(e.status)&&e.headers.has("Location")}function ni(e){return Ao.has(e.toUpperCase())}function pe(e){return Fo.has(e.toUpperCase())}function Er(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function _t(e,t){let r=typeof t=="string"?_e(t).search:t.search;if(e[e.length-1].route.index&&Er(r||""))return e[e.length-1];let a=ka(e);return a[a.length-1]}function pa(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:i}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}}}function Zt(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 oi(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 it(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 ii(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 Fe(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 li(e,t){try{let r=e.sessionStorage.getItem(Ua);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function si(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Ua,JSON.stringify(r))}catch(a){se(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function ya(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Je=d.createContext(null);Je.displayName="DataRouter";var et=d.createContext(null);et.displayName="DataRouterState";var Xa=d.createContext(!1);function qa(){return d.useContext(Xa)}var Rr=d.createContext({isTransitioning:!1});Rr.displayName="ViewTransition";var br=d.createContext(new Map);br.displayName="Fetchers";var ui=d.createContext(null);ui.displayName="Await";var Ee=d.createContext(null);Ee.displayName="Navigation";var jt=d.createContext(null);jt.displayName="Location";var Ce=d.createContext({outlet:null,matches:[],isDataRoute:!1});Ce.displayName="Route";var Sr=d.createContext(null);Sr.displayName="RouteError";var Qa="REACT_ROUTER_ERROR",ci="REDIRECT",di="ROUTE_ERROR_RESPONSE";function fi(e){if(e.startsWith(`${Qa}:${ci}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function hi(e){if(e.startsWith(`${Qa}:${di}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new je(t.status,t.statusText,t.data)}catch{}}function mi(e,{relative:t}={}){V(pt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=d.useContext(Ee),{hash:n,pathname:o,search:i}=yt(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:Pe([r,o])),a.createHref({pathname:l,search:i,hash:n})}function pt(){return d.useContext(jt)!=null}function xe(){return V(pt(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(jt).location}var Za="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function en(e){d.useContext(Ee).static||d.useLayoutEffect(e)}function tn(){let{isDataRoute:e}=d.useContext(Ce);return e?Pi():pi()}function pi(){V(pt(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(Je),{basename:t,navigator:r}=d.useContext(Ee),{matches:a}=d.useContext(Ce),{pathname:n}=xe(),o=JSON.stringify(gr(a)),i=d.useRef(!1);return en(()=>{i.current=!0}),d.useCallback((s,u={})=>{if(se(i.current,Za),!i.current)return;if(typeof s=="number"){r.go(s);return}let h=Nt(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Pe([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,n,e])}var yi=d.createContext(null);function vi(e){let t=d.useContext(Ce).outlet;return d.useMemo(()=>t&&d.createElement(yi.Provider,{value:e},t),[t,e])}function rn(){let{matches:e}=d.useContext(Ce),t=e[e.length-1];return t?t.params:{}}function yt(e,{relative:t}={}){let{matches:r}=d.useContext(Ce),{pathname:a}=xe(),n=JSON.stringify(gr(r));return d.useMemo(()=>Nt(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function gi(e,t,r){V(pt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=d.useContext(Ee),{matches:n}=d.useContext(Ce),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;{let w=u&&u.path||"";sn(l,!u||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
20
+
21
+ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let h=xe(),c;c=h;let m=c.pathname||"/",g=m;if(s!=="/"){let w=s.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let R=Ie(e,{pathname:g});return se(u||R!=null,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),se(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${c.pathname}${c.search}${c.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Si(R&&R.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:Pe([s,a.encodeLocation?a.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?s:Pe([s,a.encodeLocation?a.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),n,r)}function wi(){let e=xr(),t=Ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:n},r):null,i)}var Ei=d.createElement(wi,null),an=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=hi(e.digest);r&&(e=r)}let t=e!==void 0?d.createElement(Ce.Provider,{value:this.props.routeContext},d.createElement(Sr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?d.createElement(Ri,{error:e},t):t}};an.contextType=Xa;var er=new WeakMap;function Ri({children:e,error:t}){let{basename:r}=d.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=fi(t.digest);if(a){let n=er.get(t);if(n)throw n;let o=Ia(a.location,r);if(Fa&&!er.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw er.set(t,i),i}return d.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function bi({routeContext:e,match:t,children:r}){let a=d.useContext(Je);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Ce.Provider,{value:e},r)}function Si(e,t=[],r){let a=r==null?void 0:r.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a==null?void 0:a.errors;if(o!=null){let h=n.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);V(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,h+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let h=0;h<n.length;h++){let c=n[h];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=h),c.route.id){let{loaderData:m,errors:g}=a,R=c.route.loader&&!m.hasOwnProperty(c.route.id)&&(!g||g[c.route.id]===void 0);if(c.route.lazy||R){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r==null?void 0:r.onError,u=a&&s?(h,c)=>{var m,g;s(h,{location:a.location,params:((g=(m=a.matches)==null?void 0:m[0])==null?void 0:g.params)??{},unstable_pattern:mt(a.matches),errorInfo:c})}:void 0;return n.reduceRight((h,c,m)=>{let g,R=!1,b=null,w=null;a&&(g=o&&c.route.id?o[c.route.id]:void 0,b=c.route.errorElement||Ei,i&&(l<0&&m===0?(sn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,w=null):l===m&&(R=!0,w=c.route.hydrateFallbackElement||null)));let P=t.concat(n.slice(0,m+1)),C=()=>{let D;return g?D=b:R?D=w:c.route.Component?D=d.createElement(c.route.Component,null):c.route.element?D=c.route.element:D=h,d.createElement(bi,{match:c,routeContext:{outlet:h,matches:P,isDataRoute:a!=null},children:D})};return a&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?d.createElement(an,{location:a.location,revalidation:a.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:u}):C()},null)}function Lr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nn(e){let t=d.useContext(Je);return V(t,Lr(e)),t}function Ge(e){let t=d.useContext(et);return V(t,Lr(e)),t}function Li(e){let t=d.useContext(Ce);return V(t,Lr(e)),t}function vt(e){let t=Li(e),r=t.matches[t.matches.length-1];return V(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ci(){return vt("useRouteId")}function xi(){return Ge("useNavigation").navigation}function ds(){let e=nn("useRevalidator"),t=Ge("useRevalidator"),r=d.useCallback(async()=>{await e.router.revalidate()},[e.router]);return d.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function Cr(){let{matches:e,loaderData:t}=Ge("useMatches");return d.useMemo(()=>e.map(r=>Ta(r,t)),[e,t])}function on(){let e=Ge("useLoaderData"),t=vt("useLoaderData");return e.loaderData[t]}function fs(e){return Ge("useRouteLoaderData").loaderData[e]}function ln(){let e=Ge("useActionData"),t=vt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function xr(){var a;let e=d.useContext(Sr),t=Ge("useRouteError"),r=vt("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function Pi(){let{router:e}=nn("useNavigate"),t=vt("useNavigate"),r=d.useRef(!1);return en(()=>{r.current=!0}),d.useCallback(async(n,o={})=>{se(r.current,Za),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var va={};function sn(e,t,r){!t&&!va[e]&&(va[e]=!0,se(!1,r))}var ga={};function ur(e,t){!e&&!ga[t]&&(ga[t]=!0,console.warn(t))}var Ti="useOptimistic",wa=Qn[Ti],Mi=()=>{};function _i(e){return wa?wa(e):[e,Mi]}function hs(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&se(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&se(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&se(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var ms=["HydrateFallback","hydrateFallbackElement"],Di=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function ps({router:e,flushSync:t,onError:r,unstable_useTransitions:a}){a=qa()||a;let[o,i]=d.useState(e.state),[l,s]=_i(o),[u,h]=d.useState(),[c,m]=d.useState({isTransitioning:!1}),[g,R]=d.useState(),[b,w]=d.useState(),[P,C]=d.useState(),D=d.useRef(new Map),I=d.useCallback((v,{deletedFetchers:B,newErrors:U,flushSync:oe,viewTransitionOpts:G})=>{U&&r&&Object.values(U).forEach(q=>{var ae;return r(q,{location:v.location,params:((ae=v.matches[0])==null?void 0:ae.params)??{},unstable_pattern:mt(v.matches)})}),v.fetchers.forEach((q,ae)=>{q.data!==void 0&&D.current.set(ae,q.data)}),B.forEach(q=>D.current.delete(q)),ur(oe===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let ie=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(ur(G==null||ie,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!G||!ie){t&&oe?t(()=>i(v)):a===!1?i(v):d.startTransition(()=>{a===!0&&s(q=>Ea(q,v)),i(v)});return}if(t&&oe){t(()=>{b&&(g==null||g.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let q=e.window.document.startViewTransition(()=>{t(()=>i(v))});q.finished.finally(()=>{t(()=>{R(void 0),w(void 0),h(void 0),m({isTransitioning:!1})})}),t(()=>w(q));return}b?(g==null||g.resolve(),b.skipTransition(),C({state:v,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(h(v),m({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[e.window,t,b,g,a,s,r]);d.useLayoutEffect(()=>e.subscribe(I),[e,I]),d.useEffect(()=>{c.isTransitioning&&!c.flushSync&&R(new Di)},[c]),d.useEffect(()=>{if(g&&u&&e.window){let v=u,B=g.promise,U=e.window.document.startViewTransition(async()=>{a===!1?i(v):d.startTransition(()=>{a===!0&&s(oe=>Ea(oe,v)),i(v)}),await B});U.finished.finally(()=>{R(void 0),w(void 0),h(void 0),m({isTransitioning:!1})}),w(U)}},[u,g,e.window,a,s]),d.useEffect(()=>{g&&u&&l.location.key===u.location.key&&g.resolve()},[g,b,l.location,u]),d.useEffect(()=>{!c.isTransitioning&&P&&(h(P.state),m({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),C(void 0))},[c.isTransitioning,P]);let x=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:v=>e.navigate(v),push:(v,B,U)=>e.navigate(v,{state:B,preventScrollReset:U==null?void 0:U.preventScrollReset}),replace:(v,B,U)=>e.navigate(v,{replace:!0,state:B,preventScrollReset:U==null?void 0:U.preventScrollReset})}),[e]),_=e.basename||"/",T=d.useMemo(()=>({router:e,navigator:x,static:!1,basename:_,onError:r}),[e,x,_,r]);return d.createElement(d.Fragment,null,d.createElement(Je.Provider,{value:T},d.createElement(et.Provider,{value:l},d.createElement(br.Provider,{value:D.current},d.createElement(Rr.Provider,{value:c},d.createElement(Fi,{basename:_,location:l.location,navigationType:l.historyAction,navigator:x,unstable_useTransitions:a},d.createElement(Oi,{routes:e.routes,future:e.future,state:l,isStatic:!1,onError:r})))))),null)}function Ea(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Oi=d.memo(ki);function ki({routes:e,future:t,state:r,isStatic:a,onError:n}){return gi(e,void 0,{state:r,isStatic:a,onError:n})}function ys(e){return vi(e.context)}function Fi({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,unstable_useTransitions:i}){V(!pt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=d.useMemo(()=>({basename:l,navigator:n,static:o,unstable_useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=_e(r));let{pathname:u="/",search:h="",hash:c="",state:m=null,key:g="default",unstable_mask:R}=r,b=d.useMemo(()=>{let w=Se(u,l);return w==null?null:{location:{pathname:w,search:h,hash:c,state:m,key:g,unstable_mask:R},navigationType:a}},[l,u,h,c,m,g,a,R]);return se(b!=null,`<Router basename="${l}"> is not able to match the URL "${u}${h}${c}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:d.createElement(Ee.Provider,{value:s},d.createElement(jt.Provider,{children:t,value:b}))}function Ii(){return{params:rn(),loaderData:on(),actionData:ln(),matches:Cr()}}function vs(e){return function(){const r=Ii();return d.createElement(e,r)}}function Ai(){return{params:rn(),loaderData:on(),actionData:ln(),error:xr()}}function gs(e){return function(){const r=Ai();return d.createElement(e,r)}}var Dt="get",Ot="application/x-www-form-urlencoded";function Ut(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ni(e){return Ut(e)&&e.tagName.toLowerCase()==="button"}function $i(e){return Ut(e)&&e.tagName.toLowerCase()==="form"}function ji(e){return Ut(e)&&e.tagName.toLowerCase()==="input"}function Ui(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Hi(e,t){return e.button===0&&(!t||t==="_self")&&!Ui(e)}function cr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function zi(e,t){let r=cr(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var xt=null;function Bi(){if(xt===null)try{new FormData(document.createElement("form"),0),xt=!1}catch{xt=!0}return xt}var Wi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tr(e){return e!=null&&!Wi.has(e)?(se(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ot}"`),null):e}function Yi(e,t){let r,a,n,o,i;if($i(e)){let l=e.getAttribute("action");a=l?Se(l,t):null,r=e.getAttribute("method")||Dt,n=tr(e.getAttribute("enctype"))||Ot,o=new FormData(e)}else if(Ni(e)||ji(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?Se(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||Dt,n=tr(e.getAttribute("formenctype"))||tr(l.getAttribute("enctype"))||Ot,o=new FormData(l,e),!Bi()){let{name:u,type:h,value:c}=e;if(h==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,c)}}else{if(Ut(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Dt,a=null,n=Ot,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var Vi=-1,Ji=-2,Gi=-3,Ki=-4,Xi=-5,qi=-6,Qi=-7,Zi="B",el="D",un="E",tl="M",rl="N",cn="P",al="R",nl="S",ol="Y",il="U",ll="Z",dn=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function sl(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,a){const n=e.decode(r,{stream:!0}),o=(t+n).split(`
22
+ `);t=o.pop()||"";for(const i of o)a.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var rr=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function dr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Ra.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const a=r.length;for(const n of e)r.push(n);return t.length=r.length,Ra.call(this,a)}function Ra(e){const{hydrated:t,values:r,deferred:a,plugins:n}=this;let o;const i=[[e,s=>{o=s}]];let l=[];for(;i.length>0;){const[s,u]=i.pop();switch(s){case Qi:u(void 0);continue;case Xi:u(null);continue;case Ji:u(NaN);continue;case qi:u(1/0);continue;case Gi:u(-1/0);continue;case Ki:u(-0);continue}if(t[s]){u(t[s]);continue}const h=r[s];if(!h||typeof h!="object"){t[s]=h,u(h);continue}if(Array.isArray(h))if(typeof h[0]=="string"){const[c,m,g]=h;switch(c){case el:u(t[s]=new Date(m));continue;case il:u(t[s]=new URL(m));continue;case Zi:u(t[s]=BigInt(m));continue;case al:u(t[s]=new RegExp(m,g));continue;case ol:u(t[s]=Symbol.for(m));continue;case nl:const R=new Set;t[s]=R;for(let I=h.length-1;I>0;I--)i.push([h[I],x=>{R.add(x)}]);u(R);continue;case tl:const b=new Map;t[s]=b;for(let I=h.length-2;I>0;I-=2){const x=[];i.push([h[I+1],_=>{x[1]=_}]),i.push([h[I],_=>{x[0]=_}]),l.push(()=>{b.set(x[0],x[1])})}u(b);continue;case rl:const w=Object.create(null);t[s]=w;for(const I of Object.keys(m).reverse()){const x=[];i.push([m[I],_=>{x[1]=_}]),i.push([Number(I.slice(1)),_=>{x[0]=_}]),l.push(()=>{w[x[0]]=x[1]})}u(w);continue;case cn:if(t[m])u(t[s]=t[m]);else{const I=new dn;a[m]=I,u(t[s]=I.promise)}continue;case un:const[,P,C]=h;let D=C&&rr&&rr[C]?new rr[C](P):new Error(P);t[s]=D,u(D);continue;case ll:u(t[s]=t[m]);continue;default:if(Array.isArray(n)){const I=[],x=h.slice(1);for(let _=0;_<x.length;_++){const T=x[_];i.push([T,v=>{I[_]=v}])}l.push(()=>{for(const _ of n){const T=_(h[0],...I);if(T){u(t[s]=T.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[s]=c;for(let m=0;m<h.length;m++){const g=h[m];g!==Vi&&i.push([g,R=>{c[m]=R}])}u(c);continue}else{const c={};t[s]=c;for(const m of Object.keys(h).reverse()){const g=[];i.push([h[m],R=>{g[1]=R}]),i.push([Number(m.slice(1)),R=>{g[0]=R}]),l.push(()=>{c[g[0]]=g[1]})}u(c);continue}}for(;l.length>0;)l.pop()();return o}async function ul(e,t){const{plugins:r}=t??{},a=new dn,n=e.pipeThrough(sl()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await cl.call(o,n);let l=a.promise;return i.done?a.resolve():l=dl.call(o,n).then(a.resolve).catch(s=>{for(const u of Object.values(o.deferred))u.reject(s);a.reject(s)}),{done:l.then(()=>n.closed),value:i.value}}async function cl(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:dr.call(this,r)}}async function dl(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case cn:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const i=r.slice(a+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=dr.call(this,l);o.resolve(s);break}case un:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const i=r.slice(a+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=dr.call(this,l);o.reject(s);break}default:throw new SyntaxError}t=await e.read()}}async function fl(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var hl={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},ml=/[&><\u2028\u2029]/g;function fr(e){return e.replace(ml,t=>hl[t])}function ge(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var hr=Symbol("SingleFetchRedirect"),fn=class extends Error{},pl=202,yl=new Set([100,101,204,205]);function ws(e,t,r,a,n,o){let i=vl(e,l=>{let s=t.routes[l.route.id];ge(s,"Route not found in manifest");let u=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(u!=null&&u.shouldRevalidate)}},Ll,a,n,o);return async l=>l.runClientMiddleware(i)}function vl(e,t,r,a,n,o,i=()=>!0){return async l=>{let{request:s,matches:u,fetcherKey:h}=l,c=e();if(s.method!=="GET")return gl(l,r,n,o);let m=u.some(g=>{let{hasLoader:R,hasClientLoader:b}=t(g);return g.shouldCallHandler()&&R&&!b});return!a&&!m?wl(l,t,r,n,o):h?bl(l,r,n,o):El(l,c,t,r,a,n,o,i)}}async function gl(e,t,r,a){let n=e.matches.find(l=>l.shouldCallHandler());ge(n,"No action match found");let o,i=await n.resolve(async l=>await l(async()=>{let{data:u,status:h}=await t(e,r,a,[n.route.id]);return o=h,ht(u,n.route.id)}));return $t(i.result)||Ve(i.result)||sr(i.result)?{[n.route.id]:i}:{[n.route.id]:{type:i.type,result:xo(i.result,o)}}}async function wl(e,t,r,a,n){let o=e.matches.filter(l=>l.shouldCallHandler()),i={};return await Promise.all(o.map(l=>l.resolve(async s=>{try{let{hasClientLoader:u}=t(l),h=l.route.id,c=u?await s(async()=>{let{data:m}=await r(e,a,n,[h]);return ht(m,h)}):await s();i[l.route.id]={type:"data",result:c}}catch(u){i[l.route.id]={type:"error",result:u}}}))),i}async function El(e,t,r,a,n,o,i,l=()=>!0){let s=new Set,u=!1,h=e.matches.map(()=>ba()),c=ba(),m={},g=Promise.all(e.matches.map(async(b,w)=>b.resolve(async P=>{h[w].resolve();let C=b.route.id,{hasLoader:D,hasClientLoader:I,hasShouldRevalidate:x}=r(b),_=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(_)){u||(u=b.shouldRevalidateArgs!=null&&D&&x===!0);return}if(l(b)&&I){D&&(u=!0);try{let v=await P(async()=>{let{data:B}=await a(e,o,i,[C]);return ht(B,C)});m[C]={type:"data",result:v}}catch(v){m[C]={type:"error",result:v}}return}D&&s.add(C);try{let v=await P(async()=>{let B=await c.promise;return ht(B,C)});m[C]={type:"data",result:v}}catch(v){m[C]={type:"error",result:v}}})));if(await Promise.all(h.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=n&&u&&s.size>0?[...s.keys()]:void 0;try{let w=await a(e,o,i,b);c.resolve(w.data)}catch(w){c.reject(w)}}return await g,await Rl(c.promise,e.matches,s,m),m}async function Rl(e,t,r,a){var n;try{let o,i=await e;if("routes"in i){for(let l of t)if(l.route.id in i.routes){let s=i.routes[l.route.id];if("error"in s){o=s.error,((n=a[l.route.id])==null?void 0:n.result)==null&&(a[l.route.id]={type:"error",result:o});break}}}o!==void 0&&Array.from(r.values()).forEach(l=>{a[l].result instanceof fn&&(a[l].result=o)})}catch{}}async function bl(e,t,r,a){let n=e.matches.find(l=>l.shouldCallHandler());ge(n,"No fetcher match found");let o=n.route.id,i=await n.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,a,[o]);return ht(s,o)}));return{[n.route.id]:i}}function Sl(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let a of t)a&&r.push(a);for(let a of r)e.searchParams.append("index",a);return e}function hn(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&Se(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${a}`,n}async function Ll(e,t,r,a){let{request:n}=e,o=hn(n.url,t,r,"data");n.method==="GET"&&(o=Sl(o),a&&o.searchParams.set("_routes",a.join(",")));let i=await fetch(o,await fl(n));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new je(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has("X-Remix-Redirect"))return{status:pl,data:{redirect:{redirect:i.headers.get("X-Remix-Redirect"),status:Number(i.headers.get("X-Remix-Status")||"302"),revalidate:i.headers.get("X-Remix-Revalidate")==="true",reload:i.headers.get("X-Remix-Reload-Document")==="true",replace:i.headers.get("X-Remix-Replace")==="true"}}};if(yl.has(i.status)){let l={};return a&&n.method!=="GET"&&(l[a[0]]={data:void 0}),{status:i.status,data:{routes:l}}}ge(i.body,"No response body to decode");try{let l=await Cl(i.body,window),s;if(n.method==="GET"){let u=l.value;hr in u?s={redirect:u[hr]}:s={routes:u}}else{let u=l.value,h=a==null?void 0:a[0];ge(h,"No routeId found for single fetch call decoding"),"redirect"in u?s={redirect:u}:s={routes:{[h]:u}}}return{status:i.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Cl(e,t){return ul(e,{plugins:[(r,...a)=>{if(r==="SanitizedError"){let[n,o,i]=a,l=Error;n&&n in t&&typeof t[n]=="function"&&(l=t[n]);let s=new l(o);return s.stack=i,{value:s}}if(r==="ErrorResponse"){let[n,o,i]=a;return{value:new je(o,i,n)}}if(r==="SingleFetchRedirect")return{value:{[hr]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function ht(e,t){if("redirect"in e){let{redirect:a,revalidate:n,reload:o,replace:i,status:l}=e.redirect;throw Po(a,{status:l,headers:{...n?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new fn(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function ba(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function mn(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xl(e,t,r){let a=e.map(o=>{var s;let i=t[o.route.id],l=r.routes[o.route.id];return[l&&l.css?l.css.map(u=>({rel:"stylesheet",href:u})):[],((s=i==null?void 0:i.links)==null?void 0:s.call(i))||[]]}).flat(2),n=Tr(e,r);return gn(a,n)}function pn(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Pl(e){if(!e.css)return;let t=pn(e);await Promise.all(t.map(vn))}async function yn(e,t){if(!e.css&&!t.links||!Ol())return;let r=[];if(e.css&&r.push(...pn(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!Pr(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(vn))}async function vn(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function a(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{a(),t()},r.onerror=()=>{a(),t()},document.head.appendChild(r)})}function Pr(e){return e!=null&&typeof e.page=="string"}function Tl(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ml(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await mn(o,r);return i.links?i.links():[]}return[]}));return gn(a.flat(1).filter(Tl).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Sa(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>{var h;return r[u].pathname!==s.pathname||((h=r[u].route.path)==null?void 0:h.endsWith("*"))&&r[u].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{var c;let h=a.routes[s.route.id];if(!h||!h.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let m=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:((c=r[0])==null?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Tr(e,t,{includeHydrateFallback:r}={}){return _l(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function _l(e){return[...new Set(e)]}function Dl(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function gn(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Pr(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(Dl(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}var Pt;function Ol(){if(Pt!==void 0)return Pt;let e=document.createElement("link");return Pt=e.relList.supports("preload"),e=null,Pt}function kl(){return d.createElement(mr,{title:"Loading...",renderScripts:!0},d.createElement("script",{dangerouslySetInnerHTML:{__html:`
23
+ console.log(
24
+ "💿 Hey developer 👋. You can provide a way better UX than this " +
25
+ "when your app is loading JS modules and/or running \`clientLoader\` " +
26
+ "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
27
+ "for more information."
28
+ );
29
+ `}}))}function wn(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function Fl(e,t,r){let a=En(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?kl:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(Sn,{error:xr()}):void 0;return e.id==="root"&&t.Layout?{...a?{element:d.createElement(t.Layout,null,d.createElement(a,null))}:{Component:a},...o?{errorElement:d.createElement(t.Layout,null,d.createElement(o,null))}:{ErrorBoundary:o},...n?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(n,null))}:{HydrateFallback:n}}:{Component:a,ErrorBoundary:o,HydrateFallback:n}}function Es(e,t,r,a,n,o){return Mr(t,r,a,n,o,"",wn(t),e)}function Tt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let a=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(a),new je(400,"Bad Request",new Error(a),!0)}}function ar(e,t){let r=e==="clientAction"?"a":"an",a=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(a),new je(405,"Method Not Allowed",new Error(a),!0)}function Mr(e,t,r,a,n,o="",i=wn(e),l){return(i[o]||[]).map(s=>{var C,D,I;let u=t[s.id];function h(x){return ge(typeof x=="function","No single fetch function available for route handler"),x()}function c(x){return s.hasLoader?h(x):Promise.resolve(null)}function m(x){if(!s.hasAction)throw ar("action",s.id);return h(x)}function g(x){import(x)}function R(x){x.clientActionModule&&g(x.clientActionModule),x.clientLoaderModule&&g(x.clientLoaderModule)}async function b(x){let _=t[s.id],T=_?yn(s,_):Promise.resolve();try{return x()}finally{await T}}let w={id:s.id,index:s.index,path:s.path};if(u){Object.assign(w,{...w,...Fl(s,u,n),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:La(w.path,u,s,a,l)});let x=r&&r.loaderData&&s.id in r.loaderData,_=x?(C=r==null?void 0:r.loaderData)==null?void 0:C[s.id]:void 0,T=r&&r.errors&&s.id in r.errors,v=T?(D=r==null?void 0:r.errors)==null?void 0:D[s.id]:void 0,B=l==null&&(((I=u.clientLoader)==null?void 0:I.hydrate)===!0||!s.hasLoader);w.loader=async({request:U,params:oe,context:G,unstable_pattern:ie,unstable_url:q},ae)=>{try{return await b(async()=>(ge(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:U,params:oe,context:G,unstable_pattern:ie,unstable_url:q,async serverLoader(){if(Tt("loader",s),B){if(x)return _;if(T)throw v}return c(ae)}}):c(ae)))}finally{B=!1}},w.loader.hydrate=Nl(s.id,u.clientLoader,s.hasLoader,n),w.action=({request:U,params:oe,context:G,unstable_pattern:ie,unstable_url:q},ae)=>b(async()=>{if(ge(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw ar("clientAction",s.id);return m(ae)}return u.clientAction({request:U,params:oe,context:G,unstable_pattern:ie,unstable_url:q,async serverAction(){return Tt("action",s),m(ae)}})})}else{s.hasClientLoader||(w.loader=(T,v)=>b(()=>c(v))),s.hasClientAction||(w.action=(T,v)=>b(()=>{if(n)throw ar("clientAction",s.id);return m(v)}));let x;async function _(){return x?await x:(x=(async()=>{(s.clientLoaderModule||s.clientActionModule)&&await new Promise(v=>setTimeout(v,0));let T=Al(s,t);return R(s),await T})(),await x)}w.lazy={loader:s.hasClientLoader?async()=>{let{clientLoader:T}=s.clientLoaderModule?await import(s.clientLoaderModule):await _();return ge(T,"No `clientLoader` export found"),(v,B)=>T({...v,async serverLoader(){return Tt("loader",s),c(B)}})}:void 0,action:s.hasClientAction?async()=>{let T=s.clientActionModule?import(s.clientActionModule):_();R(s);let{clientAction:v}=await T;return ge(v,"No `clientAction` export found"),(B,U)=>v({...B,async serverAction(){return Tt("action",s),m(U)}})}:void 0,middleware:s.hasClientMiddleware?async()=>{let{clientMiddleware:T}=s.clientMiddlewareModule?await import(s.clientMiddlewareModule):await _();return ge(T,"No `clientMiddleware` export found"),T}:void 0,shouldRevalidate:async()=>{let T=await _();return La(w.path,T,s,a,l)},handle:async()=>(await _()).handle,Component:async()=>(await _()).Component,ErrorBoundary:s.hasErrorBoundary?async()=>(await _()).ErrorBoundary:void 0}}let P=Mr(e,t,r,a,n,s.id,i,l);return P.length>0&&(w.children=P),w})}function La(e,t,r,a,n){if(n)return Il(r.id,t.shouldRevalidate,n);if(!a&&r.hasLoader&&!r.hasClientLoader){let o=e?Da(e)[1].map(l=>l.paramName):[];const i=l=>o.some(s=>l.currentParams[s]!==l.nextParams[s]);if(t.shouldRevalidate){let l=t.shouldRevalidate;return s=>l({...s,defaultShouldRevalidate:i(s)})}else return l=>i(l)}return t.shouldRevalidate}function Il(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function Al(e,t){let r=mn(e,t),a=Pl(e),n=await r;return await Promise.all([a,yn(e,n)]),{Component:En(n),ErrorBoundary:n.ErrorBoundary,clientMiddleware:n.clientMiddleware,clientAction:n.clientAction,clientLoader:n.clientLoader,handle:n.handle,links:n.links,meta:n.meta,shouldRevalidate:n.shouldRevalidate}}function En(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Nl(e,t,r,a){return a&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var kt=new Set,$l=1e3,It=new Set,jl=7680;function _r(e,t){return e.mode==="lazy"&&t===!0}function Ul({sri:e,...t},r){let a=new Set(r.state.matches.map(l=>l.route.id)),n=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(n.pop();n.length>0;)o.push(`/${n.join("/")}`),n.pop();o.forEach(l=>{let s=Ie(r.routes,l,r.basename);s&&s.forEach(u=>a.add(u.route.id))});let i=[...a].reduce((l,s)=>Object.assign(l,{[s]:t.routes[s]}),{});return{...t,routes:i,sri:e?!0:void 0}}function Rs(e,t,r,a,n,o,i){if(_r(n,a))return async({path:l,patch:s,signal:u,fetcherKey:h})=>{if(It.has(l))return;let{state:c}=e();await Rn([l],h?window.location.href:Te(c.navigation.location||c.location),t,r,a,o,i,n.manifestPath,s,u)}}function bs(e,t,r,a,n,o){d.useEffect(()=>{var h,c;if(!_r(n,a)||((c=(h=window.navigator)==null?void 0:h.connection)==null?void 0:c.saveData)===!0)return;function i(m){let g=m.tagName==="FORM"?m.getAttribute("action"):m.getAttribute("href");if(!g)return;let R=m.tagName==="A"?m.pathname:new URL(g,window.location.origin).pathname;It.has(R)||kt.add(R)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let m=Array.from(kt.keys()).filter(g=>It.has(g)?(kt.delete(g),!1):!0);if(m.length!==0)try{await Rn(m,null,t,r,a,o,e.basename,n.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let s=Bl(l,100);l();let u=new MutationObserver(()=>s());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[a,o,t,r,e,n])}function Hl(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var nr="react-router-manifest-version";async function Rn(e,t,r,a,n,o,i,l,s,u){const h=new URLSearchParams;h.set("paths",e.sort().join(",")),h.set("version",r.version);let c=new URL(Hl(l,i),window.location.origin);if(c.search=h.toString(),c.toString().length>jl){kt.clear();return}let m;try{let w=await fetch(c,{signal:u});if(w.ok){if(w.status===204&&w.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}try{if(sessionStorage.getItem(nr)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(nr,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(w.status>=400)throw new Error(await w.text())}else throw new Error(`${w.status} ${w.statusText}`);try{sessionStorage.removeItem(nr)}catch{}m=await w.json()}catch(w){if(u!=null&&u.aborted)return;throw w}let g=new Set(Object.keys(r.routes)),R=Object.values(m).reduce((w,P)=>(P&&!g.has(P.id)&&(w[P.id]=P),w),{});Object.assign(r.routes,R),e.forEach(w=>zl(w,It));let b=new Set;Object.values(R).forEach(w=>{w&&(!w.parentId||!R[w.parentId])&&b.add(w.parentId)}),b.forEach(w=>s(w||null,Mr(R,a,null,n,o,w)))}function zl(e,t){if(t.size>=$l){let r=t.values().next().value;t.delete(r)}t.add(e)}function Bl(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function Dr(){let e=d.useContext(Je);return ge(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ht(){let e=d.useContext(et);return ge(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var zt=d.createContext(void 0);zt.displayName="FrameworkContext";function tt(){let e=d.useContext(zt);return ge(e,"You must render this element inside a <HydratedRouter> element"),e}function Wl(e,t){let r=d.useContext(zt),[a,n]=d.useState(!1),[o,i]=d.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:h,onTouchStart:c}=t,m=d.useRef(null);d.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=P=>{P.forEach(C=>{i(C.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return m.current&&w.observe(m.current),()=>{w.disconnect()}}},[e]),d.useEffect(()=>{if(a){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[a]);let g=()=>{n(!0)},R=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:lt(l,g),onBlur:lt(s,R),onMouseEnter:lt(u,g),onMouseLeave:lt(h,R),onTouchStart:lt(c,g)}]:[!1,m,{}]}function lt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Or(e,t,r){if(r&&!At)return[e[0]];if(t){let a=e.findIndex(n=>t[n.route.id]!==void 0);return e.slice(0,a+1)}return e}var Ca="data-react-router-critical-css";function Ss({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:a,routeModules:n,criticalCss:o}=tt(),{errors:i,matches:l}=Ht(),s=Or(l,i,r),u=d.useMemo(()=>xl(s,n,a),[s,n,a]);return d.createElement(d.Fragment,null,typeof o=="string"?d.createElement("style",{[Ca]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?d.createElement("link",{[Ca]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,u.map(({key:h,link:c})=>Pr(c)?d.createElement(bn,{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t}):d.createElement("link",{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t})))}function bn({page:e,...t}){let{router:r}=Dr(),a=d.useMemo(()=>Ie(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?d.createElement(Vl,{page:e,matches:a,...t}):null}function Yl(e){let{manifest:t,routeModules:r}=tt(),[a,n]=d.useState([]);return d.useEffect(()=>{let o=!1;return Ml(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Vl({page:e,matches:t,...r}){let a=xe(),{future:n,manifest:o,routeModules:i}=tt(),{basename:l}=Dr(),{loaderData:s,matches:u}=Ht(),h=d.useMemo(()=>Sa(e,t,u,o,a,"data"),[e,t,u,o,a]),c=d.useMemo(()=>Sa(e,t,u,o,a,"assets"),[e,t,u,o,a]),m=d.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let b=new Set,w=!1;if(t.forEach(C=>{var I;let D=o.routes[C.route.id];!D||!D.hasLoader||(!h.some(x=>x.route.id===C.route.id)&&C.route.id in s&&((I=i[C.route.id])!=null&&I.shouldRevalidate)||D.hasClientLoader?w=!0:b.add(C.route.id))}),b.size===0)return[];let P=hn(e,l,n.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&P.searchParams.set("_routes",t.filter(C=>b.has(C.route.id)).map(C=>C.route.id).join(",")),[P.pathname+P.search]},[l,n.unstable_trailingSlashAwareDataRequests,s,a,o,h,t,e,i]),g=d.useMemo(()=>Tr(c,o),[c,o]),R=Yl(c);return d.createElement(d.Fragment,null,m.map(b=>d.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>d.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),R.map(({key:b,link:w})=>d.createElement("link",{key:b,nonce:r.nonce,...w,crossOrigin:w.crossOrigin??r.crossOrigin})))}function Ls(){let{isSpaMode:e,routeModules:t}=tt(),{errors:r,matches:a,loaderData:n}=Ht(),o=xe(),i=Or(a,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let s=[],u=null,h=[];for(let c=0;c<i.length;c++){let m=i[c],g=m.route.id,R=n[g],b=m.params,w=t[g],P=[],C={id:g,data:R,loaderData:R,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:l};if(h[c]=C,w!=null&&w.meta?P=typeof w.meta=="function"?w.meta({data:R,loaderData:R,params:b,location:o,matches:h,error:l}):Array.isArray(w.meta)?[...w.meta]:w.meta:u&&(P=[...u]),P=P||[],!Array.isArray(P))throw new Error("The route at "+m.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
30
+
31
+ To reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta`);C.meta=P,h[c]=C,s=[...P],u=s}return d.createElement(d.Fragment,null,s.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:m,...g}=c;if(!Jl(m))return console.warn(`A meta object uses an invalid tagName: ${m}. Expected either 'link' or 'meta'`),null;let R=m;return d.createElement(R,{key:JSON.stringify(g),...g})}if("title"in c)return d.createElement("title",{key:"title"},String(c.title));if("charset"in c&&(c.charSet??(c.charSet=c.charset),delete c.charset),"charSet"in c&&c.charSet!=null)return typeof c.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:c.charSet}):null;if("script:ld+json"in c)try{let m=JSON.stringify(c["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${m}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:fr(m)}})}catch{return null}return d.createElement("meta",{key:JSON.stringify(c),...c})}))}function Jl(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var At=!1;function Gl(){At=!0}function Kl(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,renderMeta:n,routeDiscovery:o,ssr:i}=tt(),{router:l,static:s,staticContext:u}=Dr(),{matches:h}=Ht(),c=qa(),m=_r(o,i);n&&(n.didRenderScripts=!0);let g=Or(h,null,a);d.useEffect(()=>{Gl()},[]);let R=d.useMemo(()=>{var I;if(c)return null;let C=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",D=s?`${(I=t.hmr)!=null&&I.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
32
+ ${g.map((x,_)=>{let T=`route${_}`,v=t.routes[x.route.id];ge(v,`Route ${x.route.id} not found in manifest`);let{clientActionModule:B,clientLoaderModule:U,clientMiddlewareModule:oe,hydrateFallbackModule:G,module:ie}=v,q=[...B?[{module:B,varName:`${T}_clientAction`}]:[],...U?[{module:U,varName:`${T}_clientLoader`}]:[],...oe?[{module:oe,varName:`${T}_clientMiddleware`}]:[],...G?[{module:G,varName:`${T}_HydrateFallback`}]:[],{module:ie,varName:`${T}_main`}];if(q.length===1)return`import * as ${T} from ${JSON.stringify(ie)};`;let ae=q.map(Z=>`import * as ${Z.varName} from "${Z.module}";`).join(`
33
+ `),K=`const ${T} = {${q.map(Z=>`...${Z.varName}`).join(",")}};`;return[ae,K].join(`
34
+ `)}).join(`
35
+ `)}
36
+ ${m?`window.__reactRouterManifest = ${JSON.stringify(Ul(t,l),null,2)};`:""}
37
+ window.__reactRouterRouteModules = {${g.map((x,_)=>`${JSON.stringify(x.route.id)}:route${_}`).join(",")}};
38
+
39
+ import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:C},type:void 0}),d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:D},type:"module",async:!0}))},[]),b=At||c?[]:Xl(t.entry.imports.concat(Tr(g,t,{includeHydrateFallback:!0}))),w=typeof t.sri=="object"?t.sri:{};return ur(!c,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),At||c?null:d.createElement(d.Fragment,null,typeof t.sri=="object"?d.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:w})}}):null,m?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:w[t.url],suppressHydrationWarning:!0}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:w[t.entry.module],suppressHydrationWarning:!0}),b.map(P=>d.createElement("link",{key:P,rel:"modulepreload",href:P,crossOrigin:e.crossOrigin,integrity:w[P],suppressHydrationWarning:!0})),R)}function Xl(e){return[...new Set(e)]}function ql(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Cs=class extends d.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?d.createElement(Sn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Sn({error:e,isOutsideRemixApp:t}){console.error(e);let r=d.createElement("script",{dangerouslySetInnerHTML:{__html:`
40
+ console.log(
41
+ "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
42
+ );
43
+ `}});if(Ve(e))return d.createElement(mr,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let a;if(e instanceof Error)a=e;else{let n=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);a=new Error(n)}return d.createElement(mr,{title:"Application Error!",isOutsideRemixApp:t},d.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),d.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},a.stack),r)}function mr({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){var o;let{routeModules:n}=tt();return(o=n.root)!=null&&o.Layout&&!r?a:d.createElement("html",{lang:"en"},d.createElement("head",null,d.createElement("meta",{charSet:"utf-8"}),d.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),d.createElement("title",null,e)),d.createElement("body",null,d.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,t?d.createElement(Kl,null):null)))}var Ql=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ql&&(window.__reactRouterVersion="7.13.2")}catch{}var Ln=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cn=d.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,unstable_mask:l,state:s,target:u,to:h,preventScrollReset:c,viewTransition:m,unstable_defaultShouldRevalidate:g,...R},b){let{basename:w,navigator:P,unstable_useTransitions:C}=d.useContext(Ee),D=typeof h=="string"&&Ln.test(h),I=Ia(h,w);h=I.to;let x=mi(h,{relative:n}),_=xe(),T=null;if(l){let ae=Nt(l,[],_.unstable_mask?_.unstable_mask.pathname:"/",!0);w!=="/"&&(ae.pathname=ae.pathname==="/"?w:Pe([w,ae.pathname])),T=P.createHref(ae)}let[v,B,U]=Wl(a,R),oe=ts(h,{replace:i,unstable_mask:l,state:s,target:u,preventScrollReset:c,relative:n,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:C});function G(ae){t&&t(ae),ae.defaultPrevented||oe(ae)}let ie=!(I.isExternal||o),q=d.createElement("a",{...R,...U,href:(ie?T:void 0)||I.absoluteURL||x,onClick:ie?G:t,ref:ql(b,B),target:u,"data-discover":!D&&r==="render"?"true":void 0});return v&&!D?d.createElement(d.Fragment,null,q,d.createElement(bn,{page:x})):q});Cn.displayName="Link";var Zl=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},h){let c=yt(i,{relative:u.relative}),m=xe(),g=d.useContext(et),{navigator:R,basename:b}=d.useContext(Ee),w=g!=null&&ls(c)&&l===!0,P=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,C=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(C=C.toLowerCase(),D=D?D.toLowerCase():null,P=P.toLowerCase()),D&&b&&(D=Se(D,b)||D);const I=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let x=C===P||!n&&C.startsWith(P)&&C.charAt(I)==="/",_=D!=null&&(D===P||!n&&D.startsWith(P)&&D.charAt(P.length)==="/"),T={isActive:x,isPending:_,isTransitioning:w},v=x?t:void 0,B;typeof a=="function"?B=a(T):B=[a,x?"active":null,_?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let U=typeof o=="function"?o(T):o;return d.createElement(Cn,{...u,"aria-current":v,className:B,ref:h,style:U,to:i,viewTransition:l},typeof s=="function"?s(T):s)});Zl.displayName="NavLink";var xn=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=Dt,action:l,onSubmit:s,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=d.useContext(Ee),w=Mn(),P=ns(l,{relative:u}),C=i.toLowerCase()==="get"?"get":"post",D=typeof l=="string"&&Ln.test(l),I=x=>{if(s&&s(x),x.defaultPrevented)return;x.preventDefault();let _=x.nativeEvent.submitter,T=(_==null?void 0:_.getAttribute("formmethod"))||i,v=()=>w(_||x.currentTarget,{fetcherKey:t,method:T,navigate:r,replace:n,state:o,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?d.startTransition(()=>v()):v()};return d.createElement("form",{ref:R,method:C,action:P,onSubmit:a?s:I,...g,"data-discover":!D&&e==="render"?"true":void 0})});xn.displayName="Form";function es({getKey:e,storageKey:t,...r}){let a=d.useContext(zt),{basename:n}=d.useContext(Ee),o=xe(),i=Cr();os({getKey:e,storageKey:t});let l=d.useMemo(()=>{if(!a||!e)return null;let u=yr(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return d.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${fr(JSON.stringify(t||pr))}, ${fr(JSON.stringify(l))})`}})}es.displayName="ScrollRestoration";function Pn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bt(e){let t=d.useContext(Je);return V(t,Pn(e)),t}function Tn(e){let t=d.useContext(et);return V(t,Pn(e)),t}function ts(e,{target:t,replace:r,unstable_mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:s,unstable_useTransitions:u}={}){let h=tn(),c=xe(),m=yt(e,{relative:i});return d.useCallback(g=>{if(Hi(g,t)){g.preventDefault();let R=r!==void 0?r:Te(c)===Te(m),b=()=>h(e,{replace:R,unstable_mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:s});u?d.startTransition(()=>b()):b()}},[c,h,m,r,a,n,t,e,o,i,l,s,u])}function xs(e){se(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(cr(e)),r=d.useRef(!1),a=xe(),n=d.useMemo(()=>zi(a.search,r.current?null:t.current),[a.search]),o=tn(),i=d.useCallback((l,s)=>{const u=cr(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var rs=0,as=()=>`__${String(++rs)}__`;function Mn(){let{router:e}=Bt("useSubmit"),{basename:t}=d.useContext(Ee),r=Ci(),a=e.fetch,n=e.navigate;return d.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:h,body:c}=Yi(o,t);if(i.navigate===!1){let m=i.fetcherKey||as();await a(m,r,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function ns(e,{relative:t}={}){let{basename:r}=d.useContext(Ee),a=d.useContext(Ce);V(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...yt(e||".",{relative:t})},i=xe();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(h=>h==="")){l.delete("index"),s.filter(c=>c).forEach(c=>l.append("index",c));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Pe([r,o.pathname])),Te(o)}function Ps({key:e}={}){var x;let{router:t}=Bt("useFetcher"),r=Tn("useFetcher"),a=d.useContext(br),n=d.useContext(Ce),o=(x=n.matches[n.matches.length-1])==null?void 0:x.route.id;V(a,"useFetcher must be used inside a FetchersContext"),V(n,"useFetcher must be used inside a RouteContext"),V(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=d.useId(),[l,s]=d.useState(e||i);e&&e!==l&&s(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;d.useEffect(()=>(h(l),()=>u(l)),[u,h,l]);let g=d.useCallback(async(_,T)=>{V(o,"No routeId available for fetcher.load()"),await m(l,o,_,T)},[l,o,m]),R=Mn(),b=d.useCallback(async(_,T)=>{await R(_,{...T,navigate:!1,fetcherKey:l})},[l,R]),w=d.useCallback(_=>c(l,_),[c,l]),P=d.useMemo(()=>{let _=d.forwardRef((T,v)=>d.createElement(xn,{...T,navigate:!1,fetcherKey:l,ref:v}));return _.displayName="fetcher.Form",_},[l]),C=r.fetchers.get(l)||ja,D=a.get(l);return d.useMemo(()=>({Form:P,submit:b,load:g,reset:w,...C,data:D}),[P,b,g,w,C,D])}var pr="react-router-scroll-positions",Mt={};function yr(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:Se(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function os({getKey:e,storageKey:t}={}){let{router:r}=Bt("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=Tn("useScrollRestoration"),{basename:o}=d.useContext(Ee),i=xe(),l=Cr(),s=xi();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),is(d.useCallback(()=>{if(s.state==="idle"){let u=yr(i,l,o,e);Mt[u]=window.scrollY}try{sessionStorage.setItem(t||pr,JSON.stringify(Mt))}catch(u){se(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||pr);u&&(Mt=JSON.parse(u))}catch{}},[t]),d.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(Mt,()=>window.scrollY,e?(h,c)=>yr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),d.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{se(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function is(e,t){let{capture:r}={};d.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function ls(e,{relative:t}={}){let r=d.useContext(Rr);V(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Bt("useViewTransitionState"),n=yt(e,{relative:t});if(!r.isTransitioning)return!1;let o=Se(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=Se(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Ft(n.pathname,i)!=null||Ft(n.pathname,o)!=null}export{Es as A,hs as B,ms as C,gs as D,je as E,zt as F,Ss as G,Kl as H,xr as I,ss as J,Cn as L,Ls as M,yl as N,ys as O,qn as R,es as S,tn as a,xs as b,xe as c,Ps as d,ln as e,ds as f,Gn as g,Xn as h,fs as i,rn as j,Ve as k,V as l,Ie as m,bs as n,Cs as o,ps as p,Cl as q,d as r,Nl as s,Mr as t,on as u,cs as v,vs as w,Rs as x,ws as y,us as z};
@@ -1,4 +1,4 @@
1
- import{c}from"./createLucideIcon-4ImjHTVC.js";/**
1
+ import{c}from"./createLucideIcon-BwyFiRot.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./createLucideIcon-4ImjHTVC.js";/**
1
+ import{c}from"./createLucideIcon-BwyFiRot.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as s}from"./chunk-JZWAC4HX-BAdwhyCx.js";/**
1
+ import{r as s}from"./chunk-UVKPFVEO-Bmq2apuh.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{w as t,d as r}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{S as i}from"./ScenarioViewer-CefgqbCr.js";import{W as n}from"./InteractivePreview-DtYTSPL2.js";import"./ViewportInspectBar-BA_Ry-rs.js";import"./useCustomSizes-DhXHbEjP.js";import"./LogViewer-CM5zg40N.js";import"./SafeScreenshot-DanvyBPb.js";import"./useLastLogLine-D9QZKaLJ.js";import"./Spinner-Bc8BG-Lw.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-C2PLkej3.js";import"./createLucideIcon-4ImjHTVC.js";import"./circle-check-DFcQkN5j.js";import"./triangle-alert-DqJ0j69l.js";import"./copy-C6iF61Xs.js";import"./scenarioStatus-B_8jpV3e.js";import"./InlineSpinner-CgTNOhnu.js";const S=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],L=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{L as default,S as meta};
1
+ import{w as t,d as r}from"./chunk-UVKPFVEO-Bmq2apuh.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{S as i}from"./ScenarioViewer-Cl4oOA3A.js";import{W as n}from"./InteractivePreview-6WjVfhxX.js";import"./ViewportInspectBar-BqkA9zyZ.js";import"./useCustomSizes-Dk0Tciqg.js";import"./LogViewer-C-9zQdXg.js";import"./SafeScreenshot-DThcm_9M.js";import"./useLastLogLine-C8QvIe05.js";import"./Spinner-CIil5-gb.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-DQsceHVv.js";import"./createLucideIcon-BwyFiRot.js";import"./circle-check-DLPObLUx.js";import"./triangle-alert-D87ekDl8.js";import"./copy-DXEmO0TD.js";import"./scenarioStatus-B_8jpV3e.js";import"./InlineSpinner-ByaELMbv.js";const S=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],L=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{L as default,S as meta};
@@ -0,0 +1 @@
1
+ import{w as t}from"./chunk-UVKPFVEO-Bmq2apuh.js";const n=t(function(){return null});export{n as default};