@workflow/web 4.1.0-beta.46 → 4.1.0

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 (24) hide show
  1. package/build/client/assets/{entry.client-BjpmGyLC.js → entry.client-BiVEcoV8.js} +1 -1
  2. package/build/client/assets/{highlighted-body-B3W2YXNL-CCnn-bn-.js → highlighted-body-B3W2YXNL-uFZFLPnf.js} +1 -1
  3. package/build/client/assets/{home-ClC-EMyL.js → home-uJObYcer.js} +1 -1
  4. package/build/client/assets/{index-DklpUtP3.js → index-BmZS3y7B.js} +13 -13
  5. package/build/client/assets/manifest-f539c63d.js +1 -0
  6. package/build/client/assets/{mermaid-3ZIDBTTL-D95wSBpg.js → mermaid-3ZIDBTTL-CsKo7Yup.js} +24 -24
  7. package/build/client/assets/root-CfvTqR04.js +26 -0
  8. package/build/client/assets/root-aMfmV5uh.css +1 -0
  9. package/build/client/assets/{run-detail-Brs1Rm25.js → run-detail-DzPk1eyg.js} +1 -1
  10. package/build/client/assets/server-build-CiTtikBY.css +1 -0
  11. package/build/client/assets/{workflow-graph-viewer-BZlGoIt2.js → workflow-graph-viewer-BmYB4k6X.js} +1 -1
  12. package/build/server/assets/{app-oogZ8ZwV.js → app-Czg8_lQt.js} +33 -8
  13. package/build/server/assets/{highlighted-body-B3W2YXNL-z6TbPMtP.js → highlighted-body-B3W2YXNL-CkjItV-_.js} +5 -5
  14. package/build/server/assets/{index-BL4Kw0eA.js → index-DH6v_ut2.js} +17 -13
  15. package/build/server/assets/{mermaid-3ZIDBTTL-XSKOerl0.js → mermaid-3ZIDBTTL-DeXo6unt.js} +5 -5
  16. package/build/server/assets/{server-build-BnrnOzxz.js → server-build-D_RLM6Vr.js} +29307 -26945
  17. package/build/server/assets/{token-Ct_osLcf.js → token-B_OGugLw.js} +2 -2
  18. package/build/server/assets/{token-util-DQ6afx9q.js → token-util-DwCA_kiW.js} +2 -2
  19. package/build/server/index.js +2 -2
  20. package/package.json +7 -7
  21. package/build/client/assets/manifest-7a6ad03e.js +0 -1
  22. package/build/client/assets/root-Dae_xV-y.js +0 -26
  23. package/build/client/assets/root-DtrAdcW8.css +0 -1
  24. package/build/client/assets/server-build-8B6V768r.css +0 -1
