From c54f3f0226a60ef06234b735bb22a042aeabf014 Mon Sep 17 00:00:00 2001 From: Patrick Joyce Date: Sat, 4 Apr 2026 13:43:43 -0400 Subject: [PATCH 1/3] Add language override --- README.md | 12 ++++++++++++ src/hooks/settings.tsx | 11 ++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 732717c3..cb08c017 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,18 @@ var tsml_react_config = { }; ``` +### Override language + +By default, the UI language is determined by the visitor's browser setting (`navigator.language`). You can force a specific language for all visitors: + +```js +var tsml_react_config = { + language: 'es', +}; +``` + +Supported values: `en`, `es`, `fr`, `ja`, `nl`, `pt`, `sk`, `sv`, `th`. + ### Disable Add to Calendar button You can disable the add to calendar button if needed. diff --git a/src/hooks/settings.tsx b/src/hooks/settings.tsx index ca4c741d..3734c6eb 100644 --- a/src/hooks/settings.tsx +++ b/src/hooks/settings.tsx @@ -156,15 +156,16 @@ export const SettingsProvider = ({ } } - const preferredLanguage = navigator.language.substring(0, 2); - - if (preferredLanguage in settings.strings) { - settings.language = preferredLanguage as Lang; + if (!userSettings?.language) { + const preferredLanguage = navigator.language.substring(0, 2); + if (preferredLanguage in settings.strings) { + settings.language = preferredLanguage as Lang; + } } const strings = settings.strings[settings.language]; - Settings.defaultLocale = navigator.language; + Settings.defaultLocale = userSettings?.language ?? navigator.language; return { settings, strings }; }, [userSettings]); From 168d622938cd7a63a76e2d209c4b6e116e46d0d2 Mon Sep 17 00:00:00 2001 From: Patrick Joyce Date: Sat, 4 Apr 2026 15:02:22 -0400 Subject: [PATCH 2/3] add language tests --- test/__tests__/settings.spec.ts | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/test/__tests__/settings.spec.ts b/test/__tests__/settings.spec.ts index f84cd38b..5beadb74 100644 --- a/test/__tests__/settings.spec.ts +++ b/test/__tests__/settings.spec.ts @@ -1,5 +1,9 @@ +import { renderHook } from '@testing-library/react'; +import { createElement } from 'react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { SettingsProvider, useSettings } from '../../src/hooks'; + describe('settings', () => { let languageGetter: ReturnType; @@ -7,6 +11,17 @@ describe('settings', () => { languageGetter = vi.spyOn(window.navigator, 'language', 'get'); }); + const renderSettings = (userSettings?: Partial) => { + return renderHook(() => useSettings(), { + wrapper: ({ children }) => + createElement( + SettingsProvider, + { userSettings: userSettings as TSMLReactConfig }, + children + ), + }); + }; + it('should import flags', () => { const flags = ['O', 'C']; // const { settings } = mergeSettings({ flags }); @@ -65,9 +80,21 @@ describe('settings', () => { // expect(settings.weekdays).toEqual(weekdays); }); - it('should fall back to english', () => { + it('falls back to english when navigator.language is unsupported', () => { languageGetter.mockReturnValue('de'); - // const { settings } = mergeSettings(); - // expect(settings.language).toEqual('en'); + const { result } = renderSettings(); + expect(result.current.settings.language).toBe('en'); + }); + + it('uses navigator.language when no language is configured', () => { + languageGetter.mockReturnValue('es-MX'); + const { result } = renderSettings(); + expect(result.current.settings.language).toBe('es'); + }); + + it('uses tsml_react_config language when set, ignoring navigator.language', () => { + languageGetter.mockReturnValue('en-US'); + const { result } = renderSettings({ language: 'fr' }); + expect(result.current.settings.language).toBe('fr'); }); }); From a02ecac76996773e5a33e7463b547609680557dc Mon Sep 17 00:00:00 2001 From: Josh Reisner <1551689+joshreisner@users.noreply.github.com> Date: Sun, 5 Apr 2026 07:13:36 -0700 Subject: [PATCH 3/3] add example and build --- public/app.js | 2 +- public/tests/japan.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index 57192be3..4aeff436 100644 --- a/public/app.js +++ b/public/app.js @@ -1,4 +1,4 @@ -!function(){try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}\n/*$vite$:1*/')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();!function(){var e,t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,s,l)=>(l=null!=e?t(o(e)):{},((e,t,o,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var l,u=i(t),c=0,d=u.length;ct[e]).bind(null,l),enumerable:!(s=r(t,l))||s.enumerable});return e})(!s&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e)),u=s(e=>{function t(e,t){var n=e.length;e.push(t);e:for(;0>>1,o=e[r];if(!(0>>1;ri(l,n))ui(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(ui(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,h=3,f=!1,m=!1,p=!1,g=!1,y="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,_="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var i=n(u);null!==i;){if(null===i.callback)r(u);else{if(!(i.startTime<=e))break;r(u),i.sortIndex=i.expirationTime,t(l,i)}i=n(u)}}function w(e){if(p=!1,b(e),!m)if(null!==n(l))m=!0,x||(x=!0,k());else{var t=n(u);null!==t&&z(w,t.startTime-e)}}var k,x=!1,S=-1,E=5,T=-1;function P(){return!!g||!(e.unstable_now()-Tt&&P());){var a=d.callback;if("function"==typeof a){d.callback=null,h=d.priorityLevel;var s=a(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,b(t),i=!0;break t}d===n(l)&&r(l),b(t)}else r(l);d=n(l)}if(null!==d)i=!0;else{var c=n(u);null!==c&&z(w,c.startTime-t),i=!1}}break e}finally{d=null,h=o,f=!1}i=void 0}}finally{i?k():x=!1}}}if("function"==typeof _)k=function(){_(L)};else if("undefined"!=typeof MessageChannel){var C=new MessageChannel,M=C.port2;C.port1.onmessage=L,k=function(){M.postMessage(null)}}else k=function(){y(L,0)};function z(t,n){S=y(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125a?(r.sortIndex=o,t(u,r),null===n(l)&&r===n(u)&&(p?(v(S),S=-1):p=!0,z(w,o-a))):(r.sortIndex=s,t(l,r),m||f||(m=!0,x||(x=!0,k()))),r},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}),c=s((e,t)=>{t.exports=u()}),d=s(e=>{var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),f=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}function v(){}function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=_.prototype=new v;b.constructor=_,p(b,y.prototype),b.isPureReactComponent=!0;var w=Array.isArray;function k(){}var x={H:null,A:null,T:null,S:null},S=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:void 0!==i?i:null,props:r}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var P=/\/+/g;function L(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function C(e,r,i,o,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l,u,c=!1;if(null===e)c=!0;else switch(s){case"bigint":case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case n:c=!0;break;case d:return C((c=e._init)(e._payload),r,i,o,a)}}if(c)return a=a(e),c=""===o?"."+L(e,0):o,w(a)?(i="",null!=c&&(i=c.replace(P,"$&/")+"/"),C(a,r,i,"",function(e){return e})):null!=a&&(T(a)&&(l=a,u=i+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(P,"$&/")+"/")+c,a=E(l.type,u,l.props)),r.push(a)),1;c=0;var h,m=""===o?".":o+":";if(w(e))for(var p=0;p{t.exports=d()}),f=s(e=>{var t=h();function n(e){var t="https://react.dev/errors/"+e;if(1{!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),t.exports=f()}),p=s(e=>{var t=c(),n=h(),r=m();function i(e){var t="https://react.dev/errors/"+e;if(1j||(e.current=I[j],I[j]=null,j--)}function B(e,t){j++,I[j]=e.current,e.current=t}var Z,H,U=F(null),V=F(null),W=F(null),q=F(null);function G(e,t){switch(B(W,t),B(V,e),B(U,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=vd(t=yd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(U),B(U,e)}function Y(){$(U),$(V),$(W)}function K(e){null!==e.memoizedState&&B(q,e);var t=U.current,n=vd(t,e.type);t!==n&&(B(V,e),B(U,n))}function Q(e){V.current===e&&($(U),$(V)),q.current===e&&($(q),ch._currentValue=D)}function J(e){if(void 0===Z)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Z=t&&t[1]||"",H=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{X=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?J(n):""}function te(e,t){switch(e.tag){case 26:case 27:case 5:return J(e.type);case 16:return J("Lazy");case 13:return e.child!==t&&null!==t?J("Suspense Fallback"):J("Suspense");case 19:return J("SuspenseList");case 0:case 15:return ee(e.type,!1);case 11:return ee(e.type.render,!1);case 1:return ee(e.type,!0);case 31:return J("Activity");default:return""}}function ne(e){try{var t="",n=null;do{t+=te(e,n),n=e,e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}var re=Object.prototype.hasOwnProperty,ie=t.unstable_scheduleCallback,oe=t.unstable_cancelCallback,ae=t.unstable_shouldYield,se=t.unstable_requestPaint,le=t.unstable_now,ue=t.unstable_getCurrentPriorityLevel,ce=t.unstable_ImmediatePriority,de=t.unstable_UserBlockingPriority,he=t.unstable_NormalPriority,fe=t.unstable_LowPriority,me=t.unstable_IdlePriority,pe=t.log,ge=t.unstable_setDisableYieldValue,ye=null,ve=null;function _e(e){if("function"==typeof pe&&ge(e),ve&&"function"==typeof ve.setStrictMode)try{ve.setStrictMode(ye,e)}catch(t){}}var be=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(we(e)/ke|0)|0},we=Math.log,ke=Math.LN2;var xe=256,Se=262144,Ee=4194304;function Te(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pe(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,o=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=134217727&r;return 0!==s?0!==(r=s&~o)?i=Te(r):0!==(a&=s)?i=Te(a):n||0!==(n=s&~e)&&(i=Te(n)):0!==(s=r&~o)?i=Te(s):0!==a?i=Te(a):n||0!==(n=r&~e)&&(i=Te(n)),0===i?0:0!==t&&t!==i&&0===(t&o)&&((o=i&-i)>=(n=t&-t)||32===o&&4194048&n)?t:i}function Le(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ce(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Me(){var e=Ee;return!(62914560&(Ee<<=1))&&(Ee=4194304),e}function ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Oe(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ae(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-be(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Ne(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-be(n),i=1<=Tn),Cn=String.fromCharCode(32),Mn=!1;function zn(e,t){switch(e){case"keyup":return-1!==Sn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function On(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var An=!1;var Nn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Nn[e.type]:"textarea"===t}function Dn(e,t,n,r){Rt?Dt?Dt.push(r):Dt=[r]:Rt=r,0<(t=rd(t,"onChange")).length&&(n=new nn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var In=null,jn=null;function Fn(e){Yc(e,0)}function $n(e){if(mt(Je(e)))return e}function Bn(e,t){if("change"===e)return t}var Zn=!1;if(Bt){var Hn;if(Bt){var Un="oninput"in document;if(!Un){var Vn=document.createElement("div");Vn.setAttribute("oninput","return;"),Un="function"==typeof Vn.oninput}Hn=Un}else Hn=!1;Zn=Hn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=er(r)}}function nr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?nr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function rr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var or=Bt&&"documentMode"in document&&11>=document.documentMode,ar=null,sr=null,lr=null,ur=!1;function cr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ur||null==ar||ar!==pt(r)||("selectionStart"in(r=ar)&&ir(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},lr&&Xn(lr,r)||(lr=r,0<(r=rd(sr,"onSelect")).length&&(t=new nn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ar)))}function dr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:dr("Animation","AnimationEnd"),animationiteration:dr("Animation","AnimationIteration"),animationstart:dr("Animation","AnimationStart"),transitionrun:dr("Transition","TransitionRun"),transitionstart:dr("Transition","TransitionStart"),transitioncancel:dr("Transition","TransitionCancel"),transitionend:dr("Transition","TransitionEnd")},fr={},mr={};function pr(e){if(fr[e])return fr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in mr)return fr[e]=n[t];return e}Bt&&(mr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var gr=pr("animationend"),yr=pr("animationiteration"),vr=pr("animationstart"),_r=pr("transitionrun"),br=pr("transitionstart"),wr=pr("transitioncancel"),kr=pr("transitionend"),xr=new Map,Sr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Er(e,t){xr.set(e,t),rt(t,[e])}Sr.push("scrollEnd");var Tr="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Pr=[],Lr=0,Cr=0;function Mr(){for(var e=Lr,t=Cr=Lr=0;t>=a,i-=a,ni=1<<32-be(t)+i|n<p?(g=d,d=null):g=d.sibling;var y=f(i,d,s[p],l);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(i,d),o=a(y,o,p),null===c?u=y:c.sibling=y,c=y,d=g}if(p===s.length)return n(i,d),di&&ii(i,p),u;if(null===d){for(;pg?(y=p,p=null):y=p.sibling;var _=f(o,p,v.value,u);if(null===_){null===p&&(p=y);break}e&&p&&null===_.alternate&&t(o,p),s=a(_,s,g),null===d?c=_:d.sibling=_,d=_,p=y}if(v.done)return n(o,p),di&&ii(o,g),c;if(null===p){for(;!v.done;g++,v=l.next())null!==(v=h(o,v.value,u))&&(s=a(v,s,g),null===d?c=v:d.sibling=v,d=v);return di&&ii(o,g),c}for(p=r(p);!v.done;g++,v=l.next())null!==(v=m(p,o,g,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?g:v.key),s=a(v,s,g),null===d?c=v:d.sibling=v,d=v);return e&&p.forEach(function(e){return t(o,e)}),di&&ii(o,g),c}(l,u,c=_.call(c),d)}if("function"==typeof c.then)return v(l,u,uo(c),d);if(c.$$typeof===w)return v(l,u,Ai(l,c),d);ho(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(d=o(u,c)).return=l,l=d):(n(l,u),(d=Ur(c,l.mode,d)).return=l,l=d),s(l)):n(l,u)}return function(e,t,n,r){try{lo=0;var i=v(e,t,n,r);return so=null,i}catch(a){if(a===Qi||a===Xi)throw a;var o=jr(29,a,null,e.mode);return o.lanes=r,o.return=e,o}}}var mo=fo(!0),po=fo(!1),go=!1;function yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bo(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&fu){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Rr(e),Nr(e,null,n),t}return zr(e,r,t,n),Rr(e)}function wo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Ne(e,n)}}function ko(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){if(null!==Ui)throw Ui}}function Eo(e,t,n,r){xo=!1;var i=e.updateQueue;go=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,u=l.next;l.next=null,null===a?o=u:a.next=u,a=l;var c=e.alternate;null!==c&&((s=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(null!==o){var h=i.baseState;for(a=0,c=u=l=null,s=o;;){var f=-536870913&s.lane,m=f!==s.lane;if(m?(gu&f)===f:(r&f)===f){0!==f&&f===Hi&&(xo=!0),null!==c&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var p=e,g=s;f=t;var y=n;switch(g.tag){case 1:if("function"==typeof(p=g.payload)){h=p.call(y,h,f);break e}h=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(f="function"==typeof(p=g.payload)?p.call(y,h,f):p))break e;h=d({},h,f);break e;case 2:go=!0}}null!==(f=s.callback)&&(e.flags|=64,m&&(e.flags|=8192),null===(m=i.callbacks)?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=m,l=h):c=c.next=m,a|=f;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(m=s).next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===o&&(i.shared.lanes=0),Su|=a,e.lanes=a,e.memoizedState=h}}function To(e,t){if("function"!=typeof e)throw Error(i(191,e));e.call(t)}function Po(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;eo?o:8;var a,s,l,u=N.T,c={};N.T=c,ds(e,!1,t,n);try{var d=i(),h=N.S;null!==h&&h(c,d),null!==d&&"object"==typeof d&&"function"==typeof d.then?cs(e,t,(a=r,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},d.then(function(){l.status="fulfilled",l.value=a;for(var e=0;e<\/script>",a=a.removeChild(a.firstChild);break;case"select":a="string"==typeof r.is?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a="string"==typeof r.is?s.createElement(o,{is:r.is}):s.createElement(o)}}a[Be]=t,a[Ze]=r;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)a.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;e:switch(hd(a,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&sl(t)}}return hl(t),ll(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&sl(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=W.current,vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(o=ui))switch(o.tag){case 27:case 5:r=o.memoizedProps}e[Be]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||ud(e.nodeValue,n)))||pi(t,!0)}else(e=gd(e).createTextNode(r))[Be]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=vi(t),null!==n){if(null===e){if(!r)throw Error(i(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(i(557));e[Be]=t}else _i(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=bi(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Fo(t),t):(Fo(t),null);if(128&t.flags)throw Error(i(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(o=vi(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(i(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(i(317));o[Be]=t}else _i(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),o=!1}else o=bi(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return 256&t.flags?(Fo(t),t):(Fo(t),null)}return Fo(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(o=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(o=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),cl(t,t.updateQueue),hl(t),null);case 4:return Y(),null===e&&Xc(t.stateNode.containerInfo),hl(t),null;case 10:return Ti(t.type),hl(t),null;case 19:if($($o),null===(r=t.memoizedState))return hl(t),null;if(o=!!(128&t.flags),null===(a=r.rendering))if(o)dl(r,!1);else{if(0!==xu||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(a=Bo(e))){for(t.flags|=128,dl(r,!1),e=a.updateQueue,t.updateQueue=e,cl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Br(n,e),n=n.sibling;return B($o,1&$o.current|2),di&&ii(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&le()>Nu&&(t.flags|=128,o=!0,dl(r,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=Bo(a))){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,cl(t,e),dl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!a.alternate&&!di)return hl(t),null}else 2*le()-r.renderingStartTime>Nu&&536870912!==n&&(t.flags|=128,o=!0,dl(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=r.last)?e.sibling=a:t.child=a,r.last=a)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=le(),e.sibling=null,n=$o.current,B($o,o?1&n|2:1&n),di&&ii(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Fo(t),Oo(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&cl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&$(qi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ti(ji),hl(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}function ml(e,t){switch(si(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ti(ji),Y(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Q(t),null;case 31:if(null!==t.memoizedState){if(Fo(t),null===t.alternate)throw Error(i(340));_i()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Fo(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));_i()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return $($o),null;case 4:return Y(),null;case 10:return Ti(t.type),null;case 22:case 23:return Fo(t),Oo(),null!==e&&$(qi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Ti(ji),null;default:return null}}function pl(e,t){switch(si(t),t.tag){case 3:Ti(ji),Y();break;case 26:case 27:case 5:Q(t);break;case 4:Y();break;case 31:null!==t.memoizedState&&Fo(t);break;case 13:Fo(t);break;case 19:$($o);break;case 10:Ti(t.type);break;case 22:case 23:Fo(t),Oo(),null!==e&&$(qi);break;case 24:Ti(ji)}}function gl(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var o=n.create,a=n.inst;r=o(),a.destroy=r}n=n.next}while(n!==i)}}catch(s){xc(t,t.return,s)}}function yl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var o=i.next;r=o;do{if((r.tag&e)===e){var a=r.inst,s=a.destroy;if(void 0!==s){a.destroy=void 0,i=t;var l=n,u=s;try{u()}catch(c){xc(i,l,c)}}}r=r.next}while(r!==o)}}catch(c){xc(t,t.return,c)}}function vl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Po(t,n)}catch(r){xc(e,e.return,r)}}}function _l(e,t,n){n.props=xs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){xc(e,t,r)}}function bl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(i){xc(e,t,i)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(i){xc(e,t,i)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(o){xc(e,t,o)}else n.current=null}function kl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){xc(e,e.return,i)}}function xl(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,a=null,s=null,l=null,u=null,c=null,d=null;for(m in n){var h=n[m];if(n.hasOwnProperty(m)&&null!=h)switch(m){case"checked":case"value":break;case"defaultValue":u=h;default:r.hasOwnProperty(m)||cd(e,t,m,null,r,h)}}for(var f in r){var m=r[f];if(h=n[f],r.hasOwnProperty(f)&&(null!=m||null!=h))switch(f){case"type":a=m;break;case"name":o=m;break;case"checked":c=m;break;case"defaultChecked":d=m;break;case"value":s=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(null!=m)throw Error(i(137,t));break;default:m!==h&&cd(e,t,f,m,r,h)}}return void vt(e,s,l,u,c,d,a,o);case"select":for(a in m=s=l=f=null,n)if(u=n[a],n.hasOwnProperty(a)&&null!=u)switch(a){case"value":break;case"multiple":m=u;default:r.hasOwnProperty(a)||cd(e,t,a,null,r,u)}for(o in r)if(a=r[o],u=n[o],r.hasOwnProperty(o)&&(null!=a||null!=u))switch(o){case"value":f=a;break;case"defaultValue":l=a;break;case"multiple":s=a;default:a!==u&&cd(e,t,o,a,r,u)}return t=l,n=s,r=m,void(null!=f?wt(e,!!n,f,!1):!!r!=!!n&&(null!=t?wt(e,!!n,t,!0):wt(e,!!n,n?[]:"",!1)));case"textarea":for(l in m=f=null,n)if(o=n[l],n.hasOwnProperty(l)&&null!=o&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:cd(e,t,l,null,r,o)}for(s in r)if(o=r[s],a=n[s],r.hasOwnProperty(s)&&(null!=o||null!=a))switch(s){case"value":f=o;break;case"defaultValue":m=o;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=o)throw Error(i(91));break;default:o!==a&&cd(e,t,s,o,r,a)}return void kt(e,f,m);case"option":for(var p in n)if(f=n[p],n.hasOwnProperty(p)&&null!=f&&!r.hasOwnProperty(p))if("selected"===p)e.selected=!1;else cd(e,t,p,null,r,f);for(u in r)if(f=r[u],m=n[u],r.hasOwnProperty(u)&&f!==m&&(null!=f||null!=m))if("selected"===u)e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f;else cd(e,t,u,f,r,m);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&cd(e,t,g,null,r,f);for(c in r)if(f=r[c],m=n[c],r.hasOwnProperty(c)&&f!==m&&(null!=f||null!=m))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(i(137,t));break;default:cd(e,t,c,f,r,m)}return;default:if(Lt(t)){for(var y in n)f=n[y],n.hasOwnProperty(y)&&void 0!==f&&!r.hasOwnProperty(y)&&dd(e,t,y,void 0,r,f);for(d in r)f=r[d],m=n[d],!r.hasOwnProperty(d)||f===m||void 0===f&&void 0===m||dd(e,t,d,f,r,m);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&cd(e,t,v,null,r,f);for(h in r)f=r[h],m=n[h],!r.hasOwnProperty(h)||f===m||null==f&&null==m||cd(e,t,h,f,r,m)}(r,e.type,n,t),r[Ze]=t}catch(o){xc(e,e.return,o)}}function Sl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Td(e.type)||4===e.tag}function El(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Sl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Td(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Ot));else if(4!==r&&(27===r&&Td(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Pl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&Td(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Pl(e,t,n),e=e.sibling;null!==e;)Pl(e,t,n),e=e.sibling}function Ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hd(t,r,n),t[Be]=e,t[Ze]=n}catch(o){xc(e,e.return,o)}}var Cl=!1,Ml=!1,zl=!1,Ol="function"==typeof WeakSet?WeakSet:Set,Al=null;function Nl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Gl(e,n),4&r&&gl(5,n);break;case 1:if(Gl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(a){xc(n,n.return,a)}else{var i=xs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){xc(n,n.return,s)}}64&r&&vl(n),512&r&&bl(n,n.return);break;case 3:if(Gl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{Po(e,t)}catch(a){xc(n,n.return,a)}}break;case 27:null===t&&4&r&&Ll(n);case 26:case 5:Gl(e,n),null===t&&4&r&&kl(n),512&r&&bl(n,n.return);break;case 12:Gl(e,n);break;case 31:Gl(e,n),4&r&&$l(e,n);break;case 13:Gl(e,n),4&r&&Bl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Pc.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||Cl)){t=null!==t&&null!==t.memoizedState||Ml,i=Cl;var o=Ml;Cl=r,(Ml=t)&&!o?Kl(e,n,!!(8772&n.subtreeFlags)):Gl(e,n),Cl=i,Ml=o}break;case 30:break;default:Gl(e,n)}}function Rl(e){var t=e.alternate;null!==t&&(e.alternate=null,Rl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ye(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Dl=null,Il=!1;function jl(e,t,n){for(n=n.child;null!==n;)Fl(e,t,n),n=n.sibling}function Fl(e,t,n){if(ve&&"function"==typeof ve.onCommitFiberUnmount)try{ve.onCommitFiberUnmount(ye,n)}catch(o){}switch(n.tag){case 26:Ml||wl(n,t),jl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Ml||wl(n,t);var r=Dl,i=Il;Td(n.type)&&(Dl=n.stateNode,Il=!1),jl(e,t,n),jd(n.stateNode),Dl=r,Il=i;break;case 5:Ml||wl(n,t);case 6:if(r=Dl,i=Il,Dl=null,jl(e,t,n),Il=i,null!==(Dl=r))if(Il)try{(9===Dl.nodeType?Dl.body:"HTML"===Dl.nodeName?Dl.ownerDocument.body:Dl).removeChild(n.stateNode)}catch(a){xc(n,t,a)}else try{Dl.removeChild(n.stateNode)}catch(a){xc(n,t,a)}break;case 18:null!==Dl&&(Il?(Pd(9===(e=Dl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Zh(e)):Pd(Dl,n.stateNode));break;case 4:r=Dl,i=Il,Dl=n.stateNode.containerInfo,Il=!0,jl(e,t,n),Dl=r,Il=i;break;case 0:case 11:case 14:case 15:yl(2,n,t),Ml||yl(4,n,t),jl(e,t,n);break;case 1:Ml||(wl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&_l(n,t,r)),jl(e,t,n);break;case 21:jl(e,t,n);break;case 22:Ml=(r=Ml)||null!==n.memoizedState,jl(e,t,n),Ml=r;break;default:jl(e,t,n)}}function $l(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Zh(e)}catch(n){xc(t,t.return,n)}}}function Bl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Zh(e)}catch(n){xc(t,t.return,n)}}function Zl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Ol),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Ol),t;default:throw Error(i(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Lc.bind(null,e,t);t.then(r,r)}})}function Hl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hd(a,r,n),a[Be]=e,et(a),r=a;break e;case"link":var s=nh("link","href",o).get(r+(n.href||""));if(s)for(var l=0;ls)break;var c=l.transferSize,d=l.initiatorType;c&&fd(d)&&(a+=c*((l=l.responseEnd)oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(d,m)))return $u=o,e.cancelPendingCommit=m(pc.bind(null,e,t,o,n,r,i,a,s,l,c,d,null,h,f)),void Ju(e,o,a,!u)}pc(e,t,o,n,r,i,a,s,l)}function Qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;rg&&(a=g,g=p,p=a);var y=tr(s,p),v=tr(s,g);if(y&&v&&(1!==f.rangeCount||f.anchorNode!==y.node||f.anchorOffset!==y.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var _=d.createRange();_.setStart(y.node,y.offset),f.removeAllRanges(),p>g?(f.addRange(_),f.extend(v.node,v.offset)):(_.setEnd(v.node,v.offset),f.addRange(_))}}}}for(d=[],f=s;f=f.parentNode;)1===f.nodeType&&d.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;sn?32:n,N.T=null,n=Zu,Zu=null;var a=ju,s=$u;if(Iu=0,Fu=ju=null,$u=0,6&fu)throw Error(i(331));var l=fu;if(fu|=4,lu(a.current),eu(a,a.current,s,n),fu=l,Dc(0,!1),ve&&"function"==typeof ve.onPostCommitFiberRoot)try{ve.onPostCommitFiberRoot(ye,a)}catch(u){}return!0}finally{R.p=o,N.T=r,_c(e,t)}}function kc(e,t,n){t=Gr(n,t),null!==(e=bo(e,t=Cs(e.stateNode,t,2),2))&&(Oe(e,2),Rc(e))}function xc(e,t,n){if(3===e.tag)kc(e,e,n);else for(;null!==t;){if(3===t.tag){kc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Du||!Du.has(r))){e=Gr(n,e),null!==(r=bo(t,n=Ms(2),2))&&(zs(n,r,t,e),Oe(r,2),Rc(r));break}}t=t.return}}function Sc(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(wu=!0,i.add(n),e=Ec.bind(null,e,t,n),t.then(e,e))}function Ec(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,mu===e&&(gu&n)===n&&(4===xu||3===xu&&(62914560&gu)===gu&&300>le()-Ou?!(2&fu)&&tc(e,0):Tu|=n,Lu===gu&&(Lu=0)),Rc(e)}function Tc(e,t){0===t&&(t=Me()),null!==(e=Ar(e,t))&&(Oe(e,t),Rc(e))}function Pc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Tc(e,n)}function Lc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),Tc(e,n)}var Cc=null,Mc=null,zc=!1,Oc=!1,Ac=!1,Nc=0;function Rc(e){e!==Mc&&null===e.next&&(null===Mc?Cc=Mc=e:Mc=Mc.next=e),Oc=!0,zc||(zc=!0,Sd(function(){6&fu?ie(ce,Ic):jc()}))}function Dc(e,t){if(!Ac&&Oc){Ac=!0;do{for(var n=!1,r=Cc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var o=0;else{var a=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-be(42|e)+1)-1,o=201326741&(o&=i&~(a&~s))?201326741&o|1:o?2|o:0}0!==o&&(n=!0,Bc(r,o))}else o=gu,!(3&(o=Pe(r,r===mu?o:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Le(r,o)||(n=!0,Bc(r,o));r=r.next}}while(n);Ac=!1}}function Ic(){jc()}function jc(){Oc=zc=!1;var e=0;0!==Nc&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==bd&&(bd=e,!0);return bd=null,!1}()&&(e=Nc);for(var t=le(),n=null,r=Cc;null!==r;){var i=r.next,o=Fc(r,t);0===o?(r.next=null,null===n?Cc=i:n.next=i,null===i&&(Mc=n)):(n=r,(0!==e||3&o)&&(Oc=!0)),r=i}0!==Iu&&5!==Iu||Dc(e,!1),0!==Nc&&(Nc=0)}function Fc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=-62914561&e.pendingLanes;0 title"):null)}function ih(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var oh=0;function ah(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)lh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var sh=null;function lh(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,sh=new Map,t.forEach(uh,e),sh=null,ah.call(e))}function uh(e,t){if(!(4&t.state.loading)){var n=sh.get(e);if(n)var r=n.get(null);else{n=new Map,sh.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o{!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),t.exports=p()}),y=l(h(),1),v=e=>{throw TypeError(e)},_=(e,t,n)=>(((e,t,n)=>{t.has(e)||v("Cannot "+n)})(e,t,"read from private field"),n?n.call(e):t.get(e)),b="popstate";function w(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function k(e={}){return z(function(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:o}=n||e.location;return P("",{pathname:r,search:i,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:C(t)},null,e)}function x(e={}){return z(function(e,t){let{pathname:n="/",search:r="",hash:i=""}=M(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),P("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:C(t))},function(e,t){E("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}function S(e,t){if(!1===e||null==e)throw new Error(t)}function E(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function T(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function P(e,t,n=null,r,i){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?M(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),unstable_mask:i}}function C({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function M(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function z(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s="POP",l=null,u=c();function c(){return(a.state||{idx:null}).idx}function d(){s="POP";let e=c(),t=null==e?null:e-u;u=e,l&&l({action:s,location:f.location,delta:t})}function h(e){return O(e)}null==u&&(u=0,a.replaceState({...a.state,idx:u},""));let f={get action(){return s},get location(){return e(i,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(b,d),l=e,()=>{i.removeEventListener(b,d),l=null}},createHref:e=>t(i,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=w(e)?e:P(f.location,e,t);n&&n(r,e),u=c()+1;let d=T(r,u),h=f.createHref(r.unstable_mask||r);try{a.pushState(d,"",h)}catch(m){if(m instanceof DOMException&&"DataCloneError"===m.name)throw m;i.location.assign(h)}o&&l&&l({action:s,location:f.location,delta:1})},replace:function(e,t){s="REPLACE";let r=w(e)?e:P(f.location,e,t);n&&n(r,e),u=c();let i=T(r,u),d=f.createHref(r.unstable_mask||r);a.replaceState(i,"",d),o&&l&&l({action:s,location:f.location,delta:0})},go:e=>a.go(e)};return f}function O(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),S(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:C(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var A=class{constructor(t){var n,r,i;if(n=this,r=e,i=new Map,r.has(n)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,i),t)for(let[e,o]of t)this.set(e,o)}get(t){if(_(this,e).has(t))return _(this,e).get(t);if(void 0!==t.defaultValue)return t.defaultValue;throw new Error("No value found for context")}set(t,n){_(this,e).set(t,n)}};e=new WeakMap;var N=new Set(["lazy","caseSensitive","path","id","index","children"]);var R=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function D(e){return R.has(e)}function I(e,t,n=[],r={},i=!1){return e.map((e,o)=>{let a=[...n,String(o)],s="string"==typeof e.id?e.id:a.join("-");if(S(!0!==e.index||!e.children,"Cannot specify children on an index route"),S(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let n={...e,id:s};return r[s]=j(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=j(n,t(n)),e.children&&(n.children=I(e.children,t,a,r,i)),n}})}function j(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function F(e,t,n="/"){return $(e,t,n,!1)}function $(e,t,n,r){let i=te(("string"==typeof t?M(t):t).pathname||"/",n);if(null==i)return null;let o=Z(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let a=null;for(let s=0;null==a&&s{let l={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&a)return;S(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let u=ue([r,l.relativePath]),c=n.concat(l);e.children&&e.children.length>0&&(S(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),Z(e.children,t,c,u,a)),(null!=e.path||e.index)&&t.push({path:u,score:Q(u,e.index),routesMeta:c})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of H(e.path))o(e,t,!0,n);else o(e,t)}),t}function H(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=H(r.join("/")),s=[];return s.push(...a.map(e=>""===e?o:[o,e].join("/"))),i&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var U=/^:[\w-]+$/,V=3,W=2,q=1,G=10,Y=-2,K=e=>"*"===e;function Q(e,t){let n=e.split("/"),r=n.length;return n.some(K)&&(r+=Y),t&&(r+=W),n.filter(e=>!K(e)).reduce((e,t)=>e+(U.test(t)?V:""===t?q:G),r)}function J(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s{if(r.push({paramName:t,isOptional:null!=n}),n){let t=o.charAt(i+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");return[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=s[r]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const i=s[r];return e[t]=n&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:a,pattern:e}}function ee(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return E(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function te(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}var ne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,re=e=>ne.test(e);function ie(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function oe(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function ae(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function se(e){let t=ae(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function le(e,t,n,r=!1){let i;"string"==typeof e?i=M(e):(i={...e},S(!i.pathname||!i.pathname.includes("?"),oe("?","pathname","search",i)),S(!i.pathname||!i.pathname.includes("#"),oe("#","pathname","hash",i)),S(!i.search||!i.search.includes("#"),oe("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t="/"){let n,{pathname:r,search:i="",hash:o=""}="string"==typeof e?M(e):e;return r?(r=r.replace(/\/\/+/g,"/"),n=r.startsWith("/")?ie(r.substring(1),"/"):ie(r,t)):n=t,{pathname:n,search:de(i),hash:he(o)}}(i,o),u=s&&"/"!==s&&s.endsWith("/"),c=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!u&&!c||(l.pathname+="/"),l}var ue=e=>e.join("/").replace(/\/\/+/g,"/"),ce=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),de=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",he=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",fe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function me(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function pe(e){return e.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ge="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ye(e,t){let n=e;if("string"!=typeof n||!ne.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ge)try{let e=new URL(window.location.href),r=n.startsWith("//")?new URL(e.protocol+n):new URL(n),o=te(r.pathname,t);r.origin===e.origin&&null!=o?n=o+r.search+r.hash:i=!0}catch(o){E(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var ve=Symbol("Uninstrumented");function _e(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if("function"==typeof t.lazy&&n.lazy.length>0){let e=be(n.lazy,t.lazy,()=>{});e&&(r.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach(t=>{let i=e[t],o=n[`lazy.${t}`];if("function"==typeof i&&o.length>0){let e=be(o,i,()=>{});e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return["loader","action"].forEach(e=>{let i=t[e];if("function"==typeof i&&n[e].length>0){let t=i[ve]??i,o=be(n[e],t,(...e)=>ke(e[0]));o&&("loader"===e&&!0===t.hydrate&&(o.hydrate=!0),o[ve]=t,r[e]=o)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[ve]??e,r=be(n.middleware,t,(...e)=>ke(e[0]));return r?(r[ve]=t,r):e})),r}function be(e,t,n){return 0===e.length?null:async(...r)=>{let i=await we(e,n(...r),()=>t(...r),e.length-1);if("error"===i.type)throw i.value;return i.value}}async function we(e,t,n,r){let i,o=e[r];if(o){let s,l=async()=>(s?console.error("You cannot call instrumented handlers more than once"):s=we(e,t,n,r-1),i=await s,S(i,"Expected a result"),"error"===i.type&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await o(l,t)}catch(a){console.error("An instrumentation function threw an error:",a)}s||await l(),await s}else try{i={type:"success",value:await n()}}catch(a){i={type:"error",value:a}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function ke(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:Se(t),params:{...r},unstable_pattern:i,context:Ee(n)}}function xe(e,t){return{currentUrl:C(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Se(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ee(e){if(function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===Te}(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Te=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Pe=["POST","PUT","PATCH","DELETE"],Le=new Set(Pe),Ce=["GET",...Pe],Me=new Set(Ce),ze=new Set([301,302,303,307,308]),Oe=new Set([307,308]),Ae={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ne={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Re={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},De=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Ie="remix-router-transitions",je=Symbol("ResetLoaderData");function Fe(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,n=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;S(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||De,o=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;o=e=>({...i(e),..._e(t.map(e=>e.route).filter(Boolean),e)})}let a,s={},l=I(e.routes,o,void 0,s),u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let c,d,h,f=e.dataStrategy||Je,m={unstable_passThroughRequests:!1,...e.future},p=null,g=new Set,y=null,v=null,_=null,b=null!=e.hydrationData,w=F(l,e.history.location,u),k=!1,x=null;if(null!=w||e.patchRoutesOnNavigation)if(w&&!e.hydrationData&&Fe(w,l,e.history.location.pathname).active&&(w=null),w)if(w.some(e=>e.route.lazy))c=!1,d=!c;else if(w.some(e=>He(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=w;if(n){let e=w.findIndex(e=>void 0!==n[e.route.id]);r=r.slice(0,e+1)}d=!1,c=!0,r.forEach(e=>{let r=Ue(e.route,t,n);d=d||r.renderFallback,c=c&&!r.shouldLoad})}else c=!0,d=!c;else{c=!1,d=!c,w=[];let t=Fe(null,l,e.history.location.pathname);t.active&&t.matches&&(k=!0,w=t.matches)}else{let t=yt(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=gt(l);c=!0,d=!c,w=n,x={[r.id]:t}}let T,L,z={historyAction:e.history.action,location:e.history.location,matches:w,initialized:c,renderFallback:d,navigation:Ae,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},N="POP",R=null,D=!1,j=!1,Z=new Map,H=null,U=!1,V=!1,W=new Set,q=new Map,G=0,Y=-1,K=new Map,Q=new Set,J=new Map,X=new Map,ee=new Set,ne=new Map,ie=null;function oe(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=s[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),z={...z,...e};let n=[],r=[];z.fetchers.forEach((e,t)=>{"idle"===e.state&&(ee.has(t)?n.push(t):r.push(t))}),ee.forEach(e=>{z.fetchers.has(e)||q.has(e)||n.push(e)}),[...g].forEach(r=>r(z,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),n.forEach(e=>we(e)),r.forEach(e=>z.fetchers.delete(e))}function ae(t,n,{flushSync:r}={}){let i,o=null!=z.actionData&&null!=z.navigation.formMethod&&Tt(z.navigation.formMethod)&&"loading"===z.navigation.state&&!0!==t.state?._isRedirect;i=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:o?z.actionData:null;let s=n.loaderData?ft(z.loaderData,n.loaderData,n.matches||[],n.errors):z.loaderData,u=z.blockers;u.size>0&&(u=new Map(u),u.forEach((e,t)=>u.set(t,Re)));let c,d=!U&&je(t,n.matches||z.matches),h=!0===D||null!=z.navigation.formMethod&&Tt(z.navigation.formMethod)&&!0!==t.state?._isRedirect;if(a&&(l=a,a=void 0),U||"POP"===N||("PUSH"===N?e.history.push(t,t.state):"REPLACE"===N&&e.history.replace(t,t.state)),"POP"===N){let e=Z.get(z.location.pathname);e&&e.has(t.pathname)?c={currentLocation:z.location,nextLocation:t}:Z.has(t.pathname)&&(c={currentLocation:t,nextLocation:z.location})}else if(j){let e=Z.get(z.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),Z.set(z.location.pathname,e)),c={currentLocation:z.location,nextLocation:t}}oe({...n,actionData:i,loaderData:s,historyAction:N,location:t,initialized:!0,renderFallback:!1,navigation:Ae,revalidation:"idle",restoreScrollPosition:d,preventScrollReset:h,blockers:u},{viewTransitionOpts:c,flushSync:!0===r}),N="POP",D=!1,j=!1,U=!1,V=!1,R?.resolve(),R=null,ie?.resolve(),ie=null}async function se(t,n,i){T&&T.abort(),T=null,N=t,U=!0===(i&&i.startUninterruptedRevalidation),function(e,t){if(y&&_){let n=ze(e,t);y[n]=_()}}(z.location,z.matches),D=!0===(i&&i.preventScrollReset),j=!0===(i&&i.enableViewTransition);let c=a||l,d=i&&i.overrideNavigation,h=i?.initialHydration&&z.matches&&z.matches.length>0&&!k?z.matches:F(c,n,u),f=!0===(i&&i.flushSync);if(h&&z.initialized&&!V&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(z.location,n)&&!(i&&i.submission&&Tt(i.submission.formMethod)))return void ae(n,{matches:h},{flushSync:f});let m=Fe(h,c,n.pathname);if(m.active&&m.matches&&(h=m.matches),!h){let{error:e,notFoundMatches:t,route:r}=Me(n.pathname);return void ae(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:f})}T=new AbortController;let p,g=lt(e.history,n,T.signal,i&&i.submission),v=e.getContext?await e.getContext():new A;if(i&&i.pendingError)p=[pt(h).route.id,{type:"error",error:i.pendingError}];else if(i&&i.submission&&Tt(i.submission.formMethod)){let t=await async function(t,n,i,a,c,d,h,f={}){if(he(),oe({navigation:zt(n,i)},{flushSync:!0===f.flushSync}),d){let e=await Ve(a,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:n}=gt(l);return{matches:t,pendingActionResult:[n.id,{type:"error",error:e.error}]}}let t=pt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:r}=Me(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:t}]}}a=e.matches}let m,p=Lt(a,n);if(p.route.action||p.route.lazy){let e=await ce(t,n,rt(o,s,t,n,a,p,h?[]:r,c),c,null);if(m=e[p.route.id],!m)for(let t of a)if(e[t.route.id]){m=e[t.route.id];break}if(t.signal.aborted)return{shortCircuited:!0}}else m={type:"error",error:yt(405,{method:t.method,pathname:n.pathname,routeId:p.route.id})};if(xt(m)){let n;return n=f&&null!=f.replace?f.replace:st(m.response.headers.get("Location"),new URL(t.url),u,e.history)===z.location.pathname+z.location.search,await ue(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(kt(m)){let e=pt(a,p.route.id);return!0!==(f&&f.replace)&&(N="PUSH"),{matches:a,pendingActionResult:[e.route.id,m,p.route.id]}}return{matches:a,pendingActionResult:[p.route.id,m]}}(g,n,i.submission,h,v,m.active,i&&!0===i.initialHydration,{replace:i.replace,flushSync:f});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(kt(r)&&me(r.error)&&404===r.error.status)return T=null,void ae(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}h=t.matches||h,p=t.pendingActionResult,d=Mt(n,i.submission),f=!1,m.active=!1,g=lt(e.history,g.url,g.signal)}let{shortCircuited:b,matches:w,loaderData:x,errors:S}=await async function(t,n,i,c,d,h,f,m,p,g,y,v,_){let b=h||Mt(n,f),w=f||m||Ct(b),k=!U&&!g;if(d){if(k){let e=le(v);oe({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:y})}let e=await Ve(i,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:n}=gt(l);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=pt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=Me(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}i=e.matches}let x=a||l,{dsMatches:S,revalidatingFetchers:E}=Ze(t,c,o,s,e.history,z,i,w,n,g?[]:r,!0===g,V,W,ee,J,Q,x,u,null!=e.patchRoutesOnNavigation,v,_);if(Y=++G,!e.dataStrategy&&!S.some(e=>e.shouldLoad)&&!S.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===E.length){let e=Ee();return ae(n,{matches:i,loaderData:{},errors:v&&kt(v[1])?{[v[0]]:v[1].error}:null,...mt(v),...e?{fetchers:new Map(z.fetchers)}:{}},{flushSync:y}),{shortCircuited:!0}}if(k){let e={};if(!d){e.navigation=b;let t=le(v);void 0!==t&&(e.actionData=t)}E.length>0&&(e.fetchers=function(e){return e.forEach(e=>{let t=z.fetchers.get(e.key),n=Ot(void 0,t?t.data:void 0);z.fetchers.set(e.key,n)}),new Map(z.fetchers)}(E)),oe(e,{flushSync:y})}E.forEach(e=>{ke(e.key),e.controller&&q.set(e.key,e.controller)});let P=()=>E.forEach(e=>ke(e.key));T&&T.signal.addEventListener("abort",P);let{loaderResults:L,fetcherResults:C}=await de(S,E,t,n,c);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",P);E.forEach(e=>q.delete(e.key));let M=vt(L);if(M)return await ue(t,M.result,!0,{replace:p}),{shortCircuited:!0};if(M=vt(C),M)return Q.add(M.key),await ue(t,M.result,!0,{replace:p}),{shortCircuited:!0};let{loaderData:O,errors:A}=ht(z,i,L,v,E,C);g&&z.errors&&(A={...z.errors,...A});let N=Ee(),R=Te(Y),D=N||R||E.length>0;return{matches:i,loaderData:O,errors:A,...D?{fetchers:new Map(z.fetchers)}:{}}}(g,n,h,v,m.active,d,i&&i.submission,i&&i.fetcherSubmission,i&&i.replace,i&&!0===i.initialHydration,f,p,i&&i.callSiteDefaultShouldRevalidate);b||(T=null,ae(n,{matches:w||h,...mt(p),loaderData:x,errors:S}))}function le(e){return e&&!kt(e[1])?{[e[0]]:e[1].data}:z.actionData?0===Object.keys(z.actionData).length?null:z.actionData:void 0}async function ue(r,i,o,{submission:a,fetcherSubmission:s,preventScrollReset:l,replace:c}={}){o||(R?.resolve(),R=null),i.response.headers.has("X-Remix-Revalidate")&&(V=!0);let d=i.response.headers.get("Location");S(d,"Expected a Location header on the redirect Response"),d=st(d,new URL(r.url),u,e.history);let h=P(z.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(re(d)){const n=O(d,!0);e=n.origin!==t.location.origin||null==te(n.pathname,u)}if(e)return void(c?t.location.replace(d):t.location.assign(d))}T=null;let f=!0===c||i.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:m,formAction:p,formEncType:g}=z.navigation;!a&&!s&&m&&p&&g&&(a=Ct(z.navigation));let y=a||s;Oe.has(i.response.status)&&y&&Tt(y.formMethod)?await se(f,h,{submission:{...y,formAction:d},preventScrollReset:l||D,enableViewTransition:o?j:void 0}):await se(f,h,{overrideNavigation:Mt(h,a),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:o?j:void 0})}async function ce(e,t,n,r,i){let o,a={};try{o=await async function(e,t,n,r,i,o,a){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,unstable_url:ut(t,n),unstable_pattern:pe(r),params:r[0].params,context:o,matches:r},l=a?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Xe(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},u=await e({...s,fetcherKey:i,runClientMiddleware:l});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(c){}return u}(f,e,t,n,i,r,!1)}catch(s){return n.filter(e=>e.shouldLoad).forEach(e=>{a[e.route.id]={type:"error",error:s}}),a}if(e.signal.aborted)return a;if(!Tt(e.method))for(let l of n){if("error"===o[l.route.id]?.type)break;o.hasOwnProperty(l.route.id)||z.loaderData.hasOwnProperty(l.route.id)||z.errors&&z.errors.hasOwnProperty(l.route.id)||!l.shouldCallHandler()||(o[l.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${l.route.id}`)})}for(let[l,c]of Object.entries(o))if(wt(c)){let t=c.result;a[l]={type:"redirect",response:ot(t,e,l,n,u)}}else a[l]=await it(c);return a}async function de(e,t,n,r,i){let o=ce(n,r,e,i,null),a=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ce(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:yt(404,{pathname:e.path})}})}));return{loaderResults:await o,fetcherResults:(await a).reduce((e,t)=>Object.assign(e,t),{})}}function he(){V=!0,J.forEach((e,t)=>{q.has(t)&&W.add(t),ke(t)})}function fe(e,t,n={}){z.fetchers.set(e,t),oe({fetchers:new Map(z.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ge(e,t,n,r={}){let i=pt(z.matches,t);we(e),oe({errors:{[i.route.id]:n},fetchers:new Map(z.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function ye(e){return X.set(e,(X.get(e)||0)+1),ee.has(e)&&ee.delete(e),z.fetchers.get(e)||Ne}function we(e){let t=z.fetchers.get(e);!q.has(e)||t&&"loading"===t.state&&K.has(e)||ke(e),J.delete(e),K.delete(e),Q.delete(e),ee.delete(e),W.delete(e),z.fetchers.delete(e)}function ke(e,t){let n=q.get(e);n&&(n.abort(t),q.delete(e))}function Se(e){for(let t of e){let e=At(ye(t).data);z.fetchers.set(t,e)}}function Ee(){let e=[],t=!1;for(let n of Q){let r=z.fetchers.get(n);S(r,`Expected fetcher: ${n}`),"loading"===r.state&&(Q.delete(n),e.push(n),t=!0)}return Se(e),t}function Te(e){let t=[];for(let[n,r]of K)if(r0}function Pe(e){z.blockers.delete(e),ne.delete(e)}function Le(e,t){let n=z.blockers.get(e)||Re;S("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(z.blockers);r.set(e,t),oe({blockers:r})}function Ce({currentLocation:e,nextLocation:t,historyAction:n}){if(0===ne.size)return;ne.size>1&&E(!1,"A router only supports one blocker at a time");let r=Array.from(ne.entries()),[i,o]=r[r.length-1],a=z.blockers.get(i);return a&&"proceeding"===a.state?void 0:o({currentLocation:e,nextLocation:t,historyAction:n})?i:void 0}function Me(e){let t=yt(404,{pathname:e}),{matches:n,route:r}=gt(a||l);return{notFoundMatches:n,route:r,error:t}}function ze(e,t){return v&&v(e,t.map(e=>B(e,z.loaderData)))||e.key}function je(e,t){if(y){let n=ze(e,t),r=y[n];if("number"==typeof r)return r}return null}function Fe(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:$(n,r,u,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:$(n,r,u,!0)}}return{active:!1,matches:null}}async function Ve(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let c=t;for(;;){let t=null==a,h=a||l,f=s;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:c,fetcherKey:i,patch:(e,t)=>{r.aborted||We(e,t,h,f,o,!1)}})}catch(d){return{type:"error",error:d,partialMatches:c}}finally{t&&!r.aborted&&(l=[...l])}if(r.aborted)return{type:"aborted"};let m=F(h,n,u),p=null;if(m){if(0===Object.keys(m[0].params).length)return{type:"success",matches:m};if(p=$(h,n,u,!0),!(p&&c.lengthe.route.id===t[n].route.id)}return h={get basename(){return u},get future(){return m},get state(){return z},get routes(){return l},get window(){return t},initialize:function(){if(p=e.history.listen(({action:t,location:n,delta:r})=>{if(L)return L(),void(L=void 0);E(0===ne.size||null!=r,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ce({currentLocation:z.location,nextLocation:n,historyAction:t});if(i&&null!=r){let t=new Promise(e=>{L=e});return e.history.go(-1*r),Le(i,{state:"blocked",location:n,proceed(){Le(i,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(z.blockers);e.set(i,Re),oe({blockers:e})}}),R?.resolve(),void(R=null)}return se(t,n)}),n){!function(e,t){try{let n=e.sessionStorage.getItem(Ie);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(n){}}(t,Z);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(Ie,JSON.stringify(r))}catch(n){E(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}(t,Z);t.addEventListener("pagehide",e),H=()=>t.removeEventListener("pagehide",e)}return z.initialized||se("POP",z.location,{initialHydration:!0}),h},subscribe:function(e){return g.add(e),()=>g.delete(e)},enableScrollRestoration:function(e,t,n){if(y=e,_=t,v=n||null,!b&&z.navigation===Ae){b=!0;let e=je(z.location,z.matches);null!=e&&oe({restoreScrollPosition:e})}return()=>{y=null,_=null,v=null}},navigate:async function t(n,r){if(R?.resolve(),R=null,"number"==typeof n){R||(R=Nt());let t=R.promise;return e.history.go(n),t}let i,{path:o,submission:a,error:s}=Be(!1,$e(z.location,z.matches,u,n,r?.fromRouteId,r?.relative),r);r?.unstable_mask&&(i={pathname:"",search:"",hash:"",..."string"==typeof r.unstable_mask?M(r.unstable_mask):{...z.location.unstable_mask,...r.unstable_mask}});let l=z.location,c=P(l,o,r&&r.state,void 0,i);c={...c,...e.history.encodeLocation(c)};let d=r&&null!=r.replace?r.replace:void 0,h="PUSH";!0===d?h="REPLACE":!1===d||null!=a&&Tt(a.formMethod)&&a.formAction===z.location.pathname+z.location.search&&(h="REPLACE");let f=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,m=!0===(r&&r.flushSync),p=Ce({currentLocation:l,nextLocation:c,historyAction:h});p?Le(p,{state:"blocked",location:c,proceed(){Le(p,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(n,r)},reset(){let e=new Map(z.blockers);e.set(p,Re),oe({blockers:e})}}):await se(h,c,{submission:a,pendingError:s,preventScrollReset:f,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:r&&r.unstable_defaultShouldRevalidate})},fetch:async function(t,n,i,c){ke(t);let d=!0===(c&&c.flushSync),h=a||l,f=$e(z.location,z.matches,u,i,n,c?.relative),m=F(h,f,u),p=Fe(m,h,f);if(p.active&&p.matches&&(m=p.matches),!m)return void ge(t,n,yt(404,{pathname:f}),{flushSync:d});let{path:g,submission:y,error:v}=Be(!0,f,c);if(v)return void ge(t,n,v,{flushSync:d});let _=e.getContext?await e.getContext():new A,b=!0===(c&&c.preventScrollReset);y&&Tt(y.formMethod)?await async function(t,n,i,c,d,h,f,m,p,g){he(),J.delete(t),fe(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(p,z.fetchers.get(t)),{flushSync:f});let y=new AbortController,v=lt(e.history,i,y.signal,p);if(h){let e=await Ve(c,new URL(v.url).pathname,v.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ge(t,n,e.error,{flushSync:f});if(!e.matches)return void ge(t,n,yt(404,{pathname:i}),{flushSync:f});c=e.matches}let _=Lt(c,i);if(!_.route.action&&!_.route.lazy)return void ge(t,n,yt(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:f});q.set(t,y);let b=G,w=rt(o,s,v,i,c,_,r,d),k=await ce(v,i,w,d,t),x=k[_.route.id];if(!x)for(let e of w)if(k[e.route.id]){x=k[e.route.id];break}if(v.signal.aborted)return void(q.get(t)===y&&q.delete(t));if(ee.has(t)){if(xt(x)||kt(x))return void fe(t,At(void 0))}else{if(xt(x))return q.delete(t),Y>b?void fe(t,At(void 0)):(Q.add(t),fe(t,Ot(p)),ue(v,x,!1,{fetcherSubmission:p,preventScrollReset:m}));if(kt(x))return void ge(t,n,x.error)}let E=z.navigation.location||z.location,P=lt(e.history,E,y.signal),L=a||l,C="idle"!==z.navigation.state?F(L,z.navigation.location,u):z.matches;S(C,"Didn't find any matches after fetcher action");let M=++G;K.set(t,M);let O=Ot(p,x.data);z.fetchers.set(t,O);let{dsMatches:A,revalidatingFetchers:R}=Ze(P,d,o,s,e.history,z,C,p,E,r,!1,V,W,ee,J,Q,L,u,null!=e.patchRoutesOnNavigation,[_.route.id,x],g);R.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=z.fetchers.get(t),r=Ot(void 0,n?n.data:void 0);z.fetchers.set(t,r),ke(t),e.controller&&q.set(t,e.controller)}),oe({fetchers:new Map(z.fetchers)});let D=()=>R.forEach(e=>ke(e.key));y.signal.addEventListener("abort",D);let{loaderResults:I,fetcherResults:j}=await de(A,R,P,E,d);if(y.signal.aborted)return;if(y.signal.removeEventListener("abort",D),K.delete(t),q.delete(t),R.forEach(e=>q.delete(e.key)),z.fetchers.has(t)){let e=At(x.data);z.fetchers.set(t,e)}let $=vt(I);if($)return ue(P,$.result,!1,{preventScrollReset:m});if($=vt(j),$)return Q.add($.key),ue(P,$.result,!1,{preventScrollReset:m});let{loaderData:B,errors:Z}=ht(z,C,I,void 0,R,j);Te(M),"loading"===z.navigation.state&&M>Y?(S(N,"Expected pending action"),T&&T.abort(),ae(z.navigation.location,{matches:C,loaderData:B,errors:Z,fetchers:new Map(z.fetchers)})):(oe({errors:Z,loaderData:ft(z.loaderData,B,C,Z),fetchers:new Map(z.fetchers)}),V=!1)}(t,n,g,m,_,p.active,d,b,y,c&&c.unstable_defaultShouldRevalidate):(J.set(t,{routeId:n,path:g}),await async function(t,n,i,a,l,u,c,d,h){let f=z.fetchers.get(t);fe(t,Ot(h,f?f.data:void 0),{flushSync:c});let m=new AbortController,p=lt(e.history,i,m.signal);if(u){let e=await Ve(a,new URL(p.url).pathname,p.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ge(t,n,e.error,{flushSync:c});if(!e.matches)return void ge(t,n,yt(404,{pathname:i}),{flushSync:c});a=e.matches}let g=Lt(a,i);q.set(t,m);let y=G,v=(await ce(p,i,rt(o,s,p,i,a,g,r,l),l,t))[g.route.id];q.get(t)===m&&q.delete(t);if(p.signal.aborted)return;if(ee.has(t))return void fe(t,At(void 0));if(xt(v))return Y>y?void fe(t,At(void 0)):(Q.add(t),void(await ue(p,v,!1,{preventScrollReset:d})));if(kt(v))return void ge(t,n,v.error);fe(t,At(v.data))}(t,n,g,m,_,p.active,d,b,y))},revalidate:function(){ie||(ie=Nt()),he(),oe({revalidation:"loading"});let e=ie.promise;return"submitting"===z.navigation.state?e:"idle"===z.navigation.state?(se(z.historyAction,z.location,{startUninterruptedRevalidation:!0}),e):(se(N||z.historyAction,z.navigation.location,{overrideNavigation:z.navigation,enableViewTransition:!0===j}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ye,resetFetcher:function(e,t){ke(e,t?.reason),fe(e,At(null))},deleteFetcher:function(e){let t=(X.get(e)||0)-1;t<=0?(X.delete(e),ee.add(e)):X.set(e,t),oe({fetchers:new Map(z.fetchers)})},dispose:function(){p&&p(),H&&H(),g.clear(),T&&T.abort(),z.fetchers.forEach((e,t)=>we(t)),z.blockers.forEach((e,t)=>Pe(t))},getBlocker:function(e,t){let n=z.blockers.get(e)||Re;return ne.get(e)!==t&&ne.set(e,t),n},deleteBlocker:Pe,patchRoutes:function(e,t,n=!1){let r=null==a;We(e,t,a||l,s,o,n),r&&(l=[...l],oe({}))},_internalFetchControllers:q,_internalSetRoutes:function(e){s={},a=I(e,o,void 0,s)},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){oe(e)}},e.unstable_instrumentations&&(h=function(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[ve]??e.navigate,r=be(n.navigate,t,(...t)=>{let[n,r]=t;return{to:"number"==typeof n||"string"==typeof n?n:n?C(n):".",...xe(e,r??{})}});r&&(r[ve]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[ve]??e.fetch,r=be(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??".",fetcherKey:n,...xe(e,i??{})}});r&&(r[ve]=t,e.fetch=r)}return e}(h,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),h}function $e(e,t,n,r,i,o){let a,s;if(i){a=[];for(let e of t)if(a.push(e),e.route.id===i){s=e;break}}else a=t,s=t[t.length-1];let l=le(r||".",se(a),te(e.pathname,n)||e.pathname,"path"===o);if(null==r&&(l.search=e.search,l.hash=e.hash),(null==r||""===r||"."===r)&&s){let e=Pt(l.search);if(s.route.index&&!e)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&e){let e=new URLSearchParams(l.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();l.search=n?`?${n}`:""}}return"/"!==n&&(l.pathname=function({basename:e,pathname:t}){return"/"===t?e:ue([e,t])}({basename:n,pathname:l.pathname})),C(l)}function Be(e,t,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:t};if(n.formMethod&&(r=n.formMethod,!Me.has(r.toUpperCase())))return{path:t,error:yt(405,{method:n.formMethod})};var r;let i,o,a=()=>({path:t,error:yt(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),l=_t(t);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Tt(s))return a();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Tt(s))return a();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(d){return a()}}}if(S("function"==typeof FormData,"FormData is not available in this environment"),n.formData)i=ct(n.formData),o=n.formData;else if(n.body instanceof FormData)i=ct(n.body),o=n.body;else if(n.body instanceof URLSearchParams)i=n.body,o=dt(i);else if(null==n.body)i=new URLSearchParams,o=new FormData;else try{i=new URLSearchParams(n.body),o=dt(i)}catch(d){return a()}let u={formMethod:s,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(Tt(u.formMethod))return{path:t,submission:u};let c=M(t);return e&&c.search&&Pt(c.search)&&i.append("index",""),c.search=`?${i}`,{path:C(c),submission:u}}function Ze(e,t,n,r,i,o,a,s,l,u,c,d,h,f,m,p,g,y,v,_,b){let w,k=_?kt(_[1])?_[1].error:_[1].data:void 0,x=i.createURL(o.location),S=i.createURL(l);if(c&&o.errors){let e=Object.keys(o.errors)[0];w=a.findIndex(t=>t.route.id===e)}else if(_&&kt(_[1])){let e=_[0];w=a.findIndex(t=>t.route.id===e)-1}let E=_?_[1].statusCode:void 0,T=E&&E>=400,P={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:S,nextParams:a[0].params,...s,actionResult:k,actionStatus:E},L=pe(a),C=a.map((i,a)=>{let{route:s}=i,h=null;if(null!=w&&a>w)h=!1;else if(s.lazy)h=!0;else if(He(s))if(c){let{shouldLoad:e}=Ue(s,o.loaderData,o.errors);h=e}else(function(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i})(o.loaderData,o.matches[a],i)&&(h=!0);else h=!1;if(null!==h)return nt(n,r,e,l,L,i,u,t,h);let f=!1;"boolean"==typeof b?f=b:T?f=!1:(d||x.pathname+x.search===S.pathname+S.search||x.search!==S.search||function(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}(o.matches[a],i))&&(f=!0);let m={...P,defaultShouldRevalidate:f};return nt(n,r,e,l,L,i,u,t,Ve(i,m),m,b)}),M=[];return m.forEach((e,s)=>{if(c||!a.some(t=>t.route.id===e.routeId)||f.has(s))return;let l=o.fetchers.get(s),m=l&&"idle"!==l.state&&void 0===l.data,_=F(g,e.path,y);if(!_){if(v&&m)return;return void M.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(p.has(s))return;let w=Lt(_,e.path),k=new AbortController,x=lt(i,e.path,k.signal),S=null;if(h.has(s))h.delete(s),S=rt(n,r,x,e.path,_,w,u,t);else if(m)d&&(S=rt(n,r,x,e.path,_,w,u,t));else{let i;i="boolean"==typeof b?b:!T&&d;let o={...P,defaultShouldRevalidate:i};Ve(w,o)&&(S=rt(n,r,x,e.path,_,w,u,t,o))}S&&M.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:w,request:x,controller:k})}),{dsMatches:C,revalidatingFetchers:M}}function He(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function Ue(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!He(e))return{shouldLoad:!1,renderFallback:!1};let r=null!=t&&e.id in t,i=null!=n&&void 0!==n[e.id];if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if("function"==typeof e.loader&&!0===e.loader.hydrate)return{shouldLoad:!0,renderFallback:!r};let o=!r&&!i;return{shouldLoad:o,renderFallback:o}}function Ve(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"==typeof n)return n}return t.defaultShouldRevalidate}function We(e,t,n,r,i,o){let a;if(e){let t=r[e];S(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),a=t.children}else a=n;let s=[],l=[];if(t.forEach(e=>{let t=a.find(t=>qe(e,t));t?l.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=I(s,i,[e||"_","patch",String(a?.length||"0")],r);a.push(...t)}if(o&&l.length>0)for(let u=0;ut.children?.some(t=>qe(e,t)))??!1))}var Ge=new WeakMap,Ye=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(S(i,"No route found in manifest"),!i.lazy||"object"!=typeof i.lazy)return;let o=i.lazy[e];if(!o)return;let a=Ge.get(i);a||(a={},Ge.set(i,a));let s=a[e];if(s)return s;let l=(async()=>{let t=function(e){return N.has(e)}(e),n=void 0!==i[e]&&"hasErrorBoundary"!==e;if(t)E(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(n)E(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}"object"==typeof i.lazy&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>void 0===e)&&(i.lazy=void 0))})();return a[e]=l,l},Ke=new WeakMap;async function Qe(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Je(e){return e.matches.some(e=>e.route.middleware)?Xe(e,()=>Qe(e)):Qe(e)}function Xe(e,t){return async function(e,t,n,r,i){let{matches:o,...a}=e;return await et(a,o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}(e,t,e=>{if(Et(t=e)&&(n=t.status,ze.has(n))&&t.headers.has("Location"))throw e;var t,n;return e},bt,function(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:"error",result:t}}));{let{matches:r}=e,i=pt(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:"error",result:t}})}})}async function et(e,t,n,r,i,o,a=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[a];if(!l)return await n();let u,[c,d]=l,h=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{return u={value:await et(e,t,n,r,i,o,a+1)},u.value}catch(s){return u={value:await o(s,c,u)},u.value}};try{let t=await d(e,h),n=null!=t?r(t):void 0;return i(n)?n:u?n??u.value:(u={value:await h()},u.value)}catch(f){return await o(f,c,u)}}function tt(e,t,n,r,i){let o=Ye({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),a=function(e,t,n,r,i){let o=n[e.id];if(S(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=Ke.get(o);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{S("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(void 0===r)continue;let i=D(e),a=void 0!==o[e]&&"hasErrorBoundary"!==e;i?E(!i,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):a?E(!a,`Route "${o.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(o,n),Object.assign(o,{...r(o),lazy:void 0})})();return Ke.set(o,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let a,s=Object.keys(e.lazy),l=[];for(let c of s){if(i&&i.includes(c))continue;let o=Ye({key:c,route:e,manifest:n,mapRouteProperties:r});o&&(l.push(o),c===t&&(a=o))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u?.catch(()=>{}),a?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:a}}(r.route,Tt(n.method)?"action":"loader",t,e,i);return{middleware:o,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function nt(e,t,n,r,i,o,a,s,l,u=null,c){let d=!1,h=tt(e,t,n,o,a);return{...o,_lazyPromises:h,shouldLoad:l,shouldRevalidateArgs:u,shouldCallHandler:e=>(d=!0,u?Ve(o,"boolean"==typeof c?{...u,defaultShouldRevalidate:c}:"boolean"==typeof e?{...u,defaultShouldRevalidate:e}:u):l),resolve(e){let{lazy:t,loader:a,middleware:u}=o.route,c=d||l||e&&!Tt(n.method)&&(t||a),f=u&&u.length>0&&!a&&!t;return!c||!Tt(n.method)&&f?Promise.resolve({type:"data",result:void 0}):async function({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:o,handlerOverride:a,scopedContext:s}){let l,u,c=Tt(e.method),d=c?"action":"loader",h=i=>{let o,l=new Promise((e,t)=>o=t);u=()=>o(),e.signal.addEventListener("abort",u);let c=o=>"function"!=typeof i?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)):i({request:e,unstable_url:ut(e,t),unstable_pattern:n,params:r.params,context:s},...void 0!==o?[o]:[]),h=(async()=>{try{return{type:"data",result:await(a?a(e=>c(e)):c())}}catch(e){return{type:"error",result:e}}})();return Promise.race([h,l])};try{let t=c?r.route.action:r.route.loader;if(i||o)if(t){let e,[n]=await Promise.all([h(t).catch(t=>{e=t}),i,o]);if(void 0!==e)throw e;l=n}else{await i;let t=c?r.route.action:r.route.loader;if(!t){if("action"===d){let t=new URL(e.url),n=t.pathname+t.search;throw yt(405,{method:e.method,pathname:n,routeId:r.route.id})}return{type:"data",result:void 0}}[l]=await Promise.all([h(t),o])}else{if(!t){let t=new URL(e.url);throw yt(404,{pathname:t.pathname+t.search})}l=await h(t)}}catch(f){return{type:"error",result:f}}finally{u&&e.signal.removeEventListener("abort",u)}return l}({request:n,path:r,unstable_pattern:i,match:o,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:e,scopedContext:s})}}}function rt(e,t,n,r,i,o,a,s,l=null){return i.map(u=>u.route.id!==o.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:tt(e,t,n,u,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:nt(e,t,n,r,pe(i),u,a,s,!0,l))}async function it(e){let{result:t,type:n}=e;if(Et(t)){let e;try{e=await async function(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}(t)}catch(i){return{type:"error",error:i}}return"error"===n?{type:"error",error:new fe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===n?St(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:(r=t,new fe(r.init?.status??500,r.init?.statusText??"Internal Server Error",r.data)),statusCode:me(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:me(t)?t.status:void 0}:St(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t};var r}function ot(e,t,n,r,i){let o=e.headers.get("Location");if(S(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!re(o)){let a=r.slice(0,r.findIndex(e=>e.route.id===n)+1);o=$e(new URL(t.url),a,i,o),e.headers.set("Location",o)}return e}var at=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function st(e,t,n,r){if(re(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r);if(at.includes(i.protocol))throw new Error("Invalid redirect location");let o=null!=te(i.pathname,n);if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}try{let t=r.createURL(e);if(at.includes(t.protocol))throw new Error("Invalid redirect location")}catch(i){}return e}function lt(e,t,n,r){let i=e.createURL(_t(t)).toString(),o={signal:n};if(r&&Tt(r.formMethod)){let{formMethod:e,formEncType:t}=r;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(r.json)):"text/plain"===t?o.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?o.body=ct(r.formData):o.body=r.formData}return new Request(i,o)}function ut(e,t){let n=new URL(e.url),r="string"==typeof t?M(t):t;if(n.pathname=r.pathname||"/",r.search){let e=new URLSearchParams(r.search),t=e.getAll("index");e.delete("index");for(let n of t.filter(Boolean))e.append("index",n);n.search=e.size?`?${e.toString()}`:""}else n.search="";return n.hash=r.hash||"",n}function ct(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"==typeof r?r:r.name);return t}function dt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ht(e,t,n,r,i,o){let{loaderData:a,errors:s}=function(e,t,n,r=!1,i=!1){let o,a={},s=null,l=!1,u={},c=n&&kt(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,h=t[d];if(S(!xt(h),"Cannot handle redirect results in processLoaderData"),kt(h)){let t=h.error;if(void 0!==c&&(t=c,c=void 0),s=s||{},i)s[d]=t;else{let n=pt(e,d);null==s[n.route.id]&&(s[n.route.id]=t)}r||(a[d]=je),l||(l=!0,o=me(h.error)?h.error.status:500),h.headers&&(u[d]=h.headers)}else a[d]=h.data,h.statusCode&&200!==h.statusCode&&!l&&(o=h.statusCode),h.headers&&(u[d]=h.headers)}),void 0!==c&&n&&(s={[n[0]]:c},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:u}}(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let a=o[n];if(S(a,"Did not find corresponding fetcher result"),kt(a)){let t=pt(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:a.error}),e.fetchers.delete(n)}else if(xt(a))S(!1,"Unhandled fetcher revalidation redirect");else{let t=At(a.data);e.fetchers.set(n,t)}}),{loaderData:a,errors:s}}function ft(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==je).reduce((e,[t,n])=>(e[t]=n,e),{});for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function mt(e){return e?kt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function pt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function gt(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function yt(e,{pathname:t,routeId:n,method:r,type:i,message:o}={}){let a="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(a="Bad Request",r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:"invalid-body"===i&&(s="Unable to encode submission body")):403===e?(a="Forbidden",s=`Route "${n}" does not match URL "${t}"`):404===e?(a="Not Found",s=`No route matches URL "${t}"`):405===e&&(a="Method Not Allowed",r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new fe(e||500,a,new Error(s),!0)}function vt(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[e,r]=t[n];if(xt(r))return{key:e,result:r}}}function _t(e){return C({..."string"==typeof e?M(e):e,hash:""})}function bt(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&function(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}(t))}function wt(e){return Et(e.result)&&ze.has(e.result.status)}function kt(e){return"error"===e.type}function xt(e){return"redirect"===(e&&e.type)}function St(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Et(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Tt(e){return Le.has(e.toUpperCase())}function Pt(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function Lt(e,t){let n="string"==typeof t?M(t).search:t.search;if(e[e.length-1].route.index&&Pt(n||""))return e[e.length-1];let r=ae(e);return r[r.length-1]}function Ct(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(t&&n&&r)return null!=i?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i}:null!=o?{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0}:void 0!==a?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}:void 0}function Mt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function zt(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ot(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function At(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Nt(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch(t){}},t=async e=>{i(e);try{await n}catch(t){}}});return{promise:n,resolve:e,reject:t}}var Rt=y.createContext(null);Rt.displayName="DataRouter";var Dt=y.createContext(null);Dt.displayName="DataRouterState";var It=y.createContext(!1);function jt(){return y.useContext(It)}var Ft=y.createContext({isTransitioning:!1});Ft.displayName="ViewTransition";var $t=y.createContext(new Map);$t.displayName="Fetchers";var Bt=y.createContext(null);Bt.displayName="Await";var Zt=y.createContext(null);Zt.displayName="Navigation";var Ht=y.createContext(null);Ht.displayName="Location";var Ut=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ut.displayName="Route";var Vt=y.createContext(null);Vt.displayName="RouteError";var Wt="REACT_ROUTER_ERROR";function qt(){return null!=y.useContext(Ht)}function Gt(){return S(qt(),"useLocation() may be used only in the context of a component."),y.useContext(Ht).location}var Yt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Kt(e){y.useContext(Zt).static||y.useLayoutEffect(e)}function Qt(){let{isDataRoute:e}=y.useContext(Ut);return e?function(){let{router:e}=function(e){let t=y.useContext(Rt);return S(t,un(e)),t}("useNavigate"),t=dn("useNavigate"),n=y.useRef(!1);return Kt(()=>{n.current=!0}),y.useCallback(async(r,i={})=>{E(n.current,Yt),n.current&&("number"==typeof r?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}():function(){S(qt(),"useNavigate() may be used only in the context of a component.");let e=y.useContext(Rt),{basename:t,navigator:n}=y.useContext(Zt),{matches:r}=y.useContext(Ut),{pathname:i}=Gt(),o=JSON.stringify(se(r)),a=y.useRef(!1);return Kt(()=>{a.current=!0}),y.useCallback((r,s={})=>{if(E(a.current,Yt),!a.current)return;if("number"==typeof r)return void n.go(r);let l=le(r,JSON.parse(o),i,"path"===s.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:ue([t,l.pathname])),(s.replace?n.replace:n.push)(l,s.state,s)},[t,n,o,i,e])}()}var Jt=y.createContext(null);function Xt(){let{matches:e}=y.useContext(Ut),t=e[e.length-1];return t?t.params:{}}function en(e,{relative:t}={}){let{matches:n}=y.useContext(Ut),{pathname:r}=Gt(),i=JSON.stringify(se(n));return y.useMemo(()=>le(e,JSON.parse(i),r,"path"===t),[e,i,r,t])}function tn(e,t,n){S(qt(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=y.useContext(Zt),{matches:i}=y.useContext(Ut),o=i[i.length-1],a=o?o.params:{},s=o?o.pathname:"/",l=o?o.pathnameBase:"/",u=o&&o.route;{let e=u&&u.path||"";mn(s,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${s}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent to .`)}let c,d=Gt();if(t){let e="string"==typeof t?M(t):t;S("/"===l||e.pathname?.startsWith(l),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),c=e}else c=d;let h=c.pathname||"/",f=h;if("/"!==l){let e=l.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=F(e,{pathname:f});E(u||null!=m,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),E(null==m||void 0!==m[m.length-1].route.element||void 0!==m[m.length-1].route.Component||void 0!==m[m.length-1].route.lazy,`Matched leaf route at location "${c.pathname}${c.search}${c.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let p=function(e,t=[],n){let r=n?.state;if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let i=e,o=r?.errors;if(null!=o){let e=i.findIndex(e=>e.route.id&&void 0!==o?.[e.route.id]);S(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let a=!1,s=-1;if(n&&r){a=r.renderFallback;for(let e=0;e=0?i.slice(0,s+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:pe(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let c,d=!1,h=null,f=null;r&&(c=o&&n.route.id?o[n.route.id]:void 0,h=n.route.errorElement||rn,a&&(s<0&&0===l?(mn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,f=null):s===l&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,l+1)),p=()=>{let t;return t=c?h:d?f:n.route.Component?y.createElement(n.route.Component,null):n.route.element?n.route.element:e,y.createElement(ln,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===l)?y.createElement(on,{location:r.location,revalidation:r.revalidation,component:h,error:c,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):p()},null)}(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},a,e.params),pathname:ue([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?l:ue([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),i,n);return t&&p?y.createElement(Ht.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...c},navigationType:"POP"}},p):p}function nn(){let e=hn(),t=me(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:o},"ErrorBoundary")," or"," ",y.createElement("code",{style:o},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,a)}var rn=y.createElement(nn,null),on=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith(`${Wt}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new fe(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?y.createElement(Ut.Provider,{value:this.props.routeContext},y.createElement(Vt.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(sn,{error:e},t):t}};on.contextType=It;var an=new WeakMap;function sn({children:e,error:t}){let{basename:n}=y.useContext(Zt);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${Wt}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let r=an.get(t);if(r)throw r;let i=ye(e.location,n);if(ge&&!an.get(t)){if(!i.isExternal&&!e.reloadDocument){const n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw an.set(t,n),n}window.location.href=i.absoluteURL||i.to}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function ln({routeContext:e,match:t,children:n}){let r=y.useContext(Rt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Ut.Provider,{value:e},n)}function un(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cn(e){let t=y.useContext(Dt);return S(t,un(e)),t}function dn(e){let t=function(e){let t=y.useContext(Ut);return S(t,un(e)),t}(e),n=t.matches[t.matches.length-1];return S(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function hn(){let e=y.useContext(Vt),t=cn("useRouteError"),n=dn("useRouteError");return void 0!==e?e:t.errors?.[n]}var fn={};function mn(e,t,n){t||fn[e]||(fn[e]=!0,E(!1,n))}var pn={};function gn(e,t){e||pn[t]||(pn[t]=!0,console.warn(t))}var yn=y.useOptimistic,vn=()=>{};function _n(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&E(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&E(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&E(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var bn=["HydrateFallback","hydrateFallbackElement"],wn=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}};function kn({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=jt()||r;let[i,o]=y.useState(e.state),[a,s]=(l=i,yn?yn(l):[l,vn]);var l;let[u,c]=y.useState(),[d,h]=y.useState({isTransitioning:!1}),[f,m]=y.useState(),[p,g]=y.useState(),[v,_]=y.useState(),b=y.useRef(new Map),w=y.useCallback((i,{deletedFetchers:a,newErrors:l,flushSync:u,viewTransitionOpts:d})=>{l&&n&&Object.values(l).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},unstable_pattern:pe(i.matches)})),i.fetchers.forEach((e,t)=>{void 0!==e.data&&b.current.set(t,e.data)}),a.forEach(e=>b.current.delete(e)),gn(!1===u||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let v=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(gn(null==d||v,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),d&&v){if(t&&u){t(()=>{p&&(f?.resolve(),p.skipTransition()),h({isTransitioning:!0,flushSync:!0,currentLocation:d.currentLocation,nextLocation:d.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(i))});return n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),c(void 0),h({isTransitioning:!1})})}),void t(()=>g(n))}p?(f?.resolve(),p.skipTransition(),_({state:i,currentLocation:d.currentLocation,nextLocation:d.nextLocation})):(c(i),h({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}))}else t&&u?t(()=>o(i)):!1===r?o(i):y.startTransition(()=>{!0===r&&s(e=>xn(e,i)),o(i)})},[e.window,t,p,f,r,s,n]);y.useLayoutEffect(()=>e.subscribe(w),[e,w]),y.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new wn)},[d]),y.useEffect(()=>{if(f&&u&&e.window){let t=u,n=f.promise,i=e.window.document.startViewTransition(async()=>{!1===r?o(t):y.startTransition(()=>{!0===r&&s(e=>xn(e,t)),o(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),c(void 0),h({isTransitioning:!1})}),g(i)}},[u,f,e.window,r,s]),y.useEffect(()=>{f&&u&&a.location.key===u.location.key&&f.resolve()},[f,p,a.location,u]),y.useEffect(()=>{!d.isTransitioning&&v&&(c(v.state),h({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),_(void 0))},[d.isTransitioning,v]);let k=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||"/",S=y.useMemo(()=>({router:e,navigator:k,static:!1,basename:x,onError:n}),[e,k,x,n]);return y.createElement(y.Fragment,null,y.createElement(Rt.Provider,{value:S},y.createElement(Dt.Provider,{value:a},y.createElement($t.Provider,{value:b.current},y.createElement(Ft.Provider,{value:d},y.createElement(Tn,{basename:x,location:a.location,navigationType:a.historyAction,navigator:k,unstable_useTransitions:r},y.createElement(Sn,{routes:e.routes,future:e.future,state:a,isStatic:!1,onError:n})))))),null)}function xn(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var Sn=y.memo(function({routes:e,future:t,state:n,isStatic:r,onError:i}){return tn(e,void 0,{state:n,isStatic:r,onError:i,future:t})});function En(e){return function(e){let t=y.useContext(Ut).outlet;return y.useMemo(()=>t&&y.createElement(Jt.Provider,{value:e},t),[t,e])}(e.context)}function Tn({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:a}){S(!qt(),"You cannot render a inside another . You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=y.useMemo(()=>({basename:s,navigator:i,static:o,unstable_useTransitions:a,future:{}}),[s,i,o,a]);"string"==typeof n&&(n=M(n));let{pathname:u="/",search:c="",hash:d="",state:h=null,key:f="default",unstable_mask:m}=n,p=y.useMemo(()=>{let e=te(u,s);return null==e?null:{location:{pathname:e,search:c,hash:d,state:h,key:f,unstable_mask:m},navigationType:r}},[s,u,c,d,h,f,r,m]);return E(null!=p,` is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the won't render anything.`),null==p?null:y.createElement(Zt.Provider,{value:l},y.createElement(Ht.Provider,{children:t,value:p}))}y.Component;var Pn="get",Ln="application/x-www-form-urlencoded";function Cn(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function Mn(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}var zn=null;var On=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function An(e){return null==e||On.has(e)?e:(E(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Ln}"`),null)}function Nn(e,t){let n,r,i,o,a;if(Cn(s=e)&&"form"===s.tagName.toLowerCase()){let a=e.getAttribute("action");r=a?te(a,t):null,n=e.getAttribute("method")||Pn,i=An(e.getAttribute("enctype"))||Ln,o=new FormData(e)}else if(function(e){return Cn(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Cn(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw new Error('Cannot submit a