@airporting/integrations-app 0.4.30 → 0.4.32
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/README.md +74 -2
- package/dist/mf/{18.js → 1018.js} +3 -3
- package/dist/mf/{235.js → 1330.js} +2 -2
- package/dist/mf/1600.js +1 -0
- package/dist/mf/1857.js +1 -0
- package/dist/mf/{70.js → 2070.js} +3 -3
- package/dist/mf/3.js +1 -0
- package/dist/mf/{134.js → 3134.js} +2 -2
- package/dist/mf/{330.js → 3235.js} +2 -2
- package/dist/mf/{473.js → 3711.js} +2 -2
- package/dist/mf/4447.js +1 -0
- package/dist/mf/4756.js +18 -0
- package/dist/mf/4810.js +1 -0
- package/dist/mf/5475.js +1 -0
- package/dist/mf/{616.js → 5616.js} +2 -2
- package/dist/mf/5625.js +1 -0
- package/dist/mf/5741.js +1 -0
- package/dist/mf/6082.js +1 -0
- package/dist/mf/6092.js +10 -0
- package/dist/mf/6124.js +1 -0
- package/dist/mf/6702.js +1 -0
- package/dist/mf/7285.js +1 -0
- package/dist/mf/7286.js +10 -0
- package/dist/mf/7286.js.LICENSE.txt +9 -0
- package/dist/mf/7476.js +1 -0
- package/dist/mf/7493.js +6 -0
- package/dist/mf/7493.js.LICENSE.txt +13 -0
- package/dist/mf/8170.js +18 -0
- package/dist/mf/8473.js +10 -0
- package/dist/mf/{637.js → 8637.js} +3 -3
- package/dist/mf/8949.js +10 -0
- package/dist/mf/8978.js +33 -0
- package/dist/mf/{37.js → 9037.js} +3 -3
- package/dist/mf/9110.js +1 -0
- package/dist/mf/{755.js → 9430.js} +2 -2
- package/dist/mf/9666.js +10 -0
- package/dist/mf/9666.js.LICENSE.txt +9 -0
- package/dist/mf/9758.js +1 -0
- package/dist/mf/@mf-types/compiled-types/api/connectors/connectorAddMutation.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/connectors/connectorCatalogQuery.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/connectors/connectorDeleteMutation.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroDetailQuery.d.ts +2 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobConfigQuery.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobRunMutation.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroJobSaveMutation.d.ts +5 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroListQuery.d.ts +2 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroRunMutation.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroScheduleMutations.d.ts +21 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroSpreadsheetsQuery.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/synchroToggleMutation.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/api/synchro/types.d.ts +67 -0
- package/dist/mf/@mf-types/compiled-types/api/useApiSynchro.d.ts +6 -0
- package/dist/mf/@mf-types/compiled-types/components/InlineLoader.d.ts +4 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/connector-menu.component.d.ts +7 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/delete-active-connector-modal.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/is-delete-confirm-input.d.ts +6 -0
- package/dist/mf/@mf-types/compiled-types/components/connectors/list.catalog.component.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/inputs/InputDateBoundary.d.ts +12 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/inputs/InputGsheetsSelector.d.ts +11 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.dynamic-form.d.ts +29 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.functions.d.ts +7 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.history.d.ts +6 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.job-config-modal.d.ts +9 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.list.d.ts +8 -0
- package/dist/mf/@mf-types/compiled-types/components/synchro/synchro.schedule.d.ts +8 -0
- package/dist/mf/@mf-types/compiled-types/gen/IntegrationsApi.d.ts +120 -4
- package/dist/mf/@mf-types/compiled-types/hooks/useAppConfigConnectorSingle.d.ts +1 -1
- package/dist/mf/@mf-types/compiled-types/hooks/useAppConfigSynchro.d.ts +9 -0
- package/dist/mf/@mf-types/compiled-types/providersSynchro.d.ts +15 -0
- package/dist/mf/@mf-types/compiled-types/synchro.app.d.ts +1 -0
- package/dist/mf/@mf-types/compiled-types/synchro.d.ts +2 -0
- package/dist/mf/__federation_expose_connectors.js +2 -2
- package/dist/mf/__federation_expose_single_connector.js +2 -2
- package/dist/mf/__federation_expose_synchronisation.js +10 -0
- package/dist/mf/__federation_expose_synchronisation.js.LICENSE.txt +9 -0
- package/dist/mf/index.js +4 -5
- package/dist/mf/integrations_app.js +4 -5
- package/dist/mf/mf-manifest.json +155 -33
- package/dist/mf/mf-stats.json +212 -41
- package/package.json +13 -11
- package/dist/mf/124.js +0 -1
- package/dist/mf/170.js +0 -18
- package/dist/mf/285.js +0 -1
- package/dist/mf/447.js +0 -1
- package/dist/mf/475.js +0 -1
- package/dist/mf/476.js +0 -1
- package/dist/mf/49.js +0 -1
- package/dist/mf/625.js +0 -1
- package/dist/mf/666.js +0 -10
- package/dist/mf/702.js +0 -1
- package/dist/mf/711.js +0 -10
- package/dist/mf/741.js +0 -1
- package/dist/mf/756.js +0 -18
- package/dist/mf/857.js +0 -1
- package/dist/mf/949.js +0 -10
- package/dist/mf/978.js +0 -33
- package/dist/mf/@mf-types/connectors.d.ts +0 -2
- package/dist/mf/@mf-types/single-connector.d.ts +0 -2
- package/dist/mf/@mf-types.d.ts +0 -3
- package/dist/mf/@mf-types.zip +0 -0
- /package/dist/mf/{18.js.LICENSE.txt → 1018.js.LICENSE.txt} +0 -0
- /package/dist/mf/{235.js.LICENSE.txt → 1330.js.LICENSE.txt} +0 -0
- /package/dist/mf/{70.css → 2070.css} +0 -0
- /package/dist/mf/{70.js.LICENSE.txt → 2070.js.LICENSE.txt} +0 -0
- /package/dist/mf/{134.js.LICENSE.txt → 3134.js.LICENSE.txt} +0 -0
- /package/dist/mf/{330.js.LICENSE.txt → 3235.js.LICENSE.txt} +0 -0
- /package/dist/mf/{473.js.LICENSE.txt → 3711.js.LICENSE.txt} +0 -0
- /package/dist/mf/{756.js.LICENSE.txt → 4756.js.LICENSE.txt} +0 -0
- /package/dist/mf/{616.js.LICENSE.txt → 5616.js.LICENSE.txt} +0 -0
- /package/dist/mf/{666.js.LICENSE.txt → 6092.js.LICENSE.txt} +0 -0
- /package/dist/mf/{170.js.LICENSE.txt → 8170.js.LICENSE.txt} +0 -0
- /package/dist/mf/{711.js.LICENSE.txt → 8473.js.LICENSE.txt} +0 -0
- /package/dist/mf/{637.js.LICENSE.txt → 8637.js.LICENSE.txt} +0 -0
- /package/dist/mf/{949.js.LICENSE.txt → 8949.js.LICENSE.txt} +0 -0
- /package/dist/mf/{978.js.LICENSE.txt → 8978.js.LICENSE.txt} +0 -0
- /package/dist/mf/{37.js.LICENSE.txt → 9037.js.LICENSE.txt} +0 -0
package/dist/mf/741.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["741"],{2348:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{AirButton:()=>AirButton,BankAccountsChart:()=>BankAccountsChart,BankAccountsChartTooltip:()=>BankAccountsChartTooltip,BlurSpot:()=>BlurSpot,COLORS_EMOJI:()=>COLORS_EMOJI,Circle:()=>Circle,CompanyLogo:()=>CompanyLogo,CompanySelector:()=>CompanySelector,DynamicForm:()=>DynamicForm,Field:()=>Field,IconArrowUp:()=>IconArrowUp,IconCalculator:()=>IconCalculator,IconCheck:()=>IconCheck,IconCoin:()=>IconCoin,IconConnector:()=>IconConnector,IconCross:()=>IconCross,IconDashboard:()=>IconDashboard,IconDoubleLeft:()=>IconDoubleLeft,IconExternalLink:()=>IconExternalLink,IconLogOut:()=>IconLogOut,IconLogo:()=>IconLogo,IconRepeat:()=>IconRepeat,IconStar:()=>IconStar,KPICard:()=>KPICard,KPICardBankAccountsChart:()=>KPICardBankAccountsChart,LanguageSwitcher:()=>LanguageSwitcher,Logo:()=>Logo,PillTrend:()=>PillTrend,RxState:()=>RxState,SearchBox:()=>SearchBox,THEME_COLORS:()=>THEME_COLORS,ZIndex:()=>zIndex_ZIndex,cssVarResolver:()=>cssVarResolver,formatCurrency:()=>formatCurrency,formatCurrencyCompact:()=>formatCurrencyCompact,formatDateLocale:()=>formatDateLocale,formatPercent:()=>formatPercent,getLocaleDateFormat:()=>getLocaleDateFormat,isoday:()=>isoday,nbhy:()=>nbhy,parseDateFr:()=>parseDateFr,parseDateLocale:()=>parseDateLocale,theme:()=>theme_theme,useRxState:()=>useRxState,useRxStateDebounced:()=>useRxStateDebounced,useRxStateOr:()=>useRxStateOr});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9389);var _tanstack_react_router__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(63);var _mantine_charts__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1445);var date_fns__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(467);var lodash_es__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1084);var radash__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(2425);var react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(3620);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(3128);var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(6022);var _mantine_hooks__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(207);var _mantine_form__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(1599);var react_i18next__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(8510);function Circle({style,size,...rest}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{radius:"50%",bg:"dark.4",w:size,h:size,style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"center",...style},...rest})}function IconArrowUp({color="currentColor",size=24,rotate=0,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:`rotate(${rotate})`,...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 13.5L12 10.5L15 13.5",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconCalculator({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"4",y:"2",width:"16",height:"19",rx:"1",stroke:color,strokeWidth:"1.5"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7",y:"6",width:"10",height:"4",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7.5",y:"12.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"11.5",y:"12.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"15.5",y:"12.5",width:"1",height:"5",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"11.5",y:"16.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7.5",y:"16.5",width:"1",height:"1",stroke:color})]})}function IconCheck({color="currentColor",size=16,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",stroke:color,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M13.3346 4L6.0013 11.3333L2.66797 8",strokeWidth:"1.25",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconCoin({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ellipse",{cx:"12.0004",cy:"9.72212",rx:"10.0004",ry:"3.33345",stroke:color,strokeWidth:"1.5"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M12.0004 18.6119C9.94456 18.6119 8.03366 18.4051 6.4446 18.0505M12.0004 18.6119V13.0561M12.0004 18.6119C14.0561 18.6119 15.9671 18.4051 17.5561 18.0505M2 9.72266V15.2784C2 16.4342 3.76454 17.4525 6.4446 18.0505M22.0007 9.72266V15.2784C22.0007 16.4342 20.2362 17.4525 17.5561 18.0505M6.4446 11.945V18.0505M17.5561 12.5005L17.5561 18.0505",stroke:color,strokeWidth:"1.5"})]})}function IconConnector({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g",{clipPath:"url(#clip0_2605_1876)",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.3688 0.797175C19.6952 -0.195659 21.5754 0.0747827 22.5682 1.40122C23.5611 2.72767 23.2906 4.60781 21.9642 5.60064C20.9814 6.33624 19.6947 6.37837 18.6901 5.81135L13.2118 10.3012C13.7118 11.0797 14.0019 12.0059 14.0019 12.9999C14.0019 13.77 13.8278 14.4994 13.5168 15.151L16.0949 17.8695C17.2392 17.3161 18.6561 17.5353 19.5775 18.5069C20.7177 19.7091 20.6673 21.6079 19.4651 22.748C18.2629 23.8882 16.3641 23.8378 15.224 22.6356C14.348 21.712 14.1748 20.3771 14.6867 19.291L12.2915 16.7654C11.4123 17.5341 10.2615 17.9999 9.00189 17.9999C6.24046 17.9999 4.00189 15.7613 4.00189 12.9999C4.00189 11.5656 4.60582 10.2723 5.57327 9.36057L4.35098 6.87732C3.01379 7.07665 1.6641 6.34735 1.13207 5.03948C0.507758 3.50476 1.24579 1.7545 2.78052 1.13019C4.31525 0.50587 6.06551 1.24391 6.68982 2.77864C7.14163 3.8893 6.87995 5.11283 6.11916 5.94081L7.28211 8.30351C7.81835 8.10709 8.3976 7.99989 9.00189 7.99989C10.0434 7.99989 11.0105 8.31833 11.8112 8.86316L17.376 4.30245C16.8897 3.0748 17.2609 1.62646 18.3688 0.797175ZM9.00189 15.9999C10.6587 15.9999 12.0019 14.6567 12.0019 12.9999C12.0019 11.343 10.6587 9.99989 9.00189 9.99989C7.34503 9.99989 6.00189 11.343 6.00189 12.9999C6.00189 14.6567 7.34503 15.9999 9.00189 15.9999Z",fill:color})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs",{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("clipPath",{id:"clip0_2605_1876",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]})}function IconCross({color="currentColor",size=16,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",stroke:color,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M4 4L12 12M12 4L4 12",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function IconDashboard({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3Z",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M3 9H21",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 21V9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconDoubleLeft({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M11 15L8 12L11 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M16 15L13 12L16 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})]})}function IconExternalLink({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M10 9L15 9M15 9L15 14M15 9L9 15",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconLogo(props){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:"88",height:"19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M0.038 14L4.883 0.699999H7.904L12.768 14H9.956L5.852 2.144H6.935L2.831 14H0.038ZM2.28 11.017L2.983 8.946H9.823L10.526 11.017H2.28ZM13.4867 14V4.576H16.1467V14H13.4867ZM13.6007 3.075V0.604999H16.0707V3.075H13.6007ZM17.5131 14V4.576H20.1731V6.001C20.4264 5.53233 20.7431 5.165 21.1231 4.899C21.5031 4.62033 21.9338 4.481 22.4151 4.481H23.5741V6.837H22.1491C21.6804 6.837 21.3004 6.95733 21.0091 7.198C20.7178 7.43867 20.5024 7.79967 20.3631 8.281C20.2364 8.74967 20.1731 9.326 20.1731 10.01V14H17.5131ZM24.7874 18.18V4.576H27.4474V5.868C27.7514 5.46267 28.1441 5.108 28.6254 4.804C29.1194 4.5 29.7528 4.348 30.5254 4.348C31.3994 4.348 32.1848 4.56333 32.8814 4.994C33.5781 5.42467 34.1291 6.01367 34.5344 6.761C34.9398 7.50833 35.1424 8.357 35.1424 9.307C35.1424 10.2443 34.9398 11.0867 34.5344 11.834C34.1291 12.5813 33.5781 13.1703 32.8814 13.601C32.1848 14.019 31.3994 14.228 30.5254 14.228C29.8288 14.228 29.2208 14.1013 28.7014 13.848C28.1948 13.5947 27.7768 13.24 27.4474 12.784V18.18H24.7874ZM29.8984 11.91C30.3924 11.91 30.8294 11.796 31.2094 11.568C31.6021 11.34 31.9061 11.0297 32.1214 10.637C32.3368 10.2443 32.4444 9.801 32.4444 9.307C32.4444 8.80033 32.3368 8.35067 32.1214 7.958C31.9061 7.55267 31.6021 7.236 31.2094 7.008C30.8294 6.78 30.3924 6.666 29.8984 6.666C29.4044 6.666 28.9674 6.78 28.5874 7.008C28.2074 7.236 27.9098 7.54633 27.6944 7.939C27.4791 8.33167 27.3714 8.78133 27.3714 9.288C27.3714 9.79467 27.4791 10.2443 27.6944 10.637C27.9098 11.0297 28.2074 11.34 28.5874 11.568C28.9674 11.796 29.4044 11.91 29.8984 11.91ZM40.9671 14.228C40.0171 14.228 39.1558 14.019 38.3831 13.601C37.6231 13.183 37.0151 12.6003 36.5591 11.853C36.1158 11.1057 35.8941 10.2507 35.8941 9.288C35.8941 8.31267 36.1158 7.45767 36.5591 6.723C37.0151 5.97567 37.6295 5.393 38.4021 4.975C39.1748 4.557 40.0298 4.348 40.9671 4.348C41.9171 4.348 42.7721 4.557 43.5321 4.975C44.3048 5.393 44.9128 5.97567 45.3561 6.723C45.8121 7.45767 46.0401 8.31267 46.0401 9.288C46.0401 10.2507 45.8121 11.1057 45.3561 11.853C44.9128 12.6003 44.3048 13.183 43.5321 13.601C42.7721 14.019 41.9171 14.228 40.9671 14.228ZM40.9671 11.929C41.3978 11.929 41.7905 11.834 42.1451 11.644C42.4998 11.4413 42.7785 11.1437 42.9811 10.751C43.1965 10.3583 43.3041 9.87067 43.3041 9.288C43.3041 8.70533 43.1965 8.21767 42.9811 7.825C42.7658 7.43233 42.4808 7.141 42.1261 6.951C41.7841 6.74833 41.4041 6.647 40.9861 6.647C40.5555 6.647 40.1628 6.74833 39.8081 6.951C39.4535 7.141 39.1685 7.43233 38.9531 7.825C38.7378 8.205 38.6301 8.69267 38.6301 9.288C38.6301 9.87067 38.7315 10.3583 38.9341 10.751C39.1495 11.1437 39.4345 11.4413 39.7891 11.644C40.1438 11.834 40.5365 11.929 40.9671 11.929ZM47.1264 14V4.576H49.7864V6.001C50.0397 5.53233 50.3564 5.165 50.7364 4.899C51.1164 4.62033 51.547 4.481 52.0284 4.481H53.1874V6.837H51.7624C51.2937 6.837 50.9137 6.95733 50.6224 7.198C50.331 7.43867 50.1157 7.79967 49.9764 8.281C49.8497 8.74967 49.7864 9.326 49.7864 10.01V14H47.1264ZM58.3717 14C57.713 14 57.1557 13.924 56.6997 13.772C56.2564 13.62 55.9207 13.3287 55.6927 12.898C55.4647 12.4547 55.3507 11.8213 55.3507 10.998V6.799H53.7357V4.576H55.3507V1.992H58.0107V4.576H60.3287V6.799H58.0107V10.675C58.0107 10.9663 58.0424 11.188 58.1057 11.34C58.169 11.492 58.283 11.5997 58.4477 11.663C58.625 11.7137 58.8594 11.739 59.1507 11.739H60.2717V14H58.3717ZM61.1166 14V4.576H63.7766V14H61.1166ZM61.2306 3.075V0.604999H63.7006V3.075H61.2306ZM65.143 14V4.576H67.803V5.963C68.107 5.469 68.5187 5.07633 69.038 4.785C69.57 4.49367 70.1907 4.348 70.9 4.348C72.0907 4.348 73.0027 4.728 73.636 5.488C74.2693 6.23533 74.586 7.31833 74.586 8.737V14H71.926V8.984C71.926 8.21133 71.7677 7.62233 71.451 7.217C71.147 6.799 70.6593 6.59 69.988 6.59C69.3547 6.59 68.829 6.818 68.411 7.274C68.0057 7.71733 67.803 8.338 67.803 9.136V14H65.143ZM81.2614 18.408C80.4634 18.408 79.6907 18.275 78.9434 18.009C78.2087 17.7557 77.5817 17.344 77.0624 16.774C76.543 16.204 76.2327 15.463 76.1314 14.551H78.7724C78.8737 15.0323 79.146 15.4123 79.5894 15.691C80.0454 15.9697 80.5837 16.109 81.2044 16.109C81.6477 16.109 82.0594 16.014 82.4394 15.824C82.8194 15.6467 83.1234 15.368 83.3514 14.988C83.5794 14.6207 83.6934 14.1457 83.6934 13.563V12.423C83.5034 12.7143 83.2627 12.9803 82.9714 13.221C82.68 13.4617 82.3317 13.658 81.9264 13.81C81.5337 13.9493 81.0777 14.019 80.5584 14.019C79.659 14.019 78.8484 13.81 78.1264 13.392C77.417 12.9613 76.8534 12.3787 76.4354 11.644C76.03 10.9093 75.8274 10.086 75.8274 9.174C75.8274 8.262 76.03 7.445 76.4354 6.723C76.8534 5.98833 77.417 5.412 78.1264 4.994C78.8484 4.56333 79.659 4.348 80.5584 4.348C81.255 4.348 81.8694 4.48733 82.4014 4.766C82.946 5.04467 83.3767 5.393 83.6934 5.811V4.576H86.3534V13.411C86.3534 14.513 86.119 15.4313 85.6504 16.166C85.1817 16.9133 84.561 17.4707 83.7884 17.838C83.0157 18.218 82.1734 18.408 81.2614 18.408ZM81.1094 11.72C81.6287 11.72 82.0784 11.606 82.4584 11.378C82.8384 11.15 83.136 10.846 83.3514 10.466C83.5667 10.086 83.6744 9.66167 83.6744 9.193C83.6744 8.71167 83.5667 8.281 83.3514 7.901C83.136 7.521 82.8384 7.22333 82.4584 7.008C82.0784 6.78 81.6287 6.666 81.1094 6.666C80.6027 6.666 80.153 6.78 79.7604 7.008C79.3804 7.22333 79.0827 7.521 78.8674 7.901C78.652 8.26833 78.5444 8.69267 78.5444 9.174C78.5444 9.64267 78.652 10.0733 78.8674 10.466C79.0827 10.846 79.3804 11.15 79.7604 11.378C80.153 11.606 80.6027 11.72 81.1094 11.72Z",fill:"#F3F3F3"})})}function IconLogOut({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M16 17L21 12L16 7",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M21 12H9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconRepeat({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M15 1L20 5L15 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M4 11V9C4 7.93913 4.3746 6.92172 5.0414 6.17157C5.70819 5.42143 6.61256 5 7.55556 5H20",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 23L4 19L9 15",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M20 13V15C20 16.0609 19.6254 17.0783 18.9586 17.8284C18.2918 18.5786 17.3874 19 16.4444 19H4",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconStar({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M17.0178 1.76042C17.1521 1.26989 17.8479 1.26989 17.9822 1.76042L18.4798 3.57689C18.5237 3.73719 18.6444 3.86519 18.8019 3.91844L20.5994 4.52635C21.0525 4.67958 21.0525 5.32042 20.5994 5.47365L18.8019 6.08156C18.6444 6.13481 18.5237 6.26281 18.4798 6.42311L17.9822 8.23958C17.8479 8.73011 17.1521 8.73011 17.0178 8.23958L16.5202 6.42311C16.4763 6.26281 16.3556 6.13481 16.1981 6.08156L14.4006 5.47365C13.9475 5.32042 13.9475 4.67958 14.4006 4.52635L16.1981 3.91844C16.3556 3.86519 16.4763 3.73719 16.5202 3.57689L17.0178 1.76042Z",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9.83203 3.12891L11.7554 10.4793L18.332 12.6289L11.7554 14.7785L9.83203 22.1289L7.9087 14.7785L1.33203 12.6289L7.9087 10.4793L9.83203 3.12891Z",stroke:color,strokeWidth:"1.5",strokeLinejoin:"round"})]})}function AirButton({children,onClick,rightSection,...rest}){const navigate=(0,_tanstack_react_router__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();const href="href"in rest?rest.href:void 0;const target="target"in rest?rest.target:void 0;const to="to"in rest?rest.to:void 0;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"md",justify:"start",styles:{label:{flex:1}},rightSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[rightSection,href&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle,{bg:"dark.4",size:24,ml:"auto",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconExternalLink,{})})]}),onClick:e=>{onClick?.(e);if(href)open(href,target??"_blank");if(to)navigate({to})},...rest,children:children})}const THEME_COLORS=["green","blue","yellow","pink","cyan","orange","grape","teal"];const COLORS_EMOJI={red:"\uD83D\uDD34",orange:"\uD83D\uDFE0",yellow:"\uD83D\uDFE1",green:"\uD83D\uDFE2",blue:"\uD83D\uDD35",purple:"\uD83D\uDFE3",brown:"\uD83D\uDFE4"};function formatDateLocale(date,opts){if(!date)return null;return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.intlFormat)(date,{month:"2-digit",day:"2-digit",year:"numeric",...opts},{locale:"fr"})}function getLocaleDateFormat(locale){const getPatternForPart=part=>{switch(part.type){case"day":return"d".repeat(part.value.length);case"month":return"M".repeat(part.value.length);case"year":return"y".repeat(part.value.length);case"literal":return part.value}};return new Intl.DateTimeFormat(locale).formatToParts(new Date("2022-01-02")).map(getPatternForPart).join("")}function isoday(date){if(!date)return null;if(date instanceof Date&&isNaN(date.getTime()))return null;return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatISO)(date,{representation:"date"})}function parseDateFr(date){return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.parse)(date,"dd/MM/yyyy",new Date)}function parseDateLocale(date){if(!date)return null;const res=(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.parse)(date,getLocaleDateFormat("fr"),new Date);if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isValid)(res))return null;return res}var _computedKey,_computedKey1;_computedKey=0,_computedKey1=1;class RxState extends Array{[_computedKey];[_computedKey1];constructor(value,dispatch){super();this[0]=value;this[1]=dispatch}get value(){return this[0]}get dispatch(){return this[1]}set value(value){this.dispatch(value)}}function useRxState(value){const state=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(value);return new RxState(state[0],state[1])}function useRxStateDebounced(from,delay=300){const debounced=useRxState(from.value);const handler=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(handler.current)clearTimeout(handler.current);handler.current=setTimeout(()=>{from.value=debounced.value},delay);return()=>{if(handler.current)clearTimeout(handler.current)}},[debounced.value,delay]);return debounced}function useRxStateOr(state,or){const fallbackValue=useRxState(or);const fallback=or instanceof RxState?or:fallbackValue;return state??fallback}function nbhy(){return String.fromCharCode(8209)}function formatCurrency(value,opts){const formatted=new Intl.NumberFormat(navigator.language,{style:"currency",currency:"eur",signDisplay:"exceptZero",...opts}).format(value);return formatted.replaceAll("-",nbhy())}function formatCurrencyCompact(value,opts){return formatCurrency(value,{maximumFractionDigits:Math.abs(Number(value))>1e6||Math.abs(Number(value))<1e4?2:Math.abs(Number(value))<1e5?1:0,notation:"compact",...opts})}function formatPercent(value,opts){const formatted=new Intl.NumberFormat(navigator.language,{style:"percent",signDisplay:"exceptZero",...opts}).format(value);return formatted.replaceAll("-",nbhy())}var zIndex_ZIndex=/*#__PURE__*/function(ZIndex){ZIndex[ZIndex["TableHeader"]=1]="TableHeader";ZIndex[ZIndex["TableScrollbar"]=2]="TableScrollbar";ZIndex[ZIndex["ChartTooltip"]=3]="ChartTooltip";ZIndex[ZIndex["Loader"]=9999]="Loader";return ZIndex}({});const BankAccountsChartTooltip=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)((props,ref)=>{const{balance,accounts,detailed}=props;const themed=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const d=isoday(parseDateLocale(balance.date));return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{p:"xs",withBorder:true,shadow:"md",radius:"md",style:{maxHeight:600,overflow:"auto",filter:"drop-shadow(0 0 2px rgba(0, 0, 0, 0.5))",backdropFilter:"blur(6px)"},ref:ref,bg:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(themed.colors.dark[9],.3),children:[(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isAfter)(d,new Date)?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:10,c:"dimmed",children:"pr\xe9visionnel"}):null,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",gap:4,mb:10,align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:14,fw:"bold",children:balance.date}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:14,fw:"bolder",c:balance.accounts.total>=0?"green":"red",children:formatCurrencyCompact(balance.accounts.total)})]}),detailed?Object.entries(balance.accounts).filter(([accountId,amount])=>"total"!=accountId&&0!=amount).map(([accountId,amount],i)=>{const account=accounts[accountId];if(!account)return;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{mb:5,align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle,{bg:themed.colors[THEME_COLORS[(i+1)%THEME_COLORS.length]][9],size:10}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:account.display_name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:12,ml:"auto",children:formatCurrencyCompact(amount)})]},accountId)}):null]})});function BankAccountsChart(props){const{hovered:hoveredProps,showIndividualBalances,showReferenceLines="hover",showToday,legend,detail,xAxisProps,accounts,...rest}=props;const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const hovered=useRxStateDebounced(useRxStateOr(hoveredProps,null),200);const tooltipref=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);const data=(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>{const all=[];for(const[name,data]of(0,lodash_es__WEBPACK_IMPORTED_MODULE_5__.entries)(accounts)){const d=data;for(const[day,balance]of Object.entries(d.balance)){const date=formatDateLocale(day);let existing=all.find(x=>x.date===date);if(!existing){existing={date,label:new Date(isoday(day)).getTime(),accounts:{total:0,unassigned:0}};all.push(existing)}existing.accounts[name]=balance.amount;if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isBefore)(day,(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.startOfDay)(new Date)))existing.accounts.total_future=existing.accounts.total;if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isAfter)(day,new Date))existing.accounts.total_past=existing.accounts.total}}return all},[accounts]);const{low,high}=(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>{const values=[...Object.values(data).map(x=>x.accounts.total)];let low=(0,radash__WEBPACK_IMPORTED_MODULE_6__.min)(values)??0;low=low>0?.9*low:1.1*low;let high=(0,radash__WEBPACK_IMPORTED_MODULE_6__.max)(values)??0;high=high>0?1.05*high:.9*high;return{low,high}},[data.length]);return(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_charts__WEBPACK_IMPORTED_MODULE_3__.AreaChart,{data:data,dataKey:"label",xAxisProps:{tickFormatter:value=>(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatDate)(new Date(value),"dd/MM"),...xAxisProps},strokeWidth:2,dotProps:{r:0,strokeWidth:1},activeDotProps:{r:3,strokeWidth:1},withXAxis:"high"==detail,withYAxis:true,gridAxis:"x",yAxisProps:high&&low?{allowDataOverflow:true,domain:[low,high]}:void 0,series:showIndividualBalances?Object.values(accounts).filter(x=>"total"!=x.accountId).map(x=>({name:"accounts."+x.accountId,color:THEME_COLORS[Object.values(accounts).indexOf(x)%THEME_COLORS.length],label:x.display_name})):[{name:"accounts.total_past",color:theme.primaryColor,label:"Solde"},{name:"accounts.total_future",color:theme.primaryColor,label:"Solde",strokeDasharray:"3 5"}],connectNulls:false,withLegend:legend,legendProps:{verticalAlign:"bottom"},curveType:"bump",type:"stacked",referenceLines:(0,radash__WEBPACK_IMPORTED_MODULE_6__.sift)([false!==showToday&&{x:new Date(isoday(new Date)).getTime(),color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors.blue[5],1),label:"auj."},...("hover"!=showReferenceLines||hovered.value)&&"never"!=showReferenceLines&&data.length?[...(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.eachMonthOfInterval)({start:parseDateLocale(data[0].date),end:parseDateLocale(data[data.length-1].date)}).map(x=>({x:new Date(isoday(x)).getTime(),color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors.gray[5],.3),label:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatDate)(x,"MMMM"),labelPosition:"top"}))]:[]]),withGradient:true,fillOpacity:.1,valueFormatter:value=>formatCurrency(value,{notation:"compact"}),tooltipAnimationDuration:100,tooltipProps:{wrapperStyle:{zIndex:zIndex_ZIndex.ChartTooltip},content:props=>{const balance=props.payload?.[0]?.payload??null;setTimeout(()=>hovered.value=balance,100);if(!balance)return null;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BankAccountsChartTooltip,{balance:balance,accounts:accounts,detailed:showIndividualBalances,ref:tooltipref})}},...rest}),[JSON.stringify(Object.keys(accounts)),showIndividualBalances,tooltipref,showReferenceLines,high,low,legend,detail])}function BlurSpot({pos="bottom"}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const spotStyle=options=>({position:"fixed",width:options.width??"800px",height:options.height??"800px",top:options.top,left:options.left,right:options.right,bottom:options.bottom,background:options.background??`radial-gradient(circle, ${theme.colors[theme.primaryColor][9]}, ${theme.colors[theme.primaryColor][6]} 50%, ${theme.colors[theme.primaryColor][9]})`,filter:`blur(${options.blur||150}px)`,transform:`rotate(${options.rotation||0}deg)`,pointerEvents:"none",zIndex:-1,opacity:options.opacity??.3});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{style:{position:"fixed",mixBlendMode:"screen"},children:["bottom"==pos&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"blur-spot",style:spotStyle({width:"700px",bottom:"-50%",left:"-10%",rotation:20})}),"top"==pos&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"blur-spot",style:spotStyle({width:"300px",top:"-50%",right:"15%",rotation:-20,opacity:.2})})]})}const Logo=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)(({url,...rest},ref)=>{const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Image,{ref:ref,src:url.includes("img.logo.dev")||url.includes("media.airporting")?url:getLogo(url),radius:12,fit:"contain",bd:`3px solid ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.white,.11)}`,w:20,style:{aspectRatio:1},...rest})});Logo.displayName="Logo";const getLogo=url=>`https://img.logo.dev/${url}?token=pk_BVN4OQv0Qs-bnqjdIgTppg`;const CompanyLogo=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)(({slug,...rest},ref)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Logo,{ref:ref,url:`https://s3.dualstack.eu-west-3.amazonaws.com/media.airporting/companies/${slug}.png`,fallbackSrc:"https://s3.dualstack.eu-west-3.amazonaws.com/media.airporting/companies/undefined.png",...rest}));CompanyLogo.displayName="CompanyLogo";class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&¶ms2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class AppApi{http;constructor(http){this.http=http}getStatus=(params={})=>this.http.request({path:"/status",method:"GET",...params});users={getMeV1:(params={})=>this.http.request({path:"/v1/users/me",method:"GET",secure:true,format:"json",...params}),forgotPasswordV1:(data,params={})=>this.http.request({path:"/v1/users/password/forgot",method:"POST",body:data,type:"application/json",...params}),resetPasswordV1:(data,params={})=>this.http.request({path:"/v1/users/password/reset",method:"POST",body:data,type:"application/json",...params})};chart={getCashBalanceAccountsV1:(query,params={})=>this.http.request({path:"/v1/chart/cash_balance/accounts",method:"GET",query:query,format:"json",...params})};dashboard={getDashboardV1:({companyId,...query},params={})=>this.http.request({path:`/v1/dashboard/${companyId}`,method:"GET",secure:true,format:"json",...params})};billing={getSepaV1:({acc,cid,...query},params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/sepa`,method:"GET",secure:true,format:"json",...params}),sepaSetupV1:({acc,cid,...query},data,params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/sepa/setup`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),getPortalV1:({acc,cid,...query},params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/portal`,method:"GET",query:query,secure:true,format:"json",...params})};auth={authCallbackCredentialsCreate:(data,params={})=>this.http.request({path:"/v1/auth/callback/credentials",method:"POST",body:data,type:"application/x-www-form-urlencoded",...params}),authCsrfList:(params={})=>this.http.request({path:"/v1/auth/csrf",method:"GET",format:"json",...params}),authSessionList:(params={})=>this.http.request({path:"/v1/auth/session",method:"GET",format:"json",...params}),authSignoutCreate:(data,params={})=>this.http.request({path:"/v1/auth/signout",method:"POST",body:data,type:"application/x-www-form-urlencoded",format:"json",...params})}}function useApi(){const client=new HttpClient({baseUrl:{MODE:"production",DEV:false,PROD:true,BASE_URL:"/",ASSET_PREFIX:"https://unpkg.com/@airporting/integrations-app@latest/dist/mf"}.PUBLIC_APP_API_URL,baseApiParams:{headers:{},credentials:"include"}});return new AppApi(client)}function useGetUsersMeQuery(){const api=useApi();const query=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_9__.useQuery)({queryKey:["users","me"],queryFn:async()=>{const res=await api.users.getMeV1().then(x=>x.data);if(res.user)localStorage.setItem("app:logged","1");return res}});return query}const Field=({prop,val})=>{if(!val)return null;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:[prop,":"]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{children:[" ",val]})]})};function SearchBox({children,values,selected,onChange,showDetails}){const[search,setSearch]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)("");const[preview,setPreview]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(selected??null);const itemElems=react__WEBPACK_IMPORTED_MODULE_7__.useRef(new Map);const scrollarea=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);const[popopen,setPopopen]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false);const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const filtered=values.filter(item=>item.label.toLowerCase().includes(search.toLowerCase().trim()));const options=filtered.map(item=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{ref:ref=>{if(ref)itemElems.current.set(item.value,ref)},variant:selected===item.value?"filled":preview===item.value?"light":"subtle",color:selected===item.value?theme.colors[theme.primaryColor][9]:"gray",size:"xs",justify:"start",onClick:()=>{clickItem(item.value)},onMouseEnter:()=>setPreview(item.value),children:item.label},item.value));function clickItem(value){onChange?.(value);setPreview(value);setPopopen(false)}(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setPreview(filtered[0]?.value)},[search]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(preview)focusItem(preview)},[preview]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setTimeout(()=>{if(preview)focusItem(preview)},200)},[popopen]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setPreview(selected??null)},[selected]);function focusItem(value){const item=itemElems.current.get(value);if(item&&scrollarea.current){if(item.offsetTop+item.offsetHeight>scrollarea.current.offsetHeight+scrollarea.current.scrollTop)scrollarea.current.scrollTo({top:item.offsetTop+item.offsetHeight-scrollarea.current.offsetHeight});if(item.offsetTop<scrollarea.current.scrollTop||item.offsetTop+item.offsetHeight>scrollarea.current.offsetHeight+scrollarea.current.scrollTop)scrollarea.current.scrollTo({top:item.offsetTop})}}const content=/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{align:"flex-start",wrap:"nowrap",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{value:search,onChange:event=>setSearch(event.currentTarget.value),placeholder:"Rechercher",autoFocus:true,onKeyDown:(0,_mantine_hooks__WEBPACK_IMPORTED_MODULE_10__.getHotkeyHandler)([["enter",()=>preview&&clickItem(preview)],["escape",()=>setSearch("")],["arrowUp",()=>setPreview(filtered[filtered.findIndex(x=>x.value===preview)-1]?.value)],["arrowDown",()=>setPreview(filtered[filtered.findIndex(x=>x.value===preview)+1]?.value)]])}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ScrollArea,{h:300,scrollbars:"y",type:"auto",viewportRef:scrollarea,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:0,children:options}),0===filtered.length&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",flex:1,ta:"center",children:"Aucun resultat"})]})]}),preview&&showDetails&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider,{orientation:"vertical"}),showDetails(preview)]})]});if(!children)return content;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover,{opened:popopen,onChange:setPopopen,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{onClick:()=>setPopopen(true),children:children})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.Dropdown,{children:content})]})}function CompanySelector({children,selected,onChange}){const me=useGetUsersMeQuery();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SearchBox,{values:me.data?.companies.map(c=>({label:c.display_name,value:c.id.toString()}))??[],selected:selected,onChange:onChange,showDetails:x=>{const comp=me.data?.companies.find(c=>c.id.toString()===x);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:4,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CompanyLogo,{slug:comp?.slug,w:48,mb:"md"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Nom",val:comp?.display_name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"SIREN",val:comp?.siren_number}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Dirigeant",val:comp?.leader}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Adresse",val:comp?.address})]})},children:children??/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{flex:1,size:"md",variant:"subtle",color:"gray",leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconRepeat,{}),justify:"start",children:"Changer d'entreprise"})})}function getHelpInputStyles(help){return{input:{borderBottomLeftRadius:help?0:10,borderBottomRightRadius:help?0:10}}}function getHelpButtonStyles(help){return{root:{borderBottomLeftRadius:help?0:10,borderBottomRightRadius:help?0:10}}}const Help=({help,"rt-corner-round":rtCornerRound})=>{if(help?.length)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Alert,{variant:"light",color:"blue",title:"Aide",styles:{root:{borderTopLeftRadius:help?0:10,borderTopRightRadius:help?rtCornerRound?10:0:10}},children:help});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{})};const InputText=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};function gradientCardBottomLeft(theme){return`linear-gradient(25deg, ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors[theme.primaryColor][8],.3)} 4.93%, ${theme.colors.dark[8]} 49.02%)`}const InputMsg=({full})=>{const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{radius:"md",p:"md",bg:gradientCardBottomLeft(theme),children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,mt:5,mb:15,children:full?.title}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:full?.text})]})};const InputPassword=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.PasswordInput,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:value,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputSwitch=({label,help,value,full,onChange})=>{const[checked,setChecked]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false);const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setChecked(value??full?.default??false)},[value]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Switch,{pb:help?0:15,pt:15,styles:stylesValue,label:label,checked:checked,onChange:event=>{setChecked(event.currentTarget.checked);onChange(event.currentTarget.checked)},autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputMultipleText=({label,required,placeholder,value,isMultiple,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpButtonStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpButtonStyles(helpValue??""))},[helpValue]);const arrayValue=Array.isArray(value)?value:[];const handleUpdateItem=(index,newValue)=>{const newArray=[...arrayValue];newArray[index]=newValue;onChange(newArray)};const handleRemoveItem=index=>{const newArray=arrayValue.filter((_,i)=>i!==index);onChange(newArray)};const handleAddItem=()=>{onChange([...arrayValue,""])};return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Box,{pb:help?0:15,pt:15,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label",{style:{fontWeight:500,display:"block",fontSize:"var(--mantine-font-size-sm)"},children:[label," ",required&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{style:{color:"var(--mantine-color-red-6)"},children:"*"})]}),arrayValue.map((item,index)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",mb:"xs",wrap:"nowrap",align:"flex-start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{style:{flexGrow:1},placeholder:`${placeholder||label} #${index+1}`,value:item,onChange:event=>handleUpdateItem(index,event.currentTarget.value),type:"text",autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),arrayValue.length>1&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"xs",color:"red",onClick:()=>handleRemoveItem(index),children:"Supprimer"})]},index)),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{color:"cyan",size:"xs",onClick:handleAddItem,styles:stylesValue,children:"Ajouter"}),error&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{style:{color:"var(--mantine-color-red-6)",fontSize:"12px",marginTop:"4px"},children:error}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??"","rt-corner-round":isMultiple})]})};const InputEmail=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{type:"email",pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputMultipleEmail=({label,required,placeholder,value,isMultiple,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpButtonStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpButtonStyles(helpValue??""))},[helpValue]);const arrayValue=Array.isArray(value)?value:[];const handleUpdateItem=(index,newValue)=>{const newArray=[...arrayValue];newArray[index]=newValue;onChange(newArray)};const handleRemoveItem=index=>{const newArray=arrayValue.filter((_,i)=>i!==index);onChange(newArray)};const handleAddItem=()=>{onChange([...arrayValue,""])};return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Box,{pb:help?0:15,pt:15,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label",{style:{fontWeight:500,display:"block",fontSize:"var(--mantine-font-size-sm)"},children:[label," ",required&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{style:{color:"var(--mantine-color-red-6)"},children:"*"})]}),arrayValue.map((item,index)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",mb:"xs",wrap:"nowrap",align:"flex-start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{style:{flexGrow:1},placeholder:`${placeholder||label} #${index+1}`,value:item,onChange:event=>handleUpdateItem(index,event.currentTarget.value),type:"email",autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),arrayValue.length>1&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"xs",color:"red",onClick:()=>handleRemoveItem(index),children:"Supprimer"})]},index)),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{color:"cyan",size:"xs",onClick:handleAddItem,styles:stylesValue,children:"Ajouter"}),error&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{style:{color:"var(--mantine-color-red-6)",fontSize:"12px",marginTop:"4px"},children:error}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??"","rt-corner-round":isMultiple})]})};const InputHidden=({value,onChange,error})=>{const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{type:"hidden",value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"})})};const InputSelect=({label,required,value,onChange,error,full,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.NativeSelect,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,value:value,data:full?.values??[],onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const FormField=({config,formProps})=>{switch(config.type){case"email":if(config.isMultiple)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMultipleEmail,{...config,...formProps});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputEmail,{...config,...formProps});case"hidden":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputHidden,{...config,...formProps});case"msg":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMsg,{...config,...formProps});case"password":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputPassword,{...config,...formProps});case"switch":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputSwitch,{...config,...formProps});case"select":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputSelect,{...config,...formProps});case"text":if(config.isMultiple)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMultipleText,{...config,...formProps});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputText,{...config,...formProps});default:console.error(`Type de champs non reconnu : ${config.type}`);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Alert,{variant:"filled",color:"red",title:`Type de champ non reconnu ${config.type}`,children:["Name: $",config.name,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br",{}),"Label: $",config.label]})}};const DynamicForm=({config,save})=>{const{data:configData,isPending:isLoadingConfig}=config();const form=(0,_mantine_form__WEBPACK_IMPORTED_MODULE_11__.useForm)({initialValues:configData?.initialData??{}});(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(configData?.initialData){form.setValues(configData.initialData);form.resetDirty()}},[configData]);if(isLoadingConfig||!configData)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{withBorder:true,shadow:"md",p:"xl",style:{position:"relative"},children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{height:30,mt:6,radius:"xl"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{height:12,mt:6,width:"30%",radius:"xl"})]});const handleSubmit=async values=>{console.log("Submitting form with values:",values);await save.mutateAsync(values)};const{sections}=configData;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{shadow:"md",p:"xl",style:{position:"relative"},children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form",{autoComplete:"off",onSubmit:form.onSubmit(handleSubmit),children:[sections.map(({fields})=>fields.map((fieldConfig,idx)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormField,{config:fieldConfig,formProps:{value:form.values[fieldConfig.name],onChange:value=>form.setFieldValue(fieldConfig.name,value),error:form.errors[fieldConfig.name]}},idx))),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{type:"submit",loading:save.isPending,mt:"xl",children:"Sauvegarder"})]})})};function IconMore({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"7.5",r:"1.5",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"12.5",r:"1.5",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"17.5",r:"1.5",fill:color})]})}function IconTrendingUp({color="currentColor",size=24,transform,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",style:{transform},xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M23 6L13.5 15.5L8.5 10.5L1 18",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M17 6H23V12",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function KPICard({children,title,subtitle,topSection,trend,menu,...rest}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{bg:"dark.4",miw:260,p:"sm",...rest,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:12,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[title&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:4,children:title}),topSection]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(KPICardMenu,{parameters:menu?.parameters,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconMore,{color:theme.colors.gray[7],cursor:"pointer"})})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider,{}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:6,flex:1,children:[trend&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconTrendingUp,{transform:"down"==trend?"scaleY(-1)":void 0}),subtitle&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fw:500,fz:16,c:theme.primaryColor,children:subtitle}),children]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconHelpCircle,{color:theme.colors.dark[0],style:{alignSelf:"flex-end"}})]})]})})}function KPICardMenu({parameters,children}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu,{shadow:"md",width:200,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Target,{children:children}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Dropdown,{children:[parameters&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Label,{children:"Param\xe8tres"}),parameters,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Divider,{})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Label,{children:"Organisation"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowsMove,{size:14}),children:"D\xe9placer"})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Dropdown,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBarLeft,{size:14}),children:"Gauche"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBarRight,{size:14}),children:"Droite"})]})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{color:"red",leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconTrash,{size:14}),children:"Supprimer ce KPI"})]})]})}function KPICardBankAccountsChart({accounts,...rest}){const detailed=useRxState(false);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(KPICard,{title:"Cash position (k€)",w:"100%",menu:{parameters:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Checkbox,{label:"D\xe9tails par compte",checked:detailed.value,onChange:x=>detailed.value=x.target.checked})})]},...rest,children:accounts?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BankAccountsChart,{showIndividualBalances:detailed.value,h:200,ml:10,accounts:accounts,detail:"high",showToday:false,showReferenceLines:"never",xAxisProps:{ticks:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.eachMonthOfInterval)({start:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.subMonths)(new Date,6),end:new Date}).map(d=>new Date(isoday(d)).getTime()),tickFormatter:v=>{v=new Date(v);return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.intlFormat)(v,{month:"short"},{locale:"fr"})}}}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{h:200,w:"100%"})})}const languages={en:{label:"English",flag:"us"},fr:{label:"Fran\xe7ais",flag:"fr"},es:{label:"Espa\xf1ol",flag:"es"}};const flag=lang=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:`fi fi-${languages[lang].flag}`});function LanguageSwitcher(props){const{i18n}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_12__.useTranslation)();const lang=i18n.language;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu,{shadow:"md",width:180,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{variant:"default",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",children:[flag(lang)," ",lang.toUpperCase()]})})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Dropdown,{children:(0,radash__WEBPACK_IMPORTED_MODULE_6__.listify)(languages,(key,{label})=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{onClick:()=>i18n.changeLanguage(key),disabled:lang===key,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{children:[flag(key)," ",label]})},key))})]})})}function PillTrend({children,trend,...rest}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Pill,{bg:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors["up"==trend?"teal":"red"][6],.3),...rest,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:4,wrap:"nowrap",align:"center",children:["up"==trend?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBigUpFilled,{size:10,color:theme.colors.teal[2]}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBigDownFilled,{size:10,color:theme.colors.red[5]}),children]})})}const theme_theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.createTheme)({primaryColor:"teal",fontFamily:"Host Grotesk",headings:{sizes:{h1:{fontSize:"28px",fontWeight:"500"},h2:{fontSize:"22px",fontWeight:"500"},h3:{fontSize:"18px",fontWeight:"500"},h4:{fontSize:"16px",fontWeight:"500"},h5:{fontSize:"14px",fontWeight:"500"},h6:{fontSize:"12px",fontWeight:"500"}}},fontSizes:{lg:"16px",md:"14px",sm:"12px",xs:"10px"},colors:{dark:["#a4a4a4",(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.2),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.15),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.1),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.05),"#474747","#363636","#282828","#1e1e1e","#121212"]},components:{Button:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button.extend({styles:(_theme,props)=>({root:{border:"filled"!=props.variant&&props.variant?void 0:"none"},label:{fontWeight:"500"}})}),Checkbox:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Checkbox.extend({styles:{input:{border:"none"}},defaultProps:{icon:props=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconCheck,{...props})}}),TextInput:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput.extend({styles:{label:{marginBottom:"8px"}}}),PasswordInput:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.PasswordInput.extend({styles:{label:{marginBottom:"8px"}}}),Input:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Input.extend({styles:{input:{borderRadius:"10px",backgroundColor:"var(--mantine-color-body)"}}}),MenuDropdown:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.MenuDropdown.extend({defaultProps:{bg:"var(--mantine-color-dark-7)"}}),Popover:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.extend({defaultProps:{radius:"8px"},styles:{dropdown:{background:"var(--mantine-color-dark-7)",borderColor:"var(--mantine-color-dark-1)"}}}),Divider:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider.extend({defaultProps:{color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.1)}}),Badge:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Badge.extend({styles:{root:{borderRadius:"4px",fontWeight:"400",fontFamily:"IBM Plex Sans"}}}),Modal:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Modal.extend({styles:{content:{borderRadius:10,backgroundColor:"var(--mantine-color-dark-9)"},header:{backgroundColor:"var(--mantine-color-dark-9)"}}}),Drawer:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Drawer.extend({styles:{content:{backgroundColor:"var(--mantine-color-dark-9)"},header:{backgroundColor:"var(--mantine-color-dark-9)"}}}),Paper:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper.extend({styles:{root:{backgroundColor:"var(--mantine-color-dark-8)"}}})}});const cssVarResolver=theme=>({variables:{},light:{"--mantine-color-text":"var(--mantine-color-black)"},dark:{"--mantine-radius-default":"10px","--checkbox-radius":"4px","--mantine-color-text":"var(--mantine-color-white)","--mantine-color-body":"#090909","--mantine-color-placeholder":"var(--mantine-color-dark-0)","--mantine-color-dimmed":"var(--mantine-color-dark-0)","--button-bg":`linear-gradient(90deg, ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.darken)(theme.colors[theme.primaryColor][9],.3)} -10%, ${theme.colors[theme.primaryColor][8]} 100%)`,"--mantine-color-default":"var(--mantine-color-dark-3)","--mantine-color-default-border":"var(--mantine-color-dark-2)","--mantine-color-default-hover":"var(--mantine-color-dark-2)"}})}}]);
|
package/dist/mf/756.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 756.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["756"],{8493:function(__unused_webpack_module,exports,__webpack_require__){/**
|
|
3
|
-
* @license React
|
|
4
|
-
* use-sync-external-store-shim.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var React=__webpack_require__(3620);function is(x,y){return x===y&&(0!==x||1/x===1/y)||x!==x&&y!==y}var objectIs="function"==typeof Object.is?Object.is:is,useState=React.useState,useEffect=React.useEffect,useLayoutEffect=React.useLayoutEffect,useDebugValue=React.useDebugValue;function useSyncExternalStore$2(subscribe,getSnapshot){var value=getSnapshot(),_useState=useState({inst:{value:value,getSnapshot:getSnapshot}}),inst=_useState[0].inst,forceUpdate=_useState[1];useLayoutEffect(function(){inst.value=value;inst.getSnapshot=getSnapshot;checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst})},[subscribe,value,getSnapshot]);useEffect(function(){checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst});return subscribe(function(){checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst})})},[subscribe]);useDebugValue(value);return value}function checkIfSnapshotChanged(inst){var latestGetSnapshot=inst.getSnapshot;inst=inst.value;try{var nextValue=latestGetSnapshot();return!objectIs(inst,nextValue)}catch(error){return!0}}function useSyncExternalStore$1(subscribe,getSnapshot){return getSnapshot()}var shim="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?useSyncExternalStore$1:useSyncExternalStore$2;exports.useSyncExternalStore=void 0!==React.useSyncExternalStore?React.useSyncExternalStore:shim},2162:function(__unused_webpack_module,exports,__webpack_require__){/**
|
|
11
|
-
* @license React
|
|
12
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var React=__webpack_require__(3620),shim=__webpack_require__(9888);function is(x,y){return x===y&&(0!==x||1/x===1/y)||x!==x&&y!==y}var objectIs="function"==typeof Object.is?Object.is:is,useSyncExternalStore=shim.useSyncExternalStore,useRef=React.useRef,useEffect=React.useEffect,useMemo=React.useMemo,useDebugValue=React.useDebugValue;exports.useSyncExternalStoreWithSelector=function(subscribe,getSnapshot,getServerSnapshot,selector,isEqual){var instRef=useRef(null);if(null===instRef.current){var inst={hasValue:!1,value:null};instRef.current=inst}else inst=instRef.current;instRef=useMemo(function(){function memoizedSelector(nextSnapshot){if(!hasMemo){hasMemo=!0;memoizedSnapshot=nextSnapshot;nextSnapshot=selector(nextSnapshot);if(void 0!==isEqual&&inst.hasValue){var currentSelection=inst.value;if(isEqual(currentSelection,nextSnapshot))return memoizedSelection=currentSelection}return memoizedSelection=nextSnapshot}currentSelection=memoizedSelection;if(objectIs(memoizedSnapshot,nextSnapshot))return currentSelection;var nextSelection=selector(nextSnapshot);if(void 0!==isEqual&&isEqual(currentSelection,nextSelection))return memoizedSnapshot=nextSnapshot,currentSelection;memoizedSnapshot=nextSnapshot;return memoizedSelection=nextSelection}var hasMemo=!1,memoizedSnapshot,memoizedSelection,maybeGetServerSnapshot=void 0===getServerSnapshot?null:getServerSnapshot;return[function(){return memoizedSelector(getSnapshot())},null===maybeGetServerSnapshot?void 0:function(){return memoizedSelector(maybeGetServerSnapshot())}]},[getSnapshot,getServerSnapshot,selector,isEqual]);var value=useSyncExternalStore(subscribe,instRef[0],instRef[1]);useEffect(function(){inst.hasValue=!0;inst.value=value},[value]);useDebugValue(value);return value}},9888:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(8493)},9242:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(2162)},15:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{Scripts:()=>Scripts,getInitialRouterState:()=>getInitialRouterState,PathParamError:()=>PathParamError,isPlainArray:()=>isPlainArray,Asset:()=>Asset,notFound:()=>not_found_notFound,Route:()=>Route,createRouteMask:()=>createRouteMask,retainSearchParams:()=>retainSearchParams,rootRouteWithContext:()=>rootRouteWithContext,useChildMatches:()=>useChildMatches,getRouterContext:()=>getRouterContext,createRouterConfig:()=>createRouterConfig,createLazyRoute:()=>createLazyRoute,useLayoutEffect:()=>useLayoutEffect,createBrowserHistory:()=>createBrowserHistory,createLazyFileRoute:()=>createLazyFileRoute,matchContext:()=>matchContext,useLoaderData:()=>useLoaderData,DefaultGlobalNotFound:()=>DefaultGlobalNotFound,defaultStringifySearch:()=>defaultStringifySearch,useNavigate:()=>useNavigate,useParams:()=>useParams,createHistory:()=>createHistory,RouterContextProvider:()=>RouterContextProvider,createRouter:()=>createRouter,SearchParamError:()=>SearchParamError,useRouterState:()=>useRouterState,useElementScrollRestoration:()=>useElementScrollRestoration,trimPathLeft:()=>trimPathLeft,useMatch:()=>useMatch,Navigate:()=>Navigate,Matches:()=>Matches,deepEqual:()=>deepEqual,isMatch:()=>Matches_isMatch,joinPaths:()=>joinPaths,ClientOnly:()=>ClientOnly,ScriptOnce:()=>ScriptOnce,TSR_DEFERRED_PROMISE:()=>TSR_DEFERRED_PROMISE,matchByPath:()=>matchByPath,replaceEqualDeep:()=>replaceEqualDeep,NotFoundRoute:()=>NotFoundRoute,rootRouteId:()=>rootRouteId,Match:()=>Match,parseSearchWith:()=>parseSearchWith,stringifySearchWith:()=>stringifySearchWith,MatchRoute:()=>MatchRoute,redirect:()=>redirect,CatchBoundary:()=>CatchBoundary,RouterProvider:()=>RouterProvider,createLink:()=>createLink,useBlocker:()=>useBlocker,useStableCallback:()=>useStableCallback,stripSearchParams:()=>stripSearchParams,useRouteContext:()=>useRouteContext,createRootRoute:()=>createRootRoute,defer:()=>defer,functionalUpdate:()=>functionalUpdate,Router:()=>Router,parsePathname:()=>parsePathname,trimPath:()=>trimPath,Await:()=>Await,FileRoute:()=>FileRoute,createMemoryHistory:()=>createMemoryHistory,lazyFn:()=>router_lazyFn,useRouter:()=>useRouter,getRouteApi:()=>getRouteApi,trimPathRight:()=>trimPathRight,useSearch:()=>useSearch,useMatches:()=>useMatches,createFileRoute:()=>createFileRoute,isRedirect:()=>isRedirect,Outlet:()=>Outlet,ErrorComponent:()=>ErrorComponent,RouteApi:()=>RouteApi,useCanGoBack:()=>useCanGoBack,createRoute:()=>createRoute,createRootRouteWithContext:()=>createRootRouteWithContext,isPlainObject:()=>isPlainObject,useLocation:()=>useLocation,useParentMatches:()=>useParentMatches,createControlledPromise:()=>createControlledPromise,useLoaderDeps:()=>useLoaderDeps,resolvePath:()=>resolvePath,useLinkProps:()=>useLinkProps,useMatchRoute:()=>useMatchRoute,useAwaited:()=>useAwaited,cleanPath:()=>cleanPath,Block:()=>Block,componentTypes:()=>componentTypes,createSerializationAdapter:()=>createSerializationAdapter,Link:()=>Link,CatchNotFound:()=>CatchNotFound,defaultParseSearch:()=>defaultParseSearch,composeRewrites:()=>composeRewrites,createHashHistory:()=>createHashHistory,ScrollRestoration:()=>ScrollRestoration_ScrollRestoration,RootRoute:()=>RootRoute,LazyRoute:()=>LazyRoute,matchPathname:()=>matchPathname,HeadContent:()=>HeadContent,lazyRouteComponent:()=>lazyRouteComponent,interpolatePath:()=>interpolatePath,isNotFound:()=>isNotFound,linkOptions:()=>linkOptions,FileRouteLoader:()=>FileRouteLoader,defaultSerializeError:()=>defaultSerializeError});class Derived{constructor(options){this.listeners=/* @__PURE__ */new Set;this._subscriptions=[];this.lastSeenDepValues=[];this.getDepVals=()=>{const l=this.options.deps.length;const prevDepVals=new Array(l);const currDepVals=new Array(l);for(let i=0;i<l;i++){const dep=this.options.deps[i];prevDepVals[i]=dep.prevState;currDepVals[i]=dep.state}this.lastSeenDepValues=currDepVals;return{prevDepVals,currDepVals,prevVal:this.prevState??void 0}};this.recompute=()=>{var _a,_b;this.prevState=this.state;const depVals=this.getDepVals();this.state=this.options.fn(depVals);null==(_b=(_a=this.options).onUpdate)||_b.call(_a)};this.checkIfRecalculationNeededDeeply=()=>{for(const dep of this.options.deps)if(dep instanceof Derived)dep.checkIfRecalculationNeededDeeply();let shouldRecompute=false;const lastSeenDepValues=this.lastSeenDepValues;const{currDepVals}=this.getDepVals();for(let i=0;i<currDepVals.length;i++)if(currDepVals[i]!==lastSeenDepValues[i]){shouldRecompute=true;break}if(shouldRecompute)this.recompute()};this.mount=()=>{this.registerOnGraph();this.checkIfRecalculationNeededDeeply();return()=>{this.unregisterFromGraph();for(const cleanup of this._subscriptions)cleanup()}};this.subscribe=listener=>{var _a,_b;this.listeners.add(listener);const unsub=null==(_b=(_a=this.options).onSubscribe)?void 0:_b.call(_a,listener,this);return()=>{this.listeners.delete(listener);null==unsub||unsub()}};this.options=options;this.state=options.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(deps=this.options.deps){for(const dep of deps)if(dep instanceof Derived){dep.registerOnGraph();this.registerOnGraph(dep.options.deps)}else if(dep instanceof Store){let relatedLinkedDerivedVals=__storeToDerived.get(dep);if(!relatedLinkedDerivedVals){relatedLinkedDerivedVals=/* @__PURE__ */new Set;__storeToDerived.set(dep,relatedLinkedDerivedVals)}relatedLinkedDerivedVals.add(this);let relatedStores=__derivedToStore.get(this);if(!relatedStores){relatedStores=/* @__PURE__ */new Set;__derivedToStore.set(this,relatedStores)}relatedStores.add(dep)}}unregisterFromGraph(deps=this.options.deps){for(const dep of deps)if(dep instanceof Derived)this.unregisterFromGraph(dep.options.deps);else if(dep instanceof Store){const relatedLinkedDerivedVals=__storeToDerived.get(dep);if(relatedLinkedDerivedVals)relatedLinkedDerivedVals.delete(this);const relatedStores=__derivedToStore.get(this);if(relatedStores)relatedStores.delete(dep)}}}const __storeToDerived=/* @__PURE__ */new WeakMap;const __derivedToStore=/* @__PURE__ */new WeakMap;const __depsThatHaveWrittenThisTick={current:[]};let __isFlushing=false;let __batchDepth=0;const __pendingUpdates=/* @__PURE__ */new Set;const __initialBatchValues=/* @__PURE__ */new Map;function __flush_internals(relatedVals){const sorted=Array.from(relatedVals).sort((a,b)=>{if(a instanceof Derived&&a.options.deps.includes(b))return 1;if(b instanceof Derived&&b.options.deps.includes(a))return -1;return 0});for(const derived of sorted){if(__depsThatHaveWrittenThisTick.current.includes(derived))continue;__depsThatHaveWrittenThisTick.current.push(derived);derived.recompute();const stores=__derivedToStore.get(derived);if(stores)for(const store of stores){const relatedLinkedDerivedVals=__storeToDerived.get(store);if(relatedLinkedDerivedVals)__flush_internals(relatedLinkedDerivedVals)}}}function __notifyListeners(store){const value={prevVal:store.prevState,currentVal:store.state};for(const listener of store.listeners)listener(value)}function __notifyDerivedListeners(derived){const value={prevVal:derived.prevState,currentVal:derived.state};for(const listener of derived.listeners)listener(value)}function __flush(store){if(__batchDepth>0&&!__initialBatchValues.has(store))__initialBatchValues.set(store,store.prevState);__pendingUpdates.add(store);if(__batchDepth>0)return;if(__isFlushing)return;try{__isFlushing=true;while(__pendingUpdates.size>0){const stores=Array.from(__pendingUpdates);__pendingUpdates.clear();for(const store2 of stores){const prevState=__initialBatchValues.get(store2)??store2.prevState;store2.prevState=prevState;__notifyListeners(store2)}for(const store2 of stores){const derivedVals=__storeToDerived.get(store2);if(derivedVals){__depsThatHaveWrittenThisTick.current.push(store2);__flush_internals(derivedVals)}}for(const store2 of stores){const derivedVals=__storeToDerived.get(store2);if(derivedVals)for(const derived of derivedVals)__notifyDerivedListeners(derived)}}}finally{__isFlushing=false;__depsThatHaveWrittenThisTick.current=[];__initialBatchValues.clear()}}function batch(fn){__batchDepth++;try{fn()}finally{__batchDepth--;if(0===__batchDepth){const pendingUpdateToFlush=__pendingUpdates.values().next().value;if(pendingUpdateToFlush)__flush(pendingUpdateToFlush)}}}function isUpdaterFunction(updater){return"function"==typeof updater}class Store{constructor(initialState,options){this.listeners=/* @__PURE__ */new Set;this.subscribe=listener=>{var _a,_b;this.listeners.add(listener);const unsub=null==(_b=null==(_a=this.options)?void 0:_a.onSubscribe)?void 0:_b.call(_a,listener,this);return()=>{this.listeners.delete(listener);null==unsub||unsub()}};this.prevState=initialState;this.state=initialState;this.options=options}setState(updater){var _a,_b,_c;this.prevState=this.state;if(null==(_a=this.options)?void 0:_a.updateFn)this.state=this.options.updateFn(this.prevState)(updater);else if(isUpdaterFunction(updater))this.state=updater(this.prevState);else this.state=updater;null==(_c=null==(_b=this.options)?void 0:_b.onUpdate)||_c.call(_b);__flush(this)}}const stateIndexKey="__TSR_index";const popStateEvent="popstate";const beforeUnloadEvent="beforeunload";function createHistory(opts){let location=opts.getLocation();const subscribers=/* @__PURE__ */new Set;const notify=action=>{location=opts.getLocation();subscribers.forEach(subscriber=>subscriber({location,action}))};const handleIndexChange=action=>{if(opts.notifyOnIndexChange??true)notify(action);else location=opts.getLocation()};const tryNavigation=async({task,navigateOpts,...actionInfo})=>{const ignoreBlocker=navigateOpts?.ignoreBlocker??false;if(ignoreBlocker)return void task();const blockers=opts.getBlockers?.()??[];const isPushOrReplace="PUSH"===actionInfo.type||"REPLACE"===actionInfo.type;if("undefined"!=typeof document&&blockers.length&&isPushOrReplace)for(const blocker of blockers){const nextLocation=parseHref(actionInfo.path,actionInfo.state);const isBlocked=await blocker.blockerFn({currentLocation:location,nextLocation,action:actionInfo.type});if(isBlocked)return void opts.onBlocked?.()}task()};return{get location(){return location},get length(){return opts.getLength()},subscribers,subscribe:cb=>{subscribers.add(cb);return()=>{subscribers.delete(cb)}},push:(path,state,navigateOpts)=>{const currentIndex=location.state[stateIndexKey];state=assignKeyAndIndex(currentIndex+1,state);tryNavigation({task:()=>{opts.pushState(path,state);notify({type:"PUSH"})},navigateOpts,type:"PUSH",path,state})},replace:(path,state,navigateOpts)=>{const currentIndex=location.state[stateIndexKey];state=assignKeyAndIndex(currentIndex,state);tryNavigation({task:()=>{opts.replaceState(path,state);notify({type:"REPLACE"})},navigateOpts,type:"REPLACE",path,state})},go:(index,navigateOpts)=>{tryNavigation({task:()=>{opts.go(index);handleIndexChange({type:"GO",index})},navigateOpts,type:"GO"})},back:navigateOpts=>{tryNavigation({task:()=>{opts.back(navigateOpts?.ignoreBlocker??false);handleIndexChange({type:"BACK"})},navigateOpts,type:"BACK"})},forward:navigateOpts=>{tryNavigation({task:()=>{opts.forward(navigateOpts?.ignoreBlocker??false);handleIndexChange({type:"FORWARD"})},navigateOpts,type:"FORWARD"})},canGoBack:()=>0!==location.state[stateIndexKey],createHref:str=>opts.createHref(str),block:blocker=>{if(!opts.setBlockers)return()=>{};const blockers=opts.getBlockers?.()??[];opts.setBlockers([...blockers,blocker]);return()=>{const blockers2=opts.getBlockers?.()??[];opts.setBlockers?.(blockers2.filter(b=>b!==blocker))}},flush:()=>opts.flush?.(),destroy:()=>opts.destroy?.(),notify}}function assignKeyAndIndex(index,state){if(!state)state={};const key=createRandomKey();return{...state,key,__TSR_key:key,[stateIndexKey]:index}}function createBrowserHistory(opts){const win=opts?.window??("undefined"!=typeof document?window:void 0);const originalPushState=win.history.pushState;const originalReplaceState=win.history.replaceState;let blockers=[];const _getBlockers=()=>blockers;const _setBlockers=newBlockers=>blockers=newBlockers;const createHref=opts?.createHref??(path=>path);const parseLocation=opts?.parseLocation??(()=>parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`,win.history.state));if(!win.history.state?.__TSR_key&&!win.history.state?.key){const addedKey=createRandomKey();win.history.replaceState({[stateIndexKey]:0,key:addedKey,__TSR_key:addedKey},"")}let currentLocation=parseLocation();let rollbackLocation;let nextPopIsGo=false;let ignoreNextPop=false;let skipBlockerNextPop=false;let ignoreNextBeforeUnload=false;const getLocation=()=>currentLocation;let next;let scheduled;const flush=()=>{if(!next)return;history._ignoreSubscribers=true;(next.isPush?win.history.pushState:win.history.replaceState)(next.state,"",next.href);history._ignoreSubscribers=false;next=void 0;scheduled=void 0;rollbackLocation=void 0};const queueHistoryAction=(type,destHref,state)=>{const href=createHref(destHref);if(!scheduled)rollbackLocation=currentLocation;currentLocation=parseHref(destHref,state);next={href,state,isPush:next?.isPush||"push"===type};if(!scheduled)scheduled=Promise.resolve().then(()=>flush())};const onPushPop=type=>{currentLocation=parseLocation();history.notify({type})};const onPushPopEvent=async()=>{if(ignoreNextPop){ignoreNextPop=false;return}const nextLocation=parseLocation();const delta=nextLocation.state[stateIndexKey]-currentLocation.state[stateIndexKey];const isForward=1===delta;const isBack=-1===delta;const isGo=!isForward&&!isBack||nextPopIsGo;nextPopIsGo=false;const action=isGo?"GO":isBack?"BACK":"FORWARD";const notify=isGo?{type:"GO",index:delta}:{type:isBack?"BACK":"FORWARD"};if(skipBlockerNextPop)skipBlockerNextPop=false;else{const blockers2=_getBlockers();if("undefined"!=typeof document&&blockers2.length)for(const blocker of blockers2){const isBlocked=await blocker.blockerFn({currentLocation,nextLocation,action});if(isBlocked){ignoreNextPop=true;win.history.go(1);history.notify(notify);return}}}currentLocation=parseLocation();history.notify(notify)};const onBeforeUnload=e=>{if(ignoreNextBeforeUnload){ignoreNextBeforeUnload=false;return}let shouldBlock=false;const blockers2=_getBlockers();if("undefined"!=typeof document&&blockers2.length)for(const blocker of blockers2){const shouldHaveBeforeUnload=blocker.enableBeforeUnload??true;if(true===shouldHaveBeforeUnload){shouldBlock=true;break}if("function"==typeof shouldHaveBeforeUnload&&true===shouldHaveBeforeUnload()){shouldBlock=true;break}}if(shouldBlock){e.preventDefault();return e.returnValue=""}};const history=createHistory({getLocation,getLength:()=>win.history.length,pushState:(href,state)=>queueHistoryAction("push",href,state),replaceState:(href,state)=>queueHistoryAction("replace",href,state),back:ignoreBlocker=>{if(ignoreBlocker)skipBlockerNextPop=true;ignoreNextBeforeUnload=true;return win.history.back()},forward:ignoreBlocker=>{if(ignoreBlocker)skipBlockerNextPop=true;ignoreNextBeforeUnload=true;win.history.forward()},go:n=>{nextPopIsGo=true;win.history.go(n)},createHref:href=>createHref(href),flush,destroy:()=>{win.history.pushState=originalPushState;win.history.replaceState=originalReplaceState;win.removeEventListener(beforeUnloadEvent,onBeforeUnload,{capture:true});win.removeEventListener(popStateEvent,onPushPopEvent)},onBlocked:()=>{if(rollbackLocation&¤tLocation!==rollbackLocation)currentLocation=rollbackLocation},getBlockers:_getBlockers,setBlockers:_setBlockers,notifyOnIndexChange:false});win.addEventListener(beforeUnloadEvent,onBeforeUnload,{capture:true});win.addEventListener(popStateEvent,onPushPopEvent);win.history.pushState=function(...args){const res=originalPushState.apply(win.history,args);if(!history._ignoreSubscribers)onPushPop("PUSH");return res};win.history.replaceState=function(...args){const res=originalReplaceState.apply(win.history,args);if(!history._ignoreSubscribers)onPushPop("REPLACE");return res};return history}function createHashHistory(opts){const win=opts?.window??("undefined"!=typeof document?window:void 0);return createBrowserHistory({window:win,parseLocation:()=>{const hashSplit=win.location.hash.split("#").slice(1);const pathPart=hashSplit[0]??"/";const searchPart=win.location.search;const hashEntries=hashSplit.slice(1);const hashPart=0===hashEntries.length?"":`#${hashEntries.join("#")}`;const hashHref=`${pathPart}${searchPart}${hashPart}`;return parseHref(hashHref,win.history.state)},createHref:href=>`${win.location.pathname}${win.location.search}#${href}`})}function createMemoryHistory(opts={initialEntries:["/"]}){const entries=opts.initialEntries;let index=opts.initialIndex?Math.min(Math.max(opts.initialIndex,0),entries.length-1):entries.length-1;const states=entries.map((_entry,index2)=>assignKeyAndIndex(index2,void 0));const getLocation=()=>parseHref(entries[index],states[index]);return createHistory({getLocation,getLength:()=>entries.length,pushState:(path,state)=>{if(index<entries.length-1){entries.splice(index+1);states.splice(index+1)}states.push(state);entries.push(path);index=Math.max(entries.length-1,0)},replaceState:(path,state)=>{states[index]=state;entries[index]=path},back:()=>{index=Math.max(index-1,0)},forward:()=>{index=Math.min(index+1,entries.length-1)},go:n=>{index=Math.min(Math.max(index+n,0),entries.length-1)},createHref:path=>path})}function parseHref(href,state){const hashIndex=href.indexOf("#");const searchIndex=href.indexOf("?");const addedKey=createRandomKey();return{href,pathname:href.substring(0,hashIndex>0?searchIndex>0?Math.min(hashIndex,searchIndex):hashIndex:searchIndex>0?searchIndex:href.length),hash:hashIndex>-1?href.substring(hashIndex):"",search:searchIndex>-1?href.slice(searchIndex,-1===hashIndex?void 0:hashIndex):"",state:state||{[stateIndexKey]:0,key:addedKey,__TSR_key:addedKey}}}function createRandomKey(){return(Math.random()+1).toString(36).substring(7)}function last(arr){return arr[arr.length-1]}function isFunction(d){return"function"==typeof d}function functionalUpdate(updater,previous){if(isFunction(updater))return updater(previous);return updater}const hasOwn=Object.prototype.hasOwnProperty;function replaceEqualDeep(prev,_next){if(prev===_next)return prev;const next=_next;const array=isPlainArray(prev)&&isPlainArray(next);if(!array&&!(isPlainObject(prev)&&isPlainObject(next)))return next;const prevItems=array?prev:getEnumerableOwnKeys(prev);if(!prevItems)return next;const nextItems=array?next:getEnumerableOwnKeys(next);if(!nextItems)return next;const prevSize=prevItems.length;const nextSize=nextItems.length;const copy=array?new Array(nextSize):{};let equalItems=0;for(let i=0;i<nextSize;i++){const key=array?i:nextItems[i];const p=prev[key];const n=next[key];if(p===n){copy[key]=p;if(array?i<prevSize:hasOwn.call(prev,key))equalItems++;continue}if(null===p||null===n||"object"!=typeof p||"object"!=typeof n){copy[key]=n;continue}const v=replaceEqualDeep(p,n);copy[key]=v;if(v===p)equalItems++}return prevSize===nextSize&&equalItems===prevSize?prev:copy}function getEnumerableOwnKeys(o){const keys=[];const names=Object.getOwnPropertyNames(o);for(const name of names){if(!Object.prototype.propertyIsEnumerable.call(o,name))return false;keys.push(name)}const symbols=Object.getOwnPropertySymbols(o);for(const symbol of symbols){if(!Object.prototype.propertyIsEnumerable.call(o,symbol))return false;keys.push(symbol)}return keys}function isPlainObject(o){if(!hasObjectPrototype(o))return false;const ctor=o.constructor;if(void 0===ctor)return true;const prot=ctor.prototype;if(!hasObjectPrototype(prot))return false;if(!prot.hasOwnProperty("isPrototypeOf"))return false;return true}function hasObjectPrototype(o){return"[object Object]"===Object.prototype.toString.call(o)}function isPlainArray(value){return Array.isArray(value)&&value.length===Object.keys(value).length}function deepEqual(a,b,opts){if(a===b)return true;if(typeof a!==typeof b)return false;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return false;for(let i=0,l=a.length;i<l;i++)if(!deepEqual(a[i],b[i],opts))return false;return true}if(isPlainObject(a)&&isPlainObject(b)){const ignoreUndefined=opts?.ignoreUndefined??true;if(opts?.partial){for(const k in b)if(!ignoreUndefined||void 0!==b[k]){if(!deepEqual(a[k],b[k],opts))return false}return true}let aCount=0;if(ignoreUndefined){for(const k in a)if(void 0!==a[k])aCount++}else aCount=Object.keys(a).length;let bCount=0;for(const k in b)if(!ignoreUndefined||void 0!==b[k]){bCount++;if(bCount>aCount||!deepEqual(a[k],b[k],opts))return false}return aCount===bCount}return false}function createControlledPromise(onResolve){let resolveLoadPromise;let rejectLoadPromise;const controlledPromise=new Promise((resolve,reject)=>{resolveLoadPromise=resolve;rejectLoadPromise=reject});controlledPromise.status="pending";controlledPromise.resolve=value=>{controlledPromise.status="resolved";controlledPromise.value=value;resolveLoadPromise(value);onResolve?.(value)};controlledPromise.reject=e=>{controlledPromise.status="rejected";rejectLoadPromise(e)};return controlledPromise}function isModuleNotFoundError(error){if("string"!=typeof error?.message)return false;return error.message.startsWith("Failed to fetch dynamically imported module")||error.message.startsWith("error loading dynamically imported module")||error.message.startsWith("Importing a module script failed")}function isPromise(value){return Boolean(value&&"object"==typeof value&&"function"==typeof value.then)}var tiny_invariant=__webpack_require__(1089);const rootRouteId="__root__";const SEGMENT_TYPE_PATHNAME=0;const SEGMENT_TYPE_PARAM=1;const SEGMENT_TYPE_WILDCARD=2;const SEGMENT_TYPE_OPTIONAL_PARAM=3;function joinPaths(paths){return cleanPath(paths.filter(val=>void 0!==val).join("/"))}function cleanPath(path){return path.replace(/\/{2,}/g,"/")}function trimPathLeft(path){return"/"===path?path:path.replace(/^\/{1,}/,"")}function trimPathRight(path){return"/"===path?path:path.replace(/\/{1,}$/,"")}function trimPath(path){return trimPathRight(trimPathLeft(path))}function removeTrailingSlash(value,basepath){if(value?.endsWith("/")&&"/"!==value&&value!==`${basepath}/`)return value.slice(0,-1);return value}function exactPathTest(pathName1,pathName2,basepath){return removeTrailingSlash(pathName1,basepath)===removeTrailingSlash(pathName2,basepath)}function segmentToString(segment){const{type,value}=segment;if(type===SEGMENT_TYPE_PATHNAME)return value;const{prefixSegment,suffixSegment}=segment;if(type===SEGMENT_TYPE_PARAM){const param=value.substring(1);if(prefixSegment&&suffixSegment)return`${prefixSegment}{$${param}}${suffixSegment}`;if(prefixSegment)return`${prefixSegment}{$${param}}`;if(suffixSegment)return`{$${param}}${suffixSegment}`}if(type===SEGMENT_TYPE_OPTIONAL_PARAM){const param=value.substring(1);if(prefixSegment&&suffixSegment)return`${prefixSegment}{-$${param}}${suffixSegment}`;if(prefixSegment)return`${prefixSegment}{-$${param}}`;if(suffixSegment)return`{-$${param}}${suffixSegment}`;return`{-$${param}}`}if(type===SEGMENT_TYPE_WILDCARD){if(prefixSegment&&suffixSegment)return`${prefixSegment}{$}${suffixSegment}`;else if(prefixSegment)return`${prefixSegment}{$}`;else if(suffixSegment)return`{$}${suffixSegment}`}return value}function resolvePath({base,to,trailingSlash="never",parseCache}){let baseSegments=parseBasePathSegments(base,parseCache).slice();const toSegments=parseRoutePathSegments(to,parseCache);if(baseSegments.length>1&&last(baseSegments)?.value==="/")baseSegments.pop();for(let index=0,length=toSegments.length;index<length;index++){const toSegment=toSegments[index];const value=toSegment.value;if("/"===value)if(index){if(index===length-1)baseSegments.push(toSegment)}else baseSegments=[toSegment];else if(".."===value)baseSegments.pop();else"."===value||baseSegments.push(toSegment)}if(baseSegments.length>1){if("/"===last(baseSegments).value){if("never"===trailingSlash)baseSegments.pop()}else if("always"===trailingSlash)baseSegments.push({type:SEGMENT_TYPE_PATHNAME,value:"/"})}const segmentValues=baseSegments.map(segmentToString);const joined=joinPaths(segmentValues);return joined}const parseBasePathSegments=(pathname,cache)=>parsePathname(pathname,cache,true);const parseRoutePathSegments=(pathname,cache)=>parsePathname(pathname,cache,false);const parsePathname=(pathname,cache,basePathValues)=>{if(!pathname)return[];const cached=cache?.get(pathname);if(cached)return cached;const parsed=baseParsePathname(pathname,basePathValues);cache?.set(pathname,parsed);return parsed};const PARAM_RE=/^\$.{1,}$/;const PARAM_W_CURLY_BRACES_RE=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/;const OPTIONAL_PARAM_W_CURLY_BRACES_RE=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/;const WILDCARD_RE=/^\$$/;const WILDCARD_W_CURLY_BRACES_RE=/^(.*?)\{\$\}(.*)$/;function baseParsePathname(pathname,basePathValues){pathname=cleanPath(pathname);const segments=[];if("/"===pathname.slice(0,1)){pathname=pathname.substring(1);segments.push({type:SEGMENT_TYPE_PATHNAME,value:"/"})}if(!pathname)return segments;const split=pathname.split("/").filter(Boolean);segments.push(...split.map(part=>{const partToMatch=basePathValues||part===rootRouteId||"_"!==part.slice(-1)?part:part.slice(0,-1);const wildcardBracesMatch=partToMatch.match(WILDCARD_W_CURLY_BRACES_RE);if(wildcardBracesMatch){const prefix=wildcardBracesMatch[1];const suffix=wildcardBracesMatch[2];return{type:SEGMENT_TYPE_WILDCARD,value:"$",prefixSegment:prefix||void 0,suffixSegment:suffix||void 0}}const optionalParamBracesMatch=partToMatch.match(OPTIONAL_PARAM_W_CURLY_BRACES_RE);if(optionalParamBracesMatch){const prefix=optionalParamBracesMatch[1];const paramName=optionalParamBracesMatch[2];const suffix=optionalParamBracesMatch[3];return{type:SEGMENT_TYPE_OPTIONAL_PARAM,value:paramName,prefixSegment:prefix||void 0,suffixSegment:suffix||void 0}}const paramBracesMatch=partToMatch.match(PARAM_W_CURLY_BRACES_RE);if(paramBracesMatch){const prefix=paramBracesMatch[1];const paramName=paramBracesMatch[2];const suffix=paramBracesMatch[3];return{type:SEGMENT_TYPE_PARAM,value:""+paramName,prefixSegment:prefix||void 0,suffixSegment:suffix||void 0}}if(PARAM_RE.test(partToMatch)){const paramName=partToMatch.substring(1);return{type:SEGMENT_TYPE_PARAM,value:"$"+paramName,prefixSegment:void 0,suffixSegment:void 0}}if(WILDCARD_RE.test(partToMatch))return{type:SEGMENT_TYPE_WILDCARD,value:"$",prefixSegment:void 0,suffixSegment:void 0};return{type:SEGMENT_TYPE_PATHNAME,value:partToMatch.includes("%25")?partToMatch.split("%25").map(segment=>decodeURI(segment)).join("%25"):decodeURI(partToMatch)}}));if("/"===pathname.slice(-1)){pathname=pathname.substring(1);segments.push({type:SEGMENT_TYPE_PATHNAME,value:"/"})}return segments}function interpolatePath({path,params,leaveWildcards,leaveParams,decodeCharMap,parseCache}){const interpolatedPathSegments=parseRoutePathSegments(path,parseCache);function encodeParam(key){const value=params[key];const isValueString="string"==typeof value;if("*"===key||"_splat"===key)return isValueString?encodeURI(value):value;return isValueString?encodePathParam(value,decodeCharMap):value}let isMissingParams=false;const usedParams={};const interpolatedPath=joinPaths(interpolatedPathSegments.map(segment=>{if(segment.type===SEGMENT_TYPE_PATHNAME)return segment.value;if(segment.type===SEGMENT_TYPE_WILDCARD){usedParams._splat=params._splat;usedParams["*"]=params._splat;const segmentPrefix=segment.prefixSegment||"";const segmentSuffix=segment.suffixSegment||"";if(!params._splat){isMissingParams=true;if(leaveWildcards)return`${segmentPrefix}${segment.value}${segmentSuffix}`;if(segmentPrefix||segmentSuffix)return`${segmentPrefix}${segmentSuffix}`;return}const value=encodeParam("_splat");if(leaveWildcards)return`${segmentPrefix}${segment.value}${value??""}${segmentSuffix}`;return`${segmentPrefix}${value}${segmentSuffix}`}if(segment.type===SEGMENT_TYPE_PARAM){const key=segment.value.substring(1);if(!isMissingParams&&!(key in params))isMissingParams=true;usedParams[key]=params[key];const segmentPrefix=segment.prefixSegment||"";const segmentSuffix=segment.suffixSegment||"";if(leaveParams){const value=encodeParam(segment.value);return`${segmentPrefix}${segment.value}${value??""}${segmentSuffix}`}return`${segmentPrefix}${encodeParam(key)??"undefined"}${segmentSuffix}`}if(segment.type===SEGMENT_TYPE_OPTIONAL_PARAM){const key=segment.value.substring(1);const segmentPrefix=segment.prefixSegment||"";const segmentSuffix=segment.suffixSegment||"";if(!(key in params)||null==params[key]){if(leaveWildcards)return`${segmentPrefix}${key}${segmentSuffix}`;if(segmentPrefix||segmentSuffix)return`${segmentPrefix}${segmentSuffix}`;return}usedParams[key]=params[key];if(leaveParams){const value=encodeParam(segment.value);return`${segmentPrefix}${segment.value}${value??""}${segmentSuffix}`}if(leaveWildcards)return`${segmentPrefix}${key}${encodeParam(key)??""}${segmentSuffix}`;return`${segmentPrefix}${encodeParam(key)??""}${segmentSuffix}`}return segment.value}));return{usedParams,interpolatedPath,isMissingParams}}function encodePathParam(value,decodeCharMap){let encoded=encodeURIComponent(value);if(decodeCharMap)for(const[encodedChar,char]of decodeCharMap)encoded=encoded.replaceAll(encodedChar,char);return encoded}function matchPathname(currentPathname,matchLocation,parseCache){const pathParams=matchByPath(currentPathname,matchLocation,parseCache);if(matchLocation.to&&!pathParams)return;return pathParams??{}}function matchByPath(from,{to,fuzzy,caseSensitive},parseCache){const stringTo=to;const baseSegments=parseBasePathSegments(from.startsWith("/")?from:`/${from}`,parseCache);const routeSegments=parseRoutePathSegments(stringTo.startsWith("/")?stringTo:`/${stringTo}`,parseCache);const params={};const result=isMatch(baseSegments,routeSegments,params,fuzzy,caseSensitive);return result?params:void 0}function isMatch(baseSegments,routeSegments,params,fuzzy,caseSensitive){let baseIndex=0;let routeIndex=0;while(baseIndex<baseSegments.length||routeIndex<routeSegments.length){const baseSegment=baseSegments[baseIndex];const routeSegment=routeSegments[routeIndex];if(routeSegment){if(routeSegment.type===SEGMENT_TYPE_WILDCARD){const remainingBaseSegments=baseSegments.slice(baseIndex);let _splat;if(routeSegment.prefixSegment||routeSegment.suffixSegment){if(!baseSegment)return false;const prefix=routeSegment.prefixSegment||"";const suffix=routeSegment.suffixSegment||"";const baseValue=baseSegment.value;if("prefixSegment"in routeSegment){if(!baseValue.startsWith(prefix))return false}if("suffixSegment"in routeSegment){if(!baseSegments[baseSegments.length-1]?.value.endsWith(suffix))return false}let rejoinedSplat=decodeURI(joinPaths(remainingBaseSegments.map(d=>d.value)));if(prefix&&rejoinedSplat.startsWith(prefix))rejoinedSplat=rejoinedSplat.slice(prefix.length);if(suffix&&rejoinedSplat.endsWith(suffix))rejoinedSplat=rejoinedSplat.slice(0,rejoinedSplat.length-suffix.length);_splat=rejoinedSplat}else _splat=decodeURI(joinPaths(remainingBaseSegments.map(d=>d.value)));params["*"]=_splat;params["_splat"]=_splat;return true}if(routeSegment.type===SEGMENT_TYPE_PATHNAME){if("/"===routeSegment.value&&!baseSegment?.value){routeIndex++;continue}if(!baseSegment)return false;if(caseSensitive){if(routeSegment.value!==baseSegment.value)return false}else if(routeSegment.value.toLowerCase()!==baseSegment.value.toLowerCase())return false;baseIndex++;routeIndex++;continue}if(routeSegment.type===SEGMENT_TYPE_PARAM){if(!baseSegment)return false;if("/"===baseSegment.value)return false;let _paramValue="";let matched=false;if(routeSegment.prefixSegment||routeSegment.suffixSegment){const prefix=routeSegment.prefixSegment||"";const suffix=routeSegment.suffixSegment||"";const baseValue=baseSegment.value;if(prefix&&!baseValue.startsWith(prefix))return false;if(suffix&&!baseValue.endsWith(suffix))return false;let paramValue=baseValue;if(prefix&¶mValue.startsWith(prefix))paramValue=paramValue.slice(prefix.length);if(suffix&¶mValue.endsWith(suffix))paramValue=paramValue.slice(0,paramValue.length-suffix.length);_paramValue=decodeURIComponent(paramValue);matched=true}else{_paramValue=decodeURIComponent(baseSegment.value);matched=true}if(matched){params[routeSegment.value.substring(1)]=_paramValue;baseIndex++}routeIndex++;continue}if(routeSegment.type===SEGMENT_TYPE_OPTIONAL_PARAM){if(!baseSegment){routeIndex++;continue}if("/"===baseSegment.value){routeIndex++;continue}let _paramValue="";let matched=false;if(routeSegment.prefixSegment||routeSegment.suffixSegment){const prefix=routeSegment.prefixSegment||"";const suffix=routeSegment.suffixSegment||"";const baseValue=baseSegment.value;if((!prefix||baseValue.startsWith(prefix))&&(!suffix||baseValue.endsWith(suffix))){let paramValue=baseValue;if(prefix&¶mValue.startsWith(prefix))paramValue=paramValue.slice(prefix.length);if(suffix&¶mValue.endsWith(suffix))paramValue=paramValue.slice(0,paramValue.length-suffix.length);_paramValue=decodeURIComponent(paramValue);matched=true}}else{let shouldMatchOptional=true;for(let lookAhead=routeIndex+1;lookAhead<routeSegments.length;lookAhead++){const futureRouteSegment=routeSegments[lookAhead];if(futureRouteSegment?.type===SEGMENT_TYPE_PATHNAME&&futureRouteSegment.value===baseSegment.value){shouldMatchOptional=false;break}if(futureRouteSegment?.type===SEGMENT_TYPE_PARAM||futureRouteSegment?.type===SEGMENT_TYPE_WILDCARD){if(baseSegments.length<routeSegments.length)shouldMatchOptional=false;break}}if(shouldMatchOptional){_paramValue=decodeURIComponent(baseSegment.value);matched=true}}if(matched){params[routeSegment.value.substring(1)]=_paramValue;baseIndex++}routeIndex++;continue}}if(baseIndex<baseSegments.length&&routeIndex>=routeSegments.length){params["**"]=joinPaths(baseSegments.slice(baseIndex).map(d=>d.value));return!!fuzzy&&routeSegments[routeSegments.length-1]?.value!=="/"}if(routeIndex<routeSegments.length&&baseIndex>=baseSegments.length){for(let i=routeIndex;i<routeSegments.length;i++)if(routeSegments[i]?.type!==SEGMENT_TYPE_OPTIONAL_PARAM)return false}break}return true}const SLASH_SCORE=.75;const STATIC_SEGMENT_SCORE=1;const REQUIRED_PARAM_BASE_SCORE=.5;const OPTIONAL_PARAM_BASE_SCORE=.4;const WILDCARD_PARAM_BASE_SCORE=.25;const STATIC_AFTER_DYNAMIC_BONUS_SCORE=.2;const BOTH_PRESENCE_BASE_SCORE=.05;const PREFIX_PRESENCE_BASE_SCORE=.02;const SUFFIX_PRESENCE_BASE_SCORE=.01;const PREFIX_LENGTH_SCORE_MULTIPLIER=2e-4;const SUFFIX_LENGTH_SCORE_MULTIPLIER=1e-4;function handleParam(segment,baseScore){if(segment.prefixSegment&&segment.suffixSegment)return baseScore+BOTH_PRESENCE_BASE_SCORE+PREFIX_LENGTH_SCORE_MULTIPLIER*segment.prefixSegment.length+SUFFIX_LENGTH_SCORE_MULTIPLIER*segment.suffixSegment.length;if(segment.prefixSegment)return baseScore+PREFIX_PRESENCE_BASE_SCORE+PREFIX_LENGTH_SCORE_MULTIPLIER*segment.prefixSegment.length;if(segment.suffixSegment)return baseScore+SUFFIX_PRESENCE_BASE_SCORE+SUFFIX_LENGTH_SCORE_MULTIPLIER*segment.suffixSegment.length;return baseScore}function sortRoutes(routes){const scoredRoutes=[];routes.forEach((d,i)=>{if(d.isRoot||!d.path)return;const trimmed=trimPathLeft(d.fullPath);let parsed=parseRoutePathSegments(trimmed);let skip=0;while(parsed.length>skip+1&&parsed[skip]?.value==="/")skip++;if(skip>0)parsed=parsed.slice(skip);let optionalParamCount=0;let hasStaticAfter=false;const scores=parsed.map((segment,index)=>{if("/"===segment.value)return SLASH_SCORE;if(segment.type===SEGMENT_TYPE_PATHNAME)return STATIC_SEGMENT_SCORE;let baseScore;if(segment.type===SEGMENT_TYPE_PARAM)baseScore=REQUIRED_PARAM_BASE_SCORE;else if(segment.type===SEGMENT_TYPE_OPTIONAL_PARAM){baseScore=OPTIONAL_PARAM_BASE_SCORE;optionalParamCount++}else baseScore=WILDCARD_PARAM_BASE_SCORE;for(let i2=index+1;i2<parsed.length;i2++){const nextSegment=parsed[i2];if(nextSegment.type===SEGMENT_TYPE_PATHNAME&&"/"!==nextSegment.value){hasStaticAfter=true;return handleParam(segment,baseScore+STATIC_AFTER_DYNAMIC_BONUS_SCORE)}}return handleParam(segment,baseScore)});scoredRoutes.push({child:d,trimmed,parsed,index:i,scores,optionalParamCount,hasStaticAfter})});const flatRoutes=scoredRoutes.sort((a,b)=>{const minLength=Math.min(a.scores.length,b.scores.length);for(let i=0;i<minLength;i++)if(a.scores[i]!==b.scores[i])return b.scores[i]-a.scores[i];if(a.scores.length!==b.scores.length){if(a.optionalParamCount!==b.optionalParamCount){if(a.hasStaticAfter===b.hasStaticAfter)return a.optionalParamCount-b.optionalParamCount;else if(a.hasStaticAfter&&!b.hasStaticAfter)return -1;else if(!a.hasStaticAfter&&b.hasStaticAfter)return 1}return b.scores.length-a.scores.length}for(let i=0;i<minLength;i++)if(a.parsed[i].value!==b.parsed[i].value)return a.parsed[i].value>b.parsed[i].value?1:-1;return a.index-b.index}).map((d,i)=>{d.child.rank=i;return d.child});return flatRoutes}function processRouteTree({routeTree,initRoute}){const routesById={};const routesByPath={};const recurseRoutes=childRoutes=>{childRoutes.forEach((childRoute,i)=>{initRoute?.(childRoute,i);const existingRoute=routesById[childRoute.id];(0,tiny_invariant.A)(!existingRoute,`Duplicate routes found with id: ${String(childRoute.id)}`);routesById[childRoute.id]=childRoute;if(!childRoute.isRoot&&childRoute.path){const trimmedFullPath=trimPathRight(childRoute.fullPath);if(!routesByPath[trimmedFullPath]||childRoute.fullPath.endsWith("/"))routesByPath[trimmedFullPath]=childRoute}const children=childRoute.children;if(children?.length)recurseRoutes(children)})};recurseRoutes([routeTree]);const flatRoutes=sortRoutes(Object.values(routesById));return{routesById,routesByPath,flatRoutes}}function not_found_notFound(options={}){options.isNotFound=true;if(options.throw)throw options;return options}function isNotFound(obj){return!!obj?.isNotFound}function getSafeSessionStorage(){try{if("undefined"!=typeof window&&"object"==typeof window.sessionStorage)return window.sessionStorage}catch{}}const scroll_restoration_storageKey="tsr-scroll-restoration-v1_3";const throttle=(fn,wait)=>{let timeout;return(...args)=>{if(!timeout)timeout=setTimeout(()=>{fn(...args);timeout=null},wait)}};function createScrollRestorationCache(){const safeSessionStorage=getSafeSessionStorage();if(!safeSessionStorage)return null;const persistedState=safeSessionStorage.getItem(scroll_restoration_storageKey);let state=persistedState?JSON.parse(persistedState):{};return{state,set:updater=>(state=functionalUpdate(updater,state)||state,safeSessionStorage.setItem(scroll_restoration_storageKey,JSON.stringify(state)))}}const scrollRestorationCache=createScrollRestorationCache();const defaultGetScrollRestorationKey=location=>location.state.__TSR_key||location.href;function getCssSelector(el){const path=[];let parent;while(parent=el.parentNode){path.push(`${el.tagName}:nth-child(${Array.prototype.indexOf.call(parent.children,el)+1})`);el=parent}return`${path.reverse().join(" > ")}`.toLowerCase()}let ignoreScroll=false;function restoreScroll({storageKey:storageKey2,key,behavior,shouldScrollRestoration,scrollToTopSelectors,location}){let byKey;try{byKey=JSON.parse(sessionStorage.getItem(storageKey2)||"{}")}catch(error){console.error(error);return}const resolvedKey=key||window.history.state?.__TSR_key;const elementEntries=byKey[resolvedKey];ignoreScroll=true;scroll:{if(shouldScrollRestoration&&elementEntries&&Object.keys(elementEntries).length>0){for(const elementSelector in elementEntries){const entry=elementEntries[elementSelector];if("window"===elementSelector)window.scrollTo({top:entry.scrollY,left:entry.scrollX,behavior});else if(elementSelector){const element=document.querySelector(elementSelector);if(element){element.scrollLeft=entry.scrollX;element.scrollTop=entry.scrollY}}}break scroll}const hash=(location??window.location).hash.split("#",2)[1];if(hash){const hashScrollIntoViewOptions=window.history.state?.__hashScrollIntoViewOptions??true;if(hashScrollIntoViewOptions){const el=document.getElementById(hash);if(el)el.scrollIntoView(hashScrollIntoViewOptions)}break scroll}const scrollOptions={top:0,left:0,behavior};window.scrollTo(scrollOptions);if(scrollToTopSelectors)for(const selector of scrollToTopSelectors){if("window"===selector)continue;const element="function"==typeof selector?selector():document.querySelector(selector);if(element)element.scrollTo(scrollOptions)}}ignoreScroll=false}function setupScrollRestoration(router,force){if(!scrollRestorationCache&&!router.isServer)return;const shouldScrollRestoration=force??router.options.scrollRestoration??false;if(shouldScrollRestoration)router.isScrollRestoring=true;if(router.isServer||router.isScrollRestorationSetup||!scrollRestorationCache)return;router.isScrollRestorationSetup=true;ignoreScroll=false;const getKey=router.options.getScrollRestorationKey||defaultGetScrollRestorationKey;window.history.scrollRestoration="manual";const onScroll=event=>{if(ignoreScroll||!router.isScrollRestoring)return;let elementSelector="";if(event.target===document||event.target===window)elementSelector="window";else{const attrId=event.target.getAttribute("data-scroll-restoration-id");elementSelector=attrId?`[data-scroll-restoration-id="${attrId}"]`:getCssSelector(event.target)}const restoreKey=getKey(router.state.location);scrollRestorationCache.set(state=>{const keyEntry=state[restoreKey]||={};const elementEntry=keyEntry[elementSelector]||={};if("window"===elementSelector){elementEntry.scrollX=window.scrollX||0;elementEntry.scrollY=window.scrollY||0}else if(elementSelector){const element=document.querySelector(elementSelector);if(element){elementEntry.scrollX=element.scrollLeft||0;elementEntry.scrollY=element.scrollTop||0}}return state})};if("undefined"!=typeof document)document.addEventListener("scroll",throttle(onScroll,100),true);router.subscribe("onRendered",event=>{const cacheKey=getKey(event.toLocation);if(!router.resetNextScroll){router.resetNextScroll=true;return}if("function"==typeof router.options.scrollRestoration){const shouldRestore=router.options.scrollRestoration({location:router.latestLocation});if(!shouldRestore)return}restoreScroll({storageKey:scroll_restoration_storageKey,key:cacheKey,behavior:router.options.scrollRestorationBehavior,shouldScrollRestoration:router.isScrollRestoring,scrollToTopSelectors:router.options.scrollToTopSelectors,location:router.history.location});if(router.isScrollRestoring)scrollRestorationCache.set(state=>{state[cacheKey]||={};return state})})}function handleHashScroll(router){if("undefined"!=typeof document&&document.querySelector){const hashScrollIntoViewOptions=router.state.location.state.__hashScrollIntoViewOptions??true;if(hashScrollIntoViewOptions&&""!==router.state.location.hash){const el=document.getElementById(router.state.location.hash);if(el)el.scrollIntoView(hashScrollIntoViewOptions)}}}function encode(obj,stringify=String){const result=new URLSearchParams;for(const key in obj){const val=obj[key];if(void 0!==val)result.set(key,stringify(val))}return result.toString()}function toValue(str){if(!str)return"";if("false"===str)return false;if("true"===str)return true;return 0*str===0&&+str+""===str?+str:str}function decode(str){const searchParams=new URLSearchParams(str);const result={};for(const[key,value]of searchParams.entries()){const previousValue=result[key];if(null==previousValue)result[key]=toValue(value);else if(Array.isArray(previousValue))previousValue.push(toValue(value));else result[key]=[previousValue,toValue(value)]}return result}const defaultParseSearch=parseSearchWith(JSON.parse);const defaultStringifySearch=stringifySearchWith(JSON.stringify,JSON.parse);function parseSearchWith(parser){return searchStr=>{if("?"===searchStr[0])searchStr=searchStr.substring(1);const query=decode(searchStr);for(const key in query){const value=query[key];if("string"==typeof value)try{query[key]=parser(value)}catch(_err){}}return query}}function stringifySearchWith(stringify,parser){const hasParser="function"==typeof parser;function stringifyValue(val){if("object"==typeof val&&null!==val)try{return stringify(val)}catch(_err){}else if(hasParser&&"string"==typeof val)try{parser(val);return stringify(val)}catch(_err){}return val}return search=>{const searchStr=encode(search,stringifyValue);return searchStr?`?${searchStr}`:""}}function redirect(opts){opts.statusCode=opts.statusCode||opts.code||307;if(!opts.reloadDocument&&"string"==typeof opts.href)try{new URL(opts.href);opts.reloadDocument=true}catch{}const headers=new Headers(opts.headers);if(opts.href&&null===headers.get("Location"))headers.set("Location",opts.href);const response=new Response(null,{status:opts.statusCode,headers});response.options=opts;if(opts.throw)throw response;return response}function isRedirect(obj){return obj instanceof Response&&!!obj.options}function createLRUCache(max){const cache=/* @__PURE__ */new Map;let oldest;let newest;const touch=entry=>{if(!entry.next)return;if(entry.prev){entry.prev.next=entry.next;entry.next.prev=entry.prev;entry.next=void 0;if(newest){newest.next=entry;entry.prev=newest}}else{entry.next.prev=void 0;oldest=entry.next;entry.next=void 0;if(newest){entry.prev=newest;newest.next=entry}}newest=entry};return{get(key){const entry=cache.get(key);if(!entry)return;touch(entry);return entry.value},set(key,value){if(cache.size>=max&&oldest){const toDelete=oldest;cache.delete(toDelete.key);if(toDelete.next){oldest=toDelete.next;toDelete.next.prev=void 0}if(toDelete===newest)newest=void 0}const existing=cache.get(key);if(existing){existing.value=value;touch(existing)}else{const entry={key,value,prev:newest};if(newest)newest.next=entry;newest=entry;if(!oldest)oldest=entry;cache.set(key,entry)}}}}const triggerOnReady=inner=>{if(!inner.rendered){inner.rendered=true;return inner.onReady?.()}};const resolvePreload=(inner,matchId)=>!!(inner.preload&&!inner.router.state.matches.some(d=>d.id===matchId));const _handleNotFound=(inner,err)=>{const routeCursor=inner.router.routesById[err.routeId??""]??inner.router.routeTree;if(!routeCursor.options.notFoundComponent&&inner.router.options?.defaultNotFoundComponent)routeCursor.options.notFoundComponent=inner.router.options.defaultNotFoundComponent;(0,tiny_invariant.A)(routeCursor.options.notFoundComponent,"No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.");const matchForRoute=inner.matches.find(m=>m.routeId===routeCursor.id);(0,tiny_invariant.A)(matchForRoute,"Could not find match for route: "+routeCursor.id);inner.updateMatch(matchForRoute.id,prev=>({...prev,status:"notFound",error:err,isFetching:false}));if("BEFORE_LOAD"===err.routerCode&&routeCursor.parentRoute){err.routeId=routeCursor.parentRoute.id;_handleNotFound(inner,err)}};const handleRedirectAndNotFound=(inner,match,err)=>{if(!isRedirect(err)&&!isNotFound(err))return;if(isRedirect(err)&&err.redirectHandled&&!err.options.reloadDocument)throw err;if(match){match._nonReactive.beforeLoadPromise?.resolve();match._nonReactive.loaderPromise?.resolve();match._nonReactive.beforeLoadPromise=void 0;match._nonReactive.loaderPromise=void 0;const status=isRedirect(err)?"redirected":"notFound";inner.updateMatch(match.id,prev=>({...prev,status,isFetching:false,error:err}));if(isNotFound(err)&&!err.routeId)err.routeId=match.routeId;match._nonReactive.loadPromise?.resolve()}if(isRedirect(err)){inner.rendered=true;err.options._fromLocation=inner.location;err.redirectHandled=true;err=inner.router.resolveRedirect(err);throw err}_handleNotFound(inner,err);throw err};const shouldSkipLoader=(inner,matchId)=>{const match=inner.router.getMatch(matchId);if(!inner.router.isServer&&match._nonReactive.dehydrated)return true;if(inner.router.isServer&&false===match.ssr)return true;return false};const handleSerialError=(inner,index,err,routerCode)=>{const{id:matchId,routeId}=inner.matches[index];const route=inner.router.looseRoutesById[routeId];if(err instanceof Promise)throw err;err.routerCode=routerCode;inner.firstBadMatchIndex??=index;handleRedirectAndNotFound(inner,inner.router.getMatch(matchId),err);try{route.options.onError?.(err)}catch(errorHandlerErr){err=errorHandlerErr;handleRedirectAndNotFound(inner,inner.router.getMatch(matchId),err)}inner.updateMatch(matchId,prev=>{prev._nonReactive.beforeLoadPromise?.resolve();prev._nonReactive.beforeLoadPromise=void 0;prev._nonReactive.loadPromise?.resolve();return{...prev,error:err,status:"error",isFetching:false,updatedAt:Date.now(),abortController:new AbortController}})};const isBeforeLoadSsr=(inner,matchId,index,route)=>{const existingMatch=inner.router.getMatch(matchId);const parentMatchId=inner.matches[index-1]?.id;const parentMatch=parentMatchId?inner.router.getMatch(parentMatchId):void 0;if(inner.router.isShell()){existingMatch.ssr=matchId===rootRouteId;return}if(parentMatch?.ssr===false){existingMatch.ssr=false;return}const parentOverride=tempSsr2=>{if(true===tempSsr2&&parentMatch?.ssr==="data-only")return"data-only";return tempSsr2};const defaultSsr=inner.router.options.defaultSsr??true;if(void 0===route.options.ssr){existingMatch.ssr=parentOverride(defaultSsr);return}if("function"!=typeof route.options.ssr){existingMatch.ssr=parentOverride(route.options.ssr);return}const{search,params}=existingMatch;const ssrFnContext={search:makeMaybe(search,existingMatch.searchError),params:makeMaybe(params,existingMatch.paramsError),location:inner.location,matches:inner.matches.map(match=>({index:match.index,pathname:match.pathname,fullPath:match.fullPath,staticData:match.staticData,id:match.id,routeId:match.routeId,search:makeMaybe(match.search,match.searchError),params:makeMaybe(match.params,match.paramsError),ssr:match.ssr}))};const tempSsr=route.options.ssr(ssrFnContext);if(isPromise(tempSsr))return tempSsr.then(ssr=>{existingMatch.ssr=parentOverride(ssr??defaultSsr)});existingMatch.ssr=parentOverride(tempSsr??defaultSsr)};const setupPendingTimeout=(inner,matchId,route,match)=>{if(void 0!==match._nonReactive.pendingTimeout)return;const pendingMs=route.options.pendingMs??inner.router.options.defaultPendingMs;const shouldPending=!!(inner.onReady&&!inner.router.isServer&&!resolvePreload(inner,matchId)&&(route.options.loader||route.options.beforeLoad||routeNeedsPreload(route))&&"number"==typeof pendingMs&&pendingMs!==1/0&&(route.options.pendingComponent??inner.router.options?.defaultPendingComponent));if(shouldPending){const pendingTimeout=setTimeout(()=>{triggerOnReady(inner)},pendingMs);match._nonReactive.pendingTimeout=pendingTimeout}};const preBeforeLoadSetup=(inner,matchId,route)=>{const existingMatch=inner.router.getMatch(matchId);if(!existingMatch._nonReactive.beforeLoadPromise&&!existingMatch._nonReactive.loaderPromise)return;setupPendingTimeout(inner,matchId,route,existingMatch);const then=()=>{const match=inner.router.getMatch(matchId);if(match.preload&&("redirected"===match.status||"notFound"===match.status))handleRedirectAndNotFound(inner,match,match.error)};return existingMatch._nonReactive.beforeLoadPromise?existingMatch._nonReactive.beforeLoadPromise.then(then):then()};const executeBeforeLoad=(inner,matchId,index,route)=>{const match=inner.router.getMatch(matchId);const prevLoadPromise=match._nonReactive.loadPromise;match._nonReactive.loadPromise=createControlledPromise(()=>{prevLoadPromise?.resolve()});const{paramsError,searchError}=match;if(paramsError)handleSerialError(inner,index,paramsError,"PARSE_PARAMS");if(searchError)handleSerialError(inner,index,searchError,"VALIDATE_SEARCH");setupPendingTimeout(inner,matchId,route,match);const abortController=new AbortController;const parentMatchId=inner.matches[index-1]?.id;const parentMatch=parentMatchId?inner.router.getMatch(parentMatchId):void 0;const parentMatchContext=parentMatch?.context??inner.router.options.context??void 0;const context={...parentMatchContext,...match.__routeContext};let isPending=false;const pending=()=>{if(isPending)return;isPending=true;inner.updateMatch(matchId,prev=>({...prev,isFetching:"beforeLoad",fetchCount:prev.fetchCount+1,abortController,context}))};const resolve=()=>{match._nonReactive.beforeLoadPromise?.resolve();match._nonReactive.beforeLoadPromise=void 0;inner.updateMatch(matchId,prev=>({...prev,isFetching:false}))};if(!route.options.beforeLoad)return void batch(()=>{pending();resolve()});match._nonReactive.beforeLoadPromise=createControlledPromise();const{search,params,cause}=match;const preload=resolvePreload(inner,matchId);const beforeLoadFnContext={search,abortController,params,preload,context,location:inner.location,navigate:opts=>inner.router.navigate({...opts,_fromLocation:inner.location}),buildLocation:inner.router.buildLocation,cause:preload?"preload":cause,matches:inner.matches,...inner.router.options.additionalContext};const updateContext=beforeLoadContext2=>{if(void 0===beforeLoadContext2)return void batch(()=>{pending();resolve()});if(isRedirect(beforeLoadContext2)||isNotFound(beforeLoadContext2)){pending();handleSerialError(inner,index,beforeLoadContext2,"BEFORE_LOAD")}batch(()=>{pending();inner.updateMatch(matchId,prev=>({...prev,__beforeLoadContext:beforeLoadContext2,context:{...prev.context,...beforeLoadContext2}}));resolve()})};let beforeLoadContext;try{beforeLoadContext=route.options.beforeLoad(beforeLoadFnContext);if(isPromise(beforeLoadContext)){pending();return beforeLoadContext.catch(err=>{handleSerialError(inner,index,err,"BEFORE_LOAD")}).then(updateContext)}}catch(err){pending();handleSerialError(inner,index,err,"BEFORE_LOAD")}updateContext(beforeLoadContext)};const handleBeforeLoad=(inner,index)=>{const{id:matchId,routeId}=inner.matches[index];const route=inner.router.looseRoutesById[routeId];const serverSsr=()=>{if(inner.router.isServer){const maybePromise=isBeforeLoadSsr(inner,matchId,index,route);if(isPromise(maybePromise))return maybePromise.then(queueExecution)}return queueExecution()};const execute=()=>executeBeforeLoad(inner,matchId,index,route);const queueExecution=()=>{if(shouldSkipLoader(inner,matchId))return;const result=preBeforeLoadSetup(inner,matchId,route);return isPromise(result)?result.then(execute):execute()};return serverSsr()};const executeHead=(inner,matchId,route)=>{const match=inner.router.getMatch(matchId);if(!match)return;if(!route.options.head&&!route.options.scripts&&!route.options.headers)return;const assetContext={matches:inner.matches,match,params:match.params,loaderData:match.loaderData};return Promise.all([route.options.head?.(assetContext),route.options.scripts?.(assetContext),route.options.headers?.(assetContext)]).then(([headFnContent,scripts,headers])=>{const meta=headFnContent?.meta;const links=headFnContent?.links;const headScripts=headFnContent?.scripts;const styles=headFnContent?.styles;return{meta,links,headScripts,headers,scripts,styles}})};const getLoaderContext=(inner,matchId,index,route)=>{const parentMatchPromise=inner.matchPromises[index-1];const{params,loaderDeps,abortController,context,cause}=inner.router.getMatch(matchId);const preload=resolvePreload(inner,matchId);return{params,deps:loaderDeps,preload:!!preload,parentMatchPromise,abortController,context,location:inner.location,navigate:opts=>inner.router.navigate({...opts,_fromLocation:inner.location}),cause:preload?"preload":cause,route,...inner.router.options.additionalContext}};const runLoader=async(inner,matchId,index,route)=>{try{const match=inner.router.getMatch(matchId);try{if(!inner.router.isServer||true===match.ssr)loadRouteChunk(route);const loaderResult=route.options.loader?.(getLoaderContext(inner,matchId,index,route));const loaderResultIsPromise=route.options.loader&&isPromise(loaderResult);const willLoadSomething=!!(loaderResultIsPromise||route._lazyPromise||route._componentsPromise||route.options.head||route.options.scripts||route.options.headers||match._nonReactive.minPendingPromise);if(willLoadSomething)inner.updateMatch(matchId,prev=>({...prev,isFetching:"loader"}));if(route.options.loader){const loaderData=loaderResultIsPromise?await loaderResult:loaderResult;handleRedirectAndNotFound(inner,inner.router.getMatch(matchId),loaderData);if(void 0!==loaderData)inner.updateMatch(matchId,prev=>({...prev,loaderData}))}if(route._lazyPromise)await route._lazyPromise;const headResult=executeHead(inner,matchId,route);const head=headResult?await headResult:void 0;const pendingPromise=match._nonReactive.minPendingPromise;if(pendingPromise)await pendingPromise;if(route._componentsPromise)await route._componentsPromise;inner.updateMatch(matchId,prev=>({...prev,error:void 0,status:"success",isFetching:false,updatedAt:Date.now(),...head}))}catch(e){let error=e;const pendingPromise=match._nonReactive.minPendingPromise;if(pendingPromise)await pendingPromise;if(isNotFound(e))await route.options.notFoundComponent?.preload?.();handleRedirectAndNotFound(inner,inner.router.getMatch(matchId),e);try{route.options.onError?.(e)}catch(onErrorError){error=onErrorError;handleRedirectAndNotFound(inner,inner.router.getMatch(matchId),onErrorError)}const headResult=executeHead(inner,matchId,route);const head=headResult?await headResult:void 0;inner.updateMatch(matchId,prev=>({...prev,error,status:"error",isFetching:false,...head}))}}catch(err){const match=inner.router.getMatch(matchId);if(match){const headResult=executeHead(inner,matchId,route);if(headResult){const head=await headResult;inner.updateMatch(matchId,prev=>({...prev,...head}))}match._nonReactive.loaderPromise=void 0}handleRedirectAndNotFound(inner,match,err)}};const loadRouteMatch=async(inner,index)=>{const{id:matchId,routeId}=inner.matches[index];let loaderShouldRunAsync=false;let loaderIsRunningAsync=false;const route=inner.router.looseRoutesById[routeId];if(shouldSkipLoader(inner,matchId)){if(inner.router.isServer){const headResult=executeHead(inner,matchId,route);if(headResult){const head=await headResult;inner.updateMatch(matchId,prev=>({...prev,...head}))}return inner.router.getMatch(matchId)}}else{const prevMatch=inner.router.getMatch(matchId);if(prevMatch._nonReactive.loaderPromise){if("success"===prevMatch.status&&!inner.sync&&!prevMatch.preload)return prevMatch;await prevMatch._nonReactive.loaderPromise;const match2=inner.router.getMatch(matchId);if(match2.error)handleRedirectAndNotFound(inner,match2,match2.error)}else{const age=Date.now()-prevMatch.updatedAt;const preload=resolvePreload(inner,matchId);const staleAge=preload?route.options.preloadStaleTime??inner.router.options.defaultPreloadStaleTime??3e4:route.options.staleTime??inner.router.options.defaultStaleTime??0;const shouldReloadOption=route.options.shouldReload;const shouldReload="function"==typeof shouldReloadOption?shouldReloadOption(getLoaderContext(inner,matchId,index,route)):shouldReloadOption;const nextPreload=!!preload&&!inner.router.state.matches.some(d=>d.id===matchId);const match2=inner.router.getMatch(matchId);match2._nonReactive.loaderPromise=createControlledPromise();if(nextPreload!==match2.preload)inner.updateMatch(matchId,prev=>({...prev,preload:nextPreload}));const{status,invalid}=match2;loaderShouldRunAsync="success"===status&&(invalid||(shouldReload??age>staleAge));if(preload&&false===route.options.preload);else if(loaderShouldRunAsync&&!inner.sync){loaderIsRunningAsync=true;(async()=>{try{await runLoader(inner,matchId,index,route);const match3=inner.router.getMatch(matchId);match3._nonReactive.loaderPromise?.resolve();match3._nonReactive.loadPromise?.resolve();match3._nonReactive.loaderPromise=void 0}catch(err){if(isRedirect(err))await inner.router.navigate(err.options)}})()}else if("success"!==status||loaderShouldRunAsync&&inner.sync)await runLoader(inner,matchId,index,route);else{const headResult=executeHead(inner,matchId,route);if(headResult){const head=await headResult;inner.updateMatch(matchId,prev=>({...prev,...head}))}}}}const match=inner.router.getMatch(matchId);if(!loaderIsRunningAsync){match._nonReactive.loaderPromise?.resolve();match._nonReactive.loadPromise?.resolve()}clearTimeout(match._nonReactive.pendingTimeout);match._nonReactive.pendingTimeout=void 0;if(!loaderIsRunningAsync)match._nonReactive.loaderPromise=void 0;match._nonReactive.dehydrated=void 0;const nextIsFetching=loaderIsRunningAsync?match.isFetching:false;if(nextIsFetching===match.isFetching&&false===match.invalid)return match;inner.updateMatch(matchId,prev=>({...prev,isFetching:nextIsFetching,invalid:false}));return inner.router.getMatch(matchId)};async function loadMatches(arg){const inner=Object.assign(arg,{matchPromises:[]});if(!inner.router.isServer&&inner.router.state.matches.some(d=>d._forcePending))triggerOnReady(inner);try{for(let i=0;i<inner.matches.length;i++){const beforeLoad=handleBeforeLoad(inner,i);if(isPromise(beforeLoad))await beforeLoad}const max=inner.firstBadMatchIndex??inner.matches.length;for(let i=0;i<max;i++)inner.matchPromises.push(loadRouteMatch(inner,i));await Promise.all(inner.matchPromises);const readyPromise=triggerOnReady(inner);if(isPromise(readyPromise))await readyPromise}catch(err){if(isNotFound(err)&&!inner.preload){const readyPromise=triggerOnReady(inner);if(isPromise(readyPromise))await readyPromise;throw err}if(isRedirect(err))throw err}return inner.matches}async function loadRouteChunk(route){if(!route._lazyLoaded&&void 0===route._lazyPromise)if(route.lazyFn)route._lazyPromise=route.lazyFn().then(lazyRoute=>{const{id:_id,...options}=lazyRoute.options;Object.assign(route.options,options);route._lazyLoaded=true;route._lazyPromise=void 0});else route._lazyLoaded=true;if(!route._componentsLoaded&&void 0===route._componentsPromise){const loadComponents=()=>{const preloads=[];for(const type of componentTypes){const preload=route.options[type]?.preload;if(preload)preloads.push(preload())}if(preloads.length)return Promise.all(preloads).then(()=>{route._componentsLoaded=true;route._componentsPromise=void 0});route._componentsLoaded=true;route._componentsPromise=void 0};route._componentsPromise=route._lazyPromise?route._lazyPromise.then(loadComponents):loadComponents()}return route._componentsPromise}function makeMaybe(value,error){if(error)return{status:"error",error};return{status:"success",value}}function routeNeedsPreload(route){for(const componentType of componentTypes)if(route.options[componentType]?.preload)return true;return false}const componentTypes=["component","errorComponent","pendingComponent","notFoundComponent"];function composeRewrites(rewrites){return{input:({url})=>{for(const rewrite of rewrites)url=executeRewriteInput(rewrite,url);return url},output:({url})=>{for(let i=rewrites.length-1;i>=0;i--)url=executeRewriteOutput(rewrites[i],url);return url}}}function rewriteBasepath(opts){const trimmedBasepath=trimPath(opts.basepath);const normalizedBasepath=`/${trimmedBasepath}`;const normalizedBasepathWithSlash=`${normalizedBasepath}/`;const checkBasepath=opts.caseSensitive?normalizedBasepath:normalizedBasepath.toLowerCase();const checkBasepathWithSlash=opts.caseSensitive?normalizedBasepathWithSlash:normalizedBasepathWithSlash.toLowerCase();return{input:({url})=>{const pathname=opts.caseSensitive?url.pathname:url.pathname.toLowerCase();if(pathname===checkBasepath)url.pathname="/";else if(pathname.startsWith(checkBasepathWithSlash))url.pathname=url.pathname.slice(normalizedBasepath.length);return url},output:({url})=>{url.pathname=joinPaths(["/",trimmedBasepath,url.pathname]);return url}}}function executeRewriteInput(rewrite,url){const res=rewrite?.input?.({url});if(res){if("string"==typeof res)return new URL(res);else if(res instanceof URL)return res}return url}function executeRewriteOutput(rewrite,url){const res=rewrite?.output?.({url});if(res){if("string"==typeof res)return new URL(res);else if(res instanceof URL)return res}return url}function defaultSerializeError(err){if(err instanceof Error){const obj={name:err.name,message:err.message};return obj}return{data:err}}function getLocationChangeInfo(routerState){const fromLocation=routerState.resolvedLocation;const toLocation=routerState.location;const pathChanged=fromLocation?.pathname!==toLocation.pathname;const hrefChanged=fromLocation?.href!==toLocation.href;const hashChanged=fromLocation?.hash!==toLocation.hash;return{fromLocation,toLocation,pathChanged,hrefChanged,hashChanged}}class RouterCore{constructor(options){this.tempLocationKey=`${Math.round(1e7*Math.random())}`;this.resetNextScroll=true;this.shouldViewTransition=void 0;this.isViewTransitionTypesSupported=void 0;this.subscribers=/* @__PURE__ */new Set;this.isScrollRestoring=false;this.isScrollRestorationSetup=false;this.startTransition=fn=>fn();this.update=newOptions=>{if(newOptions.notFoundRoute)console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const prevOptions=this.options;const prevBasepath=this.basepath??prevOptions?.basepath??"/";const basepathWasUnset=void 0===this.basepath;const prevRewriteOption=prevOptions?.rewrite;this.options={...prevOptions,...newOptions};this.isServer=this.options.isServer??"undefined"==typeof document;this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(char=>[encodeURIComponent(char),char])):void 0;if(!this.history||this.options.history&&this.options.history!==this.history){if(this.options.history)this.history=this.options.history;else if(!this.isServer)this.history=createBrowserHistory()}this.origin=this.options.origin;if(!this.origin)if(!this.isServer&&window?.origin&&"null"!==window.origin)this.origin=window.origin;else this.origin="http://localhost";if(this.history)this.updateLatestLocation();if(this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;this.buildRouteTree()}if(!this.__store&&this.latestLocation){this.__store=new Store(getInitialRouterState(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}});setupScrollRestoration(this)}let needsLocationUpdate=false;const nextBasepath=this.options.basepath??"/";const nextRewriteOption=this.options.rewrite;const basepathChanged=basepathWasUnset||prevBasepath!==nextBasepath;const rewriteChanged=prevRewriteOption!==nextRewriteOption;if(basepathChanged||rewriteChanged){this.basepath=nextBasepath;const rewrites=[];if(""!==trimPath(nextBasepath))rewrites.push(rewriteBasepath({basepath:nextBasepath}));if(nextRewriteOption)rewrites.push(nextRewriteOption);this.rewrite=0===rewrites.length?void 0:1===rewrites.length?rewrites[0]:composeRewrites(rewrites);if(this.history)this.updateLatestLocation();needsLocationUpdate=true}if(needsLocationUpdate&&this.__store)this.__store.state={...this.state,location:this.latestLocation};if("undefined"!=typeof window&&"CSS"in window&&"function"==typeof window.CSS?.supports)this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)")};this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)};this.buildRouteTree=()=>{const{routesById,routesByPath,flatRoutes}=processRouteTree({routeTree:this.routeTree,initRoute:(route,i)=>{route.init({originalIndex:i})}});this.routesById=routesById;this.routesByPath=routesByPath;this.flatRoutes=flatRoutes;const notFoundRoute=this.options.notFoundRoute;if(notFoundRoute){notFoundRoute.init({originalIndex:0x174876e7ff});this.routesById[notFoundRoute.id]=notFoundRoute}};this.subscribe=(eventType,fn)=>{const listener={eventType,fn};this.subscribers.add(listener);return()=>{this.subscribers.delete(listener)}};this.emit=routerEvent=>{this.subscribers.forEach(listener=>{if(listener.eventType===routerEvent.type)listener.fn(routerEvent)})};this.parseLocation=(locationToParse,previousLocation)=>{const parse=({href,state})=>{const fullUrl=new URL(href,this.origin);const url=executeRewriteInput(this.rewrite,fullUrl);const parsedSearch=this.options.parseSearch(url.search);const searchStr=this.options.stringifySearch(parsedSearch);url.search=searchStr;const fullPath=url.href.replace(url.origin,"");const{pathname,hash}=url;return{href:fullPath,publicHref:href,url:url.href,pathname,searchStr,search:replaceEqualDeep(previousLocation?.search,parsedSearch),hash:hash.split("#").reverse()[0]??"",state:replaceEqualDeep(previousLocation?.state,state)}};const location=parse(locationToParse);const{__tempLocation,__tempKey}=location.state;if(__tempLocation&&(!__tempKey||__tempKey===this.tempLocationKey)){const parsedTempLocation=parse(__tempLocation);parsedTempLocation.state.key=location.state.key;parsedTempLocation.state.__TSR_key=location.state.__TSR_key;delete parsedTempLocation.state.__tempLocation;return{...parsedTempLocation,maskedLocation:location}}return location};this.resolvePathWithBase=(from,path)=>{const resolvedPath=resolvePath({base:from,to:cleanPath(path),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache});return resolvedPath};this.matchRoutes=(pathnameOrNext,locationSearchOrOpts,opts)=>{if("string"==typeof pathnameOrNext)return this.matchRoutesInternal({pathname:pathnameOrNext,search:locationSearchOrOpts},opts);return this.matchRoutesInternal(pathnameOrNext,locationSearchOrOpts)};this.parsePathnameCache=createLRUCache(1e3);this.getMatchedRoutes=(pathname,routePathname)=>getMatchedRoutes({pathname,routePathname,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache});this.cancelMatch=id=>{const match=this.getMatch(id);if(!match)return;match.abortController.abort();clearTimeout(match._nonReactive.pendingTimeout);match._nonReactive.pendingTimeout=void 0};this.cancelMatches=()=>{this.state.pendingMatches?.forEach(match=>{this.cancelMatch(match.id)})};this.buildLocation=opts=>{const build=(dest={})=>{const currentLocation=dest._fromLocation||this.latestLocation;const allCurrentLocationMatches=this.matchRoutes(currentLocation,{_buildLocation:true});const lastMatch=last(allCurrentLocationMatches);dest.from;const defaultedFromPath="path"===dest.unsafeRelative?currentLocation.pathname:dest.from??lastMatch.fullPath;const fromPath=this.resolvePathWithBase(defaultedFromPath,".");const fromSearch=lastMatch.search;const fromParams={...lastMatch.params};const nextTo=dest.to?this.resolvePathWithBase(fromPath,`${dest.to}`):this.resolvePathWithBase(fromPath,".");const nextParams=false===dest.params||null===dest.params?{}:(dest.params??true)===true?fromParams:Object.assign(fromParams,functionalUpdate(dest.params,fromParams));const interpolatedNextTo=interpolatePath({path:nextTo,params:nextParams,parseCache:this.parsePathnameCache}).interpolatedPath;const destRoutes=this.matchRoutes(interpolatedNextTo,void 0,{_buildLocation:true}).map(d=>this.looseRoutesById[d.routeId]);if(Object.keys(nextParams).length>0)for(const route of destRoutes){const fn=route.options.params?.stringify??route.options.stringifyParams;if(fn)Object.assign(nextParams,fn(nextParams))}const nextPathname=interpolatePath({path:nextTo,params:nextParams,leaveWildcards:false,leaveParams:opts.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath;let nextSearch=fromSearch;if(opts._includeValidateSearch&&this.options.search?.strict){const validatedSearch={};destRoutes.forEach(route=>{if(route.options.validateSearch)try{Object.assign(validatedSearch,validateSearch(route.options.validateSearch,{...validatedSearch,...nextSearch}))}catch{}});nextSearch=validatedSearch}nextSearch=applySearchMiddleware({search:nextSearch,dest,destRoutes,_includeValidateSearch:opts._includeValidateSearch});nextSearch=replaceEqualDeep(fromSearch,nextSearch);const searchStr=this.options.stringifySearch(nextSearch);const hash=true===dest.hash?currentLocation.hash:dest.hash?functionalUpdate(dest.hash,currentLocation.hash):void 0;const hashStr=hash?`#${hash}`:"";let nextState=true===dest.state?currentLocation.state:dest.state?functionalUpdate(dest.state,currentLocation.state):{};nextState=replaceEqualDeep(currentLocation.state,nextState);const fullPath=`${nextPathname}${searchStr}${hashStr}`;const url=new URL(fullPath,this.origin);const rewrittenUrl=executeRewriteOutput(this.rewrite,url);return{publicHref:rewrittenUrl.pathname+rewrittenUrl.search+rewrittenUrl.hash,href:fullPath,url:rewrittenUrl.href,pathname:nextPathname,search:nextSearch,searchStr,state:nextState,hash:hash??"",unmaskOnReload:dest.unmaskOnReload}};const buildWithMatches=(dest={},maskedDest)=>{const next=build(dest);let maskedNext=maskedDest?build(maskedDest):void 0;if(!maskedNext){let params={};const foundMask=this.options.routeMasks?.find(d=>{const match=matchPathname(next.pathname,{to:d.from,caseSensitive:false,fuzzy:false},this.parsePathnameCache);if(match){params=match;return true}return false});if(foundMask){const{from:_from,...maskProps}=foundMask;maskedDest={from:opts.from,...maskProps,params};maskedNext=build(maskedDest)}}if(maskedNext)next.maskedLocation=maskedNext;return next};if(opts.mask)return buildWithMatches(opts,{from:opts.from,...opts.mask});return buildWithMatches(opts)};this.commitLocation=({viewTransition,ignoreBlocker,...next})=>{const isSameState=()=>{const ignoredProps=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];ignoredProps.forEach(prop=>{next.state[prop]=this.latestLocation.state[prop]});const isEqual=deepEqual(next.state,this.latestLocation.state);ignoredProps.forEach(prop=>{delete next.state[prop]});return isEqual};const isSameUrl=trimPathRight(this.latestLocation.href)===trimPathRight(next.href);const previousCommitPromise=this.commitLocationPromise;this.commitLocationPromise=createControlledPromise(()=>{previousCommitPromise?.resolve()});if(isSameUrl&&isSameState())this.load();else{let{maskedLocation,hashScrollIntoView,...nextHistory}=next;if(maskedLocation){nextHistory={...maskedLocation,state:{...maskedLocation.state,__tempKey:void 0,__tempLocation:{...nextHistory,search:nextHistory.searchStr,state:{...nextHistory.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}};if(nextHistory.unmaskOnReload??this.options.unmaskOnReload??false)nextHistory.state.__tempKey=this.tempLocationKey}nextHistory.state.__hashScrollIntoViewOptions=hashScrollIntoView??this.options.defaultHashScrollIntoView??true;this.shouldViewTransition=viewTransition;this.history[next.replace?"replace":"push"](nextHistory.publicHref,nextHistory.state,{ignoreBlocker})}this.resetNextScroll=next.resetScroll??true;if(!this.history.subscribers.size)this.load();return this.commitLocationPromise};this.buildAndCommitLocation=({replace,resetScroll,hashScrollIntoView,viewTransition,ignoreBlocker,href,...rest}={})=>{if(href){const currentIndex=this.history.location.state.__TSR_index;const parsed=parseHref(href,{__TSR_index:replace?currentIndex:currentIndex+1});rest.to=parsed.pathname;rest.search=this.options.parseSearch(parsed.search);rest.hash=parsed.hash.slice(1)}const location=this.buildLocation({...rest,_includeValidateSearch:true});return this.commitLocation({...location,viewTransition,replace,resetScroll,hashScrollIntoView,ignoreBlocker})};this.navigate=({to,reloadDocument,href,...rest})=>{if(!reloadDocument&&href)try{new URL(`${href}`);reloadDocument=true}catch{}if(reloadDocument){if(!href){const location=this.buildLocation({to,...rest});href=location.url}if(rest.replace)window.location.replace(href);else window.location.href=href;return Promise.resolve()}return this.buildAndCommitLocation({...rest,href,to,_isNavigate:true})};this.beforeLoad=()=>{this.cancelMatches();this.updateLatestLocation();if(this.isServer){const nextLocation=this.buildLocation({to:this.latestLocation.pathname,search:true,params:true,hash:true,state:true,_includeValidateSearch:true});const normalizeUrl=url=>{try{return encodeURI(decodeURI(url))}catch{return url}};if(trimPath(normalizeUrl(this.latestLocation.href))!==trimPath(normalizeUrl(nextLocation.href))){let href=nextLocation.url;if(this.origin&&href.startsWith(this.origin))href=href.replace(this.origin,"")||"/";throw redirect({href})}}const pendingMatches=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:true,location:this.latestLocation,pendingMatches,cachedMatches:s.cachedMatches.filter(d=>!pendingMatches.some(e=>e.id===d.id))}))};this.load=async opts=>{let redirect2;let notFound;let loadPromise;loadPromise=new Promise(resolve=>{this.startTransition(async()=>{try{this.beforeLoad();const next=this.latestLocation;const prevLocation=this.state.resolvedLocation;if(!this.state.redirect)this.emit({type:"onBeforeNavigate",...getLocationChangeInfo({resolvedLocation:prevLocation,location:next})});this.emit({type:"onBeforeLoad",...getLocationChangeInfo({resolvedLocation:prevLocation,location:next})});await loadMatches({router:this,sync:opts?.sync,matches:this.state.pendingMatches,location:next,updateMatch:this.updateMatch,onReady:async()=>{this.startViewTransition(async()=>{let exitingMatches;let enteringMatches;let stayingMatches;batch(()=>{this.__store.setState(s=>{const previousMatches=s.matches;const newMatches=s.pendingMatches||s.matches;exitingMatches=previousMatches.filter(match=>!newMatches.some(d=>d.id===match.id));enteringMatches=newMatches.filter(match=>!previousMatches.some(d=>d.id===match.id));stayingMatches=previousMatches.filter(match=>newMatches.some(d=>d.id===match.id));return{...s,isLoading:false,loadedAt:Date.now(),matches:newMatches,pendingMatches:void 0,cachedMatches:[...s.cachedMatches,...exitingMatches.filter(d=>"error"!==d.status)]}});this.clearExpiredCache()});[[exitingMatches,"onLeave"],[enteringMatches,"onEnter"],[stayingMatches,"onStay"]].forEach(([matches,hook])=>{matches.forEach(match=>{this.looseRoutesById[match.routeId].options[hook]?.(match)})})})}})}catch(err){if(isRedirect(err)){redirect2=err;if(!this.isServer)this.navigate({...redirect2.options,replace:true,ignoreBlocker:true})}else if(isNotFound(err))notFound=err;this.__store.setState(s=>({...s,statusCode:redirect2?redirect2.status:notFound?404:s.matches.some(d=>"error"===d.status)?500:200,redirect:redirect2}))}if(this.latestLoadPromise===loadPromise){this.commitLocationPromise?.resolve();this.latestLoadPromise=void 0;this.commitLocationPromise=void 0}resolve()})});this.latestLoadPromise=loadPromise;await loadPromise;while(this.latestLoadPromise&&loadPromise!==this.latestLoadPromise)await this.latestLoadPromise;let newStatusCode;if(this.hasNotFoundMatch())newStatusCode=404;else if(this.__store.state.matches.some(d=>"error"===d.status))newStatusCode=500;if(void 0!==newStatusCode)this.__store.setState(s=>({...s,statusCode:newStatusCode}))};this.startViewTransition=fn=>{const shouldViewTransition=this.shouldViewTransition??this.options.defaultViewTransition;delete this.shouldViewTransition;if(shouldViewTransition&&"undefined"!=typeof document&&"startViewTransition"in document&&"function"==typeof document.startViewTransition){let startViewTransitionParams;if("object"==typeof shouldViewTransition&&this.isViewTransitionTypesSupported){const next=this.latestLocation;const prevLocation=this.state.resolvedLocation;const resolvedViewTransitionTypes="function"==typeof shouldViewTransition.types?shouldViewTransition.types(getLocationChangeInfo({resolvedLocation:prevLocation,location:next})):shouldViewTransition.types;if(false===resolvedViewTransitionTypes)return void fn();startViewTransitionParams={update:fn,types:resolvedViewTransitionTypes}}else startViewTransitionParams=fn;document.startViewTransition(startViewTransitionParams)}else fn()};this.updateMatch=(id,updater)=>{const matchesKey=this.state.pendingMatches?.some(d=>d.id===id)?"pendingMatches":this.state.matches.some(d=>d.id===id)?"matches":this.state.cachedMatches.some(d=>d.id===id)?"cachedMatches":"";if(matchesKey)this.__store.setState(s=>({...s,[matchesKey]:s[matchesKey]?.map(d=>d.id===id?updater(d):d)}))};this.getMatch=matchId=>{const findFn=d=>d.id===matchId;return this.state.cachedMatches.find(findFn)??this.state.pendingMatches?.find(findFn)??this.state.matches.find(findFn)};this.invalidate=opts=>{const invalidate=d=>{if(opts?.filter?.(d)??true)return{...d,invalid:true,...opts?.forcePending||"error"===d.status?{status:"pending",error:void 0}:void 0};return d};this.__store.setState(s=>({...s,matches:s.matches.map(invalidate),cachedMatches:s.cachedMatches.map(invalidate),pendingMatches:s.pendingMatches?.map(invalidate)}));this.shouldViewTransition=false;return this.load({sync:opts?.sync})};this.resolveRedirect=redirect2=>{if(!redirect2.options.href){const location=this.buildLocation(redirect2.options);let href=location.url;if(this.origin&&href.startsWith(this.origin))href=href.replace(this.origin,"")||"/";redirect2.options.href=location.href;redirect2.headers.set("Location",href)}if(!redirect2.headers.get("Location"))redirect2.headers.set("Location",redirect2.options.href);return redirect2};this.clearCache=opts=>{const filter=opts?.filter;if(void 0!==filter)this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(m=>!filter(m))}));else this.__store.setState(s=>({...s,cachedMatches:[]}))};this.clearExpiredCache=()=>{const filter=d=>{const route=this.looseRoutesById[d.routeId];if(!route.options.loader)return true;const gcTime=(d.preload?route.options.preloadGcTime??this.options.defaultPreloadGcTime:route.options.gcTime??this.options.defaultGcTime)??3e5;const isError="error"===d.status;if(isError)return true;const gcEligible=Date.now()-d.updatedAt>=gcTime;return gcEligible};this.clearCache({filter})};this.loadRouteChunk=loadRouteChunk;this.preloadRoute=async opts=>{const next=this.buildLocation(opts);let matches=this.matchRoutes(next,{throwOnError:true,preload:true,dest:opts});const activeMatchIds=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id));const loadedMatchIds=/* @__PURE__ */new Set([...activeMatchIds,...this.state.cachedMatches.map(d=>d.id)]);batch(()=>{matches.forEach(match=>{if(!loadedMatchIds.has(match.id))this.__store.setState(s=>({...s,cachedMatches:[...s.cachedMatches,match]}))})});try{matches=await loadMatches({router:this,matches,location:next,preload:true,updateMatch:(id,updater)=>{if(activeMatchIds.has(id))matches=matches.map(d=>d.id===id?updater(d):d);else this.updateMatch(id,updater)}});return matches}catch(err){if(isRedirect(err)){if(err.options.reloadDocument)return;return await this.preloadRoute({...err.options,_fromLocation:next})}if(!isNotFound(err))console.error(err);return}};this.matchRoute=(location,opts)=>{const matchLocation={...location,to:location.to?this.resolvePathWithBase(location.from||"",location.to):void 0,params:location.params||{},leaveParams:true};const next=this.buildLocation(matchLocation);if(opts?.pending&&"pending"!==this.state.status)return false;const pending=opts?.pending===void 0?!this.state.isLoading:opts.pending;const baseLocation=pending?this.latestLocation:this.state.resolvedLocation||this.state.location;const match=matchPathname(baseLocation.pathname,{...opts,to:next.pathname},this.parsePathnameCache);if(!match)return false;if(location.params){if(!deepEqual(match,location.params,{partial:true}))return false}if(match&&(opts?.includeSearch??true))return deepEqual(baseLocation.search,next.search,{partial:true})?match:false;return match};this.hasNotFoundMatch=()=>this.__store.state.matches.some(d=>"notFound"===d.status||d.globalNotFound);this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...options,caseSensitive:options.caseSensitive??false,notFoundMode:options.notFoundMode??"fuzzy",stringifySearch:options.stringifySearch??defaultStringifySearch,parseSearch:options.parseSearch??defaultParseSearch});if("undefined"!=typeof document)self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(next,opts){const{foundRoute,matchedRoutes,routeParams}=this.getMatchedRoutes(next.pathname,opts?.dest?.to);let isGlobalNotFound=false;if(foundRoute?"/"!==foundRoute.path&&routeParams["**"]:trimPathRight(next.pathname))if(this.options.notFoundRoute)matchedRoutes.push(this.options.notFoundRoute);else isGlobalNotFound=true;const globalNotFoundRouteId=(()=>{if(!isGlobalNotFound)return;if("root"!==this.options.notFoundMode)for(let i=matchedRoutes.length-1;i>=0;i--){const route=matchedRoutes[i];if(route.children)return route.id}return rootRouteId})();const matches=[];const getParentContext=parentMatch=>{const parentMatchId=parentMatch?.id;const parentContext=parentMatchId?parentMatch.context??this.options.context??void 0:this.options.context??void 0;return parentContext};matchedRoutes.forEach((route,index)=>{const parentMatch=matches[index-1];const[preMatchSearch,strictMatchSearch,searchError]=(()=>{const parentSearch=parentMatch?.search??next.search;const parentStrictSearch=parentMatch?._strictSearch??void 0;try{const strictSearch=validateSearch(route.options.validateSearch,{...parentSearch})??void 0;return[{...parentSearch,...strictSearch},{...parentStrictSearch,...strictSearch},void 0]}catch(err){let searchParamError=err;if(!(err instanceof SearchParamError))searchParamError=new SearchParamError(err.message,{cause:err});if(opts?.throwOnError)throw searchParamError;return[parentSearch,{},searchParamError]}})();const loaderDeps=route.options.loaderDeps?.({search:preMatchSearch})??"";const loaderDepsHash=loaderDeps?JSON.stringify(loaderDeps):"";const{interpolatedPath,usedParams}=interpolatePath({path:route.fullPath,params:routeParams,decodeCharMap:this.pathParamsDecodeCharMap});const matchId=interpolatePath({path:route.id,params:routeParams,leaveWildcards:true,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+loaderDepsHash;const existingMatch=this.getMatch(matchId);const previousMatch=this.state.matches.find(d=>d.routeId===route.id);const strictParams=existingMatch?._strictParams??usedParams;let paramsError;if(!existingMatch){const strictParseParams=route.options.params?.parse??route.options.parseParams;if(strictParseParams)try{Object.assign(strictParams,strictParseParams(strictParams))}catch(err){paramsError=new PathParamError(err.message,{cause:err});if(opts?.throwOnError)throw paramsError}}Object.assign(routeParams,strictParams);const cause=previousMatch?"stay":"enter";let match;if(existingMatch)match={...existingMatch,cause,params:previousMatch?replaceEqualDeep(previousMatch.params,routeParams):routeParams,_strictParams:strictParams,search:previousMatch?replaceEqualDeep(previousMatch.search,preMatchSearch):replaceEqualDeep(existingMatch.search,preMatchSearch),_strictSearch:strictMatchSearch};else{const status=route.options.loader||route.options.beforeLoad||route.lazyFn||routeNeedsPreload(route)?"pending":"success";match={id:matchId,index,routeId:route.id,params:previousMatch?replaceEqualDeep(previousMatch.params,routeParams):routeParams,_strictParams:strictParams,pathname:interpolatedPath,updatedAt:Date.now(),search:previousMatch?replaceEqualDeep(previousMatch.search,preMatchSearch):preMatchSearch,_strictSearch:strictMatchSearch,searchError:void 0,status,isFetching:false,error:void 0,paramsError,__routeContext:void 0,_nonReactive:{loadPromise:createControlledPromise()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause,loaderDeps:previousMatch?replaceEqualDeep(previousMatch.loaderDeps,loaderDeps):loaderDeps,invalid:false,preload:false,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:route.options.staticData||{},fullPath:route.fullPath}}if(!opts?.preload)match.globalNotFound=globalNotFoundRouteId===route.id;match.searchError=searchError;const parentContext=getParentContext(parentMatch);match.context={...parentContext,...match.__routeContext,...match.__beforeLoadContext};matches.push(match)});matches.forEach((match,index)=>{const route=this.looseRoutesById[match.routeId];const existingMatch=this.getMatch(match.id);if(!existingMatch&&opts?._buildLocation!==true){const parentMatch=matches[index-1];const parentContext=getParentContext(parentMatch);if(route.options.context){const contextFnContext={deps:match.loaderDeps,params:match.params,context:parentContext??{},location:next,navigate:opts2=>this.navigate({...opts2,_fromLocation:next}),buildLocation:this.buildLocation,cause:match.cause,abortController:match.abortController,preload:!!match.preload,matches};match.__routeContext=route.options.context(contextFnContext)??void 0}match.context={...parentContext,...match.__routeContext,...match.__beforeLoadContext}}});return matches}}class SearchParamError extends Error{}class PathParamError extends Error{}function router_lazyFn(fn,key){return async(...args)=>{const imported=await fn();return imported[key||"default"](...args)}}function getInitialRouterState(location){return{loadedAt:0,isLoading:false,isTransitioning:false,status:"idle",resolvedLocation:void 0,location,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function validateSearch(validateSearch2,input){if(null==validateSearch2)return{};if("~standard"in validateSearch2){const result=validateSearch2["~standard"].validate(input);if(result instanceof Promise)throw new SearchParamError("Async validation not supported");if(result.issues)throw new SearchParamError(JSON.stringify(result.issues,void 0,2),{cause:result});return result.value}if("parse"in validateSearch2)return validateSearch2.parse(input);if("function"==typeof validateSearch2)return validateSearch2(input);return{}}function getMatchedRoutes({pathname,routePathname,caseSensitive,routesByPath,routesById,flatRoutes,parseCache}){let routeParams={};const trimmedPath=trimPathRight(pathname);const getMatchedParams=route=>{const result=matchPathname(trimmedPath,{to:route.fullPath,caseSensitive:route.options?.caseSensitive??caseSensitive,fuzzy:true},parseCache);return result};let foundRoute=void 0!==routePathname?routesByPath[routePathname]:void 0;if(foundRoute)routeParams=getMatchedParams(foundRoute);else{let fuzzyMatch;for(const route of flatRoutes){const matchedParams=getMatchedParams(route);if(matchedParams)if("/"!==route.path&&matchedParams["**"]){if(!fuzzyMatch)fuzzyMatch={foundRoute:route,routeParams:matchedParams}}else{foundRoute=route;routeParams=matchedParams;break}}if(!foundRoute&&fuzzyMatch){foundRoute=fuzzyMatch.foundRoute;routeParams=fuzzyMatch.routeParams}}let routeCursor=foundRoute||routesById[rootRouteId];const matchedRoutes=[routeCursor];while(routeCursor.parentRoute){routeCursor=routeCursor.parentRoute;matchedRoutes.push(routeCursor)}matchedRoutes.reverse();return{matchedRoutes,routeParams,foundRoute}}function applySearchMiddleware({search,dest,destRoutes,_includeValidateSearch}){const allMiddlewares=destRoutes.reduce((acc,route)=>{const middlewares=[];if("search"in route.options){if(route.options.search?.middlewares)middlewares.push(...route.options.search.middlewares)}else if(route.options.preSearchFilters||route.options.postSearchFilters){const legacyMiddleware=({search:search2,next})=>{let nextSearch=search2;if("preSearchFilters"in route.options&&route.options.preSearchFilters)nextSearch=route.options.preSearchFilters.reduce((prev,next2)=>next2(prev),search2);const result=next(nextSearch);if("postSearchFilters"in route.options&&route.options.postSearchFilters)return route.options.postSearchFilters.reduce((prev,next2)=>next2(prev),result);return result};middlewares.push(legacyMiddleware)}if(_includeValidateSearch&&route.options.validateSearch){const validate=({search:search2,next})=>{const result=next(search2);try{const validatedSearch={...result,...validateSearch(route.options.validateSearch,result)??void 0};return validatedSearch}catch{return result}};middlewares.push(validate)}return acc.concat(middlewares)},[])??[];const final=({search:search2})=>{if(!dest.search)return{};if(true===dest.search)return search2;return functionalUpdate(dest.search,search2)};allMiddlewares.push(final);const applyNext=(index,currentSearch)=>{if(index>=allMiddlewares.length)return currentSearch;const middleware=allMiddlewares[index];const next=newSearch=>applyNext(index+1,newSearch);return middleware({search:currentSearch,next})};return applyNext(0,search)}const TSR_DEFERRED_PROMISE=Symbol.for("TSR_DEFERRED_PROMISE");function defer(_promise,options){const promise=_promise;if(promise[TSR_DEFERRED_PROMISE])return promise;promise[TSR_DEFERRED_PROMISE]={status:"pending"};promise.then(data=>{promise[TSR_DEFERRED_PROMISE].status="success";promise[TSR_DEFERRED_PROMISE].data=data}).catch(error=>{promise[TSR_DEFERRED_PROMISE].status="error";promise[TSR_DEFERRED_PROMISE].error={data:(options?.serializeError??defaultSerializeError)(error),__isServerError:true}});return promise}const createRouterConfig=options=>({serializationAdapters:options.serializationAdapters,defaultSsr:options.defaultSsr});var R=(a=>(a[a.AggregateError=1]="AggregateError",a[a.ArrowFunction=2]="ArrowFunction",a[a.ErrorPrototypeStack=4]="ErrorPrototypeStack",a[a.ObjectAssign=8]="ObjectAssign",a[a.BigIntTypedArray=16]="BigIntTypedArray",a))(R||{});var O="__SEROVAL_REFS__";new Map;var C=new Map;"undefined"!=typeof globalThis?Object.defineProperty(globalThis,O,{value:C,configurable:!0,writable:!1,enumerable:!1}):"undefined"!=typeof window?Object.defineProperty(window,O,{value:C,configurable:!0,writable:!1,enumerable:!1}):"undefined"!=typeof self?Object.defineProperty(self,O,{value:C,configurable:!0,writable:!1,enumerable:!1}):"undefined"!=typeof global&&Object.defineProperty(global,O,{value:C,configurable:!0,writable:!1,enumerable:!1});var production_s=void 0;function u(o,e,r,t,n,a,i,l,c,p,h,X){return{t:o,i:e,s:r,l:t,c:n,m:a,p:i,e:l,a:c,f:p,b:h,o:X}}function production_x(o){return u(2,production_s,o,production_s,production_s,production_s,production_s,production_s,production_s,production_s,production_s,production_s)}production_x(2),production_x(3),production_x(1),production_x(0),production_x(4),production_x(5),production_x(6),production_x(7);var{toString:_e}=Object.prototype;function createSerializationAdapter(opts){return opts}const Matches_isMatch=(match,path)=>{const parts=path.split(".");let part;let i=0;let value=match;while(null!=(part=parts[i++])&&null!=value)value=value[part];return null!=value};function retainSearchParams(keys){return({search,next})=>{const result=next(search);if(true===keys)return{...search,...result};keys.forEach(key=>{if(!(key in result))result[key]=search[key]});return result}}function stripSearchParams(input){return({search,next})=>{if(true===input)return{};const result=next(search);if(Array.isArray(input))input.forEach(key=>{delete result[key]});else Object.entries(input).forEach(([key,value])=>{if(deepEqual(result[key],value))delete result[key]});return result}}var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(3620);function useAwaited({promise:_promise}){const promise=defer(_promise);if("pending"===promise[TSR_DEFERRED_PROMISE].status)throw promise;if("error"===promise[TSR_DEFERRED_PROMISE].status)throw promise[TSR_DEFERRED_PROMISE].error;return[promise[TSR_DEFERRED_PROMISE].data,promise]}function Await(props){const inner=/* @__PURE__ */(0,jsx_runtime.jsx)(AwaitInner,{...props});if(props.fallback)return/* @__PURE__ */(0,jsx_runtime.jsx)(index_js_.Suspense,{fallback:props.fallback,children:inner});return inner}function AwaitInner(props){const[data]=useAwaited(props);return props.children(data)}function CatchBoundary(props){const errorComponent=props.errorComponent??ErrorComponent;return/* @__PURE__ */(0,jsx_runtime.jsx)(CatchBoundaryImpl,{getResetKey:props.getResetKey,onCatch:props.onCatch,children:({error,reset})=>{if(error)return index_js_.createElement(errorComponent,{error,reset});return props.children}})}class CatchBoundaryImpl extends index_js_.Component{constructor(){super(...arguments);this.state={error:null}}static getDerivedStateFromProps(props){return{resetKey:props.getResetKey()}}static getDerivedStateFromError(error){return{error}}reset(){this.setState({error:null})}componentDidUpdate(prevProps,prevState){if(prevState.error&&prevState.resetKey!==this.state.resetKey)this.reset()}componentDidCatch(error,errorInfo){if(this.props.onCatch)this.props.onCatch(error,errorInfo)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ErrorComponent({error}){const[show,setShow]=index_js_.useState(false);return/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[/* @__PURE__ */(0,jsx_runtime.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),/* @__PURE__ */(0,jsx_runtime.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>setShow(d=>!d),children:show?"Hide Error":"Show Error"})]}),/* @__PURE__ */(0,jsx_runtime.jsx)("div",{style:{height:".25rem"}}),show?/* @__PURE__ */(0,jsx_runtime.jsx)("div",{children:/* @__PURE__ */(0,jsx_runtime.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:error.message?/* @__PURE__ */(0,jsx_runtime.jsx)("code",{children:error.message}):null})}):null]})}function ClientOnly({children,fallback=null}){return useHydrated()?/* @__PURE__ */(0,jsx_runtime.jsx)(index_js_.Fragment,{children}):/* @__PURE__ */(0,jsx_runtime.jsx)(index_js_.Fragment,{children:fallback})}function useHydrated(){return index_js_.useSyncExternalStore(subscribe,()=>true,()=>false)}function subscribe(){return()=>{}}var isProduction=true;function warning(condition,message){if(!isProduction){if(condition)return;var text="Warning: "+message;if("undefined"!=typeof console)console.warn(text);try{throw Error(text)}catch(x){}}}const tiny_warning_esm=warning;class BaseRoute{constructor(options){this.init=opts=>{this.originalIndex=opts.originalIndex;const options2=this.options;const isRoot=!options2?.path&&!options2?.id;this.parentRoute=this.options.getParentRoute?.();if(isRoot)this._path=rootRouteId;else if(!this.parentRoute)(0,tiny_invariant.A)(false,"Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let path=isRoot?rootRouteId:options2?.path;if(path&&"/"!==path)path=trimPathLeft(path);const customId=options2?.id||path;let id=isRoot?rootRouteId:joinPaths([this.parentRoute.id===rootRouteId?"":this.parentRoute.id,customId]);if(path===rootRouteId)path="/";if(id!==rootRouteId)id=joinPaths(["/",id]);const fullPath=id===rootRouteId?"/":joinPaths([this.parentRoute.fullPath,path]);this._path=path;this._id=id;this._fullPath=fullPath;this._to=fullPath};this.clone=other=>{this._path=other._path;this._id=other._id;this._fullPath=other._fullPath;this._to=other._to;this.options.getParentRoute=other.options.getParentRoute;this.children=other.children};this.addChildren=children=>this._addFileChildren(children);this._addFileChildren=children=>{if(Array.isArray(children))this.children=children;if("object"==typeof children&&null!==children)this.children=Object.values(children);return this};this._addFileTypes=()=>this;this.updateLoader=options2=>{Object.assign(this.options,options2);return this};this.update=options2=>{Object.assign(this.options,options2);return this};this.lazy=lazyFn=>{this.lazyFn=lazyFn;return this};this.options=options||{};this.isRoot=!options?.getParentRoute;if(options?.id&&options?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class BaseRouteApi{constructor({id}){this.notFound=opts=>not_found_notFound({routeId:this.id,...opts});this.id=id}}class BaseRootRoute extends BaseRoute{constructor(options){super(options)}}var with_selector=__webpack_require__(9242);function useStore(store,selector=d=>d){const slice=(0,with_selector.useSyncExternalStoreWithSelector)(store.subscribe,()=>store.state,()=>store.state,selector,shallow);return slice}function shallow(objA,objB){if(Object.is(objA,objB))return true;if("object"!=typeof objA||null===objA||"object"!=typeof objB||null===objB)return false;if(objA instanceof Map&&objB instanceof Map){if(objA.size!==objB.size)return false;for(const[k,v]of objA)if(!objB.has(k)||!Object.is(v,objB.get(k)))return false;return true}if(objA instanceof Set&&objB instanceof Set){if(objA.size!==objB.size)return false;for(const v of objA)if(!objB.has(v))return false;return true}if(objA instanceof Date&&objB instanceof Date){if(objA.getTime()!==objB.getTime())return false;return true}const keysA=getOwnKeys(objA);if(keysA.length!==getOwnKeys(objB).length)return false;for(let i=0;i<keysA.length;i++)if(!Object.prototype.hasOwnProperty.call(objB,keysA[i])||!Object.is(objA[keysA[i]],objB[keysA[i]]))return false;return true}function getOwnKeys(obj){return Object.keys(obj).concat(Object.getOwnPropertySymbols(obj))}const routerContext_routerContext=index_js_.createContext(null);function getRouterContext(){if("undefined"==typeof document)return routerContext_routerContext;if(window.__TSR_ROUTER_CONTEXT__)return window.__TSR_ROUTER_CONTEXT__;window.__TSR_ROUTER_CONTEXT__=routerContext_routerContext;return routerContext_routerContext}function useRouter(opts){const value=index_js_.useContext(getRouterContext());tiny_warning_esm(!((opts?.warn??true)&&!value),"useRouter must be used inside a <RouterProvider> component!");return value}function useRouterState(opts){const contextRouter=useRouter({warn:opts?.router===void 0});const router=opts?.router||contextRouter;const previousResult=(0,index_js_.useRef)(void 0);return useStore(router.__store,state=>{if(opts?.select){if(opts.structuralSharing??router.options.defaultStructuralSharing){const newSlice=replaceEqualDeep(previousResult.current,opts.select(state));previousResult.current=newSlice;return newSlice}return opts.select(state)}return state})}const matchContext=index_js_.createContext(void 0);const dummyMatchContext=index_js_.createContext(void 0);function useMatch(opts){const nearestMatchId=index_js_.useContext(opts.from?dummyMatchContext:matchContext);const matchSelection=useRouterState({select:state=>{const match=state.matches.find(d=>opts.from?opts.from===d.routeId:d.id===nearestMatchId);(0,tiny_invariant.A)(!((opts.shouldThrow??true)&&!match),`Could not find ${opts.from?`an active match from "${opts.from}"`:"a nearest match!"}`);if(void 0===match)return;return opts.select?opts.select(match):match},structuralSharing:opts.structuralSharing});return matchSelection}function useLoaderData(opts){return useMatch({from:opts.from,strict:opts.strict,structuralSharing:opts.structuralSharing,select:s=>opts.select?opts.select(s.loaderData):s.loaderData})}function useLoaderDeps(opts){const{select,...rest}=opts;return useMatch({...rest,select:s=>select?select(s.loaderDeps):s.loaderDeps})}function useParams(opts){return useMatch({from:opts.from,shouldThrow:opts.shouldThrow,structuralSharing:opts.structuralSharing,strict:opts.strict,select:match=>{const params=false===opts.strict?match.params:match._strictParams;return opts.select?opts.select(params):params}})}function useSearch(opts){return useMatch({from:opts.from,strict:opts.strict,shouldThrow:opts.shouldThrow,structuralSharing:opts.structuralSharing,select:match=>opts.select?opts.select(match.search):match.search})}function useNavigate(_defaultOpts){const router=useRouter();return index_js_.useCallback(options=>router.navigate({...options,from:options.from??_defaultOpts?.from}),[_defaultOpts?.from,router])}function Navigate(props){const router=useRouter();const navigate=useNavigate();const previousPropsRef=index_js_.useRef(null);index_js_.useEffect(()=>{if(previousPropsRef.current!==props){navigate(props);previousPropsRef.current=props}},[router,props,navigate]);return null}var react_dom_index_js_=__webpack_require__(2560);const preloadWarning="Error preloading route! ☝️";function useStableCallback(fn){const fnRef=index_js_.useRef(fn);fnRef.current=fn;const ref=index_js_.useRef((...args)=>fnRef.current(...args));return ref.current}const useLayoutEffect="undefined"!=typeof window?index_js_.useLayoutEffect:index_js_.useEffect;function usePrevious(value){const ref=index_js_.useRef({value,prev:null});const current=ref.current.value;if(value!==current)ref.current={value,prev:current};return ref.current.prev}function useIntersectionObserver(ref,callback,intersectionObserverOptions={},options={}){index_js_.useEffect(()=>{if(!ref.current||options.disabled||"function"!=typeof IntersectionObserver)return;const observer=new IntersectionObserver(([entry])=>{callback(entry)},intersectionObserverOptions);observer.observe(ref.current);return()=>{observer.disconnect()}},[callback,intersectionObserverOptions,options.disabled,ref])}function useForwardedRef(ref){const innerRef=index_js_.useRef(null);index_js_.useImperativeHandle(ref,()=>innerRef.current,[]);return innerRef}function useLinkProps(options,forwardedRef){const router=useRouter();const[isTransitioning,setIsTransitioning]=index_js_.useState(false);const hasRenderFetched=index_js_.useRef(false);const innerRef=useForwardedRef(forwardedRef);const{activeProps,inactiveProps,activeOptions,to,preload:userPreload,preloadDelay:userPreloadDelay,hashScrollIntoView,replace,startTransition,resetScroll,viewTransition,children,target,disabled,style,className,onClick,onFocus,onMouseEnter,onMouseLeave,onTouchStart,ignoreBlocker,params:_params,search:_search,hash:_hash,state:_state,mask:_mask,reloadDocument:_reloadDocument,unsafeRelative:_unsafeRelative,from:_from,_fromLocation,...propsSafeToSpread}=options;const currentSearch=useRouterState({select:s=>s.location.search,structuralSharing:true});const from=options.from;const _options=index_js_.useMemo(()=>({...options,from}),[router,currentSearch,from,options._fromLocation,options.hash,options.to,options.search,options.params,options.state,options.mask,options.unsafeRelative]);const next=index_js_.useMemo(()=>router.buildLocation({..._options}),[router,_options]);const hrefOption=index_js_.useMemo(()=>{if(disabled)return;let href=next.maskedLocation?next.maskedLocation.url:next.url;let external=false;if(router.origin)if(href.startsWith(router.origin))href=router.history.createHref(href.replace(router.origin,""))||"/";else external=true;return{href,external}},[disabled,next.maskedLocation,next.url,router.origin,router.history]);const externalLink=index_js_.useMemo(()=>{if(hrefOption?.external)return hrefOption.href;try{new URL(to);return to}catch{}},[to,hrefOption]);const preload=options.reloadDocument||externalLink?false:userPreload??router.options.defaultPreload;const preloadDelay=userPreloadDelay??router.options.defaultPreloadDelay??0;const isActive=useRouterState({select:s=>{if(externalLink)return false;if(activeOptions?.exact){const testExact=exactPathTest(s.location.pathname,next.pathname,router.basepath);if(!testExact)return false}else{const currentPathSplit=removeTrailingSlash(s.location.pathname,router.basepath);const nextPathSplit=removeTrailingSlash(next.pathname,router.basepath);const pathIsFuzzyEqual=currentPathSplit.startsWith(nextPathSplit)&&(currentPathSplit.length===nextPathSplit.length||"/"===currentPathSplit[nextPathSplit.length]);if(!pathIsFuzzyEqual)return false}if(activeOptions?.includeSearch??true){const searchTest=deepEqual(s.location.search,next.search,{partial:!activeOptions?.exact,ignoreUndefined:!activeOptions?.explicitUndefined});if(!searchTest)return false}if(activeOptions?.includeHash)return s.location.hash===next.hash;return true}});const doPreload=index_js_.useCallback(()=>{router.preloadRoute({..._options}).catch(err=>{console.warn(err);console.warn(preloadWarning)})},[router,_options]);const preloadViewportIoCallback=index_js_.useCallback(entry=>{if(entry?.isIntersecting)doPreload()},[doPreload]);useIntersectionObserver(innerRef,preloadViewportIoCallback,link_intersectionObserverOptions,{disabled:!!disabled||"viewport"!==preload});index_js_.useEffect(()=>{if(hasRenderFetched.current)return;if(!disabled&&"render"===preload){doPreload();hasRenderFetched.current=true}},[disabled,doPreload,preload]);const handleClick=e=>{const elementTarget=e.currentTarget.target;const effectiveTarget=void 0!==target?target:elementTarget;if(!disabled&&!isCtrlEvent(e)&&!e.defaultPrevented&&(!effectiveTarget||"_self"===effectiveTarget)&&0===e.button){e.preventDefault();(0,react_dom_index_js_.flushSync)(()=>{setIsTransitioning(true)});const unsub=router.subscribe("onResolved",()=>{unsub();setIsTransitioning(false)});router.navigate({..._options,replace,resetScroll,hashScrollIntoView,startTransition,viewTransition,ignoreBlocker})}};if(externalLink)return{...propsSafeToSpread,ref:innerRef,href:externalLink,...children&&{children},...target&&{target},...disabled&&{disabled},...style&&{style},...className&&{className},...onClick&&{onClick},...onFocus&&{onFocus},...onMouseEnter&&{onMouseEnter},...onMouseLeave&&{onMouseLeave},...onTouchStart&&{onTouchStart}};const handleFocus=_=>{if(disabled)return;if(preload)doPreload()};const handleTouchStart=handleFocus;const handleEnter=e=>{if(disabled||!preload)return;if(preloadDelay){const eventTarget=e.target;if(timeoutMap.has(eventTarget))return;const id=setTimeout(()=>{timeoutMap.delete(eventTarget);doPreload()},preloadDelay);timeoutMap.set(eventTarget,id)}else doPreload()};const handleLeave=e=>{if(disabled||!preload||!preloadDelay)return;const eventTarget=e.target;const id=timeoutMap.get(eventTarget);if(id){clearTimeout(id);timeoutMap.delete(eventTarget)}};const resolvedActiveProps=isActive?functionalUpdate(activeProps,{})??STATIC_ACTIVE_OBJECT:STATIC_EMPTY_OBJECT;const resolvedInactiveProps=isActive?STATIC_EMPTY_OBJECT:functionalUpdate(inactiveProps,{})??STATIC_EMPTY_OBJECT;const resolvedClassName=[className,resolvedActiveProps.className,resolvedInactiveProps.className].filter(Boolean).join(" ");const resolvedStyle=(style||resolvedActiveProps.style||resolvedInactiveProps.style)&&{...style,...resolvedActiveProps.style,...resolvedInactiveProps.style};return{...propsSafeToSpread,...resolvedActiveProps,...resolvedInactiveProps,href:hrefOption?.href,ref:innerRef,onClick:composeHandlers([onClick,handleClick]),onFocus:composeHandlers([onFocus,handleFocus]),onMouseEnter:composeHandlers([onMouseEnter,handleEnter]),onMouseLeave:composeHandlers([onMouseLeave,handleLeave]),onTouchStart:composeHandlers([onTouchStart,handleTouchStart]),disabled:!!disabled,target,...resolvedStyle&&{style:resolvedStyle},...resolvedClassName&&{className:resolvedClassName},...disabled&&STATIC_DISABLED_PROPS,...isActive&&STATIC_ACTIVE_PROPS,...isTransitioning&&STATIC_TRANSITIONING_PROPS}}const STATIC_EMPTY_OBJECT={};const STATIC_ACTIVE_OBJECT={className:"active"};const STATIC_DISABLED_PROPS={role:"link","aria-disabled":true};const STATIC_ACTIVE_PROPS={"data-status":"active","aria-current":"page"};const STATIC_TRANSITIONING_PROPS={"data-transitioning":"transitioning"};const timeoutMap=/* @__PURE__ */new WeakMap;const link_intersectionObserverOptions={rootMargin:"100px"};const composeHandlers=handlers=>e=>{for(const handler of handlers)if(handler){if(e.defaultPrevented)return;handler(e)}};function createLink(Comp){return index_js_.forwardRef(function(props,ref){return/* @__PURE__ */(0,jsx_runtime.jsx)(Link,{...props,_asChild:Comp,ref})})}const Link=index_js_.forwardRef((props,ref)=>{const{_asChild,...rest}=props;const{type:_type,ref:innerRef,...linkProps}=useLinkProps(rest,ref);const children="function"==typeof rest.children?rest.children({isActive:"active"===linkProps["data-status"]}):rest.children;if(void 0===_asChild)delete linkProps.disabled;return index_js_.createElement(_asChild?_asChild:"a",{...linkProps,ref:innerRef},children)});function isCtrlEvent(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}const linkOptions=options=>options;function getRouteApi(id){return new RouteApi({id})}class RouteApi extends BaseRouteApi{constructor({id}){super({id});this.useMatch=opts=>useMatch({select:opts?.select,from:this.id,structuralSharing:opts?.structuralSharing});this.useRouteContext=opts=>useMatch({from:this.id,select:d=>opts?.select?opts.select(d.context):d.context});this.useSearch=opts=>useSearch({select:opts?.select,structuralSharing:opts?.structuralSharing,from:this.id});this.useParams=opts=>useParams({select:opts?.select,structuralSharing:opts?.structuralSharing,from:this.id});this.useLoaderDeps=opts=>useLoaderDeps({...opts,from:this.id,strict:false});this.useLoaderData=opts=>useLoaderData({...opts,from:this.id,strict:false});this.useNavigate=()=>{const router=useRouter();return useNavigate({from:router.routesById[this.id].fullPath})};this.notFound=opts=>not_found_notFound({routeId:this.id,...opts});this.Link=index_js_.forwardRef((props,ref)=>{const router=useRouter();const fullPath=router.routesById[this.id].fullPath;return/* @__PURE__ */(0,jsx_runtime.jsx)(Link,{ref,from:fullPath,...props})})}}class Route extends BaseRoute{constructor(options){super(options);this.useMatch=opts=>useMatch({select:opts?.select,from:this.id,structuralSharing:opts?.structuralSharing});this.useRouteContext=opts=>useMatch({...opts,from:this.id,select:d=>opts?.select?opts.select(d.context):d.context});this.useSearch=opts=>useSearch({select:opts?.select,structuralSharing:opts?.structuralSharing,from:this.id});this.useParams=opts=>useParams({select:opts?.select,structuralSharing:opts?.structuralSharing,from:this.id});this.useLoaderDeps=opts=>useLoaderDeps({...opts,from:this.id});this.useLoaderData=opts=>useLoaderData({...opts,from:this.id});this.useNavigate=()=>useNavigate({from:this.fullPath});this.Link=index_js_.forwardRef((props,ref)=>/* @__PURE__ */(0,jsx_runtime.jsx)(Link,{ref,from:this.fullPath,...props}));this.$$typeof=Symbol.for("react.memo")}}function createRoute(options){return new Route(options)}function createRootRouteWithContext(){return options=>createRootRoute(options)}const rootRouteWithContext=createRootRouteWithContext;class RootRoute extends BaseRootRoute{constructor(options){super(options);this.useMatch=opts=>useMatch({select:opts?.select,from:this.id,structuralSharing:opts?.structuralSharing});this.useRouteContext=opts=>useMatch({...opts,from:this.id,select:d=>opts?.select?opts.select(d.context):d.context});this.useSearch=opts=>useSearch({select:opts?.select,structuralSharing:opts?.structuralSharing,from:this.id});this.useParams=opts=>useParams({select:opts?.select,structuralSharing:opts?.structuralSharing,from:this.id});this.useLoaderDeps=opts=>useLoaderDeps({...opts,from:this.id});this.useLoaderData=opts=>useLoaderData({...opts,from:this.id});this.useNavigate=()=>useNavigate({from:this.fullPath});this.Link=index_js_.forwardRef((props,ref)=>/* @__PURE__ */(0,jsx_runtime.jsx)(Link,{ref,from:this.fullPath,...props}));this.$$typeof=Symbol.for("react.memo")}}function createRootRoute(options){return new RootRoute(options)}function createRouteMask(opts){return opts}class NotFoundRoute extends Route{constructor(options){super({...options,id:"404"})}}function createFileRoute(path){if("object"==typeof path)return new FileRoute(path,{silent:true}).createRoute(path);return new FileRoute(path,{silent:true}).createRoute}class FileRoute{constructor(path,_opts){this.path=path;this.createRoute=options=>{tiny_warning_esm(this.silent,"FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");const route=createRoute(options);route.isRoot=false;return route};this.silent=_opts?.silent}}function FileRouteLoader(_path){tiny_warning_esm(false,"FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the `createFileRoute('/path/to/file')(options)` options");return loaderFn=>loaderFn}class LazyRoute{constructor(opts){this.useMatch=opts2=>useMatch({select:opts2?.select,from:this.options.id,structuralSharing:opts2?.structuralSharing});this.useRouteContext=opts2=>useMatch({from:this.options.id,select:d=>opts2?.select?opts2.select(d.context):d.context});this.useSearch=opts2=>useSearch({select:opts2?.select,structuralSharing:opts2?.structuralSharing,from:this.options.id});this.useParams=opts2=>useParams({select:opts2?.select,structuralSharing:opts2?.structuralSharing,from:this.options.id});this.useLoaderDeps=opts2=>useLoaderDeps({...opts2,from:this.options.id});this.useLoaderData=opts2=>useLoaderData({...opts2,from:this.options.id});this.useNavigate=()=>{const router=useRouter();return useNavigate({from:router.routesById[this.options.id].fullPath})};this.options=opts;this.$$typeof=Symbol.for("react.memo")}}function createLazyRoute(id){return opts=>new LazyRoute({id,...opts})}function createLazyFileRoute(id){if("object"==typeof id)return new LazyRoute(id);return opts=>new LazyRoute({id,...opts})}function lazyRouteComponent(importer,exportName){let loadPromise;let comp;let error;let reload;const load=()=>{if(!loadPromise)loadPromise=importer().then(res=>{loadPromise=void 0;comp=res[exportName??"default"]}).catch(err=>{error=err;if(isModuleNotFoundError(error)){if(error instanceof Error&&"undefined"!=typeof window&&"undefined"!=typeof sessionStorage){const storageKey=`tanstack_router_reload:${error.message}`;if(!sessionStorage.getItem(storageKey)){sessionStorage.setItem(storageKey,"1");reload=true}}}});return loadPromise};const lazyComp=function(props){if(reload){window.location.reload();throw new Promise(()=>{})}if(error)throw error;if(!comp)throw load();return index_js_.createElement(comp,props)};lazyComp.preload=load;return lazyComp}function Transitioner(){const router=useRouter();const mountLoadForRouter=index_js_.useRef({router,mounted:false});const[isTransitioning,setIsTransitioning]=index_js_.useState(false);const{hasPendingMatches,isLoading}=useRouterState({select:s=>({isLoading:s.isLoading,hasPendingMatches:s.matches.some(d=>"pending"===d.status)}),structuralSharing:true});const previousIsLoading=usePrevious(isLoading);const isAnyPending=isLoading||isTransitioning||hasPendingMatches;const previousIsAnyPending=usePrevious(isAnyPending);const isPagePending=isLoading||hasPendingMatches;const previousIsPagePending=usePrevious(isPagePending);router.startTransition=fn=>{setIsTransitioning(true);index_js_.startTransition(()=>{fn();setIsTransitioning(false)})};index_js_.useEffect(()=>{const unsub=router.history.subscribe(router.load);const nextLocation=router.buildLocation({to:router.latestLocation.pathname,search:true,params:true,hash:true,state:true,_includeValidateSearch:true});if(trimPathRight(router.latestLocation.href)!==trimPathRight(nextLocation.href))router.commitLocation({...nextLocation,replace:true});return()=>{unsub()}},[router,router.history]);useLayoutEffect(()=>{if("undefined"!=typeof window&&router.ssr||mountLoadForRouter.current.router===router&&mountLoadForRouter.current.mounted)return;mountLoadForRouter.current={router,mounted:true};const tryLoad=async()=>{try{await router.load()}catch(err){console.error(err)}};tryLoad()},[router]);useLayoutEffect(()=>{if(previousIsLoading&&!isLoading)router.emit({type:"onLoad",...getLocationChangeInfo(router.state)})},[previousIsLoading,router,isLoading]);useLayoutEffect(()=>{if(previousIsPagePending&&!isPagePending)router.emit({type:"onBeforeRouteMount",...getLocationChangeInfo(router.state)})},[isPagePending,previousIsPagePending,router]);useLayoutEffect(()=>{if(previousIsAnyPending&&!isAnyPending){router.emit({type:"onResolved",...getLocationChangeInfo(router.state)});router.__store.setState(s=>({...s,status:"idle",resolvedLocation:s.location}));handleHashScroll(router)}},[isAnyPending,previousIsAnyPending,router]);return null}function CatchNotFound(props){const resetKey=useRouterState({select:s=>`not-found-${s.location.pathname}-${s.status}`});return/* @__PURE__ */(0,jsx_runtime.jsx)(CatchBoundary,{getResetKey:()=>resetKey,onCatch:(error,errorInfo)=>{if(isNotFound(error))props.onCatch?.(error,errorInfo);else throw error},errorComponent:({error})=>{if(isNotFound(error))return props.fallback?.(error);throw error},children:props.children})}function DefaultGlobalNotFound(){return/* @__PURE__ */(0,jsx_runtime.jsx)("p",{children:"Not Found"})}function SafeFragment(props){return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:props.children})}function renderRouteNotFound(router,route,data){if(!route.options.notFoundComponent){if(router.options.defaultNotFoundComponent)return/* @__PURE__ */(0,jsx_runtime.jsx)(router.options.defaultNotFoundComponent,{data});return/* @__PURE__ */(0,jsx_runtime.jsx)(DefaultGlobalNotFound,{})}return/* @__PURE__ */(0,jsx_runtime.jsx)(route.options.notFoundComponent,{data})}function ScriptOnce({children}){const router=useRouter();if(!router.isServer)return null;return/* @__PURE__ */(0,jsx_runtime.jsx)("script",{nonce:router.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[children].filter(Boolean).join("\n")+";$_TSR.c()"}})}function ScrollRestoration(){const router=useRouter();if(!router.isScrollRestoring||!router.isServer)return null;if("function"==typeof router.options.scrollRestoration){const shouldRestore=router.options.scrollRestoration({location:router.latestLocation});if(!shouldRestore)return null}const getKey=router.options.getScrollRestorationKey||defaultGetScrollRestorationKey;const userKey=getKey(router.latestLocation);const resolvedKey=userKey!==defaultGetScrollRestorationKey(router.latestLocation)?userKey:void 0;const restoreScrollOptions={storageKey:scroll_restoration_storageKey,shouldScrollRestoration:true};if(resolvedKey)restoreScrollOptions.key=resolvedKey;return/* @__PURE__ */(0,jsx_runtime.jsx)(ScriptOnce,{children:`(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})`})}const Match=index_js_.memo(function({matchId}){const router=useRouter();const matchState=useRouterState({select:s=>{const match=s.matches.find(d=>d.id===matchId);(0,tiny_invariant.A)(match,`Could not find match for matchId "${matchId}". Please file an issue!`);return{routeId:match.routeId,ssr:match.ssr,_displayPending:match._displayPending}},structuralSharing:true});const route=router.routesById[matchState.routeId];const PendingComponent=route.options.pendingComponent??router.options.defaultPendingComponent;const pendingElement=PendingComponent?/* @__PURE__ */(0,jsx_runtime.jsx)(PendingComponent,{}):null;const routeErrorComponent=route.options.errorComponent??router.options.defaultErrorComponent;const routeOnCatch=route.options.onCatch??router.options.defaultOnCatch;const routeNotFoundComponent=route.isRoot?route.options.notFoundComponent??router.options.notFoundRoute?.options.component:route.options.notFoundComponent;const resolvedNoSsr=false===matchState.ssr||"data-only"===matchState.ssr;const ResolvedSuspenseBoundary=(!route.isRoot||route.options.wrapInSuspense||resolvedNoSsr)&&(route.options.wrapInSuspense??PendingComponent??(route.options.errorComponent?.preload||resolvedNoSsr))?index_js_.Suspense:SafeFragment;const ResolvedCatchBoundary=routeErrorComponent?CatchBoundary:SafeFragment;const ResolvedNotFoundBoundary=routeNotFoundComponent?CatchNotFound:SafeFragment;const resetKey=useRouterState({select:s=>s.loadedAt});const parentRouteId=useRouterState({select:s=>{const index=s.matches.findIndex(d=>d.id===matchId);return s.matches[index-1]?.routeId}});const ShellComponent=route.isRoot?route.options.shellComponent??SafeFragment:SafeFragment;return/* @__PURE__ */(0,jsx_runtime.jsxs)(ShellComponent,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)(matchContext.Provider,{value:matchId,children:/* @__PURE__ */(0,jsx_runtime.jsx)(ResolvedSuspenseBoundary,{fallback:pendingElement,children:/* @__PURE__ */(0,jsx_runtime.jsx)(ResolvedCatchBoundary,{getResetKey:()=>resetKey,errorComponent:routeErrorComponent||ErrorComponent,onCatch:(error,errorInfo)=>{if(isNotFound(error))throw error;tiny_warning_esm(false,`Error in route match: ${matchId}`);routeOnCatch?.(error,errorInfo)},children:/* @__PURE__ */(0,jsx_runtime.jsx)(ResolvedNotFoundBoundary,{fallback:error=>{if(!routeNotFoundComponent||error.routeId&&error.routeId!==matchState.routeId||!error.routeId&&!route.isRoot)throw error;return index_js_.createElement(routeNotFoundComponent,error)},children:resolvedNoSsr||matchState._displayPending?/* @__PURE__ */(0,jsx_runtime.jsx)(ClientOnly,{fallback:pendingElement,children:/* @__PURE__ */(0,jsx_runtime.jsx)(MatchInner,{matchId})}):/* @__PURE__ */(0,jsx_runtime.jsx)(MatchInner,{matchId})})})})}),parentRouteId===rootRouteId&&router.options.scrollRestoration?/* @__PURE__ */(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)(OnRendered,{}),/* @__PURE__ */(0,jsx_runtime.jsx)(ScrollRestoration,{})]}):null]})});function OnRendered(){const router=useRouter();const prevLocationRef=index_js_.useRef(void 0);return/* @__PURE__ */(0,jsx_runtime.jsx)("script",{suppressHydrationWarning:true,ref:el=>{if(el&&(void 0===prevLocationRef.current||prevLocationRef.current.href!==router.latestLocation.href)){router.emit({type:"onRendered",...getLocationChangeInfo(router.state)});prevLocationRef.current=router.latestLocation}}},router.latestLocation.state.__TSR_key)}const MatchInner=index_js_.memo(function({matchId}){const router=useRouter();const{match,key,routeId}=useRouterState({select:s=>{const match2=s.matches.find(d=>d.id===matchId);const routeId2=match2.routeId;const remountFn=router.routesById[routeId2].options.remountDeps??router.options.defaultRemountDeps;const remountDeps=remountFn?.({routeId:routeId2,loaderDeps:match2.loaderDeps,params:match2._strictParams,search:match2._strictSearch});const key2=remountDeps?JSON.stringify(remountDeps):void 0;return{key:key2,routeId:routeId2,match:{id:match2.id,status:match2.status,error:match2.error,_forcePending:match2._forcePending,_displayPending:match2._displayPending}}},structuralSharing:true});const route=router.routesById[routeId];const out=index_js_.useMemo(()=>{const Comp=route.options.component??router.options.defaultComponent;if(Comp)return/* @__PURE__ */(0,jsx_runtime.jsx)(Comp,{},key);return/* @__PURE__ */(0,jsx_runtime.jsx)(Outlet,{})},[key,route.options.component,router.options.defaultComponent]);if(match._displayPending)throw router.getMatch(match.id)?._nonReactive.displayPendingPromise;if(match._forcePending)throw router.getMatch(match.id)?._nonReactive.minPendingPromise;if("pending"===match.status){const pendingMinMs=route.options.pendingMinMs??router.options.defaultPendingMinMs;if(pendingMinMs){const routerMatch=router.getMatch(match.id);if(routerMatch&&!routerMatch._nonReactive.minPendingPromise){if(!router.isServer){const minPendingPromise=createControlledPromise();routerMatch._nonReactive.minPendingPromise=minPendingPromise;setTimeout(()=>{minPendingPromise.resolve();routerMatch._nonReactive.minPendingPromise=void 0},pendingMinMs)}}}throw router.getMatch(match.id)?._nonReactive.loadPromise}if("notFound"===match.status){(0,tiny_invariant.A)(isNotFound(match.error),"Expected a notFound error");return renderRouteNotFound(router,route,match.error)}if("redirected"===match.status){(0,tiny_invariant.A)(isRedirect(match.error),"Expected a redirect error");throw router.getMatch(match.id)?._nonReactive.loadPromise}if("error"===match.status){if(router.isServer){const RouteErrorComponent=(route.options.errorComponent??router.options.defaultErrorComponent)||ErrorComponent;return/* @__PURE__ */(0,jsx_runtime.jsx)(RouteErrorComponent,{error:match.error,reset:void 0,info:{componentStack:""}})}throw match.error}return out});const Outlet=index_js_.memo(function(){const router=useRouter();const matchId=index_js_.useContext(matchContext);const routeId=useRouterState({select:s=>s.matches.find(d=>d.id===matchId)?.routeId});const route=router.routesById[routeId];const parentGlobalNotFound=useRouterState({select:s=>{const matches=s.matches;const parentMatch=matches.find(d=>d.id===matchId);(0,tiny_invariant.A)(parentMatch,`Could not find parent match for matchId "${matchId}"`);return parentMatch.globalNotFound}});const childMatchId=useRouterState({select:s=>{const matches=s.matches;const index=matches.findIndex(d=>d.id===matchId);return matches[index+1]?.id}});const pendingElement=router.options.defaultPendingComponent?/* @__PURE__ */(0,jsx_runtime.jsx)(router.options.defaultPendingComponent,{}):null;if(parentGlobalNotFound)return renderRouteNotFound(router,route,void 0);if(!childMatchId)return null;const nextMatch=/* @__PURE__ */(0,jsx_runtime.jsx)(Match,{matchId:childMatchId});if(matchId===rootRouteId)return/* @__PURE__ */(0,jsx_runtime.jsx)(index_js_.Suspense,{fallback:pendingElement,children:nextMatch});return nextMatch});function Matches(){const router=useRouter();const rootRoute=router.routesById[rootRouteId];const PendingComponent=rootRoute.options.pendingComponent??router.options.defaultPendingComponent;const pendingElement=PendingComponent?/* @__PURE__ */(0,jsx_runtime.jsx)(PendingComponent,{}):null;const ResolvedSuspense=router.isServer||"undefined"!=typeof document&&router.ssr?SafeFragment:index_js_.Suspense;const inner=/* @__PURE__ */(0,jsx_runtime.jsxs)(ResolvedSuspense,{fallback:pendingElement,children:[!router.isServer&&/* @__PURE__ */(0,jsx_runtime.jsx)(Transitioner,{}),/* @__PURE__ */(0,jsx_runtime.jsx)(MatchesInner,{})]});return router.options.InnerWrap?/* @__PURE__ */(0,jsx_runtime.jsx)(router.options.InnerWrap,{children:inner}):inner}function MatchesInner(){const router=useRouter();const matchId=useRouterState({select:s=>s.matches[0]?.id});const resetKey=useRouterState({select:s=>s.loadedAt});const matchComponent=matchId?/* @__PURE__ */(0,jsx_runtime.jsx)(Match,{matchId}):null;return/* @__PURE__ */(0,jsx_runtime.jsx)(matchContext.Provider,{value:matchId,children:router.options.disableGlobalCatchBoundary?matchComponent:/* @__PURE__ */(0,jsx_runtime.jsx)(CatchBoundary,{getResetKey:()=>resetKey,errorComponent:ErrorComponent,onCatch:error=>{tiny_warning_esm(false,"The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!");tiny_warning_esm(false,error.message||error.toString())},children:matchComponent})})}function useMatchRoute(){const router=useRouter();useRouterState({select:s=>[s.location.href,s.resolvedLocation?.href,s.status],structuralSharing:true});return index_js_.useCallback(opts=>{const{pending,caseSensitive,fuzzy,includeSearch,...rest}=opts;return router.matchRoute(rest,{pending,caseSensitive,fuzzy,includeSearch})},[router])}function MatchRoute(props){const matchRoute=useMatchRoute();const params=matchRoute(props);if("function"==typeof props.children)return props.children(params);return params?props.children:null}function useMatches(opts){return useRouterState({select:state=>{const matches=state.matches;return opts?.select?opts.select(matches):matches},structuralSharing:opts?.structuralSharing})}function useParentMatches(opts){const contextMatchId=index_js_.useContext(matchContext);return useMatches({select:matches=>{matches=matches.slice(0,matches.findIndex(d=>d.id===contextMatchId));return opts?.select?opts.select(matches):matches},structuralSharing:opts?.structuralSharing})}function useChildMatches(opts){const contextMatchId=index_js_.useContext(matchContext);return useMatches({select:matches=>{matches=matches.slice(matches.findIndex(d=>d.id===contextMatchId)+1);return opts?.select?opts.select(matches):matches},structuralSharing:opts?.structuralSharing})}const createRouter=options=>new Router(options);class Router extends RouterCore{constructor(options){super(options)}}if("undefined"!=typeof globalThis){globalThis.createFileRoute=createFileRoute;globalThis.createLazyFileRoute=createLazyFileRoute}else if("undefined"!=typeof window){window.createFileRoute=createFileRoute;window.createLazyFileRoute=createLazyFileRoute}function RouterContextProvider({router,children,...rest}){if(Object.keys(rest).length>0)router.update({...router.options,...rest,context:{...router.options.context,...rest.context}});const routerContext=getRouterContext();const provider=/* @__PURE__ */(0,jsx_runtime.jsx)(routerContext.Provider,{value:router,children});if(router.options.Wrap)return/* @__PURE__ */(0,jsx_runtime.jsx)(router.options.Wrap,{children:provider});return provider}function RouterProvider({router,...rest}){return/* @__PURE__ */(0,jsx_runtime.jsx)(RouterContextProvider,{router,...rest,children:/* @__PURE__ */(0,jsx_runtime.jsx)(Matches,{})})}function useScrollRestoration(){const router=useRouter();setupScrollRestoration(router,true)}function ScrollRestoration_ScrollRestoration(_props){useScrollRestoration();return null}function useElementScrollRestoration(options){useScrollRestoration();const router=useRouter();const getKey=options.getKey||defaultGetScrollRestorationKey;let elementSelector="";if(options.id)elementSelector=`[data-scroll-restoration-id="${options.id}"]`;else{const element=options.getElement?.();if(!element)return;elementSelector=element instanceof Window?"window":getCssSelector(element)}const restoreKey=getKey(router.latestLocation);const byKey=scrollRestorationCache?.state[restoreKey];return byKey?.[elementSelector]}function _resolveBlockerOpts(opts,condition){if(void 0===opts)return{shouldBlockFn:()=>true,withResolver:false};if("shouldBlockFn"in opts)return opts;if("function"==typeof opts){const shouldBlock2=Boolean(condition??true);const _customBlockerFn2=async()=>{if(shouldBlock2)return await opts();return false};return{shouldBlockFn:_customBlockerFn2,enableBeforeUnload:shouldBlock2,withResolver:false}}const shouldBlock=Boolean(opts.condition??true);const fn=opts.blockerFn;const _customBlockerFn=async()=>{if(shouldBlock&&void 0!==fn)return await fn();return shouldBlock};return{shouldBlockFn:_customBlockerFn,enableBeforeUnload:shouldBlock,withResolver:void 0===fn}}function useBlocker(opts,condition){const{shouldBlockFn,enableBeforeUnload=true,disabled=false,withResolver=false}=_resolveBlockerOpts(opts,condition);const router=useRouter();const{history}=router;const[resolver,setResolver]=index_js_.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});index_js_.useEffect(()=>{const blockerFnComposed=async blockerFnArgs=>{function getLocation(location){const parsedLocation=router.parseLocation(location);const matchedRoutes=router.getMatchedRoutes(parsedLocation.pathname,void 0);if(void 0===matchedRoutes.foundRoute)throw new Error(`No route found for location ${location.href}`);return{routeId:matchedRoutes.foundRoute.id,fullPath:matchedRoutes.foundRoute.fullPath,pathname:parsedLocation.pathname,params:matchedRoutes.routeParams,search:parsedLocation.search}}const current=getLocation(blockerFnArgs.currentLocation);const next=getLocation(blockerFnArgs.nextLocation);const shouldBlock=await shouldBlockFn({action:blockerFnArgs.action,current,next});if(!withResolver)return shouldBlock;if(!shouldBlock)return false;const promise=new Promise(resolve=>{setResolver({status:"blocked",current,next,action:blockerFnArgs.action,proceed:()=>resolve(false),reset:()=>resolve(true)})});const canNavigateAsync=await promise;setResolver({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return canNavigateAsync};return disabled?void 0:history.block({blockerFn:blockerFnComposed,enableBeforeUnload})},[shouldBlockFn,enableBeforeUnload,disabled,withResolver,history,router]);return resolver}const _resolvePromptBlockerArgs=props=>{if("shouldBlockFn"in props)return{...props};const shouldBlock=Boolean(props.condition??true);const fn=props.blockerFn;const _customBlockerFn=async()=>{if(shouldBlock&&void 0!==fn)return await fn();return shouldBlock};return{shouldBlockFn:_customBlockerFn,enableBeforeUnload:shouldBlock,withResolver:void 0===fn}};function Block(opts){const{children,...rest}=opts;const args=_resolvePromptBlockerArgs(rest);const resolver=useBlocker(args);return children?"function"==typeof children?children(resolver):children:null}function useRouteContext(opts){return useMatch({...opts,select:match=>opts.select?opts.select(match.context):match.context})}function useLocation(opts){return useRouterState({select:state=>opts?.select?opts.select(state.location):state.location})}function useCanGoBack(){return useRouterState({select:s=>0!==s.location.state.__TSR_index})}function Asset({tag,attrs,children,nonce}){switch(tag){case"title":return/* @__PURE__ */(0,jsx_runtime.jsx)("title",{...attrs,suppressHydrationWarning:true,children});case"meta":return/* @__PURE__ */(0,jsx_runtime.jsx)("meta",{...attrs,suppressHydrationWarning:true});case"link":return/* @__PURE__ */(0,jsx_runtime.jsx)("link",{...attrs,nonce,suppressHydrationWarning:true});case"style":return/* @__PURE__ */(0,jsx_runtime.jsx)("style",{...attrs,dangerouslySetInnerHTML:{__html:children},nonce});case"script":return/* @__PURE__ */(0,jsx_runtime.jsx)(Script,{attrs,children});default:return null}}function Script({attrs,children}){const router=useRouter();index_js_.useEffect(()=>{if(attrs?.src){const normSrc=(()=>{try{const base=document.baseURI||window.location.href;return new URL(attrs.src,base).href}catch{return attrs.src}})();const existingScript=Array.from(document.querySelectorAll("script[src]")).find(el=>el.src===normSrc);if(existingScript)return;const script=document.createElement("script");for(const[key,value]of Object.entries(attrs))if("suppressHydrationWarning"!==key&&void 0!==value&&false!==value)script.setAttribute(key,"boolean"==typeof value?"":String(value));document.head.appendChild(script);return()=>{if(script.parentNode)script.parentNode.removeChild(script)}}if("string"==typeof children){const typeAttr="string"==typeof attrs?.type?attrs.type:"text/javascript";const nonceAttr="string"==typeof attrs?.nonce?attrs.nonce:void 0;const existingScript=Array.from(document.querySelectorAll("script:not([src])")).find(el=>{if(!(el instanceof HTMLScriptElement))return false;const sType=el.getAttribute("type")??"text/javascript";const sNonce=el.getAttribute("nonce")??void 0;return el.textContent===children&&sType===typeAttr&&sNonce===nonceAttr});if(existingScript)return;const script=document.createElement("script");script.textContent=children;if(attrs){for(const[key,value]of Object.entries(attrs))if("suppressHydrationWarning"!==key&&void 0!==value&&false!==value)script.setAttribute(key,"boolean"==typeof value?"":String(value))}document.head.appendChild(script);return()=>{if(script.parentNode)script.parentNode.removeChild(script)}}},[attrs,children]);if(!router.isServer)return null;if(attrs?.src&&"string"==typeof attrs.src)return/* @__PURE__ */(0,jsx_runtime.jsx)("script",{...attrs,suppressHydrationWarning:true});if("string"==typeof children)return/* @__PURE__ */(0,jsx_runtime.jsx)("script",{...attrs,dangerouslySetInnerHTML:{__html:children},suppressHydrationWarning:true});return null}const useTags=()=>{const router=useRouter();const nonce=router.options.ssr?.nonce;const routeMeta=useRouterState({select:state=>state.matches.map(match=>match.meta).filter(Boolean)});const meta=index_js_.useMemo(()=>{const resultMeta=[];const metaByAttribute={};let title;for(let i=routeMeta.length-1;i>=0;i--){const metas=routeMeta[i];for(let j=metas.length-1;j>=0;j--){const m=metas[j];if(m)if(m.title){if(!title)title={tag:"title",children:m.title}}else{const attribute=m.name??m.property;if(attribute)if(metaByAttribute[attribute])continue;else metaByAttribute[attribute]=true;resultMeta.push({tag:"meta",attrs:{...m,nonce}})}}}if(title)resultMeta.push(title);if(nonce)resultMeta.push({tag:"meta",attrs:{property:"csp-nonce",content:nonce}});resultMeta.reverse();return resultMeta},[routeMeta,nonce]);const links=useRouterState({select:state=>{const constructed=state.matches.map(match=>match.links).filter(Boolean).flat(1).map(link=>({tag:"link",attrs:{...link,nonce}}));const manifest=router.ssr?.manifest;const assets=state.matches.map(match=>manifest?.routes[match.routeId]?.assets??[]).filter(Boolean).flat(1).filter(asset=>"link"===asset.tag).map(asset=>({tag:"link",attrs:{...asset.attrs,suppressHydrationWarning:true,nonce}}));return[...constructed,...assets]},structuralSharing:true});const preloadMeta=useRouterState({select:state=>{const preloadMeta2=[];state.matches.map(match=>router.looseRoutesById[match.routeId]).forEach(route=>router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach(preload=>{preloadMeta2.push({tag:"link",attrs:{rel:"modulepreload",href:preload,nonce}})}));return preloadMeta2},structuralSharing:true});const styles=useRouterState({select:state=>state.matches.map(match=>match.styles).flat(1).filter(Boolean).map(({children,...attrs})=>({tag:"style",attrs,children,nonce})),structuralSharing:true});const headScripts=useRouterState({select:state=>state.matches.map(match=>match.headScripts).flat(1).filter(Boolean).map(({children,...script})=>({tag:"script",attrs:{...script,nonce},children})),structuralSharing:true});return uniqBy([...meta,...preloadMeta,...links,...styles,...headScripts],d=>JSON.stringify(d))};function HeadContent(){const tags=useTags();const router=useRouter();const nonce=router.options.ssr?.nonce;return tags.map(tag=>/* @__PURE__ */(0,index_js_.createElement)(Asset,{...tag,key:`tsr-meta-${JSON.stringify(tag)}`,nonce}))}function uniqBy(arr,fn){const seen=/* @__PURE__ */new Set;return arr.filter(item=>{const key=fn(item);if(seen.has(key))return false;seen.add(key);return true})}const Scripts=()=>{const router=useRouter();const nonce=router.options.ssr?.nonce;const assetScripts=useRouterState({select:state=>{const assetScripts2=[];const manifest=router.ssr?.manifest;if(!manifest)return[];state.matches.map(match=>router.looseRoutesById[match.routeId]).forEach(route=>manifest.routes[route.id]?.assets?.filter(d=>"script"===d.tag).forEach(asset=>{assetScripts2.push({tag:"script",attrs:{...asset.attrs,nonce},children:asset.children})}));return assetScripts2},structuralSharing:true});const{scripts}=useRouterState({select:state=>({scripts:state.matches.map(match=>match.scripts).flat(1).filter(Boolean).map(({children,...script})=>({tag:"script",attrs:{...script,suppressHydrationWarning:true,nonce},children}))}),structuralSharing:true});const allScripts=[...scripts,...assetScripts];return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:allScripts.map((asset,i)=>/* @__PURE__ */(0,index_js_.createElement)(Asset,{...asset,key:`tsr-scripts-${asset.tag}-${i}`}))})}},1089:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>invariant});var isProduction=true;var prefix="Invariant failed";function invariant(condition,message){if(condition)return;if(isProduction)throw new Error(prefix);var provided="function"==typeof message?message():message;var value=provided?"".concat(prefix,": ").concat(provided):prefix;throw new Error(value)}}}]);
|