@@ -1,4 +1,4 @@
1
- function Ja(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(n,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xt={exports:{}},ot={};/**
1
+ function Ka(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(n,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xt={exports:{}},ot={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@ function Ja(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Jr;function Ga(){if(Jr)return ot;Jr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:o}}return ot.Fragment=t,ot.jsx=r,ot.jsxs=r,ot}var Gr;function Xa(){return Gr||(Gr=1,Xt.exports=Ga()),Xt.exports}var gs=Xa(),Kt={exports:{}},J={};/**
9
+ */var Gr;function qa(){if(Gr)return ot;Gr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:o}}return ot.Fragment=t,ot.jsx=r,ot.jsxs=r,ot}var Xr;function Qa(){return Xr||(Xr=1,Xt.exports=qa()),Xt.exports}var ws=Qa(),Kt={exports:{}},J={};/**
10
10
  * @license React
11
11
  * react.production.js
12
12
  *
@@ -14,7 +14,7 @@ function Ja(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Xr;function Ka(){if(Xr)return J;Xr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),c=Symbol.iterator;function m(p){return p===null||typeof p!="object"?null:(p=c&&p[c]||p["@@iterator"],typeof p=="function"?p:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,b={};function w(p,L,F){this.props=p,this.context=L,this.refs=b,this.updater=F||g}w.prototype.isReactComponent={},w.prototype.setState=function(p,L){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,L,"setState")},w.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function P(){}P.prototype=w.prototype;function _(p,L,F){this.props=p,this.context=L,this.refs=b,this.updater=F||g}var D=_.prototype=new P;D.constructor=_,R(D,w.prototype),D.isPureReactComponent=!0;var N=Array.isArray,S={H:null,A:null,T:null,S:null,V:null},M=Object.prototype.hasOwnProperty;function A(p,L,F,O,W,q){return F=q.ref,{$$typeof:e,type:p,key:L,ref:F!==void 0?F:null,props:q}}function v(p,L){return A(p.type,L,void 0,void 0,void 0,p.props)}function B(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function H(p){var L={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(F){return L[F]})}var oe=/\/+/g;function V(p,L){return typeof p=="object"&&p!==null&&p.key!=null?H(""+p.key):L.toString(36)}function ie(){}function K(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(ie,ie):(p.status="pending",p.then(function(L){p.status==="pending"&&(p.status="fulfilled",p.value=L)},function(L){p.status==="pending"&&(p.status="rejected",p.reason=L)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function re(p,L,F,O,W){var q=typeof p;(q==="undefined"||q==="boolean")&&(p=null);var z=!1;if(p===null)z=!0;else switch(q){case"bigint":case"string":case"number":z=!0;break;case"object":switch(p.$$typeof){case e:case t:z=!0;break;case d:return z=p._init,re(z(p._payload),L,F,O,W)}}if(z)return W=W(p),z=O===""?"."+V(p,0):O,N(W)?(F="",z!=null&&(F=z.replace(oe,"$&/")+"/"),re(W,L,F,"",function(Me){return Me})):W!=null&&(B(W)&&(W=v(W,F+(W.key==null||p&&p.key===W.key?"":(""+W.key).replace(oe,"$&/")+"/")+z)),L.push(W)),1;z=0;var fe=O===""?".":O+":";if(N(p))for(var le=0;le<p.length;le++)O=p[le],q=fe+V(O,le),z+=re(O,L,F,q,W);else if(le=m(p),typeof le=="function")for(p=le.call(p),le=0;!(O=p.next()).done;)O=O.value,q=fe+V(O,le++),z+=re(O,L,F,q,W);else if(q==="object"){if(typeof p.then=="function")return re(K(p),L,F,O,W);throw L=String(p),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return z}function ee(p,L,F){if(p==null)return p;var O=[],W=0;return re(p,O,"","",function(q){return L.call(F,q,W++)}),O}function ne(p){if(p._status===-1){var L=p._result;L=L(),L.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=L)}if(p._status===1)return p._result.default;throw p._result}var ve=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=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(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)};function te(){}return J.Children={map:ee,forEach:function(p,L,F){ee(p,function(){L.apply(this,arguments)},F)},count:function(p){var L=0;return ee(p,function(){L++}),L},toArray:function(p){return ee(p,function(L){return L})||[]},only:function(p){if(!B(p))throw Error("React.Children.only expected to receive a single React element child.");return p}},J.Component=w,J.Fragment=r,J.Profiler=a,J.PureComponent=_,J.StrictMode=n,J.Suspense=s,J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,J.__COMPILER_RUNTIME={__proto__:null,c:function(p){return S.H.useMemoCache(p)}},J.cache=function(p){return function(){return p.apply(null,arguments)}},J.cloneElement=function(p,L,F){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var O=R({},p.props),W=p.key,q=void 0;if(L!=null)for(z in L.ref!==void 0&&(q=void 0),L.key!==void 0&&(W=""+L.key),L)!M.call(L,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&L.ref===void 0||(O[z]=L[z]);var z=arguments.length-2;if(z===1)O.children=F;else if(1<z){for(var fe=Array(z),le=0;le<z;le++)fe[le]=arguments[le+2];O.children=fe}return A(p.type,W,void 0,void 0,q,O)},J.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},J.createElement=function(p,L,F){var O,W={},q=null;if(L!=null)for(O in L.key!==void 0&&(q=""+L.key),L)M.call(L,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(W[O]=L[O]);var z=arguments.length-2;if(z===1)W.children=F;else if(1<z){for(var fe=Array(z),le=0;le<z;le++)fe[le]=arguments[le+2];W.children=fe}if(p&&p.defaultProps)for(O in z=p.defaultProps,z)W[O]===void 0&&(W[O]=z[O]);return A(p,q,void 0,void 0,null,W)},J.createRef=function(){return{current:null}},J.forwardRef=function(p){return{$$typeof:u,render:p}},J.isValidElement=B,J.lazy=function(p){return{$$typeof:d,_payload:{_status:-1,_result:p},_init:ne}},J.memo=function(p,L){return{$$typeof:l,type:p,compare:L===void 0?null:L}},J.startTransition=function(p){var L=S.T,F={};S.T=F;try{var O=p(),W=S.S;W!==null&&W(F,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(te,ve)}catch(q){ve(q)}finally{S.T=L}},J.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},J.use=function(p){return S.H.use(p)},J.useActionState=function(p,L,F){return S.H.useActionState(p,L,F)},J.useCallback=function(p,L){return S.H.useCallback(p,L)},J.useContext=function(p){return S.H.useContext(p)},J.useDebugValue=function(){},J.useDeferredValue=function(p,L){return S.H.useDeferredValue(p,L)},J.useEffect=function(p,L,F){var O=S.H;if(typeof F=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return O.useEffect(p,L)},J.useId=function(){return S.H.useId()},J.useImperativeHandle=function(p,L,F){return S.H.useImperativeHandle(p,L,F)},J.useInsertionEffect=function(p,L){return S.H.useInsertionEffect(p,L)},J.useLayoutEffect=function(p,L){return S.H.useLayoutEffect(p,L)},J.useMemo=function(p,L){return S.H.useMemo(p,L)},J.useOptimistic=function(p,L){return S.H.useOptimistic(p,L)},J.useReducer=function(p,L,F){return S.H.useReducer(p,L,F)},J.useRef=function(p){return S.H.useRef(p)},J.useState=function(p){return S.H.useState(p)},J.useSyncExternalStore=function(p,L,F){return S.H.useSyncExternalStore(p,L,F)},J.useTransition=function(){return S.H.useTransition()},J.version="19.1.0",J}var Kr;function On(){return Kr||(Kr=1,Kt.exports=Ka()),Kt.exports}var h=On();const qa=Dn(h),Qa=Ja({__proto__:null,default:qa},[h]);var qt={exports:{}},pe={};/**
17
+ */var Kr;function Za(){if(Kr)return J;Kr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),c=Symbol.iterator;function m(p){return p===null||typeof p!="object"?null:(p=c&&p[c]||p["@@iterator"],typeof p=="function"?p:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,b={};function w(p,L,F){this.props=p,this.context=L,this.refs=b,this.updater=F||g}w.prototype.isReactComponent={},w.prototype.setState=function(p,L){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,L,"setState")},w.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function P(){}P.prototype=w.prototype;function _(p,L,F){this.props=p,this.context=L,this.refs=b,this.updater=F||g}var D=_.prototype=new P;D.constructor=_,R(D,w.prototype),D.isPureReactComponent=!0;var N=Array.isArray,S={H:null,A:null,T:null,S:null,V:null},M=Object.prototype.hasOwnProperty;function A(p,L,F,O,W,q){return F=q.ref,{$$typeof:e,type:p,key:L,ref:F!==void 0?F:null,props:q}}function v(p,L){return A(p.type,L,void 0,void 0,void 0,p.props)}function B(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function H(p){var L={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(F){return L[F]})}var oe=/\/+/g;function V(p,L){return typeof p=="object"&&p!==null&&p.key!=null?H(""+p.key):L.toString(36)}function ie(){}function K(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(ie,ie):(p.status="pending",p.then(function(L){p.status==="pending"&&(p.status="fulfilled",p.value=L)},function(L){p.status==="pending"&&(p.status="rejected",p.reason=L)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function re(p,L,F,O,W){var q=typeof p;(q==="undefined"||q==="boolean")&&(p=null);var z=!1;if(p===null)z=!0;else switch(q){case"bigint":case"string":case"number":z=!0;break;case"object":switch(p.$$typeof){case e:case t:z=!0;break;case d:return z=p._init,re(z(p._payload),L,F,O,W)}}if(z)return W=W(p),z=O===""?"."+V(p,0):O,N(W)?(F="",z!=null&&(F=z.replace(oe,"$&/")+"/"),re(W,L,F,"",function(Me){return Me})):W!=null&&(B(W)&&(W=v(W,F+(W.key==null||p&&p.key===W.key?"":(""+W.key).replace(oe,"$&/")+"/")+z)),L.push(W)),1;z=0;var fe=O===""?".":O+":";if(N(p))for(var le=0;le<p.length;le++)O=p[le],q=fe+V(O,le),z+=re(O,L,F,q,W);else if(le=m(p),typeof le=="function")for(p=le.call(p),le=0;!(O=p.next()).done;)O=O.value,q=fe+V(O,le++),z+=re(O,L,F,q,W);else if(q==="object"){if(typeof p.then=="function")return re(K(p),L,F,O,W);throw L=String(p),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return z}function ee(p,L,F){if(p==null)return p;var O=[],W=0;return re(p,O,"","",function(q){return L.call(F,q,W++)}),O}function ne(p){if(p._status===-1){var L=p._result;L=L(),L.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=L)}if(p._status===1)return p._result.default;throw p._result}var ve=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=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(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)};function te(){}return J.Children={map:ee,forEach:function(p,L,F){ee(p,function(){L.apply(this,arguments)},F)},count:function(p){var L=0;return ee(p,function(){L++}),L},toArray:function(p){return ee(p,function(L){return L})||[]},only:function(p){if(!B(p))throw Error("React.Children.only expected to receive a single React element child.");return p}},J.Component=w,J.Fragment=r,J.Profiler=a,J.PureComponent=_,J.StrictMode=n,J.Suspense=s,J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,J.__COMPILER_RUNTIME={__proto__:null,c:function(p){return S.H.useMemoCache(p)}},J.cache=function(p){return function(){return p.apply(null,arguments)}},J.cloneElement=function(p,L,F){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var O=R({},p.props),W=p.key,q=void 0;if(L!=null)for(z in L.ref!==void 0&&(q=void 0),L.key!==void 0&&(W=""+L.key),L)!M.call(L,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&L.ref===void 0||(O[z]=L[z]);var z=arguments.length-2;if(z===1)O.children=F;else if(1<z){for(var fe=Array(z),le=0;le<z;le++)fe[le]=arguments[le+2];O.children=fe}return A(p.type,W,void 0,void 0,q,O)},J.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},J.createElement=function(p,L,F){var O,W={},q=null;if(L!=null)for(O in L.key!==void 0&&(q=""+L.key),L)M.call(L,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(W[O]=L[O]);var z=arguments.length-2;if(z===1)W.children=F;else if(1<z){for(var fe=Array(z),le=0;le<z;le++)fe[le]=arguments[le+2];W.children=fe}if(p&&p.defaultProps)for(O in z=p.defaultProps,z)W[O]===void 0&&(W[O]=z[O]);return A(p,q,void 0,void 0,null,W)},J.createRef=function(){return{current:null}},J.forwardRef=function(p){return{$$typeof:u,render:p}},J.isValidElement=B,J.lazy=function(p){return{$$typeof:d,_payload:{_status:-1,_result:p},_init:ne}},J.memo=function(p,L){return{$$typeof:l,type:p,compare:L===void 0?null:L}},J.startTransition=function(p){var L=S.T,F={};S.T=F;try{var O=p(),W=S.S;W!==null&&W(F,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(te,ve)}catch(q){ve(q)}finally{S.T=L}},J.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},J.use=function(p){return S.H.use(p)},J.useActionState=function(p,L,F){return S.H.useActionState(p,L,F)},J.useCallback=function(p,L){return S.H.useCallback(p,L)},J.useContext=function(p){return S.H.useContext(p)},J.useDebugValue=function(){},J.useDeferredValue=function(p,L){return S.H.useDeferredValue(p,L)},J.useEffect=function(p,L,F){var O=S.H;if(typeof F=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return O.useEffect(p,L)},J.useId=function(){return S.H.useId()},J.useImperativeHandle=function(p,L,F){return S.H.useImperativeHandle(p,L,F)},J.useInsertionEffect=function(p,L){return S.H.useInsertionEffect(p,L)},J.useLayoutEffect=function(p,L){return S.H.useLayoutEffect(p,L)},J.useMemo=function(p,L){return S.H.useMemo(p,L)},J.useOptimistic=function(p,L){return S.H.useOptimistic(p,L)},J.useReducer=function(p,L,F){return S.H.useReducer(p,L,F)},J.useRef=function(p){return S.H.useRef(p)},J.useState=function(p){return S.H.useState(p)},J.useSyncExternalStore=function(p,L,F){return S.H.useSyncExternalStore(p,L,F)},J.useTransition=function(){return S.H.useTransition()},J.version="19.1.0",J}var qr;function kn(){return qr||(qr=1,Kt.exports=Za()),Kt.exports}var h=kn();const eo=On(h),to=Ka({__proto__:null,default:eo},[h]);var qt={exports:{}},pe={};/**
18
18
  * @license React
19
19
  * react-dom.production.js
20
20
  *
@@ -22,7 +22,7 @@ function Ja(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var qr;function Za(){if(qr)return pe;qr=1;var e=On();function t(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(s,l,d){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:c==null?null:""+c,children:s,containerInfo:l,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(s,l){if(s==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,pe.createPortal=function(s,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return o(s,l,null,d)},pe.flushSync=function(s){var l=i.T,d=n.p;try{if(i.T=null,n.p=2,s)return s()}finally{i.T=l,n.p=d,n.d.f()}},pe.preconnect=function(s,l){typeof s=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,n.d.C(s,l))},pe.prefetchDNS=function(s){typeof s=="string"&&n.d.D(s)},pe.preinit=function(s,l){if(typeof s=="string"&&l&&typeof l.as=="string"){var d=l.as,c=u(d,l.crossOrigin),m=typeof l.integrity=="string"?l.integrity:void 0,g=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;d==="style"?n.d.S(s,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:c,integrity:m,fetchPriority:g}):d==="script"&&n.d.X(s,{crossOrigin:c,integrity:m,fetchPriority:g,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},pe.preinitModule=function(s,l){if(typeof s=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var d=u(l.as,l.crossOrigin);n.d.M(s,{crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&n.d.M(s)},pe.preload=function(s,l){if(typeof s=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var d=l.as,c=u(d,l.crossOrigin);n.d.L(s,d,{crossOrigin:c,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},pe.preloadModule=function(s,l){if(typeof s=="string")if(l){var d=u(l.as,l.crossOrigin);n.d.m(s,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else n.d.m(s)},pe.requestFormReset=function(s){n.d.r(s)},pe.unstable_batchedUpdates=function(s,l){return s(l)},pe.useFormState=function(s,l,d){return i.H.useFormState(s,l,d)},pe.useFormStatus=function(){return i.H.useHostTransitionStatus()},pe.version="19.1.0",pe}var Qr;function eo(){if(Qr)return qt.exports;Qr=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qt.exports=Za(),qt.exports}/**
25
+ */var Qr;function ro(){if(Qr)return pe;Qr=1;var e=kn();function t(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(s,l,d){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:c==null?null:""+c,children:s,containerInfo:l,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(s,l){if(s==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,pe.createPortal=function(s,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return o(s,l,null,d)},pe.flushSync=function(s){var l=i.T,d=n.p;try{if(i.T=null,n.p=2,s)return s()}finally{i.T=l,n.p=d,n.d.f()}},pe.preconnect=function(s,l){typeof s=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,n.d.C(s,l))},pe.prefetchDNS=function(s){typeof s=="string"&&n.d.D(s)},pe.preinit=function(s,l){if(typeof s=="string"&&l&&typeof l.as=="string"){var d=l.as,c=u(d,l.crossOrigin),m=typeof l.integrity=="string"?l.integrity:void 0,g=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;d==="style"?n.d.S(s,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:c,integrity:m,fetchPriority:g}):d==="script"&&n.d.X(s,{crossOrigin:c,integrity:m,fetchPriority:g,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},pe.preinitModule=function(s,l){if(typeof s=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var d=u(l.as,l.crossOrigin);n.d.M(s,{crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&n.d.M(s)},pe.preload=function(s,l){if(typeof s=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var d=l.as,c=u(d,l.crossOrigin);n.d.L(s,d,{crossOrigin:c,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},pe.preloadModule=function(s,l){if(typeof s=="string")if(l){var d=u(l.as,l.crossOrigin);n.d.m(s,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else n.d.m(s)},pe.requestFormReset=function(s){n.d.r(s)},pe.unstable_batchedUpdates=function(s,l){return s(l)},pe.useFormState=function(s,l,d){return i.H.useFormState(s,l,d)},pe.useFormStatus=function(){return i.H.useHostTransitionStatus()},pe.version="19.1.0",pe}var Zr;function no(){if(Zr)return qt.exports;Zr=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qt.exports=ro(),qt.exports}/**
26
26
  * react-router v7.13.1
27
27
  *
28
28
  * Copyright (c) Remix Software Inc.
@@ -31,29 +31,29 @@ function Ja(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
31
31
  * LICENSE.md file in the root directory of this source tree.
32
32
  *
33
33
  * @license MIT
34
- */var kn=e=>{throw TypeError(e)},to=(e,t,r)=>t.has(e)||kn("Cannot "+r),Qt=(e,t,r)=>(to(e,t,"read from private field"),r?r.call(e):t.get(e)),ro=(e,t,r)=>t.has(e)?kn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Zr="popstate";function en(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ws(e={}){function t(n,a){var l;let o=(l=a.state)==null?void 0:l.masked,{pathname:i,search:u,hash:s}=o||n.location;return ft("",{pathname:i,search:u,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,a){return typeof a=="string"?a:Pe(a)}return ao(t,r,null,e)}function G(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ue(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function no(){return Math.random().toString(36).substring(2,10)}function tn(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 ft(e,t,r=null,n,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ie(t):t,state:r,key:t&&t.key||n||no(),unstable_mask:a}}function Pe({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 Ie(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function ao(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,u="POP",s=null,l=d();l==null&&(l=0,i.replaceState({...i.state,idx:l},""));function d(){return(i.state||{idx:null}).idx}function c(){u="POP";let w=d(),P=w==null?null:w-l;l=w,s&&s({action:u,location:b.location,delta:P})}function m(w,P){u="PUSH";let _=en(w)?w:ft(b.location,w,P);l=d()+1;let D=tn(_,l),N=b.createHref(_.unstable_mask||_);try{i.pushState(D,"",N)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;a.location.assign(N)}o&&s&&s({action:u,location:b.location,delta:1})}function g(w,P){u="REPLACE";let _=en(w)?w:ft(b.location,w,P);l=d();let D=tn(_,l),N=b.createHref(_.unstable_mask||_);i.replaceState(D,"",N),o&&s&&s({action:u,location:b.location,delta:0})}function R(w){return An(w)}let b={get action(){return u},get location(){return e(a,i)},listen(w){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(Zr,c),s=w,()=>{a.removeEventListener(Zr,c),s=null}},createHref(w){return t(a,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 An(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),G(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Pe(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var ut,rn=class{constructor(e){if(ro(this,ut,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Qt(this,ut).has(e))return Qt(this,ut).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Qt(this,ut).set(e,t)}};ut=new WeakMap;var oo=new Set(["lazy","caseSensitive","path","id","index","children"]);function io(e){return oo.has(e)}var lo=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function so(e){return lo.has(e)}function uo(e){return e.index===!0}function ht(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let u=[...r,String(i)],s=typeof o.id=="string"?o.id:u.join("-");if(G(o.index!==!0||!o.children,"Cannot specify children on an index route"),G(a||!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),uo(o)){let l={...o,id:s};return n[s]=nn(l,t(l)),l}else{let l={...o,id:s,children:void 0};return n[s]=nn(l,t(l)),o.children&&(l.children=ht(o.children,t,u,n,a)),l}})}function nn(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ne(e,t,r="/"){return ct(e,t,r,!1)}function ct(e,t,r,n){let a=typeof t=="string"?Ie(t):t,o=be(a.pathname||"/",r);if(o==null)return null;let i=In(e);co(i);let u=null;for(let s=0;u==null&&s<i.length;++s){let l=Ro(o);u=Eo(i[s],l,n)}return u}function Nn(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function In(e,t=[],r=[],n="",a=!1){let o=(i,u,s=a,l)=>{let d={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&s)return;G(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let c=Ce([n,d.relativePath]),m=r.concat(d);i.children&&i.children.length>0&&(G(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),In(i.children,t,m,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:go(c,i.index),routesMeta:m})};return e.forEach((i,u)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,u);else for(let l of $n(i.path))o(i,u,!0,l)}),t}function $n(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=$n(n.join("/")),u=[];return u.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&u.push(...i),u.map(s=>e.startsWith("/")&&s===""?"/":s)}function co(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:wo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var fo=/^:[\w-]+$/,ho=3,mo=2,po=1,yo=10,vo=-2,an=e=>e==="*";function go(e,t){let r=e.split("/"),n=r.length;return r.some(an)&&(n+=vo),t&&(n+=mo),r.filter(a=>!an(a)).reduce((a,o)=>a+(fo.test(o)?ho:o===""?po:yo),n)}function wo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Eo(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let u=0;u<n.length;++u){let s=n[u],l=u===n.length-1,d=o==="/"?t:t.slice(o.length)||"/",c=It({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},d),m=s.route;if(!c&&l&&r&&!n[n.length-1].route.index&&(c=It({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},d)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:Ce([o,c.pathname]),pathnameBase:Lo(Ce([o,c.pathnameBase])),route:m}),c.pathnameBase!=="/"&&(o=Ce([o,c.pathnameBase]))}return i}function It(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Fn(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:n.reduce((l,{paramName:d,isOptional:c},m)=>{if(d==="*"){let R=u[m]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=u[m];return c&&!g?l[d]=void 0:l[d]=(g||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:i,pattern:e}}function Fn(e,t=!1,r=!0){ue(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,s,l,d)=>{if(n.push({paramName:u,isOptional:s!=null}),s){let c=d.charAt(l+i.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Ro(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ue(!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 be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function bo({basename:e,pathname:t}){return t==="/"?e:Ce([e,t])}var jn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wr=e=>jn.test(e);function So(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ie(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=on(r.substring(1),"/"):o=on(r,t)):o=t,{pathname:o,search:xo(n),hash:Co(a)}}function on(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Zt(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Un(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Er(e){let t=Un(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function jt(e,t,r,n=!1){let a;typeof e=="string"?a=Ie(e):(a={...e},G(!a.pathname||!a.pathname.includes("?"),Zt("?","pathname","search",a)),G(!a.pathname||!a.pathname.includes("#"),Zt("#","pathname","hash",a)),G(!a.search||!a.search.includes("#"),Zt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,u;if(i==null)u=r;else{let c=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),c-=1;a.pathname=m.join("/")}u=c>=0?t[c]:"/"}let s=So(a,u),l=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(l||d)&&(s.pathname+="/"),s}var Ce=e=>e.join("/").replace(/\/\/+/g,"/"),Lo=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Co=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Po=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function _o(e,t){return new Po(e,typeof t=="number"?{status:t}:t)}var To=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},Ue=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Je(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Hn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function zn(e,t){let r=e;if(typeof r!="string"||!jn.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(Hn)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),u=be(i.pathname,t);i.origin===o.origin&&u!=null?r=u+i.search+i.hash:a=!0}catch{ue(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var je=Symbol("Uninstrumented");function Mo(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let u of i)o[u]&&r[u].push(o[u])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=Qe(r.lazy,t.lazy,()=>{});a&&(n.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let i=a[o],u=r[`lazy.${o}`];if(typeof i=="function"&&u.length>0){let s=Qe(u,i,()=>{});s&&(n.lazy=Object.assign(n.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[je]??o,u=Qe(r[a],i,(...s)=>ln(s[0]));u&&(a==="loader"&&i.hydrate===!0&&(u.hydrate=!0),u[je]=i,n[a]=u)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[je]??a,i=Qe(r.middleware,o,(...u)=>ln(u[0]));return i?(i[je]=o,i):a})),n}function Do(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(a){let o=Object.keys(a);for(let i of o)a[i]&&r[i].push(a[i])}})),r.navigate.length>0){let n=e.navigate[je]??e.navigate,a=Qe(r.navigate,n,(...o)=>{let[i,u]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Pe(i):".",...sn(e,u??{})}});a&&(a[je]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[je]??e.fetch,a=Qe(r.fetch,n,(...o)=>{let[i,,u,s]=o;return{href:u??".",fetcherKey:i,...sn(e,s??{})}});a&&(a[je]=n,e.fetch=a)}return e}function Qe(e,t,r){return e.length===0?null:async(...n)=>{let a=await Bn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function Bn(e,t,r,n){let a=e[n],o;if(a){let i,u=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Bn(e,t,r,n-1),o=await i,G(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(u,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await u(),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 ln(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:Oo(t),params:{...n},unstable_pattern:a,context:ko(r)}}function sn(e,t){return{currentUrl:Pe(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 Oo(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function ko(e){if(No(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Ao=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function No(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")===Ao}var Wn=["POST","PUT","PATCH","DELETE"],Io=new Set(Wn),$o=["GET",...Wn],Fo=new Set($o),Yn=new Set([301,302,303,307,308]),jo=new Set([307,308]),er={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Uo={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},it={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ho=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Vn="remix-router-transitions",Jn=Symbol("ResetLoaderData");function Es(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";G(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Ho,o=a;if(e.unstable_instrumentations){let f=e.unstable_instrumentations;o=y=>({...a(y),...Mo(f.map(E=>E.route).filter(Boolean),y)})}let i={},u=ht(e.routes,o,void 0,i),s,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let d=e.dataStrategy||Vo,c={...e.future},m=null,g=new Set,R=null,b=null,w=null,P=e.hydrationData!=null,_=Ne(u,e.history.location,l),D=!1,N=null,S,M;if(_==null&&!e.patchRoutesOnNavigation){let f=Le(404,{pathname:e.history.location.pathname}),{matches:y,route:E}=Ct(u);S=!0,M=!S,_=y,N={[E.id]:f}}else if(_&&!e.hydrationData&&Rt(_,u,e.history.location.pathname).active&&(_=null),_)if(_.some(f=>f.route.lazy))S=!1,M=!S;else if(!_.some(f=>Rr(f.route)))S=!0,M=!S;else{let f=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null,E=_;if(y){let x=_.findIndex(C=>y[C.route.id]!==void 0);E=E.slice(0,x+1)}M=!1,S=E.every(x=>{let C=Gn(x.route,f,y);return M=M||C.renderFallback,!C.shouldLoad})}else{S=!1,M=!S,_=[];let f=Rt(null,u,e.history.location.pathname);f.active&&f.matches&&(D=!0,_=f.matches)}let A,v={historyAction:e.history.action,location:e.history.location,matches:_,initialized:S,renderFallback:M,navigation:er,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||N,fetchers:new Map,blockers:new Map},B="POP",H=null,oe=!1,V,ie=!1,K=new Map,re=null,ee=!1,ne=!1,ve=new Set,te=new Map,p=0,L=-1,F=new Map,O=new Set,W=new Map,q=new Map,z=new Set,fe=new Map,le,Me=null;function Ta(){if(m=e.history.listen(({action:f,location:y,delta:E})=>{if(le){le(),le=void 0;return}ue(fe.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 x=zr({currentLocation:v.location,nextLocation:y,historyAction:f});if(x&&E!=null){let C=new Promise(I=>{le=I});e.history.go(E*-1),Et(x,{state:"blocked",location:y,proceed(){Et(x,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),C.then(()=>e.history.go(E))},reset(){let I=new Map(v.blockers);I.set(x,it),he({blockers:I})}}),H==null||H.resolve(),H=null;return}return He(f,y)}),r){ci(t,K);let f=()=>di(t,K);t.addEventListener("pagehide",f),re=()=>t.removeEventListener("pagehide",f)}return v.initialized||He("POP",v.location,{initialHydration:!0}),A}function Ma(){m&&m(),re&&re(),g.clear(),V&&V.abort(),v.fetchers.forEach((f,y)=>Vt(y)),v.blockers.forEach((f,y)=>Hr(y))}function Da(f){return g.add(f),()=>g.delete(f)}function he(f,y={}){f.matches&&(f.matches=f.matches.map(C=>{let I=i[C.route.id],j=C.route;return j.element!==I.element||j.errorElement!==I.errorElement||j.hydrateFallbackElement!==I.hydrateFallbackElement?{...C,route:I}:C})),v={...v,...f};let E=[],x=[];v.fetchers.forEach((C,I)=>{C.state==="idle"&&(z.has(I)?E.push(I):x.push(I))}),z.forEach(C=>{!v.fetchers.has(C)&&!te.has(C)&&E.push(C)}),[...g].forEach(C=>C(v,{deletedFetchers:E,newErrors:f.errors??null,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),E.forEach(C=>Vt(C)),x.forEach(C=>v.fetchers.delete(C))}function Xe(f,y,{flushSync:E}={}){var Y,$;let x=v.actionData!=null&&v.navigation.formMethod!=null&&ye(v.navigation.formMethod)&&v.navigation.state==="loading"&&((Y=f.state)==null?void 0:Y._isRedirect)!==!0,C;y.actionData?Object.keys(y.actionData).length>0?C=y.actionData:C=null:x?C=v.actionData:C=null;let I=y.loaderData?gn(v.loaderData,y.loaderData,y.matches||[],y.errors):v.loaderData,j=v.blockers;j.size>0&&(j=new Map(j),j.forEach((X,Q)=>j.set(Q,it)));let k=ee?!1:Wr(f,y.matches||v.matches),T=oe===!0||v.navigation.formMethod!=null&&ye(v.navigation.formMethod)&&(($=f.state)==null?void 0:$._isRedirect)!==!0;s&&(u=s,s=void 0),ee||B==="POP"||(B==="PUSH"?e.history.push(f,f.state):B==="REPLACE"&&e.history.replace(f,f.state));let U;if(B==="POP"){let X=K.get(v.location.pathname);X&&X.has(f.pathname)?U={currentLocation:v.location,nextLocation:f}:K.has(f.pathname)&&(U={currentLocation:f,nextLocation:v.location})}else if(ie){let X=K.get(v.location.pathname);X?X.add(f.pathname):(X=new Set([f.pathname]),K.set(v.location.pathname,X)),U={currentLocation:v.location,nextLocation:f}}he({...y,actionData:C,loaderData:I,historyAction:B,location:f,initialized:!0,renderFallback:!1,navigation:er,revalidation:"idle",restoreScrollPosition:k,preventScrollReset:T,blockers:j},{viewTransitionOpts:U,flushSync:E===!0}),B="POP",oe=!1,ie=!1,ee=!1,ne=!1,H==null||H.resolve(),H=null,Me==null||Me.resolve(),Me=null}async function Ar(f,y){if(H==null||H.resolve(),H=null,typeof f=="number"){H||(H=Rn());let se=H.promise;return e.history.go(f),se}let E=lr(v.location,v.matches,l,f,y==null?void 0:y.fromRouteId,y==null?void 0:y.relative),{path:x,submission:C,error:I}=un(!1,E,y),j;y!=null&&y.unstable_mask&&(j={pathname:"",search:"",hash:"",...typeof y.unstable_mask=="string"?Ie(y.unstable_mask):{...v.location.unstable_mask,...y.unstable_mask}});let k=v.location,T=ft(k,x,y&&y.state,void 0,j);T={...T,...e.history.encodeLocation(T)};let U=y&&y.replace!=null?y.replace:void 0,Y="PUSH";U===!0?Y="REPLACE":U===!1||C!=null&&ye(C.formMethod)&&C.formAction===v.location.pathname+v.location.search&&(Y="REPLACE");let $=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,X=(y&&y.flushSync)===!0,Q=zr({currentLocation:k,nextLocation:T,historyAction:Y});if(Q){Et(Q,{state:"blocked",location:T,proceed(){Et(Q,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),Ar(f,y)},reset(){let se=new Map(v.blockers);se.set(Q,it),he({blockers:se})}});return}await He(Y,T,{submission:C,pendingError:I,preventScrollReset:$,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:X,callSiteDefaultShouldRevalidate:y&&y.unstable_defaultShouldRevalidate})}function Oa(){Me||(Me=Rn()),Yt(),he({revalidation:"loading"});let f=Me.promise;return v.navigation.state==="submitting"?f:v.navigation.state==="idle"?(He(v.historyAction,v.location,{startUninterruptedRevalidation:!0}),f):(He(B||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation,enableViewTransition:ie===!0}),f)}async function He(f,y,E){V&&V.abort(),V=null,B=f,ee=(E&&E.startUninterruptedRevalidation)===!0,Ba(v.location,v.matches),oe=(E&&E.preventScrollReset)===!0,ie=(E&&E.enableViewTransition)===!0;let x=s||u,C=E&&E.overrideNavigation,I=E!=null&&E.initialHydration&&v.matches&&v.matches.length>0&&!D?v.matches:Ne(x,y,l),j=(E&&E.flushSync)===!0;if(I&&v.initialized&&!ne&&ei(v.location,y)&&!(E&&E.submission&&ye(E.submission.formMethod))){Xe(y,{matches:I},{flushSync:j});return}let k=Rt(I,x,y.pathname);if(k.active&&k.matches&&(I=k.matches),!I){let{error:de,notFoundMatches:ge,route:ae}=Jt(y.pathname);Xe(y,{matches:ge,loaderData:{},errors:{[ae.id]:de}},{flushSync:j});return}V=new AbortController;let T=qe(e.history,y,V.signal,E&&E.submission),U=e.getContext?await e.getContext():new rn,Y;if(E&&E.pendingError)Y=[Fe(I).route.id,{type:"error",error:E.pendingError}];else if(E&&E.submission&&ye(E.submission.formMethod)){let de=await ka(T,y,E.submission,I,U,k.active,E&&E.initialHydration===!0,{replace:E.replace,flushSync:j});if(de.shortCircuited)return;if(de.pendingActionResult){let[ge,ae]=de.pendingActionResult;if(Re(ae)&&Je(ae.error)&&ae.error.status===404){V=null,Xe(y,{matches:de.matches,loaderData:{},errors:{[ge]:ae.error}});return}}I=de.matches||I,Y=de.pendingActionResult,C=tr(y,E.submission),j=!1,k.active=!1,T=qe(e.history,T.url,T.signal)}let{shortCircuited:$,matches:X,loaderData:Q,errors:se}=await Aa(T,y,I,U,k.active,C,E&&E.submission,E&&E.fetcherSubmission,E&&E.replace,E&&E.initialHydration===!0,j,Y,E&&E.callSiteDefaultShouldRevalidate);$||(V=null,Xe(y,{matches:X||I,...wn(Y),loaderData:Q,errors:se}))}async function ka(f,y,E,x,C,I,j,k={}){Yt();let T=si(y,E);if(he({navigation:T},{flushSync:k.flushSync===!0}),I){let $=await bt(x,y.pathname,f.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:Q,route:se}=Ct(u);return{matches:Q,pendingActionResult:[se.id,{type:"error",error:$.error}]}}let X=Fe($.partialMatches).route.id;return{matches:$.partialMatches,pendingActionResult:[X,{type:"error",error:$.error}]}}else if($.matches)x=$.matches;else{let{notFoundMatches:X,error:Q,route:se}=Jt(y.pathname);return{matches:X,pendingActionResult:[se.id,{type:"error",error:Q}]}}}let U,Y=Ot(x,y);if(!Y.route.action&&!Y.route.lazy)U={type:"error",error:Le(405,{method:f.method,pathname:y.pathname,routeId:Y.route.id})};else{let $=Ze(o,i,f,x,Y,j?[]:n,C),X=await rt(f,$,C,null);if(U=X[Y.route.id],!U){for(let Q of x)if(X[Q.route.id]){U=X[Q.route.id];break}}if(f.signal.aborted)return{shortCircuited:!0}}if(Ve(U)){let $;return k&&k.replace!=null?$=k.replace:$=pn(U.response.headers.get("Location"),new URL(f.url),l,e.history)===v.location.pathname+v.location.search,await ze(f,U,!0,{submission:E,replace:$}),{shortCircuited:!0}}if(Re(U)){let $=Fe(x,Y.route.id);return(k&&k.replace)!==!0&&(B="PUSH"),{matches:x,pendingActionResult:[$.route.id,U,Y.route.id]}}return{matches:x,pendingActionResult:[Y.route.id,U]}}async function Aa(f,y,E,x,C,I,j,k,T,U,Y,$,X){let Q=I||tr(y,j),se=j||k||En(Q),de=!ee&&!U;if(C){if(de){let me=Nr($);he({navigation:Q,...me!==void 0?{actionData:me}:{}},{flushSync:Y})}let Z=await bt(E,y.pathname,f.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){if(Z.partialMatches.length===0){let{matches:Ke,route:Ye}=Ct(u);return{matches:Ke,loaderData:{},errors:{[Ye.id]:Z.error}}}let me=Fe(Z.partialMatches).route.id;return{matches:Z.partialMatches,loaderData:{},errors:{[me]:Z.error}}}else if(Z.matches)E=Z.matches;else{let{error:me,notFoundMatches:Ke,route:Ye}=Jt(y.pathname);return{matches:Ke,loaderData:{},errors:{[Ye.id]:me}}}}let ge=s||u,{dsMatches:ae,revalidatingFetchers:Se}=cn(f,x,o,i,e.history,v,E,se,y,U?[]:n,U===!0,ne,ve,z,W,O,ge,l,e.patchRoutesOnNavigation!=null,$,X);if(L=++p,!e.dataStrategy&&!ae.some(Z=>Z.shouldLoad)&&!ae.some(Z=>Z.route.middleware&&Z.route.middleware.length>0)&&Se.length===0){let Z=jr();return Xe(y,{matches:E,loaderData:{},errors:$&&Re($[1])?{[$[0]]:$[1].error}:null,...wn($),...Z?{fetchers:new Map(v.fetchers)}:{}},{flushSync:Y}),{shortCircuited:!0}}if(de){let Z={};if(!C){Z.navigation=Q;let me=Nr($);me!==void 0&&(Z.actionData=me)}Se.length>0&&(Z.fetchers=Na(Se)),he(Z,{flushSync:Y})}Se.forEach(Z=>{ke(Z.key),Z.controller&&te.set(Z.key,Z.controller)});let Be=()=>Se.forEach(Z=>ke(Z.key));V&&V.signal.addEventListener("abort",Be);let{loaderResults:nt,fetcherResults:$e}=await Ir(ae,Se,f,x);if(f.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",Be),Se.forEach(Z=>te.delete(Z.key));let Te=Pt(nt);if(Te)return await ze(f,Te.result,!0,{replace:T}),{shortCircuited:!0};if(Te=Pt($e),Te)return O.add(Te.key),await ze(f,Te.result,!0,{replace:T}),{shortCircuited:!0};let{loaderData:Gt,errors:at}=vn(v,E,nt,$,Se,$e);U&&v.errors&&(at={...v.errors,...at});let We=jr(),St=Ur(L),Lt=We||St||Se.length>0;return{matches:E,loaderData:Gt,errors:at,...Lt?{fetchers:new Map(v.fetchers)}:{}}}function Nr(f){if(f&&!Re(f[1]))return{[f[0]]:f[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function Na(f){return f.forEach(y=>{let E=v.fetchers.get(y.key),x=lt(void 0,E?E.data:void 0);v.fetchers.set(y.key,x)}),new Map(v.fetchers)}async function Ia(f,y,E,x){ke(f);let C=(x&&x.flushSync)===!0,I=s||u,j=lr(v.location,v.matches,l,E,y,x==null?void 0:x.relative),k=Ne(I,j,l),T=Rt(k,I,j);if(T.active&&T.matches&&(k=T.matches),!k){Oe(f,y,Le(404,{pathname:j}),{flushSync:C});return}let{path:U,submission:Y,error:$}=un(!0,j,x);if($){Oe(f,y,$,{flushSync:C});return}let X=e.getContext?await e.getContext():new rn,Q=(x&&x.preventScrollReset)===!0;if(Y&&ye(Y.formMethod)){await $a(f,y,U,k,X,T.active,C,Q,Y,x&&x.unstable_defaultShouldRevalidate);return}W.set(f,{routeId:y,path:U}),await Fa(f,y,U,k,X,T.active,C,Q,Y)}async function $a(f,y,E,x,C,I,j,k,T,U){Yt(),W.delete(f);let Y=v.fetchers.get(f);De(f,ui(T,Y),{flushSync:j});let $=new AbortController,X=qe(e.history,E,$.signal,T);if(I){let ce=await bt(x,new URL(X.url).pathname,X.signal,f);if(ce.type==="aborted")return;if(ce.type==="error"){Oe(f,y,ce.error,{flushSync:j});return}else if(ce.matches)x=ce.matches;else{Oe(f,y,Le(404,{pathname:E}),{flushSync:j});return}}let Q=Ot(x,E);if(!Q.route.action&&!Q.route.lazy){let ce=Le(405,{method:T.formMethod,pathname:E,routeId:y});Oe(f,y,ce,{flushSync:j});return}te.set(f,$);let se=p,de=Ze(o,i,X,x,Q,n,C),ge=await rt(X,de,C,f),ae=ge[Q.route.id];if(!ae){for(let ce of de)if(ge[ce.route.id]){ae=ge[ce.route.id];break}}if(X.signal.aborted){te.get(f)===$&&te.delete(f);return}if(z.has(f)){if(Ve(ae)||Re(ae)){De(f,Ae(void 0));return}}else{if(Ve(ae))if(te.delete(f),L>se){De(f,Ae(void 0));return}else return O.add(f),De(f,lt(T)),ze(X,ae,!1,{fetcherSubmission:T,preventScrollReset:k});if(Re(ae)){Oe(f,y,ae.error);return}}let Se=v.navigation.location||v.location,Be=qe(e.history,Se,$.signal),nt=s||u,$e=v.navigation.state!=="idle"?Ne(nt,v.navigation.location,l):v.matches;G($e,"Didn't find any matches after fetcher action");let Te=++p;F.set(f,Te);let Gt=lt(T,ae.data);v.fetchers.set(f,Gt);let{dsMatches:at,revalidatingFetchers:We}=cn(Be,C,o,i,e.history,v,$e,T,Se,n,!1,ne,ve,z,W,O,nt,l,e.patchRoutesOnNavigation!=null,[Q.route.id,ae],U);We.filter(ce=>ce.key!==f).forEach(ce=>{let xt=ce.key,Vr=v.fetchers.get(xt),Va=lt(void 0,Vr?Vr.data:void 0);v.fetchers.set(xt,Va),ke(xt),ce.controller&&te.set(xt,ce.controller)}),he({fetchers:new Map(v.fetchers)});let St=()=>We.forEach(ce=>ke(ce.key));$.signal.addEventListener("abort",St);let{loaderResults:Lt,fetcherResults:Z}=await Ir(at,We,Be,C);if($.signal.aborted)return;if($.signal.removeEventListener("abort",St),F.delete(f),te.delete(f),We.forEach(ce=>te.delete(ce.key)),v.fetchers.has(f)){let ce=Ae(ae.data);v.fetchers.set(f,ce)}let me=Pt(Lt);if(me)return ze(Be,me.result,!1,{preventScrollReset:k});if(me=Pt(Z),me)return O.add(me.key),ze(Be,me.result,!1,{preventScrollReset:k});let{loaderData:Ke,errors:Ye}=vn(v,$e,Lt,void 0,We,Z);Ur(Te),v.navigation.state==="loading"&&Te>L?(G(B,"Expected pending action"),V&&V.abort(),Xe(v.navigation.location,{matches:$e,loaderData:Ke,errors:Ye,fetchers:new Map(v.fetchers)})):(he({errors:Ye,loaderData:gn(v.loaderData,Ke,$e,Ye),fetchers:new Map(v.fetchers)}),ne=!1)}async function Fa(f,y,E,x,C,I,j,k,T){let U=v.fetchers.get(f);De(f,lt(T,U?U.data:void 0),{flushSync:j});let Y=new AbortController,$=qe(e.history,E,Y.signal);if(I){let ae=await bt(x,new URL($.url).pathname,$.signal,f);if(ae.type==="aborted")return;if(ae.type==="error"){Oe(f,y,ae.error,{flushSync:j});return}else if(ae.matches)x=ae.matches;else{Oe(f,y,Le(404,{pathname:E}),{flushSync:j});return}}let X=Ot(x,E);te.set(f,Y);let Q=p,se=Ze(o,i,$,x,X,n,C),ge=(await rt($,se,C,f))[X.route.id];if(te.get(f)===Y&&te.delete(f),!$.signal.aborted){if(z.has(f)){De(f,Ae(void 0));return}if(Ve(ge))if(L>Q){De(f,Ae(void 0));return}else{O.add(f),await ze($,ge,!1,{preventScrollReset:k});return}if(Re(ge)){Oe(f,y,ge.error);return}De(f,Ae(ge.data))}}async function ze(f,y,E,{submission:x,fetcherSubmission:C,preventScrollReset:I,replace:j}={}){E||(H==null||H.resolve(),H=null),y.response.headers.has("X-Remix-Revalidate")&&(ne=!0);let k=y.response.headers.get("Location");G(k,"Expected a Location header on the redirect Response"),k=pn(k,new URL(f.url),l,e.history);let T=ft(v.location,k,{_isRedirect:!0});if(r){let se=!1;if(y.response.headers.has("X-Remix-Reload-Document"))se=!0;else if(wr(k)){const de=An(k,!0);se=de.origin!==t.location.origin||be(de.pathname,l)==null}if(se){j?t.location.replace(k):t.location.assign(k);return}}V=null;let U=j===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Y,formAction:$,formEncType:X}=v.navigation;!x&&!C&&Y&&$&&X&&(x=En(v.navigation));let Q=x||C;if(jo.has(y.response.status)&&Q&&ye(Q.formMethod))await He(U,T,{submission:{...Q,formAction:k},preventScrollReset:I||oe,enableViewTransition:E?ie:void 0});else{let se=tr(T,x);await He(U,T,{overrideNavigation:se,fetcherSubmission:C,preventScrollReset:I||oe,enableViewTransition:E?ie:void 0})}}async function rt(f,y,E,x){var j;let C,I={};try{C=await Go(d,f,y,x,E,!1)}catch(k){return y.filter(T=>T.shouldLoad).forEach(T=>{I[T.route.id]={type:"error",error:k}}),I}if(f.signal.aborted)return I;if(!ye(f.method))for(let k of y){if(((j=C[k.route.id])==null?void 0:j.type)==="error")break;!C.hasOwnProperty(k.route.id)&&!v.loaderData.hasOwnProperty(k.route.id)&&(!v.errors||!v.errors.hasOwnProperty(k.route.id))&&k.shouldCallHandler()&&(C[k.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${k.route.id}`)})}for(let[k,T]of Object.entries(C))if(ai(T)){let U=T.result;I[k]={type:"redirect",response:Qo(U,f,k,y,l)}}else I[k]=await qo(T);return I}async function Ir(f,y,E,x){let C=rt(E,f,x,null),I=Promise.all(y.map(async T=>{if(T.matches&&T.match&&T.request&&T.controller){let Y=(await rt(T.request,T.matches,x,T.key))[T.match.route.id];return{[T.key]:Y}}else return Promise.resolve({[T.key]:{type:"error",error:Le(404,{pathname:T.path})}})})),j=await C,k=(await I).reduce((T,U)=>Object.assign(T,U),{});return{loaderResults:j,fetcherResults:k}}function Yt(){ne=!0,W.forEach((f,y)=>{te.has(y)&&ve.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,x={}){let C=Fe(v.matches,y);Vt(f),he({errors:{[C.route.id]:E},fetchers:new Map(v.fetchers)},{flushSync:(x&&x.flushSync)===!0})}function $r(f){return q.set(f,(q.get(f)||0)+1),z.has(f)&&z.delete(f),v.fetchers.get(f)||Uo}function ja(f,y){ke(f,y==null?void 0:y.reason),De(f,Ae(null))}function Vt(f){let y=v.fetchers.get(f);te.has(f)&&!(y&&y.state==="loading"&&F.has(f))&&ke(f),W.delete(f),F.delete(f),O.delete(f),z.delete(f),ve.delete(f),v.fetchers.delete(f)}function Ua(f){let y=(q.get(f)||0)-1;y<=0?(q.delete(f),z.add(f)):q.set(f,y),he({fetchers:new Map(v.fetchers)})}function ke(f,y){let E=te.get(f);E&&(E.abort(y),te.delete(f))}function Fr(f){for(let y of f){let E=$r(y),x=Ae(E.data);v.fetchers.set(y,x)}}function jr(){let f=[],y=!1;for(let E of O){let x=v.fetchers.get(E);G(x,`Expected fetcher: ${E}`),x.state==="loading"&&(O.delete(E),f.push(E),y=!0)}return Fr(f),y}function Ur(f){let y=[];for(let[E,x]of F)if(x<f){let C=v.fetchers.get(E);G(C,`Expected fetcher: ${E}`),C.state==="loading"&&(ke(E),F.delete(E),y.push(E))}return Fr(y),y.length>0}function Ha(f,y){let E=v.blockers.get(f)||it;return fe.get(f)!==y&&fe.set(f,y),E}function Hr(f){v.blockers.delete(f),fe.delete(f)}function Et(f,y){let E=v.blockers.get(f)||it;G(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 x=new Map(v.blockers);x.set(f,y),he({blockers:x})}function zr({currentLocation:f,nextLocation:y,historyAction:E}){if(fe.size===0)return;fe.size>1&&ue(!1,"A router only supports one blocker at a time");let x=Array.from(fe.entries()),[C,I]=x[x.length-1],j=v.blockers.get(C);if(!(j&&j.state==="proceeding")&&I({currentLocation:f,nextLocation:y,historyAction:E}))return C}function Jt(f){let y=Le(404,{pathname:f}),E=s||u,{matches:x,route:C}=Ct(E);return{notFoundMatches:x,route:C,error:y}}function za(f,y,E){if(R=f,w=y,b=E||null,!P&&v.navigation===er){P=!0;let x=Wr(v.location,v.matches);x!=null&&he({restoreScrollPosition:x})}return()=>{R=null,w=null,b=null}}function Br(f,y){return b&&b(f,y.map(x=>Nn(x,v.loaderData)))||f.key}function Ba(f,y){if(R&&w){let E=Br(f,y);R[E]=w()}}function Wr(f,y){if(R){let E=Br(f,y),x=R[E];if(typeof x=="number")return x}return null}function Rt(f,y,E){if(e.patchRoutesOnNavigation)if(f){if(Object.keys(f[0].params).length>0)return{active:!0,matches:ct(y,E,l,!0)}}else return{active:!0,matches:ct(y,E,l,!0)||[]};return{active:!1,matches:null}}async function bt(f,y,E,x){if(!e.patchRoutesOnNavigation)return{type:"success",matches:f};let C=f;for(;;){let I=s==null,j=s||u,k=i;try{await e.patchRoutesOnNavigation({signal:E,path:y,matches:C,fetcherKey:x,patch:(Y,$)=>{E.aborted||dn(Y,$,j,k,o,!1)}})}catch(Y){return{type:"error",error:Y,partialMatches:C}}finally{I&&!E.aborted&&(u=[...u])}if(E.aborted)return{type:"aborted"};let T=Ne(j,y,l),U=null;if(T){if(Object.keys(T[0].params).length===0)return{type:"success",matches:T};if(U=ct(j,y,l,!0),!(U&&C.length<U.length&&Yr(C,U.slice(0,C.length))))return{type:"success",matches:T}}if(U||(U=ct(j,y,l,!0)),!U||Yr(C,U))return{type:"success",matches:null};C=U}}function Yr(f,y){return f.length===y.length&&f.every((E,x)=>E.route.id===y[x].route.id)}function Wa(f){i={},s=ht(f,o,void 0,i)}function Ya(f,y,E=!1){let x=s==null;dn(f,y,s||u,i,o,E),x&&(u=[...u],he({}))}return A={get basename(){return l},get future(){return c},get state(){return v},get routes(){return u},get window(){return t},initialize:Ta,subscribe:Da,enableScrollRestoration:za,navigate:Ar,fetch:Ia,revalidate:Oa,createHref:f=>e.history.createHref(f),encodeLocation:f=>e.history.encodeLocation(f),getFetcher:$r,resetFetcher:ja,deleteFetcher:Ua,dispose:Ma,getBlocker:Ha,deleteBlocker:Hr,patchRoutes:Ya,_internalFetchControllers:te,_internalSetRoutes:Wa,_internalSetStateDoNotUseOrYouWillBreakYourApp(f){he(f)}},e.unstable_instrumentations&&(A=Do(A,e.unstable_instrumentations.map(f=>f.router).filter(Boolean))),A}function zo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function lr(e,t,r,n,a,o){let i,u;if(a){i=[];for(let l of t)if(i.push(l),l.route.id===a){u=l;break}}else i=t,u=t[t.length-1];let s=jt(n||".",Er(i),be(e.pathname,r)||e.pathname,o==="path");if(n==null&&(s.search=e.search,s.hash=e.hash),(n==null||n===""||n===".")&&u){let l=br(s.search);if(u.route.index&&!l)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&l){let d=new URLSearchParams(s.search),c=d.getAll("index");d.delete("index"),c.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();s.search=m?`?${m}`:""}}return r!=="/"&&(s.pathname=bo({basename:r,pathname:s.pathname})),Pe(s)}function un(e,t,r){if(!r||!zo(r))return{path:t};if(r.formMethod&&!li(r.formMethod))return{path:t,error:Le(405,{method:r.formMethod})};let n=()=>({path:t,error:Le(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=ea(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ye(o))return n();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}
35
- `,""):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(!ye(o))return n();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 n()}}}G(typeof FormData=="function","FormData is not available in this environment");let u,s;if(r.formData)u=ur(r.formData),s=r.formData;else if(r.body instanceof FormData)u=ur(r.body),s=r.body;else if(r.body instanceof URLSearchParams)u=r.body,s=yn(u);else if(r.body==null)u=new URLSearchParams,s=new FormData;else try{u=new URLSearchParams(r.body),s=yn(u)}catch{return n()}let l={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(ye(l.formMethod))return{path:t,submission:l};let d=Ie(t);return e&&d.search&&br(d.search)&&u.append("index",""),d.search=`?${u}`,{path:Pe(d),submission:l}}function cn(e,t,r,n,a,o,i,u,s,l,d,c,m,g,R,b,w,P,_,D,N){var re;let S=D?Re(D[1])?D[1].error:D[1].data:void 0,M=a.createURL(o.location),A=a.createURL(s),v;if(d&&o.errors){let ee=Object.keys(o.errors)[0];v=i.findIndex(ne=>ne.route.id===ee)}else if(D&&Re(D[1])){let ee=D[0];v=i.findIndex(ne=>ne.route.id===ee)-1}let B=D?D[1].statusCode:void 0,H=B&&B>=400,oe={currentUrl:M,currentParams:((re=o.matches[0])==null?void 0:re.params)||{},nextUrl:A,nextParams:i[0].params,...u,actionResult:S,actionStatus:B},V=pt(i),ie=i.map((ee,ne)=>{let{route:ve}=ee,te=null;if(v!=null&&ne>v)te=!1;else if(ve.lazy)te=!0;else if(!Rr(ve))te=!1;else if(d){let{shouldLoad:O}=Gn(ve,o.loaderData,o.errors);te=O}else Bo(o.loaderData,o.matches[ne],ee)&&(te=!0);if(te!==null)return sr(r,n,e,V,ee,l,t,te);let p=!1;typeof N=="boolean"?p=N:H?p=!1:(c||M.pathname+M.search===A.pathname+A.search||M.search!==A.search||Wo(o.matches[ne],ee))&&(p=!0);let L={...oe,defaultShouldRevalidate:p},F=dt(ee,L);return sr(r,n,e,V,ee,l,t,F,L,N)}),K=[];return R.forEach((ee,ne)=>{if(d||!i.some(q=>q.route.id===ee.routeId)||g.has(ne))return;let ve=o.fetchers.get(ne),te=ve&&ve.state!=="idle"&&ve.data===void 0,p=Ne(w,ee.path,P);if(!p){if(_&&te)return;K.push({key:ne,routeId:ee.routeId,path:ee.path,matches:null,match:null,request:null,controller:null});return}if(b.has(ne))return;let L=Ot(p,ee.path),F=new AbortController,O=qe(a,ee.path,F.signal),W=null;if(m.has(ne))m.delete(ne),W=Ze(r,n,O,p,L,l,t);else if(te)c&&(W=Ze(r,n,O,p,L,l,t));else{let q;typeof N=="boolean"?q=N:H?q=!1:q=c;let z={...oe,defaultShouldRevalidate:q};dt(L,z)&&(W=Ze(r,n,O,p,L,l,t,z))}W&&K.push({key:ne,routeId:ee.routeId,path:ee.path,matches:W,match:L,request:O,controller:F})}),{dsMatches:ie,revalidatingFetchers:K}}function Rr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Gn(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Rr(e))return{shouldLoad:!1,renderFallback:!1};let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;if(!n&&a)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!n};let o=!n&&!a;return{shouldLoad:o,renderFallback:o}}function Bo(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function Wo(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function dt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function dn(e,t,r,n,a,o){let i;if(e){let l=n[e];G(l,`No route found to patch children into: routeId = ${e}`),l.children||(l.children=[]),i=l.children}else i=r;let u=[],s=[];if(t.forEach(l=>{let d=i.find(c=>Xn(l,c));d?s.push({existingRoute:d,newRoute:l}):u.push(l)}),u.length>0){let l=ht(u,a,[e||"_","patch",String((i==null?void 0:i.length)||"0")],n);i.push(...l)}if(o&&s.length>0)for(let l=0;l<s.length;l++){let{existingRoute:d,newRoute:c}=s[l],m=d,[g]=ht([c],a,[],{},!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 Xn(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((n,a)=>{var o;return(o=t.children)==null?void 0:o.some(i=>Xn(n,i))}))??!1:!1}var fn=new WeakMap,Kn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(G(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=fn.get(a);i||(i={},fn.set(a,i));let u=i[e];if(u)return u;let s=(async()=>{let l=io(e),c=a[e]!==void 0&&e!=="hasErrorBoundary";if(l)ue(!l,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)ue(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await o();m!=null&&(Object.assign(a,{[e]:m}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(m=>m===void 0)&&(a.lazy=void 0))})();return i[e]=s,s},hn=new WeakMap;function Yo(e,t,r,n,a){let o=r[e.id];if(G(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let d=hn.get(o);if(d)return{lazyRoutePromise:d,lazyHandlerPromise:d};let c=(async()=>{G(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=so(R),_=o[R]!==void 0&&R!=="hasErrorBoundary";w?ue(!w,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?ue(!_,`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,{...n(o),lazy:void 0})})();return hn.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),u=[],s;for(let d of i){if(a&&a.includes(d))continue;let c=Kn({key:d,route:e,manifest:r,mapRouteProperties:n});c&&(u.push(c),d===t&&(s=c))}let l=u.length>0?Promise.all(u).then(()=>{}):void 0;return l==null||l.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:s}}async function mn(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function Vo(e){return e.matches.some(t=>t.route.middleware)?qn(e,()=>mn(e)):mn(e)}function qn(e,t){return Jo(e,t,n=>{if(ii(n))throw n;return n},ri,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,u=Math.min(Math.max(i.findIndex(l=>l.route.id===a),0),Math.max(i.findIndex(l=>l.shouldCallHandler()),0)),s=Fe(i,i[u].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:n}})}}}async function Jo(e,t,r,n,a){let{matches:o,request:i,params:u,context:s,unstable_pattern:l}=e,d=o.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await Qn({request:i,params:u,context:s,unstable_pattern:l},d,t,r,n,a)}async function Qn(e,t,r,n,a,o,i=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let s=t[i];if(!s)return await r();let[l,d]=s,c,m=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await Qn(e,t,r,n,a,o,i+1)},c.value}catch(g){return c={value:await o(g,l,c)},c.value}};try{let g=await d(e,m),R=g!=null?n(g):void 0;return a(R)?R:c?R??c.value:(c={value:await m()},c.value)}catch(g){return await o(g,l,c)}}function Zn(e,t,r,n,a){let o=Kn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=Yo(n.route,ye(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function sr(e,t,r,n,a,o,i,u,s=null,l){let d=!1,c=Zn(e,t,r,a,o);return{...a,_lazyPromises:c,shouldLoad:u,shouldRevalidateArgs:s,shouldCallHandler(m){return d=!0,s?typeof l=="boolean"?dt(a,{...s,defaultShouldRevalidate:l}):typeof m=="boolean"?dt(a,{...s,defaultShouldRevalidate:m}):dt(a,s):u},resolve(m){let{lazy:g,loader:R,middleware:b}=a.route,w=d||u||m&&!ye(r.method)&&(g||R),P=b&&b.length>0&&!R&&!g;return w&&(ye(r.method)||!P)?Xo({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:c==null?void 0:c.handler,lazyRoutePromise:c==null?void 0:c.route,handlerOverride:m,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Ze(e,t,r,n,a,o,i,u=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:Zn(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:sr(e,t,r,pt(n),s,o,i,!0,u))}async function Go(e,t,r,n,a,o){r.some(l=>{var d;return(d=l._lazyPromises)==null?void 0:d.middleware})&&await Promise.all(r.map(l=>{var d;return(d=l._lazyPromises)==null?void 0:d.middleware}));let i={request:t,unstable_pattern:pt(r),params:r[0].params,context:a,matches:r},s=await e({...i,fetcherKey:n,runClientMiddleware:l=>{let d=i;return qn(d,()=>l({...d,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(l=>{var d,c;return[(d=l._lazyPromises)==null?void 0:d.handler,(c=l._lazyPromises)==null?void 0:c.route]}))}catch{}return s}async function Xo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let u,s,l=ye(e.method),d=l?"action":"loader",c=m=>{let g,R=new Promise((P,_)=>g=_);s=()=>g(),e.signal.addEventListener("abort",s);let b=P=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)):m({request:e,unstable_pattern:t,params:r.params,context:i},...P!==void 0?[P]:[]),w=(async()=>{try{return{type:"data",result:await(o?o(_=>b(_)):b())}}catch(P){return{type:"error",result:P}}})();return Promise.race([w,R])};try{let m=l?r.route.action:r.route.loader;if(n||a)if(m){let g,[R]=await Promise.all([c(m).catch(b=>{g=b}),n,a]);if(g!==void 0)throw g;u=R}else{await n;let g=l?r.route.action:r.route.loader;if(g)[u]=await Promise.all([c(g),a]);else if(d==="action"){let R=new URL(e.url),b=R.pathname+R.search;throw Le(405,{method:e.method,pathname:b,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(m)u=await c(m);else{let g=new URL(e.url),R=g.pathname+g.search;throw Le(404,{pathname:R})}}catch(m){return{type:"error",result:m}}finally{s&&e.signal.removeEventListener("abort",s)}return u}async function Ko(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 qo(e){var n,a,o,i,u;let{result:t,type:r}=e;if(Ut(t)){let s;try{s=await Ko(t)}catch(l){return{type:"error",error:l}}return r==="error"?{type:"error",error:new Ue(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?cr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:ti(t),statusCode:Je(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Je(t)?t.status:void 0}:cr(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Qo(e,t,r,n,a){let o=e.headers.get("Location");if(G(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!wr(o)){let i=n.slice(0,n.findIndex(u=>u.route.id===r)+1);o=lr(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function pn(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(wr(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(i.protocol))throw new Error("Invalid redirect location");let u=be(i.pathname,r)!=null;if(i.origin===t.origin&&u)return i.pathname+i.search+i.hash}try{let o=n.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function qe(e,t,r,n){let a=e.createURL(ea(t)).toString(),o={signal:r};if(n&&ye(n.formMethod)){let{formMethod:i,formEncType:u}=n;o.method=i.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(n.json)):u==="text/plain"?o.body=n.text:u==="application/x-www-form-urlencoded"&&n.formData?o.body=ur(n.formData):o.body=n.formData}return new Request(a,o)}function ur(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function yn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Zo(e,t,r,n=!1,a=!1){let o={},i=null,u,s=!1,l={},d=r&&Re(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(G(!Ve(g),"Cannot handle redirect results in processLoaderData"),Re(g)){let R=g.error;if(d!==void 0&&(R=d,d=void 0),i=i||{},a)i[m]=R;else{let b=Fe(e,m);i[b.route.id]==null&&(i[b.route.id]=R)}n||(o[m]=Jn),s||(s=!0,u=Je(g.error)?g.error.status:500),g.headers&&(l[m]=g.headers)}else o[m]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(u=g.statusCode),g.headers&&(l[m]=g.headers)}),d!==void 0&&r&&(i={[r[0]]:d},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:u||200,loaderHeaders:l}}function vn(e,t,r,n,a,o){let{loaderData:i,errors:u}=Zo(t,r,n);return a.filter(s=>!s.matches||s.matches.some(l=>l.shouldLoad)).forEach(s=>{let{key:l,match:d,controller:c}=s;if(c&&c.signal.aborted)return;let m=o[l];if(G(m,"Did not find corresponding fetcher result"),Re(m)){let g=Fe(e.matches,d==null?void 0:d.route.id);u&&u[g.route.id]||(u={...u,[g.route.id]:m.error}),e.fetchers.delete(l)}else if(Ve(m))G(!1,"Unhandled fetcher revalidation redirect");else{let g=Ae(m.data);e.fetchers.set(l,g)}}),{loaderData:i,errors:u}}function gn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==Jn).reduce((o,[i,u])=>(o[i]=u,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function wn(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Fe(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Ct(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:n,type:a,message:o}={}){let i="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(i="Bad Request",n&&t&&r?u=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(i="Forbidden",u=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",u=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",n&&t&&r?u=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(u=`Invalid request method "${n.toUpperCase()}"`)),new Ue(e||500,i,new Error(u),!0)}function Pt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Ve(a))return{key:n,result:a}}}function ea(e){let t=typeof e=="string"?Ie(e):e;return Pe({...t,hash:""})}function ei(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function ti(e){var t,r;return new Ue(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function ri(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&ni(r))}function ni(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function ai(e){return Ut(e.result)&&Yn.has(e.result.status)}function Re(e){return e.type==="error"}function Ve(e){return(e&&e.type)==="redirect"}function cr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ut(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function oi(e){return Yn.has(e)}function ii(e){return Ut(e)&&oi(e.status)&&e.headers.has("Location")}function li(e){return Fo.has(e.toUpperCase())}function ye(e){return Io.has(e.toUpperCase())}function br(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ot(e,t){let r=typeof t=="string"?Ie(t).search:t.search;if(e[e.length-1].route.index&&br(r||""))return e[e.length-1];let n=Un(e);return n[n.length-1]}function En(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function tr(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 si(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 lt(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 ui(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 Ae(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 ci(e,t){try{let r=e.sessionStorage.getItem(Vn);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function di(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Vn,JSON.stringify(r))}catch(n){ue(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function Rn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Ge=h.createContext(null);Ge.displayName="DataRouter";var et=h.createContext(null);et.displayName="DataRouterState";var ta=h.createContext(!1);function ra(){return h.useContext(ta)}var Sr=h.createContext({isTransitioning:!1});Sr.displayName="ViewTransition";var na=h.createContext(new Map);na.displayName="Fetchers";var fi=h.createContext(null);fi.displayName="Await";var Ee=h.createContext(null);Ee.displayName="Navigation";var Ht=h.createContext(null);Ht.displayName="Location";var _e=h.createContext({outlet:null,matches:[],isDataRoute:!1});_e.displayName="Route";var Lr=h.createContext(null);Lr.displayName="RouteError";var aa="REACT_ROUTER_ERROR",hi="REDIRECT",mi="ROUTE_ERROR_RESPONSE";function pi(e){if(e.startsWith(`${aa}:${hi}:{`))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 yi(e){if(e.startsWith(`${aa}:${mi}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ue(t.status,t.statusText,t.data)}catch{}}function vi(e,{relative:t}={}){G(yt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=h.useContext(Ee),{hash:a,pathname:o,search:i}=vt(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:Ce([r,o])),n.createHref({pathname:u,search:i,hash:a})}function yt(){return h.useContext(Ht)!=null}function xe(){return G(yt(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Ht).location}var oa="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ia(e){h.useContext(Ee).static||h.useLayoutEffect(e)}function la(){let{isDataRoute:e}=h.useContext(_e);return e?Ai():gi()}function gi(){G(yt(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Ge),{basename:t,navigator:r}=h.useContext(Ee),{matches:n}=h.useContext(_e),{pathname:a}=xe(),o=JSON.stringify(Er(n)),i=h.useRef(!1);return ia(()=>{i.current=!0}),h.useCallback((s,l={})=>{if(ue(i.current,oa),!i.current)return;if(typeof s=="number"){r.go(s);return}let d=jt(s,JSON.parse(o),a,l.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ce([t,d.pathname])),(l.replace?r.replace:r.push)(d,l.state,l)},[t,r,o,a,e])}var wi=h.createContext(null);function Ei(e){let t=h.useContext(_e).outlet;return h.useMemo(()=>t&&h.createElement(wi.Provider,{value:e},t),[t,e])}function Ri(){let{matches:e}=h.useContext(_e),t=e[e.length-1];return t?t.params:{}}function vt(e,{relative:t}={}){let{matches:r}=h.useContext(_e),{pathname:n}=xe(),a=JSON.stringify(Er(r));return h.useMemo(()=>jt(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function bi(e,t,r){G(yt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=h.useContext(Ee),{matches:a}=h.useContext(_e),o=a[a.length-1],i=o?o.params:{},u=o?o.pathname:"/",s=o?o.pathnameBase:"/",l=o&&o.route;{let w=l&&l.path||"";ca(u,!l||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (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.
34
+ */var An=e=>{throw TypeError(e)},ao=(e,t,r)=>t.has(e)||An("Cannot "+r),Qt=(e,t,r)=>(ao(e,t,"read from private field"),r?r.call(e):t.get(e)),oo=(e,t,r)=>t.has(e)?An("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),en="popstate";function tn(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Es(e={}){function t(n,a){var l;let o=(l=a.state)==null?void 0:l.masked,{pathname:i,search:u,hash:s}=o||n.location;return ft("",{pathname:i,search:u,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,a){return typeof a=="string"?a:Pe(a)}return lo(t,r,null,e)}function G(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ue(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function io(){return Math.random().toString(36).substring(2,10)}function rn(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 ft(e,t,r=null,n,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ie(t):t,state:r,key:t&&t.key||n||io(),unstable_mask:a}}function Pe({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 Ie(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function lo(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,u="POP",s=null,l=d();l==null&&(l=0,i.replaceState({...i.state,idx:l},""));function d(){return(i.state||{idx:null}).idx}function c(){u="POP";let w=d(),P=w==null?null:w-l;l=w,s&&s({action:u,location:b.location,delta:P})}function m(w,P){u="PUSH";let _=tn(w)?w:ft(b.location,w,P);l=d()+1;let D=rn(_,l),N=b.createHref(_.unstable_mask||_);try{i.pushState(D,"",N)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;a.location.assign(N)}o&&s&&s({action:u,location:b.location,delta:1})}function g(w,P){u="REPLACE";let _=tn(w)?w:ft(b.location,w,P);l=d();let D=rn(_,l),N=b.createHref(_.unstable_mask||_);i.replaceState(D,"",N),o&&s&&s({action:u,location:b.location,delta:0})}function R(w){return Nn(w)}let b={get action(){return u},get location(){return e(a,i)},listen(w){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(en,c),s=w,()=>{a.removeEventListener(en,c),s=null}},createHref(w){return t(a,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 Nn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),G(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Pe(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var ut,nn=class{constructor(e){if(oo(this,ut,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Qt(this,ut).has(e))return Qt(this,ut).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Qt(this,ut).set(e,t)}};ut=new WeakMap;var so=new Set(["lazy","caseSensitive","path","id","index","children"]);function uo(e){return so.has(e)}var co=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function fo(e){return co.has(e)}function ho(e){return e.index===!0}function ht(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let u=[...r,String(i)],s=typeof o.id=="string"?o.id:u.join("-");if(G(o.index!==!0||!o.children,"Cannot specify children on an index route"),G(a||!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),ho(o)){let l={...o,id:s};return n[s]=an(l,t(l)),l}else{let l={...o,id:s,children:void 0};return n[s]=an(l,t(l)),o.children&&(l.children=ht(o.children,t,u,n,a)),l}})}function an(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ne(e,t,r="/"){return ct(e,t,r,!1)}function ct(e,t,r,n){let a=typeof t=="string"?Ie(t):t,o=be(a.pathname||"/",r);if(o==null)return null;let i=$n(e);mo(i);let u=null;for(let s=0;u==null&&s<i.length;++s){let l=Lo(o);u=So(i[s],l,n)}return u}function In(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function $n(e,t=[],r=[],n="",a=!1){let o=(i,u,s=a,l)=>{let d={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&s)return;G(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let c=Ce([n,d.relativePath]),m=r.concat(d);i.children&&i.children.length>0&&(G(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),$n(i.children,t,m,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:Ro(c,i.index),routesMeta:m})};return e.forEach((i,u)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,u);else for(let l of Fn(i.path))o(i,u,!0,l)}),t}function Fn(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=Fn(n.join("/")),u=[];return u.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&u.push(...i),u.map(s=>e.startsWith("/")&&s===""?"/":s)}function mo(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:bo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var po=/^:[\w-]+$/,yo=3,vo=2,go=1,wo=10,Eo=-2,on=e=>e==="*";function Ro(e,t){let r=e.split("/"),n=r.length;return r.some(on)&&(n+=Eo),t&&(n+=vo),r.filter(a=>!on(a)).reduce((a,o)=>a+(po.test(o)?yo:o===""?go:wo),n)}function bo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function So(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let u=0;u<n.length;++u){let s=n[u],l=u===n.length-1,d=o==="/"?t:t.slice(o.length)||"/",c=It({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},d),m=s.route;if(!c&&l&&r&&!n[n.length-1].route.index&&(c=It({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},d)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:Ce([o,c.pathname]),pathnameBase:Po(Ce([o,c.pathnameBase])),route:m}),c.pathnameBase!=="/"&&(o=Ce([o,c.pathnameBase]))}return i}function It(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=jn(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:n.reduce((l,{paramName:d,isOptional:c},m)=>{if(d==="*"){let R=u[m]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=u[m];return c&&!g?l[d]=void 0:l[d]=(g||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:i,pattern:e}}function jn(e,t=!1,r=!0){ue(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,s,l,d)=>{if(n.push({paramName:u,isOptional:s!=null}),s){let c=d.charAt(l+i.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Lo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ue(!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 be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function xo({basename:e,pathname:t}){return t==="/"?e:Ce([e,t])}var Un=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wr=e=>Un.test(e);function Co(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ie(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=ln(r.substring(1),"/"):o=ln(r,t)):o=t,{pathname:o,search:_o(n),hash:To(a)}}function ln(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Zt(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Hn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Er(e){let t=Hn(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function jt(e,t,r,n=!1){let a;typeof e=="string"?a=Ie(e):(a={...e},G(!a.pathname||!a.pathname.includes("?"),Zt("?","pathname","search",a)),G(!a.pathname||!a.pathname.includes("#"),Zt("#","pathname","hash",a)),G(!a.search||!a.search.includes("#"),Zt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,u;if(i==null)u=r;else{let c=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),c-=1;a.pathname=m.join("/")}u=c>=0?t[c]:"/"}let s=Co(a,u),l=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(l||d)&&(s.pathname+="/"),s}var Ce=e=>e.join("/").replace(/\/\/+/g,"/"),Po=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_o=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,To=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Mo=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Do(e,t){return new Mo(e,typeof t=="number"?{status:t}:t)}var Oo=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},Ue=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Je(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var zn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bn(e,t){let r=e;if(typeof r!="string"||!Un.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(zn)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),u=be(i.pathname,t);i.origin===o.origin&&u!=null?r=u+i.search+i.hash:a=!0}catch{ue(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var je=Symbol("Uninstrumented");function ko(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let u of i)o[u]&&r[u].push(o[u])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=Qe(r.lazy,t.lazy,()=>{});a&&(n.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let i=a[o],u=r[`lazy.${o}`];if(typeof i=="function"&&u.length>0){let s=Qe(u,i,()=>{});s&&(n.lazy=Object.assign(n.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[je]??o,u=Qe(r[a],i,(...s)=>sn(s[0]));u&&(a==="loader"&&i.hydrate===!0&&(u.hydrate=!0),u[je]=i,n[a]=u)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[je]??a,i=Qe(r.middleware,o,(...u)=>sn(u[0]));return i?(i[je]=o,i):a})),n}function Ao(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(a){let o=Object.keys(a);for(let i of o)a[i]&&r[i].push(a[i])}})),r.navigate.length>0){let n=e.navigate[je]??e.navigate,a=Qe(r.navigate,n,(...o)=>{let[i,u]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Pe(i):".",...un(e,u??{})}});a&&(a[je]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[je]??e.fetch,a=Qe(r.fetch,n,(...o)=>{let[i,,u,s]=o;return{href:u??".",fetcherKey:i,...un(e,s??{})}});a&&(a[je]=n,e.fetch=a)}return e}function Qe(e,t,r){return e.length===0?null:async(...n)=>{let a=await Wn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function Wn(e,t,r,n){let a=e[n],o;if(a){let i,u=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Wn(e,t,r,n-1),o=await i,G(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(u,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await u(),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 sn(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:No(t),params:{...n},unstable_pattern:a,context:Io(r)}}function un(e,t){return{currentUrl:Pe(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 No(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Io(e){if(Fo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var $o=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Fo(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")===$o}var Yn=["POST","PUT","PATCH","DELETE"],jo=new Set(Yn),Uo=["GET",...Yn],Ho=new Set(Uo),Vn=new Set([301,302,303,307,308]),zo=new Set([307,308]),er={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Bo={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},it={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Wo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Jn="remix-router-transitions",Gn=Symbol("ResetLoaderData");function Rs(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";G(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Wo,o=a;if(e.unstable_instrumentations){let f=e.unstable_instrumentations;o=y=>({...a(y),...ko(f.map(E=>E.route).filter(Boolean),y)})}let i={},u=ht(e.routes,o,void 0,i),s,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let d=e.dataStrategy||Xo,c={...e.future},m=null,g=new Set,R=null,b=null,w=null,P=e.hydrationData!=null,_=Ne(u,e.history.location,l),D=!1,N=null,S,M;if(_==null&&!e.patchRoutesOnNavigation){let f=Le(404,{pathname:e.history.location.pathname}),{matches:y,route:E}=Ct(u);S=!0,M=!S,_=y,N={[E.id]:f}}else if(_&&!e.hydrationData&&Rt(_,u,e.history.location.pathname).active&&(_=null),_)if(_.some(f=>f.route.lazy))S=!1,M=!S;else if(!_.some(f=>Rr(f.route)))S=!0,M=!S;else{let f=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null,E=_;if(y){let x=_.findIndex(C=>y[C.route.id]!==void 0);E=E.slice(0,x+1)}M=!1,S=E.every(x=>{let C=Xn(x.route,f,y);return M=M||C.renderFallback,!C.shouldLoad})}else{S=!1,M=!S,_=[];let f=Rt(null,u,e.history.location.pathname);f.active&&f.matches&&(D=!0,_=f.matches)}let A,v={historyAction:e.history.action,location:e.history.location,matches:_,initialized:S,renderFallback:M,navigation:er,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||N,fetchers:new Map,blockers:new Map},B="POP",H=null,oe=!1,V,ie=!1,K=new Map,re=null,ee=!1,ne=!1,ve=new Set,te=new Map,p=0,L=-1,F=new Map,O=new Set,W=new Map,q=new Map,z=new Set,fe=new Map,le,Me=null;function Oa(){if(m=e.history.listen(({action:f,location:y,delta:E})=>{if(le){le(),le=void 0;return}ue(fe.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 x=Br({currentLocation:v.location,nextLocation:y,historyAction:f});if(x&&E!=null){let C=new Promise(I=>{le=I});e.history.go(E*-1),Et(x,{state:"blocked",location:y,proceed(){Et(x,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),C.then(()=>e.history.go(E))},reset(){let I=new Map(v.blockers);I.set(x,it),he({blockers:I})}}),H==null||H.resolve(),H=null;return}return He(f,y)}),r){hi(t,K);let f=()=>mi(t,K);t.addEventListener("pagehide",f),re=()=>t.removeEventListener("pagehide",f)}return v.initialized||He("POP",v.location,{initialHydration:!0}),A}function ka(){m&&m(),re&&re(),g.clear(),V&&V.abort(),v.fetchers.forEach((f,y)=>Vt(y)),v.blockers.forEach((f,y)=>zr(y))}function Aa(f){return g.add(f),()=>g.delete(f)}function he(f,y={}){f.matches&&(f.matches=f.matches.map(C=>{let I=i[C.route.id],j=C.route;return j.element!==I.element||j.errorElement!==I.errorElement||j.hydrateFallbackElement!==I.hydrateFallbackElement?{...C,route:I}:C})),v={...v,...f};let E=[],x=[];v.fetchers.forEach((C,I)=>{C.state==="idle"&&(z.has(I)?E.push(I):x.push(I))}),z.forEach(C=>{!v.fetchers.has(C)&&!te.has(C)&&E.push(C)}),[...g].forEach(C=>C(v,{deletedFetchers:E,newErrors:f.errors??null,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),E.forEach(C=>Vt(C)),x.forEach(C=>v.fetchers.delete(C))}function Xe(f,y,{flushSync:E}={}){var Y,$;let x=v.actionData!=null&&v.navigation.formMethod!=null&&ye(v.navigation.formMethod)&&v.navigation.state==="loading"&&((Y=f.state)==null?void 0:Y._isRedirect)!==!0,C;y.actionData?Object.keys(y.actionData).length>0?C=y.actionData:C=null:x?C=v.actionData:C=null;let I=y.loaderData?wn(v.loaderData,y.loaderData,y.matches||[],y.errors):v.loaderData,j=v.blockers;j.size>0&&(j=new Map(j),j.forEach((X,Q)=>j.set(Q,it)));let k=ee?!1:Yr(f,y.matches||v.matches),T=oe===!0||v.navigation.formMethod!=null&&ye(v.navigation.formMethod)&&(($=f.state)==null?void 0:$._isRedirect)!==!0;s&&(u=s,s=void 0),ee||B==="POP"||(B==="PUSH"?e.history.push(f,f.state):B==="REPLACE"&&e.history.replace(f,f.state));let U;if(B==="POP"){let X=K.get(v.location.pathname);X&&X.has(f.pathname)?U={currentLocation:v.location,nextLocation:f}:K.has(f.pathname)&&(U={currentLocation:f,nextLocation:v.location})}else if(ie){let X=K.get(v.location.pathname);X?X.add(f.pathname):(X=new Set([f.pathname]),K.set(v.location.pathname,X)),U={currentLocation:v.location,nextLocation:f}}he({...y,actionData:C,loaderData:I,historyAction:B,location:f,initialized:!0,renderFallback:!1,navigation:er,revalidation:"idle",restoreScrollPosition:k,preventScrollReset:T,blockers:j},{viewTransitionOpts:U,flushSync:E===!0}),B="POP",oe=!1,ie=!1,ee=!1,ne=!1,H==null||H.resolve(),H=null,Me==null||Me.resolve(),Me=null}async function Nr(f,y){if(H==null||H.resolve(),H=null,typeof f=="number"){H||(H=bn());let se=H.promise;return e.history.go(f),se}let E=lr(v.location,v.matches,l,f,y==null?void 0:y.fromRouteId,y==null?void 0:y.relative),{path:x,submission:C,error:I}=cn(!1,E,y),j;y!=null&&y.unstable_mask&&(j={pathname:"",search:"",hash:"",...typeof y.unstable_mask=="string"?Ie(y.unstable_mask):{...v.location.unstable_mask,...y.unstable_mask}});let k=v.location,T=ft(k,x,y&&y.state,void 0,j);T={...T,...e.history.encodeLocation(T)};let U=y&&y.replace!=null?y.replace:void 0,Y="PUSH";U===!0?Y="REPLACE":U===!1||C!=null&&ye(C.formMethod)&&C.formAction===v.location.pathname+v.location.search&&(Y="REPLACE");let $=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,X=(y&&y.flushSync)===!0,Q=Br({currentLocation:k,nextLocation:T,historyAction:Y});if(Q){Et(Q,{state:"blocked",location:T,proceed(){Et(Q,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),Nr(f,y)},reset(){let se=new Map(v.blockers);se.set(Q,it),he({blockers:se})}});return}await He(Y,T,{submission:C,pendingError:I,preventScrollReset:$,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:X,callSiteDefaultShouldRevalidate:y&&y.unstable_defaultShouldRevalidate})}function Na(){Me||(Me=bn()),Yt(),he({revalidation:"loading"});let f=Me.promise;return v.navigation.state==="submitting"?f:v.navigation.state==="idle"?(He(v.historyAction,v.location,{startUninterruptedRevalidation:!0}),f):(He(B||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation,enableViewTransition:ie===!0}),f)}async function He(f,y,E){V&&V.abort(),V=null,B=f,ee=(E&&E.startUninterruptedRevalidation)===!0,Va(v.location,v.matches),oe=(E&&E.preventScrollReset)===!0,ie=(E&&E.enableViewTransition)===!0;let x=s||u,C=E&&E.overrideNavigation,I=E!=null&&E.initialHydration&&v.matches&&v.matches.length>0&&!D?v.matches:Ne(x,y,l),j=(E&&E.flushSync)===!0;if(I&&v.initialized&&!ne&&ni(v.location,y)&&!(E&&E.submission&&ye(E.submission.formMethod))){Xe(y,{matches:I},{flushSync:j});return}let k=Rt(I,x,y.pathname);if(k.active&&k.matches&&(I=k.matches),!I){let{error:de,notFoundMatches:ge,route:ae}=Jt(y.pathname);Xe(y,{matches:ge,loaderData:{},errors:{[ae.id]:de}},{flushSync:j});return}V=new AbortController;let T=qe(e.history,y,V.signal,E&&E.submission),U=e.getContext?await e.getContext():new nn,Y;if(E&&E.pendingError)Y=[Fe(I).route.id,{type:"error",error:E.pendingError}];else if(E&&E.submission&&ye(E.submission.formMethod)){let de=await Ia(T,y,E.submission,I,U,k.active,E&&E.initialHydration===!0,{replace:E.replace,flushSync:j});if(de.shortCircuited)return;if(de.pendingActionResult){let[ge,ae]=de.pendingActionResult;if(Re(ae)&&Je(ae.error)&&ae.error.status===404){V=null,Xe(y,{matches:de.matches,loaderData:{},errors:{[ge]:ae.error}});return}}I=de.matches||I,Y=de.pendingActionResult,C=tr(y,E.submission),j=!1,k.active=!1,T=qe(e.history,T.url,T.signal)}let{shortCircuited:$,matches:X,loaderData:Q,errors:se}=await $a(T,y,I,U,k.active,C,E&&E.submission,E&&E.fetcherSubmission,E&&E.replace,E&&E.initialHydration===!0,j,Y,E&&E.callSiteDefaultShouldRevalidate);$||(V=null,Xe(y,{matches:X||I,...En(Y),loaderData:Q,errors:se}))}async function Ia(f,y,E,x,C,I,j,k={}){Yt();let T=di(y,E);if(he({navigation:T},{flushSync:k.flushSync===!0}),I){let $=await bt(x,y.pathname,f.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:Q,route:se}=Ct(u);return{matches:Q,pendingActionResult:[se.id,{type:"error",error:$.error}]}}let X=Fe($.partialMatches).route.id;return{matches:$.partialMatches,pendingActionResult:[X,{type:"error",error:$.error}]}}else if($.matches)x=$.matches;else{let{notFoundMatches:X,error:Q,route:se}=Jt(y.pathname);return{matches:X,pendingActionResult:[se.id,{type:"error",error:Q}]}}}let U,Y=Ot(x,y);if(!Y.route.action&&!Y.route.lazy)U={type:"error",error:Le(405,{method:f.method,pathname:y.pathname,routeId:Y.route.id})};else{let $=Ze(o,i,f,x,Y,j?[]:n,C),X=await rt(f,$,C,null);if(U=X[Y.route.id],!U){for(let Q of x)if(X[Q.route.id]){U=X[Q.route.id];break}}if(f.signal.aborted)return{shortCircuited:!0}}if(Ve(U)){let $;return k&&k.replace!=null?$=k.replace:$=yn(U.response.headers.get("Location"),new URL(f.url),l,e.history)===v.location.pathname+v.location.search,await ze(f,U,!0,{submission:E,replace:$}),{shortCircuited:!0}}if(Re(U)){let $=Fe(x,Y.route.id);return(k&&k.replace)!==!0&&(B="PUSH"),{matches:x,pendingActionResult:[$.route.id,U,Y.route.id]}}return{matches:x,pendingActionResult:[Y.route.id,U]}}async function $a(f,y,E,x,C,I,j,k,T,U,Y,$,X){let Q=I||tr(y,j),se=j||k||Rn(Q),de=!ee&&!U;if(C){if(de){let me=Ir($);he({navigation:Q,...me!==void 0?{actionData:me}:{}},{flushSync:Y})}let Z=await bt(E,y.pathname,f.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){if(Z.partialMatches.length===0){let{matches:Ke,route:Ye}=Ct(u);return{matches:Ke,loaderData:{},errors:{[Ye.id]:Z.error}}}let me=Fe(Z.partialMatches).route.id;return{matches:Z.partialMatches,loaderData:{},errors:{[me]:Z.error}}}else if(Z.matches)E=Z.matches;else{let{error:me,notFoundMatches:Ke,route:Ye}=Jt(y.pathname);return{matches:Ke,loaderData:{},errors:{[Ye.id]:me}}}}let ge=s||u,{dsMatches:ae,revalidatingFetchers:Se}=dn(f,x,o,i,e.history,v,E,se,y,U?[]:n,U===!0,ne,ve,z,W,O,ge,l,e.patchRoutesOnNavigation!=null,$,X);if(L=++p,!e.dataStrategy&&!ae.some(Z=>Z.shouldLoad)&&!ae.some(Z=>Z.route.middleware&&Z.route.middleware.length>0)&&Se.length===0){let Z=Ur();return Xe(y,{matches:E,loaderData:{},errors:$&&Re($[1])?{[$[0]]:$[1].error}:null,...En($),...Z?{fetchers:new Map(v.fetchers)}:{}},{flushSync:Y}),{shortCircuited:!0}}if(de){let Z={};if(!C){Z.navigation=Q;let me=Ir($);me!==void 0&&(Z.actionData=me)}Se.length>0&&(Z.fetchers=Fa(Se)),he(Z,{flushSync:Y})}Se.forEach(Z=>{ke(Z.key),Z.controller&&te.set(Z.key,Z.controller)});let Be=()=>Se.forEach(Z=>ke(Z.key));V&&V.signal.addEventListener("abort",Be);let{loaderResults:nt,fetcherResults:$e}=await $r(ae,Se,f,x);if(f.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",Be),Se.forEach(Z=>te.delete(Z.key));let Te=Pt(nt);if(Te)return await ze(f,Te.result,!0,{replace:T}),{shortCircuited:!0};if(Te=Pt($e),Te)return O.add(Te.key),await ze(f,Te.result,!0,{replace:T}),{shortCircuited:!0};let{loaderData:Gt,errors:at}=gn(v,E,nt,$,Se,$e);U&&v.errors&&(at={...v.errors,...at});let We=Ur(),St=Hr(L),Lt=We||St||Se.length>0;return{matches:E,loaderData:Gt,errors:at,...Lt?{fetchers:new Map(v.fetchers)}:{}}}function Ir(f){if(f&&!Re(f[1]))return{[f[0]]:f[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function Fa(f){return f.forEach(y=>{let E=v.fetchers.get(y.key),x=lt(void 0,E?E.data:void 0);v.fetchers.set(y.key,x)}),new Map(v.fetchers)}async function ja(f,y,E,x){ke(f);let C=(x&&x.flushSync)===!0,I=s||u,j=lr(v.location,v.matches,l,E,y,x==null?void 0:x.relative),k=Ne(I,j,l),T=Rt(k,I,j);if(T.active&&T.matches&&(k=T.matches),!k){Oe(f,y,Le(404,{pathname:j}),{flushSync:C});return}let{path:U,submission:Y,error:$}=cn(!0,j,x);if($){Oe(f,y,$,{flushSync:C});return}let X=e.getContext?await e.getContext():new nn,Q=(x&&x.preventScrollReset)===!0;if(Y&&ye(Y.formMethod)){await Ua(f,y,U,k,X,T.active,C,Q,Y,x&&x.unstable_defaultShouldRevalidate);return}W.set(f,{routeId:y,path:U}),await Ha(f,y,U,k,X,T.active,C,Q,Y)}async function Ua(f,y,E,x,C,I,j,k,T,U){Yt(),W.delete(f);let Y=v.fetchers.get(f);De(f,fi(T,Y),{flushSync:j});let $=new AbortController,X=qe(e.history,E,$.signal,T);if(I){let ce=await bt(x,new URL(X.url).pathname,X.signal,f);if(ce.type==="aborted")return;if(ce.type==="error"){Oe(f,y,ce.error,{flushSync:j});return}else if(ce.matches)x=ce.matches;else{Oe(f,y,Le(404,{pathname:E}),{flushSync:j});return}}let Q=Ot(x,E);if(!Q.route.action&&!Q.route.lazy){let ce=Le(405,{method:T.formMethod,pathname:E,routeId:y});Oe(f,y,ce,{flushSync:j});return}te.set(f,$);let se=p,de=Ze(o,i,X,x,Q,n,C),ge=await rt(X,de,C,f),ae=ge[Q.route.id];if(!ae){for(let ce of de)if(ge[ce.route.id]){ae=ge[ce.route.id];break}}if(X.signal.aborted){te.get(f)===$&&te.delete(f);return}if(z.has(f)){if(Ve(ae)||Re(ae)){De(f,Ae(void 0));return}}else{if(Ve(ae))if(te.delete(f),L>se){De(f,Ae(void 0));return}else return O.add(f),De(f,lt(T)),ze(X,ae,!1,{fetcherSubmission:T,preventScrollReset:k});if(Re(ae)){Oe(f,y,ae.error);return}}let Se=v.navigation.location||v.location,Be=qe(e.history,Se,$.signal),nt=s||u,$e=v.navigation.state!=="idle"?Ne(nt,v.navigation.location,l):v.matches;G($e,"Didn't find any matches after fetcher action");let Te=++p;F.set(f,Te);let Gt=lt(T,ae.data);v.fetchers.set(f,Gt);let{dsMatches:at,revalidatingFetchers:We}=dn(Be,C,o,i,e.history,v,$e,T,Se,n,!1,ne,ve,z,W,O,nt,l,e.patchRoutesOnNavigation!=null,[Q.route.id,ae],U);We.filter(ce=>ce.key!==f).forEach(ce=>{let xt=ce.key,Jr=v.fetchers.get(xt),Xa=lt(void 0,Jr?Jr.data:void 0);v.fetchers.set(xt,Xa),ke(xt),ce.controller&&te.set(xt,ce.controller)}),he({fetchers:new Map(v.fetchers)});let St=()=>We.forEach(ce=>ke(ce.key));$.signal.addEventListener("abort",St);let{loaderResults:Lt,fetcherResults:Z}=await $r(at,We,Be,C);if($.signal.aborted)return;if($.signal.removeEventListener("abort",St),F.delete(f),te.delete(f),We.forEach(ce=>te.delete(ce.key)),v.fetchers.has(f)){let ce=Ae(ae.data);v.fetchers.set(f,ce)}let me=Pt(Lt);if(me)return ze(Be,me.result,!1,{preventScrollReset:k});if(me=Pt(Z),me)return O.add(me.key),ze(Be,me.result,!1,{preventScrollReset:k});let{loaderData:Ke,errors:Ye}=gn(v,$e,Lt,void 0,We,Z);Hr(Te),v.navigation.state==="loading"&&Te>L?(G(B,"Expected pending action"),V&&V.abort(),Xe(v.navigation.location,{matches:$e,loaderData:Ke,errors:Ye,fetchers:new Map(v.fetchers)})):(he({errors:Ye,loaderData:wn(v.loaderData,Ke,$e,Ye),fetchers:new Map(v.fetchers)}),ne=!1)}async function Ha(f,y,E,x,C,I,j,k,T){let U=v.fetchers.get(f);De(f,lt(T,U?U.data:void 0),{flushSync:j});let Y=new AbortController,$=qe(e.history,E,Y.signal);if(I){let ae=await bt(x,new URL($.url).pathname,$.signal,f);if(ae.type==="aborted")return;if(ae.type==="error"){Oe(f,y,ae.error,{flushSync:j});return}else if(ae.matches)x=ae.matches;else{Oe(f,y,Le(404,{pathname:E}),{flushSync:j});return}}let X=Ot(x,E);te.set(f,Y);let Q=p,se=Ze(o,i,$,x,X,n,C),ge=(await rt($,se,C,f))[X.route.id];if(te.get(f)===Y&&te.delete(f),!$.signal.aborted){if(z.has(f)){De(f,Ae(void 0));return}if(Ve(ge))if(L>Q){De(f,Ae(void 0));return}else{O.add(f),await ze($,ge,!1,{preventScrollReset:k});return}if(Re(ge)){Oe(f,y,ge.error);return}De(f,Ae(ge.data))}}async function ze(f,y,E,{submission:x,fetcherSubmission:C,preventScrollReset:I,replace:j}={}){E||(H==null||H.resolve(),H=null),y.response.headers.has("X-Remix-Revalidate")&&(ne=!0);let k=y.response.headers.get("Location");G(k,"Expected a Location header on the redirect Response"),k=yn(k,new URL(f.url),l,e.history);let T=ft(v.location,k,{_isRedirect:!0});if(r){let se=!1;if(y.response.headers.has("X-Remix-Reload-Document"))se=!0;else if(wr(k)){const de=Nn(k,!0);se=de.origin!==t.location.origin||be(de.pathname,l)==null}if(se){j?t.location.replace(k):t.location.assign(k);return}}V=null;let U=j===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Y,formAction:$,formEncType:X}=v.navigation;!x&&!C&&Y&&$&&X&&(x=Rn(v.navigation));let Q=x||C;if(zo.has(y.response.status)&&Q&&ye(Q.formMethod))await He(U,T,{submission:{...Q,formAction:k},preventScrollReset:I||oe,enableViewTransition:E?ie:void 0});else{let se=tr(T,x);await He(U,T,{overrideNavigation:se,fetcherSubmission:C,preventScrollReset:I||oe,enableViewTransition:E?ie:void 0})}}async function rt(f,y,E,x){var j;let C,I={};try{C=await qo(d,f,y,x,E,!1)}catch(k){return y.filter(T=>T.shouldLoad).forEach(T=>{I[T.route.id]={type:"error",error:k}}),I}if(f.signal.aborted)return I;if(!ye(f.method))for(let k of y){if(((j=C[k.route.id])==null?void 0:j.type)==="error")break;!C.hasOwnProperty(k.route.id)&&!v.loaderData.hasOwnProperty(k.route.id)&&(!v.errors||!v.errors.hasOwnProperty(k.route.id))&&k.shouldCallHandler()&&(C[k.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${k.route.id}`)})}for(let[k,T]of Object.entries(C))if(li(T)){let U=T.result;I[k]={type:"redirect",response:ti(U,f,k,y,l)}}else I[k]=await ei(T);return I}async function $r(f,y,E,x){let C=rt(E,f,x,null),I=Promise.all(y.map(async T=>{if(T.matches&&T.match&&T.request&&T.controller){let Y=(await rt(T.request,T.matches,x,T.key))[T.match.route.id];return{[T.key]:Y}}else return Promise.resolve({[T.key]:{type:"error",error:Le(404,{pathname:T.path})}})})),j=await C,k=(await I).reduce((T,U)=>Object.assign(T,U),{});return{loaderResults:j,fetcherResults:k}}function Yt(){ne=!0,W.forEach((f,y)=>{te.has(y)&&ve.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,x={}){let C=Fe(v.matches,y);Vt(f),he({errors:{[C.route.id]:E},fetchers:new Map(v.fetchers)},{flushSync:(x&&x.flushSync)===!0})}function Fr(f){return q.set(f,(q.get(f)||0)+1),z.has(f)&&z.delete(f),v.fetchers.get(f)||Bo}function za(f,y){ke(f,y==null?void 0:y.reason),De(f,Ae(null))}function Vt(f){let y=v.fetchers.get(f);te.has(f)&&!(y&&y.state==="loading"&&F.has(f))&&ke(f),W.delete(f),F.delete(f),O.delete(f),z.delete(f),ve.delete(f),v.fetchers.delete(f)}function Ba(f){let y=(q.get(f)||0)-1;y<=0?(q.delete(f),z.add(f)):q.set(f,y),he({fetchers:new Map(v.fetchers)})}function ke(f,y){let E=te.get(f);E&&(E.abort(y),te.delete(f))}function jr(f){for(let y of f){let E=Fr(y),x=Ae(E.data);v.fetchers.set(y,x)}}function Ur(){let f=[],y=!1;for(let E of O){let x=v.fetchers.get(E);G(x,`Expected fetcher: ${E}`),x.state==="loading"&&(O.delete(E),f.push(E),y=!0)}return jr(f),y}function Hr(f){let y=[];for(let[E,x]of F)if(x<f){let C=v.fetchers.get(E);G(C,`Expected fetcher: ${E}`),C.state==="loading"&&(ke(E),F.delete(E),y.push(E))}return jr(y),y.length>0}function Wa(f,y){let E=v.blockers.get(f)||it;return fe.get(f)!==y&&fe.set(f,y),E}function zr(f){v.blockers.delete(f),fe.delete(f)}function Et(f,y){let E=v.blockers.get(f)||it;G(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 x=new Map(v.blockers);x.set(f,y),he({blockers:x})}function Br({currentLocation:f,nextLocation:y,historyAction:E}){if(fe.size===0)return;fe.size>1&&ue(!1,"A router only supports one blocker at a time");let x=Array.from(fe.entries()),[C,I]=x[x.length-1],j=v.blockers.get(C);if(!(j&&j.state==="proceeding")&&I({currentLocation:f,nextLocation:y,historyAction:E}))return C}function Jt(f){let y=Le(404,{pathname:f}),E=s||u,{matches:x,route:C}=Ct(E);return{notFoundMatches:x,route:C,error:y}}function Ya(f,y,E){if(R=f,w=y,b=E||null,!P&&v.navigation===er){P=!0;let x=Yr(v.location,v.matches);x!=null&&he({restoreScrollPosition:x})}return()=>{R=null,w=null,b=null}}function Wr(f,y){return b&&b(f,y.map(x=>In(x,v.loaderData)))||f.key}function Va(f,y){if(R&&w){let E=Wr(f,y);R[E]=w()}}function Yr(f,y){if(R){let E=Wr(f,y),x=R[E];if(typeof x=="number")return x}return null}function Rt(f,y,E){if(e.patchRoutesOnNavigation)if(f){if(Object.keys(f[0].params).length>0)return{active:!0,matches:ct(y,E,l,!0)}}else return{active:!0,matches:ct(y,E,l,!0)||[]};return{active:!1,matches:null}}async function bt(f,y,E,x){if(!e.patchRoutesOnNavigation)return{type:"success",matches:f};let C=f;for(;;){let I=s==null,j=s||u,k=i;try{await e.patchRoutesOnNavigation({signal:E,path:y,matches:C,fetcherKey:x,patch:(Y,$)=>{E.aborted||fn(Y,$,j,k,o,!1)}})}catch(Y){return{type:"error",error:Y,partialMatches:C}}finally{I&&!E.aborted&&(u=[...u])}if(E.aborted)return{type:"aborted"};let T=Ne(j,y,l),U=null;if(T){if(Object.keys(T[0].params).length===0)return{type:"success",matches:T};if(U=ct(j,y,l,!0),!(U&&C.length<U.length&&Vr(C,U.slice(0,C.length))))return{type:"success",matches:T}}if(U||(U=ct(j,y,l,!0)),!U||Vr(C,U))return{type:"success",matches:null};C=U}}function Vr(f,y){return f.length===y.length&&f.every((E,x)=>E.route.id===y[x].route.id)}function Ja(f){i={},s=ht(f,o,void 0,i)}function Ga(f,y,E=!1){let x=s==null;fn(f,y,s||u,i,o,E),x&&(u=[...u],he({}))}return A={get basename(){return l},get future(){return c},get state(){return v},get routes(){return u},get window(){return t},initialize:Oa,subscribe:Aa,enableScrollRestoration:Ya,navigate:Nr,fetch:ja,revalidate:Na,createHref:f=>e.history.createHref(f),encodeLocation:f=>e.history.encodeLocation(f),getFetcher:Fr,resetFetcher:za,deleteFetcher:Ba,dispose:ka,getBlocker:Wa,deleteBlocker:zr,patchRoutes:Ga,_internalFetchControllers:te,_internalSetRoutes:Ja,_internalSetStateDoNotUseOrYouWillBreakYourApp(f){he(f)}},e.unstable_instrumentations&&(A=Ao(A,e.unstable_instrumentations.map(f=>f.router).filter(Boolean))),A}function Yo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function lr(e,t,r,n,a,o){let i,u;if(a){i=[];for(let l of t)if(i.push(l),l.route.id===a){u=l;break}}else i=t,u=t[t.length-1];let s=jt(n||".",Er(i),be(e.pathname,r)||e.pathname,o==="path");if(n==null&&(s.search=e.search,s.hash=e.hash),(n==null||n===""||n===".")&&u){let l=br(s.search);if(u.route.index&&!l)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&l){let d=new URLSearchParams(s.search),c=d.getAll("index");d.delete("index"),c.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();s.search=m?`?${m}`:""}}return r!=="/"&&(s.pathname=xo({basename:r,pathname:s.pathname})),Pe(s)}function cn(e,t,r){if(!r||!Yo(r))return{path:t};if(r.formMethod&&!ci(r.formMethod))return{path:t,error:Le(405,{method:r.formMethod})};let n=()=>({path:t,error:Le(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=ta(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ye(o))return n();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}
35
+ `,""):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(!ye(o))return n();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 n()}}}G(typeof FormData=="function","FormData is not available in this environment");let u,s;if(r.formData)u=ur(r.formData),s=r.formData;else if(r.body instanceof FormData)u=ur(r.body),s=r.body;else if(r.body instanceof URLSearchParams)u=r.body,s=vn(u);else if(r.body==null)u=new URLSearchParams,s=new FormData;else try{u=new URLSearchParams(r.body),s=vn(u)}catch{return n()}let l={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(ye(l.formMethod))return{path:t,submission:l};let d=Ie(t);return e&&d.search&&br(d.search)&&u.append("index",""),d.search=`?${u}`,{path:Pe(d),submission:l}}function dn(e,t,r,n,a,o,i,u,s,l,d,c,m,g,R,b,w,P,_,D,N){var re;let S=D?Re(D[1])?D[1].error:D[1].data:void 0,M=a.createURL(o.location),A=a.createURL(s),v;if(d&&o.errors){let ee=Object.keys(o.errors)[0];v=i.findIndex(ne=>ne.route.id===ee)}else if(D&&Re(D[1])){let ee=D[0];v=i.findIndex(ne=>ne.route.id===ee)-1}let B=D?D[1].statusCode:void 0,H=B&&B>=400,oe={currentUrl:M,currentParams:((re=o.matches[0])==null?void 0:re.params)||{},nextUrl:A,nextParams:i[0].params,...u,actionResult:S,actionStatus:B},V=pt(i),ie=i.map((ee,ne)=>{let{route:ve}=ee,te=null;if(v!=null&&ne>v)te=!1;else if(ve.lazy)te=!0;else if(!Rr(ve))te=!1;else if(d){let{shouldLoad:O}=Xn(ve,o.loaderData,o.errors);te=O}else Vo(o.loaderData,o.matches[ne],ee)&&(te=!0);if(te!==null)return sr(r,n,e,V,ee,l,t,te);let p=!1;typeof N=="boolean"?p=N:H?p=!1:(c||M.pathname+M.search===A.pathname+A.search||M.search!==A.search||Jo(o.matches[ne],ee))&&(p=!0);let L={...oe,defaultShouldRevalidate:p},F=dt(ee,L);return sr(r,n,e,V,ee,l,t,F,L,N)}),K=[];return R.forEach((ee,ne)=>{if(d||!i.some(q=>q.route.id===ee.routeId)||g.has(ne))return;let ve=o.fetchers.get(ne),te=ve&&ve.state!=="idle"&&ve.data===void 0,p=Ne(w,ee.path,P);if(!p){if(_&&te)return;K.push({key:ne,routeId:ee.routeId,path:ee.path,matches:null,match:null,request:null,controller:null});return}if(b.has(ne))return;let L=Ot(p,ee.path),F=new AbortController,O=qe(a,ee.path,F.signal),W=null;if(m.has(ne))m.delete(ne),W=Ze(r,n,O,p,L,l,t);else if(te)c&&(W=Ze(r,n,O,p,L,l,t));else{let q;typeof N=="boolean"?q=N:H?q=!1:q=c;let z={...oe,defaultShouldRevalidate:q};dt(L,z)&&(W=Ze(r,n,O,p,L,l,t,z))}W&&K.push({key:ne,routeId:ee.routeId,path:ee.path,matches:W,match:L,request:O,controller:F})}),{dsMatches:ie,revalidatingFetchers:K}}function Rr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Xn(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Rr(e))return{shouldLoad:!1,renderFallback:!1};let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;if(!n&&a)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!n};let o=!n&&!a;return{shouldLoad:o,renderFallback:o}}function Vo(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function Jo(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function dt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function fn(e,t,r,n,a,o){let i;if(e){let l=n[e];G(l,`No route found to patch children into: routeId = ${e}`),l.children||(l.children=[]),i=l.children}else i=r;let u=[],s=[];if(t.forEach(l=>{let d=i.find(c=>Kn(l,c));d?s.push({existingRoute:d,newRoute:l}):u.push(l)}),u.length>0){let l=ht(u,a,[e||"_","patch",String((i==null?void 0:i.length)||"0")],n);i.push(...l)}if(o&&s.length>0)for(let l=0;l<s.length;l++){let{existingRoute:d,newRoute:c}=s[l],m=d,[g]=ht([c],a,[],{},!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 Kn(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((n,a)=>{var o;return(o=t.children)==null?void 0:o.some(i=>Kn(n,i))}))??!1:!1}var hn=new WeakMap,qn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(G(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=hn.get(a);i||(i={},hn.set(a,i));let u=i[e];if(u)return u;let s=(async()=>{let l=uo(e),c=a[e]!==void 0&&e!=="hasErrorBoundary";if(l)ue(!l,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)ue(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await o();m!=null&&(Object.assign(a,{[e]:m}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(m=>m===void 0)&&(a.lazy=void 0))})();return i[e]=s,s},mn=new WeakMap;function Go(e,t,r,n,a){let o=r[e.id];if(G(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let d=mn.get(o);if(d)return{lazyRoutePromise:d,lazyHandlerPromise:d};let c=(async()=>{G(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=fo(R),_=o[R]!==void 0&&R!=="hasErrorBoundary";w?ue(!w,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?ue(!_,`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,{...n(o),lazy:void 0})})();return mn.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),u=[],s;for(let d of i){if(a&&a.includes(d))continue;let c=qn({key:d,route:e,manifest:r,mapRouteProperties:n});c&&(u.push(c),d===t&&(s=c))}let l=u.length>0?Promise.all(u).then(()=>{}):void 0;return l==null||l.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:s}}async function pn(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function Xo(e){return e.matches.some(t=>t.route.middleware)?Qn(e,()=>pn(e)):pn(e)}function Qn(e,t){return Ko(e,t,n=>{if(ui(n))throw n;return n},oi,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,u=Math.min(Math.max(i.findIndex(l=>l.route.id===a),0),Math.max(i.findIndex(l=>l.shouldCallHandler()),0)),s=Fe(i,i[u].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:n}})}}}async function Ko(e,t,r,n,a){let{matches:o,request:i,params:u,context:s,unstable_pattern:l}=e,d=o.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await Zn({request:i,params:u,context:s,unstable_pattern:l},d,t,r,n,a)}async function Zn(e,t,r,n,a,o,i=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let s=t[i];if(!s)return await r();let[l,d]=s,c,m=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await Zn(e,t,r,n,a,o,i+1)},c.value}catch(g){return c={value:await o(g,l,c)},c.value}};try{let g=await d(e,m),R=g!=null?n(g):void 0;return a(R)?R:c?R??c.value:(c={value:await m()},c.value)}catch(g){return await o(g,l,c)}}function ea(e,t,r,n,a){let o=qn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=Go(n.route,ye(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function sr(e,t,r,n,a,o,i,u,s=null,l){let d=!1,c=ea(e,t,r,a,o);return{...a,_lazyPromises:c,shouldLoad:u,shouldRevalidateArgs:s,shouldCallHandler(m){return d=!0,s?typeof l=="boolean"?dt(a,{...s,defaultShouldRevalidate:l}):typeof m=="boolean"?dt(a,{...s,defaultShouldRevalidate:m}):dt(a,s):u},resolve(m){let{lazy:g,loader:R,middleware:b}=a.route,w=d||u||m&&!ye(r.method)&&(g||R),P=b&&b.length>0&&!R&&!g;return w&&(ye(r.method)||!P)?Qo({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:c==null?void 0:c.handler,lazyRoutePromise:c==null?void 0:c.route,handlerOverride:m,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Ze(e,t,r,n,a,o,i,u=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:ea(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:sr(e,t,r,pt(n),s,o,i,!0,u))}async function qo(e,t,r,n,a,o){r.some(l=>{var d;return(d=l._lazyPromises)==null?void 0:d.middleware})&&await Promise.all(r.map(l=>{var d;return(d=l._lazyPromises)==null?void 0:d.middleware}));let i={request:t,unstable_pattern:pt(r),params:r[0].params,context:a,matches:r},s=await e({...i,fetcherKey:n,runClientMiddleware:l=>{let d=i;return Qn(d,()=>l({...d,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(l=>{var d,c;return[(d=l._lazyPromises)==null?void 0:d.handler,(c=l._lazyPromises)==null?void 0:c.route]}))}catch{}return s}async function Qo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let u,s,l=ye(e.method),d=l?"action":"loader",c=m=>{let g,R=new Promise((P,_)=>g=_);s=()=>g(),e.signal.addEventListener("abort",s);let b=P=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)):m({request:e,unstable_pattern:t,params:r.params,context:i},...P!==void 0?[P]:[]),w=(async()=>{try{return{type:"data",result:await(o?o(_=>b(_)):b())}}catch(P){return{type:"error",result:P}}})();return Promise.race([w,R])};try{let m=l?r.route.action:r.route.loader;if(n||a)if(m){let g,[R]=await Promise.all([c(m).catch(b=>{g=b}),n,a]);if(g!==void 0)throw g;u=R}else{await n;let g=l?r.route.action:r.route.loader;if(g)[u]=await Promise.all([c(g),a]);else if(d==="action"){let R=new URL(e.url),b=R.pathname+R.search;throw Le(405,{method:e.method,pathname:b,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(m)u=await c(m);else{let g=new URL(e.url),R=g.pathname+g.search;throw Le(404,{pathname:R})}}catch(m){return{type:"error",result:m}}finally{s&&e.signal.removeEventListener("abort",s)}return u}async function Zo(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 ei(e){var n,a,o,i,u;let{result:t,type:r}=e;if(Ut(t)){let s;try{s=await Zo(t)}catch(l){return{type:"error",error:l}}return r==="error"?{type:"error",error:new Ue(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?cr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:ai(t),statusCode:Je(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Je(t)?t.status:void 0}:cr(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function ti(e,t,r,n,a){let o=e.headers.get("Location");if(G(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!wr(o)){let i=n.slice(0,n.findIndex(u=>u.route.id===r)+1);o=lr(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function yn(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(wr(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(i.protocol))throw new Error("Invalid redirect location");let u=be(i.pathname,r)!=null;if(i.origin===t.origin&&u)return i.pathname+i.search+i.hash}try{let o=n.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function qe(e,t,r,n){let a=e.createURL(ta(t)).toString(),o={signal:r};if(n&&ye(n.formMethod)){let{formMethod:i,formEncType:u}=n;o.method=i.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(n.json)):u==="text/plain"?o.body=n.text:u==="application/x-www-form-urlencoded"&&n.formData?o.body=ur(n.formData):o.body=n.formData}return new Request(a,o)}function ur(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function vn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ri(e,t,r,n=!1,a=!1){let o={},i=null,u,s=!1,l={},d=r&&Re(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(G(!Ve(g),"Cannot handle redirect results in processLoaderData"),Re(g)){let R=g.error;if(d!==void 0&&(R=d,d=void 0),i=i||{},a)i[m]=R;else{let b=Fe(e,m);i[b.route.id]==null&&(i[b.route.id]=R)}n||(o[m]=Gn),s||(s=!0,u=Je(g.error)?g.error.status:500),g.headers&&(l[m]=g.headers)}else o[m]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(u=g.statusCode),g.headers&&(l[m]=g.headers)}),d!==void 0&&r&&(i={[r[0]]:d},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:u||200,loaderHeaders:l}}function gn(e,t,r,n,a,o){let{loaderData:i,errors:u}=ri(t,r,n);return a.filter(s=>!s.matches||s.matches.some(l=>l.shouldLoad)).forEach(s=>{let{key:l,match:d,controller:c}=s;if(c&&c.signal.aborted)return;let m=o[l];if(G(m,"Did not find corresponding fetcher result"),Re(m)){let g=Fe(e.matches,d==null?void 0:d.route.id);u&&u[g.route.id]||(u={...u,[g.route.id]:m.error}),e.fetchers.delete(l)}else if(Ve(m))G(!1,"Unhandled fetcher revalidation redirect");else{let g=Ae(m.data);e.fetchers.set(l,g)}}),{loaderData:i,errors:u}}function wn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==Gn).reduce((o,[i,u])=>(o[i]=u,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function En(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Fe(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Ct(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:n,type:a,message:o}={}){let i="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(i="Bad Request",n&&t&&r?u=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(i="Forbidden",u=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",u=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",n&&t&&r?u=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(u=`Invalid request method "${n.toUpperCase()}"`)),new Ue(e||500,i,new Error(u),!0)}function Pt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Ve(a))return{key:n,result:a}}}function ta(e){let t=typeof e=="string"?Ie(e):e;return Pe({...t,hash:""})}function ni(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function ai(e){var t,r;return new Ue(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function oi(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&ii(r))}function ii(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function li(e){return Ut(e.result)&&Vn.has(e.result.status)}function Re(e){return e.type==="error"}function Ve(e){return(e&&e.type)==="redirect"}function cr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ut(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function si(e){return Vn.has(e)}function ui(e){return Ut(e)&&si(e.status)&&e.headers.has("Location")}function ci(e){return Ho.has(e.toUpperCase())}function ye(e){return jo.has(e.toUpperCase())}function br(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ot(e,t){let r=typeof t=="string"?Ie(t).search:t.search;if(e[e.length-1].route.index&&br(r||""))return e[e.length-1];let n=Hn(e);return n[n.length-1]}function Rn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function tr(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 di(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 lt(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 fi(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 Ae(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 hi(e,t){try{let r=e.sessionStorage.getItem(Jn);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function mi(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Jn,JSON.stringify(r))}catch(n){ue(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function bn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Ge=h.createContext(null);Ge.displayName="DataRouter";var et=h.createContext(null);et.displayName="DataRouterState";var ra=h.createContext(!1);function na(){return h.useContext(ra)}var Sr=h.createContext({isTransitioning:!1});Sr.displayName="ViewTransition";var aa=h.createContext(new Map);aa.displayName="Fetchers";var pi=h.createContext(null);pi.displayName="Await";var Ee=h.createContext(null);Ee.displayName="Navigation";var Ht=h.createContext(null);Ht.displayName="Location";var _e=h.createContext({outlet:null,matches:[],isDataRoute:!1});_e.displayName="Route";var Lr=h.createContext(null);Lr.displayName="RouteError";var oa="REACT_ROUTER_ERROR",yi="REDIRECT",vi="ROUTE_ERROR_RESPONSE";function gi(e){if(e.startsWith(`${oa}:${yi}:{`))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 wi(e){if(e.startsWith(`${oa}:${vi}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ue(t.status,t.statusText,t.data)}catch{}}function Ei(e,{relative:t}={}){G(yt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=h.useContext(Ee),{hash:a,pathname:o,search:i}=vt(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:Ce([r,o])),n.createHref({pathname:u,search:i,hash:a})}function yt(){return h.useContext(Ht)!=null}function xe(){return G(yt(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Ht).location}var ia="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function la(e){h.useContext(Ee).static||h.useLayoutEffect(e)}function sa(){let{isDataRoute:e}=h.useContext(_e);return e?Ai():Ri()}function Ri(){G(yt(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Ge),{basename:t,navigator:r}=h.useContext(Ee),{matches:n}=h.useContext(_e),{pathname:a}=xe(),o=JSON.stringify(Er(n)),i=h.useRef(!1);return la(()=>{i.current=!0}),h.useCallback((s,l={})=>{if(ue(i.current,ia),!i.current)return;if(typeof s=="number"){r.go(s);return}let d=jt(s,JSON.parse(o),a,l.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ce([t,d.pathname])),(l.replace?r.replace:r.push)(d,l.state,l)},[t,r,o,a,e])}var bi=h.createContext(null);function Si(e){let t=h.useContext(_e).outlet;return h.useMemo(()=>t&&h.createElement(bi.Provider,{value:e},t),[t,e])}function ua(){let{matches:e}=h.useContext(_e),t=e[e.length-1];return t?t.params:{}}function vt(e,{relative:t}={}){let{matches:r}=h.useContext(_e),{pathname:n}=xe(),a=JSON.stringify(Er(r));return h.useMemo(()=>jt(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function Li(e,t,r){G(yt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=h.useContext(Ee),{matches:a}=h.useContext(_e),o=a[a.length-1],i=o?o.params:{},u=o?o.pathname:"/",s=o?o.pathnameBase:"/",l=o&&o.route;{let w=l&&l.path||"";ha(u,!l||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (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.
36
36
 
37
- Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let d=xe(),c;c=d;let m=c.pathname||"/",g=m;if(s!=="/"){let w=s.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let R=Ne(e,{pathname:g});return ue(l||R!=null,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),ue(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.`),Pi(R&&R.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:Ce([s,n.encodeLocation?n.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?s:Ce([s,n.encodeLocation?n.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),a,r)}function Si(){let e=ua(),t=Je(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,i)}var Li=h.createElement(Si,null),sa=class extends h.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=yi(e.digest);r&&(e=r)}let t=e!==void 0?h.createElement(_e.Provider,{value:this.props.routeContext},h.createElement(Lr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(xi,{error:e},t):t}};sa.contextType=ta;var rr=new WeakMap;function xi({children:e,error:t}){let{basename:r}=h.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=pi(t.digest);if(n){let a=rr.get(t);if(a)throw a;let o=zn(n.location,r);if(Hn&&!rr.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw rr.set(t,i),i}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Ci({routeContext:e,match:t,children:r}){let n=h.useContext(Ge);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(_e.Provider,{value:e},r)}function Pi(e,t=[],r){let n=r==null?void 0:r.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let d=a.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);G(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,d+1))}let i=!1,u=-1;if(r&&n){i=n.renderFallback;for(let d=0;d<a.length;d++){let c=a[d];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(u=d),c.route.id){let{loaderData:m,errors:g}=n,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),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let s=r==null?void 0:r.onError,l=n&&s?(d,c)=>{var m,g;s(d,{location:n.location,params:((g=(m=n.matches)==null?void 0:m[0])==null?void 0:g.params)??{},unstable_pattern:pt(n.matches),errorInfo:c})}:void 0;return a.reduceRight((d,c,m)=>{let g,R=!1,b=null,w=null;n&&(g=o&&c.route.id?o[c.route.id]:void 0,b=c.route.errorElement||Li,i&&(u<0&&m===0?(ca("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,w=null):u===m&&(R=!0,w=c.route.hydrateFallbackElement||null)));let P=t.concat(a.slice(0,m+1)),_=()=>{let D;return g?D=b:R?D=w:c.route.Component?D=h.createElement(c.route.Component,null):c.route.element?D=c.route.element:D=d,h.createElement(Ci,{match:c,routeContext:{outlet:d,matches:P,isDataRoute:n!=null},children:D})};return n&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?h.createElement(sa,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:_(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:l}):_()},null)}function xr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _i(e){let t=h.useContext(Ge);return G(t,xr(e)),t}function gt(e){let t=h.useContext(et);return G(t,xr(e)),t}function Ti(e){let t=h.useContext(_e);return G(t,xr(e)),t}function wt(e){let t=Ti(e),r=t.matches[t.matches.length-1];return G(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Mi(){return wt("useRouteId")}function Di(){return gt("useNavigation").navigation}function Cr(){let{matches:e,loaderData:t}=gt("useMatches");return h.useMemo(()=>e.map(r=>Nn(r,t)),[e,t])}function Oi(){let e=gt("useLoaderData"),t=wt("useLoaderData");return e.loaderData[t]}function ki(){let e=gt("useActionData"),t=wt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function ua(){var n;let e=h.useContext(Lr),t=gt("useRouteError"),r=wt("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Ai(){let{router:e}=_i("useNavigate"),t=wt("useNavigate"),r=h.useRef(!1);return ia(()=>{r.current=!0}),h.useCallback(async(a,o={})=>{ue(r.current,oa),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var bn={};function ca(e,t,r){!t&&!bn[e]&&(bn[e]=!0,ue(!1,r))}var Sn={};function dr(e,t){!e&&!Sn[t]&&(Sn[t]=!0,console.warn(t))}var Ni="useOptimistic",Ln=Qa[Ni],Ii=()=>{};function $i(e){return Ln?Ln(e):[e,Ii]}function Rs(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ue(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ue(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ue(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var bs=["HydrateFallback","hydrateFallbackElement"],Fi=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 Ss({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=ra()||n;let[o,i]=h.useState(e.state),[u,s]=$i(o),[l,d]=h.useState(),[c,m]=h.useState({isTransitioning:!1}),[g,R]=h.useState(),[b,w]=h.useState(),[P,_]=h.useState(),D=h.useRef(new Map),N=h.useCallback((v,{deletedFetchers:B,newErrors:H,flushSync:oe,viewTransitionOpts:V})=>{H&&r&&Object.values(H).forEach(K=>{var re;return r(K,{location:v.location,params:((re=v.matches[0])==null?void 0:re.params)??{},unstable_pattern:pt(v.matches)})}),v.fetchers.forEach((K,re)=>{K.data!==void 0&&D.current.set(re,K.data)}),B.forEach(K=>D.current.delete(K)),dr(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(dr(V==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."),!V||!ie){t&&oe?t(()=>i(v)):n===!1?i(v):h.startTransition(()=>{n===!0&&s(K=>xn(K,v)),i(v)});return}if(t&&oe){t(()=>{b&&(g==null||g.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let K=e.window.document.startViewTransition(()=>{t(()=>i(v))});K.finished.finally(()=>{t(()=>{R(void 0),w(void 0),d(void 0),m({isTransitioning:!1})})}),t(()=>w(K));return}b?(g==null||g.resolve(),b.skipTransition(),_({state:v,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(d(v),m({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[e.window,t,b,g,n,s,r]);h.useLayoutEffect(()=>e.subscribe(N),[e,N]),h.useEffect(()=>{c.isTransitioning&&!c.flushSync&&R(new Fi)},[c]),h.useEffect(()=>{if(g&&l&&e.window){let v=l,B=g.promise,H=e.window.document.startViewTransition(async()=>{n===!1?i(v):h.startTransition(()=>{n===!0&&s(oe=>xn(oe,v)),i(v)}),await B});H.finished.finally(()=>{R(void 0),w(void 0),d(void 0),m({isTransitioning:!1})}),w(H)}},[l,g,e.window,n,s]),h.useEffect(()=>{g&&l&&u.location.key===l.location.key&&g.resolve()},[g,b,u.location,l]),h.useEffect(()=>{!c.isTransitioning&&P&&(d(P.state),m({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),_(void 0))},[c.isTransitioning,P]);let S=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:v=>e.navigate(v),push:(v,B,H)=>e.navigate(v,{state:B,preventScrollReset:H==null?void 0:H.preventScrollReset}),replace:(v,B,H)=>e.navigate(v,{replace:!0,state:B,preventScrollReset:H==null?void 0:H.preventScrollReset})}),[e]),M=e.basename||"/",A=h.useMemo(()=>({router:e,navigator:S,static:!1,basename:M,onError:r}),[e,S,M,r]);return h.createElement(h.Fragment,null,h.createElement(Ge.Provider,{value:A},h.createElement(et.Provider,{value:u},h.createElement(na.Provider,{value:D.current},h.createElement(Sr.Provider,{value:c},h.createElement(Hi,{basename:M,location:u.location,navigationType:u.historyAction,navigator:S,unstable_useTransitions:n},h.createElement(ji,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:r})))))),null)}function xn(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 ji=h.memo(Ui);function Ui({routes:e,future:t,state:r,isStatic:n,onError:a}){return bi(e,void 0,{state:r,isStatic:n,onError:a})}function Ls(e){return Ei(e.context)}function Hi({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){G(!yt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:u,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[u,a,o,i]);typeof r=="string"&&(r=Ie(r));let{pathname:l="/",search:d="",hash:c="",state:m=null,key:g="default",unstable_mask:R}=r,b=h.useMemo(()=>{let w=be(l,u);return w==null?null:{location:{pathname:w,search:d,hash:c,state:m,key:g,unstable_mask:R},navigationType:n}},[u,l,d,c,m,g,n,R]);return ue(b!=null,`<Router basename="${u}"> is not able to match the URL "${l}${d}${c}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:h.createElement(Ee.Provider,{value:s},h.createElement(Ht.Provider,{children:t,value:b}))}function zi(){return{params:Ri(),loaderData:Oi(),actionData:ki(),matches:Cr()}}function xs(e){return function(){const r=zi();return h.createElement(e,r)}}var kt="get",At="application/x-www-form-urlencoded";function zt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Bi(e){return zt(e)&&e.tagName.toLowerCase()==="button"}function Wi(e){return zt(e)&&e.tagName.toLowerCase()==="form"}function Yi(e){return zt(e)&&e.tagName.toLowerCase()==="input"}function Vi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ji(e,t){return e.button===0&&(!t||t==="_self")&&!Vi(e)}function fr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Gi(e,t){let r=fr(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var _t=null;function Xi(){if(_t===null)try{new FormData(document.createElement("form"),0),_t=!1}catch{_t=!0}return _t}var Ki=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nr(e){return e!=null&&!Ki.has(e)?(ue(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${At}"`),null):e}function qi(e,t){let r,n,a,o,i;if(Wi(e)){let u=e.getAttribute("action");n=u?be(u,t):null,r=e.getAttribute("method")||kt,a=nr(e.getAttribute("enctype"))||At,o=new FormData(e)}else if(Bi(e)||Yi(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||u.getAttribute("action");if(n=s?be(s,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||kt,a=nr(e.getAttribute("formenctype"))||nr(u.getAttribute("enctype"))||At,o=new FormData(u,e),!Xi()){let{name:l,type:d,value:c}=e;if(d==="image"){let m=l?`${l}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else l&&o.append(l,c)}}else{if(zt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=kt,n=null,a=At,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var Qi=-1,Zi=-2,el=-3,tl=-4,rl=-5,nl=-6,al=-7,ol="B",il="D",da="E",ll="M",sl="N",fa="P",ul="R",cl="S",dl="Y",fl="U",hl="Z",ha=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function ml(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
38
- `);t=o.pop()||"";for(const i of o)n.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ar=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function hr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Cn.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,Cn.call(this,n)}function Cn(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,s=>{o=s}]];let u=[];for(;i.length>0;){const[s,l]=i.pop();switch(s){case al:l(void 0);continue;case rl:l(null);continue;case Zi:l(NaN);continue;case nl:l(1/0);continue;case el:l(-1/0);continue;case tl:l(-0);continue}if(t[s]){l(t[s]);continue}const d=r[s];if(!d||typeof d!="object"){t[s]=d,l(d);continue}if(Array.isArray(d))if(typeof d[0]=="string"){const[c,m,g]=d;switch(c){case il:l(t[s]=new Date(m));continue;case fl:l(t[s]=new URL(m));continue;case ol:l(t[s]=BigInt(m));continue;case ul:l(t[s]=new RegExp(m,g));continue;case dl:l(t[s]=Symbol.for(m));continue;case cl:const R=new Set;t[s]=R;for(let N=d.length-1;N>0;N--)i.push([d[N],S=>{R.add(S)}]);l(R);continue;case ll:const b=new Map;t[s]=b;for(let N=d.length-2;N>0;N-=2){const S=[];i.push([d[N+1],M=>{S[1]=M}]),i.push([d[N],M=>{S[0]=M}]),u.push(()=>{b.set(S[0],S[1])})}l(b);continue;case sl:const w=Object.create(null);t[s]=w;for(const N of Object.keys(m).reverse()){const S=[];i.push([m[N],M=>{S[1]=M}]),i.push([Number(N.slice(1)),M=>{S[0]=M}]),u.push(()=>{w[S[0]]=S[1]})}l(w);continue;case fa:if(t[m])l(t[s]=t[m]);else{const N=new ha;n[m]=N,l(t[s]=N.promise)}continue;case da:const[,P,_]=d;let D=_&&ar&&ar[_]?new ar[_](P):new Error(P);t[s]=D,l(D);continue;case hl:l(t[s]=t[m]);continue;default:if(Array.isArray(a)){const N=[],S=d.slice(1);for(let M=0;M<S.length;M++){const A=S[M];i.push([A,v=>{N[M]=v}])}u.push(()=>{for(const M of a){const A=M(d[0],...N);if(A){l(t[s]=A.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[s]=c;for(let m=0;m<d.length;m++){const g=d[m];g!==Qi&&i.push([g,R=>{c[m]=R}])}l(c);continue}else{const c={};t[s]=c;for(const m of Object.keys(d).reverse()){const g=[];i.push([d[m],R=>{g[1]=R}]),i.push([Number(m.slice(1)),R=>{g[0]=R}]),u.push(()=>{c[g[0]]=g[1]})}l(c);continue}}for(;u.length>0;)u.pop()();return o}async function pl(e,t){const{plugins:r}=t??{},n=new ha,a=e.pipeThrough(ml()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await yl.call(o,a);let u=n.promise;return i.done?n.resolve():u=vl.call(o,a).then(n.resolve).catch(s=>{for(const l of Object.values(o.deferred))l.reject(s);n.reject(s)}),{done:u.then(()=>a.closed),value:i.value}}async function yl(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:hr.call(this,r)}}async function vl(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case fa:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let u;try{u=JSON.parse(i)}catch{throw new SyntaxError}const s=hr.call(this,u);o.resolve(s);break}case da:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let u;try{u=JSON.parse(i)}catch{throw new SyntaxError}const s=hr.call(this,u);o.reject(s);break}default:throw new SyntaxError}t=await e.read()}}async function gl(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 wl={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},El=/[&><\u2028\u2029]/g;function mr(e){return e.replace(El,t=>wl[t])}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var pr=Symbol("SingleFetchRedirect"),ma=class extends Error{},Rl=202,bl=new Set([100,101,204,205]);function Cs(e,t,r,n,a,o){let i=Sl(e,u=>{let s=t.routes[u.route.id];we(s,"Route not found in manifest");let l=r[u.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(l!=null&&l.shouldRevalidate)}},Ml,n,a,o);return async u=>u.runClientMiddleware(i)}function Sl(e,t,r,n,a,o,i=()=>!0){return async u=>{let{request:s,matches:l,fetcherKey:d}=u,c=e();if(s.method!=="GET")return Ll(u,r,a,o);let m=l.some(g=>{let{hasLoader:R,hasClientLoader:b}=t(g);return g.shouldCallHandler()&&R&&!b});return!n&&!m?xl(u,t,r,a,o):d?_l(u,r,a,o):Cl(u,c,t,r,n,a,o,i)}}async function Ll(e,t,r,n){let a=e.matches.find(u=>u.shouldCallHandler());we(a,"No action match found");let o,i=await a.resolve(async u=>await u(async()=>{let{data:l,status:d}=await t(e,r,n,[a.route.id]);return o=d,mt(l,a.route.id)}));return Ut(i.result)||Je(i.result)||cr(i.result)?{[a.route.id]:i}:{[a.route.id]:{type:i.type,result:_o(i.result,o)}}}async function xl(e,t,r,n,a){let o=e.matches.filter(u=>u.shouldCallHandler()),i={};return await Promise.all(o.map(u=>u.resolve(async s=>{try{let{hasClientLoader:l}=t(u),d=u.route.id,c=l?await s(async()=>{let{data:m}=await r(e,n,a,[d]);return mt(m,d)}):await s();i[u.route.id]={type:"data",result:c}}catch(l){i[u.route.id]={type:"error",result:l}}}))),i}async function Cl(e,t,r,n,a,o,i,u=()=>!0){let s=new Set,l=!1,d=e.matches.map(()=>Pn()),c=Pn(),m={},g=Promise.all(e.matches.map(async(b,w)=>b.resolve(async P=>{d[w].resolve();let _=b.route.id,{hasLoader:D,hasClientLoader:N,hasShouldRevalidate:S}=r(b),M=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(M)){l||(l=b.shouldRevalidateArgs!=null&&D&&S===!0);return}if(u(b)&&N){D&&(l=!0);try{let v=await P(async()=>{let{data:B}=await n(e,o,i,[_]);return mt(B,_)});m[_]={type:"data",result:v}}catch(v){m[_]={type:"error",result:v}}return}D&&s.add(_);try{let v=await P(async()=>{let B=await c.promise;return mt(B,_)});m[_]={type:"data",result:v}}catch(v){m[_]={type:"error",result:v}}})));if(await Promise.all(d.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=a&&l&&s.size>0?[...s.keys()]:void 0;try{let w=await n(e,o,i,b);c.resolve(w.data)}catch(w){c.reject(w)}}return await g,await Pl(c.promise,e.matches,s,m),m}async function Pl(e,t,r,n){var a;try{let o,i=await e;if("routes"in i){for(let u of t)if(u.route.id in i.routes){let s=i.routes[u.route.id];if("error"in s){o=s.error,((a=n[u.route.id])==null?void 0:a.result)==null&&(n[u.route.id]={type:"error",result:o});break}}}o!==void 0&&Array.from(r.values()).forEach(u=>{n[u].result instanceof ma&&(n[u].result=o)})}catch{}}async function _l(e,t,r,n){let a=e.matches.find(u=>u.shouldCallHandler());we(a,"No fetcher match found");let o=a.route.id,i=await a.resolve(async u=>u(async()=>{let{data:s}=await t(e,r,n,[o]);return mt(s,o)}));return{[a.route.id]:i}}function Tl(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}function pa(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&be(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${n}`,a}async function Ml(e,t,r,n){let{request:a}=e,o=pa(a.url,t,r,"data");a.method==="GET"&&(o=Tl(o),n&&o.searchParams.set("_routes",n.join(",")));let i=await fetch(o,await gl(a));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new Ue(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has("X-Remix-Redirect"))return{status:Rl,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(bl.has(i.status)){let u={};return n&&a.method!=="GET"&&(u[n[0]]={data:void 0}),{status:i.status,data:{routes:u}}}we(i.body,"No response body to decode");try{let u=await Dl(i.body,window),s;if(a.method==="GET"){let l=u.value;pr in l?s={redirect:l[pr]}:s={routes:l}}else{let l=u.value,d=n==null?void 0:n[0];we(d,"No routeId found for single fetch call decoding"),"redirect"in l?s={redirect:l}:s={routes:{[d]:l}}}return{status:i.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Dl(e,t){return pl(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,i]=n,u=Error;a&&a in t&&typeof t[a]=="function"&&(u=t[a]);let s=new u(o);return s.stack=i,{value:s}}if(r==="ErrorResponse"){let[a,o,i]=n;return{value:new Ue(o,i,a)}}if(r==="SingleFetchRedirect")return{value:{[pr]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function mt(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:i,status:u}=e.redirect;throw To(n,{status:u,headers:{...a?{"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 ma(`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 Pn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function ya(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 Ol(e,t,r){let n=e.map(o=>{var s;let i=t[o.route.id],u=r.routes[o.route.id];return[u&&u.css?u.css.map(l=>({rel:"stylesheet",href:l})):[],((s=i==null?void 0:i.links)==null?void 0:s.call(i))||[]]}).flat(2),a=_r(e,r);return Ea(n,a)}function va(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function kl(e){if(!e.css)return;let t=va(e);await Promise.all(t.map(wa))}async function ga(e,t){if(!e.css&&!t.links||!Fl())return;let r=[];if(e.css&&r.push(...va(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!Pr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(wa))}async function wa(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 n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function Pr(e){return e!=null&&typeof e.page=="string"}function Al(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 Nl(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await ya(o,r);return i.links?i.links():[]}return[]}));return Ea(n.flat(1).filter(Al).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function _n(e,t,r,n,a,o){let i=(s,l)=>r[l]?s.route.id!==r[l].route.id:!0,u=(s,l)=>{var d;return r[l].pathname!==s.pathname||((d=r[l].route.path)==null?void 0:d.endsWith("*"))&&r[l].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,l)=>i(s,l)||u(s,l)):o==="data"?t.filter((s,l)=>{var c;let d=n.routes[s.route.id];if(!d||!d.hasLoader)return!1;if(i(s,l)||u(s,l))return!0;if(s.route.shouldRevalidate){let m=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.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 _r(e,t,{includeHydrateFallback:r}={}){return Il(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function Il(e){return[...new Set(e)]}function $l(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Ea(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!Pr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let u=JSON.stringify($l(o));return r.has(u)||(r.add(u),a.push({key:u,link:o})),a},[])}var Tt;function Fl(){if(Tt!==void 0)return Tt;let e=document.createElement("link");return Tt=e.relList.supports("preload"),e=null,Tt}function jl(){return h.createElement(yr,{title:"Loading...",renderScripts:!0},h.createElement("script",{dangerouslySetInnerHTML:{__html:`
37
+ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let d=xe(),c;c=d;let m=c.pathname||"/",g=m;if(s!=="/"){let w=s.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let R=Ne(e,{pathname:g});return ue(l||R!=null,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),ue(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.`),Ti(R&&R.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:Ce([s,n.encodeLocation?n.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?s:Ce([s,n.encodeLocation?n.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),a,r)}function xi(){let e=Pr(),t=Je(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,i)}var Ci=h.createElement(xi,null),ca=class extends h.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=wi(e.digest);r&&(e=r)}let t=e!==void 0?h.createElement(_e.Provider,{value:this.props.routeContext},h.createElement(Lr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(Pi,{error:e},t):t}};ca.contextType=ra;var rr=new WeakMap;function Pi({children:e,error:t}){let{basename:r}=h.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=gi(t.digest);if(n){let a=rr.get(t);if(a)throw a;let o=Bn(n.location,r);if(zn&&!rr.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw rr.set(t,i),i}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function _i({routeContext:e,match:t,children:r}){let n=h.useContext(Ge);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(_e.Provider,{value:e},r)}function Ti(e,t=[],r){let n=r==null?void 0:r.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let d=a.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);G(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,d+1))}let i=!1,u=-1;if(r&&n){i=n.renderFallback;for(let d=0;d<a.length;d++){let c=a[d];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(u=d),c.route.id){let{loaderData:m,errors:g}=n,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),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let s=r==null?void 0:r.onError,l=n&&s?(d,c)=>{var m,g;s(d,{location:n.location,params:((g=(m=n.matches)==null?void 0:m[0])==null?void 0:g.params)??{},unstable_pattern:pt(n.matches),errorInfo:c})}:void 0;return a.reduceRight((d,c,m)=>{let g,R=!1,b=null,w=null;n&&(g=o&&c.route.id?o[c.route.id]:void 0,b=c.route.errorElement||Ci,i&&(u<0&&m===0?(ha("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,w=null):u===m&&(R=!0,w=c.route.hydrateFallbackElement||null)));let P=t.concat(a.slice(0,m+1)),_=()=>{let D;return g?D=b:R?D=w:c.route.Component?D=h.createElement(c.route.Component,null):c.route.element?D=c.route.element:D=d,h.createElement(_i,{match:c,routeContext:{outlet:d,matches:P,isDataRoute:n!=null},children:D})};return n&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?h.createElement(ca,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:_(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:l}):_()},null)}function xr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mi(e){let t=h.useContext(Ge);return G(t,xr(e)),t}function gt(e){let t=h.useContext(et);return G(t,xr(e)),t}function Di(e){let t=h.useContext(_e);return G(t,xr(e)),t}function wt(e){let t=Di(e),r=t.matches[t.matches.length-1];return G(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Oi(){return wt("useRouteId")}function ki(){return gt("useNavigation").navigation}function Cr(){let{matches:e,loaderData:t}=gt("useMatches");return h.useMemo(()=>e.map(r=>In(r,t)),[e,t])}function da(){let e=gt("useLoaderData"),t=wt("useLoaderData");return e.loaderData[t]}function fa(){let e=gt("useActionData"),t=wt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Pr(){var n;let e=h.useContext(Lr),t=gt("useRouteError"),r=wt("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Ai(){let{router:e}=Mi("useNavigate"),t=wt("useNavigate"),r=h.useRef(!1);return la(()=>{r.current=!0}),h.useCallback(async(a,o={})=>{ue(r.current,ia),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var Sn={};function ha(e,t,r){!t&&!Sn[e]&&(Sn[e]=!0,ue(!1,r))}var Ln={};function dr(e,t){!e&&!Ln[t]&&(Ln[t]=!0,console.warn(t))}var Ni="useOptimistic",xn=to[Ni],Ii=()=>{};function $i(e){return xn?xn(e):[e,Ii]}function bs(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ue(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ue(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ue(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ss=["HydrateFallback","hydrateFallbackElement"],Fi=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 Ls({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=na()||n;let[o,i]=h.useState(e.state),[u,s]=$i(o),[l,d]=h.useState(),[c,m]=h.useState({isTransitioning:!1}),[g,R]=h.useState(),[b,w]=h.useState(),[P,_]=h.useState(),D=h.useRef(new Map),N=h.useCallback((v,{deletedFetchers:B,newErrors:H,flushSync:oe,viewTransitionOpts:V})=>{H&&r&&Object.values(H).forEach(K=>{var re;return r(K,{location:v.location,params:((re=v.matches[0])==null?void 0:re.params)??{},unstable_pattern:pt(v.matches)})}),v.fetchers.forEach((K,re)=>{K.data!==void 0&&D.current.set(re,K.data)}),B.forEach(K=>D.current.delete(K)),dr(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(dr(V==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."),!V||!ie){t&&oe?t(()=>i(v)):n===!1?i(v):h.startTransition(()=>{n===!0&&s(K=>Cn(K,v)),i(v)});return}if(t&&oe){t(()=>{b&&(g==null||g.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let K=e.window.document.startViewTransition(()=>{t(()=>i(v))});K.finished.finally(()=>{t(()=>{R(void 0),w(void 0),d(void 0),m({isTransitioning:!1})})}),t(()=>w(K));return}b?(g==null||g.resolve(),b.skipTransition(),_({state:v,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(d(v),m({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[e.window,t,b,g,n,s,r]);h.useLayoutEffect(()=>e.subscribe(N),[e,N]),h.useEffect(()=>{c.isTransitioning&&!c.flushSync&&R(new Fi)},[c]),h.useEffect(()=>{if(g&&l&&e.window){let v=l,B=g.promise,H=e.window.document.startViewTransition(async()=>{n===!1?i(v):h.startTransition(()=>{n===!0&&s(oe=>Cn(oe,v)),i(v)}),await B});H.finished.finally(()=>{R(void 0),w(void 0),d(void 0),m({isTransitioning:!1})}),w(H)}},[l,g,e.window,n,s]),h.useEffect(()=>{g&&l&&u.location.key===l.location.key&&g.resolve()},[g,b,u.location,l]),h.useEffect(()=>{!c.isTransitioning&&P&&(d(P.state),m({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),_(void 0))},[c.isTransitioning,P]);let S=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:v=>e.navigate(v),push:(v,B,H)=>e.navigate(v,{state:B,preventScrollReset:H==null?void 0:H.preventScrollReset}),replace:(v,B,H)=>e.navigate(v,{replace:!0,state:B,preventScrollReset:H==null?void 0:H.preventScrollReset})}),[e]),M=e.basename||"/",A=h.useMemo(()=>({router:e,navigator:S,static:!1,basename:M,onError:r}),[e,S,M,r]);return h.createElement(h.Fragment,null,h.createElement(Ge.Provider,{value:A},h.createElement(et.Provider,{value:u},h.createElement(aa.Provider,{value:D.current},h.createElement(Sr.Provider,{value:c},h.createElement(Hi,{basename:M,location:u.location,navigationType:u.historyAction,navigator:S,unstable_useTransitions:n},h.createElement(ji,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:r})))))),null)}function Cn(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 ji=h.memo(Ui);function Ui({routes:e,future:t,state:r,isStatic:n,onError:a}){return Li(e,void 0,{state:r,isStatic:n,onError:a})}function xs(e){return Si(e.context)}function Hi({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){G(!yt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:u,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[u,a,o,i]);typeof r=="string"&&(r=Ie(r));let{pathname:l="/",search:d="",hash:c="",state:m=null,key:g="default",unstable_mask:R}=r,b=h.useMemo(()=>{let w=be(l,u);return w==null?null:{location:{pathname:w,search:d,hash:c,state:m,key:g,unstable_mask:R},navigationType:n}},[u,l,d,c,m,g,n,R]);return ue(b!=null,`<Router basename="${u}"> is not able to match the URL "${l}${d}${c}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:h.createElement(Ee.Provider,{value:s},h.createElement(Ht.Provider,{children:t,value:b}))}function zi(){return{params:ua(),loaderData:da(),actionData:fa(),matches:Cr()}}function Cs(e){return function(){const r=zi();return h.createElement(e,r)}}function Bi(){return{params:ua(),loaderData:da(),actionData:fa(),error:Pr()}}function Ps(e){return function(){const r=Bi();return h.createElement(e,r)}}var kt="get",At="application/x-www-form-urlencoded";function zt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Wi(e){return zt(e)&&e.tagName.toLowerCase()==="button"}function Yi(e){return zt(e)&&e.tagName.toLowerCase()==="form"}function Vi(e){return zt(e)&&e.tagName.toLowerCase()==="input"}function Ji(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gi(e,t){return e.button===0&&(!t||t==="_self")&&!Ji(e)}function fr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Xi(e,t){let r=fr(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var _t=null;function Ki(){if(_t===null)try{new FormData(document.createElement("form"),0),_t=!1}catch{_t=!0}return _t}var qi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nr(e){return e!=null&&!qi.has(e)?(ue(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${At}"`),null):e}function Qi(e,t){let r,n,a,o,i;if(Yi(e)){let u=e.getAttribute("action");n=u?be(u,t):null,r=e.getAttribute("method")||kt,a=nr(e.getAttribute("enctype"))||At,o=new FormData(e)}else if(Wi(e)||Vi(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||u.getAttribute("action");if(n=s?be(s,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||kt,a=nr(e.getAttribute("formenctype"))||nr(u.getAttribute("enctype"))||At,o=new FormData(u,e),!Ki()){let{name:l,type:d,value:c}=e;if(d==="image"){let m=l?`${l}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else l&&o.append(l,c)}}else{if(zt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=kt,n=null,a=At,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var Zi=-1,el=-2,tl=-3,rl=-4,nl=-5,al=-6,ol=-7,il="B",ll="D",ma="E",sl="M",ul="N",pa="P",cl="R",dl="S",fl="Y",hl="U",ml="Z",ya=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function pl(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
38
+ `);t=o.pop()||"";for(const i of o)n.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ar=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function hr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Pn.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,Pn.call(this,n)}function Pn(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,s=>{o=s}]];let u=[];for(;i.length>0;){const[s,l]=i.pop();switch(s){case ol:l(void 0);continue;case nl:l(null);continue;case el:l(NaN);continue;case al:l(1/0);continue;case tl:l(-1/0);continue;case rl:l(-0);continue}if(t[s]){l(t[s]);continue}const d=r[s];if(!d||typeof d!="object"){t[s]=d,l(d);continue}if(Array.isArray(d))if(typeof d[0]=="string"){const[c,m,g]=d;switch(c){case ll:l(t[s]=new Date(m));continue;case hl:l(t[s]=new URL(m));continue;case il:l(t[s]=BigInt(m));continue;case cl:l(t[s]=new RegExp(m,g));continue;case fl:l(t[s]=Symbol.for(m));continue;case dl:const R=new Set;t[s]=R;for(let N=d.length-1;N>0;N--)i.push([d[N],S=>{R.add(S)}]);l(R);continue;case sl:const b=new Map;t[s]=b;for(let N=d.length-2;N>0;N-=2){const S=[];i.push([d[N+1],M=>{S[1]=M}]),i.push([d[N],M=>{S[0]=M}]),u.push(()=>{b.set(S[0],S[1])})}l(b);continue;case ul:const w=Object.create(null);t[s]=w;for(const N of Object.keys(m).reverse()){const S=[];i.push([m[N],M=>{S[1]=M}]),i.push([Number(N.slice(1)),M=>{S[0]=M}]),u.push(()=>{w[S[0]]=S[1]})}l(w);continue;case pa:if(t[m])l(t[s]=t[m]);else{const N=new ya;n[m]=N,l(t[s]=N.promise)}continue;case ma:const[,P,_]=d;let D=_&&ar&&ar[_]?new ar[_](P):new Error(P);t[s]=D,l(D);continue;case ml:l(t[s]=t[m]);continue;default:if(Array.isArray(a)){const N=[],S=d.slice(1);for(let M=0;M<S.length;M++){const A=S[M];i.push([A,v=>{N[M]=v}])}u.push(()=>{for(const M of a){const A=M(d[0],...N);if(A){l(t[s]=A.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[s]=c;for(let m=0;m<d.length;m++){const g=d[m];g!==Zi&&i.push([g,R=>{c[m]=R}])}l(c);continue}else{const c={};t[s]=c;for(const m of Object.keys(d).reverse()){const g=[];i.push([d[m],R=>{g[1]=R}]),i.push([Number(m.slice(1)),R=>{g[0]=R}]),u.push(()=>{c[g[0]]=g[1]})}l(c);continue}}for(;u.length>0;)u.pop()();return o}async function yl(e,t){const{plugins:r}=t??{},n=new ya,a=e.pipeThrough(pl()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await vl.call(o,a);let u=n.promise;return i.done?n.resolve():u=gl.call(o,a).then(n.resolve).catch(s=>{for(const l of Object.values(o.deferred))l.reject(s);n.reject(s)}),{done:u.then(()=>a.closed),value:i.value}}async function vl(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:hr.call(this,r)}}async function gl(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case pa:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let u;try{u=JSON.parse(i)}catch{throw new SyntaxError}const s=hr.call(this,u);o.resolve(s);break}case ma:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let u;try{u=JSON.parse(i)}catch{throw new SyntaxError}const s=hr.call(this,u);o.reject(s);break}default:throw new SyntaxError}t=await e.read()}}async function wl(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 El={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Rl=/[&><\u2028\u2029]/g;function mr(e){return e.replace(Rl,t=>El[t])}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var pr=Symbol("SingleFetchRedirect"),va=class extends Error{},bl=202,Sl=new Set([100,101,204,205]);function _s(e,t,r,n,a,o){let i=Ll(e,u=>{let s=t.routes[u.route.id];we(s,"Route not found in manifest");let l=r[u.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(l!=null&&l.shouldRevalidate)}},Dl,n,a,o);return async u=>u.runClientMiddleware(i)}function Ll(e,t,r,n,a,o,i=()=>!0){return async u=>{let{request:s,matches:l,fetcherKey:d}=u,c=e();if(s.method!=="GET")return xl(u,r,a,o);let m=l.some(g=>{let{hasLoader:R,hasClientLoader:b}=t(g);return g.shouldCallHandler()&&R&&!b});return!n&&!m?Cl(u,t,r,a,o):d?Tl(u,r,a,o):Pl(u,c,t,r,n,a,o,i)}}async function xl(e,t,r,n){let a=e.matches.find(u=>u.shouldCallHandler());we(a,"No action match found");let o,i=await a.resolve(async u=>await u(async()=>{let{data:l,status:d}=await t(e,r,n,[a.route.id]);return o=d,mt(l,a.route.id)}));return Ut(i.result)||Je(i.result)||cr(i.result)?{[a.route.id]:i}:{[a.route.id]:{type:i.type,result:Do(i.result,o)}}}async function Cl(e,t,r,n,a){let o=e.matches.filter(u=>u.shouldCallHandler()),i={};return await Promise.all(o.map(u=>u.resolve(async s=>{try{let{hasClientLoader:l}=t(u),d=u.route.id,c=l?await s(async()=>{let{data:m}=await r(e,n,a,[d]);return mt(m,d)}):await s();i[u.route.id]={type:"data",result:c}}catch(l){i[u.route.id]={type:"error",result:l}}}))),i}async function Pl(e,t,r,n,a,o,i,u=()=>!0){let s=new Set,l=!1,d=e.matches.map(()=>_n()),c=_n(),m={},g=Promise.all(e.matches.map(async(b,w)=>b.resolve(async P=>{d[w].resolve();let _=b.route.id,{hasLoader:D,hasClientLoader:N,hasShouldRevalidate:S}=r(b),M=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(M)){l||(l=b.shouldRevalidateArgs!=null&&D&&S===!0);return}if(u(b)&&N){D&&(l=!0);try{let v=await P(async()=>{let{data:B}=await n(e,o,i,[_]);return mt(B,_)});m[_]={type:"data",result:v}}catch(v){m[_]={type:"error",result:v}}return}D&&s.add(_);try{let v=await P(async()=>{let B=await c.promise;return mt(B,_)});m[_]={type:"data",result:v}}catch(v){m[_]={type:"error",result:v}}})));if(await Promise.all(d.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=a&&l&&s.size>0?[...s.keys()]:void 0;try{let w=await n(e,o,i,b);c.resolve(w.data)}catch(w){c.reject(w)}}return await g,await _l(c.promise,e.matches,s,m),m}async function _l(e,t,r,n){var a;try{let o,i=await e;if("routes"in i){for(let u of t)if(u.route.id in i.routes){let s=i.routes[u.route.id];if("error"in s){o=s.error,((a=n[u.route.id])==null?void 0:a.result)==null&&(n[u.route.id]={type:"error",result:o});break}}}o!==void 0&&Array.from(r.values()).forEach(u=>{n[u].result instanceof va&&(n[u].result=o)})}catch{}}async function Tl(e,t,r,n){let a=e.matches.find(u=>u.shouldCallHandler());we(a,"No fetcher match found");let o=a.route.id,i=await a.resolve(async u=>u(async()=>{let{data:s}=await t(e,r,n,[o]);return mt(s,o)}));return{[a.route.id]:i}}function Ml(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}function ga(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&be(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${n}`,a}async function Dl(e,t,r,n){let{request:a}=e,o=ga(a.url,t,r,"data");a.method==="GET"&&(o=Ml(o),n&&o.searchParams.set("_routes",n.join(",")));let i=await fetch(o,await wl(a));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new Ue(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has("X-Remix-Redirect"))return{status:bl,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(Sl.has(i.status)){let u={};return n&&a.method!=="GET"&&(u[n[0]]={data:void 0}),{status:i.status,data:{routes:u}}}we(i.body,"No response body to decode");try{let u=await Ol(i.body,window),s;if(a.method==="GET"){let l=u.value;pr in l?s={redirect:l[pr]}:s={routes:l}}else{let l=u.value,d=n==null?void 0:n[0];we(d,"No routeId found for single fetch call decoding"),"redirect"in l?s={redirect:l}:s={routes:{[d]:l}}}return{status:i.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Ol(e,t){return yl(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,i]=n,u=Error;a&&a in t&&typeof t[a]=="function"&&(u=t[a]);let s=new u(o);return s.stack=i,{value:s}}if(r==="ErrorResponse"){let[a,o,i]=n;return{value:new Ue(o,i,a)}}if(r==="SingleFetchRedirect")return{value:{[pr]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function mt(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:i,status:u}=e.redirect;throw Oo(n,{status:u,headers:{...a?{"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 va(`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 _n(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function wa(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 kl(e,t,r){let n=e.map(o=>{var s;let i=t[o.route.id],u=r.routes[o.route.id];return[u&&u.css?u.css.map(l=>({rel:"stylesheet",href:l})):[],((s=i==null?void 0:i.links)==null?void 0:s.call(i))||[]]}).flat(2),a=Tr(e,r);return Sa(n,a)}function Ea(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Al(e){if(!e.css)return;let t=Ea(e);await Promise.all(t.map(ba))}async function Ra(e,t){if(!e.css&&!t.links||!jl())return;let r=[];if(e.css&&r.push(...Ea(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!_r(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(ba))}async function ba(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 n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function _r(e){return e!=null&&typeof e.page=="string"}function Nl(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 Il(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await wa(o,r);return i.links?i.links():[]}return[]}));return Sa(n.flat(1).filter(Nl).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Tn(e,t,r,n,a,o){let i=(s,l)=>r[l]?s.route.id!==r[l].route.id:!0,u=(s,l)=>{var d;return r[l].pathname!==s.pathname||((d=r[l].route.path)==null?void 0:d.endsWith("*"))&&r[l].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,l)=>i(s,l)||u(s,l)):o==="data"?t.filter((s,l)=>{var c;let d=n.routes[s.route.id];if(!d||!d.hasLoader)return!1;if(i(s,l)||u(s,l))return!0;if(s.route.shouldRevalidate){let m=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.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(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function $l(e){return[...new Set(e)]}function Fl(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Sa(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!_r(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let u=JSON.stringify(Fl(o));return r.has(u)||(r.add(u),a.push({key:u,link:o})),a},[])}var Tt;function jl(){if(Tt!==void 0)return Tt;let e=document.createElement("link");return Tt=e.relList.supports("preload"),e=null,Tt}function Ul(){return h.createElement(yr,{title:"Loading...",renderScripts:!0},h.createElement("script",{dangerouslySetInnerHTML:{__html:`
39
39
  console.log(
40
40
  "💿 Hey developer 👋. You can provide a way better UX than this " +
41
41
  "when your app is loading JS modules and/or running \`clientLoader\` " +
42
42
  "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
43
43
  "for more information."
44
44
  );
45
- `}}))}function Ra(e){let t={};return Object.values(e).forEach(r=>{if(r){let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}}),t}function Ul(e,t,r){let n=ba(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?jl:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>h.createElement(xa,{error:ua()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:h.createElement(t.Layout,null,h.createElement(n,null))}:{Component:n},...o?{errorElement:h.createElement(t.Layout,null,h.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:h.createElement(t.Layout,null,h.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function Ps(e,t,r,n,a,o){return Tr(t,r,n,a,o,"",Ra(t),e)}function Mt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let n=`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(n),new Ue(400,"Bad Request",new Error(n),!0)}}function or(e,t){let r=e==="clientAction"?"a":"an",n=`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(n),new Ue(405,"Method Not Allowed",new Error(n),!0)}function Tr(e,t,r,n,a,o="",i=Ra(e),u){return(i[o]||[]).map(s=>{var _,D,N;let l=t[s.id];function d(S){return we(typeof S=="function","No single fetch function available for route handler"),S()}function c(S){return s.hasLoader?d(S):Promise.resolve(null)}function m(S){if(!s.hasAction)throw or("action",s.id);return d(S)}function g(S){import(S)}function R(S){S.clientActionModule&&g(S.clientActionModule),S.clientLoaderModule&&g(S.clientLoaderModule)}async function b(S){let M=t[s.id],A=M?ga(s,M):Promise.resolve();try{return S()}finally{await A}}let w={id:s.id,index:s.index,path:s.path};if(l){Object.assign(w,{...w,...Ul(s,l,a),middleware:l.clientMiddleware,handle:l.handle,shouldRevalidate:Tn(w.path,l,s,n,u)});let S=r&&r.loaderData&&s.id in r.loaderData,M=S?(_=r==null?void 0:r.loaderData)==null?void 0:_[s.id]:void 0,A=r&&r.errors&&s.id in r.errors,v=A?(D=r==null?void 0:r.errors)==null?void 0:D[s.id]:void 0,B=u==null&&(((N=l.clientLoader)==null?void 0:N.hydrate)===!0||!s.hasLoader);w.loader=async({request:H,params:oe,context:V,unstable_pattern:ie},K)=>{try{return await b(async()=>(we(l,"No `routeModule` available for critical-route loader"),l.clientLoader?l.clientLoader({request:H,params:oe,context:V,unstable_pattern:ie,async serverLoader(){if(Mt("loader",s),B){if(S)return M;if(A)throw v}return c(K)}}):c(K)))}finally{B=!1}},w.loader.hydrate=Bl(s.id,l.clientLoader,s.hasLoader,a),w.action=({request:H,params:oe,context:V,unstable_pattern:ie},K)=>b(async()=>{if(we(l,"No `routeModule` available for critical-route action"),!l.clientAction){if(a)throw or("clientAction",s.id);return m(K)}return l.clientAction({request:H,params:oe,context:V,unstable_pattern:ie,async serverAction(){return Mt("action",s),m(K)}})})}else{s.hasClientLoader||(w.loader=(A,v)=>b(()=>c(v))),s.hasClientAction||(w.action=(A,v)=>b(()=>{if(a)throw or("clientAction",s.id);return m(v)}));let S;async function M(){return S?await S:(S=(async()=>{(s.clientLoaderModule||s.clientActionModule)&&await new Promise(v=>setTimeout(v,0));let A=zl(s,t);return R(s),await A})(),await S)}w.lazy={loader:s.hasClientLoader?async()=>{let{clientLoader:A}=s.clientLoaderModule?await import(s.clientLoaderModule):await M();return we(A,"No `clientLoader` export found"),(v,B)=>A({...v,async serverLoader(){return Mt("loader",s),c(B)}})}:void 0,action:s.hasClientAction?async()=>{let A=s.clientActionModule?import(s.clientActionModule):M();R(s);let{clientAction:v}=await A;return we(v,"No `clientAction` export found"),(B,H)=>v({...B,async serverAction(){return Mt("action",s),m(H)}})}:void 0,middleware:s.hasClientMiddleware?async()=>{let{clientMiddleware:A}=s.clientMiddlewareModule?await import(s.clientMiddlewareModule):await M();return we(A,"No `clientMiddleware` export found"),A}:void 0,shouldRevalidate:async()=>{let A=await M();return Tn(w.path,A,s,n,u)},handle:async()=>(await M()).handle,Component:async()=>(await M()).Component,ErrorBoundary:s.hasErrorBoundary?async()=>(await M()).ErrorBoundary:void 0}}let P=Tr(e,t,r,n,a,s.id,i,u);return P.length>0&&(w.children=P),w})}function Tn(e,t,r,n,a){if(a)return Hl(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?Fn(e)[1].map(u=>u.paramName):[];const i=u=>o.some(s=>u.currentParams[s]!==u.nextParams[s]);if(t.shouldRevalidate){let u=t.shouldRevalidate;return s=>u({...s,defaultShouldRevalidate:i(s)})}else return u=>i(u)}return t.shouldRevalidate}function Hl(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function zl(e,t){let r=ya(e,t),n=kl(e),a=await r;return await Promise.all([n,ga(e,a)]),{Component:ba(a),ErrorBoundary:a.ErrorBoundary,clientMiddleware:a.clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}function ba(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Bl(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Nt=new Set,Wl=1e3,$t=new Set,Yl=7680;function Mr(e,t){return e.mode==="lazy"&&t===!0}function Vl({sri:e,...t},r){let n=new Set(r.state.matches.map(u=>u.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(u=>{let s=Ne(r.routes,u,r.basename);s&&s.forEach(l=>n.add(l.route.id))});let i=[...n].reduce((u,s)=>Object.assign(u,{[s]:t.routes[s]}),{});return{...t,routes:i,sri:e?!0:void 0}}function _s(e,t,r,n,a,o,i){if(Mr(a,n))return async({path:u,patch:s,signal:l,fetcherKey:d})=>{if($t.has(u))return;let{state:c}=e();await Sa([u],d?window.location.href:Pe(c.navigation.location||c.location),t,r,n,o,i,a.manifestPath,s,l)}}function Ts(e,t,r,n,a,o){h.useEffect(()=>{var d,c;if(!Mr(a,n)||((c=(d=window.navigator)==null?void 0:d.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;$t.has(R)||Nt.add(R)}async function u(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let m=Array.from(Nt.keys()).filter(g=>$t.has(g)?(Nt.delete(g),!1):!0);if(m.length!==0)try{await Sa(m,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let s=Xl(u,100);u();let l=new MutationObserver(()=>s());return l.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>l.disconnect()},[n,o,t,r,e,a])}function Jl(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var ir="react-router-manifest-version";async function Sa(e,t,r,n,a,o,i,u,s,l){const d=new URLSearchParams;d.set("paths",e.sort().join(",")),d.set("version",r.version);let c=new URL(Jl(u,i),window.location.origin);if(c.search=d.toString(),c.toString().length>Yl){Nt.clear();return}let m;try{let w=await fetch(c,{signal:l});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(ir)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(ir,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(ir)}catch{}m=await w.json()}catch(w){if(l!=null&&l.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=>Gl(w,$t));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,Tr(R,n,null,a,o,w)))}function Gl(e,t){if(t.size>=Wl){let r=t.values().next().value;t.delete(r)}t.add(e)}function Xl(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function Dr(){let e=h.useContext(Ge);return we(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Bt(){let e=h.useContext(et);return we(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wt=h.createContext(void 0);Wt.displayName="FrameworkContext";function tt(){let e=h.useContext(Wt);return we(e,"You must render this element inside a <HydratedRouter> element"),e}function Kl(e,t){let r=h.useContext(Wt),[n,a]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:l,onMouseLeave:d,onTouchStart:c}=t,m=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=P=>{P.forEach(_=>{i(_.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return m.current&&w.observe(m.current),()=>{w.disconnect()}}},[e]),h.useEffect(()=>{if(n){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[n]);let g=()=>{a(!0)},R=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:st(u,g),onBlur:st(s,R),onMouseEnter:st(l,g),onMouseLeave:st(d,R),onTouchStart:st(c,g)}]:[!1,m,{}]}function st(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Or(e,t,r){if(r&&!Ft)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}var Mn="data-react-router-critical-css";function Ms({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:o}=tt(),{errors:i,matches:u}=Bt(),s=Or(u,i,r),l=h.useMemo(()=>Ol(s,a,n),[s,a,n]);return h.createElement(h.Fragment,null,typeof o=="string"?h.createElement("style",{[Mn]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?h.createElement("link",{[Mn]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,l.map(({key:d,link:c})=>Pr(c)?h.createElement(La,{key:d,nonce:e,...c,crossOrigin:c.crossOrigin??t}):h.createElement("link",{key:d,nonce:e,...c,crossOrigin:c.crossOrigin??t})))}function La({page:e,...t}){let{router:r}=Dr(),n=h.useMemo(()=>Ne(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?h.createElement(Ql,{page:e,matches:n,...t}):null}function ql(e){let{manifest:t,routeModules:r}=tt(),[n,a]=h.useState([]);return h.useEffect(()=>{let o=!1;return Nl(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function Ql({page:e,matches:t,...r}){let n=xe(),{future:a,manifest:o,routeModules:i}=tt(),{basename:u}=Dr(),{loaderData:s,matches:l}=Bt(),d=h.useMemo(()=>_n(e,t,l,o,n,"data"),[e,t,l,o,n]),c=h.useMemo(()=>_n(e,t,l,o,n,"assets"),[e,t,l,o,n]),m=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let b=new Set,w=!1;if(t.forEach(_=>{var N;let D=o.routes[_.route.id];!D||!D.hasLoader||(!d.some(S=>S.route.id===_.route.id)&&_.route.id in s&&((N=i[_.route.id])!=null&&N.shouldRevalidate)||D.hasClientLoader?w=!0:b.add(_.route.id))}),b.size===0)return[];let P=pa(e,u,a.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&P.searchParams.set("_routes",t.filter(_=>b.has(_.route.id)).map(_=>_.route.id).join(",")),[P.pathname+P.search]},[u,a.unstable_trailingSlashAwareDataRequests,s,n,o,d,t,e,i]),g=h.useMemo(()=>_r(c,o),[c,o]),R=ql(c);return h.createElement(h.Fragment,null,m.map(b=>h.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>h.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),R.map(({key:b,link:w})=>h.createElement("link",{key:b,nonce:r.nonce,...w,crossOrigin:w.crossOrigin??r.crossOrigin})))}function Ds(){let{isSpaMode:e,routeModules:t}=tt(),{errors:r,matches:n,loaderData:a}=Bt(),o=xe(),i=Or(n,r,e),u=null;r&&(u=r[i[i.length-1].route.id]);let s=[],l=null,d=[];for(let c=0;c<i.length;c++){let m=i[c],g=m.route.id,R=a[g],b=m.params,w=t[g],P=[],_={id:g,data:R,loaderData:R,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:u};if(d[c]=_,w!=null&&w.meta?P=typeof w.meta=="function"?w.meta({data:R,loaderData:R,params:b,location:o,matches:d,error:u}):Array.isArray(w.meta)?[...w.meta]:w.meta:l&&(P=[...l]),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.
45
+ `}}))}function La(e){let t={};return Object.values(e).forEach(r=>{if(r){let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}}),t}function Hl(e,t,r){let n=xa(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Ul:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>h.createElement(_a,{error:Pr()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:h.createElement(t.Layout,null,h.createElement(n,null))}:{Component:n},...o?{errorElement:h.createElement(t.Layout,null,h.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:h.createElement(t.Layout,null,h.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function Ts(e,t,r,n,a,o){return Mr(t,r,n,a,o,"",La(t),e)}function Mt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let n=`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(n),new Ue(400,"Bad Request",new Error(n),!0)}}function or(e,t){let r=e==="clientAction"?"a":"an",n=`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(n),new Ue(405,"Method Not Allowed",new Error(n),!0)}function Mr(e,t,r,n,a,o="",i=La(e),u){return(i[o]||[]).map(s=>{var _,D,N;let l=t[s.id];function d(S){return we(typeof S=="function","No single fetch function available for route handler"),S()}function c(S){return s.hasLoader?d(S):Promise.resolve(null)}function m(S){if(!s.hasAction)throw or("action",s.id);return d(S)}function g(S){import(S)}function R(S){S.clientActionModule&&g(S.clientActionModule),S.clientLoaderModule&&g(S.clientLoaderModule)}async function b(S){let M=t[s.id],A=M?Ra(s,M):Promise.resolve();try{return S()}finally{await A}}let w={id:s.id,index:s.index,path:s.path};if(l){Object.assign(w,{...w,...Hl(s,l,a),middleware:l.clientMiddleware,handle:l.handle,shouldRevalidate:Mn(w.path,l,s,n,u)});let S=r&&r.loaderData&&s.id in r.loaderData,M=S?(_=r==null?void 0:r.loaderData)==null?void 0:_[s.id]:void 0,A=r&&r.errors&&s.id in r.errors,v=A?(D=r==null?void 0:r.errors)==null?void 0:D[s.id]:void 0,B=u==null&&(((N=l.clientLoader)==null?void 0:N.hydrate)===!0||!s.hasLoader);w.loader=async({request:H,params:oe,context:V,unstable_pattern:ie},K)=>{try{return await b(async()=>(we(l,"No `routeModule` available for critical-route loader"),l.clientLoader?l.clientLoader({request:H,params:oe,context:V,unstable_pattern:ie,async serverLoader(){if(Mt("loader",s),B){if(S)return M;if(A)throw v}return c(K)}}):c(K)))}finally{B=!1}},w.loader.hydrate=Wl(s.id,l.clientLoader,s.hasLoader,a),w.action=({request:H,params:oe,context:V,unstable_pattern:ie},K)=>b(async()=>{if(we(l,"No `routeModule` available for critical-route action"),!l.clientAction){if(a)throw or("clientAction",s.id);return m(K)}return l.clientAction({request:H,params:oe,context:V,unstable_pattern:ie,async serverAction(){return Mt("action",s),m(K)}})})}else{s.hasClientLoader||(w.loader=(A,v)=>b(()=>c(v))),s.hasClientAction||(w.action=(A,v)=>b(()=>{if(a)throw or("clientAction",s.id);return m(v)}));let S;async function M(){return S?await S:(S=(async()=>{(s.clientLoaderModule||s.clientActionModule)&&await new Promise(v=>setTimeout(v,0));let A=Bl(s,t);return R(s),await A})(),await S)}w.lazy={loader:s.hasClientLoader?async()=>{let{clientLoader:A}=s.clientLoaderModule?await import(s.clientLoaderModule):await M();return we(A,"No `clientLoader` export found"),(v,B)=>A({...v,async serverLoader(){return Mt("loader",s),c(B)}})}:void 0,action:s.hasClientAction?async()=>{let A=s.clientActionModule?import(s.clientActionModule):M();R(s);let{clientAction:v}=await A;return we(v,"No `clientAction` export found"),(B,H)=>v({...B,async serverAction(){return Mt("action",s),m(H)}})}:void 0,middleware:s.hasClientMiddleware?async()=>{let{clientMiddleware:A}=s.clientMiddlewareModule?await import(s.clientMiddlewareModule):await M();return we(A,"No `clientMiddleware` export found"),A}:void 0,shouldRevalidate:async()=>{let A=await M();return Mn(w.path,A,s,n,u)},handle:async()=>(await M()).handle,Component:async()=>(await M()).Component,ErrorBoundary:s.hasErrorBoundary?async()=>(await M()).ErrorBoundary:void 0}}let P=Mr(e,t,r,n,a,s.id,i,u);return P.length>0&&(w.children=P),w})}function Mn(e,t,r,n,a){if(a)return zl(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?jn(e)[1].map(u=>u.paramName):[];const i=u=>o.some(s=>u.currentParams[s]!==u.nextParams[s]);if(t.shouldRevalidate){let u=t.shouldRevalidate;return s=>u({...s,defaultShouldRevalidate:i(s)})}else return u=>i(u)}return t.shouldRevalidate}function zl(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function Bl(e,t){let r=wa(e,t),n=Al(e),a=await r;return await Promise.all([n,Ra(e,a)]),{Component:xa(a),ErrorBoundary:a.ErrorBoundary,clientMiddleware:a.clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}function xa(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Wl(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Nt=new Set,Yl=1e3,$t=new Set,Vl=7680;function Dr(e,t){return e.mode==="lazy"&&t===!0}function Jl({sri:e,...t},r){let n=new Set(r.state.matches.map(u=>u.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(u=>{let s=Ne(r.routes,u,r.basename);s&&s.forEach(l=>n.add(l.route.id))});let i=[...n].reduce((u,s)=>Object.assign(u,{[s]:t.routes[s]}),{});return{...t,routes:i,sri:e?!0:void 0}}function Ms(e,t,r,n,a,o,i){if(Dr(a,n))return async({path:u,patch:s,signal:l,fetcherKey:d})=>{if($t.has(u))return;let{state:c}=e();await Ca([u],d?window.location.href:Pe(c.navigation.location||c.location),t,r,n,o,i,a.manifestPath,s,l)}}function Ds(e,t,r,n,a,o){h.useEffect(()=>{var d,c;if(!Dr(a,n)||((c=(d=window.navigator)==null?void 0:d.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;$t.has(R)||Nt.add(R)}async function u(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let m=Array.from(Nt.keys()).filter(g=>$t.has(g)?(Nt.delete(g),!1):!0);if(m.length!==0)try{await Ca(m,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let s=Kl(u,100);u();let l=new MutationObserver(()=>s());return l.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>l.disconnect()},[n,o,t,r,e,a])}function Gl(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var ir="react-router-manifest-version";async function Ca(e,t,r,n,a,o,i,u,s,l){const d=new URLSearchParams;d.set("paths",e.sort().join(",")),d.set("version",r.version);let c=new URL(Gl(u,i),window.location.origin);if(c.search=d.toString(),c.toString().length>Vl){Nt.clear();return}let m;try{let w=await fetch(c,{signal:l});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(ir)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(ir,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(ir)}catch{}m=await w.json()}catch(w){if(l!=null&&l.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=>Xl(w,$t));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,n,null,a,o,w)))}function Xl(e,t){if(t.size>=Yl){let r=t.values().next().value;t.delete(r)}t.add(e)}function Kl(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function Or(){let e=h.useContext(Ge);return we(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Bt(){let e=h.useContext(et);return we(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wt=h.createContext(void 0);Wt.displayName="FrameworkContext";function tt(){let e=h.useContext(Wt);return we(e,"You must render this element inside a <HydratedRouter> element"),e}function ql(e,t){let r=h.useContext(Wt),[n,a]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:l,onMouseLeave:d,onTouchStart:c}=t,m=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=P=>{P.forEach(_=>{i(_.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return m.current&&w.observe(m.current),()=>{w.disconnect()}}},[e]),h.useEffect(()=>{if(n){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[n]);let g=()=>{a(!0)},R=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:st(u,g),onBlur:st(s,R),onMouseEnter:st(l,g),onMouseLeave:st(d,R),onTouchStart:st(c,g)}]:[!1,m,{}]}function st(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function kr(e,t,r){if(r&&!Ft)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}var Dn="data-react-router-critical-css";function Os({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:o}=tt(),{errors:i,matches:u}=Bt(),s=kr(u,i,r),l=h.useMemo(()=>kl(s,a,n),[s,a,n]);return h.createElement(h.Fragment,null,typeof o=="string"?h.createElement("style",{[Dn]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?h.createElement("link",{[Dn]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,l.map(({key:d,link:c})=>_r(c)?h.createElement(Pa,{key:d,nonce:e,...c,crossOrigin:c.crossOrigin??t}):h.createElement("link",{key:d,nonce:e,...c,crossOrigin:c.crossOrigin??t})))}function Pa({page:e,...t}){let{router:r}=Or(),n=h.useMemo(()=>Ne(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?h.createElement(Zl,{page:e,matches:n,...t}):null}function Ql(e){let{manifest:t,routeModules:r}=tt(),[n,a]=h.useState([]);return h.useEffect(()=>{let o=!1;return Il(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function Zl({page:e,matches:t,...r}){let n=xe(),{future:a,manifest:o,routeModules:i}=tt(),{basename:u}=Or(),{loaderData:s,matches:l}=Bt(),d=h.useMemo(()=>Tn(e,t,l,o,n,"data"),[e,t,l,o,n]),c=h.useMemo(()=>Tn(e,t,l,o,n,"assets"),[e,t,l,o,n]),m=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let b=new Set,w=!1;if(t.forEach(_=>{var N;let D=o.routes[_.route.id];!D||!D.hasLoader||(!d.some(S=>S.route.id===_.route.id)&&_.route.id in s&&((N=i[_.route.id])!=null&&N.shouldRevalidate)||D.hasClientLoader?w=!0:b.add(_.route.id))}),b.size===0)return[];let P=ga(e,u,a.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&P.searchParams.set("_routes",t.filter(_=>b.has(_.route.id)).map(_=>_.route.id).join(",")),[P.pathname+P.search]},[u,a.unstable_trailingSlashAwareDataRequests,s,n,o,d,t,e,i]),g=h.useMemo(()=>Tr(c,o),[c,o]),R=Ql(c);return h.createElement(h.Fragment,null,m.map(b=>h.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>h.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),R.map(({key:b,link:w})=>h.createElement("link",{key:b,nonce:r.nonce,...w,crossOrigin:w.crossOrigin??r.crossOrigin})))}function ks(){let{isSpaMode:e,routeModules:t}=tt(),{errors:r,matches:n,loaderData:a}=Bt(),o=xe(),i=kr(n,r,e),u=null;r&&(u=r[i[i.length-1].route.id]);let s=[],l=null,d=[];for(let c=0;c<i.length;c++){let m=i[c],g=m.route.id,R=a[g],b=m.params,w=t[g],P=[],_={id:g,data:R,loaderData:R,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:u};if(d[c]=_,w!=null&&w.meta?P=typeof w.meta=="function"?w.meta({data:R,loaderData:R,params:b,location:o,matches:d,error:u}):Array.isArray(w.meta)?[...w.meta]:w.meta:l&&(P=[...l]),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.
46
46
 
47
- To reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta`);_.meta=P,d[c]=_,s=[...P],l=s}return h.createElement(h.Fragment,null,s.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:m,...g}=c;if(!Zl(m))return console.warn(`A meta object uses an invalid tagName: ${m}. Expected either 'link' or 'meta'`),null;let R=m;return h.createElement(R,{key:JSON.stringify(g),...g})}if("title"in c)return h.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"?h.createElement("meta",{key:"charSet",charSet:c.charSet}):null;if("script:ld+json"in c)try{let m=JSON.stringify(c["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${m}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:mr(m)}})}catch{return null}return h.createElement("meta",{key:JSON.stringify(c),...c})}))}function Zl(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Ft=!1;function es(){Ft=!0}function ts(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=tt(),{router:u,static:s,staticContext:l}=Dr(),{matches:d}=Bt(),c=ra(),m=Mr(o,i);a&&(a.didRenderScripts=!0);let g=Or(d,null,n);h.useEffect(()=>{es()},[]);let R=h.useMemo(()=>{var N;if(c)return null;let _=l?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",D=s?`${(N=t.hmr)!=null&&N.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
47
+ To reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta`);_.meta=P,d[c]=_,s=[...P],l=s}return h.createElement(h.Fragment,null,s.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:m,...g}=c;if(!es(m))return console.warn(`A meta object uses an invalid tagName: ${m}. Expected either 'link' or 'meta'`),null;let R=m;return h.createElement(R,{key:JSON.stringify(g),...g})}if("title"in c)return h.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"?h.createElement("meta",{key:"charSet",charSet:c.charSet}):null;if("script:ld+json"in c)try{let m=JSON.stringify(c["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${m}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:mr(m)}})}catch{return null}return h.createElement("meta",{key:JSON.stringify(c),...c})}))}function es(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Ft=!1;function ts(){Ft=!0}function rs(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=tt(),{router:u,static:s,staticContext:l}=Or(),{matches:d}=Bt(),c=na(),m=Dr(o,i);a&&(a.didRenderScripts=!0);let g=kr(d,null,n);h.useEffect(()=>{ts()},[]);let R=h.useMemo(()=>{var N;if(c)return null;let _=l?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",D=s?`${(N=t.hmr)!=null&&N.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
48
48
  ${g.map((S,M)=>{let A=`route${M}`,v=t.routes[S.route.id];we(v,`Route ${S.route.id} not found in manifest`);let{clientActionModule:B,clientLoaderModule:H,clientMiddlewareModule:oe,hydrateFallbackModule:V,module:ie}=v,K=[...B?[{module:B,varName:`${A}_clientAction`}]:[],...H?[{module:H,varName:`${A}_clientLoader`}]:[],...oe?[{module:oe,varName:`${A}_clientMiddleware`}]:[],...V?[{module:V,varName:`${A}_HydrateFallback`}]:[],{module:ie,varName:`${A}_main`}];if(K.length===1)return`import * as ${A} from ${JSON.stringify(ie)};`;let re=K.map(ne=>`import * as ${ne.varName} from "${ne.module}";`).join(`
49
49
  `),ee=`const ${A} = {${K.map(ne=>`...${ne.varName}`).join(",")}};`;return[re,ee].join(`
50
50
  `)}).join(`
51
51
  `)}
52
- ${m?`window.__reactRouterManifest = ${JSON.stringify(Vl(t,u),null,2)};`:""}
52
+ ${m?`window.__reactRouterManifest = ${JSON.stringify(Jl(t,u),null,2)};`:""}
53
53
  window.__reactRouterRouteModules = {${g.map((S,M)=>`${JSON.stringify(S.route.id)}:route${M}`).join(",")}};
54
54
 
55
- import(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:_},type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:D},type:"module",async:!0}))},[]),b=Ft||c?[]:rs(t.entry.imports.concat(_r(g,t,{includeHydrateFallback:!0}))),w=typeof t.sri=="object"?t.sri:{};return dr(!c,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Ft||c?null:h.createElement(h.Fragment,null,typeof t.sri=="object"?h.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:w})}}):null,m?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:w[t.url],suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:w[t.entry.module],suppressHydrationWarning:!0}),b.map(P=>h.createElement("link",{key:P,rel:"modulepreload",href:P,crossOrigin:e.crossOrigin,integrity:w[P],suppressHydrationWarning:!0})),R)}function rs(e){return[...new Set(e)]}function ns(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Os=class extends h.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?h.createElement(xa,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function xa({error:e,isOutsideRemixApp:t}){console.error(e);let r=h.createElement("script",{dangerouslySetInnerHTML:{__html:`
55
+ import(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:_},type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:D},type:"module",async:!0}))},[]),b=Ft||c?[]:ns(t.entry.imports.concat(Tr(g,t,{includeHydrateFallback:!0}))),w=typeof t.sri=="object"?t.sri:{};return dr(!c,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Ft||c?null:h.createElement(h.Fragment,null,typeof t.sri=="object"?h.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:w})}}):null,m?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:w[t.url],suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:w[t.entry.module],suppressHydrationWarning:!0}),b.map(P=>h.createElement("link",{key:P,rel:"modulepreload",href:P,crossOrigin:e.crossOrigin,integrity:w[P],suppressHydrationWarning:!0})),R)}function ns(e){return[...new Set(e)]}function as(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var As=class extends h.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?h.createElement(_a,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function _a({error:e,isOutsideRemixApp:t}){console.error(e);let r=h.createElement("script",{dangerouslySetInnerHTML:{__html:`
56
56
  console.log(
57
57
  "💿 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."
58
58
  );
59
- `}});if(Je(e))return h.createElement(yr,{title:"Unhandled Thrown Response!"},h.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return h.createElement(yr,{title:"Application Error!",isOutsideRemixApp:t},h.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),h.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function yr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=tt();return(o=a.root)!=null&&o.Layout&&!r?n:h.createElement("html",{lang:"en"},h.createElement("head",null,h.createElement("meta",{charSet:"utf-8"}),h.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),h.createElement("title",null,e)),h.createElement("body",null,h.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?h.createElement(ts,null):null)))}var as=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{as&&(window.__reactRouterVersion="7.13.1")}catch{}var Ca=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pa=h.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,unstable_mask:u,state:s,target:l,to:d,preventScrollReset:c,viewTransition:m,unstable_defaultShouldRevalidate:g,...R},b){let{basename:w,navigator:P,unstable_useTransitions:_}=h.useContext(Ee),D=typeof d=="string"&&Ca.test(d),N=zn(d,w);d=N.to;let S=vi(d,{relative:a}),M=xe(),A=null;if(u){let re=jt(u,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);w!=="/"&&(re.pathname=re.pathname==="/"?w:Ce([w,re.pathname])),A=P.createHref(re)}let[v,B,H]=Kl(n,R),oe=us(d,{replace:i,unstable_mask:u,state:s,target:l,preventScrollReset:c,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:_});function V(re){t&&t(re),re.defaultPrevented||oe(re)}let ie=!(N.isExternal||o),K=h.createElement("a",{...R,...H,href:(ie?A:void 0)||N.absoluteURL||S,onClick:ie?V:t,ref:ns(b,B),target:l,"data-discover":!D&&r==="render"?"true":void 0});return v&&!D?h.createElement(h.Fragment,null,K,h.createElement(La,{page:S})):K});Pa.displayName="Link";var os=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:u,children:s,...l},d){let c=vt(i,{relative:l.relative}),m=xe(),g=h.useContext(et),{navigator:R,basename:b}=h.useContext(Ee),w=g!=null&&ys(c)&&u===!0,P=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,_=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(_=_.toLowerCase(),D=D?D.toLowerCase():null,P=P.toLowerCase()),D&&b&&(D=be(D,b)||D);const N=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let S=_===P||!a&&_.startsWith(P)&&_.charAt(N)==="/",M=D!=null&&(D===P||!a&&D.startsWith(P)&&D.charAt(P.length)==="/"),A={isActive:S,isPending:M,isTransitioning:w},v=S?t:void 0,B;typeof n=="function"?B=n(A):B=[n,S?"active":null,M?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(A):o;return h.createElement(Pa,{...l,"aria-current":v,className:B,ref:d,style:H,to:i,viewTransition:u},typeof s=="function"?s(A):s)});os.displayName="NavLink";var is=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=kt,action:u,onSubmit:s,relative:l,preventScrollReset:d,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=h.useContext(Ee),w=fs(),P=hs(u,{relative:l}),_=i.toLowerCase()==="get"?"get":"post",D=typeof u=="string"&&Ca.test(u),N=S=>{if(s&&s(S),S.defaultPrevented)return;S.preventDefault();let M=S.nativeEvent.submitter,A=(M==null?void 0:M.getAttribute("formmethod"))||i,v=()=>w(M||S.currentTarget,{fetcherKey:t,method:A,navigate:r,replace:a,state:o,relative:l,preventScrollReset:d,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?h.startTransition(()=>v()):v()};return h.createElement("form",{ref:R,method:_,action:P,onSubmit:n?s:N,...g,"data-discover":!D&&e==="render"?"true":void 0})});is.displayName="Form";function ls({getKey:e,storageKey:t,...r}){let n=h.useContext(Wt),{basename:a}=h.useContext(Ee),o=xe(),i=Cr();ms({getKey:e,storageKey:t});let u=h.useMemo(()=>{if(!n||!e)return null;let l=gr(o,i,a,e);return l!==o.key?l:null},[]);if(!n||n.isSpaMode)return null;let s=((l,d)=>{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(l)||"{}")[d||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(l)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${mr(JSON.stringify(t||vr))}, ${mr(JSON.stringify(u))})`}})}ls.displayName="ScrollRestoration";function _a(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kr(e){let t=h.useContext(Ge);return G(t,_a(e)),t}function ss(e){let t=h.useContext(et);return G(t,_a(e)),t}function us(e,{target:t,replace:r,unstable_mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:s,unstable_useTransitions:l}={}){let d=la(),c=xe(),m=vt(e,{relative:i});return h.useCallback(g=>{if(Ji(g,t)){g.preventDefault();let R=r!==void 0?r:Pe(c)===Pe(m),b=()=>d(e,{replace:R,unstable_mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:s});l?h.startTransition(()=>b()):b()}},[c,d,m,r,n,a,t,e,o,i,u,s,l])}function ks(e){ue(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=h.useRef(fr(e)),r=h.useRef(!1),n=xe(),a=h.useMemo(()=>Gi(n.search,r.current?null:t.current),[n.search]),o=la(),i=h.useCallback((u,s)=>{const l=fr(typeof u=="function"?u(new URLSearchParams(a)):u);r.current=!0,o("?"+l,s)},[o,a]);return[a,i]}var cs=0,ds=()=>`__${String(++cs)}__`;function fs(){let{router:e}=kr("useSubmit"),{basename:t}=h.useContext(Ee),r=Mi(),n=e.fetch,a=e.navigate;return h.useCallback(async(o,i={})=>{let{action:u,method:s,encType:l,formData:d,body:c}=qi(o,t);if(i.navigate===!1){let m=i.fetcherKey||ds();await n(m,r,i.action||u,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:d,body:c,formMethod:i.method||s,formEncType:i.encType||l,flushSync:i.flushSync})}else await a(i.action||u,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:d,body:c,formMethod:i.method||s,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function hs(e,{relative:t}={}){let{basename:r}=h.useContext(Ee),n=h.useContext(_e);G(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...vt(e||".",{relative:t})},i=xe();if(e==null){o.search=i.search;let u=new URLSearchParams(o.search),s=u.getAll("index");if(s.some(d=>d==="")){u.delete("index"),s.filter(c=>c).forEach(c=>u.append("index",c));let d=u.toString();o.search=d?`?${d}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ce([r,o.pathname])),Pe(o)}var vr="react-router-scroll-positions",Dt={};function gr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:be(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function ms({getKey:e,storageKey:t}={}){let{router:r}=kr("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=ss("useScrollRestoration"),{basename:o}=h.useContext(Ee),i=xe(),u=Cr(),s=Di();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),ps(h.useCallback(()=>{if(s.state==="idle"){let l=gr(i,u,o,e);Dt[l]=window.scrollY}try{sessionStorage.setItem(t||vr,JSON.stringify(Dt))}catch(l){ue(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${l}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,u,t])),typeof document<"u"&&(h.useLayoutEffect(()=>{try{let l=sessionStorage.getItem(t||vr);l&&(Dt=JSON.parse(l))}catch{}},[t]),h.useLayoutEffect(()=>{let l=r==null?void 0:r.enableScrollRestoration(Dt,()=>window.scrollY,e?(d,c)=>gr(d,c,o,e):void 0);return()=>l&&l()},[r,o,e]),h.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let l=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(l){l.scrollIntoView();return}}}catch{ue(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function ps(e,t){let{capture:r}={};h.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function ys(e,{relative:t}={}){let r=h.useContext(Sr);G(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=kr("useViewTransitionState"),a=vt(e,{relative:t});if(!r.isTransitioning)return!1;let o=be(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=be(r.nextLocation.pathname,n)||r.nextLocation.pathname;return It(a.pathname,i)!=null||It(a.pathname,o)!=null}var vs=eo();const As=Dn(vs);export{As as A,xe as B,Ri as C,Qa as D,Ue as E,Wt as F,Dn as G,Ms as L,Ds as M,bl as N,Ls as O,qa as R,ls as S,On as a,eo as b,G as c,Os as d,Ss as e,vs as f,Dl as g,Tr as h,Je as i,gs as j,Es as k,_s as l,Ne as m,Cs as n,ws as o,Ps as p,Rs as q,h as r,Bl as s,bs as t,Ts as u,ts as v,xs as w,la as x,ks as y,Pa as z};
59
+ `}});if(Je(e))return h.createElement(yr,{title:"Unhandled Thrown Response!"},h.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return h.createElement(yr,{title:"Application Error!",isOutsideRemixApp:t},h.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),h.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function yr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=tt();return(o=a.root)!=null&&o.Layout&&!r?n:h.createElement("html",{lang:"en"},h.createElement("head",null,h.createElement("meta",{charSet:"utf-8"}),h.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),h.createElement("title",null,e)),h.createElement("body",null,h.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?h.createElement(rs,null):null)))}var os=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{os&&(window.__reactRouterVersion="7.13.1")}catch{}var Ta=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ma=h.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,unstable_mask:u,state:s,target:l,to:d,preventScrollReset:c,viewTransition:m,unstable_defaultShouldRevalidate:g,...R},b){let{basename:w,navigator:P,unstable_useTransitions:_}=h.useContext(Ee),D=typeof d=="string"&&Ta.test(d),N=Bn(d,w);d=N.to;let S=Ei(d,{relative:a}),M=xe(),A=null;if(u){let re=jt(u,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);w!=="/"&&(re.pathname=re.pathname==="/"?w:Ce([w,re.pathname])),A=P.createHref(re)}let[v,B,H]=ql(n,R),oe=cs(d,{replace:i,unstable_mask:u,state:s,target:l,preventScrollReset:c,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:_});function V(re){t&&t(re),re.defaultPrevented||oe(re)}let ie=!(N.isExternal||o),K=h.createElement("a",{...R,...H,href:(ie?A:void 0)||N.absoluteURL||S,onClick:ie?V:t,ref:as(b,B),target:l,"data-discover":!D&&r==="render"?"true":void 0});return v&&!D?h.createElement(h.Fragment,null,K,h.createElement(Pa,{page:S})):K});Ma.displayName="Link";var is=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:u,children:s,...l},d){let c=vt(i,{relative:l.relative}),m=xe(),g=h.useContext(et),{navigator:R,basename:b}=h.useContext(Ee),w=g!=null&&vs(c)&&u===!0,P=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,_=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(_=_.toLowerCase(),D=D?D.toLowerCase():null,P=P.toLowerCase()),D&&b&&(D=be(D,b)||D);const N=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let S=_===P||!a&&_.startsWith(P)&&_.charAt(N)==="/",M=D!=null&&(D===P||!a&&D.startsWith(P)&&D.charAt(P.length)==="/"),A={isActive:S,isPending:M,isTransitioning:w},v=S?t:void 0,B;typeof n=="function"?B=n(A):B=[n,S?"active":null,M?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(A):o;return h.createElement(Ma,{...l,"aria-current":v,className:B,ref:d,style:H,to:i,viewTransition:u},typeof s=="function"?s(A):s)});is.displayName="NavLink";var ls=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=kt,action:u,onSubmit:s,relative:l,preventScrollReset:d,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=h.useContext(Ee),w=hs(),P=ms(u,{relative:l}),_=i.toLowerCase()==="get"?"get":"post",D=typeof u=="string"&&Ta.test(u),N=S=>{if(s&&s(S),S.defaultPrevented)return;S.preventDefault();let M=S.nativeEvent.submitter,A=(M==null?void 0:M.getAttribute("formmethod"))||i,v=()=>w(M||S.currentTarget,{fetcherKey:t,method:A,navigate:r,replace:a,state:o,relative:l,preventScrollReset:d,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?h.startTransition(()=>v()):v()};return h.createElement("form",{ref:R,method:_,action:P,onSubmit:n?s:N,...g,"data-discover":!D&&e==="render"?"true":void 0})});ls.displayName="Form";function ss({getKey:e,storageKey:t,...r}){let n=h.useContext(Wt),{basename:a}=h.useContext(Ee),o=xe(),i=Cr();ps({getKey:e,storageKey:t});let u=h.useMemo(()=>{if(!n||!e)return null;let l=gr(o,i,a,e);return l!==o.key?l:null},[]);if(!n||n.isSpaMode)return null;let s=((l,d)=>{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(l)||"{}")[d||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(l)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${mr(JSON.stringify(t||vr))}, ${mr(JSON.stringify(u))})`}})}ss.displayName="ScrollRestoration";function Da(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ar(e){let t=h.useContext(Ge);return G(t,Da(e)),t}function us(e){let t=h.useContext(et);return G(t,Da(e)),t}function cs(e,{target:t,replace:r,unstable_mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:s,unstable_useTransitions:l}={}){let d=sa(),c=xe(),m=vt(e,{relative:i});return h.useCallback(g=>{if(Gi(g,t)){g.preventDefault();let R=r!==void 0?r:Pe(c)===Pe(m),b=()=>d(e,{replace:R,unstable_mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:s});l?h.startTransition(()=>b()):b()}},[c,d,m,r,n,a,t,e,o,i,u,s,l])}function Ns(e){ue(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=h.useRef(fr(e)),r=h.useRef(!1),n=xe(),a=h.useMemo(()=>Xi(n.search,r.current?null:t.current),[n.search]),o=sa(),i=h.useCallback((u,s)=>{const l=fr(typeof u=="function"?u(new URLSearchParams(a)):u);r.current=!0,o("?"+l,s)},[o,a]);return[a,i]}var ds=0,fs=()=>`__${String(++ds)}__`;function hs(){let{router:e}=Ar("useSubmit"),{basename:t}=h.useContext(Ee),r=Oi(),n=e.fetch,a=e.navigate;return h.useCallback(async(o,i={})=>{let{action:u,method:s,encType:l,formData:d,body:c}=Qi(o,t);if(i.navigate===!1){let m=i.fetcherKey||fs();await n(m,r,i.action||u,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:d,body:c,formMethod:i.method||s,formEncType:i.encType||l,flushSync:i.flushSync})}else await a(i.action||u,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:d,body:c,formMethod:i.method||s,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function ms(e,{relative:t}={}){let{basename:r}=h.useContext(Ee),n=h.useContext(_e);G(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...vt(e||".",{relative:t})},i=xe();if(e==null){o.search=i.search;let u=new URLSearchParams(o.search),s=u.getAll("index");if(s.some(d=>d==="")){u.delete("index"),s.filter(c=>c).forEach(c=>u.append("index",c));let d=u.toString();o.search=d?`?${d}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ce([r,o.pathname])),Pe(o)}var vr="react-router-scroll-positions",Dt={};function gr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:be(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function ps({getKey:e,storageKey:t}={}){let{router:r}=Ar("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=us("useScrollRestoration"),{basename:o}=h.useContext(Ee),i=xe(),u=Cr(),s=ki();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),ys(h.useCallback(()=>{if(s.state==="idle"){let l=gr(i,u,o,e);Dt[l]=window.scrollY}try{sessionStorage.setItem(t||vr,JSON.stringify(Dt))}catch(l){ue(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${l}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,u,t])),typeof document<"u"&&(h.useLayoutEffect(()=>{try{let l=sessionStorage.getItem(t||vr);l&&(Dt=JSON.parse(l))}catch{}},[t]),h.useLayoutEffect(()=>{let l=r==null?void 0:r.enableScrollRestoration(Dt,()=>window.scrollY,e?(d,c)=>gr(d,c,o,e):void 0);return()=>l&&l()},[r,o,e]),h.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let l=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(l){l.scrollIntoView();return}}}catch{ue(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function ys(e,t){let{capture:r}={};h.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function vs(e,{relative:t}={}){let r=h.useContext(Sr);G(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ar("useViewTransitionState"),a=vt(e,{relative:t});if(!r.isTransitioning)return!1;let o=be(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=be(r.nextLocation.pathname,n)||r.nextLocation.pathname;return It(a.pathname,i)!=null||It(a.pathname,o)!=null}var gs=no();const Is=On(gs);export{sa as A,Ns as B,Is as C,xe as D,Ue as E,Wt as F,ua as G,to as H,On as I,Os as L,ks as M,Sl as N,xs as O,eo as R,ss as S,kn as a,no as b,G as c,As as d,Ls as e,gs as f,Ol as g,Mr as h,Je as i,ws as j,Rs as k,Ms as l,Ne as m,_s as n,Es as o,Ts as p,bs as q,h as r,Wl as s,Ss as t,Ds as u,Ps as v,Cs as w,rs as x,Pr as y,Ma as z};