libre-webui 0.45.1 → 0.46.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.
- package/backend/dist/routes/work.js +1 -1
- package/backend/dist/routes/work.js.map +1 -1
- package/backend/dist/services/agentCliService.d.ts.map +1 -1
- package/backend/dist/services/agentCliService.js +2 -0
- package/backend/dist/services/agentCliService.js.map +1 -1
- package/backend/dist/services/dataArchiveService.d.ts.map +1 -1
- package/backend/dist/services/dataArchiveService.js +2 -0
- package/backend/dist/services/dataArchiveService.js.map +1 -1
- package/backend/dist/services/followUpService.d.ts.map +1 -1
- package/backend/dist/services/followUpService.js +11 -1
- package/backend/dist/services/followUpService.js.map +1 -1
- package/backend/dist/services/ollamaService.d.ts.map +1 -1
- package/backend/dist/services/ollamaService.js +2 -1
- package/backend/dist/services/ollamaService.js.map +1 -1
- package/backend/dist/services/pluginService.d.ts.map +1 -1
- package/backend/dist/services/pluginService.js +24 -10
- package/backend/dist/services/pluginService.js.map +1 -1
- package/backend/dist/services/preferencesService.d.ts.map +1 -1
- package/backend/dist/services/preferencesService.js +1 -0
- package/backend/dist/services/preferencesService.js.map +1 -1
- package/backend/dist/services/workModelProviderService.d.ts.map +1 -1
- package/backend/dist/services/workModelProviderService.js +16 -134
- package/backend/dist/services/workModelProviderService.js.map +1 -1
- package/backend/dist/types/index.d.ts +4 -3
- package/backend/dist/types/index.d.ts.map +1 -1
- package/backend/dist/types/index.js.map +1 -1
- package/backend/dist/utils/geminiProtocol.d.ts +103 -0
- package/backend/dist/utils/geminiProtocol.d.ts.map +1 -0
- package/backend/dist/utils/geminiProtocol.js +586 -0
- package/backend/dist/utils/geminiProtocol.js.map +1 -0
- package/backend/dist/utils/openAIResponsesAdapter.d.ts +1 -1
- package/backend/dist/utils/openAIResponsesAdapter.d.ts.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.d.ts +36 -12
- package/backend/dist/utils/pluginChatAdapter.d.ts.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.js +121 -134
- package/backend/dist/utils/pluginChatAdapter.js.map +1 -1
- package/backend/dist/utils/pluginDefinitionTrust.js +5 -5
- package/backend/dist/utils/pluginValidation.d.ts.map +1 -1
- package/backend/dist/utils/pluginValidation.js +7 -0
- package/backend/dist/utils/pluginValidation.js.map +1 -1
- package/backend/dist/utils/thinkingOptions.d.ts +12 -1
- package/backend/dist/utils/thinkingOptions.d.ts.map +1 -1
- package/backend/dist/utils/thinkingOptions.js +10 -1
- package/backend/dist/utils/thinkingOptions.js.map +1 -1
- package/backend/package.json +2 -4
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
- package/frontend/dist/artifact-runtime/framer-motion.js +1 -1
- package/frontend/dist/artifact-runtime/lucide-react.js +1 -1
- package/frontend/dist/artifact-runtime/recharts.js +54 -50
- package/frontend/dist/assets/index-CjeHi5JU.js +76 -0
- package/frontend/dist/assets/index-DyhvMw2T.css +2 -0
- package/frontend/dist/index.html +29 -29
- package/frontend/dist/js/{ArtifactContainer-BiGwAZkv.js → ArtifactContainer-BaacvZ8q.js} +1 -1
- package/frontend/dist/js/{ArtifactDemoPage-Dk6bf2fr.js → ArtifactDemoPage-D6pgt8_p.js} +1 -1
- package/frontend/dist/js/{ArtifactSandboxFrame-BMQXP8E8.js → ArtifactSandboxFrame-BqfRwsQa.js} +1 -1
- package/frontend/dist/js/{ArtifactSlideOutPanel-CNLSDJAJ.js → ArtifactSlideOutPanel-BUFb1QaC.js} +1 -1
- package/frontend/dist/js/{AutomationModal-VMrwN5y4.js → AutomationModal-a9rx93qd.js} +1 -1
- package/frontend/dist/js/AutomationsPage-Bhzy71Cq.js +1 -0
- package/frontend/dist/js/{AvatarUpload-DpeJzlyv.js → AvatarUpload-BHHUA-GH.js} +1 -1
- package/frontend/dist/js/{Button-D6d7HYoa.js → Button-DeV-GhQr.js} +1 -1
- package/frontend/dist/js/CalendarPage-DIlOEXA9.js +1 -0
- package/frontend/dist/js/ChannelsPage-BRVs-Kp-.js +1 -0
- package/frontend/dist/js/ChatPage-DqEa_l2u.js +14 -0
- package/frontend/dist/js/{ConnectModels-7E_zzkFc.js → ConnectModels-dimFaMkn.js} +1 -1
- package/frontend/dist/js/{EvaluationsPage-_jLiPYYc.js → EvaluationsPage-BKVxoUaS.js} +1 -1
- package/frontend/dist/js/{FirstTimeSetup-BzSil7F7.js → FirstTimeSetup-MLU3EUOv.js} +1 -1
- package/frontend/dist/js/{GalleryPage-CKpQMmd7.js → GalleryPage-BqhTNi2p.js} +1 -1
- package/frontend/dist/js/HomePage-B_HbAwgO.js +1 -0
- package/frontend/dist/js/LanguageSwitcher-gij6QsCJ.js +1 -0
- package/frontend/dist/js/{Logo-DhV6D_3q.js → Logo-BBRSG7mh.js} +1 -1
- package/frontend/dist/js/{LogoMark-CmF1lHXT.js → LogoMark-CiSslCTm.js} +1 -1
- package/frontend/dist/js/{ModelManagerModals-eAwih0CC.js → ModelManagerModals-CfcrXIm5.js} +1 -1
- package/frontend/dist/js/NotesPage-6qb7awMu.js +3 -0
- package/frontend/dist/js/{PasswordStrengthMeter-BwgYbk3r.js → PasswordStrengthMeter-MkydwQ8j.js} +1 -1
- package/frontend/dist/js/PersonasPage-KRnYk61s.js +13 -0
- package/frontend/dist/js/PluginUsagePage-Bm2WXYM5.js +1 -0
- package/frontend/dist/js/RichMessageContent-C5hmCcK6.js +3 -0
- package/frontend/dist/js/{RichMessageContent-BY1I7d9d.js → RichMessageContent-fyjhRYjT.js} +1 -1
- package/frontend/dist/js/SettingsModal-CgtaiEwd.js +19 -0
- package/frontend/dist/js/{SettingsToggle-CNUeo6DO.js → SettingsToggle-XpuugbHi.js} +1 -1
- package/frontend/dist/js/{ShareDialog-DgVAGGOp.js → ShareDialog-lkQnQmeI.js} +1 -1
- package/frontend/dist/js/{StrandsPage-9UVviZ58.js → StrandsPage-sPvcnqzA.js} +1 -1
- package/frontend/dist/js/{SystemPage-ChJ8O0MR.js → SystemPage-DwL4p4Rm.js} +1 -1
- package/frontend/dist/js/{UserManagementPage-BrogyZDQ.js → UserManagementPage-CzFDrqMr.js} +1 -1
- package/frontend/dist/js/{UserManagementPanel-CYuTltw4.js → UserManagementPanel-Dz8Q_Nv7.js} +1 -1
- package/frontend/dist/js/{WhatsNewModal-DyK_LXtM.js → WhatsNewModal-CSYCRxyb.js} +1 -1
- package/frontend/dist/js/WorkPage-zNqtL6D7.js +7 -0
- package/frontend/dist/js/{api-BPTwf2O4.js → api-B8EjExUU.js} +1 -1
- package/frontend/dist/js/api-CCDH67RO.js +1 -0
- package/frontend/dist/js/{appNavigation-DYXehtYu.js → appNavigation-C0lNX2LE.js} +1 -1
- package/frontend/dist/js/{appStore-C_SBNGJT.js → appStore-BEjqPvpR.js} +2 -2
- package/frontend/dist/js/appVersion-Dv97-qD1.js +1 -0
- package/frontend/dist/js/ar-BM7CvBiJ.js +2 -0
- package/frontend/dist/js/authStore-BNu5iRKd.js +1 -0
- package/frontend/dist/js/{authStore-Tu09JYbR.js → authStore-BOFcWqii.js} +3 -3
- package/frontend/dist/js/bn-DZgfamCo.js +2 -0
- package/frontend/dist/js/chatStore-C3c3r8iB.js +3 -0
- package/frontend/dist/js/{client-Czyqg89i.js → client-CQZUgw7R.js} +2 -2
- package/frontend/dist/js/{config-DWmMmE_t.js → config-Dz__g4tp.js} +1 -1
- package/frontend/dist/js/cs-Cx7EJqsO.js +2 -0
- package/frontend/dist/js/da-o3xyldjl.js +2 -0
- package/frontend/dist/js/de-DtSkfuOa.js +2 -0
- package/frontend/dist/js/decisionsApi-DJWWXd5m.js +1 -0
- package/frontend/dist/js/{decisionsApi-CftWDIPz.js → decisionsApi-DWyjcL8B.js} +1 -1
- package/frontend/dist/js/es-CNJDAw3s.js +2 -0
- package/frontend/dist/js/{evaluationsApi-C5DC-61t.js → evaluationsApi-BE2P4V0I.js} +1 -1
- package/frontend/dist/js/fr-BfkRYgQd.js +2 -0
- package/frontend/dist/js/hi-BKmbYlM1.js +2 -0
- package/frontend/dist/js/id-BeP0q360.js +2 -0
- package/frontend/dist/js/is-FNrpAg1Q.js +2 -0
- package/frontend/dist/js/it-C6LfJuro.js +2 -0
- package/frontend/dist/js/ja-VGke24PN.js +2 -0
- package/frontend/dist/js/ko-JnCzlETi.js +2 -0
- package/frontend/dist/js/{messageCodeStyles-DbG-nHEj.js → messageCodeStyles-QRyNUcEv.js} +2 -2
- package/frontend/dist/js/modelPresentation-BqdYlMRq.js +1 -0
- package/frontend/dist/js/ms-JF56ktSS.js +2 -0
- package/frontend/dist/js/nl-FzrGEt7O.js +2 -0
- package/frontend/dist/js/pl-C6EtLPmh.js +2 -0
- package/frontend/dist/js/pt-Clyy_Jz3.js +2 -0
- package/frontend/dist/js/router-vendor-ihzG-2y7.js +1 -0
- package/frontend/dist/js/ru-yG8TnHJE.js +2 -0
- package/frontend/dist/js/{strandsApi-c_sLVTzl.js → strandsApi-EFMF0J0x.js} +1 -1
- package/frontend/dist/js/sv-DSCl8r0m.js +2 -0
- package/frontend/dist/js/{teamEventStream-Bnna_p2v.js → teamEventStream-aQGd68I4.js} +1 -1
- package/frontend/dist/js/th-DiITM0tM.js +2 -0
- package/frontend/dist/js/tr-jQmrBMGA.js +2 -0
- package/frontend/dist/js/ui-CKcr9ReZ.js +2 -0
- package/frontend/dist/js/{ui-vendor-C7v9zeJX.js → ui-vendor-BanHlKMb.js} +1 -1
- package/frontend/dist/js/uk-rPc3yzsm.js +2 -0
- package/frontend/dist/js/{useChat-DGCDsOOs.js → useChat-DFozXoci.js} +1 -1
- package/frontend/dist/js/useDictation-D9lyoqUR.js +1 -0
- package/frontend/dist/js/useQuery-B-RslgPA.js +1 -0
- package/frontend/dist/js/useTranslation-Bu0AxynE.js +1 -0
- package/frontend/dist/js/utils-DhBboyBg.js +1 -0
- package/frontend/dist/js/utils-vendor-DpFrFwUi.js +1 -0
- package/frontend/dist/js/vi-wT4LDUXd.js +2 -0
- package/frontend/dist/js/{workApi-BTdJF6o5.js → workApi-C2R6IiSd.js} +1 -1
- package/frontend/dist/js/workApi-CNDPo0bG.js +1 -0
- package/frontend/dist/js/zh-CIASsxyC.js +2 -0
- package/package.json +5 -6
- package/plugins/codex-oauth.json +2 -0
- package/plugins/gemini.json +7 -1
- package/plugins/mlx-lm.json +5 -5
- package/plugins/openai.json +3 -1
- package/plugins/openrouter.json +2 -0
- package/frontend/dist/assets/index-FrFgrp5E.css +0 -2
- package/frontend/dist/assets/index-MveXWX7i.js +0 -15
- package/frontend/dist/js/AutomationsPage-wb5royf_.js +0 -1
- package/frontend/dist/js/CalendarPage-DeMdx8BD.js +0 -1
- package/frontend/dist/js/ChannelsPage-DJj_kG1m.js +0 -1
- package/frontend/dist/js/ChatPage-tJ5_eAbV.js +0 -14
- package/frontend/dist/js/HomePage-Dr8mrmo7.js +0 -1
- package/frontend/dist/js/LanguageSwitcher-BPwDwNez.js +0 -1
- package/frontend/dist/js/NotesPage-DDagHzg0.js +0 -3
- package/frontend/dist/js/PersonasPage-uFr0Yzes.js +0 -13
- package/frontend/dist/js/PluginUsagePage-BfIQuqIV.js +0 -1
- package/frontend/dist/js/RichMessageContent-otmciPPz.js +0 -3
- package/frontend/dist/js/SettingsModal-D2x0muLa.js +0 -19
- package/frontend/dist/js/WorkPage-CdfTyNv_.js +0 -7
- package/frontend/dist/js/api-Lutao9vm.js +0 -1
- package/frontend/dist/js/appVersion-C5-Afzj1.js +0 -1
- package/frontend/dist/js/ar-CMnK2iUi.js +0 -2
- package/frontend/dist/js/authStore-6cAmoXEk.js +0 -1
- package/frontend/dist/js/bn-B_6kDlG3.js +0 -2
- package/frontend/dist/js/chatStore-wi8VDo6B.js +0 -3
- package/frontend/dist/js/cs-DN4IeMBM.js +0 -2
- package/frontend/dist/js/da-Cx-BiRSz.js +0 -2
- package/frontend/dist/js/de-Cwlx8oC5.js +0 -2
- package/frontend/dist/js/decisionsApi-Dneh1e4n.js +0 -1
- package/frontend/dist/js/es-DGOk1LTg.js +0 -2
- package/frontend/dist/js/fr-DsjFEubC.js +0 -2
- package/frontend/dist/js/hi-YoyZTSWi.js +0 -2
- package/frontend/dist/js/id-D7ObCsR9.js +0 -2
- package/frontend/dist/js/is-DRfnKDHX.js +0 -2
- package/frontend/dist/js/it-Cb4C73dp.js +0 -2
- package/frontend/dist/js/ja-DsDfWEWn.js +0 -2
- package/frontend/dist/js/ko-J9IK9O8f.js +0 -2
- package/frontend/dist/js/modelPresentation-4QU9r-Pl.js +0 -1
- package/frontend/dist/js/ms-DVZBQWu-.js +0 -2
- package/frontend/dist/js/nl-CotrV0Lb.js +0 -2
- package/frontend/dist/js/pl-DlsgTT5q.js +0 -2
- package/frontend/dist/js/pt-B8F-CAdb.js +0 -2
- package/frontend/dist/js/router-vendor-DLHZHk4K.js +0 -1
- package/frontend/dist/js/ru-B7H_WJLM.js +0 -2
- package/frontend/dist/js/sv-iYQWY_4T.js +0 -2
- package/frontend/dist/js/th-BIlkYCg9.js +0 -2
- package/frontend/dist/js/tr-Cb0GxFvG.js +0 -2
- package/frontend/dist/js/ui-Byzdw4-Y.js +0 -2
- package/frontend/dist/js/uk-BH7Ojiob.js +0 -2
- package/frontend/dist/js/useDictation-BGys860H.js +0 -1
- package/frontend/dist/js/useQuery-Cs76KYuP.js +0 -1
- package/frontend/dist/js/useTranslation-CKqEdZ8j.js +0 -1
- package/frontend/dist/js/utils-BXRzbHJC.js +0 -1
- package/frontend/dist/js/utils-vendor-B4bGLP5p.js +0 -1
- package/frontend/dist/js/vi-BKN3n9CC.js +0 -2
- package/frontend/dist/js/workApi-DvXvzA8C.js +0 -1
- package/frontend/dist/js/zh-CbiVZpr_.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./react-vendor-C1iE8mnY.js";var n=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,r=/^[\\/]{2}/;function i(e,t){return t+e.replace(/\\/g,`/`)}var a=`popstate`;function o(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function s(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return p(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:m(t)}return g(t,n,null,e)}function c(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=h(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),p(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:m(t))}function r(e,t){u(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return g(t,n,r,e)}function l(e,t){if(e===!1||e==null)throw Error(t)}function u(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function d(){return Math.random().toString(36).substring(2,10)}function f(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function p(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?h(t):t,state:n,key:t&&t.key||r||d(),mask:i}}function m({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function h(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function g(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,l=`POP`,u=null,d=m();d??(d=0,c.replaceState({...c.state,idx:d},``));function m(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=m(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=o(e)?e:p(b.location,e,t);n&&n(r,e),d=m()+1;let a=f(r,d),h=b.createHref(r.mask||r);try{c.pushState(a,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}s&&u&&u({action:l,location:b.location,delta:1})}function v(e,t){l=`REPLACE`;let r=o(e)?e:p(b.location,e,t);n&&n(r,e),d=m();let i=f(r,d),a=b.createHref(r.mask||r);c.replaceState(i,``,a),s&&u&&u({action:l,location:b.location,delta:0})}function y(e){return _(i,e)}let b={get action(){return l},get location(){return e(i,c)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(a,h),u=e,()=>{i.removeEventListener(a,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:v,go(e){return c.go(e)}};return b}function _(e,t,n=!1){let i=`http://localhost`;e&&(i=e.location.origin===`null`?e.location.href:e.location.origin),l(i,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:m(t);return a=a.replace(/ $/,`%20`),!n&&r.test(a)&&(a=i+a),new URL(a,i)}var v=new URL(`http://localhost`);function y(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),v)}catch{return v}}function b(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function x(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function S(e){let t=e.replace(/[\t\n\r]/g,``),r=0;for(;t.charCodeAt(r)<=32;)r++;if(t=t.slice(r),!n.test(t))return;let i;try{i=new URL(e,v)}catch{return}if(!x(e,i))throw Error(`External navigation is not allowed`)}function C(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!b(i,n),s=!b(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!x(e,i)||!b(i,a)))throw Error(`External navigation is not allowed`)}var w=e(t(),1),T=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},E=class extends Error{},D=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function O(e){return D.has(e)}var ee=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function k(e){return ee.has(e)}function A(e){return e.index===!0}function j(e){let t={};return e.Component&&Object.assign(t,{element:w.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:w.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function M(e,t=j,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(l(e.index!==!0||!e.children,`Cannot specify children on an index route`),l(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),A(e)){let n={...e,id:s};return r[s]=N(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=N(n,t(n)),e.children&&(n.children=M(e.children,t,o,r,i)),n}})}function N(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function P(e,t,n=`/`){return F(e,t,n,!1)}function F(e,t,n,r,i){let a=U((typeof t==`string`?h(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ne(e),s=null,c=me(a);for(let e=0;s==null&&e<o.length;++e)s=fe(o[e],c,r);return s}function te(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function ne(e){let t=I(e);return R(t),t}function I(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;l(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let u=G([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(l(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),I(e.children,t,d,u,o)),(e.path!=null||e.index)&&t.push({path:u,score:ue(u,e.index),routesMeta:d.map((e,t)=>{let[n,r]=H(e.relativePath,e.caseSensitive,t===d.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of L(e.path))a(e,t,!0,n)}),t}function L(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=L(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function R(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var z=/^:[\w-]+$/,re=/^:[\w-]+/,ie=3.5,ae=3,oe=2,se=1,ce=10,B=-2,le=e=>e===`*`;function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(le)&&(r+=B),t&&(r+=oe),n.filter(e=>!le(e)).reduce((e,t)=>e+(z.test(t)?ae:re.test(t)?ie:t===``?se:ce),r)}function de(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function fe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?pe(u,l,s.matcher,s.compiledParams):V(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=V({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:G([a,d.pathname]),pathnameBase:we(G([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=G([a,d.pathnameBase]))}return o}function V(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=H(e.path,e.caseSensitive,e.end);return pe(e,t,n,r)}function pe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Ce(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Ce(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function H(e,t=!1,n=!0){u(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return u(!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 U(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function he({basename:e,pathname:t}){return t===`/`?e:G([e,t])}var ge=e=>n.test(e);function _e(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?h(e):e,a;return n?(n=Se(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?ve(n.substring(1),`/`):ve(n,t)):a=t,{pathname:a,search:Te(r),hash:Ee(i)}}function ve(e,t){let n=Ce(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ye(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function be(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function W(e){let t=be(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function xe(e,t,n,r=!1){let i;typeof e==`string`?i=h(e):(i={...e},l(!i.pathname||!i.pathname.includes(`?`),ye(`?`,`pathname`,`search`,i)),l(!i.pathname||!i.pathname.includes(`#`),ye(`#`,`pathname`,`hash`,i)),l(!i.search||!i.search.includes(`#`),ye(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_e(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(u||d)&&(c.pathname+=`/`),c}var Se=e=>e.replace(/[\\/]{2,}/g,`/`),G=e=>Se(e.join(`/`));function Ce(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var we=e=>Ce(e).replace(/^\/*/,`/`),Te=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ee=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,De=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Oe=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ke(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ae(e){return G(e.map(e=>e.route.path).filter(Boolean))||`/`}function je(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?h(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Me=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ne(e,t){let a=e;if(typeof a!=`string`||!n.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,s=!1;if(Me)try{let e=new URL(window.location.href),n=r.test(a)?new URL(i(a,e.protocol)):new URL(a),o=U(n.pathname,t);n.origin===e.origin&&o!=null?a=o+n.search+n.hash:s=!0}catch{u(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:a}}var Pe=Symbol(`Uninstrumented`),Fe=new WeakMap;function Ie(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>q(await Ve(n.lazy,void 0,()=>e(...t),He))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>q(await Ve(n[`lazy.middleware`],void 0,()=>t(...e),He))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>q(await Ve(n[`lazy.loader`],void 0,()=>t(...e),He))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>q(await Ve(n[`lazy.action`],void 0,()=>t(...e),He))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Re(t.loader),i=async(...t)=>q(await Ve(n.loader,Ue(t[0]),()=>e(...t),He));e.hydrate===!0&&(i.hydrate=!0),ze(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Re(t.action),i=async(...t)=>q(await Ve(n.action,Ue(t[0]),()=>e(...t),He));ze(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Re(e),r=async(...e)=>q(await Ve(n.middleware,Ue(e[0]),()=>t(...e),He));return ze(r,t),r})),r}function Le(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Re(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?m(i):`.`,...We(e,a??{})};return q(await Ve(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=K(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...He(e),meta:o})))};ze(r,t),e.navigate=r}if(n.fetch.length>0){let t=Re(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return q(await Ve(n.fetch,{href:o??`.`,fetcherKey:i,...We(e,s??{})},async()=>{let n=K(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...He(e),meta:c})))};ze(r,t),e.fetch=r}return e}function Re(e){return e[Pe]??e}function ze(e,t){e[Pe]=t}function K(e,t){return Fe.set(e,t),()=>{Fe.get(e)===t&&Fe.delete(e)}}function Be(e){let t=Fe.get(e);return Fe.delete(e),t}function q(e){if(e.type===`error`)throw e.value;return e.value}async function Ve(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=Ve(e,t,n,r,i,a-1),await s,l(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result||(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function He(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Ue(e){let{request:t,context:n,params:r}=e;return{...e,request:Ge(t),params:{...r},context:Ke(n)}}function We(e,t){return{currentUrl:m(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 Ge(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ke(e){return{get:t=>e.get(t)}}var qe=class{#e=[];#t=[];#n;#r=0;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=ne(e),this.#r=this.#t.reduce((e,t)=>e+t.routesMeta.length,0)}get matchCost(){return this.#r}match(e,t=!1){return F(this.#e,e,this.#n,t,this.#t)}},Je=[`POST`,`PUT`,`PATCH`,`DELETE`],Ye=new Set(Je),Xe=[`GET`,...Je],Ze=new Set(Xe),Qe=new Set([301,302,303,307,308]),$e=new Set([307,308]),et={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},rt=`remix-router-transitions`,it=Symbol(`ResetLoaderData`);function at(e,t){return e.unstable_routePatternMatching?(l(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new qe(t)}var ot=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}},st=new WeakMap;function ct(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;l(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i=e.hydrationRouteProperties||[],a=e.mapRouteProperties,o=a||(()=>({}));if(e.instrumentations){let t=e.instrumentations;o=e=>({...a?.(e),...Ie(t.map(e=>e.route).filter(Boolean),e)})}let s={...e.future},c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let d=at(s,c),f={},g=new ot(M(e.routes,o,void 0,f),d),v=e.dataStrategy||Tt,y=null,b=new Set,x=null,S=null,w=null,D=e.hydrationData!=null,O=d.match(e.history.location),ee=!1,k=null,A,j;if(O==null&&!e.patchRoutesOnNavigation){let t=J(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Jt(g.activeRoutes);A=!0,j=!A,O=n,k={[r.id]:t}}else if(O&&!e.hydrationData&>(O,e.history.location.pathname).active&&(O=null),!O){A=!1,j=!A,O=[];let t=gt(null,e.history.location.pathname);t.active&&t.matches&&(ee=!0,O=t.matches)}else if(O.some(e=>e.route.lazy))A=!1,j=!A;else if(!O.some(e=>pt(e.route)))A=!0,j=!A;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=O;if(n){let e=O.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}j=!1,A=!0,r.forEach(e=>{let r=mt(e.route,t,n);j||=r.renderFallback,A&&=!r.shouldLoad})}let N,P={historyAction:e.history.action,location:e.history.location,matches:O,initialized:A,renderFallback:j,navigation:et,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||k,fetchers:new Map,blockers:new Map},F=`POP`,ne=0,I,L=null,R=!1,z,re=!1,ie=new Map,ae=null,oe=!1,se=!1,ce=new Set,B=new Map,le=0,ue=-1,de=new Map,fe=new Set,V=new Map,pe=new Map,H=new Set,me=new Map,he,_e=null;function ve(){if(y=e.history.listen(({action:t,location:n,delta:r})=>{if(he){he(),he=void 0;return}u(me.size===0||r!=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 i=Qe({currentLocation:P.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{he=e});e.history.go(r*-1),Ze(i,{state:`blocked`,location:n,proceed(){Ze(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(P.blockers);e.set(i,nt),W({blockers:e})}}),L?.resolve(),L=null}else return s.unstable_customRouteDiscovery&&(ne+=r||0),we(t,n)}),n){_n(t,ie);let e=()=>vn(t,ie);t.addEventListener(`pagehide`,e),ae=()=>t.removeEventListener(`pagehide`,e)}return P.initialized||we(`POP`,P.location,{initialHydration:!0}),N}function ye(){y&&y(),ae&&ae(),b.clear(),z&&z.abort(),P.fetchers.forEach((e,t)=>Ue(P.fetchers,t)),P.blockers.forEach((e,t)=>Xe(t))}function be(e){return b.add(e),()=>b.delete(e)}function W(e,t={}){let n=e.errors??null,r=n?st.get(n):void 0;r!==void 0&&(n=r),(e.errors!==void 0||e.initialized)&&(P.errors&&st.delete(P.errors),e.errors&&st.set(e.errors,n)),e.matches&&=e.matches.map(e=>{let t=f[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),P={...P,...e};let i=[],a=[];P.fetchers.forEach((e,t)=>{e.state===`idle`&&(H.has(t)?i.push(t):a.push(t))}),H.forEach(e=>{!P.fetchers.has(e)&&!B.has(e)&&i.push(e)}),[...b].forEach(e=>e(P,{deletedFetchers:i,newErrors:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),i.forEach(e=>Ue(P.fetchers,e)),a.forEach(e=>P.fetchers.delete(e))}function xe(t,n,{flushSync:r}={}){let i=P.actionData!=null&&P.navigation.formMethod!=null&&X(P.navigation.formMethod)&&P.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?P.actionData:null;let o=n.loaderData?Gt(P.loaderData,n.loaderData,n.matches||[],n.errors):P.loaderData,s=P.blockers;s.size>0&&!oe&&(s=new Map(s),s.forEach((e,t)=>s.set(t,nt)));let c=!oe&&ht(t,n.matches||P.matches),l=R===!0||P.navigation.formMethod!=null&&X(P.navigation.formMethod)&&t.state?._isRedirect!==!0;g.commitHmrRoutes(),oe||F===`POP`||(F===`PUSH`?e.history.push(t,t.state):F===`REPLACE`&&e.history.replace(t,t.state));let u;if(F===`POP`&&!oe&&t!==P.location){let e=ie.get(P.location.pathname);e&&e.has(t.pathname)?u={currentLocation:P.location,nextLocation:t}:ie.has(t.pathname)&&(u={currentLocation:t,nextLocation:P.location})}else if(re){let e=ie.get(P.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ie.set(P.location.pathname,e)),u={currentLocation:P.location,nextLocation:t}}W({...n,actionData:a,loaderData:o,historyAction:F,location:t,initialized:!0,renderFallback:!1,navigation:et,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:u,flushSync:r===!0}),Se(),L?.resolve(),L=null,_e?.resolve(),_e=null}function Se(){ne=0,F=`POP`,R=!1,re=!1,oe=!1,se=de.size>0}async function G(t,n){if(I&&await I,L?.resolve(),L=null,typeof t==`number`){L||=yn();let n=L.promise;return e.history.go(t),n}let i=Be(N),{path:a,submission:o,error:s}=dt(!1,ut(P.location,P.matches,c,t,n?.fromRouteId,n?.relative),n),l;if(n?.mask){let t=typeof n.mask==`string`?h(n.mask):{...P.location.mask,...n.mask};if(l={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},r.test(l.pathname))throw Error(`External navigation is not allowed`);l.pathname.startsWith(`\\`)&&(l.pathname=l.pathname.replace(/^\\+/,`/`)),C(typeof n.mask==`string`?n.mask:m(n.mask),m(l),e.history.createURL(`/`),`reject`)}let u=P.location,d=p(u,a,n&&n.state,void 0,l);d={...d,...e.history.encodeLocation(d)},C(t==null?e.history.createHref(P.location):typeof t==`string`?t:m(t),e.history.createHref(d.mask||d),e.history.createURL(`/`),`reject`);let f=n&&n.replace!=null?n.replace:void 0,g=`PUSH`,_=P.location.pathname+P.location.search;f===!0?g=`REPLACE`:f===!1||o!=null&&X(o.formMethod)&&(o.formAction===_||d.pathname+d.search===_)&&(g=`REPLACE`);let v=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,y=(n&&n.flushSync)===!0,b=Qe({currentLocation:u,nextLocation:d,historyAction:g});b?Ze(b,{state:`blocked`,location:d,proceed(){Ze(b,{state:`proceeding`,proceed:void 0,reset:void 0,location:d}),G(t,n)},reset(){let e=new Map(P.blockers);e.set(b,nt),W({blockers:e})}}):await we(g,d,{submission:o,pendingError:s,preventScrollReset:v,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:y,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:i})}function Ce(){if(I)return I.then(Ce);_e||=yn(),ze(),W({revalidation:`loading`});let e=_e.promise;return P.navigation.state===`submitting`?e:P.navigation.state===`idle`?(we(P.historyAction,P.location,{startUninterruptedRevalidation:!0,dataStrategyInitiator:`revalidation`}),e):(we(F||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,dataStrategyInitiator:`revalidation`,enableViewTransition:re===!0}),e)}async function we(t,n,r){I&&await I,z&&z.abort(),z=null,F=t,oe=(r&&r.startUninterruptedRevalidation)===!0,lt(P.location,P.matches),R=(r&&r.preventScrollReset)===!0,re=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&P.matches&&P.matches.length>0&&!ee?P.matches:d.match(n),a=(r&&r.flushSync)===!0;if(i&&P.initialized&&!se&&Zt(P.location,n)&&!(r&&r.submission&&X(r.submission.formMethod))){xe(n,{matches:i},{flushSync:a});return}let o=gt(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=dn(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);xe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;z=new AbortController;let c=Bt(e.history,n,z.signal,r&&r.submission),l=r?.initialHydration?`initialization`:r?.dataStrategyInitiator??`navigation`,u=e.getContext?await e.getContext():new T,f;if(r&&r.pendingError)f=[qt(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&X(r.submission.formMethod)){let d=await Ee(c,l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(d.shortCircuited)return;if(d.pendingActionResult){let[e,t]=d.pendingActionResult;if(Y(t)&&ke(t.error)&&t.error.status===404){z=null,xe(n,{matches:d.matches,loaderData:{},errors:{[e]:t.error}});return}}i=d.matches||i,f=d.pendingActionResult,t=F,s=pn(n,i,t,r.submission),a=!1,o.active=!1,c=Bt(e.history,c.url,c.signal)}let{shortCircuited:p,matches:m,loaderData:h,errors:g,workingFetchers:_}=await De(c,l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,f,r&&r.callSiteDefaultShouldRevalidate);p||(z=null,xe(n,{matches:m||i,...Kt(f),loaderData:h,errors:g,..._?{fetchers:_}:{}}))}function Te(){let t=yn();I=t.promise;let n=ne,r=L;L=null,z?.abort(),z=null,Se(),_e?.resolve(),_e=null;let i=new Map(P.blockers);i.forEach((e,t)=>{e.state===`proceeding`&&i.set(t,nt)});let a=new Map(P.fetchers),o=qe(a);a.forEach((e,t)=>{e.state===`loading`&&!B.has(t)&&(a.set(t,Z(e.data)),o=!0)}),ce.clear(),W({navigation:et,revalidation:`idle`,blockers:i,...o?{fetchers:a}:{}});function s(){I=void 0,r?.resolve(),t.resolve()}return n?(he=s,e.history.go(-n)):s(),t.promise}async function Ee(t,n,r,a,l,u,d,p,m,h={}){if(s.unstable_customRouteDiscovery||ze(),W({navigation:mn(r,l,u,a)},{flushSync:h.flushSync===!0}),p){let e=await _t(l,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Te(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Jt(g.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=qt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:n}=rt(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:`error`,error:t}]}}}s.unstable_customRouteDiscovery&&ze();let _,v=un(l,r);if(!v.route.action&&!v.route.lazy)_={type:`error`,error:J(405,{method:t.method,pathname:r.pathname,routeId:v.route.id})};else{let e=await Fe(t,r,jt(o,f,t,r,l,v,m?[]:i,d),d,null,n,u);if(_=e[v.route.id],!_){for(let t of l)if(e[t.route.id]){_=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(nn(_)){let r;return r=h&&h.replace!=null?h.replace:zt(_.response.headers.get(`Location`),new URL(t.url),c,e.history)===P.location.pathname+P.location.search,await Pe(t,_,!0,n,{submission:a,replace:r}),{shortCircuited:!0}}if(Y(_)){let e=qt(l,v.route.id);return(h&&h.replace)!==!0&&(F=`PUSH`),{matches:l,pendingActionResult:[e.route.id,_,v.route.id]}}return{matches:l,pendingActionResult:[v.route.id,_]}}async function De(t,n,r,a,c,l,u,p,m,h,_,v,y,b,x){let S=p||pn(r,a,c,m),C=m||h||fn(S),w=!oe&&!v;if(u){if(w){let e=Oe(b);W({navigation:S,...e===void 0?{}:{actionData:e}},{flushSync:y})}let e=await _t(a,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Te(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Jt(g.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=qt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)a=e.matches,v&&!t.signal.aborted&&W({matches:a});else{let{error:e,notFoundMatches:t,route:n}=rt(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let{dsMatches:T,revalidatingFetchers:E}=ft(t,l,o,f,e.history,P,a,C,r,v?[]:i,v===!0,se,ce,H,V,fe,d,b,x);if(ue=++le,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(P.fetchers),t=qe(e);return xe(r,{matches:a,loaderData:{},errors:b&&Y(b[1])?{[b[0]]:b[1].error}:null,...Kt(b),...t?{fetchers:e}:{}},{flushSync:y}),{shortCircuited:!0}}if(w){let e={};if(!u){e.navigation=S;let t=Oe(b);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=Ae(E)),W(e,{flushSync:y})}E.forEach(e=>{Ge(e.key),e.controller&&B.set(e.key,e.controller)});let D=()=>E.forEach(e=>{B.get(e.key)===e.controller&&Ge(e.key)});z&&z.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:ee}=await Re(T,E,t,r,l,n,c);if(t.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener(`abort`,D),E.forEach(e=>{B.get(e.key)===e.controller&&B.delete(e.key)});let k=Yt(O);if(k)return await Pe(t,k.result,!0,n,{replace:_}),{shortCircuited:!0};if(k=Yt(ee),k)return fe.add(k.key),await Pe(t,k.result,!0,n,{replace:_}),{shortCircuited:!0};let A=new Map(P.fetchers),{loaderData:j,errors:M}=Wt(P,a,O,b,E,ee,A);if(v&&P.errors){let e=M??null;M={...P.errors,...M},st.set(M,e)}let N=qe(A),F=Je(ue,A),te=N||F||E.length>0;return{matches:a,loaderData:j,errors:M,...te?{workingFetchers:A}:{}}}function Oe(e){if(e&&!Y(e[1]))return{[e[0]]:e[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function Ae(e){let t=new Map(P.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=hn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function je(t,n,r,i){I&&await I,Ge(t);let a=(i&&i.flushSync)===!0,o=Be(N),s=ut(P.location,P.matches,c,r,n,i?.relative);C(null,s,e.history.createURL(`/`),`reject`);let l=d.match(s),u=gt(l,s);if(u.active&&u.matches&&(l=u.matches),o&&o(dn(e.history,s,l)),!l){q(t,n,J(404,{pathname:s}),{flushSync:a});return}let{path:f,submission:p,error:m}=dt(!0,s,i);if(m){q(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new T,g=(i&&i.preventScrollReset)===!0;if(p&&X(p.formMethod)){await Me(t,n,f,l,h,u.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:u.active};V.set(t,_),await Ne(t,_,l,h,a,g,p)}async function Me(t,n,r,a,c,u,p,m,h,g){s.unstable_customRouteDiscovery||ze(),V.delete(t);let _=P.fetchers.get(t);K(t,gn(h,_),{flushSync:p});let v=new AbortController;s.unstable_customRouteDiscovery&&B.set(t,v);let y=Bt(e.history,r,v.signal,h);if(u){let e=await _t(a,new URL(y.url).pathname,y.signal,t);if(s.unstable_customRouteDiscovery&&y.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){B.delete(t),V.delete(t),K(t,Z(_?.data),{flushSync:p});return}if(e.type===`error`){q(t,n,e.error,{flushSync:p});return}if(e.matches)a=e.matches;else{q(t,n,J(404,{pathname:r}),{flushSync:p});return}}let b=un(a,r);if(!b.route.action&&!b.route.lazy){q(t,n,J(405,{method:h.formMethod,pathname:r,routeId:n}),{flushSync:p});return}s.unstable_customRouteDiscovery&&ze(),B.set(t,v);let x=le,S=jt(o,f,y,r,a,b,i,c),C=await Fe(y,r,S,c,t,`fetcher`),w=C[b.route.id];if(!w){for(let e of S)if(C[e.route.id]){w=C[e.route.id];break}}if(y.signal.aborted){B.get(t)===v&&B.delete(t);return}if(H.has(t)){if(Y(w)){K(t,Z(void 0));return}nn(w)&&(se=!0,w={type:`data`,data:void 0})}else{if(nn(w)){if(ue>x)se=!0,w={type:`data`,data:void 0};else return B.delete(t),fe.add(t),K(t,hn(h)),Pe(y,w,!1,`fetcher`,{fetcherSubmission:h,preventScrollReset:m})}if(Y(w)){q(t,n,w.error);return}}se=!0;let T=P.navigation.location||P.location,E=Bt(e.history,T,v.signal),D=P.navigation.state===`idle`?P.matches:d.match(P.navigation.location);l(D,`Didn't find any matches after fetcher action`);let O=++le;de.set(t,O);let{dsMatches:ee,revalidatingFetchers:k}=ft(E,c,o,f,e.history,P,D,h,T,i,!1,se,ce,H,V,fe,d,[b.route.id,w],g),A=hn(h,w.data),j=new Map(P.fetchers);j.set(t,A),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=j.get(t),r=hn(void 0,n?n.data:void 0);j.set(t,r),Ge(t),e.controller&&B.set(t,e.controller)}),W({fetchers:j});let M=()=>k.forEach(e=>{B.get(e.key)===e.controller&&Ge(e.key)});v.signal.addEventListener(`abort`,M);let{loaderResults:N,fetcherResults:te}=await Re(ee,k,E,T,c,`fetcher`);if(v.signal.aborted){de.get(t)===O&&de.delete(t);return}v.signal.removeEventListener(`abort`,M),de.delete(t),B.delete(t),k.forEach(e=>{B.get(e.key)===e.controller&&B.delete(e.key)});let ne=P.fetchers.has(t),I=e=>{if(!ne)return e;let n=new Map(e.fetchers);return n.set(t,Z(w.data)),{...e,fetchers:n}},L=Yt(N);if(L)return P=I(P),Pe(E,L.result,!1,`fetcher`,{preventScrollReset:m});if(L=Yt(te),L)return fe.add(L.key),P=I(P),Pe(E,L.result,!1,`fetcher`,{preventScrollReset:m});let R=new Map(P.fetchers);ne&&R.set(t,Z(w.data));let{loaderData:re,errors:ie}=Wt(P,D,N,void 0,k,te,R);Je(O,R),P.navigation.state===`loading`&&O>ue?(l(F,`Expected pending action`),z&&z.abort(),qe(R),xe(P.navigation.location,{matches:D,loaderData:re,errors:ie,fetchers:R})):(W({errors:ie,loaderData:Gt(P.loaderData,re,D,ie),fetchers:R}),se=de.size>0)}async function Ne(t,n,r,a,c,l,u){let{routeId:d,path:p}=n,m=P.fetchers.get(t);K(t,hn(u,m?m.data:void 0),{flushSync:c});let h=new AbortController;s.unstable_customRouteDiscovery&&B.set(t,h);let g=Bt(e.history,p,h.signal);if(n.isDiscovering){let e=await _t(r,new URL(g.url).pathname,g.signal,t);if(s.unstable_customRouteDiscovery&&g.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){B.delete(t),V.delete(t),K(t,Z(m?.data),{flushSync:c});return}if(e.type===`error`){q(t,d,e.error,{flushSync:c});return}if(e.matches)r=e.matches,n.isDiscovering=!1;else{q(t,d,J(404,{pathname:p}),{flushSync:c});return}}let _=un(r,p);B.set(t,h);let v=le,y=await Fe(g,p,jt(o,f,g,p,r,_,i,a),a,t,`fetcher`),b=y[_.route.id];if(!b){for(let e of r)if(y[e.route.id]){b=y[e.route.id];break}}if(B.get(t)===h&&B.delete(t),!g.signal.aborted){if(H.has(t))K(t,Z(void 0));else{if(nn(b)){if(ue>v){K(t,Z(void 0));return}fe.add(t),await Pe(g,b,!1,`fetcher`,{preventScrollReset:l});return}Y(b)?q(t,d,b.error):K(t,Z(b.data))}}}async function Pe(r,i,a,o,{submission:s,fetcherSubmission:u,preventScrollReset:d,replace:f}={}){a||(L?.resolve(),L=null),i.response.headers.has(`X-Remix-Revalidate`)&&(se=!0);let m=i.response.headers.get(`Location`);l(m,`Expected a Location header on the redirect Response`);let h=m,g=new URL(r.url);m=zt(m,g,c,e.history),C(h,m,g,`allow-explicit`);let v=p(P.location,m,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(ge(m)){let n=_(t,m,!0);e=n.origin!==t.location.origin||U(n.pathname,c)==null}if(e){f?t.location.replace(m):t.location.assign(m);return}}z=null;let y=f===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:b,formAction:x,formEncType:S}=P.navigation;!s&&!u&&b&&x&&S&&(s=fn(P.navigation));let w=s||u;$e.has(i.response.status)&&w&&X(w.formMethod)?await we(y,v,{submission:{...w,formAction:m},preventScrollReset:d||R,enableViewTransition:a?re:void 0,dataStrategyInitiator:o}):await we(y,v,{overrideNavigation:pn(v,[],y,s),fetcherSubmission:u,preventScrollReset:d||R,enableViewTransition:a?re:void 0,dataStrategyInitiator:o})}async function Fe(e,t,n,r,i,a,o=null){let s,l={};try{s=await Mt(v,e,t,n,i,a,r,!1,o)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{l[t.route.id]={type:`error`,error:e}}),l}if(e.signal.aborted)return l;if(!X(e.method))for(let e of n){if(s[e.route.id]?.type===`error`)break;s.hasOwnProperty(e.route.id)||P.loaderData.hasOwnProperty(e.route.id)||P.errors&&P.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(s[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(s))if(tn(r)){let i=r.result;l[t]={type:`redirect`,response:It(i,e,t,n,c)}}else l[t]=await Ft(r);return l}async function Re(e,t,n,r,i,a,o=null){let s=Fe(n,r,e,i,null,a,o),c=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Fe(e.request,e.path,e.matches,i,e.key,a,o))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:J(404,{pathname:e.path})}})}));return{loaderResults:await s,fetcherResults:(await c).reduce((e,t)=>Object.assign(e,t),{})}}function ze(){se=!0,V.forEach((e,t)=>{s.unstable_customRouteDiscovery&&e.isDiscovering||(B.has(t)&&ce.add(t),Ge(t))})}function K(e,t,n={}){let r=new Map(P.fetchers);r.set(e,t),W({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function q(e,t,n,r={}){let i=qt(P.matches,t),a=new Map(P.fetchers);Ue(a,e),W({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ve(e){return pe.set(e,(pe.get(e)||0)+1),H.has(e)&&H.delete(e),P.fetchers.get(e)||tt}function He(e,t){Ge(e,t?.reason),V.delete(e),ce.delete(e),K(e,Z(null))}function Ue(e,t){let n=P.fetchers.get(t);B.has(t)&&!(n&&n.state===`loading`&&de.has(t))&&Ge(t),V.delete(t),de.delete(t),fe.delete(t),H.delete(t),ce.delete(t),e.delete(t)}function We(e){let t=(pe.get(e)||0)-1;t<=0?(pe.delete(e),H.add(e)):pe.set(e,t),W({fetchers:new Map(P.fetchers)})}function Ge(e,t){let n=B.get(e);n&&(n.abort(t),B.delete(e))}function Ke(e,t){for(let n of e){let e=t.get(n);l(e,`Expected fetcher: ${n}`);let r=Z(e.data);t.set(n,r)}}function qe(e){let t=[],n=!1;for(let r of fe){let i=e.get(r);l(i,`Expected fetcher: ${r}`),i.state===`loading`&&(fe.delete(r),t.push(r),n=!0)}return Ke(t,e),n}function Je(e,t){let n=[];for(let[r,i]of de)if(i<e){let e=t.get(r);l(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Ge(r),de.delete(r),n.push(r))}return Ke(n,t),n.length>0}function Ye(e,t){let n=P.blockers.get(e)||nt;return me.get(e)!==t&&me.set(e,t),n}function Xe(e){P.blockers.delete(e),me.delete(e)}function Ze(e,t){let n=P.blockers.get(e)||nt;l(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(P.blockers);r.set(e,t),W({blockers:r})}function Qe({currentLocation:e,nextLocation:t,historyAction:n}){if(me.size===0)return;me.size>1&&u(!1,`A router only supports one blocker at a time`);let r=Array.from(me.entries()),[i,a]=r[r.length-1],o=P.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function rt(e){let t=J(404,{pathname:e}),n=g.activeRoutes,{matches:r,route:i}=Jt(n);return{notFoundMatches:r,route:i,error:t}}function it(e,t,n){if(x=e,w=t,S=n||null,!D&&P.navigation===et){D=!0;let e=ht(P.location,P.matches);e!=null&&W({restoreScrollPosition:e})}return()=>{x=null,w=null,S=null}}function ct(e,t){return S&&S(e,t.map(e=>te(e,P.loaderData)))||e.key}function lt(e,t){if(x&&w){let n=ct(e,t);x[n]=w()}}function ht(e,t){if(x){let n=ct(e,t),r=x[n];if(typeof r==`number`)return r}return null}function gt(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:d.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:d.match(n,!0)}}return{active:!1,matches:null}}async function _t(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let a=t;for(;;){let t=f;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:a,fetcherKey:i,patch:(e,n)=>{r.aborted||vt(e,n,g,t,o,!1)}})}catch(e){if(s.unstable_customRouteDiscovery){if(r.aborted)return{type:`aborted`};if(e instanceof E)return{type:`cancelled`}}return{type:`error`,error:e,partialMatches:a}}if(r.aborted)return{type:`aborted`};let c=d.match(n),l=null;if(c&&(Object.keys(c[0].params).length===0||(l=d.match(n,!0),!(l&&a.length<l.length&&yt(a,l.slice(0,a.length))))))return{type:`success`,matches:c};if(l||=d.match(n,!0),!l||yt(a,l))return{type:`success`,matches:null};a=l}}function yt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function bt(e){f={},g.setHmrRoutes(M(e,o,void 0,f))}function xt(e,t,n=!1){vt(e,t,g,f,o,n),g.hasHMRRoutes||W({})}return N={get basename(){return c},get future(){return s},get state(){return P},get routes(){return g.stableRoutes},match(e){return d.match(e)},get manifest(){return f},get window(){return t},initialize:ve,subscribe:be,enableScrollRestoration:it,navigate:G,fetch:je,revalidate:Ce,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ve,resetFetcher:He,deleteFetcher:We,dispose:ye,getBlocker:Ye,deleteBlocker:Xe,patchRoutes:xt,_internalFetchControllers:B,_internalSetRoutes:bt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){W(e)}},e.instrumentations&&(N=Le(N,e.instrumentations.map(e=>e.router).filter(Boolean))),N}function lt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ut(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=xe(r||`.`,W(o),U(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=ln(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=he({basename:n,pathname:c.pathname})),m(c)}function dt(e,t,n){if(!n||!lt(n))return{path:t};if(n.formMethod&&!cn(n.formMethod))return{path:t,error:J(405,{method:n.formMethod})};let r=()=>({path:t,error:J(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Xt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!X(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!X(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}l(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Vt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Vt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Ht(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Ht(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(X(c.formMethod))return{path:t,submission:c};let u=h(t);return e&&u.search&&ln(u.search)&&o.append(`index`,``),u.search=`?${o}`,{path:m(u),submission:c}}function ft(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Y(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&Y(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=Ae(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!pt(s))f=!1;else if(u){let{shouldLoad:e}=mt(s,a.loaderData,a.errors);f=e}else ht(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return At(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?gt(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return At(n,r,e,c,E,i,l,t,_t(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=un(_,e.path),b=new AbortController,x=Bt(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=jt(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=jt(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};_t(y,a)&&(S=jt(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function pt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function mt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!pt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function ht(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function gt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function _t(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function vt(e,t,n,r,i,a){let o;if(e){let t=r[e];l(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>yt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=M(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=M([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function yt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>yt(e,t)))??!1}var bt=new WeakMap,xt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(l(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=bt.get(i);o||(o={},bt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=O(e),n=i[e]!==void 0;if(t)u(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)u(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c.catch(()=>{o[e]===c&&delete o[e]}),c},St=new WeakMap;function Ct(e,t,n,r,i){let a=n[e.id];if(l(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=St.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{l(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=k(e),o=a[e]!==void 0;i?u(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?u(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return St.set(a,n),n.catch(()=>{St.get(a)===n&&St.delete(a)}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=xt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let d=s.length>0?Promise.all(s).then(()=>{}):void 0;return d?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:c}}async function wt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Tt(e){return e.matches.some(e=>e.route.middleware)?Et(e,()=>wt(e)):wt(e)}function Et(e,t){return Dt(e,t,e=>{if(sn(e))throw e;return e},$t,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[qt(r,a).route.id]:{type:`error`,result:t}}}}}async function Dt(e,t,n,r,i){let{matches:a,...o}=e;return await Ot(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Ot(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Ot(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function kt(e,t,n,r,i){let a=xt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Ct(r.route,X(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function At(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=kt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?_t(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?_t(a,{...l,defaultShouldRevalidate:e}):_t(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!X(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(X(n.method)||!p)?Nt({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function jt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?At(e,t,n,r,Ae(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:kt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Mt(e,t,n,r,i,a,o,s,c=null){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let l={request:t,url:je(t,n),pattern:Ae(r),params:r[0].params,context:o,matches:r,unstable_initiator:a,unstable_navigationType:a===`navigation`?c:null},u=s?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=l;return Et(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},d=await e({...l,fetcherKey:i,runClientMiddleware:u});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return d}async function Nt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=X(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:je(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw J(405,{method:e.method,pathname:n,routeId:r.route.id})}else return await a,{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw J(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Pt(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 Ft(e){let{result:t,type:n}=e;if(an(t)){let e;try{e=await Pt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Oe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?rn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Qt(t),statusCode:ke(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ke(t)?t.status:void 0}:rn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function It(e,t,n,r,i){let a=e.headers.get(`Location`);if(l(a,`Redirects returned/thrown from loaders/actions must have a Location header`),C(a,a,new URL(t.url),`allow-explicit`),!ge(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ut(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Lt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Rt(e){try{return Lt.includes(new URL(e).protocol)}catch{return!1}}function zt(e,t,n,a){if(ge(e)){let a=e,o=r.test(a)?new URL(i(a,t.protocol)):new URL(a);if(Rt(o.toString()))throw Error(`Invalid redirect location`);let s=U(o.pathname,n)!=null;if(o.origin===t.origin&&s)return Se(o.pathname)+o.search+o.hash}try{if(Rt(a.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Bt(e,t,n,r){let i=e.createURL(Xt(t)).toString(),a={signal:n};if(r&&X(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Vt(r.formData):r.formData}return new Request(i,a)}function Vt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Ht(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Ut(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,u={},d=n&&Y(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let f=n.route.id,p=t[f];if(l(!nn(p),`Cannot handle redirect results in processLoaderData`),Y(p)){let t=p.error;if(d!==void 0&&(t=d,d=void 0),o||={},i)o[f]=t;else{let n=qt(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=it),c||(c=!0,s=ke(p.error)?p.error.status:500),p.headers&&(u[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(u[f]=p.headers)}),d!==void 0&&n&&(o={[n[0]]:d},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:u}}function Wt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Ut(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,routeId:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(l(s,`Did not find corresponding fetcher result`),Y(s)){let t=qt(e.matches,r);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(nn(s))l(!1,`Unhandled fetcher revalidation redirect`);else{let e=Z(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Gt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==it).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Kt(e){return e?Y(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function qt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Jt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function J(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Oe(e||500,o,Error(s),!0)}function Yt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(nn(r))return{key:n,result:r}}}function Xt(e){return m({...typeof e==`string`?h(e):e,hash:``})}function Zt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Qt(e){return new Oe(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function $t(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&en(t))}function en(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function tn(e){return an(e.result)&&Qe.has(e.result.status)}function Y(e){return e.type===`error`}function nn(e){return(e&&e.type)===`redirect`}function rn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function an(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function on(e){return Qe.has(e)}function sn(e){return an(e)&&on(e.status)&&e.headers.has(`Location`)}function cn(e){return Ze.has(e.toUpperCase())}function X(e){return Ye.has(e.toUpperCase())}function ln(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function un(e,t){let n=typeof t==`string`?h(t).search:t.search;if(e[e.length-1].route.index&&ln(n||``))return e[e.length-1];let r=be(e);return r[r.length-1]}function dn(e,t,n){return{url:je(e.createURL(t),t),pattern:n?Ae(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function fn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function pn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function mn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function hn(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 gn(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 Z(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 _n(e,t){try{let n=e.sessionStorage.getItem(rt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function vn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(rt,JSON.stringify(n))}catch(e){u(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function yn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var bn=w.createContext(null);bn.displayName=`DataRouter`;var xn=w.createContext(null);xn.displayName=`DataRouterState`;var Sn=w.createContext(null);Sn.displayName=`DataRouterData`;var Cn=w.createContext(null);Cn.displayName=`DataRouterNavigation`;var wn=w.createContext(!1);function Tn(){return w.useContext(wn)}var En=w.createContext({isTransitioning:!1});En.displayName=`ViewTransition`;var Dn=w.createContext(null);Dn.displayName=`Fetchers`;var On=w.createContext(null);On.displayName=`Await`;var Q=w.createContext(null);Q.displayName=`Navigation`;var kn=w.createContext(null);kn.displayName=`Location`;var An=w.createContext({outlet:null,matches:[],isDataRoute:!1});An.displayName=`Route`;var jn=w.createContext(!1);jn.displayName=`IsDataRoute`;var Mn=w.createContext(void 0);Mn.displayName=`RouteId`;var Nn=w.createContext(null);Nn.displayName=`RouteError`;var Pn=`REACT_ROUTER_ERROR`,Fn=`REDIRECT`,In=`ROUTE_ERROR_RESPONSE`;function Ln(e){if(e.startsWith(`${Pn}:${Fn}:{`))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 Rn(e){if(e.startsWith(`${Pn}:${In}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Oe(t.status,t.statusText,t.data)}catch{}}function zn(e,{relative:t}={}){l(Bn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=w.useContext(Q),{hash:i,pathname:a,search:o}=Gn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:G([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Bn(){return w.useContext(kn)!=null}function $(){return l(Bn(),`useLocation() may be used only in the context of a <Router> component.`),w.useContext(kn).location}var Vn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Hn(){return w.useContext(jn)?lr():Un()}function Un(){l(Bn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=w.useContext(bn),{basename:t,navigator:n}=w.useContext(Q),{matches:r}=w.useContext(An),{pathname:i}=$(),a=JSON.stringify(W(r)),o=w.useRef(!1);return w.useLayoutEffect(()=>{o.current=!0}),w.useCallback((r,s={})=>{if(u(o.current,Vn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=xe(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:G([t,c.pathname])),C(typeof r==`string`?r:m(r),n.createHref(c),y(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}w.createContext(null);function Wn(){let{matches:e}=w.useContext(An);return e[e.length-1]?.params??{}}function Gn(e,{relative:t}={}){let{matches:n}=w.useContext(An),{pathname:r}=$(),i=JSON.stringify(W(n));return w.useMemo(()=>xe(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Kn(e,t){return qn(e,t)}function qn(e,t,n){l(Bn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=w.useContext(Q),{matches:i}=w.useContext(An),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=$(),u;if(t){let e=typeof t==`string`?h(t):t;l(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=c;let d=u.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p;p=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):P(e,{pathname:f});let m=er(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:G([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:G([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&m?w.createElement(kn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},m):m}function Jn(){let e=or(),t=ke(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return w.createElement(w.Fragment,null,w.createElement(`h2`,null,`Unexpected Application Error!`),w.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?w.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Yn=w.createElement(Jn,null),Xn=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=wn;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){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`){let t=Rn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:w.createElement(An.Provider,{value:this.props.routeContext},w.createElement(jn.Provider,{value:this.props.routeContext.isDataRoute},w.createElement(Mn.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},w.createElement(Nn.Provider,{value:e,children:this.props.component}))));return this.context?w.createElement(Qn,{error:e},t):t}},Zn=new WeakMap;function Qn({children:e,error:t}){let{basename:n,navigator:r}=w.useContext(Q);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ln(t.digest);if(e){let i=Zn.get(t);if(i)throw i;let a=Ne(e.location,n),o=a.absoluteURL||a.to;if(C(e.location,o,y(r),`allow-explicit`),Rt(o))throw Error(`Invalid redirect location`);if(Me&&!Zn.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Zn.set(t,n),n}}return w.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function $n({routeContext:e,match:t,children:n}){let r=w.useContext(bn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(An.Provider,{value:e},w.createElement(jn.Provider,{value:e.isDataRoute},w.createElement(Mn.Provider,{value:t.route.id},n)))}function er(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);l(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,u=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ae(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let l,d=!1,f=null,p=null;r&&(l=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Yn,o&&(s<0&&c===0?(dr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=l?f:d?p:n.route.Component?w.createElement(n.route.Component,null):n.route.element?n.route.element:e,w.createElement($n,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?w.createElement(Xn,{location:r.location,revalidation:r.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):h()},null)}function tr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nr(e){let t=w.useContext(bn);return l(t,tr(e)),t}function rr(e){let t=w.useContext(xn);return l(t,tr(e)),t}function ir(e){let t=w.useContext(Sn);return l(t,tr(e)),t}function ar(e){let t=w.useContext(Mn);return l(t,`${e} can only be used on routes that contain a unique "id"`),t}function or(){let e=w.useContext(Nn),t=ir(`useRouteError`),n=ar(`useRouteError`);return e===void 0?t.errors?.[n]:e}var sr=0;function cr(e){let{router:t,basename:n}=nr(`useBlocker`),r=rr(`useBlocker`),[i,a]=w.useState(``),o=w.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:U(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:U(i.pathname,n)||i.pathname},historyAction:a})},[n,e]),s=w.useRef(``);return w.useEffect(()=>{let e=String(++sr);return s.current=e,a(e),()=>{s.current=``,t.deleteBlocker(e)}},[t]),w.useEffect(()=>{i!==``&&i===s.current&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):nt}function lr(){let{router:e}=nr(`useNavigate`),t=ar(`useNavigate`),n=w.useRef(!1);return w.useLayoutEffect(()=>{n.current=!0}),w.useCallback(async(r,i={})=>{u(n.current,Vn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ur={};function dr(e,t,n){!t&&!ur[e]&&(ur[e]=!0,u(!1,n))}function fr(e,t){if(e===!1||e==null)throw Error(t)}function pr(e,t,n){let r=typeof e==`string`?new URL(e,n??(typeof window>`u`?`server://singlefetch/`:window.location.origin)):new URL(e);return n&&r.origin!==n&&(r=new URL(r.pathname+r.search+r.hash,n)),r.pathname.endsWith(`/`)?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}async function mr(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function hr(e){return e!=null&&typeof e.page==`string`}function gr(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 _r(e,t,n){return Sr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await mr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(gr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function vr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function yr(e,t,{includeHydrateFallback:n}={}){return br(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function br(e){return[...new Set(e)]}function xr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Sr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!hr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(xr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Cr={};function wr(e,t){!e&&!Cr[t]&&(Cr[t]=!0,console.warn(t))}var Tr=w.createContext(void 0);Tr.displayName=`FrameworkContext`;function Er(){let e=w.useContext(Tr);return fr(e,`You must render this element inside a <HydratedRouter> element`),e}function Dr(e,t){let n=w.useContext(Tr),[r,i]=w.useState(!1),[a,o]=w.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=w.useRef(null);w.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),w.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Or(s,p),onBlur:Or(c,m),onMouseEnter:Or(l,p),onMouseLeave:Or(u,m),onTouchStart:Or(d,p)}]:[a,f,{}]:[!1,f,{}]}function Or(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function kr({page:e,...t}){let n=Tn(),{nonce:r}=Er(),{router:i}=nr(`PrefetchPageLinks`),a=w.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?w.createElement(jr,{page:e,matches:a,...t}):w.createElement(Mr,{page:e,matches:a,...t})):null}function Ar(e){let{manifest:t,routeModules:n}=Er(),[r,i]=w.useState([]);return w.useEffect(()=>{let r=!1;return _r(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function jr({page:e,matches:t,...n}){let r=$(),{unstable_apiServerOrigin:i}=Er(),a=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=pr(e,`rsc`,i),a=!1,o=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?a=!0:o.push(e.route.id);return a&&o.length>0&&n.searchParams.set(`_routes`,o.join(`,`)),[i?n.toString():n.pathname+n.search]},[e,r,t,i]);return w.createElement(w.Fragment,null,a.map(e=>w.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Mr({page:e,matches:t,...n}){let r=$(),{manifest:i,routeModules:a,unstable_apiServerOrigin:o}=Er(),{matches:s}=rr(`PrefetchPageLinks`),{loaderData:c}=ir(`PrefetchPageLinks`),l=w.useMemo(()=>vr(e,t,s,i,r,`data`),[e,t,s,i,r]),u=w.useMemo(()=>vr(e,t,s,i,r,`assets`),[e,t,s,i,r]),d=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!l.some(t=>t.route.id===e.route.id)&&e.route.id in c&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=pr(e,`data`,o);return s&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[o?u.toString():u.pathname+u.search]},[c,r,i,l,t,e,a,o]),f=w.useMemo(()=>yr(u,i),[u,i]),p=Ar(u);return w.createElement(w.Fragment,null,d.map(e=>w.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),f.map(e=>w.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),p.map(({key:e,link:t})=>w.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Nr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Pr=[`HydrateFallback`,`hydrateFallbackElement`],Fr=class{status=`pending`;promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ir(e,t){e.ready.catch(e=>{if(!(t.visibilityState===`hidden`||typeof e==`object`&&e&&`name`in e&&e.name===`AbortError`))throw e})}function Lr({router:e,flushSync:t,onError:n,useTransitions:r}){r=Tn()||r;let[i,a]=w.useState(e.state),[o,s]=(0,w.useOptimistic)(i),c=w.useRef(o),[l,u]=w.useState(),[d,f]=w.useState({isTransitioning:!1}),[p,m]=w.useState(),[h,g]=w.useState(),[_,v]=w.useState(),y=w.useRef(new Map),b=w.useRef(new WeakSet),x=w.useCallback((i,{deletedFetchers:o,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{c.current=i,l&&i.errors&&st.has(i.errors)&&(b.current.has(i.errors)?l=null:b.current.add(i.errors)),l&&n&&Object.values(l).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Ae(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),wr(d===!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 x=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(wr(_==null||x,"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."),!_||!x)t&&d?t(()=>a(i)):r===!1?a(i):w.startTransition(()=>{r===!0&&s(e=>Rr(e,i)),a(i)});else if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});Ir(n,e.window.document),n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n))}else h?(p?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(i),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,s,n]);w.useLayoutEffect(()=>e.subscribe(x),[e,x]),w.useLayoutEffect(()=>{let t=e.state.errors,n=t?st.get(t):null;(c.current!==e.state||t&&n&&!b.current.has(t))&&x(e.state,{deletedFetchers:[],flushSync:!1,newErrors:n??null})},[e,x]),w.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new Fr)},[d]),w.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):w.startTransition(()=>{r===!0&&s(e=>Rr(e,t)),a(t)}),await n});Ir(i,e.window.document),i.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(i)}},[l,p,e.window,r,s]),w.useEffect(()=>{p&&l&&o.location.key===l.location.key&&p.resolve()},[p,h,o.location,l]),w.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let S=w.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),C=e.basename||`/`,T=w.useMemo(()=>({router:e,navigator:S,static:!1,basename:C,onError:n}),[e,S,C,n]),E=w.useMemo(()=>({historyAction:o.historyAction,location:o.location,matches:o.matches,initialized:o.initialized,renderFallback:o.renderFallback,restoreScrollPosition:o.restoreScrollPosition,preventScrollReset:o.preventScrollReset,blockers:o.blockers}),[o.historyAction,o.location,o.matches,o.initialized,o.renderFallback,o.restoreScrollPosition,o.preventScrollReset,o.blockers]),D=w.useMemo(()=>({navigation:o.navigation,revalidation:o.revalidation}),[o.navigation,o.revalidation]),O=w.useMemo(()=>({loaderData:o.loaderData,actionData:o.actionData,errors:o.errors}),[o.loaderData,o.actionData,o.errors]),ee=w.useMemo(()=>({fetchers:o.fetchers,fetcherData:y.current}),[o.fetchers]);return w.createElement(w.Fragment,null,w.createElement(bn.Provider,{value:T},w.createElement(xn.Provider,{value:E},w.createElement(Cn.Provider,{value:D},w.createElement(Sn.Provider,{value:O},w.createElement(Dn.Provider,{value:ee},w.createElement(En.Provider,{value:d},w.createElement(Ur,{basename:C,location:o.location,navigationType:o.historyAction,navigator:S,useTransitions:r},w.createElement(zr,{routes:e.routes,manifest:e.manifest,state:o,isStatic:!1,onError:n})))))))),null)}function Rr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var zr=w.memo(Br);function Br({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=w.useContext(bn);l(a,`You must render this element inside a <DataRouterContext.Provider> element`);let o=w.useContext(Tr)?.routeDiscoveryRuntime;return w.useEffect(()=>{n.initialized&&o?.markReady()},[n.initialized,o]),qn(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function Vr({to:e,replace:t,state:n,relative:r}){l(Bn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=w.useContext(Q);u(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=w.useContext(An),{pathname:s}=$(),c=Hn(),d=xe(e,W(o),s,r===`path`);C(typeof e==`string`?e:m(e),a.createHref(d),y(a),`reject`);let f=JSON.stringify(d);return w.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function Hr(e){l(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ur({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){l(!Bn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=w.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=h(n));let{pathname:d=`/`,search:f=``,hash:p=``,state:m=null,key:g=`default`,mask:_}=n,v=w.useMemo(()=>{let e=U(d,s);return e==null?null:{location:{pathname:e,search:f,hash:p,state:m,key:g,mask:_},navigationType:r}},[s,d,f,p,m,g,r,_]);return u(v!=null,`<Router basename="${s}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:w.createElement(Q.Provider,{value:c},w.createElement(kn.Provider,{children:t,value:v}))}function Wr({children:e,location:t}){return Kn(Gr(e),t)}w.Component;function Gr(e,t=[]){let n=[];return w.Children.forEach(e,(e,r)=>{if(!w.isValidElement(e))return;let i=[...t,r];if(e.type===w.Fragment){n.push.apply(n,Gr(e.props.children,i));return}l(e.type===Hr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;l(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=Gr(a.children,i)),n.push(o)}),n}var Kr=`application/x-www-form-urlencoded`;function qr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Jr(e){return qr(e)&&e.tagName.toLowerCase()===`button`}function Yr(e){return qr(e)&&e.tagName.toLowerCase()===`form`}function Xr(e){return qr(e)&&e.tagName.toLowerCase()===`input`}function Zr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qr(e,t){return e.button===0&&(!t||t===`_self`)&&!Zr(e)}function $r(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function ei(e,t){let n=$r(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var ti=null;function ni(){if(ti===null)try{new FormData(document.createElement(`form`),0),ti=!1}catch{ti=!0}return ti}var ri=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ii(e){return e!=null&&!ri.has(e)?(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kr}"`),null):e}function ai(e,t){if(t===`/`)return e;let n=h(e),r=U(n.pathname||``,t);return r==null?null:m({...n,pathname:r})}function oi(e,t){let n,r,i,a,o;if(Yr(e)){let o=e.getAttribute(`action`);r=o?ai(o,t):null,n=e.getAttribute(`method`)||`get`,i=ii(e.getAttribute(`enctype`))||Kr,a=new FormData(e)}else if(Jr(e)||Xr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ai(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=ii(e.getAttribute(`formenctype`))||ii(o.getAttribute(`enctype`))||Kr,a=new FormData(o,e),!ni()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(qr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Kr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var si=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{si&&(window.__reactRouterVersion=`8`)}catch{}function ci(e,t){return ct({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:s({window:t?.window}),hydrationData:t?.hydrationData||ui(),routes:e,mapRouteProperties:j,hydrationRouteProperties:Pr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function li(e,t){return ct({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:c({window:t?.window}),hydrationData:t?.hydrationData||ui(),routes:e,mapRouteProperties:j,hydrationRouteProperties:Pr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ui(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:di(e.errors)}),e}function di(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Oe(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&De.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var fi=w.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=w.useContext(Q),y=typeof u==`string`&&n.test(u),b=Ne(u,g);u=b.to;let x=zn(u,{relative:i}),C=$(),T=null;if(s){let e=xe(s,[],C.mask?C.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:G([g,e.pathname])),T=_.createHref(e)}let[E,D,O]=Dr(r,m),ee=hi(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function k(t){e&&e(t),t.defaultPrevented||ee(t)}let A=!(b.isExternal||a),j=(A?T:void 0)||b.absoluteURL||x;S(j);let M=w.createElement(`a`,{...m,...O,href:j,onClick:A?k:e,ref:Nr(h,D),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return E&&!y?w.createElement(w.Fragment,null,M,w.createElement(kr,{page:x})):M});fi.displayName=`Link`;var pi=w.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Gn(a,{relative:c.relative}),d=$(),f=w.useContext(Cn),{navigator:p,basename:m}=w.useContext(Q),h=f!=null&&xi(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=U(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(y)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,T;T=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(S):i;return w.createElement(fi,{...c,"aria-current":C,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(S):s)});pi.displayName=`NavLink`;var mi=w.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=`get`,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=w.useContext(Q),_=yi(),v=bi(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&n.test(c);return w.createElement(`form`,{ref:h,method:y,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,i=n?.getAttribute(`formmethod`)||s,c=()=>_(n||e.currentTarget,{fetcherKey:t,method:i,navigate:r,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&r!==!1?w.startTransition(()=>c()):c()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});mi.displayName=`Form`;function hi(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Hn(),d=$(),f=Gn(e,{relative:o});return w.useCallback(p=>{if(Qr(p,t)){p.preventDefault();let t=n===void 0?m(d)===m(f):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?w.startTransition(()=>h()):h()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function gi(e){u(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=w.useRef($r(e)),n=w.useRef(!1),r=$(),i=w.useMemo(()=>ei(r.search,n.current?null:t.current),[r.search]),a=Hn();return[i,w.useCallback((e,t)=>{let r=$r(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var _i=0,vi=()=>`__${String(++_i)}__`;function yi(){let{router:e}=nr(`useSubmit`),{basename:t}=w.useContext(Q),n=ar(`useSubmit`),r=e.fetch,i=e.navigate;return w.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=oi(e,t);a.navigate===!1?await r(a.fetcherKey||vi(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function bi(e,{relative:t}={}){let{basename:n}=w.useContext(Q),r=w.useContext(An);l(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Gn(e||`.`,{relative:t})},o=$();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:G([n,a.pathname]));let s=m(a);return S(s),s}function xi(e,{relative:t}={}){let n=w.useContext(En);l(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=nr(`useViewTransitionState`),i=Gn(e,{relative:t});if(!n.isTransitioning)return!1;let a=U(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=U(n.nextLocation.pathname,r)||n.nextLocation.pathname;return V(i.pathname,o)!=null||V(i.pathname,a)!=null}export{Vr as a,Wr as c,Hn as d,Wn as f,gi as i,cr as l,ke as m,ci as n,Hr as o,or as p,li as r,Lr as s,fi as t,$ as u};
|