@remit/web-client-dist 0.0.689 → 0.0.690
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{BriefPane-CIgScC6f.js → BriefPane-uF6csCem.js} +1 -1
- package/assets/{CalendarEventEditor-Bv8Zwepk.js → CalendarEventEditor-B0SWzPqQ.js} +1 -1
- package/assets/{CalendarEventPopup-DzSD-pN5.js → CalendarEventPopup-V9BZRnwN.js} +1 -1
- package/assets/{CalendarLoadFailed-DlvWlSvt.js → CalendarLoadFailed-CU4C4nFf.js} +1 -1
- package/assets/{CalendarQuickCreate-6gB_5E4G.js → CalendarQuickCreate-CaO2GHZr.js} +1 -1
- package/assets/{CalendarSession-DViVPv6J.js → CalendarSession-Ub9ZzsQN.js} +1 -1
- package/assets/{DesktopChrome-m6od8Ja9.js → DesktopChrome-H9yEQYFf.js} +1 -1
- package/assets/{DropdownMenu-C_eApX94.js → DropdownMenu-CGhv-K3k.js} +1 -1
- package/assets/{EmptyState-BL1JRo_I.js → EmptyState-B_Kthrla.js} +1 -1
- package/assets/{ErrorState-CKFCoido.js → ErrorState-BB0xpcCi.js} +1 -1
- package/assets/{FlaggedPane-B-I6yPP2.js → FlaggedPane-CyyX0x8y.js} +1 -1
- package/assets/{FullCompose-_sj778B4.js → FullCompose-sAZlqUaR.js} +1 -1
- package/assets/{LabelApplyTrigger-BhX06pIz.js → LabelApplyTrigger-ChzWyjHs.js} +1 -1
- package/assets/{MailShell-C_g9w1zh.js → MailShell-DY2Ot0ah.js} +1 -1
- package/assets/{MailViewChrome-CvBM49lf.js → MailViewChrome-U9YpZx_B.js} +1 -1
- package/assets/{MailboxPane-DI1t1Hak.js → MailboxPane-DszlAx2f.js} +1 -1
- package/assets/{MessageBody-Bk3iKnM5.js → MessageBody-zT-at0bi.js} +2 -2
- package/assets/MessageToolbar-mGmOl_Xf.js +1 -0
- package/assets/{NavMenuButton-BkOzMsgi.js → NavMenuButton-B_c3nIpV.js} +1 -1
- package/assets/{OnboardingWizard-Bcxk8WK5.js → OnboardingWizard-ezuAE6sx.js} +1 -1
- package/assets/OutboxPane-D47KP_dW.js +1 -0
- package/assets/{ReportLink-DlgYSSed.js → ReportLink-C4yyzfnn.js} +1 -1
- package/assets/_calendarObjectId-5z-o0pQB.js +1 -0
- package/assets/_mailboxId-CBxHNU1m.js +1 -0
- package/assets/_messageId-DHvQcDnk.js +1 -0
- package/assets/_messageId-Dk8Pv3WS.js +1 -0
- package/assets/_messageId-q5-pR6qn.js +1 -0
- package/assets/_outboxMessageId-Akv-3HPP.js +1 -0
- package/assets/_recurrenceId-DrNRvEqM.js +1 -0
- package/assets/{_slotId-DDM7bXIa.js → _slotId-BbhN8swS.js} +1 -1
- package/assets/_threadId-9uIkuh2L.js +1 -0
- package/assets/_threadId-DdQZmst0.js +1 -0
- package/assets/_threadId-mITrrqLR.js +1 -0
- package/assets/{_view._date-aunsrlO1.js → _view._date-DyseRkCh.js} +1 -1
- package/assets/{account-service-status-BzuS1vKt.js → account-service-status-HIGoykok.js} +1 -1
- package/assets/{accounts-LD3DHIQP.js → accounts-DwJx265B.js} +1 -1
- package/assets/{advanced-CwHXjE5M.js → advanced-4BQF-R7r.js} +1 -1
- package/assets/{agenda-time-wv3Yn4YC.js → agenda-time-hKUG2dhl.js} +1 -1
- package/assets/{app-chrome-Ct8iEAKc.js → app-chrome-BI9iJnw3.js} +1 -1
- package/assets/{appearance-DXhCiVla.js → appearance-BHnbKYJT.js} +1 -1
- package/assets/{avatar-UfQRtoX1.js → avatar-COXPYlBH.js} +1 -1
- package/assets/{badge-Ci5wC_7z.js → badge-DLlDkvBl.js} +1 -1
- package/assets/{bottom-sheet-BHLpXy8c.js → bottom-sheet-BUOc_BG6.js} +1 -1
- package/assets/brief-CJySko3D.js +1 -0
- package/assets/{brief-CbjthOAj.js → brief-iq8Ra5O_.js} +1 -1
- package/assets/{calendar-C7o1JZFZ.js → calendar-Cmzt0eKc.js} +1 -1
- package/assets/{calendar-Dm6uO2dA.js → calendar-DCTglXEB.js} +1 -1
- package/assets/{calendar-event-popup-C9kH8QF7.js → calendar-event-popup-BvI6Qwla.js} +1 -1
- package/assets/{calendar-event-sidebar-B3JdISzb.js → calendar-event-sidebar-Dx3WbbPv.js} +1 -1
- package/assets/{calendar-failure-note-CRMNo9aW.js → calendar-failure-note-BRyIsChq.js} +1 -1
- package/assets/{calendar-guests-CnGUT-A_.js → calendar-guests-7MqnVXzX.js} +1 -1
- package/assets/{calendar-suggestion-CtFQODJx.js → calendar-suggestion-CpOWds4W.js} +1 -1
- package/assets/{calendars-fNaRHaAx.js → calendars-CbchUImt.js} +1 -1
- package/assets/{card-anoxIkUJ.js → card-XAEgDd1b.js} +1 -1
- package/assets/{checkbox-CqsFCQg_.js → checkbox-CzFLh5Dk.js} +1 -1
- package/assets/chevron-down-Q4i_URUt.js +1 -0
- package/assets/chevron-left-gBxhdHb5.js +1 -0
- package/assets/{circle-check-d7R16tcy.js → circle-check-BucqMsie.js} +1 -1
- package/assets/{circle-check-big-DLjZoyk0.js → circle-check-big-CDjntmXC.js} +1 -1
- package/assets/{circle-help-C8FYparP.js → circle-help-B6Fn573l.js} +1 -1
- package/assets/{classification-CRDKgH1K.js → classification-DzmiHklC.js} +1 -1
- package/assets/{clock-Bbm6HW1W.js → clock-jwuPTxhb.js} +1 -1
- package/assets/compose._-_outboxMessageId_-B7D1W3Sx.js +1 -0
- package/assets/compose._-_outboxMessageId_-CO4UJXl9.js +1 -0
- package/assets/compose._-_outboxMessageId_-D0T64VP0.js +1 -0
- package/assets/compose._-_outboxMessageId_-pcn-0-gQ.js +1 -0
- package/assets/{config-import-DC-oD8sZ.js → config-import-DZkZ73sW.js} +1 -1
- package/assets/{confirm-dialog-IJNXJDPm.js → confirm-dialog-D33DXPkQ.js} +1 -1
- package/assets/{copy-hvuziBW_.js → copy-Be7MLulJ.js} +1 -1
- package/assets/{credential-steps-DlMC5KrE.js → credential-steps-MLDe683C.js} +1 -1
- package/assets/{download-CG1DfqLR.js → download-BSz8KKlH.js} +1 -1
- package/assets/{draft-DNqwi2Zh.js → draft--MHSP3BT.js} +1 -1
- package/assets/edit-DCtOcxf9.js +1 -0
- package/assets/edit-DbSsj2wh.js +1 -0
- package/assets/{external-link-PMyhSgaf.js → external-link-o4VBX-Sp.js} +1 -1
- package/assets/{file-json-WnVFOoAJ.js → file-json-B3Qb4sPC.js} +1 -1
- package/assets/{filters-DKLKnl_R.js → filters-Mgogmt5O.js} +1 -1
- package/assets/{flagged-Bjq-IpS_.js → flagged-C-DEfMAa.js} +1 -1
- package/assets/flagged-D0pl5Vka.js +1 -0
- package/assets/{folder-input-BOF5ZXG3.js → folder-input-C8-nffA0.js} +1 -1
- package/assets/{folders-CBDVbqCE.js → folders-DodnBZua.js} +1 -1
- package/assets/{help-copy-pLuI87o4.js → help-copy-DodnPf1K.js} +1 -1
- package/assets/{import-LYqvEMAJ.js → import-C-0_jeuq.js} +1 -1
- package/assets/{index-BoYUTbor.js → index-9JWzpiiR.js} +10 -10
- package/assets/index-BnElevbT.js +1 -0
- package/assets/index-DHvQcDnk.js +1 -0
- package/assets/index-DcMLhAhx.js +1 -0
- package/assets/index-DfAafcCq.js +1 -0
- package/assets/index-Dk8Pv3WS.js +1 -0
- package/assets/{index-DCmMcCPu.js → index-DqlUjB9k.js} +4 -4
- package/assets/index-Dvms4bLC.js +1 -0
- package/assets/index-DxDWr9QM.js +1 -0
- package/assets/index-JdYKPBmV.js +1 -0
- package/assets/index-Tl1Nlwxt.js +1 -0
- package/assets/index-q5-pR6qn.js +1 -0
- package/assets/{kbd-CdSSr8_e.js → kbd-D_0s6Sx_.js} +1 -1
- package/assets/{label-chip-5FAmbl-0.js → label-chip-zJi2r8mQ.js} +1 -1
- package/assets/{labels-CMfUV9F8.js → labels-BLy-VSyB.js} +1 -1
- package/assets/{mail-S3HHCKeG.js → mail-Bh469T8t.js} +1 -1
- package/assets/{mail-VDHZ9yHE.js → mail-CXavFmSm.js} +1 -1
- package/assets/{menu-BoWQGjnP.js → menu-Dro5vzLW.js} +1 -1
- package/assets/{nav-link-Bdfj8Qsa.js → nav-link-8l24_oWF.js} +1 -1
- package/assets/new-D7laO9Pg.js +1 -0
- package/assets/onboarding-D-4ZdWHj.js +1 -0
- package/assets/{onboarding-completion-DapNqjan.js → onboarding-completion-Z1EOTA33.js} +1 -1
- package/assets/outbox-DzVji2w9.js +1 -0
- package/assets/{pencil-CIMfGyWW.js → pencil-Dz-yZ9zw.js} +1 -1
- package/assets/{people-WnhpS7pI.js → people-DoJm1MLz.js} +1 -1
- package/assets/{plus-CPYNu12K.js → plus-Cp9K9QJ4.js} +1 -1
- package/assets/{popover-menu-BpInrjNp.js → popover-menu-BCEzStJs.js} +1 -1
- package/assets/{refresh-cw-DNktlgJw.js → refresh-cw-0FbK4O4v.js} +1 -1
- package/assets/{reply-uZv24OMi.js → reply-BUVhW3yq.js} +1 -1
- package/assets/{rich-text-Z2SPIW-n.js → rich-text-HpMiPjFH.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-C9P5xz-f.js → rich-text-spellcheck-worker-provider-BfhfcGZ2.js} +1 -1
- package/assets/{rotate-ccw-BJZUR8Nt.js → rotate-ccw-DCzt84SY.js} +1 -1
- package/assets/{roving-focus-yjJNzNce.js → roving-focus-C87O2raY.js} +1 -1
- package/assets/{row-actions-PBH1Gp1Q.js → row-actions-cUhOCilI.js} +1 -1
- package/assets/{search-mirror-CuvGXRcx.js → search-mirror-B0C9oCpr.js} +1 -1
- package/assets/{search-scope-t7_lhEwH.js → search-scope-aZ2AZX-k.js} +1 -1
- package/assets/{search-token-index-CocSlVpd.js → search-token-index--Pzg9wI2.js} +1 -1
- package/assets/{sections-BlI9KK6M.js → sections-BtFAPYYy.js} +1 -1
- package/assets/{segmented-control-a7ri58vM.js → segmented-control-tpWp-yev.js} +1 -1
- package/assets/{select-BzudQ-hj.js → select-Dv65Mqkl.js} +1 -1
- package/assets/{senders-CjrCpj3s.js → senders-BjvP6Oq9.js} +1 -1
- package/assets/settings-fP9o8EL9.js +1 -0
- package/assets/{settings-screen-DRlPhwXt.js → settings-screen-DPboZsK5.js} +1 -1
- package/assets/{shield-check-CLfzxgNh.js → shield-check-BbF5QmrH.js} +1 -1
- package/assets/{suggest-list-D2yVcukg.js → suggest-list-xX77W_hF.js} +1 -1
- package/assets/{suggested-vips-D5AG6FUm.js → suggested-vips-DRijwoFY.js} +1 -1
- package/assets/{suggestion._suggestionId-CDQ4j2h8.js → suggestion._suggestionId-Ca3k8ej7.js} +1 -1
- package/assets/{switch-BTBLx1IK.js → switch-CGmUk-Wh.js} +1 -1
- package/assets/{task._calendarTaskId-DQA8KsVJ.js → task._calendarTaskId-CvuxUcFe.js} +1 -1
- package/assets/{undo-2-B5wu3SLV.js → undo-2-CGWL2haZ.js} +1 -1
- package/assets/{useCalendarData-qfV6gCnL.js → useCalendarData-D07VZ1QE.js} +1 -1
- package/assets/{useCalendarScheduling-7KLsotZJ.js → useCalendarScheduling-CnlDrC-W.js} +1 -1
- package/assets/{useCalendarSuggestions-BQrUJL_8.js → useCalendarSuggestions-DW7WFMvd.js} +1 -1
- package/assets/{useCalendarTasks-97JGdBNu.js → useCalendarTasks-CV-ORktM.js} +1 -1
- package/assets/{useDebouncedValue-BMLVeivZ.js → useDebouncedValue-DRrHzwce.js} +1 -1
- package/assets/{useFilters-Gs-HP3Pc.js → useFilters-DdYKMP_s.js} +1 -1
- package/assets/{useLabels-s52ZXGjz.js → useLabels-ouqsQR1c.js} +1 -1
- package/assets/{useLayoutTier-Byf0e8X8.js → useLayoutTier-CeBSbbkD.js} +1 -1
- package/assets/{useMediaQuery-Bd0VbOGT.js → useMediaQuery-BzGo-bVp.js} +1 -1
- package/assets/{useMessageBodyContent-DECgYR7u.js → useMessageBodyContent-D9UpR1Dh.js} +1 -1
- package/assets/{useQueries-wqN_e7rn.js → useQueries-Des6lpmI.js} +1 -1
- package/assets/{useRefreshControl-B-sdQjVt.js → useRefreshControl-CWSpNwGo.js} +1 -1
- package/assets/{useResultFolderIndex-ETlz8Y4G.js → useResultFolderIndex-DRfqL3r_.js} +1 -1
- package/assets/{useSignature-C5PObLcq.js → useSignature-CQsNwcJm.js} +1 -1
- package/assets/{warnings-CxANki4C.js → warnings-CDdQ-K5m.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/MessageToolbar-CvppODup.js +0 -1
- package/assets/OutboxPane-DIpS2Rm4.js +0 -1
- package/assets/_calendarObjectId-CVhLhFXf.js +0 -1
- package/assets/_mailboxId-DlqMqGqM.js +0 -1
- package/assets/_messageId-DN1DLs0X.js +0 -1
- package/assets/_messageId-DVrkUlX2.js +0 -1
- package/assets/_messageId-KN8V6cN7.js +0 -1
- package/assets/_outboxMessageId-BIrIq3Vo.js +0 -1
- package/assets/_recurrenceId-0huvJmsM.js +0 -1
- package/assets/_threadId-BSH0itQ1.js +0 -1
- package/assets/_threadId-Bp-Ew-3E.js +0 -1
- package/assets/_threadId-CdQh_MJ8.js +0 -1
- package/assets/brief-BAVboLUI.js +0 -1
- package/assets/chevron-down-DGwUrOcf.js +0 -1
- package/assets/chevron-left-BW50jo-d.js +0 -1
- package/assets/compose._-_outboxMessageId_-B33uCNdX.js +0 -1
- package/assets/compose._-_outboxMessageId_-CHBzY_fa.js +0 -1
- package/assets/compose._-_outboxMessageId_-D7hd8Tdl.js +0 -1
- package/assets/compose._-_outboxMessageId_-DiYwMDkQ.js +0 -1
- package/assets/edit-BZa7tCBO.js +0 -1
- package/assets/edit-DNs-CH-e.js +0 -1
- package/assets/flagged-DF7M44oi.js +0 -1
- package/assets/index-6pj7tvZO.js +0 -1
- package/assets/index-BWIWbASS.js +0 -1
- package/assets/index-BhHZ2hYz.js +0 -1
- package/assets/index-CJFN6_qF.js +0 -1
- package/assets/index-CKwz4x5U.js +0 -1
- package/assets/index-CLJXg4M_.js +0 -1
- package/assets/index-DN1DLs0X.js +0 -1
- package/assets/index-DVrkUlX2.js +0 -1
- package/assets/index-KN8V6cN7.js +0 -1
- package/assets/index-icM3qGGf.js +0 -1
- package/assets/new-CKTDsGv_.js +0 -1
- package/assets/onboarding-DGPNq5IJ.js +0 -1
- package/assets/outbox-M7c0xAzB.js +0 -1
- package/assets/settings-4eabvjnS.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/calendar-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/calendar-DCTglXEB.js","assets/DesktopChrome-H9yEQYFf.js","assets/useLayoutTier-CeBSbbkD.js","assets/useMediaQuery-BzGo-bVp.js","assets/nav-link-8l24_oWF.js","assets/reply-BUVhW3yq.js","assets/sections-BtFAPYYy.js","assets/avatar-COXPYlBH.js","assets/popover-menu-BCEzStJs.js","assets/roving-focus-C87O2raY.js","assets/mail-CXavFmSm.js","assets/app-chrome-BI9iJnw3.js","assets/calendar-Cmzt0eKc.js","assets/ErrorState-BB0xpcCi.js","assets/import-C-0_jeuq.js","assets/credential-steps-MLDe683C.js","assets/select-Dv65Mqkl.js","assets/chevron-down-Q4i_URUt.js","assets/badge-DLlDkvBl.js","assets/card-XAEgDd1b.js","assets/config-import-DZkZ73sW.js","assets/file-json-B3Qb4sPC.js","assets/onboarding-completion-Z1EOTA33.js","assets/mail-Bh469T8t.js","assets/useMessageBodyContent-D9UpR1Dh.js","assets/pencil-Dz-yZ9zw.js","assets/MailShell-DY2Ot0ah.js","assets/FullCompose-sAZlqUaR.js","assets/index-DqlUjB9k.js","assets/useSignature-CQsNwcJm.js","assets/account-form-helpers-DhckT_PN.js","assets/useDebouncedValue-DRrHzwce.js","assets/suggest-list-xX77W_hF.js","assets/confirm-dialog-D33DXPkQ.js","assets/search-scope-aZ2AZX-k.js","assets/useRefreshControl-CWSpNwGo.js","assets/circle-check-big-CDjntmXC.js","assets/refresh-cw-0FbK4O4v.js","assets/useQueries-Des6lpmI.js","assets/search-token-index--Pzg9wI2.js","assets/menu-Dro5vzLW.js","assets/useResultFolderIndex-DRfqL3r_.js","assets/folder-failure-CqkVSsrb.js","assets/outbox-status-BlKn6P0x.js","assets/account-service-status-HIGoykok.js","assets/kbd-D_0s6Sx_.js","assets/onboarding-D-4ZdWHj.js","assets/OnboardingWizard-ezuAE6sx.js","assets/checkbox-CzFLh5Dk.js","assets/_mailboxId-CBxHNU1m.js","assets/MailboxPane-DszlAx2f.js","assets/MailViewChrome-U9YpZx_B.js","assets/MessageToolbar-mGmOl_Xf.js","assets/MessageBody-zT-at0bi.js","assets/undo-2-CGWL2haZ.js","assets/DropdownMenu-CGhv-K3k.js","assets/download-BSz8KKlH.js","assets/EmptyState-B_Kthrla.js","assets/calendar-suggestion-CpOWds4W.js","assets/useCalendarSuggestions-DW7WFMvd.js","assets/agenda-time-hKUG2dhl.js","assets/plus-Cp9K9QJ4.js","assets/calendar-format-BwCpz-JZ.js","assets/calendar-failure-note-BRyIsChq.js","assets/clock-jwuPTxhb.js","assets/segmented-control-tpWp-yev.js","assets/shield-check-BbF5QmrH.js","assets/useFilters-DdYKMP_s.js","assets/folder-input-C8-nffA0.js","assets/label-chip-zJi2r8mQ.js","assets/LabelApplyTrigger-ChzWyjHs.js","assets/useLabels-ouqsQR1c.js","assets/NavMenuButton-B_c3nIpV.js","assets/bottom-sheet-BUOc_BG6.js","assets/circle-help-B6Fn573l.js","assets/circle-check-BucqMsie.js","assets/search-mirror-B0C9oCpr.js","assets/brief-iq8Ra5O_.js","assets/brief-CJySko3D.js","assets/BriefPane-uF6csCem.js","assets/wizard-selection-zWa1qc6-.js","assets/flagged-C-DEfMAa.js","assets/flagged-D0pl5Vka.js","assets/FlaggedPane-CyyX0x8y.js","assets/outbox-DzVji2w9.js","assets/OutboxPane-D47KP_dW.js","assets/row-actions-cUhOCilI.js","assets/rotate-ccw-DCzt84SY.js","assets/_slotId-BbhN8swS.js","assets/settings-screen-DPboZsK5.js","assets/chevron-left-gBxhdHb5.js","assets/accounts-DwJx265B.js","assets/switch-CGmUk-Wh.js","assets/help-copy-DodnPf1K.js","assets/advanced-4BQF-R7r.js","assets/external-link-o4VBX-Sp.js","assets/appearance-BHnbKYJT.js","assets/calendars-CbchUImt.js","assets/useCalendarScheduling-CnlDrC-W.js","assets/calendar-guests-7MqnVXzX.js","assets/calendar-event-popup-BvI6Qwla.js","assets/copy-Be7MLulJ.js","assets/classification-DzmiHklC.js","assets/ReportLink-C4yyzfnn.js","assets/filters-Mgogmt5O.js","assets/folders-DodnBZua.js","assets/labels-BLy-VSyB.js","assets/people-DoJm1MLz.js","assets/senders-BjvP6Oq9.js","assets/warnings-CDdQ-K5m.js","assets/_view._date-DyseRkCh.js","assets/useCalendarTasks-CV-ORktM.js","assets/useCalendarData-D07VZ1QE.js","assets/CalendarLoadFailed-CU4C4nFf.js","assets/CalendarQuickCreate-CaO2GHZr.js","assets/draft--MHSP3BT.js","assets/CalendarSession-Ub9ZzsQN.js","assets/_view-CtgngRpB.css","assets/index-DcMLhAhx.js","assets/index-DxDWr9QM.js","assets/index-Dvms4bLC.js","assets/index-Tl1Nlwxt.js","assets/new-D7laO9Pg.js","assets/CalendarEventEditor-B0SWzPqQ.js","assets/calendar-event-sidebar-Dx3WbbPv.js","assets/index-DHvQcDnk.js","assets/_messageId-DHvQcDnk.js","assets/compose._-_outboxMessageId_-B7D1W3Sx.js","assets/index-Dk8Pv3WS.js","assets/_messageId-Dk8Pv3WS.js","assets/compose._-_outboxMessageId_-D0T64VP0.js","assets/index-q5-pR6qn.js","assets/_messageId-q5-pR6qn.js","assets/compose._-_outboxMessageId_-pcn-0-gQ.js","assets/compose._-_outboxMessageId_-CO4UJXl9.js","assets/_outboxMessageId-Akv-3HPP.js","assets/index-JdYKPBmV.js","assets/CalendarEventPopup-V9BZRnwN.js","assets/edit-DCtOcxf9.js","assets/suggestion._suggestionId-Ca3k8ej7.js","assets/task._calendarTaskId-CvuxUcFe.js","assets/index-DfAafcCq.js","assets/edit-DbSsj2wh.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function e8(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var Up=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _1={exports:{}},yd={};var TP;function NW(){if(TP)return yd;TP=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return yd.Fragment=t,yd.jsx=n,yd.jsxs=n,yd}var OP;function kW(){return OP||(OP=1,_1.exports=NW()),_1.exports}var O=kW();const DW="Logging",LW="x-amz-user-agent",UW="NoHubcallbackProvidedException";var Ar;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(Ar||(Ar={}));const MP={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class Ln{constructor(t,n=Ar.WARN){this.name=t,this.level=n,this._pluggables=[]}_padding(t){return t<10?"0"+t:""+t}_ts(){const t=new Date;return[this._padding(t.getMinutes()),this._padding(t.getSeconds())].join(":")+"."+t.getMilliseconds()}configure(t){return t?(this._config=t,this._config):this._config}_log(t,...n){let r=this.level;Ln.LOG_LEVEL&&(r=Ln.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(r=window.LOG_LEVEL);const o=MP[r];if(!(MP[t]>=o))return;let a=console.log.bind(console);t===Ar.ERROR&&console.error&&(a=console.error.bind(console)),t===Ar.WARN&&console.warn&&(a=console.warn.bind(console)),Ln.BIND_ALL_LOG_LEVELS&&(t===Ar.INFO&&console.info&&(a=console.info.bind(console)),t===Ar.DEBUG&&console.debug&&(a=console.debug.bind(console)));const u=`[${t}] ${this._ts()} ${this.name}`;let c="";if(n.length===1&&typeof n[0]=="string")c=`${u} - ${n[0]}`,a(c);else if(n.length===1)c=`${u} ${n[0]}`,a(u,n[0]);else if(typeof n[0]=="string"){let f=n.slice(1);f.length===1&&(f=f[0]),c=`${u} - ${n[0]} ${f}`,a(`${u} - ${n[0]}`,f)}else c=`${u} ${n}`,a(u,n);for(const f of this._pluggables){const h={message:c,timestamp:Date.now()};f.pushLogs([h])}}log(...t){this._log(Ar.INFO,...t)}info(...t){this._log(Ar.INFO,...t)}warn(...t){this._log(Ar.WARN,...t)}error(...t){this._log(Ar.ERROR,...t)}debug(...t){this._log(Ar.DEBUG,...t)}verbose(...t){this._log(Ar.VERBOSE,...t)}addPluggable(t){t&&t.getCategoryName()===DW&&(this._pluggables.push(t),t.configure(this._config))}listPluggables(){return this._pluggables}}Ln.LOG_LEVEL=null;Ln.BIND_ALL_LOG_LEVELS=!1;class cr extends Error{constructor({message:t,name:n,recoverySuggestion:r,underlyingError:o,metadata:s}){if(super(t),this.name=n,this.underlyingError=o,this.recoverySuggestion=r,s){const{extendedRequestId:a,httpStatusCode:u,requestId:c}=s;this.metadata={extendedRequestId:a,httpStatusCode:u,requestId:c}}this.constructor=cr,Object.setPrototypeOf(this,cr.prototype)}}var $i;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})($i||($i={}));const Pv=(e,t=cr)=>(n,r,o)=>{const{message:s,recoverySuggestion:a}=e[r];if(!n)throw new t({name:r,message:o?`${s} ${o}`:s,recoverySuggestion:a})},$o=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",bd=new Ln("Hub");class t8{constructor(t){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=t}_remove(t,n){const r=this.listeners.get(t);if(!r){bd.warn(`No listeners for ${t}`);return}this.listeners.set(t,[...r.filter(({callback:o})=>o!==n)])}dispatch(t,n,r,o){typeof t=="string"&&this.protectedChannels.indexOf(t)>-1&&(o===$o||bd.warn(`WARNING: ${t} is protected and dispatching on it can have unintended consequences`));const s={channel:t,payload:{...n},source:r,patternInfo:[]};try{this._toListeners(s)}catch(a){bd.error(a)}}listen(t,n,r="noname"){let o;if(typeof n!="function")throw new cr({name:UW,message:"No callback supplied to Hub"});o=n;let s=this.listeners.get(t);return s||(s=[],this.listeners.set(t,s)),s.push({name:r,callback:o}),()=>{this._remove(t,o)}}_toListeners(t){const{channel:n,payload:r}=t,o=this.listeners.get(n);o&&o.forEach(s=>{bd.debug(`Dispatching to ${n} with `,r);try{s.callback(t)}catch(a){bd.error(a)}})}}const zo=new t8("__default__"),Em=new t8("internal-hub"),OA=()=>{if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto;if(typeof crypto=="object")return crypto;throw new cr({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},FW=()=>{if(typeof window<"u"&&typeof window.btoa=="function")return window.btoa;if(typeof btoa=="function")return btoa;throw new cr({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},$W=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new cr({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},MA={convert(e,t){let n=e;return t?.urlSafe&&(n=n.replace(/-/g,"+").replace(/_/g,"/")),$W()(n)}};var Lo;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(Lo||(Lo={}));const zW={[Lo.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Lo.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Lo.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Lo.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Lo.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},PA=Pv(zW);function We(e){let t=!0;e?t=!!e.userPoolId&&!!e.userPoolClientId:t=!1,PA(t,Lo.AuthUserPoolException)}function Nv(e){const t=!!e?.loginWith?.oauth?.domain&&!!e?.loginWith?.oauth?.redirectSignOut&&!!e?.loginWith?.oauth?.redirectSignIn&&!!e?.loginWith?.oauth?.responseType;PA(t,Lo.OAuthNotConfigureException)}function Kg(e){const t=!!e?.identityPoolId;PA(t,Lo.InvalidIdentityPoolIdException)}function Ms(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid token");try{const r=t[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(MA.convert(r).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),s=JSON.parse(o);return{toString:()=>e,payload:s}}catch{throw new Error("Invalid token payload")}}const n8=e=>{const t=Reflect.ownKeys(e);for(const n of t){const r=e[n];(r&&typeof r=="object"||typeof r=="function")&&n8(r)}return Object.freeze(e)},jW=new Ln("parseAWSExports"),BW={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},HW=(e={})=>{if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new cr({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:t,aws_appsync_authenticationType:n,aws_appsync_graphqlEndpoint:r,aws_appsync_region:o,aws_bots_config:s,aws_cognito_identity_pool_id:a,aws_cognito_sign_up_verification_method:u,aws_cognito_mfa_configuration:c,aws_cognito_mfa_types:f,aws_cognito_password_protection_settings:h,aws_cognito_verification_mechanisms:g,aws_cognito_signup_attributes:m,aws_cognito_social_providers:v,aws_cognito_username_attributes:w,aws_mandatory_sign_in:S,aws_mobile_analytics_app_id:C,aws_mobile_analytics_app_region:E,aws_user_files_s3_bucket:A,aws_user_files_s3_bucket_region:I,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:T,aws_user_pools_id:N,aws_user_pools_web_client_id:M,geo:R,oauth:k,predictions:L,aws_cloud_logic_custom:q,Notifications:F,modelIntrospection:D}=e,j={};C&&(j.Analytics={Pinpoint:{appId:C,region:E}});const{InAppMessaging:Z,Push:he}=F??{};if(Z?.AWSPinpoint||he?.AWSPinpoint){if(Z?.AWSPinpoint){const{appId:oe,region:fe}=Z.AWSPinpoint;j.Notifications={InAppMessaging:{Pinpoint:{appId:oe,region:fe}}}}if(he?.AWSPinpoint){const{appId:oe,region:fe}=he.AWSPinpoint;j.Notifications={...j.Notifications,PushNotification:{Pinpoint:{appId:oe,region:fe}}}}}if(Array.isArray(s)&&(j.Interactions={LexV1:Object.fromEntries(s.map(oe=>[oe.name,oe]))}),r){const oe=BW[n];oe||jW.debug(`Invalid authentication type ${n}. Falling back to IAM.`),j.API={GraphQL:{endpoint:r,apiKey:t,region:o,defaultAuthMode:oe??"iam"}},D&&(j.API.GraphQL.modelIntrospection=D)}const B=c?{status:c&&c.toLowerCase(),totpEnabled:f?.includes("TOTP")??!1,smsEnabled:f?.includes("SMS")??!1}:void 0,Q=h?{minLength:h.passwordPolicyMinLength,requireLowercase:h.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:h.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:h.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:h.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,ue=Array.from(new Set([...g??[],...m??[]])).reduce((oe,fe)=>({...oe,[fe.toLowerCase()]:{required:!0}}),{}),we=w?.includes("EMAIL")??!1,U=w?.includes("PHONE_NUMBER")??!1;(a||N)&&(j.Auth={Cognito:{identityPoolId:a,allowGuestAccess:S!=="enable",signUpVerificationMethod:u,userAttributes:ue,userPoolClientId:M,userPoolId:N,mfa:B,passwordFormat:Q,loginWith:{username:!(we||U),email:we,phone:U}}});const X=k?Object.keys(k).length>0:!1,ie=v?v.length>0:!1;if(j.Auth&&X&&(j.Auth.Cognito.loginWith={...j.Auth.Cognito.loginWith,oauth:{...qW(k),...ie&&{providers:VW(v)}}}),A&&(j.Storage={S3:{bucket:A,region:I,dangerouslyConnectToHttpEndpointForTesting:T}}),R){const{amazon_location_service:oe}=R;j.Geo={LocationService:{maps:oe.maps,geofenceCollections:oe.geofenceCollections,searchIndices:oe.search_indices,region:oe.region}}}if(q&&(j.API={...j.API,REST:q.reduce((oe,fe)=>{const{name:Me,endpoint:xe,region:se,service:Se}=fe;return{...oe,[Me]:{endpoint:xe,...Se?{service:Se}:void 0,...se?{region:se}:void 0}}},{})}),L){const{VoiceId:oe}=L?.convert?.speechGenerator?.defaults??{};j.Predictions=oe?{...L,convert:{...L.convert,speechGenerator:{...L.convert.speechGenerator,defaults:{voiceId:oe}}}}:L}return j},PP=e=>e?.split(",")??[],qW=({domain:e,scope:t,redirectSignIn:n,redirectSignOut:r,responseType:o})=>({domain:e,scopes:t,redirectSignIn:PP(n),redirectSignOut:PP(r),responseType:o}),VW=e=>e.map(t=>{const n=t.toLowerCase();return n.charAt(0).toUpperCase()+n.slice(1)}),r8=Symbol("oauth-listener"),kn=[];for(let e=0;e<256;++e)kn.push((e+256).toString(16).slice(1));function WW(e,t=0){return(kn[e[t+0]]+kn[e[t+1]]+kn[e[t+2]]+kn[e[t+3]]+"-"+kn[e[t+4]]+kn[e[t+5]]+"-"+kn[e[t+6]]+kn[e[t+7]]+"-"+kn[e[t+8]]+kn[e[t+9]]+"-"+kn[e[t+10]]+kn[e[t+11]]+kn[e[t+12]]+kn[e[t+13]]+kn[e[t+14]]+kn[e[t+15]]).toLowerCase()}let x1;const GW=new Uint8Array(16);function KW(){if(!x1){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");x1=crypto.getRandomValues.bind(crypto)}return x1(GW)}const ZW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),NP={randomUUID:ZW};function YW(e,t,n){e=e||{};const r=e.random??e.rng?.()??KW();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[n+o]=r[o];return t}return WW(r)}function Ou(e,t,n){return NP.randomUUID&&!t&&!e?NP.randomUUID():YW(e,t,n)}function QW(e){const{version:t}=e;return t?t.startsWith("1"):!1}function XW(e){if(!e)return;const{bucket_name:t,aws_region:n,buckets:r}=e;return{S3:{bucket:t,region:n,buckets:r&&uG(r)}}}function JW(e){if(!e)return;const{user_pool_id:t,user_pool_client_id:n,identity_pool_id:r,password_policy:o,mfa_configuration:s,mfa_methods:a,unauthenticated_identities_enabled:u,oauth:c,username_attributes:f,standard_required_attributes:h,groups:g,passwordless:m}=e,v={Cognito:{userPoolId:t,userPoolClientId:n,groups:g}};return r&&(v.Cognito={...v.Cognito,identityPoolId:r}),o&&(v.Cognito.passwordFormat={requireLowercase:o.require_lowercase,requireNumbers:o.require_numbers,requireUppercase:o.require_uppercase,requireSpecialCharacters:o.require_symbols,minLength:o.min_length??6}),s&&(v.Cognito.mfa={status:lG(s),smsEnabled:a?.includes("SMS"),totpEnabled:a?.includes("TOTP")}),u&&(v.Cognito.allowGuestAccess=u),c&&(v.Cognito.loginWith={oauth:{domain:c.domain,redirectSignIn:c.redirect_sign_in_uri,redirectSignOut:c.redirect_sign_out_uri,responseType:c.response_type==="token"?"token":"code",scopes:c.scopes,providers:aG(c.identity_providers)}}),f&&(v.Cognito.loginWith={...v.Cognito.loginWith,email:f.includes("email"),phone:f.includes("phone_number"),username:f.includes("username")}),h&&(v.Cognito.userAttributes=h.reduce((w,S)=>({...w,[S]:{required:!0}}),{})),m&&(v.Cognito.passwordless={emailOtpEnabled:m.email_otp_enabled,smsOtpEnabled:m.sms_otp_enabled,webAuthn:m.web_authn?{relyingPartyId:m.web_authn.relying_party_id,userVerification:m.web_authn.user_verification}:void 0,preferredChallenge:m.preferred_challenge}),v}function eG(e){if(!e?.amazon_pinpoint)return;const{amazon_pinpoint:t}=e;return{Pinpoint:{appId:t.app_id,region:t.aws_region}}}function tG(e){if(!e)return;const{aws_region:t,geofence_collections:n,maps:r,search_indices:o}=e;return{LocationService:{region:t,searchIndices:o,geofenceCollections:n,maps:r}}}function nG(e){if(!e)return;const{aws_region:t,default_authorization_type:n,url:r,api_key:o,model_introspection:s}=e;return{GraphQL:{endpoint:r,defaultAuthMode:o8(n),region:t,apiKey:o,modelIntrospection:s}}}function rG(e){if(!e?.events)return;const{url:t,aws_region:n,api_key:r,default_authorization_type:o}=e.events;return{Events:{endpoint:t,defaultAuthMode:o8(o),region:n,apiKey:r}}}function oG(e){if(!e)return;const{aws_region:t,channels:n,amazon_pinpoint_app_id:r}=e,o=n.includes("IN_APP_MESSAGING"),s=n.includes("APNS")||n.includes("FCM");if(!(o||s))return;const a={};return o&&(a.InAppMessaging={Pinpoint:{appId:r,region:t}}),s&&(a.PushNotification={Pinpoint:{appId:r,region:t}}),a}function sG(e){const t={};if(e.storage&&(t.Storage=XW(e.storage)),e.auth&&(t.Auth=JW(e.auth)),e.analytics&&(t.Analytics=eG(e.analytics)),e.geo&&(t.Geo=tG(e.geo)),e.data&&(t.API=nG(e.data)),e.custom){const n=rG(e.custom);n&&"Events"in n&&(t.API={...t.API,...n})}return e.notifications&&(t.Notifications=oG(e.notifications)),t}const iG={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function o8(e){return iG[e]}const kP={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function aG(e=[]){return e.reduce((t,n)=>(kP[n]!==void 0&&t.push(kP[n]),t),[])}function lG(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function uG(e){const t={};return e.forEach(({name:n,bucket_name:r,aws_region:o,paths:s})=>{if(n in t)throw new Error(`Duplicate friendly name found: ${n}. Name must be unique.`);const a=s?Object.entries(s).reduce((u,[c,f])=>(f!==void 0&&(u[c]=f),u),{}):void 0;t[n]={bucketName:r,region:o,paths:a}}),t}const s8=e=>Object.keys(e).some(t=>t.startsWith("aws_"))?HW(e):QW(e)?sG(e):e;var DP=function(){return DP=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},DP.apply(this,arguments)};function fUe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function cG(e,t,n,r){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(h){try{f(r.next(h))}catch(g){a(g)}}function c(h){try{f(r.throw(h))}catch(g){a(g)}}function f(h){h.done?s(h.value):o(h.value).then(u,c)}f((r=r.apply(e,t||[])).next())})}function dG(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(h){return c([f,h])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,o&&(s=f[0]&2?o.return:f[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,f[1])).done)return s;switch(o=0,s&&(f=[f[0]&2,s.value]),f[0]){case 0:case 1:s=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,o=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){n.label=f[1];break}if(f[0]===6&&n.label<s[1]){n.label=s[1],s=f;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(f);break}s[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(h){f=[6,h],o=0}finally{r=s=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function hUe(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Wr=64,fG=32,hG=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),pG=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],gG=Math.pow(2,53)-1,Zg=(function(){function e(){this.state=Int32Array.from(pG),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,r=t.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>gG)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=t[n++],r--,this.bufferLength===Wr&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%Wr>=Wr-8){for(var o=this.bufferLength;o<Wr;o++)n.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(var o=this.bufferLength;o<Wr-8;o++)n.setUint8(o,0);n.setUint32(Wr-8,Math.floor(t/4294967296),!0),n.setUint32(Wr-4,t),this.hashBuffer(),this.finished=!0}for(var s=new Uint8Array(fG),o=0;o<8;o++)s[o*4]=this.state[o]>>>24&255,s[o*4+1]=this.state[o]>>>16&255,s[o*4+2]=this.state[o]>>>8&255,s[o*4+3]=this.state[o]>>>0&255;return s},e.prototype.hashBuffer=function(){for(var t=this,n=t.buffer,r=t.state,o=r[0],s=r[1],a=r[2],u=r[3],c=r[4],f=r[5],h=r[6],g=r[7],m=0;m<Wr;m++){if(m<16)this.temp[m]=(n[m*4]&255)<<24|(n[m*4+1]&255)<<16|(n[m*4+2]&255)<<8|n[m*4+3]&255;else{var v=this.temp[m-2],w=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10;v=this.temp[m-15];var S=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;this.temp[m]=(w+this.temp[m-7]|0)+(S+this.temp[m-16]|0)}var C=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&f^~c&h)|0)+(g+(hG[m]+this.temp[m]|0)|0)|0,E=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&s^o&a^s&a)|0;g=h,h=f,f=c,c=u+C|0,u=a,a=s,s=o,o=C+E|0}r[0]+=o,r[1]+=s,r[2]+=a,r[3]+=u,r[4]+=c,r[5]+=f,r[6]+=h,r[7]+=g},e})();const mG=e=>new TextEncoder().encode(e);var vG=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:mG;function i8(e){return e instanceof Uint8Array?e:typeof e=="string"?vG(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function yG(e){return typeof e=="string"?e.length===0:e.byteLength===0}var Ha=(function(){function e(t){this.secret=t,this.hash=new Zg,this.reset()}return e.prototype.update=function(t){if(!(yG(t)||this.error))try{this.hash.update(i8(t))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return cG(this,void 0,void 0,function(){return dG(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new Zg,this.secret){this.outer=new Zg;var t=bG(this.secret),n=new Uint8Array(Wr);n.set(t);for(var r=0;r<Wr;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(var r=0;r<t.byteLength;r++)t[r]=0}},e})();function bG(e){var t=i8(e);if(t.byteLength>Wr){var n=new Zg;n.update(t),t=n.digest()}var r=new Uint8Array(Wr);return r.set(t),r}for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`)}var un;(function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"})(un||(un={}));var Jr;(function(e){e.AI="ai",e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"})(Jr||(Jr={}));var ws;(function(e){e.CreateConversation="1",e.GetConversation="2",e.ListConversations="3",e.DeleteConversation="4",e.SendMessage="5",e.ListMessages="6",e.OnMessage="7",e.Generation="8",e.UpdateConversation="9"})(ws||(ws={}));var LP;(function(e){e.Record="1",e.IdentifyUser="2"})(LP||(LP={}));var UP;(function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"})(UP||(UP={}));var Fe;(function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36",e.StartWebAuthnRegistration="37",e.CompleteWebAuthnRegistration="38",e.ListWebAuthnCredentials="39",e.DeleteWebAuthnCredential="40"})(Fe||(Fe={}));var FP;(function(e){e.Subscribe="1",e.GraphQl="2"})(FP||(FP={}));var tf;(function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"})(tf||(tf={}));var v_;(function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"})(v_||(v_={}));var $P;(function(e){e.None="0"})($P||($P={}));var zP;(function(e){e.Convert="1",e.Identify="2",e.Interpret="3"})(zP||(zP={}));var jP;(function(e){e.Subscribe="1"})(jP||(jP={}));var BP;(function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"})(BP||(BP={}));var fo;(function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7",e.GetDataAccess="8",e.ListCallerAccessGrants="9"})(fo||(fo={}));const SG="6.18.0",kv=()=>typeof global<"u",ic=()=>typeof window<"u",a8=()=>typeof document<"u",NA=()=>typeof process<"u",vf=(e,t)=>!!Object.keys(e).find(n=>n.startsWith(t));var HP={};function wG(){const e=r=>r.startsWith("_react")||r.startsWith("__react"),t=r=>Object.keys(r).find(e),n=()=>Array.from(document.querySelectorAll("[id]"));return a8()&&n().some(t)}function CG(){return NA()&&typeof HP<"u"&&!!Object.keys(HP).find(e=>e.includes("react"))}function EG(){return ic()&&vf(window,"__VUE")}function _G(){return kv()&&vf(global,"__VUE")}var qP={};function xG(){return ic()&&vf(window,"__SVELTE")}function AG(){return NA()&&typeof qP<"u"&&!!Object.keys(qP).find(e=>e.includes("svelte"))}function IG(){return ic()&&window.next&&typeof window.next=="object"}function RG(){return kv()&&(vf(global,"__next")||vf(global,"__NEXT"))}function TG(){return ic()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function OG(){return kv()&&typeof global.__NUXT_PATHS__<"u"}var VP={};function MG(){const e=!!(a8()&&document.querySelector("[ng-version]")),t=!!(ic()&&typeof window.ng<"u");return e||t}function PG(){return NA()&&typeof VP=="object"&&VP.npm_lifecycle_script?.startsWith("ng ")||!1}function NG(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function kG(){return kv()&&typeof global.expo<"u"}function DG(){return ic()}const LG=[{platform:un.Expo,detectionMethod:kG},{platform:un.ReactNative,detectionMethod:NG},{platform:un.NextJs,detectionMethod:IG},{platform:un.Nuxt,detectionMethod:TG},{platform:un.Angular,detectionMethod:MG},{platform:un.React,detectionMethod:wG},{platform:un.VueJs,detectionMethod:EG},{platform:un.Svelte,detectionMethod:xG},{platform:un.WebUnknown,detectionMethod:DG},{platform:un.NextJsSSR,detectionMethod:RG},{platform:un.NuxtSSR,detectionMethod:OG},{platform:un.ReactSSR,detectionMethod:CG},{platform:un.VueJsSSR,detectionMethod:_G},{platform:un.AngularSSR,detectionMethod:PG},{platform:un.SvelteSSR,detectionMethod:AG}];function UG(){return LG.find(e=>e.detectionMethod())?.platform||un.ServerSideUnknown}let nf;const A1=[];let y_=!1;const FG=10,$G=10,zG=1e3,l8=()=>{if(!nf){if(nf=UG(),y_)for(;A1.length;)A1.pop()?.();else A1.forEach(e=>{e()});WP(un.ServerSideUnknown,FG),WP(un.WebUnknown,$G)}return nf};function jG(){nf=void 0}function WP(e,t){nf===e&&!y_&&setTimeout(()=>{jG(),y_=!0,setTimeout(l8,zG)},t)}const Ci={},gs=e=>{Ci[e.category]=e.apis.reduce((r,o)=>({...r,[o]:{refCount:r[o]?.refCount?r[o].refCount+1:1,additionalDetails:e.additionalDetails}}),Ci[e.category]??{});let t=!1;return()=>{t||(t=!0,e.apis.forEach(r=>{const o=Ci[e.category][r].refCount;o>1?Ci[e.category][r].refCount=o-1:(delete Ci[e.category][r],Object.keys(Ci[e.category]).length||delete Ci[e.category])}))}},BG=(e,t)=>Ci[e]?.[t]?.additionalDetails,HG="aws-amplify",qG=e=>e.replace(/\+.*/,""),VG=({category:e,action:t}={})=>{const n=[[HG,qG(SG)]];if(e&&n.push([e,t]),n.push(["framework",l8()]),e&&t){const r=BG(e,t);r&&r.forEach(o=>{n.push(o)})}return n},Dv=e=>VG(e).map(([r,o])=>r&&o?`${r}/${o}`:r).join(" "),Lv=()=>typeof window<"u"&&typeof window.document<"u",GP=new Ln("Auth");class WG{configure(t,n){this.authConfig=t,this.authOptions=n,t&&t.Cognito?.userPoolEndpoint&&GP.warn(KP("Amazon Cognito User Pool")),t&&t.Cognito?.identityPoolEndpoint&&GP.warn(KP("Amazon Cognito Identity Pool"))}async fetchAuthSession(t={}){let n,r;const o=await this.getTokens(t);return o?(r=o.accessToken?.payload?.sub,n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:o,authenticated:!0,forceRefresh:t.forceRefresh})):n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:t.forceRefresh}),{tokens:o,credentials:n?.credentials,identityId:n?.identityId,userSub:r}}async clearCredentials(){await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()}async getTokens(t){return await this.authOptions?.tokenProvider?.getTokens(t)??void 0}}const KP=e=>`You are using a custom Amazon ${e} endpoint, ensure the endpoint is correct.`;class GG{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new WG}configure(t,n){const r=s8(t);this.resourcesConfig=r,n&&(this.libraryOptions=n),this.resourcesConfig=n8(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),(this.resourcesConfig.Analytics?.Pinpoint||this.resourcesConfig.Notifications?.InAppMessaging?.Pinpoint||this.resourcesConfig.Notifications?.PushNotification?.Pinpoint)&&console.warn("AWS will end support for Amazon Pinpoint on October 30, 2026. The guidance is to use AWS End User Messaging for push notifications and SMS, Amazon Simple Email Service for sending emails, Amazon Connect for campaigns, journeys, endpoints, and engagement analytics. Pinpoint recommends Amazon Kinesis for event collection and mobile analytics."),zo.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",$o),this.notifyOAuthListener(),this.isConfigured=!0}getConfig(){return this.isConfigured||console.warn("Amplify has not been configured. Please call Amplify.configure() before using this service."),this.resourcesConfig}[r8](t){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?t(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=t}notifyOAuthListener(){!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth||!this.oAuthListener||(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}}const Tt=new GG,u8=(e,t)=>e.Auth.fetchAuthSession(t),Uv=e=>u8(Tt,e);function c8(){return Tt.Auth.clearCredentials()}const Fv=e=>{const{headers:t,statusCode:n}=e;return{...KG(e)?e.$metadata:{},httpStatusCode:n,requestId:t["x-amzn-requestid"]??t["x-amzn-request-id"]??t["x-amz-request-id"],extendedRequestId:t["x-amz-id-2"],cfId:t["x-amz-cf-id"]}},KG=e=>typeof e?.$metadata=="object",ac=async e=>{if(!e||e.statusCode<300)return;const t=await Qf(e),r=(a=>{const[u]=a.toString().split(/[,:]+/);return u.includes("#")?u.split("#")[1]:u})(e.headers["x-amzn-errortype"]??t.code??t.__type??"UnknownError"),o=t.message??t.Message??"Unknown error",s=new Error(o);return Object.assign(s,{name:r,$metadata:Fv(e)})},Qf=async e=>{if(!e.body)throw new Error("Missing response payload");const t=await e.body.json();return Object.assign(t,{$metadata:Fv(e)})},fn=(e,t,n,r)=>async(o,s)=>{const a={...r,...o},u=await a.endpointResolver(a,s),c=await t(s,u),f=await e(c,{...a});return n(f)},ZG=300*1e3;function YG(e=ZG){return r=>{const o=2**r*100+100*Math.random();return o>e?!1:o}}const d8=3,ZP="amz-sdk-invocation-id",QG="amz-sdk-request",YP=300*1e3,f8=e=>{const n=YG(YP)(e);return n===!1?YP:n},XG=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],JG=e=>!!e&&XG.includes(e),h8=e=>async(t,n)=>{const r=n??await e(t)??void 0,o=r?.code||r?.name,s=t?.statusCode;return{retryable:rK(n)||nK(s,o)||JG(o)||oK(s,o)}},eK=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],tK=["TimeoutError","RequestTimeout","RequestTimeoutException"],nK=(e,t)=>e===429||!!t&&eK.includes(t),rK=e=>[$i.NetworkError,"ERR_NETWORK"].includes(e?.name),oK=(e,t)=>!!e&&[500,502,503,504].includes(e)||!!t&&tK.includes(t),p8="cognito-identity",g8={service:p8,retryDecider:h8(ac),computeDelay:f8,cache:"no-store"},sK=({maxAttempts:e=d8,retryDecider:t,computeDelay:n,abortSignal:r})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(o,s)=>async function(u){let c,f=s.attemptsCount??0,h;const g=()=>{if(h)return QP(h,f),h;throw QP(c,f),c};for(;!r?.aborted&&f<e;){try{h=await o(u),c=void 0}catch(w){c=w,h=void 0}f=(s.attemptsCount??0)>f?s.attemptsCount??0:f+1,s.attemptsCount=f;const{isCredentialsExpiredError:m,retryable:v}=await t(h,c,s);if(v){if(s.isCredentialsExpired=!!m,!r?.aborted&&f<e){const w=n(f);await iK(w,r)}continue}else return g()}if(r?.aborted)throw new Error("Request aborted.");return g()}},iK=(e,t)=>{if(t?.aborted)return Promise.resolve();let n,r;const o=new Promise(s=>{r=s,n=setTimeout(s,e)});return t?.addEventListener("abort",function s(a){clearTimeout(n),t?.removeEventListener("abort",s),r()}),o},QP=(e,t)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:t})},aK=Ou,lK=()=>e=>async function(n){return n.headers[ZP]||(n.headers[ZP]=aK()),e(n)},uK=({maxAttempts:e=d8})=>(t,n)=>async function(o){const s=n.attemptsCount??0;return o.headers[QG]=`attempt=${s+1}; max=${e}`,t(o)},cK=({userAgentHeader:e="x-amz-user-agent",userAgentValue:t=""})=>n=>async function(o){if(t.trim().length===0)return await n(o);{const s=e.toLowerCase();return o.headers[s]=o.headers[s]?`${o.headers[s]} ${t}`:t,await n(o)}},kA=(e,t)=>(n,r)=>{const o={};let s=a=>e(a,r);for(let a=t.length-1;a>=0;a--){const u=t[a];s=u(r)(s,o)}return s(n)},I1=e=>{let t;return()=>(t||(t=e()),t)},dK=e=>!["HEAD","GET"].includes(e.toUpperCase()),fK=async({url:e,method:t,headers:n,body:r},{abortSignal:o,cache:s,withCrossDomainCredentials:a})=>{let u;try{u=await fetch(e,{method:t,headers:n,body:dK(t)?r:void 0,signal:o,cache:s,credentials:a?"include":"same-origin"})}catch(g){throw g instanceof TypeError?new cr({name:$i.NetworkError,message:"A network error has occurred.",underlyingError:g}):g}const c={};u.headers?.forEach((g,m)=>{c[m.toLowerCase()]=g});const f={statusCode:u.status,headers:c,body:null},h=Object.assign(u.body??{},{text:I1(()=>u.text()),blob:I1(()=>u.blob()),json:I1(()=>u.json())});return{...f,body:h}},m8=kA(fK,[cK,lK,sK,uK]),hK=()=>e=>async function(n){return n.headers["cache-control"]="no-store",e(n)},v8=kA(m8,[hK]),y8=e=>(t,n)=>{const r=pK(e),o=JSON.stringify(t);return gK(n,r,o)},pK=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),gK=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"}),XP=e=>fn(v8,y8("GetCredentialsForIdentity"),mK,{...g8,...e,userAgentValue:Dv()}),mK=async e=>{if(e.statusCode>=300)throw await ac(e);const t=await Qf(e);return{IdentityId:t.IdentityId,Credentials:vK(t.Credentials),$metadata:Fv(e)}},vK=({Expiration:e,...t}={})=>({...t,Expiration:e&&new Date(e*1e3)}),yK=e=>fn(v8,y8("GetId"),bK,{...g8,...e,userAgentValue:Dv()}),bK=async e=>{if(e.statusCode>=300)throw await ac(e);return{IdentityId:(await Qf(e)).IdentityId,$metadata:Fv(e)}},b8={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},SK={partitions:[b8,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},S8=e=>{const{partitions:t}=SK;for(const{regions:n,outputs:r,regionRegex:o}of t){const s=new RegExp(o);if(n.includes(e)||s.test(e))return r.dnsSuffix}return b8.outputs.dnsSuffix},Yi=URL,wK=({region:e})=>({url:new Yi(`https://${p8}.${e}.${S8(e)}`)});class Bd extends cr{constructor(){super({name:$i.PlatformNotSupported,message:"Function not supported on current platform"})}}class w8{constructor(t){this.storage=t}async setItem(t,n){if(!this.storage)throw new Bd;this.storage.setItem(t,n)}async getItem(t){if(!this.storage)throw new Bd;return this.storage.getItem(t)}async removeItem(t){if(!this.storage)throw new Bd;this.storage.removeItem(t)}async clear(){if(!this.storage)throw new Bd;this.storage.clear()}}class C8{constructor(){this.storage=new Map}get length(){return this.storage.size}key(t){return t>this.length-1?null:Array.from(this.storage.keys())[t]}setItem(t,n){this.storage.set(t,n)}getItem(t){return this.storage.get(t)??null}removeItem(t){this.storage.delete(t)}clear(){this.storage.clear()}}const E8=new Ln("CoreStorageUtils"),CK=()=>{try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{E8.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new C8},_8=()=>{try{if(typeof window<"u"&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw new Error("sessionStorage is not defined")}catch{return E8.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new C8}};class EK extends w8{constructor(){super(CK())}}class _K extends w8{constructor(){super(_8())}}class xK{constructor(t){this._storage=t}get storage(){if(!this._storage)throw new Bd;return this._storage}setItem(t,n){this.storage.setItem(t,n)}getItem(t){return this.storage.getItem(t)}removeItem(t){this.storage.removeItem(t)}clear(){this.storage.clear()}}class AK extends xK{constructor(){super(_8())}}function Fp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!=="__proto__"&&(e[r]=n[r])}return e}var IK={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function b_(e,t){function n(o,s,a){if(!(typeof document>"u")){a=Fp({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var c in a)a[c]&&(u+="; "+c,a[c]!==!0&&(u+="="+a[c].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+u}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],a={},u=0;u<s.length;u++){var c=s[u].split("="),f=c.slice(1).join("=");try{var h=decodeURIComponent(c[0]);if(h in a||(a[h]=e.read(f,h)),o===h)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",Fp({},s,{expires:-1}))},withAttributes:function(o){return b_(this.converter,Fp({},this.attributes,o))},withConverter:function(o){return b_(Fp({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var $p=b_(IK,{path:"/"});class RK{constructor(t={}){const{path:n,domain:r,expires:o,sameSite:s,secure:a}=t;if(this.domain=r,this.path=n||"/",this.expires=Object.prototype.hasOwnProperty.call(t,"expires")?o:365,this.secure=Object.prototype.hasOwnProperty.call(t,"secure")?a:!0,Object.prototype.hasOwnProperty.call(t,"sameSite")){if(!s||!["strict","lax","none"].includes(s))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(s==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=s}}async setItem(t,n){$p.set(t,n,this.getData())}async getItem(t){return $p.get(t)??null}async removeItem(t){$p.remove(t,this.getData())}async clear(){const t=$p.get(),n=Object.keys(t).map(r=>this.removeItem(r));await Promise.all(n)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const Xf=new EK;new _K;const xs=new AK,TK=new Ln("I18n");let OK=class{constructor(){this._options=null,this._lang=null,this._dict={}}setDefaultLanguage(){!this._lang&&typeof window<"u"&&window&&window.navigator&&(this._lang=window.navigator.language),TK.debug(this._lang)}setLanguage(t){this._lang=t}get(t,n=void 0){if(this.setDefaultLanguage(),!this._lang)return typeof n<"u"?n:t;const r=this._lang;let o=this.getByLanguage(t,r);return o||(r.indexOf("-")>0&&(o=this.getByLanguage(t,r.split("-")[0])),o)?o:typeof n<"u"?n:t}getByLanguage(t,n,r=null){if(!n)return r;const o=this._dict[n];return o?o[t]:r}putVocabulariesForLanguage(t,n){let r=this._dict[t];r||(r=this._dict[t]={}),this._dict[t]={...r,...n}}putVocabularies(t){Object.keys(t).forEach(n=>{this.putVocabulariesForLanguage(n,t[n])})}};var _a;(function(e){e.NotConfigured="NotConfigured"})(_a||(_a={}));const MK={[_a.NotConfigured]:{message:"i18n is not configured."}},zp=Pv(MK),JP=new Ln("I18n");let jp={language:null},ao=null,x8=class Ca{static configure(t){return JP.debug("configure I18n"),t&&(jp=Object.assign({},jp,t.I18n||t),Ca.createInstance()),jp}static getModuleName(){return"I18n"}static createInstance(){JP.debug("create I18n instance"),!ao&&(ao=new OK)}static setLanguage(t){Ca.checkConfig(),zp(!!ao,_a.NotConfigured),ao.setLanguage(t)}static get(t,n){return Ca.checkConfig(),zp(!!ao,_a.NotConfigured),ao.get(t,n)}static putVocabulariesForLanguage(t,n){Ca.checkConfig(),zp(!!ao,_a.NotConfigured),ao.putVocabulariesForLanguage(t,n)}static putVocabularies(t){Ca.checkConfig(),zp(!!ao,_a.NotConfigured),ao.putVocabularies(t)}static checkConfig(){return ao||Ca.createInstance(),!0}};x8.createInstance();const PK=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=new Uint8Array(e);OA().getRandomValues(r);for(const o of r)n.push(t[o%t.length]);return n.join("")};function NK(e){return(e.match(/.{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("")}function kK(e){return e.split("").map(t=>t.charCodeAt(0).toString(16).padStart(2,"0")).join("")}const DK=e=>{let t;return async(...n)=>t||(t=new Promise((r,o)=>{e(...n).then(s=>{r(s)}).catch(s=>{o(s)}).finally(()=>{t=void 0})}),t)};function eN({expiresAt:e,clockDrift:t,tolerance:n=5e3}){return Date.now()+t+n>e}const LK=async()=>{const{userAgentData:e}=navigator;if(!e)return navigator.userAgent;const{platform:t="",platformVersion:n="",model:r="",architecture:o="",fullVersionList:s=[]}=await e.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]),a=s.map(c=>`${c.brand}/${c.version}`).join(";");return[t,n,o,r,t,a].filter(c=>c).join(" ")||navigator.userAgent};function UK(e){return Array.from(e,t=>String.fromCodePoint(t)).join("")}const Uu={convert(e,t={urlSafe:!1,skipPadding:!1}){const n=typeof e=="string"?e:UK(e);let r=FW()(n);return t.urlSafe&&(r=r.replace(/\+/g,"-").replace(/\//g,"_")),t.skipPadding&&(r=r.replace(/=/g,"")),r}};function FK(){return OA().getRandomValues(new Uint32Array(1))[0]}function $K(e){const{words:t}=e,{sigBytes:n}=e,r=[];for(let o=0;o<n;o++){const s=t[o>>>2]>>>24-o%4*8&255;r.push((s>>>4).toString(16)),r.push((s&15).toString(16))}return r.join("")}class DA{constructor(t,n){this.words=[];let r=t;r=this.words=r||[],n!==void 0?this.sigBytes=n:this.sigBytes=r.length*4}random(t){const n=[];for(let r=0;r<t;r+=4)n.push(FK());return new DA(n,t)}toString(){return $K(this)}}var Ue;(function(e){e.EmptySignInUsername="EmptySignInUsername",e.EmptySignInPassword="EmptySignInPassword",e.CustomAuthSignInPassword="CustomAuthSignInPassword",e.EmptySignUpUsername="EmptySignUpUsername",e.EmptySignUpPassword="EmptySignUpPassword",e.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",e.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",e.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",e.EmptyChallengeResponse="EmptyChallengeResponse",e.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",e.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",e.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",e.EmptyResetPasswordUsername="EmptyResetPasswordUsername",e.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",e.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",e.IncorrectMFAMethod="IncorrectMFAMethod",e.EmptyUpdatePassword="EmptyUpdatePassword",e.InvalidPreferredChallenge="InvalidPreferredChallenge"})(Ue||(Ue={}));const A8={[Ue.EmptyChallengeResponse]:{message:"challengeResponse is required to confirmSignIn"},[Ue.EmptyConfirmResetPasswordUsername]:{message:"username is required to confirmResetPassword"},[Ue.EmptyConfirmSignUpCode]:{message:"code is required to confirmSignUp"},[Ue.EmptyConfirmSignUpUsername]:{message:"username is required to confirmSignUp"},[Ue.EmptyConfirmResetPasswordConfirmationCode]:{message:"confirmationCode is required to confirmResetPassword"},[Ue.EmptyConfirmResetPasswordNewPassword]:{message:"newPassword is required to confirmResetPassword"},[Ue.EmptyResendSignUpCodeUsername]:{message:"username is required to confirmSignUp"},[Ue.EmptyResetPasswordUsername]:{message:"username is required to resetPassword"},[Ue.EmptySignInPassword]:{message:"password is required to signIn"},[Ue.EmptySignInUsername]:{message:"username is required to signIn"},[Ue.EmptySignUpPassword]:{message:"password is required to signUp"},[Ue.EmptySignUpUsername]:{message:"username is required to signUp"},[Ue.CustomAuthSignInPassword]:{message:"A password is not needed when signing in with CUSTOM_WITHOUT_SRP",recoverySuggestion:"Do not include a password in your signIn call."},[Ue.IncorrectMFAMethod]:{message:"Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL",recoverySuggestion:"Try to pass SMS, TOTP, or EMAIL as the challengeResponse"},[Ue.EmptyVerifyTOTPSetupCode]:{message:"code is required to verifyTotpSetup"},[Ue.EmptyUpdatePassword]:{message:"oldPassword and newPassword are required to changePassword"},[Ue.EmptyConfirmUserAttributeCode]:{message:"confirmation code is required to confirmUserAttribute"},[Ue.InvalidPreferredChallenge]:{message:"The preferred challenge is not enabled in your backend configuration",recoverySuggestion:"Ensure the authentication method is enabled in your Amplify backend configuration"}};var En;(function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",e.AUTOSIGNIN_ERROR="Please use your credentials to sign in",e.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings"})(En||(En={}));var jo;(function(e){e.SignInException="SignInException",e.OAuthSignInError="OAuthSignInException"})(jo||(jo={}));class Oe extends cr{constructor(t){super(t),this.constructor=Oe,Object.setPrototypeOf(this,Oe.prototype)}}function Kt(e,t){const{message:n,recoverySuggestion:r}=A8[t];if(!e)throw new Oe({name:t,message:n,recoverySuggestion:r})}function nt(e){const t=e?.split("_")[0];if(!e||e.indexOf("_")<0||!t||typeof t!="string")throw new Oe({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return t}function S_(e){if(!e||!e.includes(":"))throw new Oe({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}function tN(e){return Object.entries(e).map(([t,n])=>({Name:t,Value:n}))}function zK(e){const t={};return e?.forEach(n=>{n.Name&&(t[n.Name]=n.Value)}),t}var nN;(function(e){e.ConcurrentModificationException="ConcurrentModificationException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException"})(nN||(nN={}));var rN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(rN||(rN={}));var oN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UsernameExistsException="UsernameExistsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(oN||(oN={}));var sN;(function(e){e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyFailedAttemptsException="TooManyFailedAttemptsException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(sN||(sN={}));var iN;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyFailedAttemptsException="TooManyFailedAttemptsException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(iN||(iN={}));var aN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(aN||(aN={}));var lN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(lN||(lN={}));var uN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(uN||(uN={}));var cN;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(cN||(cN={}));var dN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(dN||(dN={}));var fN;(function(e){e.ExternalServiceException="ExternalServiceException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceConflictException="ResourceConflictException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException"})(fN||(fN={}));var hN;(function(e){e.ExternalServiceException="ExternalServiceException",e.InternalErrorException="InternalErrorException",e.InvalidIdentityPoolConfigurationException="InvalidIdentityPoolConfigurationException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceConflictException="ResourceConflictException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException"})(hN||(hN={}));var pN;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(pN||(pN={}));var gN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException"})(gN||(gN={}));var _m;(function(e){e.PasswordResetRequiredException="PasswordResetRequiredException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(_m||(_m={}));var mN;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(mN||(mN={}));var vN;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.MFAMethodNotFoundException="MFAMethodNotFoundException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(vN||(vN={}));var yN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(yN||(yN={}));var w_;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UsernameExistsException="UsernameExistsException"})(w_||(w_={}));var bN;(function(e){e.AliasExistsException="AliasExistsException",e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(bN||(bN={}));var SN;(function(e){e.CodeMismatchException="CodeMismatchException",e.EnableSoftwareTokenMFAException="EnableSoftwareTokenMFAException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(SN||(SN={}));var wN;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(wN||(wN={}));var CN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(CN||(CN={}));var EN;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(EN||(EN={}));const $v="UserUnAuthenticatedException",jK="UserAlreadyAuthenticatedException",BK="DeviceMetadataNotFoundException",I8="AutoSignInException",HK="InvalidRedirectException",qK="InvalidAppSchemeException",VK="InvalidPreferredRedirectUrlException",WK=new Oe({name:HK,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new Oe({name:qK,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new Oe({name:VK,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const GK="InvalidOriginException",KK=new Oe({name:GK,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."}),ZK="OAuthSignOutException",YK="TokenRefreshException",QK="UnexpectedSignInInterruptionException";function lc(e){if(!e||!e.accessToken)throw new Oe({name:$v,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function XK(e){if(!e||!e.idToken)throw new Oe({name:$v,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const JK=new Oe({name:YK,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow.
|
|
3
3
|
Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow.
|
|
4
4
|
E.g { responseType: 'code' }`}),eZ=new Oe({name:$v,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function R8(e){if(rZ(e))throw JK;if(!nZ(e))throw eZ}function T8(e){if(!e||!e.deviceKey||!e.deviceGroupKey||!e.randomPassword)throw new Oe({name:BK,message:"Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.",recoverySuggestion:"Make sure to not clear storage after calling the signIn API."})}const tZ={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function O8(e){return e?.accessToken||e?.idToken}function nZ(e){return O8(e)&&e?.refreshToken}function rZ(e){return O8(e)&&!e?.refreshToken}const oZ=async e=>{const t=e.getConfig().Auth?.Cognito;We(t);const n=await e.Auth.getTokens({forceRefresh:!1});lc(n);const{"cognito:username":r,sub:o}=n.idToken?.payload??{},s={username:r,userId:o},a=sZ(n);return a&&(s.signInDetails=a),s};function sZ(e){return e?.signInDetails}const zv=async()=>oZ(Tt),vt=(e,t)=>Dv({category:Jr.Auth,action:e,...t}),_n=e=>(t,n)=>{const r=iZ(e),o=JSON.stringify(t);return aZ(n,r,o)},iZ=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),aZ=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"});function eo(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new Oe({name:$i.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const Un=()=>async e=>{if(e.statusCode>=300){const t=await ac(e);throw eo(t),new Oe({name:t.name,message:t.message,metadata:t.$metadata})}return Qf(e)},lZ=()=>(e,t)=>async function(r){return r.headers={...r.headers,"cache-control":"no-store",...await Tt.libraryOptions?.Auth?.headers?.()},e(r)},xn=kA(m8,[lZ]),M8="cognito-idp",An={service:M8,retryDecider:h8(ac),computeDelay:f8,get userAgentValue(){return Dv()},cache:"no-store"},Jf=e=>fn(xn,_n("InitiateAuth"),Un(),{...An,...e}),Tr=e=>fn(xn,_n("RespondToAuthChallenge"),Un(),{...An,...e}),uZ=e=>fn(xn,_n("VerifySoftwareToken"),Un(),{...An,...e}),cZ=e=>fn(xn,_n("AssociateSoftwareToken"),Un(),{...An,...e}),dZ=({region:e})=>({url:new Yi(`https://${M8}.${e}.${S8(e)}`)}),rt=({endpointOverride:e})=>t=>e?{url:new Yi(e)}:dZ(t),fZ=e=>fn(xn,_n("GetTokensFromRefreshToken"),Un(),{...An,...e}),hZ=async({tokens:e,authConfig:t,username:n,clientMetadata:r})=>{We(t?.Cognito);const{userPoolId:o,userPoolClientId:s,userPoolEndpoint:a}=t.Cognito,u=nt(o);R8(e);const c=fZ({endpointResolver:rt({endpointOverride:a})}),{AuthenticationResult:f}=await c({region:u},{ClientId:s,RefreshToken:e.refreshToken,DeviceKey:e.deviceMetadata?.deviceKey,ClientMetadata:r}),h=Ms(f?.AccessToken??""),g=f?.IdToken?Ms(f.IdToken):void 0,{iat:m}=h.payload;if(!m)throw new Oe({name:"iatNotFoundException",message:"iat not found in access token"});const v=m*1e3-new Date().getTime();return{accessToken:h,idToken:g,clockDrift:v,refreshToken:f?.RefreshToken??e.refreshToken,username:n}},pZ=DK(hZ),gZ={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var xm;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(xm||(xm={}));const mZ={[xm.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},vZ=Pv(mZ),_N="CognitoIdentityServiceProvider";class yZ{getKeyValueStorage(){if(!this.keyValueStorage)throw new Oe({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(t){this.keyValueStorage=t}setAuthConfig(t){this.authConfig=t}async loadTokens(){try{const t=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(t.accessToken);if(!n)throw new Oe({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const r=Ms(n),o=await this.getKeyValueStorage().getItem(t.idToken),s=o?Ms(o):void 0,a=await this.getKeyValueStorage().getItem(t.refreshToken)??void 0,u=await this.getKeyValueStorage().getItem(t.clockDrift)??"0",c=Number.parseInt(u),f=await this.getKeyValueStorage().getItem(t.signInDetails),h={accessToken:r,idToken:s,refreshToken:a,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:c,username:await this.getLastAuthUser()};return f&&(h.signInDetails=JSON.parse(f)),h}catch{return null}}async storeTokens(t){vZ(t!==void 0,xm.InvalidAuthTokens);const n=t.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),n);const r=await this.getAuthKeys();await this.getKeyValueStorage().setItem(r.accessToken,t.accessToken.toString()),t.idToken?await this.getKeyValueStorage().setItem(r.idToken,t.idToken.toString()):await this.getKeyValueStorage().removeItem(r.idToken),t.refreshToken?await this.getKeyValueStorage().setItem(r.refreshToken,t.refreshToken):await this.getKeyValueStorage().removeItem(r.refreshToken),t.deviceMetadata&&(t.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(r.deviceKey,t.deviceMetadata.deviceKey),t.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(r.deviceGroupKey,t.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(r.randomPasswordKey,t.deviceMetadata.randomPassword)),t.signInDetails?await this.getKeyValueStorage().setItem(r.signInDetails,JSON.stringify(t.signInDetails)):await this.getKeyValueStorage().removeItem(r.signInDetails),await this.getKeyValueStorage().setItem(r.clockDrift,`${t.clockDrift}`)}async clearTokens(){const t=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(t.accessToken),this.getKeyValueStorage().removeItem(t.idToken),this.getKeyValueStorage().removeItem(t.clockDrift),this.getKeyValueStorage().removeItem(t.refreshToken),this.getKeyValueStorage().removeItem(t.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(t.oauthMetadata)])}async getDeviceMetadata(t){const n=await this.getAuthKeys(t),r=await this.getKeyValueStorage().getItem(n.deviceKey),o=await this.getKeyValueStorage().getItem(n.deviceGroupKey),s=await this.getKeyValueStorage().getItem(n.randomPasswordKey);return s&&o&&r?{deviceKey:r,deviceGroupKey:o,randomPassword:s}:null}async clearDeviceMetadata(t){const n=await this.getAuthKeys(t);await Promise.all([this.getKeyValueStorage().removeItem(n.deviceKey),this.getKeyValueStorage().removeItem(n.deviceGroupKey),this.getKeyValueStorage().removeItem(n.randomPasswordKey)])}async getAuthKeys(t){We(this.authConfig?.Cognito);const n=t??await this.getLastAuthUser();return bZ(_N,`${this.authConfig.Cognito.userPoolClientId}.${n}`)}getLastAuthUserKey(){We(this.authConfig?.Cognito);const t=this.authConfig.Cognito.userPoolClientId;return`${_N}.${t}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(t){const{oauthMetadata:n}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(n,JSON.stringify(t))}async getOAuthMetadata(){const{oauthMetadata:t}=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(t);return n&&JSON.parse(n)}}const bZ=(e,t)=>LA(gZ)(`${e}`,t);function LA(e){const t=Object.values({...e});return(n,r)=>t.reduce((o,s)=>({...o,[s]:`${n}.${r}.${s}`}),{})}const xN="amplify-signin-with-hostedUI",To="CognitoIdentityServiceProvider";class P8{constructor(t){this.keyValueStorage=t}async clearOAuthInflightData(){We(this.cognitoConfig);const t=Oo(To,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(t.inflightOAuth),this.keyValueStorage.removeItem(t.oauthPKCE),this.keyValueStorage.removeItem(t.oauthState)])}async clearOAuthData(){We(this.cognitoConfig);const t=Oo(To,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(xN),this.keyValueStorage.removeItem(t.oauthSignIn)}loadOAuthState(){We(this.cognitoConfig);const t=Oo(To,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthState)}storeOAuthState(t){We(this.cognitoConfig);const n=Oo(To,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthState,t)}loadPKCE(){We(this.cognitoConfig);const t=Oo(To,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthPKCE)}storePKCE(t){We(this.cognitoConfig);const n=Oo(To,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthPKCE,t)}setAuthConfig(t){this.cognitoConfig=t}async loadOAuthInFlight(){We(this.cognitoConfig);const t=Oo(To,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(t.inflightOAuth)==="true"}async storeOAuthInFlight(t){We(this.cognitoConfig);const n=Oo(To,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.inflightOAuth,`${t}`)}async loadOAuthSignIn(){We(this.cognitoConfig);const t=Oo(To,this.cognitoConfig.userPoolClientId),n=await this.keyValueStorage.getItem(xN),[r,o]=(await this.keyValueStorage.getItem(t.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:r==="true"||n==="true",preferPrivateSession:o==="true"}}async storeOAuthSignIn(t,n=!1){We(this.cognitoConfig);const r=Oo(To,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(r.oauthSignIn,`${t},${n}`)}}const Oo=(e,t)=>LA(tZ)(e,t),ir=new P8(Xf),C_=[],SZ=e=>{C_.push(e)},N8=()=>{for(;C_.length;)C_.pop()?.()};class wZ{constructor(){this.waitForInflightOAuth=Lv()?async()=>{if(await ir.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((t,n)=>{SZ(t)}),this.inflightPromise)}:async()=>{}}setAuthConfig(t){ir.setAuthConfig(t.Cognito),this.authConfig=t}setTokenRefresher(t){this.tokenRefresher=t}setAuthTokenStore(t){this.tokenStore=t}getTokenStore(){if(!this.tokenStore)throw new Oe({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new Oe({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}setClientMetadataProvider(t){this.clientMetadataProvider=t}async getTokens(t){let n;try{We(this.authConfig?.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,n=await this.getTokenStore().loadTokens();const r=await this.getTokenStore().getLastAuthUser();if(n===null)return null;const o=!!n?.idToken&&eN({expiresAt:(n.idToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0}),s=eN({expiresAt:(n.accessToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0});return(t?.forceRefresh||o||s)&&(n=await this.refreshTokens({tokens:n,username:r,clientMetadata:t?.clientMetadata??await this.clientMetadataProvider?.()}),n===null)?null:{accessToken:n?.accessToken,idToken:n?.idToken,signInDetails:n?.signInDetails}}async refreshTokens({tokens:t,username:n,clientMetadata:r}){try{const{signInDetails:o}=t,s=await this.getTokenRefresher()({tokens:t,authConfig:this.authConfig,username:n,clientMetadata:r});return s.signInDetails=o,await this.setTokens({tokens:s}),zo.dispatch("auth",{event:"tokenRefresh"},"Auth",$o),s}catch(o){return this.handleErrors(o)}}handleErrors(t){if(eo(t),this.isAuthenticationError(t)&&this.clearTokens(),zo.dispatch("auth",{event:"tokenRefresh_failure",data:{error:t}},"Auth",$o),t.name.startsWith("NotAuthorizedException"))return null;throw t}isAuthenticationError(t){return["NotAuthorizedException","TokenRevokedException","UserNotFoundException","PasswordResetRequiredException","UserNotConfirmedException","RefreshTokenReuseException"].some(r=>t?.name?.startsWith?.(r))}async setTokens({tokens:t}){return this.getTokenStore().storeTokens(t)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(t){return this.getTokenStore().getDeviceMetadata(t)}clearDeviceMetadata(t){return this.getTokenStore().clearDeviceMetadata(t)}setOAuthMetadata(t){return this.getTokenStore().setOAuthMetadata(t)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class CZ{constructor(){this.authTokenStore=new yZ,this.authTokenStore.setKeyValueStorage(Xf),this.tokenOrchestrator=new wZ,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(pZ)}getTokens(t={}){return this.tokenOrchestrator.getTokens(t)}setKeyValueStorage(t){this.authTokenStore.setKeyValueStorage(t)}setClientMetadataProvider(t){this.tokenOrchestrator.setClientMetadataProvider(t)}setAuthConfig(t){this.authTokenStore.setAuthConfig(t),this.tokenOrchestrator.setAuthConfig(t)}}const Yg=new CZ,{tokenOrchestrator:dr}=Yg;async function js(e){if(e.AccessToken){const t=Ms(e.AccessToken),n=(t.payload.iat||0)*1e3,r=new Date().getTime(),o=n>0?n-r:0;let s,a,u;e.RefreshToken&&(a=e.RefreshToken),e.IdToken&&(s=Ms(e.IdToken)),e?.NewDeviceMetadata&&(u=e.NewDeviceMetadata);const c={accessToken:t,idToken:s,refreshToken:a,clockDrift:o,deviceMetadata:u,username:e.username};e?.signInDetails&&(c.signInDetails=e.signInDetails),await dr.setTokens({tokens:c})}else throw new cr({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}const EZ="Unable to get user session following successful sign-in.",Qi=async()=>{try{zo.dispatch("auth",{event:"signedIn",data:await zv()},"Auth",$o)}catch(e){throw e.name===$v?new Oe({name:QK,message:EZ,recoverySuggestion:"This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server."}):e}};function k8(){return{active:!1}}const _Z=(e,t)=>{switch(t.type){case"SET_USERNAME":return{...e,username:t.value};case"SET_SESSION":return{...e,session:t.value};case"START":return{...e,active:!0};case"RESET":return k8();default:return e}},xZ=e=>{let t=e(k8(),{type:"RESET"});return{getState:()=>t,dispatch:n=>{t=e(t,n)}}},Pi=xZ(_Z),AZ=180*1e3,Bp="CognitoSignInState",As={username:`${Bp}.username`,challengeName:`${Bp}.challengeName`,signInSession:`${Bp}.signInSession`,expiry:`${Bp}.expiry`},IZ=(e,t)=>{switch(t.type){case"SET_SIGN_IN_SESSION":return Hp({signInSession:t.value}),{...e,signInSession:t.value};case"SET_SIGN_IN_STATE":return Hp(t.value),{...t.value};case"SET_CHALLENGE_NAME":return Hp({challengeName:t.value}),{...e,challengeName:t.value};case"SET_USERNAME":return Hp({username:t.value}),{...e,username:t.value};case"SET_INITIAL_STATE":return TZ();case"RESET_STATE":return D8(),UA();default:return e}},RZ=e=>{const t=Number(e),n=Date.now();return t<=n},bo=()=>{Bo.dispatch({type:"RESET_STATE"})},D8=()=>{for(const e of Object.values(As))xs.removeItem(e)},UA=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),TZ=()=>{const e=xs.getItem(As.expiry);if(!e||RZ(e))return D8(),UA();const t=xs.getItem(As.username)??void 0,n=xs.getItem(As.challengeName)??void 0,r=xs.getItem(As.signInSession)??void 0;return{username:t,challengeName:n,signInSession:r}},OZ=e=>{let t=e(UA(),{type:"SET_INITIAL_STATE"});return{getState:()=>t,dispatch:n=>{t=e(t,n)}}},Bo=OZ(IZ);function tl(e){Bo.dispatch({type:"SET_SIGN_IN_STATE",value:e})}const Hp=({challengeName:e,signInSession:t,username:n})=>{n&&xs.setItem(As.username,n),e&&xs.setItem(As.challengeName,e),t&&(xs.setItem(As.signInSession,t),xs.setItem(As.expiry,String(Date.now()+AZ)))},AN="Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.";class Qr extends cr{constructor(t){super(t),this.constructor=Qr,Object.setPrototypeOf(this,Qr.prototype)}}var It;(function(e){e.PasskeyNotSupported="PasskeyNotSupported",e.PasskeyAlreadyExists="PasskeyAlreadyExists",e.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",e.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",e.RelyingPartyMismatch="RelyingPartyMismatch",e.PasskeyRegistrationFailed="PasskeyRegistrationFailed",e.PasskeyRetrievalFailed="PasskeyRetrievalFailed",e.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",e.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",e.PasskeyOperationAborted="PasskeyOperationAborted"})(It||(It={}));const R1="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",IN="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",Fu={[It.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:AN},[It.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:IN},[It.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:IN},[It.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:AN},[It.PasskeyRetrievalFailed]:{message:"Device failed to retrieve passkey.",recoverySuggestion:"Passkeys may not be available on this device. Try an alternative authentication factor like PASSWORD, EMAIL_OTP, or SMS_OTP."},[It.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[It.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:R1},[It.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:R1},[It.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:R1},[It.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},uc=Pv(Fu,Qr),L8=e=>{if(e instanceof Error){if(e.name==="AbortError"){const{message:t,recoverySuggestion:n}=Fu[It.PasskeyOperationAborted];return new Qr({name:It.PasskeyOperationAborted,message:t,recoverySuggestion:n,underlyingError:e})}if(e.name==="SecurityError"){const{message:t,recoverySuggestion:n}=Fu[It.RelyingPartyMismatch];return new Qr({name:It.RelyingPartyMismatch,message:t,recoverySuggestion:n,underlyingError:e})}}return new Qr({name:$i.Unknown,message:"An unknown error has occurred.",underlyingError:e})},MZ=e=>{if(e instanceof Qr)return e;if(e instanceof Error&&e.name==="NotAllowedError"){const{message:t,recoverySuggestion:n}=Fu[It.PasskeyAuthenticationCanceled];return new Qr({name:It.PasskeyAuthenticationCanceled,message:t,recoverySuggestion:n,underlyingError:e})}return L8(e)},U8=()=>Lv()&&window.isSecureContext&&"credentials"in navigator&&typeof window.PublicKeyCredential=="function",Uo=e=>Uu.convert(new Uint8Array(e),{urlSafe:!0,skipPadding:!0}),rf=e=>Uint8Array.from(MA.convert(e,{urlSafe:!0}),t=>t.charCodeAt(0)).buffer,PZ=e=>{const t=rf(e.user.id),n=rf(e.challenge),r=(e.excludeCredentials||[]).map(o=>({...o,id:rf(o.id)}));return{...e,excludeCredentials:r,challenge:n,user:{...e.user,id:t}}},NZ=e=>{const t={clientDataJSON:Uo(e.response.clientDataJSON),attestationObject:Uo(e.response.attestationObject),transports:e.response.getTransports(),publicKeyAlgorithm:e.response.getPublicKeyAlgorithm(),authenticatorData:Uo(e.response.getAuthenticatorData())},n=e.response.getPublicKey();n&&(t.publicKey=Uo(n));const r={type:e.type,id:e.id,rawId:Uo(e.rawId),clientExtensionResults:e.getClientExtensionResults(),response:t};return e.authenticatorAttachment&&(r.authenticatorAttachment=e.authenticatorAttachment),r},kZ=e=>{const t=rf(e.challenge),n=(e.allowCredentials||[]).map(r=>({...r,id:rf(r.id)}));return{...e,challenge:t,allowCredentials:n}},DZ=e=>{const t={clientDataJSON:Uo(e.response.clientDataJSON),authenticatorData:Uo(e.response.authenticatorData),signature:Uo(e.response.signature)};e.response.userHandle&&(t.userHandle=Uo(e.response.userHandle));const n={id:e.id,rawId:Uo(e.rawId),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:t};return e.authenticatorAttachment&&(n.authenticatorAttachment=e.authenticatorAttachment),n};function LZ(e){uc([!!e,!!e?.challenge,!!e?.user,!!e?.rp,!!e?.pubKeyCredParams].every(Boolean),It.InvalidPasskeyRegistrationOptions)}function UZ(e){uc(e&&e instanceof PublicKeyCredential&&e.response instanceof AuthenticatorAttestationResponse,It.PasskeyRegistrationFailed)}function FZ(e){uc(e&&e instanceof PublicKeyCredential&&e.response instanceof AuthenticatorAssertionResponse,It.PasskeyRetrievalFailed)}const $Z=async e=>{try{const t=U8();uc(t,It.PasskeyNotSupported);const n=kZ(e),r=await navigator.credentials.get({publicKey:n});return FZ(r),DZ(r)}catch(t){throw MZ(t)}},zZ=e=>fn(xn,_n("ConfirmDevice"),Un(),{...An,...e}),Qg={convert(e){return new TextEncoder().encode(e)}};function be(e,t){e!=null&&this.fromString(e,t)}function Zn(){return new be(null,null)}let Li;const jZ=0xdeadbeefcafe,RN=(jZ&16777215)===15715070;function BZ(e,t,n,r,o,s){for(;--s>=0;){const a=t*this[e++]+n[r]+o;o=Math.floor(a/67108864),n[r++]=a&67108863}return o}function HZ(e,t,n,r,o,s){const a=t&32767,u=t>>15;for(;--s>=0;){let c=this[e]&32767;const f=this[e++]>>15,h=u*c+f*a;c=a*c+((h&32767)<<15)+n[r]+(o&1073741823),o=(c>>>30)+(h>>>15)+u*f+(o>>>30),n[r++]=c&1073741823}return o}function qZ(e,t,n,r,o,s){const a=t&16383,u=t>>14;for(;--s>=0;){let c=this[e]&16383;const f=this[e++]>>14,h=u*c+f*a;c=a*c+((h&16383)<<14)+n[r]+o,o=(c>>28)+(h>>14)+u*f,n[r++]=c&268435455}return o}const TN=typeof navigator<"u";TN&&RN&&navigator.appName==="Microsoft Internet Explorer"?(be.prototype.am=HZ,Li=30):TN&&RN&&navigator.appName!=="Netscape"?(be.prototype.am=BZ,Li=26):(be.prototype.am=qZ,Li=28);be.prototype.DB=Li;be.prototype.DM=(1<<Li)-1;be.prototype.DV=1<<Li;const FA=52;be.prototype.FV=Math.pow(2,FA);be.prototype.F1=FA-Li;be.prototype.F2=2*Li-FA;const VZ="0123456789abcdefghijklmnopqrstuvwxyz",jv=[];let cc,Kr;cc=48;for(Kr=0;Kr<=9;++Kr)jv[cc++]=Kr;cc=97;for(Kr=10;Kr<36;++Kr)jv[cc++]=Kr;cc=65;for(Kr=10;Kr<36;++Kr)jv[cc++]=Kr;function ON(e){return VZ.charAt(e)}function WZ(e,t){const n=jv[e.charCodeAt(t)];return n??-1}function GZ(e){for(let t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function KZ(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function $A(e){const t=Zn();return t.fromInt(e),t}function ZZ(e,t){let n;if(t===16)n=4;else if(t===8)n=3;else if(t===2)n=1;else if(t===32)n=5;else if(t===4)n=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;let r=e.length,o=!1,s=0;for(;--r>=0;){const a=WZ(e,r);if(a<0){e.charAt(r)==="-"&&(o=!0);continue}o=!1,s===0?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=n,s>=this.DB&&(s-=this.DB)}this.clamp(),o&&be.ZERO.subTo(this,this)}function YZ(){const e=this.s&this.DM;for(;this.t>0&&this[this.t-1]==e;)--this.t}function QZ(e){if(this.s<0)return"-"+this.negate().toString(e);let t;if(e==16)t=4;else if(e===8)t=3;else if(e===2)t=1;else if(e===32)t=5;else if(e===4)t=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");const n=(1<<t)-1;let r,o=!1,s="",a=this.t,u=this.DB-a*this.DB%t;if(a-- >0)for(u<this.DB&&(r=this[a]>>u)>0&&(o=!0,s=ON(r));a>=0;)u<t?(r=(this[a]&(1<<u)-1)<<t-u,r|=this[--a]>>(u+=this.DB-t)):(r=this[a]>>(u-=t)&n,u<=0&&(u+=this.DB,--a)),r>0&&(o=!0),o&&(s+=ON(r));return o?s:"0"}function XZ(){const e=Zn();return be.ZERO.subTo(this,e),e}function JZ(){return this.s<0?this.negate():this}function eY(e){let t=this.s-e.s;if(t!=0)return t;let n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this[n]-e[n])!=0)return t;return 0}function zA(e){let t=1,n;return(n=e>>>16)!==0&&(e=n,t+=16),(n=e>>8)!==0&&(e=n,t+=8),(n=e>>4)!==0&&(e=n,t+=4),(n=e>>2)!==0&&(e=n,t+=2),(n=e>>1)!==0&&(e=n,t+=1),t}function tY(){return this.t<=0?0:this.DB*(this.t-1)+zA(this[this.t-1]^this.s&this.DM)}function nY(e,t){let n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function rY(e,t){for(let n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s}function oY(e,t){const n=e%this.DB,r=this.DB-n,o=(1<<r)-1,s=Math.floor(e/this.DB);let a=this.s<<n&this.DM,u;for(u=this.t-1;u>=0;--u)t[u+s+1]=this[u]>>r|a,a=(this[u]&o)<<n;for(u=s-1;u>=0;--u)t[u]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()}function sY(e,t){t.s=this.s;const n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}const r=e%this.DB,o=this.DB-r,s=(1<<r)-1;t[0]=this[n]>>r;for(let a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&s)<<o,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&s)<<o),t.t=this.t-n,t.clamp()}function iY(e,t){let n=0,r=0;const o=Math.min(e.t,this.t);for(;n<o;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()}function aY(e,t){const n=this.abs(),r=e.abs();let o=n.t;for(t.t=o+r.t;--o>=0;)t[o]=0;for(o=0;o<r.t;++o)t[o+n.t]=n.am(0,r[o],t,o,0,n.t);t.s=0,t.clamp(),this.s!==e.s&&be.ZERO.subTo(t,t)}function lY(e){const t=this.abs();let n=e.t=2*t.t;for(;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){const r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}function uY(e,t,n){const r=e.abs();if(r.t<=0)return;const o=this.abs();if(o.t<r.t){t?.fromInt(0),n!=null&&this.copyTo(n);return}n===null&&(n=Zn());const s=Zn(),a=this.s,u=e.s,c=this.DB-zA(r[r.t-1]);c>0?(r.lShiftTo(c,s),o.lShiftTo(c,n)):(r.copyTo(s),o.copyTo(n));const f=s.t,h=s[f-1];if(h===0)return;const g=h*(1<<this.F1)+(f>1?s[f-2]>>this.F2:0),m=this.FV/g,v=(1<<this.F1)/g,w=1<<this.F2;let S=n.t,C=S-f;const E=t===null?Zn():t;for(s.dlShiftTo(C,E),n.compareTo(E)>=0&&(n[n.t++]=1,n.subTo(E,n)),be.ONE.dlShiftTo(f,E),E.subTo(s,s);s.t<f;)s[s.t++]=0;for(;--C>=0;){let A=n[--S]===h?this.DM:Math.floor(n[S]*m+(n[S-1]+w)*v);if((n[S]+=s.am(0,A,n,C,0,f))<A)for(s.dlShiftTo(C,E),n.subTo(E,n);n[S]<--A;)n.subTo(E,n)}t!==null&&(n.drShiftTo(f,t),a!==u&&be.ZERO.subTo(t,t)),n.t=f,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&be.ZERO.subTo(n,n)}function cY(e){const t=Zn();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(be.ZERO)>0&&e.subTo(t,t),t}function dY(){if(this.t<1)return 0;const e=this[0];if((e&1)===0)return 0;let t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function fY(e){return this.compareTo(e)===0}function hY(e,t){let n=0,r=0;const o=Math.min(e.t,this.t);for(;n<o;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()}function pY(e){const t=Zn();return this.addTo(e,t),t}function gY(e){const t=Zn();return this.subTo(e,t),t}function mY(e){const t=Zn();return this.multiplyTo(e,t),t}function vY(e){const t=Zn();return this.divRemTo(e,t,null),t}function dc(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function yY(e){const t=Zn();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(be.ZERO)>0&&this.m.subTo(t,t),t}function bY(e){const t=Zn();return e.copyTo(t),this.reduce(t),t}function SY(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(let t=0;t<this.m.t;++t){let n=e[t]&32767;const r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function wY(e,t){e.squareTo(t),this.reduce(t)}function CY(e,t,n){e.multiplyTo(t,n),this.reduce(n)}dc.prototype.convert=yY;dc.prototype.revert=bY;dc.prototype.reduce=SY;dc.prototype.mulTo=CY;dc.prototype.sqrTo=wY;function EY(e,t,n){let r=e.bitLength(),o,s=$A(1);const a=new dc(t);if(r<=0)return s;r<18?o=1:r<48?o=3:r<144?o=4:r<768?o=5:o=6;const u=[];let c=3;const f=o-1,h=(1<<o)-1;if(u[1]=a.convert(this),o>1){const E=Zn();for(a.sqrTo(u[1],E);c<=h;)u[c]=Zn(),a.mulTo(E,u[c-2],u[c]),c+=2}let g=e.t-1,m,v=!0,w=Zn(),S;for(r=zA(e[g])-1;g>=0;){for(r>=f?m=e[g]>>r-f&h:(m=(e[g]&(1<<r+1)-1)<<f-r,g>0&&(m|=e[g-1]>>this.DB+r-f)),c=o;(m&1)===0;)m>>=1,--c;if((r-=c)<0&&(r+=this.DB,--g),v)u[m].copyTo(s),v=!1;else{for(;c>1;)a.sqrTo(s,w),a.sqrTo(w,s),c-=2;c>0?a.sqrTo(s,w):(S=s,s=w,w=S),a.mulTo(w,u[m],s)}for(;g>=0&&(e[g]&1<<r)===0;)a.sqrTo(s,w),S=s,s=w,w=S,--r<0&&(r=this.DB-1,--g)}const C=a.revert(s);return n(null,C),C}be.prototype.copyTo=GZ;be.prototype.fromInt=KZ;be.prototype.fromString=ZZ;be.prototype.clamp=YZ;be.prototype.dlShiftTo=nY;be.prototype.drShiftTo=rY;be.prototype.lShiftTo=oY;be.prototype.rShiftTo=sY;be.prototype.subTo=iY;be.prototype.multiplyTo=aY;be.prototype.squareTo=lY;be.prototype.divRemTo=uY;be.prototype.invDigit=dY;be.prototype.addTo=hY;be.prototype.toString=QZ;be.prototype.negate=XZ;be.prototype.abs=JZ;be.prototype.compareTo=eY;be.prototype.bitLength=tY;be.prototype.mod=cY;be.prototype.equals=fY;be.prototype.add=pY;be.prototype.subtract=gY;be.prototype.multiply=mY;be.prototype.divide=vY;be.prototype.modPow=EY;be.ZERO=$A(0);be.ONE=$A(1);const _Y=async({a:e,g:t,k:n,x:r,B:o,N:s,U:a})=>new Promise((u,c)=>{t.modPow(r,s,(f,h)=>{if(f){c(f);return}o.subtract(n.multiply(h)).modPow(e.add(a.multiply(r)),s,(g,m)=>{if(g){c(g);return}u(m.mod(s))})})}),xY="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",F8={},E_={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),F8[e]=t,E_[t]=e}const $u=e=>{if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(r in E_)t[n/2]=E_[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return t},jA=e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=F8[e[n]];return t},__=e=>{const t=new Ha;t.update(e);const n=t.digestSync(),r=jA(n);return new Array(64-r.length).join("0")+r},Xg=e=>__($u(e)),AY=/^[89a-f]/i,Cs=e=>{if(!(e instanceof be))throw new Error("Not a BigInteger");const t=e.compareTo(be.ZERO)<0;let n=e.abs().toString(16);if(n=n.length%2!==0?`0${n}`:n,n=AY.test(n)?`00${n}`:n,t){const r=n.split("").map(s=>{const a=~parseInt(s,16)&15;return"0123456789ABCDEF".charAt(a)}).join("");n=new be(r,16).add(be.ONE).toString(16),n.toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},IY=({A:e,B:t})=>{const n=new be(Xg(Cs(e)+Cs(t)),16);if(n.equals(be.ZERO))throw new Error("U cannot be zero.");return n},RY=(e,t,n)=>{const r=new Ha(t);r.update(e);const o=r.digestSync(),s=new Ha(o);return s.update(n),s.digestSync().slice(0,16)},BA=e=>{const t=new DA().random(e).toString();return $u(t)},TY=()=>Uu.convert(BA(40));class OY{constructor({userPoolName:t,a:n,g:r,A:o,N:s}){this.encoder=Qg,this.userPoolName=t,this.a=n,this.g=r,this.A=o,this.N=s,this.k=new be(Xg(`${Cs(s)}${Cs(r)}`),16)}getRandomPassword(){if(!this.randomPassword)throw new Oe({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new Oe({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new Oe({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}async generateHashDevice(t,n){this.randomPassword=TY();const r=`${t}${n}:${this.randomPassword}`,o=__(r),s=jA(BA(16));return this.saltToHashDevices=Cs(new be(s,16)),new Promise((a,u)=>{this.g.modPow(new be(Xg(this.saltToHashDevices+o),16),this.N,(c,f)=>{if(c){u(c);return}this.verifierDevices=Cs(f),a()})})}async getPasswordAuthenticationKey({username:t,password:n,serverBValue:r,salt:o}){if(r.mod(this.N).equals(be.ZERO))throw new Error("B cannot be zero.");const s=IY({A:this.A,B:r}),a=`${this.userPoolName}${t}:${n}`,u=__(a),c=new be(Xg(Cs(o)+u),16),f=await _Y({a:this.a,g:this.g,k:this.k,x:c,B:r,N:this.N,U:s}),h=this.encoder.convert("Caldera Derived Key"),g=this.encoder.convert(""),m=new Uint8Array(h.byteLength+g.byteLength);return m.set(h,0),m.set(g,h.byteLength),RY($u(Cs(f)),$u(Cs(s)),m)}}const MY=async({a:e,g:t,N:n})=>new Promise((r,o)=>{t.modPow(e,n,(s,a)=>{if(s){o(s);return}if(a.mod(n).equals(be.ZERO)){o(new Error("Illegal parameter. A mod N cannot be 0."));return}r(a)})}),eh=async e=>{const t=new be(xY,16),n=new be("2",16),r=PY(),o=await MY({a:r,g:n,N:t});return new OY({userPoolName:e,a:r,g:n,A:o,N:t})},PY=()=>{const e=jA(BA(128));return new be(e,16)};async function nl({userPoolId:e,userPoolEndpoint:t,newDeviceMetadata:n,accessToken:r}){if(!n)return;const o=e.split("_")[1]||"",s=await eh(o),a=n?.DeviceKey,u=n?.DeviceGroupKey;try{await s.generateHashDevice(u??"",a??"")}catch{return}const c={Salt:Uu.convert($u(s.getSaltToHashDevices())),PasswordVerifier:Uu.convert($u(s.getVerifierDevices()))},f=s.getRandomPassword();try{return await zZ({endpointResolver:rt({endpointOverride:t})})({region:nt(e)},{AccessToken:r,DeviceName:await LK(),DeviceKey:n?.DeviceKey,DeviceSecretVerifierConfig:c}),{deviceKey:a,deviceGroupKey:u,randomPassword:f}}catch{return}}async function NY(e){const t=Tt.getConfig().Auth?.Cognito;We(t);const{username:n,signInSession:r,signInDetails:o,challengeName:s}=Bo.getState();if(s!=="WEB_AUTHN"||!n)throw new Oe({name:jo.SignInException,message:"Unable to proceed due to invalid sign in state."});const{CREDENTIAL_REQUEST_OPTIONS:a}=e;uc(!!a,It.InvalidPasskeyAuthenticationOptions);const u=await $Z(JSON.parse(a)),c=Tr({endpointResolver:rt({endpointOverride:t.userPoolEndpoint})}),{ChallengeName:f,ChallengeParameters:h,AuthenticationResult:g,Session:m}=await c({region:nt(t.userPoolId),userAgentValue:vt(Fe.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(u)},ClientId:t.userPoolClientId,Session:r});if(tl({signInSession:m,username:n,challengeName:f,signInDetails:o}),g)return await js({...g,username:n,NewDeviceMetadata:await nl({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:o}),Bo.dispatch({type:"RESET_STATE"}),await Qi(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if(f==="WEB_AUTHN")throw new Oe({name:jo.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return{challengeName:f,challengeParameters:h}}function In({username:e,userPoolId:t,userPoolClientId:n}){if(typeof window>"u")return;const r=window.AmazonCognitoAdvancedSecurityData;if(typeof r>"u")return;const o=r.getData(e,t,n);return o?{EncodedData:o}:{}}const kY=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DY=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$8=()=>{const e=new Date,t=DY[e.getUTCDay()],n=kY[e.getUTCMonth()],r=e.getUTCDate();let o=e.getUTCHours();o<10&&(o=`0${o}`);let s=e.getUTCMinutes();s<10&&(s=`0${s}`);let a=e.getUTCSeconds();a<10&&(a=`0${a}`);const u=e.getUTCFullYear();return`${t} ${n} ${r} ${o}:${s}:${a} UTC ${u}`},z8=({userPoolName:e,username:t,challengeParameters:n,dateNow:r,hkdf:o})=>{const s=Qg.convert(e),a=Qg.convert(t),u=LY(n.SECRET_BLOCK),c=Qg.convert(r),f=new Uint8Array(s.byteLength+a.byteLength+u.byteLength+c.byteLength);f.set(s,0),f.set(a,s.byteLength),f.set(u,s.byteLength+a.byteLength),f.set(c,s.byteLength+a.byteLength+u.byteLength);const h=new Ha(o);h.update(f);const g=h.digestSync();return Uu.convert(g)},LY=e=>{const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=MA.convert(n),o=new Uint8Array(r.length);for(let s=0;s<r.length;++s)o[s]=r.charCodeAt(s);return o};async function th({username:e,config:t,clientMetadata:n,session:r,tokenOrchestrator:o}){const{userPoolId:s,userPoolEndpoint:a}=t,u=t.userPoolClientId,c=await o?.getDeviceMetadata(e);T8(c);const f=await eh(c.deviceGroupKey),h={USERNAME:e,SRP_A:f.A.toString(16),DEVICE_KEY:c.deviceKey},g={ChallengeName:"DEVICE_SRP_AUTH",ClientId:u,ChallengeResponses:h,ClientMetadata:n,Session:r},m=Tr({endpointResolver:rt({endpointOverride:a})}),{ChallengeParameters:v,Session:w}=await m({region:nt(s)},g);return UY(e,v,n,w,f,t,o)}async function UY(e,t,n,r,o,{userPoolId:s,userPoolClientId:a,userPoolEndpoint:u},c){const f=await c?.getDeviceMetadata(e);T8(f);const h=new be(t?.SRP_B,16),g=new be(t?.SALT,16),{deviceKey:m}=f,{deviceGroupKey:v}=f,w=await o.getPasswordAuthenticationKey({username:f.deviceKey,password:f.randomPassword,serverBValue:h,salt:g}),S=$8(),C={USERNAME:t?.USERNAME??e,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:S,PASSWORD_CLAIM_SIGNATURE:z8({username:m,userPoolName:v,challengeParameters:t,dateNow:S,hkdf:w}),DEVICE_KEY:m},E=In({username:e,userPoolId:s,userPoolClientId:a}),A={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:a,ChallengeResponses:C,Session:r,ClientMetadata:n,UserContextData:E};return Tr({endpointResolver:rt({endpointOverride:u})})({region:nt(s)},A)}async function HA(e,t,n,r,o,s,a){const{userPoolId:u,userPoolClientId:c,userPoolEndpoint:f}=s,h=u?.split("_")[1]||"",g=new be(t?.SRP_B,16),m=new be(t?.SALT,16),v=t?.USER_ID_FOR_SRP;if(!v)throw new Oe({name:"EmptyUserIdForSRPException",message:"USER_ID_FOR_SRP was not found in challengeParameters"});const w=await o.getPasswordAuthenticationKey({username:v,password:e,serverBValue:g,salt:m}),S=$8(),C={USERNAME:v,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:S,PASSWORD_CLAIM_SIGNATURE:z8({username:v,userPoolName:h,challengeParameters:t,dateNow:S,hkdf:w})},E=await a.getDeviceMetadata(v);E&&E.deviceKey&&(C.DEVICE_KEY=E.deviceKey);const A=In({username:v,userPoolId:u,userPoolClientId:c}),I={ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:C,ClientMetadata:n,Session:r,ClientId:c,UserContextData:A},N=await Tr({endpointResolver:rt({endpointOverride:f})})({region:nt(u)},I);return N.ChallengeName==="DEVICE_SRP_AUTH"?th({username:v,config:s,clientMetadata:n,session:N.Session,tokenOrchestrator:a}):N}async function fc(e,t,n,r){try{return await e(...t)}catch(o){if(o instanceof Oe&&o.name==="ResourceNotFoundException"&&o.message.includes("Device does not exist."))return await r.clearDeviceMetadata(n),e(...t);throw o}}function rl(e){const{dispatch:t}=Bo;t({type:"SET_USERNAME",value:e})}async function j8({username:e,password:t,clientMetadata:n,config:r,tokenOrchestrator:o,authFlow:s,preferredChallenge:a}){const{userPoolId:u,userPoolClientId:c,userPoolEndpoint:f}=r,h=u?.split("_")[1]||"",g=await eh(h),m={USERNAME:e,SRP_A:g.A.toString(16)};s==="USER_AUTH"&&a&&(m.PREFERRED_CHALLENGE=a);const v=In({username:e,userPoolId:u,userPoolClientId:c}),w={AuthFlow:s,AuthParameters:m,ClientMetadata:n,ClientId:c,UserContextData:v},C=await Jf({endpointResolver:rt({endpointOverride:f})})({region:nt(u),userAgentValue:vt(Fe.SignIn)},w),{ChallengeParameters:E,Session:A}=C,I=E?.USERNAME??e;return rl(I),C.ChallengeName==="PASSWORD_VERIFIER"?fc(HA,[t,E,n,A,g,r,o],I,o):C}async function FY({username:e,session:t,selectedChallenge:n,config:r,clientMetadata:o}){return Tr({endpointResolver:rt({endpointOverride:r.userPoolEndpoint})})({region:nt(r.userPoolId),userAgentValue:vt(Fe.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:{USERNAME:e,ANSWER:n},ClientId:r.userPoolClientId,Session:t,ClientMetadata:o})}async function $Y(e,t,n,r,o){const{userPoolId:s,userPoolClientId:a,userPoolEndpoint:u}=r,c={ANSWER:"PASSWORD",USERNAME:e,PASSWORD:t},f=In({username:e,userPoolId:s,userPoolClientId:a}),g=await Tr({endpointResolver:rt({endpointOverride:u})})({region:nt(s),userAgentValue:vt(Fe.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:c,ClientId:a,ClientMetadata:n,Session:o,UserContextData:f}),m=g.ChallengeParameters?.USERNAME??e;return rl(m),g}async function zY(e,t,n,r,o,s){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=r,f=a.split("_")[1]||"",h=await eh(f),g={ANSWER:"PASSWORD_SRP",USERNAME:e,SRP_A:h.A.toString(16)},m=In({username:e,userPoolId:a,userPoolClientId:u}),w=await Tr({endpointResolver:rt({endpointOverride:c})})({region:nt(a),userAgentValue:vt(Fe.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:g,ClientId:u,ClientMetadata:n,Session:o,UserContextData:m}),S=w.ChallengeParameters?.USERNAME??e;return rl(S),w.ChallengeName==="PASSWORD_VERIFIER"?fc(HA,[t,w.ChallengeParameters,n,w.Session,h,r,s],S,s):w}const x_="userAttributes.";function jY(e){return"isSignedIn"in e&&"nextStep"in e}async function BY({challengeResponse:e,clientMetadata:t,session:n,username:r,config:o,tokenOrchestrator:s}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=o,f={USERNAME:r,ANSWER:e},h=await s?.getDeviceMetadata(r);h&&h.deviceKey&&(f.DEVICE_KEY=h.deviceKey);const g=In({username:r,userPoolId:a,userPoolClientId:u}),m={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:f,Session:n,ClientMetadata:t,ClientId:u,UserContextData:g},w=await Tr({endpointResolver:rt({endpointOverride:c})})({region:nt(a),userAgentValue:vt(Fe.ConfirmSignIn)},m);return w.ChallengeName==="DEVICE_SRP_AUTH"?th({username:r,config:o,clientMetadata:t,session:w.Session,tokenOrchestrator:s}):w}async function HY({challengeResponse:e,username:t,clientMetadata:n,session:r,deviceName:o,config:s}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=s;if(e==="EMAIL")return{ChallengeName:"MFA_SETUP",Session:r,ChallengeParameters:{MFAS_CAN_SETUP:'["EMAIL_OTP"]'},$metadata:{}};if(e==="TOTP")return{ChallengeName:"MFA_SETUP",Session:r,ChallengeParameters:{MFAS_CAN_SETUP:'["SOFTWARE_TOKEN_MFA"]'},$metadata:{}};const f={USERNAME:t};if(/^\d+$/.test(e)){const m=uZ({endpointResolver:rt({endpointOverride:c})}),{Session:v}=await m({region:nt(a),userAgentValue:vt(Fe.ConfirmSignIn)},{UserCode:e,Session:r,FriendlyDeviceName:o});Bo.dispatch({type:"SET_SIGN_IN_SESSION",value:v});const w={ChallengeName:"MFA_SETUP",ChallengeResponses:f,Session:v,ClientMetadata:n,ClientId:u};return Tr({endpointResolver:rt({endpointOverride:c})})({region:nt(a),userAgentValue:vt(Fe.ConfirmSignIn)},w)}if(e.includes("@")){f.EMAIL=e;const m={ChallengeName:"MFA_SETUP",ChallengeResponses:f,Session:r,ClientMetadata:n,ClientId:u};return Tr({endpointResolver:rt({endpointOverride:c})})({region:nt(a),userAgentValue:vt(Fe.ConfirmSignIn)},m)}throw new Oe({name:jo.SignInException,message:`Cannot proceed with MFA setup using challengeResponse: ${e}`,recoverySuggestion:'Try passing "EMAIL", "TOTP", a valid email, or OTP code as the challengeResponse.'})}async function qY({challengeResponse:e,username:t,clientMetadata:n,session:r,config:o}){const{userPoolId:s,userPoolClientId:a,userPoolEndpoint:u}=o;Kt(e==="TOTP"||e==="SMS"||e==="EMAIL",Ue.IncorrectMFAMethod);const c={USERNAME:t,ANSWER:eQ(e)},f=In({username:t,userPoolId:s,userPoolClientId:a}),h={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:c,Session:r,ClientMetadata:n,ClientId:a,UserContextData:f};return Tr({endpointResolver:rt({endpointOverride:u})})({region:nt(s),userAgentValue:vt(Fe.ConfirmSignIn)},h)}async function VY({challengeResponse:e,clientMetadata:t,session:n,username:r,requiredAttributes:o,config:s}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=s,f={...XY(o),NEW_PASSWORD:e,USERNAME:r},h=In({username:r,userPoolId:a,userPoolClientId:u}),g={ChallengeName:"NEW_PASSWORD_REQUIRED",ChallengeResponses:f,ClientMetadata:t,Session:n,ClientId:u,UserContextData:h};return Tr({endpointResolver:rt({endpointOverride:c})})({region:nt(a),userAgentValue:vt(Fe.ConfirmSignIn)},g)}async function WY(e,t,n,r,o){const{userPoolClientId:s,userPoolId:a,userPoolEndpoint:u}=r,c={USERNAME:e,PASSWORD:t},f=await o.getDeviceMetadata(e);f&&f.deviceKey&&(c.DEVICE_KEY=f.deviceKey);const h=In({username:e,userPoolId:a,userPoolClientId:s}),g={AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:c,ClientMetadata:n,ClientId:s,UserContextData:h},v=await Jf({endpointResolver:rt({endpointOverride:u})})({region:nt(a),userAgentValue:vt(Fe.SignIn)},g),w=v.ChallengeParameters?.USERNAME??v.ChallengeParameters?.USER_ID_FOR_SRP??e;return rl(w),v.ChallengeName==="DEVICE_SRP_AUTH"?th({username:w,config:r,clientMetadata:n,session:v.Session,tokenOrchestrator:o}):v}async function GY(e,t,n,r,o){return j8({username:e,password:t,clientMetadata:n,config:r,tokenOrchestrator:o,authFlow:"USER_SRP_AUTH"})}async function KY(e,t,n,r){const{userPoolClientId:o,userPoolId:s,userPoolEndpoint:a}=n,u={USERNAME:e},c=await r.getDeviceMetadata(e);c&&c.deviceKey&&(u.DEVICE_KEY=c.deviceKey);const f=In({username:e,userPoolId:s,userPoolClientId:o}),h={AuthFlow:"CUSTOM_AUTH",AuthParameters:u,ClientMetadata:t,ClientId:o,UserContextData:f},m=await Jf({endpointResolver:rt({endpointOverride:a})})({region:nt(s),userAgentValue:vt(Fe.SignIn)},h),v=m.ChallengeParameters?.USERNAME??e;return rl(v),m.ChallengeName==="DEVICE_SRP_AUTH"?th({username:v,config:n,clientMetadata:t,session:m.Session,tokenOrchestrator:r}):m}async function ZY(e,t,n,r,o){We(r);const{userPoolId:s,userPoolClientId:a,userPoolEndpoint:u}=r,c=s?.split("_")[1]||"",f=await eh(c),h={USERNAME:e,SRP_A:f.A.toString(16),CHALLENGE_NAME:"SRP_A"},g=In({username:e,userPoolId:s,userPoolClientId:a}),m={AuthFlow:"CUSTOM_AUTH",AuthParameters:h,ClientMetadata:n,ClientId:a,UserContextData:g},v=Jf({endpointResolver:rt({endpointOverride:u})}),{ChallengeParameters:w,Session:S}=await v({region:nt(s),userAgentValue:vt(Fe.SignIn)},m),C=w?.USERNAME??e;return rl(C),fc(HA,[t,w,n,S,f,r,o],C,o)}async function ol(e){const{challengeName:t,challengeParameters:n,availableChallenges:r}=e,o=Tt.getConfig().Auth?.Cognito;switch(We(o),t){case"CUSTOM_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE",additionalInfo:n}};case"MFA_SETUP":{const{signInSession:s,username:a}=Bo.getState(),u=MN(PN(n.MFAS_CAN_SETUP))||[],c=nQ(u),f=c.includes("TOTP"),h=c.includes("EMAIL");if(f&&h)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION",allowedMFATypes:c}};if(h)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"}};if(f){const g=cZ({endpointResolver:rt({endpointOverride:o.userPoolEndpoint})}),{Session:m,SecretCode:v}=await g({region:nt(o.userPoolId)},{Session:s});return Bo.dispatch({type:"SET_SIGN_IN_SESSION",value:m}),{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_TOTP_SETUP",totpSetupDetails:YY(v,a)}}}throw new Oe({name:jo.SignInException,message:`Cannot initiate MFA setup from available types: ${u}`})}case"NEW_PASSWORD_REQUIRED":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",missingAttributes:QY(n.requiredAttributes)}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:MN(PN(n.MFAS_CAN_CHOOSE))}};case"SMS_OTP":case"SMS_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_SMS_CODE",codeDeliveryDetails:{deliveryMedium:n.CODE_DELIVERY_DELIVERY_MEDIUM,destination:n.CODE_DELIVERY_DESTINATION}}};case"SOFTWARE_TOKEN_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_TOTP_CODE"}};case"EMAIL_OTP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_EMAIL_CODE",codeDeliveryDetails:{deliveryMedium:n.CODE_DELIVERY_DELIVERY_MEDIUM,destination:n.CODE_DELIVERY_DESTINATION}}};case"WEB_AUTHN":{const s=await NY(n);return jY(s)?s:ol(s)}case"PASSWORD":case"PASSWORD_SRP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_PASSWORD"}};case"SELECT_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION",availableChallenges:r}}}throw new Oe({name:jo.SignInException,message:`An error occurred during the sign in process. ${t} challengeName returned by the underlying service was not addressed.`})}function YY(e,t){return{sharedSecret:e,getSetupUri:(n,r)=>{const o=`otpauth://totp/${n}:${r??t}?secret=${e}&issuer=${n}`;return new Yi(o)}}}function hc(e){if(e===_m.PasswordResetRequiredException)return{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}};if(e===_m.UserNotConfirmedException)return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}}function QY(e){return e?JSON.parse(e).map(n=>n.includes(x_)?n.replace(x_,""):n):[]}function XY(e){if(!e)return{};const t={};return Object.entries(e).forEach(([n,r])=>{r&&(t[`${x_}${n}`]=r)}),t}async function JY(e,t,n,r,o,s,a,u){const c=u?.userAttributes,f=u?.friendlyDeviceName;switch(t){case"WEB_AUTHN":case"SELECT_CHALLENGE":return r==="PASSWORD_SRP"||r==="PASSWORD"?{ChallengeName:r,Session:n,$metadata:{}}:FY({username:e,session:n,selectedChallenge:r,config:o,clientMetadata:a});case"SELECT_MFA_TYPE":return qY({challengeResponse:r,clientMetadata:a,session:n,username:e,config:o});case"MFA_SETUP":return HY({challengeResponse:r,clientMetadata:a,session:n,username:e,deviceName:f,config:o});case"NEW_PASSWORD_REQUIRED":return VY({challengeResponse:r,clientMetadata:a,session:n,username:e,requiredAttributes:c,config:o});case"CUSTOM_CHALLENGE":return fc(BY,[{challengeResponse:r,clientMetadata:a,session:n,username:e,config:o,tokenOrchestrator:s}],e,s);case"SMS_MFA":case"SOFTWARE_TOKEN_MFA":case"SMS_OTP":case"EMAIL_OTP":return rQ({challengeName:t,challengeResponse:r,clientMetadata:a,session:n,username:e,config:o,tokenOrchestrator:s});case"PASSWORD":return $Y(e,r,a,o,n);case"PASSWORD_SRP":return zY(e,r,a,o,n,s)}throw new Oe({name:jo.SignInException,message:`An error occurred during the sign in process.
|
|
@@ -9,12 +9,12 @@ function e8(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
|
|
|
9
9
|
1. signIn was not called before confirmSignIn.
|
|
10
10
|
2. signIn threw an exception.
|
|
11
11
|
3. page was refreshed during the sign in flow and session has expired.
|
|
12
|
-
`,recoverySuggestion:"Make sure a successful call to signIn is made before calling confirmSignInand that the session has not expired."});try{const{Session:f,ChallengeName:h,AuthenticationResult:g,ChallengeParameters:m}=await JY(r,o,s,t,u,dr,c,n);return tl({signInSession:f,username:r,challengeName:h,signInDetails:a}),g?(await js({username:r,...g,NewDeviceMetadata:await nl({userPoolId:u.userPoolId,userPoolEndpoint:u.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:a}),bo(),await Qi(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ol({challengeName:h,challengeParameters:m})}catch(f){eo(f);const h=hc(f.name);if(h)return h;throw f}}const xQ=e=>fn(xn,_n("GetUser"),Un(),{...An,...e}),AQ=e=>fn(xn,_n("VerifyUserAttribute"),Un(),{...An,...e});async function IQ(e){const t=Tt.getConfig().Auth?.Cognito;We(t);const{userPoolEndpoint:n,userPoolId:r}=t,{confirmationCode:o,userAttributeKey:s}=e;Kt(!!o,Ue.EmptyConfirmUserAttributeCode);const{tokens:a}=await Uv({forceRefresh:!1});lc(a),await AQ({endpointResolver:rt({endpointOverride:n})})({region:nt(r),userAgentValue:vt(Fe.ConfirmUserAttribute)},{AccessToken:a.accessToken.toString(),AttributeName:s,Code:o})}new Ln("AuthError");const RQ={oauthSignInError:{message:En.OAUTH_ERROR,log:"Make sure Cognito Hosted UI has been configured correctly"},noConfig:{message:En.DEFAULT_MSG},missingAuthConfig:{message:En.DEFAULT_MSG},emptyUsername:{message:En.EMPTY_USERNAME},invalidUsername:{message:En.INVALID_USERNAME},emptyPassword:{message:En.EMPTY_PASSWORD},emptyCode:{message:En.EMPTY_CODE},signUpError:{message:En.SIGN_UP_ERROR},noMFA:{message:En.NO_MFA},invalidMFA:{message:En.INVALID_MFA},emptyChallengeResponse:{message:En.EMPTY_CHALLENGE},noUserSession:{message:En.NO_USER_SESSION},deviceConfig:{message:En.DEVICE_CONFIG},networkError:{message:En.NETWORK_ERROR},autoSignInError:{message:En.AUTOSIGNIN_ERROR},default:{message:En.DEFAULT_MSG}},zi=(e,t)=>new Oe({message:e??"An error has occurred during the oauth process.",name:jo.OAuthSignInError,recoverySuggestion:RQ.oauthSignInError.log});var I_;(function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError",e.OAuthSignInError="oauthSignInError"})(I_||(I_={}));const TQ="`signInWithRedirect` has been canceled.",OQ="An error occurred while validating the state.",MQ="Try to initiate an OAuth flow from Amplify",Y8=async e=>{const t=await ir.loadOAuthState(),n=e===t?t:void 0;if(!n)throw new Oe({name:I_.OAuthSignInError,message:e===null?TQ:OQ,recoverySuggestion:e===null?void 0:MQ});return n},Q8=async({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,responseType:o,domain:s,preferPrivateSession:a})=>{const u=new Yi(e),c=u.searchParams.get("error"),f=u.searchParams.get("error_description");if(c)throw zi(f??c);return o==="code"?PQ({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,domain:s,preferPrivateSession:a}):NQ({currentUrl:e,redirectUri:r,preferPrivateSession:a})},PQ=async({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,domain:o,preferPrivateSession:s})=>{const a=new Yi(e),u=a.searchParams.get("code"),c=a.searchParams.get("state");if(!u||!c)throw zi("User cancelled OAuth flow.");const f=await Y8(c),h="https://"+o+"/oauth2/token",g=await ir.loadPKCE(),m={grant_type:"authorization_code",code:u,client_id:n,redirect_uri:r,...g?{code_verifier:g}:{}},v=Object.entries(m).map(([M,R])=>`${encodeURIComponent(M)}=${encodeURIComponent(R)}`).join("&"),{access_token:w,refresh_token:S,id_token:C,error:E,error_message:A,token_type:I,expires_in:T}=await(await fetch(h,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",[LW]:t},body:v})).json();if(E)throw zi(A??E);const N=(w&&Ms(w).payload.username)??"username";return await js({username:N,AccessToken:w,IdToken:C,RefreshToken:S}),X8({redirectUri:r,state:f,preferPrivateSession:s})},NQ=async({currentUrl:e,redirectUri:t,preferPrivateSession:n})=>{const r=new Yi(e),{id_token:o,access_token:s,state:a,token_type:u,expires_in:c,error_description:f,error:h}=(r.hash??"#").substring(1).split("&").map(v=>v.split("=")).reduce((v,[w,S])=>({...v,[w]:S}),{id_token:void 0,access_token:void 0,state:void 0,token_type:void 0,expires_in:void 0,error_description:void 0,error:void 0});if(h)throw zi(f??h);if(!s)throw zi("No access token returned from OAuth flow.");const g=await Y8(a),m=(s&&Ms(s).payload.username)??"username";return await js({username:m,AccessToken:s,IdToken:o}),X8({redirectUri:t,state:g,preferPrivateSession:n})},X8=async({redirectUri:e,state:t,preferPrivateSession:n})=>{await dr.setOAuthMetadata({oauthSignIn:!0}),await ir.clearOAuthData(),await ir.storeOAuthSignIn(!0,n),N8(),LQ(e),kQ(t)&&zo.dispatch("auth",{event:"customOAuthState",data:NK(DQ(t))},"Auth",$o),zo.dispatch("auth",{event:"signInWithRedirect"},"Auth",$o),await Qi()},kQ=e=>/-/.test(e),DQ=e=>e.split("-").splice(1).join("-"),LQ=e=>{typeof window<"u"&&typeof window.history<"u"&&window.history.replaceState(window.history.state,"",e)};function WA(e,t){{const n=e?.find(UQ)??e?.find(FQ),r=e?.find(zQ)??e?.find($Q);if(n)return n;throw r?KK:WK}}const UQ=e=>e.startsWith(String(window.location.origin+(window.location.pathname||"/"))),FQ=e=>e.includes(String(window.location.hostname)),$Q=e=>e.startsWith("http://"),zQ=e=>e.startsWith("https://"),GA=async e=>{N8(),await ir.clearOAuthInflightData(),zo.dispatch("auth",{event:"signInWithRedirect_failure",data:{error:e}},"Auth",$o)},jQ=async e=>{try{We(e),Nv(e),ir.setAuthConfig(e)}catch{return}if(await ir.loadOAuthInFlight())try{const t=window.location.href,{loginWith:n,userPoolClientId:r}=e,{domain:o,redirectSignIn:s,responseType:a}=n.oauth,u=WA(s);await Q8({currentUrl:t,clientId:r,domain:o,redirectUri:u,responseType:a,userAgentValue:vt(Fe.SignInWithRedirect)})}catch(t){await GA(t)}};Lv()&&Tt[r8](jQ);const BQ={Google:"Google",Facebook:"Facebook",Amazon:"LoginWithAmazon",Apple:"SignInWithApple"},J8=async e=>{window?.location&&(window.location.href=e.replace("http://","https://"))},kN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",HQ=e=>{const t=new Uint8Array(e);OA().getRandomValues(t);let n="",r;for(const o of t)n+=kN.charAt(o%kN.length);return{value:n,method:"S256",toCodeChallenge(){return r||(r=qQ(n),r)}}};function qQ(e){const t=new Ha;return t.update(e),VQ(Uu.convert(t.digestSync(),{urlSafe:!0}))}function VQ(e){return e.replace(/=/g,"")}const WQ=()=>PK(32),GQ=e=>{async function t(n){if(n.persisted&&await e.loadOAuthInFlight()){const o=zi("User cancelled OAuth flow.");await GA(o)}window.removeEventListener("pageshow",t)}window.addEventListener("pageshow",t)};async function eF(e){const t=Tt.getConfig().Auth?.Cognito;We(t),Nv(t),ir.setAuthConfig(t),e?.options?.prompt||await B8();let n="COGNITO",r;return typeof e?.provider=="string"?n=BQ[e.provider]:e?.provider?.custom?n=e.provider.custom:e?.provider?.idpIdentifier&&({idpIdentifier:r}=e.provider),KQ({oauthConfig:t.loginWith.oauth,clientId:t.userPoolClientId,provider:n,idpIdentifier:r,customState:e?.customState,preferPrivateSession:e?.options?.preferPrivateSession,options:{loginHint:e?.options?.loginHint,lang:e?.options?.lang,nonce:e?.options?.nonce,prompt:e?.options?.prompt},authSessionOpener:e?.options?.authSessionOpener})}const KQ=async({oauthConfig:e,provider:t,idpIdentifier:n,clientId:r,customState:o,preferPrivateSession:s,options:a,authSessionOpener:u})=>{const{domain:c,redirectSignIn:f,responseType:h,scopes:g}=e,{loginHint:m,lang:v,nonce:w,prompt:S}=a??{},C=WQ(),E=u||J8,A=o?`${C}-${kK(o)}`:C,{value:I,method:T,toCodeChallenge:N}=HQ(128),M=WA(e.redirectSignIn);Lv()&&ir.storeOAuthInFlight(!0),ir.storeOAuthState(A),ir.storePKCE(I);const R=new URLSearchParams;R.append("redirect_uri",M),R.append("response_type",h),R.append("client_id",r),n?R.append("idp_identifier",n):R.append("identity_provider",t),R.append("scope",g.join(" ")),m&&R.append("login_hint",m),v&&R.append("lang",v),w&&R.append("nonce",w),S&&R.append("prompt",S.toLowerCase()),R.append("state",A),h==="code"&&(R.append("code_challenge",N()),R.append("code_challenge_method",T));const k=`https://${c}/oauth2/authorize?${R.toString()}`;GQ(ir);const{type:L,error:q,url:F}=await E(k,f,s)??{};try{if(L==="error")throw zi(String(q));if(L==="canceled")throw zi(String(L));L==="success"&&F&&await Q8({currentUrl:F,clientId:r,domain:c,redirectUri:M,responseType:h,userAgentValue:vt(Fe.SignInWithRedirect),preferPrivateSession:s})}catch(D){throw await GA(D),D}},ZQ=async e=>{const t=e.getConfig().Auth?.Cognito;We(t);const{userPoolEndpoint:n,userPoolId:r}=t,{tokens:o}=await u8(e,{forceRefresh:!1});lc(o);const s=xQ({endpointResolver:rt({endpointOverride:n})}),{UserAttributes:a}=await s({region:nt(r),userAgentValue:vt(Fe.FetchUserAttributes)},{AccessToken:o.accessToken.toString()});return zK(a)},tF=()=>ZQ(Tt),YQ=async e=>{await e.clearOAuthData(),dr.clearTokens(),await c8(),zo.dispatch("auth",{event:"signedOut"},"Auth",$o)},QQ=async(e,t=!1,n)=>{Nv(e);const{loginWith:r,userPoolClientId:o}=e,{domain:s,redirectSignOut:a}=r.oauth,u=WA(a),c=`https://${s}/logout?${Object.entries({client_id:o,logout_uri:encodeURIComponent(u)}).map(([f,h])=>`${f}=${h}`).join("&")}`;return J8(c)},XQ=async(e,t,n,r)=>{const{isOAuthSignIn:o}=await t.loadOAuthSignIn(),s=await n.getOAuthMetadata();if(await YQ(t),o||s?.oauthSignIn)return QQ(e,!1)},JQ=e=>fn(xn,_n("RevokeToken"),Un(),{...An,...e}),eX=new Ln("Auth");async function tX(e){const t=Tt.getConfig().Auth?.Cognito;We(t),await nX(t);let n;try{Nv(t),n=!0}catch{n=!1}if(n){const r=new P8(Xf);r.setAuthConfig(t);const{type:o}=await XQ(t,r,dr)??{};if(o==="error")throw new Oe({name:ZK,message:"An error occurred when attempting to log out from OAuth provider."})}else dr.clearTokens(),await c8(),zo.dispatch("auth",{event:"signedOut"},"Auth",$o)}async function nX(e){try{const{userPoolEndpoint:t,userPoolId:n,userPoolClientId:r}=e,o=await dr.getTokenStore().loadTokens();R8(o),rX(o.accessToken)&&await JQ({endpointResolver:rt({endpointOverride:t})})({region:nt(n),userAgentValue:vt(Fe.SignOut)},{ClientId:r,Token:o.refreshToken})}catch{eX.debug("Client signOut error caught but will proceed with token removal")}}const rX=e=>!!e?.payload?.origin_jti,oX=e=>fn(xn,_n("GetUserAttributeVerificationCode"),Un(),{...An,...e}),sX=async e=>{const{userAttributeKey:t,options:n}=e,r=Tt.getConfig().Auth?.Cognito,o=n?.clientMetadata;We(r);const{userPoolEndpoint:s,userPoolId:a}=r,{tokens:u}=await Uv({forceRefresh:!1});lc(u);const c=oX({endpointResolver:rt({endpointOverride:s})}),{CodeDeliveryDetails:f}=await c({region:nt(a),userAgentValue:vt(Fe.SendUserAttributeVerificationCode)},{AccessToken:u.accessToken.toString(),ClientMetadata:o,AttributeName:t}),{DeliveryMedium:h,AttributeName:g,Destination:m}={...f};return{destination:m,deliveryMedium:h,attributeName:g}},iX={identityId:"identityId"},aX=new Ln("DefaultIdentityIdStore");class nF{setAuthConfig(t){Kg(t.Cognito),this.authConfig=t,this._authKeys=lX("Cognito",t.Cognito.identityPoolId)}constructor(t){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=t}async loadIdentityId(){Kg(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const t=await this.keyValueStorage.getItem(this._authKeys.identityId);return t?(this._hasGuestIdentityId=!0,{id:t,type:"guest"}):null}}catch(t){return aX.log("Error getting stored IdentityId.",t),null}}async storeIdentityId(t){Kg(this.authConfig?.Cognito),t.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,t.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=t.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const lX=(e,t)=>LA(iX)(`com.amplify.${e}`,t),R_=({endpointOverride:e})=>t=>e?{url:new Yi(e)}:wK(t);function rF(e){const t=Ms(e).payload.iss,n={};if(!t)throw new Oe({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const r=t.replace(/(^\w+:|^)\/\//,"");return n[r]=e,n}async function uX({tokens:e,authConfig:t,identityIdStore:n}){n.setAuthConfig({Cognito:t});const r=await n.loadIdentityId();if(r)return r.id;const o=e?.idToken?rF(e.idToken.toString()):{},s=await cX(o,t);return n.storeIdentityId({id:s,type:e?"primary":"guest"}),s}async function cX(e,t){const n=t?.identityPoolId,r=S_(n),o=yK({endpointResolver:R_({endpointOverride:t.identityPoolEndpoint})});let s;try{s=(await o({region:r},{IdentityPoolId:n,Logins:e})).IdentityId}catch(a){throw eo(a),new Oe(a)}if(!s)throw new Oe({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return s}const qp=new Ln("CognitoCredentialsProvider"),DN=3e3*1e3;class oF{constructor(t){this._nextCredentialsRefresh=0,this._identityIdStore=t}async clearCredentialsAndIdentityId(){qp.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){qp.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(t){const n=t.authenticated,{tokens:r}=t,{authConfig:o}=t;try{Kg(o?.Cognito)}catch{return}if(!n&&!o.Cognito.allowGuestAccess)return;const{forceRefresh:s}=t,a=this.hasTokenChanged(r),u=await uX({tokens:r,authConfig:o.Cognito,identityIdStore:this._identityIdStore});return(s||a)&&this.clearCredentials(),n?(XK(r),this.credsForOIDCTokens(o.Cognito,r,u)):this.getGuestCredentials(u,o.Cognito)}async getGuestCredentials(t,n){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return qp.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const r=S_(n.identityPoolId),o=XP({endpointResolver:R_({endpointOverride:n.identityPoolEndpoint})});let s;try{s=await o({region:r},{IdentityId:t})}catch(a){throw eo(a),new Oe(a)}if(s?.Credentials?.AccessKeyId&&s?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+DN;const a={credentials:{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration},identityId:t};return s.IdentityId&&(a.identityId=s.IdentityId,this._identityIdStore.storeIdentityId({id:s.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...a,isAuthenticatedCreds:!1},a}else throw new Oe({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(t,n,r){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return qp.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const o=n.idToken?rF(n.idToken.toString()):{},s=S_(t.identityPoolId),a=XP({endpointResolver:R_({endpointOverride:t.identityPoolEndpoint})});let u;try{u=await a({region:s},{IdentityId:r,Logins:o})}catch(c){throw eo(c),new Oe(c)}if(u?.Credentials?.AccessKeyId&&u?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+DN;const c={credentials:{accessKeyId:u.Credentials.AccessKeyId,secretAccessKey:u.Credentials.SecretKey,sessionToken:u.Credentials.SessionToken,expiration:u.Credentials.Expiration},identityId:r};return u.IdentityId&&(c.identityId=u.IdentityId,this._identityIdStore.storeIdentityId({id:u.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...c,isAuthenticatedCreds:!0,associatedIdToken:n.idToken?.toString()},c}else throw new Oe({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(t){return!!t&&!!this._credentialsAndIdentityId?.associatedIdToken&&t.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}const dX=new oF(new nF(Xf)),sF={configure(e,t){const n=s8(e),r=new RK({sameSite:"lax"}),o=t?.ssr?r:Xf,s=t?.ssr?new oF(new nF(r)):dX;if(!n.Auth||t?.Auth){Tt.configure(n,t);return}Yg.setAuthConfig(n.Auth),Yg.setKeyValueStorage(o),Tt.configure(n,{...t,Auth:{tokenProvider:Yg,credentialsProvider:s}})},getConfig(){return Tt.getConfig()}},fX="https://github.com/remit-mail/reader/issues/new",hX=["internal","acme","tailscale","off"],pX=["self","managed"],LN=(e,t,n)=>e.find(r=>r===t)??n,pc=()=>{const e=globalThis.__REMIT_CONFIG__??{};return{apiUrl:e.apiUrl??"/api",appOrigin:e.appOrigin??"",betterAuthEnabled:e.betterAuthEnabled??!1,cognito:{userPoolId:e.cognito?.userPoolId??"",clientId:e.cognito?.clientId??"",domain:e.cognito?.domain??"",region:e.cognito?.region??""},rum:{appMonitorId:e.rum?.appMonitorId??"",identityPoolId:e.rum?.identityPoolId??"",region:e.rum?.region??"eu-west-1"},mailboxPollIntervalSeconds:e.mailboxPollIntervalSeconds!=null?String(e.mailboxPollIntervalSeconds):void 0,disableDevtools:e.disableDevtools??!1,tlsMode:LN(hX,e.tlsMode,"off"),issuesUrl:e.issuesUrl??fX,updateMode:LN(pX,e.updateMode,"self")}},iF=()=>{const e=pc(),{userPoolId:t,clientId:n,domain:r,region:o}=e.cognito;return!t||!n?null:{userPoolId:t,userPoolClientId:n,domain:r,region:o,appOrigin:e.appOrigin}},Bv=()=>iF()!==null,aF=()=>{const e=iF();if(!e){console.warn("[auth] Cognito user pool is not configured. Running in local dev mode without Cognito auth.");return}const{userPoolId:t,userPoolClientId:n,domain:r,appOrigin:o}=e;sF.configure({Auth:{Cognito:{userPoolId:t,userPoolClientId:n,loginWith:r?{oauth:{domain:r,scopes:["openid","email","profile"],redirectSignIn:o?[o]:[],redirectSignOut:o?[o]:[],responseType:"code"}}:void 0}}})};var gX={};const Jg=Object.create(null),Sd=e=>gX||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?Jg:globalThis),Ei=new Proxy(Jg,{get(e,t){return Sd()[t]??Jg[t]},has(e,t){return t in Sd()||t in Jg},set(e,t,n){const r=Sd(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;const n=Sd(!0);return delete n[t],!0},ownKeys(){const e=Sd(!0);return Object.keys(e)}});Ei.NODE_ENV;var em=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};const mX=47;function lF(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===mX;)t--;return t===e.length?e:e.slice(0,t)}function vX(e){try{return(lF(new URL(e).pathname)||"/")!=="/"}catch{throw new em(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function yX(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new em(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof em?t:new em(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function UN(e,t="/api/auth"){if(yX(e),vX(e))return e;const n=lF(e);return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function bX(e,t,n,r,o){{const s=Ei.BETTER_AUTH_URL||Ei.NEXT_PUBLIC_BETTER_AUTH_URL||Ei.PUBLIC_BETTER_AUTH_URL||Ei.NUXT_PUBLIC_BETTER_AUTH_URL||Ei.NUXT_PUBLIC_AUTH_URL||(Ei.BASE_URL!=="/"?Ei.BASE_URL:void 0);if(s)return UN(s,t)}if(typeof window<"u"&&window.location)return UN(window.location.origin,t)}const SX={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},wX=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,FN={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},CX=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function EX(e){return e instanceof Date&&!isNaN(e.getTime())}function _X(e){const t=CX.exec(e);if(!t)return null;const[,n,r,o,s,a,u,c,f,h,g]=t,m=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(s,10),parseInt(a,10),parseInt(u,10),c?parseInt(c.padEnd(3,"0"),10):0));if(f){const v=(parseInt(h,10)*60+parseInt(g,10))*(f==="+"?-1:1);m.setUTCMinutes(m.getUTCMinutes()+v)}return EX(m)?m:null}function xX(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:o,parseDates:s=!0}=t;if(typeof e!="string")return e;const a=e.trim(),u=a.toLowerCase();if(u.length<=9&&u in FN)return FN[u];if(!wX.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(SX).some(([c,f])=>{const h=f.test(a);return h&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${c} pattern`),h})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(f,h)=>{if(f==="__proto__"||f==="constructor"&&h&&typeof h=="object"&&"prototype"in h){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(s&&typeof h=="string"){const g=_X(h);if(g)return g}return o?o(f,h):h})}catch(c){if(n)throw c;return e}}function AX(e,t={strict:!0}){return xX(e,t)}const IX=["javascript:","data:","vbscript:"];function RX(e){let t;try{t=new URL(e)}catch{return!0}return!IX.includes(t.protocol)}const TX={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&RX(e.data.url)&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}};let po=[],_i=0;const tm=4,OX=globalThis.nanostoresGlobal||={epoch:0};let MX=()=>{for(_i=0;_i<po.length;_i+=tm)po[_i](po[_i+1].value,po[_i+2],po[_i+3]);po.length=0};const uF=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let s=_i+tm;s<po.length;)po[s]===r?po.splice(s,tm):s+=tm;let o=t.indexOf(r);~o&&(t.splice(o,1),--n.lc||n.off())}},notify(r,o){OX.epoch++;let s=!po.length&&!0;for(let a of t)po.push(a,n,r,o);s&&MX()},off(){},set(r){let o=n.value;o!==r&&(n.value=r,n.notify(o))},subscribe(r){let o=n.listen(r);return r(n.value),o},value:e};return n},PX=2,NX=5,Vp=6,Wp=10;let cF=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Wp]||(e.events[n+Wp]=r(o=>{e.events[n].reduceRight((s,a)=>(a(s),s),{shared:{},...o})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],s=o.indexOf(t);o.splice(s,1),o.length||(delete e.events[n],e.events[n+Wp](),delete e.events[n+Wp])}),kX=(e,t)=>cF(e,t,PX,n=>{let r=e.set,o=e.setKey;return e.setKey&&(e.setKey=(s,a)=>{let u;if(n({abort:()=>{u=!0},changed:s,newValue:{...e.value,[s]:a}}),!u)return o(s,a)}),e.set=s=>{let a;if(n({abort:()=>{a=!0},newValue:s}),!a)return r(s)},()=>{e.set=r,e.setKey=o}});const dF=1e3;let DX=(e,t)=>cF(e,r=>{let o=t(r);o&&e.events[Vp].push(o)},NX,r=>{let o=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),o(...a));let s=e.off;return e.events[Vp]=[],e.off=()=>{s(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[Vp])a();e.events[Vp]=[]}},dF)},()=>{e.listen=o,e.off=s}});function LX(e,t,n){let r=new Set(t);return e.listen((o,s,a)=>{(a===void 0?t.some(u=>o[u]!==s[u]):r.has(a)||r.has(a.split(/\.|\[/)[0]))&&n(o,s,a)})}function $N(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Am(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Am(e[n],t[n]))return!1;return!0}if($N(e)&&$N(t)){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!(o in t)||!Am(e[o],t[o]))return!1;return!0}return!1}function UX(e,t){return kX(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}const T_=Symbol.for("better-auth:auth-query");function FX(e){return T_ in e&&e[T_]===!0}function $X(e){const t=uF(e);return Object.defineProperty(t,T_,{value:!0}),t}const T1=Symbol.for("better-auth:broadcast-channel"),zX=()=>Math.floor(Date.now()/1e3);var jX=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:zX()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function O1(e="better-auth.message"){return globalThis[T1]||(globalThis[T1]=new jX(e)),globalThis[T1]}const M1=Symbol.for("better-auth:focus-manager");var BX=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function zN(){return globalThis[M1]||(globalThis[M1]=new BX),globalThis[M1]}const P1=Symbol.for("better-auth:online-manager");var HX=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function N1(){return globalThis[P1]||(globalThis[P1]=new HX),globalThis[P1]}const k1=()=>Math.floor(Date.now()/1e3),qX=5;function VX(e){const{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:o={}}=e,s=o.sessionOptions?.refetchInterval??0,a=o.sessionOptions?.refetchOnWindowFocus??!0,u=o.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},f=()=>u||N1().isOnline,h=I=>{if(f()){if(I?.event==="storage"){t();return}if(I?.event==="poll"){c.lastSessionRequest=k1(),t();return}if(I?.event==="visibilitychange"){if(k1()-c.lastSessionRequest<qX)return;c.lastSessionRequest=k1(),t();return}t()}},g=I=>{O1().post({event:"session",data:{trigger:I},clientId:Math.random().toString(36).substring(7)})},m=()=>{s&&s>0&&(c.pollInterval=setInterval(()=>{n()&&h({event:"poll"})},s*1e3))},v=()=>{c.unsubscribeBroadcast=O1().subscribe(()=>{h({event:"storage"})})},w=()=>{a&&(c.unsubscribeFocus=zN().subscribe(()=>{h({event:"visibilitychange"})}))},S=()=>{c.unsubscribeOnline=N1().subscribe(I=>{I&&h({event:"visibilitychange"})})},C=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,m(),v(),w(),S(),C(),c.cleanupBroadcastSetup=O1().setup(),c.cleanupFocusSetup=zN().setup(),c.cleanupOnlineSetup=N1().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&(clearInterval(c.pollInterval),c.pollInterval=void 0),c.unsubscribeBroadcast&&(c.unsubscribeBroadcast(),c.unsubscribeBroadcast=void 0),c.unsubscribeFocus&&(c.unsubscribeFocus(),c.unsubscribeFocus=void 0),c.unsubscribeOnline&&(c.unsubscribeOnline(),c.unsubscribeOnline=void 0),c.unsubscribeSignal&&(c.unsubscribeSignal(),c.unsubscribeSignal=void 0),c.cleanupBroadcastSetup&&(c.cleanupBroadcastSetup(),c.cleanupBroadcastSetup=void 0),c.cleanupFocusSetup&&(c.cleanupFocusSetup(),c.cleanupFocusSetup=void 0),c.cleanupOnlineSetup&&(c.cleanupOnlineSetup(),c.cleanupOnlineSetup=void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:h,broadcastSessionUpdate:g}}const WX=()=>typeof window>"u",GX=dF;function KX(e,t){if(typeof window>"u")return;const n=e.get();n.data!==null||t===null||e.set({...n,data:t,error:null,isPending:!1})}function jN(e){return typeof e=="object"&&e!==null&&"data"in e&&"error"in e?e:{data:e,error:null}}function ZX(e){return!e||e.session===null&&e.user===null?null:e}function YX(e,t){return Am(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function QX(e,t){const n=uF(!1);let r,o=0,s=0;n.listen(()=>{s++,o=0});const a=v=>h(v),u=$X({data:null,error:null,isPending:!0,isRefetching:!1,refetch:a});UX(u,YX);const c=async(v,w)=>{const S=u.value;if(u.set({...S,isPending:S.data===null,isRefetching:!0,error:null,refetch:a}),v.aborted)return"aborted";try{const C=await e("/get-session",{method:"GET",query:w?.query,signal:v});if(v.aborted)return"aborted";let{data:E,error:A}=jN(C),I="fresh";if(E?.needsRefresh)try{const R=await e("/get-session",{method:"POST",signal:v});if(v.aborted)return"aborted";({data:E,error:A}=jN(R))}catch{if(v.aborted)return"aborted";I="stale"}if(A){const R=u.value,k=A?.status===401;return u.set({data:k?null:R.data,error:A,isPending:!1,isRefetching:!1,refetch:a}),"failed"}const T=ZX(E),N=u.value,M=N.data!=null&&T!=null&&Am(N.data,T)?N.data:T;return u.set({data:M,error:null,isPending:!1,isRefetching:!1,refetch:a}),I}catch(C){if(v.aborted)return"aborted";const E=u.value;return u.set({data:E.data,error:C,isPending:!1,isRefetching:!1,refetch:a}),"failed"}},f=()=>{const v=u.value.data?.session?.expiresAt,w=v instanceof Date?v.getTime():Number.POSITIVE_INFINITY;return Math.min(Date.now()+GX,w)},h=v=>{o=0,r?.cancel();const w=new AbortController,S={cancel:()=>w.abort(),promise:Promise.resolve().then(()=>w.signal.aborted?"aborted":c(w.signal,v)),revision:s};r=S;const C=E=>{r===S&&(r=void 0,E==="fresh"&&S.revision===s&&(o=f()))};return S.promise.then(C,()=>C("failed")),S.promise.then(()=>{})},g=()=>r?.revision===s?r.promise.then(()=>{}):Date.now()<o?Promise.resolve():h();let m=()=>{};return DX(u,()=>{let v;WX()||(v=setTimeout(()=>{g()},0));const w=VX({fetchSession:h,shouldPollSession:()=>u.value.data!=null,sessionSignal:n,options:t});return w.init(),m=w.broadcastSessionUpdate,()=>{v&&clearTimeout(v),w.cleanup()}}),{session:u,$sessionSignal:n,broadcastSessionUpdate:v=>m(v)}}function D1(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function O_(e,t,n=".",r){if(!D1(t))return O_(e,{},n,r);const o={...t};for(const s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;const a=e[s];a!=null&&(r&&r(o,s,a,n)||(Array.isArray(a)&&Array.isArray(o[s])?o[s]=[...a,...o[s]]:D1(a)&&D1(o[s])?o[s]=O_(a,o[s],(n?`${n}.`:"")+s.toString(),r):o[s]=a))}return o}function XX(e){return(...t)=>t.reduce((n,r)=>O_(n,r,"",e),{})}const JX=XX();var eJ=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}};const tJ=async(e,t)=>{let n=t||{};const r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(const h of t?.plugins||[]){var o,s,a,u,c;if(h.init){var f;const g=await((f=h.init)===null||f===void 0?void 0:f.call(h,e.toString(),n));n=g.options||n,e=g.url}r.onRequest.push((o=h.hooks)===null||o===void 0?void 0:o.onRequest),r.onResponse.push((s=h.hooks)===null||s===void 0?void 0:s.onResponse),r.onSuccess.push((a=h.hooks)===null||a===void 0?void 0:a.onSuccess),r.onError.push((u=h.hooks)===null||u===void 0?void 0:u.onError),r.onRetry.push((c=h.hooks)===null||c===void 0?void 0:c.onRetry)}return{url:e,options:n,hooks:r}};var BN=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},nJ=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function rJ(e){if(typeof e=="number")return new BN({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new BN(e);case"exponential":return new nJ(e);default:throw new Error("Invalid retry strategy")}}const oJ=["get","post","put","patch","delete"];function KA(e){if(!e.startsWith("@"))return{method:void 0,path:e};const t=e.indexOf("/"),n=e.slice(1,t===-1?void 0:t);return oJ.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}const sJ=e=>e==="."||e==="..",iJ=e=>e.split(":").map(t=>encodeURIComponent(t)).join(":");function aJ(e,t){const n=t.get(e);if(n===void 0)return iJ(e);if(sJ(n))throw new TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)}function lJ(e,t){const{baseURL:n,params:r,query:o}=t||{query:{},params:{},baseURL:""};let s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";const{path:a}=KA(e);a!==e&&(e=`/${a}`),s.endsWith("/")||(s+="/");let[u,c]=e.replace(s,"").split("?");const f=new URLSearchParams(c);for(const[m,v]of Object.entries(o||{})){if(v==null)continue;let w;if(typeof v=="string")w=v;else if(Array.isArray(v)){for(const S of v)f.append(m,S);continue}else w=JSON.stringify(v);f.set(m,w)}const h=new Map;if(r)if(Array.isArray(r)){const m=u.split("/").filter(v=>v.startsWith(":"));for(const[v,w]of m.entries()){const S=r[v];h.set(w,String(S))}}else for(const[m,v]of Object.entries(r))h.set(`:${m}`,String(v));u=u.split("/").map(m=>aJ(m,h)).join("/"),u=u.replace(/^\/+/,"");let g=f.toString();return g=g.length>0?`?${g}`.replace(/\+/g,"%20"):"",s.startsWith("http")?new URL(`${u}${g}`,s):`${s}${u}${g}`}const uJ=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if(e.auth.type==="Custom"){const[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${r??""} ${o}`}}return t},cJ=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function dJ(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return cJ.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function fJ(e){try{return JSON.parse(e),!0}catch{return!1}}function fF(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function HN(e){try{return JSON.parse(e)}catch{return e}}function qN(e){return typeof e=="function"}function hJ(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&qN(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&qN(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}function hF(...e){const t={};for(const n of e)if(n)if(n instanceof Headers)n.forEach((r,o)=>{t[o]=r});else{const r=Array.isArray(n)?n:Object.entries(n);for(const[o,s]of r)s!=null&&(t[o]=s)}return t}async function pJ(e){const t=new Headers(hF(e?.headers,await uJ(e)));if(!t.has("content-type")){const n=gJ(e?.body);n&&t.set("content-type",n)}return t}function gJ(e){return fF(e)?"application/json":null}function mJ(e){const t=e.get("content-type");return t?t.split(";")[0].trim().toLowerCase():null}function vJ(e,t){const{body:n}=e;return n?!fF(n)||typeof n=="string"?n:mJ(t)==="application/x-www-form-urlencoded"?new URLSearchParams(n).toString():JSON.stringify(n):null}function yJ(e,t){if(t?.method)return t.method.toUpperCase();const{method:n}=KA(e);return n?n.toUpperCase():t?.body?"POST":"GET"}function bJ(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var SJ=class pF extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,pF.prototype)}};async function Hd(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new SJ(n.issues);return n.value}function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}function wJ(e,t){if(yf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e){var t=wJ(e,"string");return yf(t)=="symbol"?t:t+""}function EJ(e,t,n){return(t=CJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VN(Object(n),!0).forEach(function(r){EJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const M_=async(e,t)=>{var n,r,o;const{hooks:s,url:a,options:u}=await tJ(e,t),c=hJ(u),f=new AbortController,h=(n=u.signal)!==null&&n!==void 0?n:f.signal,g=lJ(a,u),m=await pJ(u),v=vJ(u,m),w=yJ(a,u),S=ct(ct({},u),{},{url:g,headers:m,body:v,method:w,signal:h});for(const j of s.onRequest)if(j){const Z=await j(S);typeof Z=="object"&&Z!==null&&Object.assign(S,Z)}("pipeTo"in S&&typeof S.pipeTo=="function"||typeof(t==null||(r=t.body)===null||r===void 0?void 0:r.pipe)=="function")&&("duplex"in S||(S.duplex="half"));const{clearTimeout:C}=bJ(u,f);let E=await c(S.url,S);C();const A={response:E,request:S};for(const j of s.onResponse)if(j){var I;const Z=await j(ct(ct({},A),{},{response:!(t==null||(I=t.hookOptions)===null||I===void 0)&&I.cloneResponse?E.clone():E}));Z instanceof Response?E=Z:typeof Z=="object"&&Z!==null&&(E=Z.response)}if(E.ok){if(S.method==="HEAD")return{data:"",error:null};const j=dJ(E),Z={data:null,response:E,request:S};if(j==="json"||j==="text"){var T;const he=await E.text();Z.data=await((T=S.jsonParser)!==null&&T!==void 0?T:HN)(he)}else Z.data=await E[j]();S?.output&&S.output&&!S.disableValidation&&(Z.data=await Hd(S.output,Z.data));for(const he of s.onSuccess)if(he){var N;await he(ct(ct({},Z),{},{response:!(t==null||(N=t.hookOptions)===null||N===void 0)&&N.cloneResponse?E.clone():E}))}return t?.throw?Z.data:{data:Z.data,error:null}}const M=(o=t?.jsonParser)!==null&&o!==void 0?o:HN,R=await E.text(),k=fJ(R),L=k?await M(R):null,q={response:E,responseText:R,request:S,error:ct(ct({},L),{},{status:E.status,statusText:E.statusText})};for(const j of s.onError)if(j){var F;await j(ct(ct({},q),{},{response:!(t==null||(F=t.hookOptions)===null||F===void 0)&&F.cloneResponse?E.clone():E}))}if(t?.retry){var D;const j=rJ(t.retry),Z=(D=t.retryAttempt)!==null&&D!==void 0?D:0;if(await j.shouldAttemptRetry(Z,E)){for(const B of s.onRetry)B&&await B(A);const he=j.getDelay(Z);return await new Promise(B=>setTimeout(B,he)),await M_(e,ct(ct({},t),{},{retryAttempt:Z+1}))}}if(t?.throw)throw new eJ(E.status,E.statusText,k?L:R);return{data:null,error:ct(ct({},L),{},{status:E.status,statusText:E.statusText})}},_J=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r;let o=ct(ct({},n),e.query!==void 0&&{query:ct(ct({},e.query),n?.query)});const s=((r=e.plugins)===null||r===void 0||(r=r.find(f=>{var h;return!((h=f.schema)===null||h===void 0)&&h.config?t.startsWith(f.schema.config.baseURL||"")||t.startsWith(f.schema.config.prefix||""):!1}))===null||r===void 0?void 0:r.schema)||e.schema;if(s){var a,u;let f=t;!((a=s.config)===null||a===void 0)&&a.prefix&&f.startsWith(s.config.prefix)&&(f=f.replace(s.config.prefix,""),s.config.baseURL&&(t=t.replace(s.config.prefix,s.config.baseURL))),!((u=s.config)===null||u===void 0)&&u.baseURL&&f.startsWith(s.config.baseURL)&&(f=f.replace(s.config.baseURL,"")),f.startsWith("/")&&f.charAt(1)==="@"&&(f=f.substring(1));const h=s.schema[f];if(h){var c;const{method:g,path:m}=KA(f);g&&(t=t.slice(0,t.length-f.length)+m);let v=n?.headers;if(h.headers&&!n?.disableValidation){const S={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((A,I)=>{S[I.toLowerCase()]=A});else if(typeof n.headers=="object")for(const[A,I]of Object.entries(n.headers))I!=null&&(S[A.toLowerCase()]=I)}const C=await Hd(h.headers,S),E={};for(const[A,I]of Object.entries(C))E[A.toLowerCase()]=I;v=E}const w=(c=h.method)!==null&&c!==void 0?c:g;if(o=ct(ct(ct(ct({},o),w!==void 0&&{method:w}),h.output!==void 0&&{output:h.output}),v!==void 0&&{headers:v}),!n?.disableValidation){if(h.query&&(o.query=await Hd(h.query,n?.query),o.query!==null&&typeof o.query=="object")){const S=ct({},e.query);for(const C of Object.keys(S))n?.query&&Object.prototype.hasOwnProperty.call(n.query,C)&&(S[C]=n.query[C]);o.query=ct(ct({},S),o.query)}o=ct(ct({},o),{},{body:h.input?await Hd(h.input,n?.body):n?.body,params:h.params?await Hd(h.params,n?.params):n?.params})}return{url:t,options:o}}}return ct({url:t},(n!==void 0||e.query!==void 0)&&{options:o})}}),xJ=e=>{async function t(n,r){const o=ct(ct(ct({},e),r),{},{headers:hF(e?.headers,r?.headers),plugins:[...e?.plugins||[],_J(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await M_(n,o)}catch(s){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:s}}}return await M_(n,o)}return t};var Sa={};const AJ=e=>{if(typeof process>"u")return;const t="/api/auth";if(Sa.NEXT_PUBLIC_AUTH_URL)return Sa.NEXT_PUBLIC_AUTH_URL;if(typeof window>"u"){if(Sa.NEXTAUTH_URL)try{return Sa.NEXTAUTH_URL}catch{}if(Sa.VERCEL_URL)try{const n=Sa.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${n}${Sa.VERCEL_URL}`).origin}${t}`}catch{}}},IJ=e=>e==="/sign-out"||e==="/update-user"||e==="/update-session"||e==="/sign-up/email"||e==="/sign-in/email"||e==="/delete-user"||e==="/verify-email"||e==="/revoke-sessions"||e==="/revoke-session"||e==="/revoke-other-sessions"||e==="/change-email"||e==="/change-password",RJ=(e,t)=>{const n="credentials"in Request.prototype,r=bX(e?.baseURL,e?.basePath)??AJ()??"/api/auth",o=[],s={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:a,onError:u,onRequest:c,onResponse:f,...h}={},g=xJ({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(R){return R?AX(R,{strict:!1}):null},customFetchImpl:fetch,...h,plugins:[s,...h.plugins||[],TX,...o]}),{$sessionSignal:m,session:v,broadcastSessionUpdate:w}=QX(g,e);let S=!1;const C=R=>{S||R===null||(S=!0,KX(v,R))},E=[];let A={};const I={$sessionSignal:m,session:v},T={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},N=[{signal:"$sessionSignal",matcher:IJ,callback(R){R==="/sign-out"?w("signout"):(R==="/update-user"||R==="/update-session")&&w("updateUser")}}];for(const R of E)R.getAtoms&&Object.assign(I,R.getAtoms?.(g)),R.pathMethods&&Object.assign(T,R.pathMethods),R.atomListeners&&N.push(...R.atomListeners);const M={notify:R=>{I[R].set(!I[R].get())},listen:(R,k)=>{I[R].subscribe(k)},atoms:I};for(const R of E)R.getActions&&(A=JX(R.getActions?.(g,M,e)??{},A));return{get baseURL(){return r},pluginsActions:A,pluginsAtoms:I,pluginPathMethods:T,atomListeners:N,hydrateSession:C,$sessionSignal:m,$fetch:g,$store:M}};function TJ(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function OJ(e){return e.charAt(0).toUpperCase()+e.slice(1)}const MJ=new RegExp("[\\p{Ll}\\d]+|\\p{Lu}+(?!\\p{Ll})|\\p{Lu}[\\p{Ll}\\d]+|\\p{Lo}+","gu"),PJ=/['\u2019]/g;function NJ(e){return e.replace(PJ,"").match(MJ)??[]}function kJ(e){return NJ(e).map(t=>t.toLowerCase()).join("-")}function DJ(e,t,n){const r=t[e],{fetchOptions:o,query:s,...a}=n||{};return r||(o?.method?o.method:a&&Object.keys(a).length>0?"POST":"GET")}function LJ(e,t,n,r,o){function s(a=[]){return new Proxy(function(){},{get(u,c){if(typeof c!="string"||c==="then"||c==="catch"||c==="finally")return;const f=[...a,c];let h=e;for(const g of f)if(h&&typeof h=="object"&&g in h)h=h[g];else{h=void 0;break}return typeof h=="function"||TJ(h)?h:s(f)},apply:async(u,c,f)=>{const h="/"+a.map(kJ).join("/"),g=f[0]||{},m=f[1]||{},{query:v,fetchOptions:w,...S}=g,C={...m,...w},E=DJ(h,n,g);return await t(h,{...C,body:E==="GET"?void 0:{...S,...C?.body||{}},query:v||C?.query,method:E,async onSuccess(A){if(await C?.onSuccess?.(A),!o||C.disableSignal)return;const I=o.filter(N=>N.matcher(h));if(!I.length)return;const T=new Set;for(const N of I){const M=r[N.signal];if(!M)return;if(T.has(N.signal))continue;T.add(N.signal);const R=M.get();setTimeout(()=>{M.set(!R)},10),N.callback?.(h)}}})}})}return s()}var L1={exports:{}},Le={};var WN;function UJ(){if(WN)return Le;WN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),m=Symbol.iterator;function v(U){return U===null||typeof U!="object"?null:(U=m&&U[m]||U["@@iterator"],typeof U=="function"?U:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(U,X,ie){this.props=U,this.context=X,this.refs=C,this.updater=ie||w}E.prototype.isReactComponent={},E.prototype.setState=function(U,X){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,X,"setState")},E.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function A(){}A.prototype=E.prototype;function I(U,X,ie){this.props=U,this.context=X,this.refs=C,this.updater=ie||w}var T=I.prototype=new A;T.constructor=I,S(T,E.prototype),T.isPureReactComponent=!0;var N=Array.isArray;function M(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function L(U,X,ie){var oe=ie.ref;return{$$typeof:e,type:U,key:X,ref:oe!==void 0?oe:null,props:ie}}function q(U,X){return L(U.type,X,U.props)}function F(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function D(U){var X={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(ie){return X[ie]})}var j=/\/+/g;function Z(U,X){return typeof U=="object"&&U!==null&&U.key!=null?D(""+U.key):X.toString(36)}function he(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(X){U.status==="pending"&&(U.status="fulfilled",U.value=X)},function(X){U.status==="pending"&&(U.status="rejected",U.reason=X)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function B(U,X,ie,oe,fe){var Me=typeof U;(Me==="undefined"||Me==="boolean")&&(U=null);var xe=!1;if(U===null)xe=!0;else switch(Me){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(U.$$typeof){case e:case t:xe=!0;break;case h:return xe=U._init,B(xe(U._payload),X,ie,oe,fe)}}if(xe)return fe=fe(U),xe=oe===""?"."+Z(U,0):oe,N(fe)?(ie="",xe!=null&&(ie=xe.replace(j,"$&/")+"/"),B(fe,X,ie,"",function(Ze){return Ze})):fe!=null&&(F(fe)&&(fe=q(fe,ie+(fe.key==null||U&&U.key===fe.key?"":(""+fe.key).replace(j,"$&/")+"/")+xe)),X.push(fe)),1;xe=0;var se=oe===""?".":oe+":";if(N(U))for(var Se=0;Se<U.length;Se++)oe=U[Se],Me=se+Z(oe,Se),xe+=B(oe,X,ie,Me,fe);else if(Se=v(U),typeof Se=="function")for(U=Se.call(U),Se=0;!(oe=U.next()).done;)oe=oe.value,Me=se+Z(oe,Se++),xe+=B(oe,X,ie,Me,fe);else if(Me==="object"){if(typeof U.then=="function")return B(he(U),X,ie,oe,fe);throw X=String(U),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return xe}function Q(U,X,ie){if(U==null)return U;var oe=[],fe=0;return B(U,oe,"","",function(Me){return X.call(ie,Me,fe++)}),oe}function ae(U){if(U._status===-1){var X=U._result;X=X(),X.then(function(ie){(U._status===0||U._status===-1)&&(U._status=1,U._result=ie)},function(ie){(U._status===0||U._status===-1)&&(U._status=2,U._result=ie)}),U._status===-1&&(U._status=0,U._result=X)}if(U._status===1)return U._result.default;throw U._result}var ue=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},we={map:Q,forEach:function(U,X,ie){Q(U,function(){X.apply(this,arguments)},ie)},count:function(U){var X=0;return Q(U,function(){X++}),X},toArray:function(U){return Q(U,function(X){return X})||[]},only:function(U){if(!F(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Le.Activity=g,Le.Children=we,Le.Component=E,Le.Fragment=n,Le.Profiler=o,Le.PureComponent=I,Le.StrictMode=r,Le.Suspense=c,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Le.__COMPILER_RUNTIME={__proto__:null,c:function(U){return R.H.useMemoCache(U)}},Le.cache=function(U){return function(){return U.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(U,X,ie){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var oe=S({},U.props),fe=U.key;if(X!=null)for(Me in X.key!==void 0&&(fe=""+X.key),X)!k.call(X,Me)||Me==="key"||Me==="__self"||Me==="__source"||Me==="ref"&&X.ref===void 0||(oe[Me]=X[Me]);var Me=arguments.length-2;if(Me===1)oe.children=ie;else if(1<Me){for(var xe=Array(Me),se=0;se<Me;se++)xe[se]=arguments[se+2];oe.children=xe}return L(U.type,fe,oe)},Le.createContext=function(U){return U={$$typeof:a,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:s,_context:U},U},Le.createElement=function(U,X,ie){var oe,fe={},Me=null;if(X!=null)for(oe in X.key!==void 0&&(Me=""+X.key),X)k.call(X,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(fe[oe]=X[oe]);var xe=arguments.length-2;if(xe===1)fe.children=ie;else if(1<xe){for(var se=Array(xe),Se=0;Se<xe;Se++)se[Se]=arguments[Se+2];fe.children=se}if(U&&U.defaultProps)for(oe in xe=U.defaultProps,xe)fe[oe]===void 0&&(fe[oe]=xe[oe]);return L(U,Me,fe)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(U){return{$$typeof:u,render:U}},Le.isValidElement=F,Le.lazy=function(U){return{$$typeof:h,_payload:{_status:-1,_result:U},_init:ae}},Le.memo=function(U,X){return{$$typeof:f,type:U,compare:X===void 0?null:X}},Le.startTransition=function(U){var X=R.T,ie={};R.T=ie;try{var oe=U(),fe=R.S;fe!==null&&fe(ie,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(M,ue)}catch(Me){ue(Me)}finally{X!==null&&ie.types!==null&&(X.types=ie.types),R.T=X}},Le.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Le.use=function(U){return R.H.use(U)},Le.useActionState=function(U,X,ie){return R.H.useActionState(U,X,ie)},Le.useCallback=function(U,X){return R.H.useCallback(U,X)},Le.useContext=function(U){return R.H.useContext(U)},Le.useDebugValue=function(){},Le.useDeferredValue=function(U,X){return R.H.useDeferredValue(U,X)},Le.useEffect=function(U,X){return R.H.useEffect(U,X)},Le.useEffectEvent=function(U){return R.H.useEffectEvent(U)},Le.useId=function(){return R.H.useId()},Le.useImperativeHandle=function(U,X,ie){return R.H.useImperativeHandle(U,X,ie)},Le.useInsertionEffect=function(U,X){return R.H.useInsertionEffect(U,X)},Le.useLayoutEffect=function(U,X){return R.H.useLayoutEffect(U,X)},Le.useMemo=function(U,X){return R.H.useMemo(U,X)},Le.useOptimistic=function(U,X){return R.H.useOptimistic(U,X)},Le.useReducer=function(U,X,ie){return R.H.useReducer(U,X,ie)},Le.useRef=function(U){return R.H.useRef(U)},Le.useState=function(U){return R.H.useState(U)},Le.useSyncExternalStore=function(U,X,ie){return R.H.useSyncExternalStore(U,X,ie)},Le.useTransition=function(){return R.H.useTransition()},Le.version="19.2.7",Le}var GN;function rh(){return GN||(GN=1,L1.exports=UJ()),L1.exports}var _=rh();const $=sc(_),FJ=e8({__proto__:null,default:$},[_]);function $J(e,t={}){const n=_.useRef(e.get()),{keys:r,deps:o=[e,r]}=t,s=_.useCallback(u=>{const c=f=>{n.current!==f&&(n.current=f,u())};return c(e.value),r?.length?LX(e,r,c):e.listen(c)},o),a=()=>n.current;return _.useSyncExternalStore(s,a,FX(e)?()=>e.init:a)}function zJ(e){return`use${OJ(e)}`}function jJ(e){const{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:o,$fetch:s,$store:a,atomListeners:u}=RJ(e),c={};for(const[f,h]of Object.entries(r))c[zJ(f)]=()=>$J(h);return LJ({...n,...c,hydrateSession:o,$fetch:s,$store:a},s,t,r,u)}const BJ=10,Mu=[],HJ=["x-correlation-id","x-request-id","x-amzn-requestid","x-amzn-trace-id","apigw-requestid","x-trace-id"];function qJ(e){const t=typeof e=="string"?e:e instanceof URL?e.href:e.url;try{return new URL(t,window.location.origin).pathname}catch{return t.split(/[?#]/)[0]}}function VJ(e,t){return t?.method?t.method.toUpperCase():typeof e!="string"&&!(e instanceof URL)&&e.method?e.method.toUpperCase():"GET"}function WJ(e){for(const t of HJ){const n=e.headers.get(t);if(n)return n}}function GJ(e){Mu.push(e),Mu.length>BJ&&Mu.shift()}function KN(e){const{input:t,init:n,response:r,durationMs:o}=e;GJ({method:VJ(t,n),path:qJ(t),status:r?.status??0,durationMs:Math.round(o),correlationId:r?WJ(r):void 0,timestamp:new Date().toISOString()})}function KJ(){return Mu.slice()}function ZJ(){for(let e=Mu.length-1;e>=0;e--){const t=Mu[e];if(t.status===0||t.status>=400)return t}}class ZA extends Error{constructor(t){super(t instanceof Error&&t.message?t.message:"The request could not be completed.",{cause:t}),this.name="NetworkError"}}const YJ=e=>typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError",gF=async(e,t)=>{const n=performance.now();try{const r=await fetch(e,{...t,redirect:"manual"}),o=r.type==="opaqueredirect"?new Response(null,{status:401}):r;return KN({input:e,init:t,response:o,durationMs:performance.now()-n}),o}catch(r){throw YJ(r)?r:(KN({input:e,init:t,durationMs:performance.now()-n}),new ZA(r))}},YA=()=>{try{return globalThis.sessionStorage??null}catch{return null}},Hv=()=>pc().betterAuthEnabled,QJ="EMAIL_PASSWORD_SIGN_UP_DISABLED",XJ=e=>typeof e=="object"&&e!==null&&e.code===QJ,qa=jJ(),JJ=60,eee=30,P_="remit.better-auth.token",tee=()=>{const e=YA()?.getItem(P_);if(!e)return null;try{const t=JSON.parse(e);if(t&&typeof t=="object"&&typeof t.value=="string"&&typeof t.expiresAt=="number")return{value:t.value,expiresAt:t.expiresAt}}catch{}return null},mF=e=>{const t=YA();if(t)try{if(!e){t.removeItem(P_);return}t.setItem(P_,JSON.stringify(e))}catch{}};let xa=null,Im=0;const nee=()=>xa||(xa=tee(),xa),Ma=()=>Math.floor(Date.now()/1e3),ree=e=>{const[,t]=e.split(".");if(!t)return Ma();try{const n=JSON.parse(atob(t.replace(/-/g,"+").replace(/_/g,"/")));return typeof n.exp=="number"?n.exp:Ma()}catch{return Ma()}};class Rm extends Error{status;constructor(t,n){super(t),this.name="AuthTokenError",this.status=n}}const oee=async()=>{const e=await gF("/api/auth/token",{credentials:"include"});if(!e.ok)throw new Rm(`Could not mint a session token: ${e.status} ${e.statusText}`,e.status);const t=await e.json();if(t&&typeof t=="object"&&"token"in t&&typeof t.token=="string")return t.token;throw new Rm("The token endpoint returned no token")};let wd=null;const see=()=>wd||(wd=oee().then(e=>(xa={value:e,expiresAt:ree(e)},mF(xa),Im=0,e)).finally(()=>{wd=null}),wd),iee=e=>e.expiresAt-JJ>Ma(),ZN=e=>e.expiresAt>Ma(),aee=e=>e instanceof ZA?!0:e instanceof Rm?e.status===408||e.status===429||(e.status??0)>=500:!1,lee=e=>e instanceof Rm&&(e.status===401||e.status===403),uee=async()=>{const e=nee();if(e&&iee(e)||e&&ZN(e)&&Ma()<Im)return e.value;try{return await see()}catch(t){if(lee(t))throw QA(),t.status===403&&qa.$store.notify("$sessionSignal"),t;if(e&&ZN(e)&&aee(t))return Im=Ma()+eee,e.value;throw t}},QA=()=>{Im=0,mF(null),xa=null};function vF(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=vF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function cee(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=vF(e))&&(r&&(r+=" "),r+=t);return r}var U1={exports:{}},$n={};var YN;function dee(){if(YN)return $n;YN=1;var e=rh();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(c,f,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:c,containerInfo:f,implementation:h}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$n.createPortal=function(c,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(c,f,null,h)},$n.flushSync=function(c){var f=a.T,h=r.p;try{if(a.T=null,r.p=2,c)return c()}finally{a.T=f,r.p=h,r.d.f()}},$n.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},$n.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},$n.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var h=f.as,g=u(h,f.crossOrigin),m=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:m,fetchPriority:v}):h==="script"&&r.d.X(c,{crossOrigin:g,integrity:m,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},$n.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=u(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},$n.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,g=u(h,f.crossOrigin);r.d.L(c,h,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},$n.preloadModule=function(c,f){if(typeof c=="string")if(f){var h=u(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},$n.requestFormReset=function(c){r.d.r(c)},$n.unstable_batchedUpdates=function(c,f){return c(f)},$n.useFormState=function(c,f,h){return a.H.useFormState(c,f,h)},$n.useFormStatus=function(){return a.H.useHostTransitionStatus()},$n.version="19.2.7",$n}var QN;function yF(){if(QN)return U1.exports;QN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),U1.exports=dee(),U1.exports}var fee=yF(),F1={exports:{}},$1={};var XN;function hee(){if(XN)return $1;XN=1;var e=rh();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function u(g,m){var v=m(),w=r({inst:{value:v,getSnapshot:m}}),S=w[0].inst,C=w[1];return s(function(){S.value=v,S.getSnapshot=m,c(S)&&C({inst:S})},[g,v,m]),o(function(){return c(S)&&C({inst:S}),g(function(){c(S)&&C({inst:S})})},[g]),a(v),v}function c(g){var m=g.getSnapshot;g=g.value;try{var v=m();return!n(g,v)}catch{return!0}}function f(g,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return $1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,$1}var JN;function pee(){return JN||(JN=1,F1.exports=hee()),F1.exports}const gee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bF=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var mee={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const vee=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...u},c)=>_.createElement("svg",{ref:c,...mee,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:bF("lucide",o),...u},[...a.map(([f,h])=>_.createElement(f,h)),...Array.isArray(s)?s:[s]]));const yt=(e,t)=>{const n=_.forwardRef(({className:r,...o},s)=>_.createElement(vee,{ref:s,iconNode:t,className:bF(`lucide-${gee(e)}`,r),...o}));return n.displayName=`${e}`,n};const yee=yt("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const bee=yt("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);const SF=yt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const See=yt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const wF=yt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const wee=yt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const Cee=yt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Eee=yt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const _ee=yt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const xee=yt("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const Aee=yt("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);const Iee=yt("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const CF=yt("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);const Ree=yt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const EF=yt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const ek=yt("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);const Tee=yt("Mails",[["rect",{width:"16",height:"13",x:"6",y:"4",rx:"2",key:"1drq3f"}],["path",{d:"m22 7-7.1 3.78c-.57.3-1.23.3-1.8 0L6 7",key:"xn252p"}],["path",{d:"M2 8v11c0 1.1.9 2 2 2h14",key:"n13cji"}]]);const XA=yt("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Oee=yt("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);const Mee=yt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const Pee=yt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Nee=yt("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const kee=yt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);const Dee=yt("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const Lee=yt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const JA=yt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Uee=yt("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);const Fee=yt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const $ee=yt("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const N_=yt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),eI="-",zee=e=>{const t=Bee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const u=a.split(eI);return u[0]===""&&u.length!==1&&u.shift(),_F(u,t)||jee(a)},getConflictingClassGroupIds:(a,u)=>{const c=n[a]||[];return u&&r[a]?[...c,...r[a]]:c}}},_F=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?_F(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(eI);return t.validators.find(({validator:a})=>a(s))?.classGroupId},tk=/^\[(.+)\]$/,jee=e=>{if(tk.test(e)){const t=tk.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Bee=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return qee(Object.entries(e.classGroups),n).forEach(([s,a])=>{k_(a,r,s,t)}),r},k_=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:nk(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Hee(o)){k_(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,a])=>{k_(a,nk(t,s),n,r)})})},nk=(e,t)=>{let n=e;return t.split(eI).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Hee=e=>e.isThemeGetter,qee=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,u])=>[t+a,u])):s);return[n,o]}):e,Vee=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return o(s,a),a},set(s,a){n.has(s)?n.set(s,a):o(s,a)}}},xF="!",Wee=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,a=u=>{const c=[];let f=0,h=0,g;for(let C=0;C<u.length;C++){let E=u[C];if(f===0){if(E===o&&(r||u.slice(C,C+s)===t)){c.push(u.slice(h,C)),h=C+s;continue}if(E==="/"){g=C;continue}}E==="["?f++:E==="]"&&f--}const m=c.length===0?u:u.substring(h),v=m.startsWith(xF),w=v?m.substring(1):m,S=g&&g>h?g-h:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}};return n?u=>n({className:u,parseClassName:a}):a},Gee=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Kee=e=>({cache:Vee(e.cacheSize),parseClassName:Wee(e),...zee(e)}),Zee=/\s+/,Yee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],a=e.trim().split(Zee);let u="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{modifiers:h,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:v}=n(f);let w=!!v,S=r(w?m.substring(0,v):m);if(!S){if(!w){u=f+(u.length>0?" "+u:u);continue}if(S=r(m),!S){u=f+(u.length>0?" "+u:u);continue}w=!1}const C=Gee(h).join(":"),E=g?C+xF:C,A=E+S;if(s.includes(A))continue;s.push(A);const I=o(S,w);for(let T=0;T<I.length;++T){const N=I[T];s.push(E+N)}u=f+(u.length>0?" "+u:u)}return u};function Qee(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=AF(t))&&(r&&(r+=" "),r+=n);return r}const AF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=AF(e[r]))&&(n&&(n+=" "),n+=t);return n};function Xee(e,...t){let n,r,o,s=a;function a(c){const f=t.reduce((h,g)=>g(h),e());return n=Kee(f),r=n.cache.get,o=n.cache.set,s=u,u(c)}function u(c){const f=r(c);if(f)return f;const h=Yee(c,n);return o(c,h),h}return function(){return s(Qee.apply(null,arguments))}}const Lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},IF=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jee=/^\d+\/\d+$/,ete=new Set(["px","full","screen"]),tte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nte=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ote=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ste=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ms=e=>Pu(e)||ete.has(e)||Jee.test(e),bi=e=>gc(e,"length",hte),Pu=e=>!!e&&!Number.isNaN(Number(e)),z1=e=>gc(e,"number",Pu),Cd=e=>!!e&&Number.isInteger(Number(e)),ite=e=>e.endsWith("%")&&Pu(e.slice(0,-1)),je=e=>IF.test(e),Si=e=>tte.test(e),ate=new Set(["length","size","percentage"]),lte=e=>gc(e,ate,RF),ute=e=>gc(e,"position",RF),cte=new Set(["image","url"]),dte=e=>gc(e,cte,gte),fte=e=>gc(e,"",pte),Ed=()=>!0,gc=(e,t,n)=>{const r=IF.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},hte=e=>nte.test(e)&&!rte.test(e),RF=()=>!1,pte=e=>ote.test(e),gte=e=>ste.test(e),mte=()=>{const e=Lt("colors"),t=Lt("spacing"),n=Lt("blur"),r=Lt("brightness"),o=Lt("borderColor"),s=Lt("borderRadius"),a=Lt("borderSpacing"),u=Lt("borderWidth"),c=Lt("contrast"),f=Lt("grayscale"),h=Lt("hueRotate"),g=Lt("invert"),m=Lt("gap"),v=Lt("gradientColorStops"),w=Lt("gradientColorStopPositions"),S=Lt("inset"),C=Lt("margin"),E=Lt("opacity"),A=Lt("padding"),I=Lt("saturate"),T=Lt("scale"),N=Lt("sepia"),M=Lt("skew"),R=Lt("space"),k=Lt("translate"),L=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",je,t],D=()=>[je,t],j=()=>["",ms,bi],Z=()=>["auto",Pu,je],he=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],ue=()=>["","0",je],we=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[Pu,je];return{cacheSize:500,separator:":",theme:{colors:[Ed],spacing:[ms,bi],blur:["none","",Si,je],brightness:U(),borderColor:[e],borderRadius:["none","","full",Si,je],borderSpacing:D(),borderWidth:j(),contrast:U(),grayscale:ue(),hueRotate:U(),invert:ue(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[ite,bi],inset:F(),margin:F(),opacity:U(),padding:D(),saturate:U(),scale:U(),sepia:ue(),skew:U(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",je]}],container:["container"],columns:[{columns:[Si]}],"break-after":[{"break-after":we()}],"break-before":[{"break-before":we()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...he(),je]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Cd,je]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",je]}],grow:[{grow:ue()}],shrink:[{shrink:ue()}],order:[{order:["first","last","none",Cd,je]}],"grid-cols":[{"grid-cols":[Ed]}],"col-start-end":[{col:["auto",{span:["full",Cd,je]},je]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[Ed]}],"row-start-end":[{row:["auto",{span:[Cd,je]},je]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",je]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",je,t]}],"min-w":[{"min-w":[je,t,"min","max","fit"]}],"max-w":[{"max-w":[je,t,"none","full","min","max","fit","prose",{screen:[Si]},Si]}],h:[{h:[je,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[je,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[je,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[je,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Si,bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",z1]}],"font-family":[{font:[Ed]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",je]}],"line-clamp":[{"line-clamp":["none",Pu,z1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ms,je]}],"list-image":[{"list-image":["none",je]}],"list-style-type":[{list:["none","disc","decimal",je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ms,bi]}],"underline-offset":[{"underline-offset":["auto",ms,je]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...he(),ute]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lte]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dte]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:B()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[ms,je]}],"outline-w":[{outline:[ms,bi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[ms,bi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Si,fte]}],"shadow-color":[{shadow:[Ed]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Si,je]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[I]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",je]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",je]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Cd,je]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",je]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ms,bi,z1]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},vte=Xee(mte);function rn(...e){return vte(cee(e))}const _d={action:null,nextPrefix:null,preventDefault:!1},yte={b:"goBrief",i:"goInbox",s:"goSent",f:"goFlagged",",":"goSettings"},bte={j:{action:"focusNext"},k:{action:"focusPrevious"},arrowdown:{action:"focusNext"},arrowup:{action:"focusPrevious"},home:{action:"focusFirst"},end:{action:"focusLast"},enter:{action:"openFocused"}," ":{action:"toggleSelect"},delete:{action:"delete"},backspace:{action:"delete"},u:{action:"toggleRead"},x:{action:"toggleSelect"},r:{action:"reply"},a:{action:"replyAll"},f:{action:"forward"},"#":{action:"delete"},s:{action:"toggleStar"},m:{action:"muteSender"},b:{action:"blockSender"},v:{action:"vipSender"},"!":{action:"markJunk"},i:{action:"toggleIntelligence"},d:{action:"toggleDensity"},"/":{action:"focusSearch"},c:{action:"compose"},"?":{action:"help"}};function Ste(e,t){const n=e.key.toLowerCase(),r=e.metaKey||e.ctrlKey;if(e.inEditable)return{..._d,nextPrefix:t==="g"?null:t};if(e.onControl&&(n==="enter"||n===" "))return{..._d,nextPrefix:t==="g"?null:t};if(r&&n==="n")return{action:"compose",nextPrefix:null,preventDefault:!0};if(r&&n==="a")return{action:"selectAll",nextPrefix:null,preventDefault:!0};if(r)return{..._d,nextPrefix:t==="g"?null:t};if(n==="escape")return{action:"back",nextPrefix:null,preventDefault:!1};if(t==="g"){const a=yte[n===","?",":n]??null;return{action:a,nextPrefix:null,preventDefault:a!==null}}if(n==="g"&&!e.shiftKey)return{action:null,nextPrefix:"g",preventDefault:!0};if(e.shiftKey){const s=n==="j"||n==="arrowdown";if(s||(n==="k"||n==="arrowup"))return{action:s?"extendSelectDown":"extendSelectUp",nextPrefix:null,preventDefault:!0}}const o=bte[n];if(o){const s=o.requireShift===!0,a=n.length===1&&!/[a-z0-9]/.test(n);return!s&&e.shiftKey&&!a?_d:{action:o.action,nextPrefix:null,preventDefault:!0}}return _d}function wte(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}const Cte="data-message-row",Ete='button, a[href], summary, [role="button"], [role="menuitem"], [role="tab"], [role="switch"], [role="checkbox"]';function _te(e){if(!(e instanceof HTMLElement))return!1;const t=e.closest(Ete);return t?!t.hasAttribute(Cte):!1}const xte=["reply","replyAll","forward","delete","toggleStar","toggleRead","muteSender","blockSender","vipSender","markJunk"],Ate=["focusNext","focusPrevious","focusFirst","focusLast","openFocused","toggleSelect","extendSelectDown","extendSelectUp","selectAll","toggleDensity"],Cn=(e,...t)=>({action:e,requires:t});Cn("help"),Cn("goBrief",{listIsNot:"brief"}),Cn("goFlagged",{listIsNot:"flagged"}),Cn("goInbox",{listIsNot:"inbox"}),Cn("goSent",{listIsNot:"sent"}),Cn("goSettings"),Cn("compose"),Cn("focusSearch"),Cn("toggleIntelligence"),[...Ate.map(e=>Cn(e,"listVisible")),...xte.map(e=>Cn(e,"aimed")),Cn("back","selection")],Cn("focusNext","threadOpen",{not:"listVisible"}),Cn("focusPrevious","threadOpen",{not:"listVisible"}),Cn("reply","threadOpen"),Cn("replyAll","threadOpen"),Cn("forward","threadOpen"),Cn("back");function Ite(e,t){const n=t.at(-1);return n?n.handles.includes(e)?{outcome:"act",target:{kind:"overlay",frame:n}}:{outcome:"contained",by:{kind:"overlay",frame:n}}:null}const Rte="[data-escape-owner]";let zu=[],Tte=0;const Ote=()=>++Tte;function TF(){const[e]=_.useState(Ote);return e}const Mte=(e,t)=>e.depth-t.depth;function Pte(){return[...zu].sort(Mte).map(e=>({id:e.id,handles:Object.entries(e.run()).filter(([,t])=>t).map(([t])=>t)}))}function Nte(){let e;for(const t of zu)(!e||t.depth>e.depth)&&(e=t);return e}function gUe(e){return Ite(e,Pte())}function kte(e){if(e.key==="Escape"){const t=document.activeElement;return t instanceof Element&&t.closest(Rte)?null:"back"}return Ste({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,inEditable:wte(e.target),onControl:_te(e.target)},null).action}function rk(e){const t=Nte();if(!t)return;const n=kte(e);if(!n)return;const r=t.run()[n];r&&(e.preventDefault(),e.stopImmediatePropagation(),r())}function ok(e){const t=zu.length===0;if(zu=e,t!==(e.length===0)){if(e.length>0){window.addEventListener("keydown",rk,!0);return}window.removeEventListener("keydown",rk,!0)}}function qv({id:e,open:t,answers:n={}}){const r=_.useRef(n);r.current=n;const o=TF();_.useEffect(()=>{if(!t)return;const s={id:e,depth:o,run:()=>r.current};return ok([...zu,s]),()=>{ok(zu.filter(a=>a!==s))}},[e,t,o])}const OF="inline-flex items-center justify-center gap-2 rounded-md font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface disabled:opacity-50 disabled:pointer-events-none",MF={primary:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface text-fg border border-line hover:bg-surface-sunken hover:border-line-strong",ghost:"text-fg-muted hover:bg-surface-sunken hover:text-fg",danger:"bg-danger text-accent-fg hover:opacity-90"},PF={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3.5 text-sm",touch:"h-11 w-11 text-sm"};function Xr({variant:e="primary",size:t="md",icon:n,className:r,children:o,ref:s,...a}){return O.jsxs("button",{type:"button",ref:s,className:rn(OF,MF[e],PF[t],r),...a,children:[n,o]})}function mUe({variant:e="primary",size:t="md",icon:n,external:r,className:o,children:s,...a}){return O.jsxs("a",{className:rn(OF,MF[e],PF[t],o),...r?{target:"_blank",rel:"noopener noreferrer"}:{},...a,children:[n,s]})}const Dte='a[href], button, input, select, textarea, iframe, [tabindex], [contenteditable]:not([contenteditable="false"])';function Lte(e){if(Number(e.getAttribute("tabindex")??0)<0||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"||e.closest("[inert], [hidden], [aria-hidden='true']"))return!1;const t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function sk(e){const t=e.querySelectorAll('[role="dialog"][aria-modal="true"]');return[...(t[t.length-1]??e).querySelectorAll(Dte)].filter(Lte)}const D_=new Set;function Ute(e){for(const t of D_)if(t>e)return!1;return!0}function Fte(e,t){return!(t instanceof HTMLElement)||t===document.body||t===document.documentElement?!1:!e.contains(t)}function Vv(e,t){const n=TF();_.useEffect(()=>{if(t)return D_.add(n),()=>{D_.delete(n)}},[t,n]),_.useEffect(()=>{if(!t)return;const r=document.activeElement instanceof HTMLElement?document.activeElement:null,o=e.current;return o&&(sk(o)[0]??o).focus(),()=>{r?.isConnected&&r.focus()}},[t,e]),_.useEffect(()=>{if(!t)return;const r=o=>{if(o.key!=="Tab"||o.defaultPrevented||!Ute(n))return;const s=e.current;if(!s)return;const a=document.activeElement;if(Fte(s,a))return;const u=sk(s),c=u[0],f=u.at(-1);if(!c||!f){o.preventDefault(),s.focus();return}const h=a instanceof HTMLElement&&u.includes(a);if(o.shiftKey){(!h||a===c)&&(o.preventDefault(),f.focus());return}(!h||a===f)&&(o.preventDefault(),c.focus())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,e,n])}const $te=({label:e,onDismiss:t,className:n})=>O.jsx("button",{type:"button","aria-label":e,tabIndex:-1,onClick:t,className:rn("absolute inset-0 bg-canvas/80",n)}),zte={info:"bg-accent-2/15 text-accent-2 border-accent-2/40",success:"bg-positive/15 text-positive border-positive/40",warning:"bg-warning/15 text-warning border-warning/40",danger:"bg-danger/15 text-danger border-danger/40"},jte={info:"bg-surface-sunken text-fg-muted",success:"bg-positive/10 text-positive",warning:"bg-warning/10 text-warning",danger:"bg-danger-soft text-danger"},Bte={info:"status",success:"status",warning:"alert",danger:"alert"};function Zr({tone:e="info",variant:t="framed",onDismiss:n,role:r,className:o,children:s,...a}){const u=t==="soft";return O.jsxs("div",{role:r??Bte[e],className:rn("flex gap-2 px-3 py-2 text-sm",u?rn("items-start rounded-md",jte[e]):rn("items-center border",zte[e]),o),...a,children:[O.jsx("div",{className:"flex-1 min-w-0",children:s}),n&&(u?O.jsx(Xr,{variant:"ghost",size:"sm",icon:O.jsx(N_,{className:"size-3.5"}),onClick:n,"aria-label":"Dismiss",className:"-mr-1 shrink-0"}):O.jsx("button",{type:"button",onClick:n,"aria-label":"Dismiss",className:"shrink-0 rounded-md p-1 hover:bg-fg/10 transition-colors",children:O.jsx(N_,{className:"size-4","aria-hidden":"true"})}))]})}function ik({open:e,onClose:t,title:n,children:r,className:o,anchor:s="center"}){const a=_.useRef(null);if(qv({id:"dialog",open:e,answers:{back:t}}),Vv(a,e),!e)return null;const u=s==="left",c=s==="right";return O.jsxs("div",{className:rn("fixed inset-0 z-50 flex",u?"items-stretch justify-start":c?"items-stretch justify-end":"items-center justify-center px-4"),children:[O.jsx($te,{label:"Dismiss dialog",onDismiss:t}),O.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title",tabIndex:-1,className:rn("relative z-10 overflow-hidden border-line bg-surface shadow-xl",u?"safe-area-frame h-full w-72 max-w-[85vw] border-r":c?"safe-area-frame h-full w-[80vw] max-w-[320px] border-l":"w-full max-w-lg rounded-md border",o),children:[O.jsx("h2",{id:"dialog-title",className:"sr-only",children:n}),r]})]})}function NF({children:e,label:t}){return O.jsxs("span",{className:"relative inline-flex",children:[e,t!==void 0&&O.jsxs(O.Fragment,{children:[O.jsx("span",{"data-testid":"attention-dot",className:"absolute -right-1 -top-1 size-2 rounded-full bg-accent-2"}),O.jsx("span",{className:"sr-only",children:t})]})]})}function Wv({children:e,className:t}){return O.jsx("div",{"data-auth-page":!0,className:rn("flex min-h-dvh w-full flex-col items-center justify-center overflow-y-auto bg-surface-sunken pb-[max(2rem,env(safe-area-inset-bottom,0px))] pl-[max(1rem,env(safe-area-inset-left,0px))] pr-[max(1rem,env(safe-area-inset-right,0px))] pt-[max(2rem,env(safe-area-inset-top,0px))] text-fg",t),style:{backgroundImage:"radial-gradient(at 20% 0%, color-mix(in oklch, var(--accent) 8%, transparent) 0px, transparent 50%), radial-gradient(at 80% 100%, color-mix(in oklch, var(--accent) 8%, transparent) 0px, transparent 50%)"},children:O.jsx("div",{className:"w-full max-w-[26rem]",children:e})})}const Hte="Secure sign-in powered by AWS Cognito";function tI(e){const t=e?.note??"Secure sign-in";return O.jsx("div",{className:"text-center pt-5",children:O.jsx("p",{className:"text-xs text-fg-muted",children:t})})}const qte=()=>O.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"text-accent",children:[O.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),O.jsx("path",{d:"M3 7l9 6 9-6"})]});function Gv({wordmark:e="remit,",tagline:t="your email client in the cloud.",mark:n=O.jsx(qte,{})}){return O.jsxs("div",{className:"text-center pb-6",children:[O.jsx("div",{className:"flex items-center justify-center pb-3",children:n}),O.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-[-0.01em] text-fg",children:e}),O.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:t})]})}const Vte={default:rn("flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors"),inline:"flex items-center gap-2 bg-transparent text-sm"};function bf({icon:e,className:t,variant:n="default",trailing:r,ref:o,...s}){return O.jsxs("div",{className:rn(Vte[n],t),children:[e&&O.jsx("span",{className:"text-fg-subtle shrink-0",children:e}),O.jsx("input",{ref:o,className:"min-w-0 flex-1 bg-transparent text-fg placeholder:text-fg-subtle outline-none",...s}),r]})}const Wte={error:{container:"border-danger/50 bg-danger-soft",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning-soft",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},Gte={error:wF,warning:JA,info:Ree},Kte={error:"Error",warning:"Warning",info:"Information"},Zte=({id:e,severity:t,title:n,detail:r,action:o,onDismiss:s})=>{const a=Wte[t],u=Gte[t];return O.jsxs("div",{role:t==="error"?"alert":"status","aria-live":t==="error"?"assertive":"polite",className:rn("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg",a.container),children:[O.jsx(u,{className:rn("size-5 shrink-0 mt-0.5",a.icon),"aria-hidden":"true"}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("p",{className:rn("text-sm font-medium",a.title),children:n}),r&&O.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r}),o&&O.jsx("a",{href:o.href,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-block text-xs font-medium text-accent-2 underline underline-offset-2",children:o.label})]}),O.jsx("button",{type:"button",onClick:()=>s(e),className:"shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors","aria-label":`Dismiss ${Kte[t].toLowerCase()}`,children:O.jsx(N_,{className:"size-4","aria-hidden":"true"})})]})},Yte=({errors:e,onDismiss:t})=>e.length===0?null:O.jsx("section",{"aria-label":"Notifications",className:"pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-[calc(1rem+env(safe-area-inset-top,0px))] sm:items-end sm:pr-6",children:O.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:e.map(n=>O.jsx(Zte,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,action:n.action,onDismiss:t},n.id))})});function Qte({className:e,children:t,...n}){return O.jsx("label",{className:rn("mb-1 block text-xs font-medium text-fg-muted",e),...n,children:t})}const Xte="Matches on what the messages say about themselves — sender, subject, list. No reading involved.",Jte={From:"From",Subject:"Subject",HasWords:"Has the words",ListId:"List",FromDomain:"Domain"};function ene(e){return Jte[e]}const tne={ListId:"The mailing list's List-Id header, matched exactly. New mail is matched as it arrives — mail delivered before this was set up may not carry it yet.",FromDomain:"The sender's registrable domain — matches anyone at it, subdomains included (a look-alike like example.com.evil.test never matches)."};function vUe(e){return tne[e]}function nne(e){return e==="HasWords"}function kF(e){return e.clauses.length>0}function DF(e){return e.clauses.filter(t=>nne(t.field))}const yUe=["From","Subject","HasWords","ListId","FromDomain"],rne={all:"Match all",any:"Match any"};function bUe(e){return rne[e]}function one(e){return e==="all"?"and":"or"}function SUe(e){if(e.status==="loading")return"Counting matches…";if(e.status==="error")return e.reason;if(e.count===0)return"No mail matches yet";const t=e.count===1?"message":"messages",n=`${e.count} ${t} match`;return e.stale?`${n} — recounting`:n}const sne={once:"Just once",standing:"Keep doing this",until:"Until a date"};function wUe(e){return sne[e]}function CUe(e){return e==="once"?"Apply now":e==="standing"?"Save rule":"Save until then"}const Gr={noMatch:"Add a clause so the rule has something to match.",bodyTextOnce:"Applying once can't read message bodies. Save this as a rule instead, or drop the “has the words” clause.",noAction:"Pick a folder to move into, or a label to apply.",unnamed:"Name this rule so you can find it later.",noUntilDate:"Pick the date this rule should stop on.",counting:"Counting matches — save once the count settles.",recounting:"Recounting matches — save once the count settles."},EUe="Can't count matches — “has the words” reads message bodies, which only a saved rule does.";function LF(e){if(e.status==="loading")return Gr.counting;if(e.status==="ready"&&e.stale)return Gr.recounting}function _Ue(e,t){return kF(e)?e.scope==="once"&&DF(e).length>0?Gr.bodyTextOnce:!e.moveMailboxId&&!e.labelId?Gr.noAction:(e.scope==="standing"||e.scope==="until")&&(e.name??"").trim()===""?Gr.unnamed:e.scope==="until"&&!e.until?Gr.noUntilDate:LF(t):Gr.noMatch}const nI=(e,t)=>t.length===0?[e]:e.split(t),ine=(e,t)=>{const n=nI(e,t);return n[n.length-1]||e},Sf=(e,t)=>{if(t.length===0)return"";const n=e.lastIndexOf(t);return n===-1?"":e.slice(0,n)},UF=(e,t)=>nI(e,t).length-1,wf=(e,t)=>{const n=[];let r=e,o=Sf(r,t);for(;o&&o.length<r.length;)n.push(o),r=o,o=Sf(r,t);return n},ane=(e,t)=>{const n=new Set(e.map(a=>a.path)),r=new Set,o=[],s=a=>{if(!r.has(a.path)){r.add(a.path),o.push(a);for(const u of e)Sf(u.path,t)===a.path&&s(u)}};for(const a of e){const u=Sf(a.path,t);u&&n.has(u)||s(a)}return o},FF=(e,t)=>e.label.toLowerCase().includes(t)||e.path.toLowerCase().includes(t),lne=(e,t,n)=>{const r=new Set;if(!t)return r;for(const o of e)if(FF(o,t))for(const s of wf(o.path,n))r.add(s);return r},une=(e,t,n,r=new Set)=>{const o=(u,c)=>({folder:u,depth:UF(u.path,n),context:c,expanded:r.has(u.path)});if(!t)return e.map(u=>o(u,!1));const s=new Set;for(const u of e)FF(u,t)&&s.add(u.path);const a=new Set(s);for(const u of s)for(const c of wf(u,n))a.add(c);return e.filter(u=>a.has(u.path)).map(u=>o(u,!s.has(u.path)))},cne=(e,t,n)=>{const r=new Set(e.map(o=>o.path));return e.filter(o=>wf(o.path,n).every(s=>!r.has(s)||t.has(s))).map(o=>({folder:o,depth:UF(o.path,n),context:!1,expanded:t.has(o.path)}))},dne=(e,t)=>{if(t.length===0)return e.map((s,a)=>({kind:"folder",row:s,index:a}));const n=[],r=[],o=s=>{for(;r.length>0;){const a=r[r.length-1];if(!a||s?.startsWith(`${a.folder.path}${t}`))break;r.pop(),n.push({kind:"create",parent:a.folder,depth:a.depth+1})}};return e.forEach((s,a)=>{o(s.folder.path),n.push({kind:"folder",row:s,index:a}),s.expanded&&r.push(s)}),o(null),n},fne=e=>typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError",Do=e=>e!==void 0&&!e.context,j1=e=>e!==void 0&&!e.folder.isCurrent&&!e.context,B1=e=>{for(let t=0;t<e.length;t+=1)if(Do(e[t]))return t;return-1},hne=e=>{for(let t=e.length-1;t>=0;t-=1)if(Do(e[t]))return t;return-1},ak=(e,t,n)=>{const r=e.length;if(r<=0)return-1;const o=t<0?n===1?-1:r:t;for(let s=1;s<=r;s+=1){const a=((o+n*s)%r+r)%r;if(Do(e[a]))return a}return-1},pne=(e,t,n)=>{const r=e[t];if(!r)return-1;const o=Sf(r.folder.path,n);if(!o)return-1;for(let s=t-1;s>=0;s-=1)if(e[s]?.folder.path===o)return Do(e[s])?s:-1;return-1},L_="flex min-h-11 min-w-0 flex-1 items-center gap-2 px-3 py-2.5 text-left text-sm transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",$F=14,gne=60,U_=({depth:e})=>e>0?O.jsx("span",{"aria-hidden":"true",className:"shrink-0",style:{width:e*$F}}):null,F_=({depth:e})=>O.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute right-0 bottom-0 h-px bg-line",style:{left:gne+e*$F}}),mne=({label:e,depth:t,expanded:n,ariaLabel:r,selected:o=!1,context:s=!1,current:a=!1,currentTag:u,messageCount:c,failure:f,separated:h=!1,actions:g,tabIndex:m,onActivate:v,onFocus:w,ref:S})=>{const C=O.jsx(See,{className:rn("size-4 shrink-0 text-fg-subtle transition-transform",n&&"rotate-90"),"aria-hidden":"true"}),E=O.jsx(Iee,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":"true"}),A=c===void 0?null:O.jsxs("span",{"aria-hidden":"true",className:"shrink-0 text-2xs text-fg-subtle",children:[c," ",c===1?"msg":"msgs"]}),I=O.jsxs("span",{className:"min-w-0 flex-1",children:[O.jsx("span",{className:"block truncate",children:e}),f&&O.jsxs("span",{className:"flex items-center gap-1 text-2xs text-danger",children:[O.jsx(wF,{className:"size-3 shrink-0","aria-hidden":"true"}),O.jsx("span",{className:"truncate",children:f})]})]}),T=f?`${r} — ${f}`:r;return s?O.jsxs("div",{className:"relative flex items-center",children:[O.jsxs("div",{role:"treeitem","aria-level":t+1,"aria-selected":!1,"aria-expanded":n,"aria-label":T,className:rn(L_,"opacity-60"),children:[O.jsx(U_,{depth:t}),C,E,I,A]}),g,h&&O.jsx(F_,{depth:t})]}):O.jsxs("div",{className:"relative flex items-center",children:[O.jsxs("button",{ref:S,type:"button",role:"treeitem","aria-level":t+1,"aria-selected":o,"aria-expanded":n,"aria-current":a?"true":void 0,"aria-label":T,tabIndex:m,onClick:v,onFocus:w,className:rn(L_,"hover:bg-surface-raised active:bg-surface-sunken",a&&"text-fg-muted"),children:[O.jsx(U_,{depth:t}),C,E,I,A,a&&u&&O.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:u}),o&&O.jsx(SF,{className:"size-4 shrink-0 text-accent","aria-hidden":"true"})]}),g,h&&O.jsx(F_,{depth:t})]})},lk=({label:e,ariaLabel:t,depth:n=0,prominence:r="prominent",separated:o=!1,onOpen:s})=>O.jsxs("div",{className:rn("relative",r==="prominent"&&"p-2"),children:[O.jsxs("button",{type:"button",onClick:s,"aria-label":t,"data-prominence":r,className:rn(L_,"w-full active:bg-surface-sunken",r==="prominent"?"rounded-lg border border-line-strong border-dashed font-medium text-fg-muted hover:border-accent-2 hover:text-accent-2":"text-fg-subtle hover:bg-surface-raised hover:text-fg-muted"),children:[O.jsx(U_,{depth:n}),O.jsx("span",{"aria-hidden":"true",className:"size-4 shrink-0"}),O.jsx(xee,{className:"size-4 shrink-0","aria-hidden":"true"}),O.jsx("span",{className:"min-w-0 flex-1 truncate",children:e})]}),o&&O.jsx(F_,{depth:n})]}),zF={nameLabel:"Folder name",namePlaceholder:"Hotels",insideLabel:"Inside",create:"Create folder",cancel:"Cancel",createPending:"Creating folder…"},vne=({parentLabel:e,name:t,onNameChange:n,onSubmit:r,onCancel:o,pending:s=!1,error:a,labels:u})=>{const c={...zF,...u},f=_.useId(),h=_.useRef(null),g=_.useRef(null);return _.useEffect(()=>{h.current?.focus({preventScroll:!0}),g.current?.scrollIntoView({block:"nearest"})},[]),O.jsxs("div",{ref:g,className:"space-y-3 border-y border-line bg-surface-sunken px-3 py-3",children:[O.jsxs("div",{children:[O.jsx(Qte,{htmlFor:f,children:c.nameLabel}),O.jsx(bf,{id:f,ref:h,value:t,placeholder:c.namePlaceholder,onChange:m=>n(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r()),m.key==="Escape"&&(m.preventDefault(),o())}})]}),O.jsxs("p",{className:"text-xs text-fg-muted",children:[c.insideLabel," ",O.jsx("span",{className:"font-medium text-fg",children:e})]}),a&&O.jsx("p",{className:"text-xs text-danger",role:"alert",children:a}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Xr,{variant:"ghost",size:"md",onClick:o,className:"min-h-11 shrink-0",children:c.cancel}),O.jsx(Xr,{variant:"secondary",size:"md",onClick:r,disabled:s,className:"min-h-11 shrink-0",children:s?c.createPending:c.create})]})]})},yne={...zF,filterPlaceholder:"Filter folders…",filterAriaLabel:"Filter folders",treeAriaLabel:"Destination folders",currentSuffix:"(current folder)",currentTag:"current",contextSuffix:"(containing folder)",emptyMessage:e=>`No folders match "${e}"`,noFolders:"No folders to show",optionLabel:e=>`Move to ${e.label}`,newFolder:"New folder",newSubfolder:e=>`New folder inside ${e}`,topLevel:"Top level",nameRequired:"Give the folder a name.",createError:"Couldn't create that folder. Please try again."},bne=({folders:e,selectedId:t,onSelect:n,rowActions:r,rowFailure:o,onCreateFolder:s,onCancel:a,delimiter:u="/",labels:c,autoFocusFilter:f=!1})=>{const h={...yne,...c},[g,m]=_.useState(""),[v,w]=_.useState(()=>{const se=e.find(Se=>Se.id===t);return new Set(se?wf(se.path,u):[])}),[S,C]=_.useState(null),[E,A]=_.useState(""),[I,T]=_.useState(),[N,M]=_.useState(!1),[R,k]=_.useState(-1),L=_.useRef([]),q=_.useRef(null),F=_.useRef(!1),D=_.useRef(null);_.useEffect(()=>()=>D.current?.abort(),[]),_.useEffect(()=>{f&&q.current?.focus()},[f]);const j=g.trim().toLowerCase(),Z=_.useMemo(()=>ane(e,u),[e,u]),he=_.useMemo(()=>{const se=lne(Z,j,u);return se.size===0?v:new Set([...v,...se])},[Z,v,j,u]),B=_.useMemo(()=>j?une(Z,j,u,he):cne(Z,he,u),[Z,j,u,he]),Q=_.useMemo(()=>s?dne(B,u):void 0,[B,u,s]);_.useEffect(()=>{k(se=>Do(B[se])?se:B1(B))},[B]),_.useEffect(()=>{F.current&&(F.current=!1,!(R<0)&&L.current[R]?.focus())},[R]);const ae=_.useCallback((se,Se)=>{w(Ze=>{if(Se)return new Set([...wf(se,u),se]);const ve=new Set(Ze);return ve.delete(se),ve})},[u]),ue=_.useCallback(se=>{j1(se)&&n?.(se.folder.id),ae(se.folder.path,!se.expanded)},[n,ae]),we=_.useCallback(()=>{D.current?.abort(),C(null),A(""),T(void 0),M(!1)},[]),U=_.useCallback(se=>{D.current?.abort(),C({anchorId:se?.id??null,parentPath:se?.path??"",parentLabel:se?.label??h.topLevel}),A(""),T(void 0),M(!1)},[h.topLevel]),X=_.useCallback(()=>{if(!s||!S||N)return;const se=E.trim();if(se===""){T(h.nameRequired);return}M(!0),T(void 0),D.current?.abort();const Se=new AbortController;D.current=Se;const Ze=S.parentPath;s(se,Ze,Se.signal).then(ve=>{M(!1),C(null),A(""),Ze&&ae(Ze,!0),n?.(ve.id)}).catch(ve=>{fne(ve)||(T(ve instanceof Error?ve.message:h.createError),M(!1))})},[s,S,N,E,n,ae,h.nameRequired,h.createError]),ie=_.useCallback(se=>{const Se=se.target;if(!(Se instanceof Element)||!Se.closest('[role="treeitem"]'))return;const Ze=pt=>{se.preventDefault(),F.current=!0,k(pt)},ve=B[R];switch(se.key){case"ArrowDown":return Ze(ak(B,R,1));case"ArrowUp":return Ze(ak(B,R,-1));case"Home":return Ze(B1(B));case"End":return Ze(hne(B));case"ArrowRight":{if(!Do(ve)||!ve)return;if(se.preventDefault(),!ve.expanded){ae(ve.folder.path,!0);return}const pt=R+1;Do(B[pt])&&Ze(pt);return}case"ArrowLeft":{if(!Do(ve)||!ve)return;if(se.preventDefault(),ve.expanded){ae(ve.folder.path,!1);return}const pt=pne(B,R,u);pt>=0&&Ze(pt);return}case"Enter":case" ":{if(!Do(ve)||!ve)return;se.preventDefault(),ue(ve);return}case"Escape":se.preventDefault(),a?.();return;default:return}},[B,R,u,ue,ae,a]),oe=S!==null&&S.anchorId!==null&&(Q?.some(se=>se.kind==="create"&&se.parent.id===S.anchorId)??!1),fe=S&&O.jsx(vne,{parentLabel:S.parentLabel,name:E,onNameChange:se=>{A(se),T(void 0)},onSubmit:X,onCancel:we,pending:N,error:I,labels:h}),Me=se=>se.context?`${se.folder.label} ${h.contextSuffix}`:j1(se)?h.optionLabel(se.folder):`${se.folder.label} ${h.currentSuffix}`,xe=(se,Se,Ze)=>{const{folder:ve,depth:pt}=se,gt=j1(se);return O.jsx(mne,{ref:Ye=>{L.current[Se]=Ye},label:ve.label,depth:pt,expanded:se.expanded,context:se.context,current:ve.isCurrent,currentTag:h.currentTag,messageCount:ve.messageCount,selected:gt&&ve.id===t,separated:Ze,failure:o?.(ve),actions:r?.(ve),ariaLabel:Me(se),tabIndex:Se===R?0:-1,onActivate:()=>ue(se),onFocus:()=>k(Se)})};return O.jsxs("div",{className:"flex min-h-0 w-full min-w-0 flex-col",children:[O.jsx(bf,{ref:q,variant:"inline",className:"border-b border-line px-3 py-2",icon:O.jsx(Mee,{className:"size-4","aria-hidden":"true"}),type:"search",value:g,onChange:se=>m(se.target.value),onKeyDown:se=>{if(se.key==="Escape"){se.preventDefault(),a?.();return}if(se.key!=="ArrowDown")return;se.preventDefault();const Se=Do(B[R])?R:B1(B);Se<0||(F.current=!0,k(Se),L.current[Se]?.focus())},placeholder:h.filterPlaceholder,"aria-label":h.filterAriaLabel}),s&&O.jsx("div",{className:"shrink-0 border-b border-line","data-create-anchor":"top",children:S&&!oe?fe:O.jsx(lk,{label:h.newFolder,ariaLabel:h.newFolder,prominence:"prominent",onOpen:()=>U(null)})}),B.length===0?O.jsx("p",{className:"px-3 py-3 text-sm text-fg-muted","aria-live":"polite",children:e.length===0?h.noFolders:h.emptyMessage(g)}):O.jsx("div",{role:"tree","aria-label":h.treeAriaLabel,className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden pb-24",onKeyDown:ie,children:(Q??B.map((se,Se)=>({kind:"folder",row:se,index:Se}))).map((se,Se,Ze)=>{const ve=Se<Ze.length-1;return se.kind==="create"?O.jsx("div",{role:"none","data-create-anchor":se.parent.id,children:S?.anchorId===se.parent.id?fe:O.jsx(lk,{label:h.newFolder,ariaLabel:h.newSubfolder(se.parent.label),depth:se.depth,prominence:"quiet",separated:ve,onOpen:()=>U(se.parent)})},`new:${se.parent.id}`):O.jsx("div",{role:"none",children:xe(se.row,se.index,ve)},se.row.folder.id)})})]})},Sne={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Spam",trash:"Trash",flagged:"Starred",all:"All Mail"};function wne(e){return Sne[e]}const Cne=new Set(["all","flagged"]);function Ene(e){return Cne.has(e)}const _ne=new Set(["[Gmail]","[Google Mail]"]);function xne(e){if(e.role)return Ene(e.role)?void 0:wne(e.role);if(!e.providerPath)return;const t=nI(e.providerPath,e.hierarchyDelimiter);if(!_ne.has(t[0]))return ine(e.providerPath,e.hierarchyDelimiter)}function xUe(e){return e==="inbox"?O.jsx(CF,{className:"size-4"}):e==="drafts"?O.jsx(Eee,{className:"size-4"}):e==="sent"?O.jsx(Pee,{className:"size-4"}):e==="archive"?O.jsx(yee,{className:"size-4"}):e==="junk"?O.jsx(XA,{className:"size-4"}):e==="trash"?O.jsx(Lee,{className:"size-4"}):e==="flagged"?O.jsx(kee,{className:"size-4"}):O.jsx(Tee,{className:"size-4"})}const Ane={Inbox:"Inbox",Drafts:"Drafts",Sent:"Sent",Archive:"Archive",Junk:"Junk",Trash:"Trash",All:"All",Flagged:"Flagged"},AUe={Body:"Body"},IUe={Mail:"Mail",Calendar:"Calendar"},nu={Appointed:"Appointed",Flagged:"Flagged",Reserved:"Reserved",Proposed:"Proposed",Stale:"Stale",None:"None"},Pa={SignInDisabled:"sign_in_disabled",CallerDisabled:"caller_disabled",ForeignOrigin:"foreign_origin",StepUpRequired:"step_up_required",WrongPassword:"wrong_password",StepUpLocked:"step_up_locked",CannotDisableSelf:"cannot_disable_self"},uk={synced:"synced",failed:"failed"},RUe={Saved:"Saved",Deployment:"Deployment",Default:"Default"},TUe={NoBaseUrl:"NoBaseUrl",NoApiKey:"NoApiKey"},OUe={uncategorized:"uncategorized",personal:"personal",newsletter:"newsletter",marketing:"marketing",automated:"automated",transactional:"transactional",social:"social"},MUe={Wellknown:"wellknown",Vip:"vip"},PUe={Lookalike:"Lookalike",ForeignAddress:"ForeignAddress",Unrelated:"Unrelated"},NUe={abandoned:"abandoned"},kUe={none:"none",move:"move",delete:"delete"},DUe={MoveToInbox:"MoveToInbox",MoveToJunk:"MoveToJunk"},LUe={Confident:"Confident",Unsure:"Unsure"},UUe={Attachment:"attachment"},FUe={None:"None"},$Ue={Retrying:"Retrying",GaveUp:"GaveUp"};function jF(e){const[t,n]=_.useState(!1),r=t?wee:Cee,o=t?"Hide password":"Show password";return O.jsx(bf,{...e,type:t?"text":"password",trailing:O.jsx("button",{type:"button","aria-label":o,"aria-pressed":t,title:o,onClick:()=>n(s=>!s),className:"-my-1 -mr-2 flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-md text-fg-subtle transition-colors hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:O.jsx(r,{className:"size-4","aria-hidden":!0})})})}const Ine=e=>e===1?"message":"messages",Tm=e=>`${e.toLocaleString()} ${Ine(e)}`,H1=(e,t)=>e.kind==="delete"?`delete ${Tm(e.count)}`:t===void 0?"empty it":`empty ${Tm(t)}`,BF=e=>e.kind==="delete"?"Nothing has been deleted.":"Nothing has been emptied.",Rne=(e,t,n={})=>{const{trashFolderLabel:r,staleFolderLabel:o,selectedCount:s}=n,a=BF(t);if(e==="none")return{title:"No folder is set as Trash",description:`${a} reader files deleted mail in the folder you set as Trash, and this account has none.`,pickerPrompt:"Which folder does this account use for deleted mail?",confirmLabel:`Set as Trash and ${H1(t,void 0)}`,cancelLabel:"Cancel"};if(e==="stale")return{title:"The Trash folder you chose is gone",description:o?`${a} You set ${o} as this account's Trash and it is no longer on the mail server — another mail app may have renamed or removed it.`:`${a} The folder you set as this account's Trash is no longer on the mail server — another mail app may have renamed or removed it.`,pickerPrompt:"Which folder should reader use instead?",confirmLabel:`Set as Trash and ${H1(t,void 0)}`,cancelLabel:"Cancel"};const u=t.kind==="delete"?`Deleting ${Tm(t.count)} there erases them from the mail server, and that cannot be restored.`:"Emptying a folder erases everything in it from the mail server, and that cannot be restored.";return{title:"Confirm this account's Trash folder",description:r?`${a} reader files this account's deleted mail in ${r} because of its name — you never chose it, and the mail server doesn't mark it as Trash. ${u}`:`${a} reader files this account's deleted mail in a folder it matched by name — you never chose it, and the mail server doesn't mark it as Trash. ${u}`,pickerPrompt:r?`Confirm ${r}, or pick the folder this account really uses.`:"Pick the folder this account really uses for deleted mail.",confirmLabel:`Set as Trash and ${H1(t,s)}`,cancelLabel:"Cancel"}},Tne=(e,t,n,r)=>e.kind==="appointing"?{headline:"Setting the Trash folder…",status:n}:t.kind==="delete"?{headline:`Deleting ${Tm(t.count)}…`,status:r?`Erasing them from ${n}. This can't be undone.`:`Moving them to ${n}`}:{headline:`Emptying ${n}…`,status:"This can't be undone."},One=(e,t,n,r)=>e==="unconfirmed"&&t.kind==="delete"&&n!==void 0&&r===n,Mne=(e,t,n)=>e==="mailbox-pending"?`${n} is still being created on the mail server. Wait for it to finish, then try again.`:`Couldn't set that folder as Trash. ${BF(t)} Please try again.`,Pne=({open:e,reason:t,action:n,folders:r,delimiter:o,trashFolderLabel:s,guessedMailboxId:a,staleFolderLabel:u,accountEmail:c,phase:f,selectedId:h,onSelect:g,onCreateFolder:m,onConfirm:v,onCancel:w})=>{const S=_.useRef(null),C=f.kind==="appointing"||f.kind==="acting";_.useEffect(()=>{C&&S.current?.focus()},[C]);const E=r.find(N=>N.id===h),A=Rne(t,n,{trashFolderLabel:s,staleFolderLabel:u,selectedCount:E?.messageCount}),I=One(t,n,a,h),T=n.kind==="emptyTrash"||I;if(!e)return null;if(C){const N=Tne(f,n,E?.label??"",I);return O.jsx(ik,{open:e,onClose:()=>{},title:A.title,children:O.jsxs("div",{ref:S,"data-escape-owner":!0,tabIndex:-1,className:"flex flex-col items-center gap-3 px-5 py-10 text-center outline-none",children:[O.jsx(EF,{className:"size-8 animate-spin text-accent-2"}),O.jsx("p",{className:"text-sm font-medium text-fg",children:N.headline}),O.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:N.status})]})})}return O.jsxs(ik,{open:e,onClose:w,title:A.title,children:[O.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[O.jsx(JA,{className:`size-4 shrink-0 ${T?"text-danger":"text-warning"}`}),O.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:A.title})]}),O.jsxs("div",{className:"flex max-h-[70vh] flex-col",children:[O.jsxs("div",{className:"space-y-1 px-5 py-4",children:[O.jsx("p",{className:"text-sm text-fg-muted",children:A.description}),c&&O.jsx("p",{className:"text-xs text-fg-subtle",children:c})]}),f.kind==="appoint-failed"&&O.jsx("div",{className:"px-5 pb-3",children:O.jsx(Zr,{tone:"danger",variant:"soft",children:Mne(f.cause,n,E?.label??"That folder")})}),O.jsx("p",{className:"px-5 pb-2 text-sm text-fg-muted",children:A.pickerPrompt}),O.jsx("div",{className:"flex h-[26rem] min-h-0 flex-1 overflow-hidden",children:O.jsx(bne,{folders:r,selectedId:h,delimiter:o,onSelect:g,onCreateFolder:t==="none"?m:void 0,onCancel:w,labels:{treeAriaLabel:"Folders on this account",optionLabel:N=>`Set ${N.label}${N.messageCount===void 0?"":`, ${N.messageCount} messages`}, as Trash`}})})]}),O.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[O.jsx(Xr,{variant:"secondary",size:"sm",onClick:w,children:A.cancelLabel}),E&&O.jsx(Xr,{variant:T?"danger":"primary",size:"sm",onClick:()=>v(E.id),children:O.jsx("span",{className:"truncate",children:A.confirmLabel})})]})]})},Nne={delete:{label:"Delete",present:"Deleting",past:"Deleted",destructive:!0},move:{label:"Move",present:"Moving",past:"Moved",destructive:!1},junk:{label:"Junk",present:"Marking as junk",past:"Marked as junk",destructive:!0},markRead:{label:"Mark read",present:"Marking read",past:"Marked read",destructive:!1},organize:{label:"Organize",present:"Organizing",past:"Organized",destructive:!1}},kne=e=>Nne[e],Dne={match:"Apply to",properties:"Properties",folder:"Folder",rule:"Rule",name:"Name",review:"Review",run:"Run"},zUe=e=>Dne[e],jUe=({verb:e,mode:t,scope:n,fromSearch:r})=>{const o=r?["properties"]:t==="properties"?["match","properties"]:["match"];return e==="move"?[...o,"folder","review","run"]:e==="organize"?n==="standing"||n==="until"?[...o,"folder","rule","name","review","run"]:[...o,"folder","rule","review","run"]:[...o,"review","run"]},HF=(e,t)=>Math.max(0,e.indexOf(t)),BUe=(e,t)=>HF(e,t)===0||t==="run",qF=(e,t)=>({clauses:[...e.clauses],matchOperator:e.matchOperator,moveMailboxId:e.moveMailboxId,scope:t,until:e.until,name:e.name}),Lne=e=>DF(qF(e,e.scope??"once")),ck=e=>{if(!(e.scope!=="standing"&&e.scope!=="until")&&!kF(qF(e,e.scope)))return Gr.noMatch},Une="A rule only works within one account — clear the selection, or pick messages from a single account.",Fne="A destination only works within one account — clear the selection, or pick messages from a single account.",HUe="Matching beyond the messages you picked only works within one account — clear the selection, or pick messages from a single account.",$ne="A rule only works within one folder — clear the selection, or pick messages from a single folder.",zne="A destination only works within one folder — clear the selection, or pick messages from a single folder.",jne={spansAccounts:{rule:Une,destination:Fne},spansFolders:{rule:$ne,destination:zne}},Bne="A match this wide applies once — use “Make this a filter” above the results to keep doing it.",qUe=(e,t)=>e==="escalated"?Bne:t.rule,VUe=(e,t)=>{const n=e===void 0?"spansAccounts":t;if(!n)return{accountId:e};const r=jne[n];return{accountId:n==="spansAccounts"?void 0:e,rule:r.rule,destination:r.destination}},WUe=e=>e===void 0?["selected"]:["selected","properties"],Hne="This matches no messages, so there is nothing to do. Go back and change what it applies to.",qne="Fill in every property, or take the empty one off.",Vne="Pick a destination first.",Wne="Choose one of the three first.",GUe=(e,t,n)=>{if(e==="properties")return t.clauses.length===0?Gr.noMatch:t.clauses.some(r=>r.value.trim()==="")?qne:void 0;if(e==="folder")return t.moveMailboxId?void 0:Vne;if(e==="rule"){if(!t.scope)return Wne;const r=ck(t);return r||(t.scope==="once"&&Lne(t).length>0?Gr.bodyTextOnce:t.scope==="until"&&!t.until?.trim()?Gr.noUntilDate:void 0)}if(e==="name"&&!t.name?.trim())return Gr.unnamed;if(e==="review"){const r=ck(t);return r||(n.status==="uncounted"?void 0:n.status==="ready"&&n.count===0&&!n.stale?Hne:LF(n))}},KUe="Nothing matches this yet. Widen a property, or match on a different one.",ZUe=({state:e,verb:t,scope:n,matched:r,applied:o,failed:s,failureReason:a})=>{const{label:u,present:c,past:f}=kne(t),h=f.toLowerCase(),g=n==="standing"||n==="until",v={screenTitle:e==="saving"||e==="backApplyRunning"||e==="statusUnknown"||e==="commitFailed"?u:"Done",showProgress:e==="backApplyRunning"||e==="backApplyComplete"||e==="backApplyFailed"||e==="backApplyRestartFailed"||e==="statusUnknown"||e==="runStopped",failureListLabel:`Not ${h}`};return e==="saving"?{...v,title:g?"Saving rule…":"Applying…",detail:"Nothing has been changed yet.",tone:"progress",dismissLabel:"Close"}:e==="backApplyRunning"?{...v,title:g?"Rule saved. Moving the mail already in your mailbox…":`${c} ${r} messages…`,detail:"This keeps running if you close the wizard.",tone:"progress",dismissLabel:"Close",cancelLabel:"Stop the run"}:e==="statusUnknown"?{...v,title:g?"Rule saved. Its progress over your existing mail is unknown":`${c} — progress unknown`,detail:g?"The connection dropped, so the bar shows the last that was read. The pass runs on the mail server, and the rule keeps working on new mail either way. This keeps checking.":"The connection dropped, so the bar shows the last that was read. The run is on the mail server and carries on either way. This keeps checking.",tone:"warning",dismissLabel:"Close",retryLabel:"Check again"}:e==="backApplyComplete"?{...v,title:g?"Rule saved and applied":`${f} ${o}`,detail:g?`${o} of ${r} already in your mailbox ${h}. New mail follows the rule as it arrives.`:`Every message the match reached was ${h}. Your mail server is still catching up, so the list can lag behind.`,tone:"success",dismissLabel:"Done"}:e==="backApplyFailed"?{...v,title:g?"Rule saved — some mail stayed put":`Not everything was ${h}`,detail:`${o} of ${r} ${h} · the mail server rejected ${s}.${g?" The rule itself is saved and keeps working on new mail.":""}`,tone:"warning",dismissLabel:"Close",retryLabel:`Retry ${s}`}:e==="runStopped"?{...v,title:`Stopped after ${o}`,detail:`${o} of ${r} ${h}. The rest were not sent, apart from the ones already on their way when you stopped — those may still have gone through.`,tone:"warning",dismissLabel:"Close",retryLabel:`Retry ${s}`}:e==="backApplyRestartFailed"?{...v,title:g?"Rule saved — the retry didn't start":"The retry didn't start",detail:`${o} of ${r} ${h} · the mail server rejected ${s}, which are still where they were.${g?" The rule itself is saved and keeps working on new mail.":""} Check your connection and try again.`,tone:"warning",dismissLabel:"Close",retryLabel:`Retry ${s}`}:e==="backApplyStartFailed"?{...v,title:"Rule saved",detail:"New mail follows it automatically. The pass over the mail already in your mailbox never started.",tone:"warning",dismissLabel:"Not now",retryLabel:"Run it over existing mail"}:e==="filterSaved"?{...v,title:"Filter saved",detail:"There is no mail in your mailbox to apply it to yet. New mail follows it as it arrives. You can see it, and when it expires, under Settings › Filters.",tone:"success",dismissLabel:"Done"}:{...v,title:g?"Couldn't save the rule":`Couldn't start ${u.toLowerCase()}`,detail:a??"Nothing has changed.",tone:"danger",dismissLabel:a===void 0?"Not now":"Close",retryLabel:a===void 0?"Try again":void 0}},Gne=e=>`${ene(e.field)} "${e.value}"`,VF=(e,t)=>e.map(Gne).join(` ${one(t)} `),Kne=(e,t)=>e==="selected"?`These ${t} messages`:"Its properties",YUe=e=>e==="selected"?"Only the messages ticked in the list.":Xte,Zne=e=>`Every message ${e}`,WF="the list is showing",QUe="This reaches every match on the mail server, including the ones the list has not loaded. The search is already the match, so there is nothing to widen.",XUe="This covers messages not shown in the list, and anything else matching by the time it runs.",JUe=({mode:e,selectedCount:t,clauses:n,matchOperator:r,escalatedScope:o})=>e==="escalated"?Zne(o??WF):e==="properties"?VF(n,r):Kne(e,t),e6e=({mode:e,selectedCount:t,clauses:n,matchOperator:r,escalatedScope:o,escalatedCount:s})=>{if(e==="selected")return`${t} messages`;if(e==="escalated"){const a=o??WF;return s===void 0?`every message ${a}`:`all ${s.toLocaleString()} messages ${a}`}return n.length===0?"every message":`every message where ${VF(n,r)}`},Yne={preparing:"Getting the new version ready",restarting:"Restarting Remit",reconnecting:"Waiting for Remit to answer again"};function dk(e){return Yne[e]}function Qne(e){return e<90?"This usually takes about a minute.":e<240?"Longer than usual. Remit is still trying to reach the server.":"Still no answer. Remit keeps trying."}function t6e(e,t=Date.now()){const n=Math.floor((t-e)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function n6e(e){return new Date(e).toLocaleDateString(void 0,{dateStyle:"medium"})}const fk=["preparing","restarting","reconnecting"],GF="fixed inset-0 z-50 flex flex-col items-center justify-center gap-6 bg-canvas p-6 text-center outline-none";function Xne({target:e,phase:t,elapsedSeconds:n}){const r=_.useRef(null);Vv(r,!0),qv({id:"self-update",open:!0});const o=fk.indexOf(t);return O.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"self-update-progress-title",tabIndex:-1,className:GF,children:[O.jsxs("div",{className:"max-w-md space-y-2",children:[O.jsxs("h1",{id:"self-update-progress-title",className:"text-lg font-semibold text-fg",children:["Installing Remit ",e]}),O.jsx("p",{className:"text-sm text-fg-muted",children:"Remit is restarting, so this page has no server to talk to for a moment. Leave this open — it reconnects on its own."})]}),O.jsx("ol",{className:"w-full max-w-sm space-y-2 text-left",children:fk.map((s,a)=>{const u=a<o,c=a===o;return O.jsxs("li",{className:rn("flex items-center gap-3 rounded-sm border px-row-inset py-2 text-sm",c?"border-line-strong bg-surface text-fg":"border-line bg-surface-sunken text-fg-subtle"),children:[u?O.jsx(SF,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}):c?O.jsx(EF,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}):O.jsx("span",{className:"size-4 shrink-0 rounded-full border border-line-strong"}),dk(s)]},s)})}),O.jsxs("p",{"aria-live":"polite",className:"max-w-md text-xs text-fg-subtle",children:[O.jsx("span",{className:"sr-only",children:`${dk(t)}. `}),Qne(n)]})]})}function Jne({attemptedVersion:e,previousVersion:t,elapsedSeconds:n,logsCommand:r,onRetryConnection:o}){const s=_.useRef(null);Vv(s,!0);const a=Math.max(1,Math.round(n/60));return O.jsxs("div",{ref:s,role:"alertdialog","aria-modal":"true","aria-labelledby":"self-update-unreachable-title",tabIndex:-1,className:GF,children:[O.jsx(XA,{className:"size-12 shrink-0 text-danger","aria-hidden":!0}),O.jsxs("div",{className:"max-w-lg space-y-3",children:[O.jsx("h1",{id:"self-update-unreachable-title",className:"text-lg font-semibold text-fg",children:"Remit has not answered since the restart"}),O.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing ",e," started ",a," minute",a===1?"":"s"," ago and the server has been silent since. Your mail is safe at your provider — it was never part of the update."]}),O.jsxs("p",{className:"text-sm text-fg-muted",children:["Remit rolls back to ",t," on its own when the new version fails to start, but this page cannot confirm that from here. Check the server directly:"]}),O.jsx("code",{className:"block rounded-xs bg-surface-sunken px-3 py-2 text-left text-xs text-fg-muted",children:r})]}),O.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:O.jsx(Xr,{size:"sm",onClick:o,children:"Try connecting again"})})]})}const ere=()=>O.jsxs("div",{className:"hidden h-full w-[17%] min-w-40 max-w-64 shrink-0 flex-col gap-1 border-r border-line p-3 md:flex",children:[O.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((e,t)=>O.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[O.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),O.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},t))]}),tre=()=>O.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((e,t)=>O.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[O.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),O.jsxs("div",{className:"flex-1 space-y-1.5",children:[O.jsxs("div",{className:"flex justify-between gap-2",children:[O.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),O.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),O.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),O.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},t))}),Kv=()=>O.jsxs("div",{className:"flex h-full animate-pulse bg-canvas","aria-hidden":"true",children:[O.jsx(ere,{}),O.jsx(tre,{})]}),Zv="9d2055eb48deea4378f86890bd377e6ba0cb399e",nre="2026-11-11T04:01:45.943Z",rre=Zv.slice(0,7),ore=/^[0-9a-f]{40}$/.test(Zv),sre=ore?`https://github.com/remit-mail/reader/commit/${Zv}`:void 0;class Yv extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r,this.name="ApiError"}status;body}const $_=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),sl=e=>{const t=e instanceof Yv?e.body:e;if(!$_(t))return;const{code:n,details:r}=t;if(typeof n=="string")return{code:n,details:$_(r)?r:void 0}},ire=(e,t)=>{if($_(e)&&e.message!==void 0&&e.message!==null){const n=String(e.message);if(n)return n}return`Request failed with status ${t}`},are=(e,t)=>new Yv(ire(e,t),t,e),hn=e=>{if(e instanceof Yv)return e.status;if(e&&typeof e=="object"){const t=e;if(typeof t.status=="number")return t.status;if(typeof t.statusCode=="number")return t.statusCode}},KF=e=>hn(e)!==void 0,Qv=e=>{const t=hn(e);return t!==void 0&&t>=500&&t<=599},Xv=e=>!!(typeof DOMException<"u"&&e instanceof DOMException&&e.name==="AbortError"||e&&typeof e=="object"&&"name"in e&&e.name==="AbortError"),lre=()=>typeof navigator<"u"&&navigator.onLine===!1,Jv=e=>Xv(e)||KF(e)?!1:e instanceof ZA?!0:lre(),ure=e=>!KF(e)&&!Xv(e)&&!Jv(e),ZF=e=>Qv(e)||ure(e),cre=e=>e instanceof Error&&e.name==="AuthTokenError"&&hn(e)===403,ey=e=>hn(e)===401||cre(e),dre=(e,t)=>{if(t?.softError===!0)return!0;const n=t?.softErrorStatuses;if(!Array.isArray(n))return!1;const r=hn(e);return r!==void 0&&n.includes(r)},fre=[502,503,504],hre=(e,t)=>{if(t?.restartExpected!==!0)return!1;const n=hn(e);return n!==void 0&&fre.includes(n)},pre=(e,t)=>Qv(e)?!hre(e,t)&&t?.ownsServerErrors!==!0:Xv(e)||Jv(e)||ey(e)?!1:ZF(e)?!0:!dre(e,t),rI={softError:!0},ty=(...e)=>({softErrorStatuses:e}),gre={restartExpected:!0},mre={ownsServerErrors:!0},YF=e=>hn(e)===404,vre=e=>Qv(e),z_=new Set;let QF=null,XF=null;const yre=e=>{XF=e},bre=e=>e instanceof Error?e:new Error(JF(e)),JF=e=>e instanceof Error?e.message||e.name:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:"An unexpected server error occurred.",Sre=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`fatal-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,ju=(e,t)=>{const n={error:e,message:JF(e),correlationId:Sre(),at:Date.now(),recoverable:t?.recoverable??vre(e),stack:e instanceof Error?e.stack:void 0,componentStack:t?.componentStack};QF=n,Are(`Fatal: ${n.message} [${n.correlationId}]`),XF?.recordError(bre(e),{fatal:"true",correlationId:n.correlationId});for(const r of z_)r(n);return n},wre=e=>(z_.add(e),()=>{z_.delete(e)}),Cre=()=>QF,Ere=20,nm=[],_re=new Set(["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"]);function xre(e){return typeof e!="string"?!1:_re.has(e.replace(/\.\s*$/,""))}function rm(e){nm.push(e),nm.length>Ere&&nm.shift()}function Are(e){rm(e)}function Ire(e){return e.map(t=>{if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}).join(" ")}function Rre(){const e=console.error.bind(console);console.error=(...t)=>{rm(Ire(t)),e(...t)},window.addEventListener("error",t=>{xre(t.message)||(rm(`Uncaught ${t.error instanceof Error?`${t.error.name}: ${t.error.message}`:String(t.message)} (${t.filename}:${t.lineno})`),ju(t.error??t.message))}),window.addEventListener("unhandledrejection",t=>{const n=t.reason,r=n instanceof Error?`${n.name}: ${n.message}`:String(n);rm(`Unhandled rejection: ${r}`),ju(n)})}function Tre(){return nm.slice()}const Ore=8,gu=[];function Mre(e){const t=e.split(/[?#]/)[0],n=gu[gu.length-1];n&&n.path===t||(gu.push({path:t,timestamp:new Date().toISOString()}),gu.length>Ore&&gu.shift())}function Pre(){return gu.slice()}const q1=7500,hk=`
|
|
13
|
-
… (truncated — the copy action on this screen has the full report)`;function Bu(e){return{appShortSha:
|
|
14
|
-
`)}function e$(e){const t=/T(\d{2}:\d{2}:\d{2})/.exec(e);return t?t[1]:e}function
|
|
15
|
-
`):" (none)",r=["## Environment",
|
|
16
|
-
`)}function
|
|
17
|
-
`)[0].trim();return`Bug: ${t.length>120?`${t.slice(0,117)}…`:t}`}function Gp(e,t){const n=new URLSearchParams({title:Ure(e),body:t$(e,t)});return`${pc().issuesUrl}?${n.toString()}`}function Fre(e){return t$(e)}function oh(e){const t=Gp(e);if(t.length<=q1)return t;const n={...e,componentStack:void 0},r=[];e.stack&&r.push(["stack",e.stack]),e.quarantine?.structure&&r.push(["quarantineStructure",e.quarantine.structure]),r.sort((s,a)=>a[1].length-s[1].length);let o={};for(const[s,a]of r){if(Gp(n,o).length<=q1)break;let u=0,c=a.length,f=0;for(;u<=c;){const h=u+c>>1;Gp(n,{...o,[s]:a.slice(0,h)+hk}).length<=q1?(f=h,u=h+1):c=h-1}o={...o,[s]:a.slice(0,f)+hk}}return Gp(n,o)}function $re(){const e=oh(Bu());window.open(e,"_blank","noopener,noreferrer")}const zre="/mail",n$=()=>{const[e,t]=_.useState(()=>Cre());return _.useEffect(()=>wre(t),[]),e?O.jsx(r$,{fatal:e}):null},pk=e=>({errorMessage:e.message,stack:e.stack,componentStack:e.componentStack}),r$=({fatal:e,onRetry:t})=>{qv({id:"fatal-error",open:!0});const[n,r]=_.useState(!1),o=()=>{window.location.reload()},s=()=>{if(t){t();return}o()},a=()=>{const f=oh(Bu(pk(e)));window.open(f,"_blank","noopener,noreferrer")},u=async()=>{const f=Fre(Bu(pk(e)));await navigator.clipboard.writeText(f),r(!0),window.setTimeout(()=>r(!1),2e3)},c=e.recoverable?"The server returned an unexpected error. This is not your fault — nothing was saved or sent. Retry, or report a bug so we can fix it.":"Something went wrong and this page can't recover. This is not your fault — nothing was saved or sent. Go to your inbox, or report a bug so we can fix it.";return O.jsxs("div",{role:"alert","aria-live":"assertive","data-testid":"fatal-error-overlay",className:"fixed inset-0 z-[1000] flex flex-col items-center justify-center gap-6 bg-red-700 p-6 text-center text-white",children:[O.jsx(XA,{className:"size-16 shrink-0","aria-hidden":"true"}),O.jsxs("div",{className:"max-w-lg space-y-3",children:[O.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Something broke"}),O.jsx("p",{className:"text-base text-red-50",children:c}),O.jsx("p",{className:"break-words font-mono text-sm text-red-100",children:e.message}),O.jsxs("p",{className:"font-mono text-xs text-red-200",children:["Reference: ",e.correlationId]})]}),O.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[e.recoverable?O.jsx("button",{type:"button",onClick:s,className:"inline-flex min-h-11 items-center rounded-md bg-white px-5 text-sm font-semibold text-red-700 transition-colors hover:bg-red-50",children:"Retry"}):O.jsx("a",{href:zre,className:"inline-flex min-h-11 items-center rounded-md bg-white px-5 text-sm font-semibold text-red-700 transition-colors hover:bg-red-50",children:"Go to inbox"}),O.jsx("button",{type:"button",onClick:a,className:"inline-flex min-h-11 items-center rounded-md border border-white/70 px-5 text-sm font-semibold text-white transition-colors hover:bg-white/10",children:"Report a bug"}),O.jsx("button",{type:"button",onClick:u,className:"inline-flex min-h-11 items-center rounded-md border border-white/70 px-5 text-sm font-semibold text-white transition-colors hover:bg-white/10",children:n?"Copied":"Copy full details"})]})]})},jre=({betterAuthEnabled:e,cognitoConfigured:t})=>e?"betterAuth":t?"cognito":"none",oI=e=>jre(e)==="cognito"?Hte:void 0,Bre="Fetch Error",Hre=429,sI=(e,t)=>{if(e&&typeof e=="object"&&t in e){const n=e[t];if(typeof n=="string"&&n.trim().length>0)return n}},Cf=e=>sI(e,"message"),qre=e=>Xv(e)?!1:sI(e,"statusText")===Bre?!0:hn(e)===void 0,o$=e=>{if(qre(e))return"network";const t=hn(e);return t===void 0?"fatal":t===Hre?"rateLimited":t===404||t>=500?"fatal":Cf(e)?"validation":"fatal"},Vre="Can't reach the server. You may be offline — check your connection and try again.",Wre="Too many requests from this address. Everyone behind the same address — other people on this network, and every tab you have open — shares one limit. Wait a minute and try again.",Gre=(e,t)=>t==="network"?Vre:t==="rateLimited"?Wre:Cf(e)??"Please check your details and try again.",Kre=e=>{const t=hn(e);if(t===void 0)return"no response";const n=sI(e,"statusText");return n?`${t} ${n}`:String(t)},Zre=(e,t)=>{const n=Kre(e),r=hn(e)===404?"The endpoint did not respond as expected — check that the backend is running and up to date (see the deployment guide's troubleshooting section).":"The server returned an unexpected response.",o=Cf(e),s=o?` Server said: ${o}.`:"";return`${t.method} ${t.path} failed: ${n}. ${r}${s}`},Yre=(e,t)=>{ju(new Error(Zre(e,t)),{recoverable:!1})},Qre={SIGN_IN_DISABLED:"signInOff",ACCOUNT_DISABLED:"accountDisabled"},iI=e=>{if(hn(e)!==403||!e||typeof e!="object"||!("code"in e))return;const{code:t}=e;return typeof t=="string"?Qre[t]:void 0},Xre=/\/reset-password\/([^/]+)\/?$/,Jre=e=>{const t=Xre.exec(e);return t?.[1]?decodeURIComponent(t[1]):void 0},eoe="Your password was not set",toe=e=>oh({...Bu({title:`Reset password: ${e}`,errorMessage:e}),href:`${window.location.origin}/reset-password/<token>`}),noe=e=>{if(iI(e)==="signInOff")return{kind:"signInOff"};const t=e&&typeof e=="object"&&"code"in e?e.code:void 0;if(t==="INVALID_TOKEN")return{kind:"deadLink"};if(t==="PASSWORD_TOO_SHORT"||t==="PASSWORD_TOO_LONG")return{kind:"password",message:Cf(e)??"Use 12 to 128 characters."};const n=o$(e);if(n==="network")return{kind:"inline",message:"Can't reach the server. You may be offline. Check your connection and try again."};if(n==="rateLimited")return{kind:"inline",message:"Too many tries from this address. Wait a minute and try again."};const r=hn(e),o=Cf(e);return{kind:"server",message:`${eoe}. The server answered ${r??"nothing"}${o?`: ${o}`:""}.`}};function roe({token:e,onDone:t}){const[n,r]=_.useState(""),[o,s]=_.useState(null),[a,u]=_.useState(!1),c=_.useRef(null);_.useEffect(()=>{c.current?.focus()},[]);const f=async h=>{if(h.preventDefault(),a)return;s(null),u(!0);const g=await qa.resetPassword({newPassword:n,token:e}).then(m=>m.error??null,m=>m);if(u(!1),!g){t();return}s(noe(g))};return O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsxs("form",{onSubmit:f,className:"mt-6 flex flex-col gap-4 rounded-lg border border-line bg-surface p-7 shadow-lg",children:[O.jsx("h1",{className:"text-base font-semibold text-fg",children:"Choose a new password"}),o?.kind==="deadLink"&&O.jsx(Zr,{tone:"danger",children:"This link no longer works. Ask for a new one."}),o?.kind==="signInOff"&&O.jsxs(Zr,{tone:"info",children:[O.jsx("p",{className:"font-medium",children:"Sign-in is turned off on this server."}),O.jsx("p",{className:"mt-1",children:"The link works once the person who runs this server turns sign-in back on."})]}),o?.kind==="inline"&&O.jsx(Zr,{tone:"danger",children:o.message}),o?.kind==="server"&&O.jsxs(Zr,{tone:"danger",children:[O.jsx("p",{children:o.message}),O.jsx("a",{href:toe(o.message),target:"_blank",rel:"noreferrer",className:"mt-1 inline-block font-medium text-accent hover:underline",children:"Report an issue"})]}),O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"reset-new-password",className:"text-fg-muted",children:"New password"}),O.jsx(jF,{ref:c,id:"reset-new-password",autoComplete:"new-password",value:n,onChange:h=>{r(h.target.value),o?.kind==="password"&&s(null)},placeholder:"12 to 128 characters","aria-invalid":o?.kind==="password","aria-describedby":"reset-new-password-hint",required:!0}),O.jsx("p",{id:"reset-new-password-hint",className:"text-xs text-fg-muted",children:o?.kind==="password"?O.jsx("span",{className:"text-danger",role:"alert",children:o.message}):"Use 12 to 128 characters. Spaces and any symbols are fine. A long phrase is easy to remember."})]}),O.jsx(Xr,{type:"submit","aria-busy":a,children:"Set password"})]}),O.jsx(tI,{note:oI({betterAuthEnabled:!0,cognitoConfigured:!1})})]})}const ooe=({onRetry:e,onReport:t})=>O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-line bg-surface p-7 shadow-lg",children:[O.jsxs(Zr,{tone:"warning",children:[O.jsx("p",{className:"font-medium",children:"Too many requests from this address"}),O.jsx("p",{className:"mt-1",children:"The server is limiting requests from your network address, so it could not check whether you are signed in. You have not been signed out."})]}),O.jsx("p",{className:"text-sm text-fg-muted",children:"Wait a minute and try again. Everyone behind the same address — other people on this network, and every tab you have open — shares one limit."}),O.jsx(Xr,{onClick:e,children:"Try again"}),O.jsx(Xr,{variant:"ghost",size:"sm",onClick:t,children:"Report an issue"})]})]}),soe=429,ioe=({data:e,isPending:t,error:n})=>{const r=iI(n);return r?{kind:"refused",refusal:r}:e?{kind:"active"}:t?{kind:"pending"}:hn(n)===soe?{kind:"rateLimited"}:{kind:"signedOut"}},aoe={method:"POST",path:"/api/auth/sign-up/email"},loe={method:"POST",path:"/api/auth/sign-in/email"},uoe=({notice:e})=>{const t=_.useRef(null);return _.useEffect(()=>{t.current?.focus()},[]),O.jsxs("div",{ref:t,tabIndex:-1,className:"outline-none",children:[e==="signInOff"&&O.jsxs(Zr,{tone:"info",children:[O.jsx("p",{className:"font-medium",children:"Sign-in is turned off on this server."}),O.jsx("p",{className:"mt-1",children:"The person who runs this server turned it off. Ask them when it is back."})]}),e==="accountDisabled"&&O.jsxs(Zr,{tone:"danger",children:[O.jsx("p",{className:"font-medium",children:"This account is disabled."}),O.jsx("p",{className:"mt-1",children:"Ask the person who runs this server."})]}),e==="passwordChanged"&&O.jsx(Zr,{tone:"success",children:"Password changed. Sign in with your new password."})]})},gk=({notice:e})=>{const[t,n]=_.useState("signIn"),[r,o]=_.useState(""),[s,a]=_.useState(""),[u,c]=_.useState(""),[f,h]=_.useState(null),[g,m]=_.useState(!1),[v,w]=_.useState(!1),[S,C]=_.useState(e),E=S==="signInOff",A=v||E?"signIn":t,I=(N,M)=>{const R=iI(N);if(R){C(R);return}if(XJ(N)){w(!0),n("signIn");return}const k=o$(N);if(k==="fatal"){Yre(N,M);return}h(Gre(N,k))},T=async N=>{if(N.preventDefault(),g)return;h(null),C(void 0),m(!0);const M=A==="signUp"?aoe:loe,R=await(A==="signUp"?qa.signUp.email({email:s,password:u,name:r}):qa.signIn.email({email:s,password:u})).then(k=>k.error??null,k=>k);m(!1),R&&I(R,M)};return O.jsxs(O.Fragment,{children:[O.jsx(n$,{}),O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsxs("form",{onSubmit:T,className:"mt-6 flex flex-col gap-4 rounded-lg border border-line bg-surface p-7 shadow-lg",children:[S&&O.jsx(uoe,{notice:S},S),E?null:v?O.jsx(Zr,{tone:"info",children:"New signups are currently closed. Sign in with an existing account, or contact your administrator for access."}):O.jsxs("div",{className:"flex gap-1",children:[O.jsx(Xr,{size:"sm",variant:A==="signIn"?"secondary":"ghost","aria-pressed":A==="signIn",onClick:()=>n("signIn"),children:"Sign in"}),O.jsx(Xr,{size:"sm",variant:A==="signUp"?"secondary":"ghost","aria-pressed":A==="signUp",onClick:()=>n("signUp"),children:"Create account"})]}),f&&O.jsx(Zr,{tone:"danger",children:f}),A==="signUp"&&O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"ba-name",className:"text-fg-muted",children:"Name"}),O.jsx(bf,{id:"ba-name",type:"text",autoComplete:"name",value:r,onChange:N=>o(N.target.value),placeholder:"Your name",required:!0})]}),O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"ba-email",className:"text-fg-muted",children:"Email"}),O.jsx(bf,{id:"ba-email",type:"email",autoComplete:"email",value:s,onChange:N=>a(N.target.value),placeholder:"you@example.com",required:!0,disabled:E})]}),O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"ba-password",className:"text-fg-muted",children:"Password"}),O.jsx(jF,{id:"ba-password",autoComplete:A==="signUp"?"new-password":"current-password",value:u,onChange:N=>c(N.target.value),placeholder:"Your password",required:!0,disabled:E})]}),O.jsx(Xr,{type:"submit",disabled:E,children:A==="signUp"?"Create account":"Sign in"})]}),O.jsx(tI,{note:oI({betterAuthEnabled:Hv(),cognitoConfigured:!1})})]})]})},coe=({session:e,onRetry:t,notice:n,children:r})=>{const o=ioe(e);return o.kind==="active"?O.jsx(O.Fragment,{children:r}):o.kind==="pending"?O.jsx(Kv,{}):o.kind==="rateLimited"?O.jsx(ooe,{onRetry:t,onReport:$re}):o.kind==="refused"?O.jsx(gk,{notice:o.refusal},o.refusal):O.jsx(gk,{notice:n})},doe=({children:e})=>{const{data:t,isPending:n,error:r,refetch:o}=qa.useSession(),[s,a]=_.useState(()=>Jre(window.location.pathname)),[u,c]=_.useState(void 0);return s?O.jsx(roe,{token:s,onDone:()=>{window.history.replaceState(null,"","/"),a(void 0),c("passwordChanged")}}):O.jsx(coe,{session:{data:t,isPending:n,error:r},onRetry:()=>{o()},notice:u,children:e})},foe=({children:e,fallback:t=null})=>{const{data:n}=qa.useSession();if(!n)return O.jsx(O.Fragment,{children:t});const r=async()=>{await qa.signOut(),QA()};return O.jsx(O.Fragment,{children:e({email:n.user.email??null,signOut:r})})},Om={configure:()=>{},getToken:uee,resetToken:QA,Shell:doe,Account:foe};var W1,mk;function hoe(){if(mk)return W1;mk=1;function e(){this.__data__=[],this.size=0}return W1=e,W1}var G1,vk;function sh(){if(vk)return G1;vk=1;function e(t,n){return t===n||t!==t&&n!==n}return G1=e,G1}var K1,yk;function ny(){if(yk)return K1;yk=1;var e=sh();function t(n,r){for(var o=n.length;o--;)if(e(n[o][0],r))return o;return-1}return K1=t,K1}var Z1,bk;function poe(){if(bk)return Z1;bk=1;var e=ny(),t=Array.prototype,n=t.splice;function r(o){var s=this.__data__,a=e(s,o);if(a<0)return!1;var u=s.length-1;return a==u?s.pop():n.call(s,a,1),--this.size,!0}return Z1=r,Z1}var Y1,Sk;function goe(){if(Sk)return Y1;Sk=1;var e=ny();function t(n){var r=this.__data__,o=e(r,n);return o<0?void 0:r[o][1]}return Y1=t,Y1}var Q1,wk;function moe(){if(wk)return Q1;wk=1;var e=ny();function t(n){return e(this.__data__,n)>-1}return Q1=t,Q1}var X1,Ck;function voe(){if(Ck)return X1;Ck=1;var e=ny();function t(n,r){var o=this.__data__,s=e(o,n);return s<0?(++this.size,o.push([n,r])):o[s][1]=r,this}return X1=t,X1}var J1,Ek;function ry(){if(Ek)return J1;Ek=1;var e=hoe(),t=poe(),n=goe(),r=moe(),o=voe();function s(a){var u=-1,c=a==null?0:a.length;for(this.clear();++u<c;){var f=a[u];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=o,J1=s,J1}var eS,_k;function yoe(){if(_k)return eS;_k=1;var e=ry();function t(){this.__data__=new e,this.size=0}return eS=t,eS}var tS,xk;function boe(){if(xk)return tS;xk=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return tS=e,tS}var nS,Ak;function Soe(){if(Ak)return nS;Ak=1;function e(t){return this.__data__.get(t)}return nS=e,nS}var rS,Ik;function woe(){if(Ik)return rS;Ik=1;function e(t){return this.__data__.has(t)}return rS=e,rS}var oS,Rk;function s$(){if(Rk)return oS;Rk=1;var e=typeof Up=="object"&&Up&&Up.Object===Object&&Up;return oS=e,oS}var sS,Tk;function Go(){if(Tk)return sS;Tk=1;var e=s$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return sS=n,sS}var iS,Ok;function oy(){if(Ok)return iS;Ok=1;var e=Go(),t=e.Symbol;return iS=t,iS}var aS,Mk;function Coe(){if(Mk)return aS;Mk=1;var e=oy(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function s(a){var u=n.call(a,o),c=a[o];try{a[o]=void 0;var f=!0}catch{}var h=r.call(a);return f&&(u?a[o]=c:delete a[o]),h}return aS=s,aS}var lS,Pk;function Eoe(){if(Pk)return lS;Pk=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return lS=n,lS}var uS,Nk;function mc(){if(Nk)return uS;Nk=1;var e=oy(),t=Coe(),n=Eoe(),r="[object Null]",o="[object Undefined]",s=e?e.toStringTag:void 0;function a(u){return u==null?u===void 0?o:r:s&&s in Object(u)?t(u):n(u)}return uS=a,uS}var cS,kk;function Bs(){if(kk)return cS;kk=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return cS=e,cS}var dS,Dk;function aI(){if(Dk)return dS;Dk=1;var e=mc(),t=Bs(),n="[object AsyncFunction]",r="[object Function]",o="[object GeneratorFunction]",s="[object Proxy]";function a(u){if(!t(u))return!1;var c=e(u);return c==r||c==o||c==n||c==s}return dS=a,dS}var fS,Lk;function _oe(){if(Lk)return fS;Lk=1;var e=Go(),t=e["__core-js_shared__"];return fS=t,fS}var hS,Uk;function xoe(){if(Uk)return hS;Uk=1;var e=_oe(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return hS=n,hS}var pS,Fk;function i$(){if(Fk)return pS;Fk=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return pS=n,pS}var gS,$k;function Aoe(){if($k)return gS;$k=1;var e=aI(),t=xoe(),n=Bs(),r=i$(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,a=Function.prototype,u=Object.prototype,c=a.toString,f=u.hasOwnProperty,h=RegExp("^"+c.call(f).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(m){if(!n(m)||t(m))return!1;var v=e(m)?h:s;return v.test(r(m))}return gS=g,gS}var mS,zk;function Ioe(){if(zk)return mS;zk=1;function e(t,n){return t?.[n]}return mS=e,mS}var vS,jk;function il(){if(jk)return vS;jk=1;var e=Aoe(),t=Ioe();function n(r,o){var s=t(r,o);return e(s)?s:void 0}return vS=n,vS}var yS,Bk;function lI(){if(Bk)return yS;Bk=1;var e=il(),t=Go(),n=e(t,"Map");return yS=n,yS}var bS,Hk;function sy(){if(Hk)return bS;Hk=1;var e=il(),t=e(Object,"create");return bS=t,bS}var SS,qk;function Roe(){if(qk)return SS;qk=1;var e=sy();function t(){this.__data__=e?e(null):{},this.size=0}return SS=t,SS}var wS,Vk;function Toe(){if(Vk)return wS;Vk=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return wS=e,wS}var CS,Wk;function Ooe(){if(Wk)return CS;Wk=1;var e=sy(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function o(s){var a=this.__data__;if(e){var u=a[s];return u===t?void 0:u}return r.call(a,s)?a[s]:void 0}return CS=o,CS}var ES,Gk;function Moe(){if(Gk)return ES;Gk=1;var e=sy(),t=Object.prototype,n=t.hasOwnProperty;function r(o){var s=this.__data__;return e?s[o]!==void 0:n.call(s,o)}return ES=r,ES}var _S,Kk;function Poe(){if(Kk)return _S;Kk=1;var e=sy(),t="__lodash_hash_undefined__";function n(r,o){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&o===void 0?t:o,this}return _S=n,_S}var xS,Zk;function Noe(){if(Zk)return xS;Zk=1;var e=Roe(),t=Toe(),n=Ooe(),r=Moe(),o=Poe();function s(a){var u=-1,c=a==null?0:a.length;for(this.clear();++u<c;){var f=a[u];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=o,xS=s,xS}var AS,Yk;function koe(){if(Yk)return AS;Yk=1;var e=Noe(),t=ry(),n=lI();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return AS=r,AS}var IS,Qk;function Doe(){if(Qk)return IS;Qk=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return IS=e,IS}var RS,Xk;function iy(){if(Xk)return RS;Xk=1;var e=Doe();function t(n,r){var o=n.__data__;return e(r)?o[typeof r=="string"?"string":"hash"]:o.map}return RS=t,RS}var TS,Jk;function Loe(){if(Jk)return TS;Jk=1;var e=iy();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return TS=t,TS}var OS,e3;function Uoe(){if(e3)return OS;e3=1;var e=iy();function t(n){return e(this,n).get(n)}return OS=t,OS}var MS,t3;function Foe(){if(t3)return MS;t3=1;var e=iy();function t(n){return e(this,n).has(n)}return MS=t,MS}var PS,n3;function $oe(){if(n3)return PS;n3=1;var e=iy();function t(n,r){var o=e(this,n),s=o.size;return o.set(n,r),this.size+=o.size==s?0:1,this}return PS=t,PS}var NS,r3;function uI(){if(r3)return NS;r3=1;var e=koe(),t=Loe(),n=Uoe(),r=Foe(),o=$oe();function s(a){var u=-1,c=a==null?0:a.length;for(this.clear();++u<c;){var f=a[u];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=o,NS=s,NS}var kS,o3;function zoe(){if(o3)return kS;o3=1;var e=ry(),t=lI(),n=uI(),r=200;function o(s,a){var u=this.__data__;if(u instanceof e){var c=u.__data__;if(!t||c.length<r-1)return c.push([s,a]),this.size=++u.size,this;u=this.__data__=new n(c)}return u.set(s,a),this.size=u.size,this}return kS=o,kS}var DS,s3;function cI(){if(s3)return DS;s3=1;var e=ry(),t=yoe(),n=boe(),r=Soe(),o=woe(),s=zoe();function a(u){var c=this.__data__=new e(u);this.size=c.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=o,a.prototype.set=s,DS=a,DS}var LS,i3;function joe(){if(i3)return LS;i3=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return LS=t,LS}var US,a3;function Boe(){if(a3)return US;a3=1;function e(t){return this.__data__.has(t)}return US=e,US}var FS,l3;function Hoe(){if(l3)return FS;l3=1;var e=uI(),t=joe(),n=Boe();function r(o){var s=-1,a=o==null?0:o.length;for(this.__data__=new e;++s<a;)this.add(o[s])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,FS=r,FS}var $S,u3;function qoe(){if(u3)return $S;u3=1;function e(t,n){for(var r=-1,o=t==null?0:t.length;++r<o;)if(n(t[r],r,t))return!0;return!1}return $S=e,$S}var zS,c3;function Voe(){if(c3)return zS;c3=1;function e(t,n){return t.has(n)}return zS=e,zS}var jS,d3;function a$(){if(d3)return jS;d3=1;var e=Hoe(),t=qoe(),n=Voe(),r=1,o=2;function s(a,u,c,f,h,g){var m=c&r,v=a.length,w=u.length;if(v!=w&&!(m&&w>v))return!1;var S=g.get(a),C=g.get(u);if(S&&C)return S==u&&C==a;var E=-1,A=!0,I=c&o?new e:void 0;for(g.set(a,u),g.set(u,a);++E<v;){var T=a[E],N=u[E];if(f)var M=m?f(N,T,E,u,a,g):f(T,N,E,a,u,g);if(M!==void 0){if(M)continue;A=!1;break}if(I){if(!t(u,function(R,k){if(!n(I,k)&&(T===R||h(T,R,c,f,g)))return I.push(k)})){A=!1;break}}else if(!(T===N||h(T,N,c,f,g))){A=!1;break}}return g.delete(a),g.delete(u),A}return jS=s,jS}var BS,f3;function l$(){if(f3)return BS;f3=1;var e=Go(),t=e.Uint8Array;return BS=t,BS}var HS,h3;function Woe(){if(h3)return HS;h3=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(o,s){r[++n]=[s,o]}),r}return HS=e,HS}var qS,p3;function Goe(){if(p3)return qS;p3=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(o){r[++n]=o}),r}return qS=e,qS}var VS,g3;function Koe(){if(g3)return VS;g3=1;var e=oy(),t=l$(),n=sh(),r=a$(),o=Woe(),s=Goe(),a=1,u=2,c="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Map]",m="[object Number]",v="[object RegExp]",w="[object Set]",S="[object String]",C="[object Symbol]",E="[object ArrayBuffer]",A="[object DataView]",I=e?e.prototype:void 0,T=I?I.valueOf:void 0;function N(M,R,k,L,q,F,D){switch(k){case A:if(M.byteLength!=R.byteLength||M.byteOffset!=R.byteOffset)return!1;M=M.buffer,R=R.buffer;case E:return!(M.byteLength!=R.byteLength||!F(new t(M),new t(R)));case c:case f:case m:return n(+M,+R);case h:return M.name==R.name&&M.message==R.message;case v:case S:return M==R+"";case g:var j=o;case w:var Z=L&a;if(j||(j=s),M.size!=R.size&&!Z)return!1;var he=D.get(M);if(he)return he==R;L|=u,D.set(M,R);var B=r(j(M),j(R),L,q,F,D);return D.delete(M),B;case C:if(T)return T.call(M)==T.call(R)}return!1}return VS=N,VS}var WS,m3;function u$(){if(m3)return WS;m3=1;function e(t,n){for(var r=-1,o=n.length,s=t.length;++r<o;)t[s+r]=n[r];return t}return WS=e,WS}var GS,v3;function Hs(){if(v3)return GS;v3=1;var e=Array.isArray;return GS=e,GS}var KS,y3;function c$(){if(y3)return KS;y3=1;var e=u$(),t=Hs();function n(r,o,s){var a=o(r);return t(r)?a:e(a,s(r))}return KS=n,KS}var ZS,b3;function Zoe(){if(b3)return ZS;b3=1;function e(t,n){for(var r=-1,o=t==null?0:t.length,s=0,a=[];++r<o;){var u=t[r];n(u,r,t)&&(a[s++]=u)}return a}return ZS=e,ZS}var YS,S3;function d$(){if(S3)return YS;S3=1;function e(){return[]}return YS=e,YS}var QS,w3;function f$(){if(w3)return QS;w3=1;var e=Zoe(),t=d$(),n=Object.prototype,r=n.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(a){return a==null?[]:(a=Object(a),e(o(a),function(u){return r.call(a,u)}))}:t;return QS=s,QS}var XS,C3;function Yoe(){if(C3)return XS;C3=1;function e(t,n){for(var r=-1,o=Array(t);++r<t;)o[r]=n(r);return o}return XS=e,XS}var JS,E3;function al(){if(E3)return JS;E3=1;function e(t){return t!=null&&typeof t=="object"}return JS=e,JS}var ew,_3;function Qoe(){if(_3)return ew;_3=1;var e=mc(),t=al(),n="[object Arguments]";function r(o){return t(o)&&e(o)==n}return ew=r,ew}var tw,x3;function dI(){if(x3)return tw;x3=1;var e=Qoe(),t=al(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!o.call(a,"callee")};return tw=s,tw}var qd={exports:{}},nw,A3;function Xoe(){if(A3)return nw;A3=1;function e(){return!1}return nw=e,nw}qd.exports;var I3;function fI(){return I3||(I3=1,(function(e,t){var n=Go(),r=Xoe(),o=t&&!t.nodeType&&t,s=o&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===o,u=a?n.Buffer:void 0,c=u?u.isBuffer:void 0,f=c||r;e.exports=f})(qd,qd.exports)),qd.exports}var rw,R3;function ay(){if(R3)return rw;R3=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,o){var s=typeof r;return o=o??e,!!o&&(s=="number"||s!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<o}return rw=n,rw}var ow,T3;function hI(){if(T3)return ow;T3=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return ow=t,ow}var sw,O3;function Joe(){if(O3)return sw;O3=1;var e=mc(),t=hI(),n=al(),r="[object Arguments]",o="[object Array]",s="[object Boolean]",a="[object Date]",u="[object Error]",c="[object Function]",f="[object Map]",h="[object Number]",g="[object Object]",m="[object RegExp]",v="[object Set]",w="[object String]",S="[object WeakMap]",C="[object ArrayBuffer]",E="[object DataView]",A="[object Float32Array]",I="[object Float64Array]",T="[object Int8Array]",N="[object Int16Array]",M="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",F={};F[A]=F[I]=F[T]=F[N]=F[M]=F[R]=F[k]=F[L]=F[q]=!0,F[r]=F[o]=F[C]=F[s]=F[E]=F[a]=F[u]=F[c]=F[f]=F[h]=F[g]=F[m]=F[v]=F[w]=F[S]=!1;function D(j){return n(j)&&t(j.length)&&!!F[e(j)]}return sw=D,sw}var iw,M3;function ese(){if(M3)return iw;M3=1;function e(t){return function(n){return t(n)}}return iw=e,iw}var Vd={exports:{}};Vd.exports;var P3;function tse(){return P3||(P3=1,(function(e,t){var n=s$(),r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===r,a=s&&n.process,u=(function(){try{var c=o&&o.require&&o.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}})();e.exports=u})(Vd,Vd.exports)),Vd.exports}var aw,N3;function pI(){if(N3)return aw;N3=1;var e=Joe(),t=ese(),n=tse(),r=n&&n.isTypedArray,o=r?t(r):e;return aw=o,aw}var lw,k3;function h$(){if(k3)return lw;k3=1;var e=Yoe(),t=dI(),n=Hs(),r=fI(),o=ay(),s=pI(),a=Object.prototype,u=a.hasOwnProperty;function c(f,h){var g=n(f),m=!g&&t(f),v=!g&&!m&&r(f),w=!g&&!m&&!v&&s(f),S=g||m||v||w,C=S?e(f.length,String):[],E=C.length;for(var A in f)(h||u.call(f,A))&&!(S&&(A=="length"||v&&(A=="offset"||A=="parent")||w&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||o(A,E)))&&C.push(A);return C}return lw=c,lw}var uw,D3;function gI(){if(D3)return uw;D3=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,o=typeof r=="function"&&r.prototype||e;return n===o}return uw=t,uw}var cw,L3;function p$(){if(L3)return cw;L3=1;function e(t,n){return function(r){return t(n(r))}}return cw=e,cw}var dw,U3;function nse(){if(U3)return dw;U3=1;var e=p$(),t=e(Object.keys,Object);return dw=t,dw}var fw,F3;function rse(){if(F3)return fw;F3=1;var e=gI(),t=nse(),n=Object.prototype,r=n.hasOwnProperty;function o(s){if(!e(s))return t(s);var a=[];for(var u in Object(s))r.call(s,u)&&u!="constructor"&&a.push(u);return a}return fw=o,fw}var hw,$3;function ly(){if($3)return hw;$3=1;var e=aI(),t=hI();function n(r){return r!=null&&t(r.length)&&!e(r)}return hw=n,hw}var pw,z3;function g$(){if(z3)return pw;z3=1;var e=h$(),t=rse(),n=ly();function r(o){return n(o)?e(o):t(o)}return pw=r,pw}var gw,j3;function ose(){if(j3)return gw;j3=1;var e=c$(),t=f$(),n=g$();function r(o){return e(o,n,t)}return gw=r,gw}var mw,B3;function sse(){if(B3)return mw;B3=1;var e=ose(),t=1,n=Object.prototype,r=n.hasOwnProperty;function o(s,a,u,c,f,h){var g=u&t,m=e(s),v=m.length,w=e(a),S=w.length;if(v!=S&&!g)return!1;for(var C=v;C--;){var E=m[C];if(!(g?E in a:r.call(a,E)))return!1}var A=h.get(s),I=h.get(a);if(A&&I)return A==a&&I==s;var T=!0;h.set(s,a),h.set(a,s);for(var N=g;++C<v;){E=m[C];var M=s[E],R=a[E];if(c)var k=g?c(R,M,E,a,s,h):c(M,R,E,s,a,h);if(!(k===void 0?M===R||f(M,R,u,c,h):k)){T=!1;break}N||(N=E=="constructor")}if(T&&!N){var L=s.constructor,q=a.constructor;L!=q&&"constructor"in s&&"constructor"in a&&!(typeof L=="function"&&L instanceof L&&typeof q=="function"&&q instanceof q)&&(T=!1)}return h.delete(s),h.delete(a),T}return mw=o,mw}var vw,H3;function ise(){if(H3)return vw;H3=1;var e=il(),t=Go(),n=e(t,"DataView");return vw=n,vw}var yw,q3;function ase(){if(q3)return yw;q3=1;var e=il(),t=Go(),n=e(t,"Promise");return yw=n,yw}var bw,V3;function lse(){if(V3)return bw;V3=1;var e=il(),t=Go(),n=e(t,"Set");return bw=n,bw}var Sw,W3;function use(){if(W3)return Sw;W3=1;var e=il(),t=Go(),n=e(t,"WeakMap");return Sw=n,Sw}var ww,G3;function cse(){if(G3)return ww;G3=1;var e=ise(),t=lI(),n=ase(),r=lse(),o=use(),s=mc(),a=i$(),u="[object Map]",c="[object Object]",f="[object Promise]",h="[object Set]",g="[object WeakMap]",m="[object DataView]",v=a(e),w=a(t),S=a(n),C=a(r),E=a(o),A=s;return(e&&A(new e(new ArrayBuffer(1)))!=m||t&&A(new t)!=u||n&&A(n.resolve())!=f||r&&A(new r)!=h||o&&A(new o)!=g)&&(A=function(I){var T=s(I),N=T==c?I.constructor:void 0,M=N?a(N):"";if(M)switch(M){case v:return m;case w:return u;case S:return f;case C:return h;case E:return g}return T}),ww=A,ww}var Cw,K3;function dse(){if(K3)return Cw;K3=1;var e=cI(),t=a$(),n=Koe(),r=sse(),o=cse(),s=Hs(),a=fI(),u=pI(),c=1,f="[object Arguments]",h="[object Array]",g="[object Object]",m=Object.prototype,v=m.hasOwnProperty;function w(S,C,E,A,I,T){var N=s(S),M=s(C),R=N?h:o(S),k=M?h:o(C);R=R==f?g:R,k=k==f?g:k;var L=R==g,q=k==g,F=R==k;if(F&&a(S)){if(!a(C))return!1;N=!0,L=!1}if(F&&!L)return T||(T=new e),N||u(S)?t(S,C,E,A,I,T):n(S,C,R,E,A,I,T);if(!(E&c)){var D=L&&v.call(S,"__wrapped__"),j=q&&v.call(C,"__wrapped__");if(D||j){var Z=D?S.value():S,he=j?C.value():C;return T||(T=new e),I(Z,he,E,A,T)}}return F?(T||(T=new e),r(S,C,E,A,I,T)):!1}return Cw=w,Cw}var Ew,Z3;function m$(){if(Z3)return Ew;Z3=1;var e=dse(),t=al();function n(r,o,s,a,u){return r===o?!0:r==null||o==null||!t(r)&&!t(o)?r!==r&&o!==o:e(r,o,s,a,n,u)}return Ew=n,Ew}var _w={exports:{}},xw={};var Y3;function fse(){if(Y3)return xw;Y3=1;var e=rh(),t=pee();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,u=e.useMemo,c=e.useDebugValue;return xw.useSyncExternalStoreWithSelector=function(f,h,g,m,v){var w=s(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function E(M){if(!A){if(A=!0,I=M,M=m(M),v!==void 0&&S.hasValue){var R=S.value;if(v(R,M))return T=R}return T=M}if(R=T,r(I,M))return R;var k=m(M);return v!==void 0&&v(R,k)?(I=M,R):(I=M,T=k)}var A=!1,I,T,N=g===void 0?null:g;return[function(){return E(h())},N===null?void 0:function(){return E(N())}]},[h,g,m,v]);var C=o(f,w[0],w[1]);return a(function(){S.hasValue=!0,S.value=C},[C]),c(C),C},xw}var Q3;function hse(){return Q3||(Q3=1,_w.exports=fse()),_w.exports}var v$=hse();var ce=function(){return ce=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ce.apply(this,arguments)};function mI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function et(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lt(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(u){a={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}function $t(e,t,n){if(arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var wt;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(wt||(wt={}));var Va;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(Va||(Va={}));var j_=wt.Start,vI=wt.Stop,ih=wt.Raise,uy=wt.Send,y$=wt.Cancel,pse=wt.NullEvent,yI=wt.Assign;wt.After;wt.DoneState;var b$=wt.Log,gse=wt.Init,B_=wt.Invoke;wt.ErrorExecution;var X3=wt.ErrorPlatform,mse=wt.ErrorCustom,bI=wt.Update,vse=wt.Choose,yse=wt.Pure,S$=".",J3={},H_="xstate.guard",bse="",Kp;function SI(e,t,n){n===void 0&&(n=S$);var r=of(e,n),o=of(t,n);return dt(o)?dt(r)?o===r:!1:dt(r)?r in o:Object.keys(r).every(function(s){return s in o?SI(r[s],o[s]):!1})}function w$(e){try{return dt(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function q_(e,t){try{return vc(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function Sse(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function of(e,t){if(Sse(e))return e.value;if(vc(e))return Mm(e);if(typeof e!="string")return e;var n=q_(e,t);return Mm(n)}function Mm(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function Wd(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var s=r[o];n[s]=t(e[s],s,e,o)}return n}function eD(e,t,n){var r,o,s={};try{for(var a=et(Object.keys(e)),u=a.next();!u.done;u=a.next()){var c=u.value,f=e[c];n(f)&&(s[c]=t(f,c,e))}}catch(h){r={error:h}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return s}var wse=function(e){return function(t){var n,r,o=t;try{for(var s=et(e),a=s.next();!a.done;a=s.next()){var u=a.value;o=o[u]}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}};function Cse(e,t){return function(n){var r,o,s=n;try{for(var a=et(e),u=a.next();!u.done;u=a.next()){var c=u.value;s=s[t][c]}}catch(f){r={error:f}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return s}}function om(e){if(!e)return[[]];if(dt(e))return[[e]];var t=Gt(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:om(e[n]).map(function(o){return[n].concat(o)})}));return t}function Gt(e){var t;return(t=[]).concat.apply(t,$t([],lt(e),!1))}function C$(e){return vc(e)?e:[e]}function uo(e){return e===void 0?[]:C$(e)}function Pm(e,t,n){var r,o;if(ft(e))return e(t,n.data);var s={};try{for(var a=et(Object.keys(e)),u=a.next();!u.done;u=a.next()){var c=u.value,f=e[c];ft(f)?s[c]=f(t,n.data):s[c]=f}}catch(h){r={error:h}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return s}function Ese(e){return/^(done|error)\./.test(e)}function tD(e){return!!(e instanceof Promise||e!==null&&(ft(e)||typeof e=="object")&&ft(e.then))}function _se(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function xse(e,t){var n,r,o=lt([[],[]],2),s=o[0],a=o[1];try{for(var u=et(e),c=u.next();!c.done;c=u.next()){var f=c.value;t(f)?s.push(f):a.push(f)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return[s,a]}function E$(e,t){return Wd(e.states,function(n,r){if(n){var o=(dt(t)?void 0:t[r])||(n?n.current:void 0);if(o)return{current:o,states:E$(n,o)}}})}function Ase(e,t){return{current:t,states:E$(e,t)}}function nD(e,t,n,r){var o=e&&n.reduce(function(s,a){var u,c,f=a.assignment,h={state:r,action:a,_event:t},g={};if(ft(f))g=f(s,t.data,h);else try{for(var m=et(Object.keys(f)),v=m.next();!v.done;v=m.next()){var w=v.value,S=f[w];g[w]=ft(S)?S(s,t.data,h):S}}catch(C){u={error:C}}finally{try{v&&!v.done&&(c=m.return)&&c.call(m)}finally{if(u)throw u.error}}return Object.assign({},s,g)},e);return o}var Ise=function(){};function vc(e){return Array.isArray(e)}function ft(e){return typeof e=="function"}function dt(e){return typeof e=="string"}function _$(e,t){if(e)return dt(e)?{type:H_,name:e,predicate:t?t[e]:void 0}:ft(e)?{type:H_,name:e.name,predicate:e}:e}function Rse(e){try{return"subscribe"in e&&ft(e.subscribe)}catch{return!1}}var Ti=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();Kp={},Kp[Ti]=function(){return this},Kp[Symbol.observable]=function(){return this};function Hu(e){return!!e&&"__xstatenode"in e}function Tse(e){return!!e&&typeof e.send=="function"}var Ose=(function(){var e=0;return function(){return e++,e.toString(16)}})();function cy(e,t){return dt(e)||typeof e=="number"?ce({type:e},t):e}function Dn(e,t){if(!dt(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=cy(e);return ce({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function ru(e,t){var n=C$(t).map(function(r){return typeof r>"u"||typeof r=="string"||Hu(r)?{target:r,event:e}:ce(ce({},r),{event:e})});return n}function Mse(e){if(!(e===void 0||e===bse))return uo(e)}function x$(e,t,n,r,o){var s=e.options.guards,a={state:o,cond:t,_event:r};if(t.type===H_)return(s?.[t.name]||t.predicate)(n,r.data,a);var u=s?.[t.type];if(!u)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return u(n,r.data,a)}function A$(e){return typeof e=="string"?{type:e}:e}function sf(e,t,n){var r=function(){},o=typeof e=="object",s=o?e:null;return{next:((o?e.next:e)||r).bind(s),error:((o?e.error:t)||r).bind(s),complete:((o?e.complete:n)||r).bind(s)}}function Zp(e,t){return"".concat(e,":invocation[").concat(t,"]")}function V_(e){return(e.type===ih||e.type===uy&&e.to===Va.Internal)&&typeof e.delay!="number"}var Na=Dn({type:gse});function Nm(e,t){return t&&t[e]||void 0}function qu(e,t){var n;if(dt(e)||typeof e=="number"){var r=Nm(e,t);ft(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(ft(e))n={type:e.name||e.toString(),exec:e};else{var r=Nm(e.type,t);if(ft(r))n=ce(ce({},e),{exec:r});else if(r){var o=r.type||e.type;n=ce(ce(ce({},r),e),{type:o})}else n=e}return n}var _s=function(e,t){if(!e)return[];var n=vc(e)?e:[e];return n.map(function(r){return qu(r,t)})};function dy(e){var t=qu(e);return ce(ce({id:dt(e)?e:t.id},t),{type:t.type})}function I$(e,t){return{type:ih,event:typeof e=="function"?e:cy(e),delay:t?t.delay:void 0,id:t?.id}}function R$(e,t,n,r){var o={_event:n},s=Dn(ft(e.event)?e.event(t,n.data,o):e.event),a;if(dt(e.delay)){var u=r&&r[e.delay];a=ft(u)?u(t,n.data,o):u}else a=ft(e.delay)?e.delay(t,n.data,o):e.delay;return ce(ce({},e),{type:ih,_event:s,delay:a})}function fy(e,t){return{to:t?t.to:void 0,type:uy,event:ft(e)?e:cy(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:ft(e)?e.name:w$(e)}}function T$(e,t,n,r){var o={_event:n},s=Dn(ft(e.event)?e.event(t,n.data,o):e.event),a;if(dt(e.delay)){var u=r&&r[e.delay];a=ft(u)?u(t,n.data,o):u}else a=ft(e.delay)?e.delay(t,n.data,o):e.delay;var c=ft(e.to)?e.to(t,n.data,o):e.to;return ce(ce({},e),{to:c,_event:s,event:s.data,delay:a})}function O$(e,t){return fy(e,ce(ce({},t),{to:Va.Parent}))}function M$(){return O$(bI)}var P$=function(e,t,n){return ce(ce({},e),{value:dt(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},N$=function(e){return{type:y$,sendId:e}};function k$(e){var t=dy(e);return{type:wt.Start,activity:t,exec:void 0}}function D$(e){var t=ft(e)?e:dy(e);return{type:wt.Stop,activity:t,exec:void 0}}function L$(e,t,n){var r=ft(e.activity)?e.activity(t,n.data):e.activity,o=typeof r=="string"?{id:r}:r,s={type:wt.Stop,activity:o};return s}var U$=function(e){return{type:yI,assignment:e}};function F$(e,t){var n=t?"#".concat(t):"";return"".concat(wt.After,"(").concat(e,")").concat(n)}function Gd(e,t){var n="".concat(wt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function af(e,t){var n="".concat(wt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function wu(e,t){var n="".concat(wt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function $$(e,t){return fy(function(n,r){return r},ce(ce({},t),{to:e}))}function Pse(e){return{type:wt.Choose,conds:e}}var Nse=function(e){var t,n,r=[];try{for(var o=et(e),s=o.next();!s.done;s=o.next())for(var a=s.value,u=0;u<a.actions.length;){if(a.actions[u].type===yI){r.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r};function Ef(e,t,n,r,o,s,a){a===void 0&&(a=!1);var u=a?[]:Nse(o),c=u.length?nD(n,r,u,t):n,f=a?[n]:void 0,h=[];function g(w,S){var C;switch(S.type){case ih:{var E=R$(S,c,r,e.options.delays);return s&&typeof E.delay=="number"&&s(E,c,r),E}case uy:var A=T$(S,c,r,e.options.delays);return s&&A.to!==Va.Internal&&(w==="entry"?h.push(A):s(A,c,r)),A;case b$:{var I=P$(S,c,r);return s?.(I,c,r),I}case vse:{var T=S,N=(C=T.conds.find(function(B){var Q=_$(B.cond,e.options.guards);return!Q||x$(e,Q,c,r,s?void 0:t)}))===null||C===void 0?void 0:C.actions;if(!N)return[];var M=lt(Ef(e,t,c,r,[{type:w,actions:_s(uo(N),e.options.actions)}],s,a),2),R=M[0],k=M[1];return c=k,f?.push(c),R}case yse:{var N=S.get(c,r.data);if(!N)return[];var L=lt(Ef(e,t,c,r,[{type:w,actions:_s(uo(N),e.options.actions)}],s,a),2),q=L[0],F=L[1];return c=F,f?.push(c),q}case vI:{var I=L$(S,c,r);return s?.(I,n,r),I}case yI:{c=nD(c,r,[S],s?void 0:t),f?.push(c);break}default:var D=qu(S,e.options.actions),j=D.exec;if(s)s(D,c,r);else if(j&&f){var Z=f.length-1,he=ce(ce({},D),{exec:function(B){for(var Q=[],ae=1;ae<arguments.length;ae++)Q[ae-1]=arguments[ae];j.apply(void 0,$t([f[Z]],lt(Q),!1))}});D=he}return D}}function m(w){var S,C,E=[];try{for(var A=et(w.actions),I=A.next();!I.done;I=A.next()){var T=I.value,N=g(w.type,T);N&&(E=E.concat(N))}}catch(M){S={error:M}}finally{try{I&&!I.done&&(C=A.return)&&C.call(A)}finally{if(S)throw S.error}}return h.forEach(function(M){s(M,c,r)}),h.length=0,E}var v=Gt(o.map(m));return[v,c]}const z$=Object.freeze(Object.defineProperty({__proto__:null,after:F$,assign:U$,cancel:N$,choose:Pse,done:Gd,doneInvoke:af,error:wu,forwardTo:$$,getActionFunction:Nm,initEvent:Na,raise:I$,resolveActions:Ef,resolveLog:P$,resolveRaise:R$,resolveSend:T$,resolveStop:L$,send:fy,sendParent:O$,sendUpdate:M$,start:k$,stop:D$,toActionObject:qu,toActionObjects:_s,toActivityDefinition:dy},Symbol.toStringTag,{value:"Module"}));var km=[],mu=function(e,t){km.push(e);var n=t(e);return km.pop(),n},kse=function(e){return e(km[km.length-1])};function j$(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[Ti]=function(){return this},t}function Dse(e,t,n,r){var o,s=A$(e.src),a=(o=t?.options.services)===null||o===void 0?void 0:o[s.type],u=e.data?Pm(e.data,n,r):void 0,c=a?wI(a,e.id,u):j$(e.id);return c.meta=e,c}function wI(e,t,n){var r=j$(t);if(r.deferred=!0,Hu(e)){var o=r.state=mu(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return o}}return r}function Lse(e){try{return typeof e.send=="function"}catch{return!1}}function Use(e){return Lse(e)&&"id"in e}function Fse(e){var t;return ce((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[Ti]=function(){return this},t),e)}var Dm=function(e){return e.type==="atomic"||e.type==="final"};function B$(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function _f(e){return B$(e).filter(function(t){return t.type!=="history"})}function H$(e){var t=[e];return Dm(e)?t:t.concat(Gt(_f(e).map(H$)))}function Kd(e,t){var n,r,o,s,a,u,c,f,h=new Set(e),g=W_(h),m=new Set(t);try{for(var v=et(m),w=v.next();!w.done;w=v.next())for(var S=w.value,C=S.parent;C&&!m.has(C);)m.add(C),C=C.parent}catch(L){n={error:L}}finally{try{w&&!w.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}var E=W_(m);try{for(var A=et(m),I=A.next();!I.done;I=A.next()){var S=I.value;if(S.type==="compound"&&(!E.get(S)||!E.get(S).length))g.get(S)?g.get(S).forEach(function(q){return m.add(q)}):S.initialStateNodes.forEach(function(q){return m.add(q)});else if(S.type==="parallel")try{for(var T=(a=void 0,et(_f(S))),N=T.next();!N.done;N=T.next()){var M=N.value;m.has(M)||(m.add(M),g.get(M)?g.get(M).forEach(function(q){return m.add(q)}):M.initialStateNodes.forEach(function(q){return m.add(q)}))}}catch(q){a={error:q}}finally{try{N&&!N.done&&(u=T.return)&&u.call(T)}finally{if(a)throw a.error}}}}catch(L){o={error:L}}finally{try{I&&!I.done&&(s=A.return)&&s.call(A)}finally{if(o)throw o.error}}try{for(var R=et(m),k=R.next();!k.done;k=R.next())for(var S=k.value,C=S.parent;C&&!m.has(C);)m.add(C),C=C.parent}catch(L){c={error:L}}finally{try{k&&!k.done&&(f=R.return)&&f.call(R)}finally{if(c)throw c.error}}return m}function q$(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Dm(r))return r.key}else return{}}var o={};return n.forEach(function(s){o[s.key]=q$(s,t)}),o}function W_(e){var t,n,r=new Map;try{for(var o=et(e),s=o.next();!s.done;s=o.next()){var a=s.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function $se(e,t){var n=Kd([e],t);return q$(e,W_(n))}function Zd(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function zse(e){return $t([],lt(new Set(Gt($t([],lt(e.map(function(t){return t.ownEvents})),!1)))),!1)}function sm(e,t){return t.type==="compound"?_f(t).some(function(n){return n.type==="final"&&Zd(e,n)}):t.type==="parallel"?_f(t).every(function(n){return sm(e,n)}):!1}function jse(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function rD(e){return new Set(Gt(e.map(function(t){return t.tags})))}function V$(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(dt(e)||dt(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(o){return V$(e[o],t[o])})}function Bse(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function Hse(e,t){var n=e.exec,r=ce(ce({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var co=(function(){function e(t){var n=this,r;this.actions=[],this.activities=J3,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||J3,this.meta=jse(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&r!==void 0?r:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return zse(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,events:[],configuration:[],transitions:[],children:{}}):t;var r=Na;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=Na;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),dt(t))return[t];var o=Object.keys(t);return o.concat.apply(o,$t([],lt(o.map(function(s){return r.toStrings(t[s],n).map(function(a){return s+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=mI(t,["configuration","transitions","tags","machine"]);return ce(ce({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return SI(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Ise(!!this.machine);var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!r?.transitions.length&&r.transitions.some(function(o){return o.target!==void 0||o.actions.length})},e})(),qse={deferEvents:!1},oD=(function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ce(ce({},qse),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e})(),Aw=new Map,Vse=0,xd={bookId:function(){return"x:".concat(Vse++)},register:function(e,t){return Aw.set(e,t),e},get:function(e){return Aw.get(e)},free:function(e){Aw.delete(e)}};function CI(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Wse(){var e=CI();if(e&&"__xstate__"in e)return e.__xstate__}function Gse(e){if(CI()){var t=Wse();t&&t.register(e)}}function Kse(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,o=[],s=!1,a=function(){if(!s){for(s=!0;o.length>0;){var f=o.shift();n=e.transition(n,f,c),r.forEach(function(h){return h.next(n)})}s=!1}},u=Fse({id:t.id,send:function(f){o.push(f),a()},getSnapshot:function(){return n},subscribe:function(f,h,g){var m=sf(f,h,g);return r.add(m),m.next(n),{unsubscribe:function(){r.delete(m)}}}}),c={parent:t.parent,self:u,id:t.id||"anonymous",observers:r};return n=e.start?e.start(c):n,u}var G_={sync:!1,autoForward:!1},mn;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(mn||(mn={}));var Zse=(function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=mn.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(h,g){if(vc(h))return r.batch(h),r.state;var m=Dn(cy(h,g));if(r.status===mn.Stopped)return r.state;if(r.status!==mn.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(m.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
12
|
+
`,recoverySuggestion:"Make sure a successful call to signIn is made before calling confirmSignInand that the session has not expired."});try{const{Session:f,ChallengeName:h,AuthenticationResult:g,ChallengeParameters:m}=await JY(r,o,s,t,u,dr,c,n);return tl({signInSession:f,username:r,challengeName:h,signInDetails:a}),g?(await js({username:r,...g,NewDeviceMetadata:await nl({userPoolId:u.userPoolId,userPoolEndpoint:u.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:a}),bo(),await Qi(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ol({challengeName:h,challengeParameters:m})}catch(f){eo(f);const h=hc(f.name);if(h)return h;throw f}}const xQ=e=>fn(xn,_n("GetUser"),Un(),{...An,...e}),AQ=e=>fn(xn,_n("VerifyUserAttribute"),Un(),{...An,...e});async function IQ(e){const t=Tt.getConfig().Auth?.Cognito;We(t);const{userPoolEndpoint:n,userPoolId:r}=t,{confirmationCode:o,userAttributeKey:s}=e;Kt(!!o,Ue.EmptyConfirmUserAttributeCode);const{tokens:a}=await Uv({forceRefresh:!1});lc(a),await AQ({endpointResolver:rt({endpointOverride:n})})({region:nt(r),userAgentValue:vt(Fe.ConfirmUserAttribute)},{AccessToken:a.accessToken.toString(),AttributeName:s,Code:o})}new Ln("AuthError");const RQ={oauthSignInError:{message:En.OAUTH_ERROR,log:"Make sure Cognito Hosted UI has been configured correctly"},noConfig:{message:En.DEFAULT_MSG},missingAuthConfig:{message:En.DEFAULT_MSG},emptyUsername:{message:En.EMPTY_USERNAME},invalidUsername:{message:En.INVALID_USERNAME},emptyPassword:{message:En.EMPTY_PASSWORD},emptyCode:{message:En.EMPTY_CODE},signUpError:{message:En.SIGN_UP_ERROR},noMFA:{message:En.NO_MFA},invalidMFA:{message:En.INVALID_MFA},emptyChallengeResponse:{message:En.EMPTY_CHALLENGE},noUserSession:{message:En.NO_USER_SESSION},deviceConfig:{message:En.DEVICE_CONFIG},networkError:{message:En.NETWORK_ERROR},autoSignInError:{message:En.AUTOSIGNIN_ERROR},default:{message:En.DEFAULT_MSG}},zi=(e,t)=>new Oe({message:e??"An error has occurred during the oauth process.",name:jo.OAuthSignInError,recoverySuggestion:RQ.oauthSignInError.log});var I_;(function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError",e.OAuthSignInError="oauthSignInError"})(I_||(I_={}));const TQ="`signInWithRedirect` has been canceled.",OQ="An error occurred while validating the state.",MQ="Try to initiate an OAuth flow from Amplify",Y8=async e=>{const t=await ir.loadOAuthState(),n=e===t?t:void 0;if(!n)throw new Oe({name:I_.OAuthSignInError,message:e===null?TQ:OQ,recoverySuggestion:e===null?void 0:MQ});return n},Q8=async({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,responseType:o,domain:s,preferPrivateSession:a})=>{const u=new Yi(e),c=u.searchParams.get("error"),f=u.searchParams.get("error_description");if(c)throw zi(f??c);return o==="code"?PQ({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,domain:s,preferPrivateSession:a}):NQ({currentUrl:e,redirectUri:r,preferPrivateSession:a})},PQ=async({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,domain:o,preferPrivateSession:s})=>{const a=new Yi(e),u=a.searchParams.get("code"),c=a.searchParams.get("state");if(!u||!c)throw zi("User cancelled OAuth flow.");const f=await Y8(c),h="https://"+o+"/oauth2/token",g=await ir.loadPKCE(),m={grant_type:"authorization_code",code:u,client_id:n,redirect_uri:r,...g?{code_verifier:g}:{}},v=Object.entries(m).map(([M,R])=>`${encodeURIComponent(M)}=${encodeURIComponent(R)}`).join("&"),{access_token:w,refresh_token:S,id_token:C,error:E,error_message:A,token_type:I,expires_in:T}=await(await fetch(h,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",[LW]:t},body:v})).json();if(E)throw zi(A??E);const N=(w&&Ms(w).payload.username)??"username";return await js({username:N,AccessToken:w,IdToken:C,RefreshToken:S}),X8({redirectUri:r,state:f,preferPrivateSession:s})},NQ=async({currentUrl:e,redirectUri:t,preferPrivateSession:n})=>{const r=new Yi(e),{id_token:o,access_token:s,state:a,token_type:u,expires_in:c,error_description:f,error:h}=(r.hash??"#").substring(1).split("&").map(v=>v.split("=")).reduce((v,[w,S])=>({...v,[w]:S}),{id_token:void 0,access_token:void 0,state:void 0,token_type:void 0,expires_in:void 0,error_description:void 0,error:void 0});if(h)throw zi(f??h);if(!s)throw zi("No access token returned from OAuth flow.");const g=await Y8(a),m=(s&&Ms(s).payload.username)??"username";return await js({username:m,AccessToken:s,IdToken:o}),X8({redirectUri:t,state:g,preferPrivateSession:n})},X8=async({redirectUri:e,state:t,preferPrivateSession:n})=>{await dr.setOAuthMetadata({oauthSignIn:!0}),await ir.clearOAuthData(),await ir.storeOAuthSignIn(!0,n),N8(),LQ(e),kQ(t)&&zo.dispatch("auth",{event:"customOAuthState",data:NK(DQ(t))},"Auth",$o),zo.dispatch("auth",{event:"signInWithRedirect"},"Auth",$o),await Qi()},kQ=e=>/-/.test(e),DQ=e=>e.split("-").splice(1).join("-"),LQ=e=>{typeof window<"u"&&typeof window.history<"u"&&window.history.replaceState(window.history.state,"",e)};function WA(e,t){{const n=e?.find(UQ)??e?.find(FQ),r=e?.find(zQ)??e?.find($Q);if(n)return n;throw r?KK:WK}}const UQ=e=>e.startsWith(String(window.location.origin+(window.location.pathname||"/"))),FQ=e=>e.includes(String(window.location.hostname)),$Q=e=>e.startsWith("http://"),zQ=e=>e.startsWith("https://"),GA=async e=>{N8(),await ir.clearOAuthInflightData(),zo.dispatch("auth",{event:"signInWithRedirect_failure",data:{error:e}},"Auth",$o)},jQ=async e=>{try{We(e),Nv(e),ir.setAuthConfig(e)}catch{return}if(await ir.loadOAuthInFlight())try{const t=window.location.href,{loginWith:n,userPoolClientId:r}=e,{domain:o,redirectSignIn:s,responseType:a}=n.oauth,u=WA(s);await Q8({currentUrl:t,clientId:r,domain:o,redirectUri:u,responseType:a,userAgentValue:vt(Fe.SignInWithRedirect)})}catch(t){await GA(t)}};Lv()&&Tt[r8](jQ);const BQ={Google:"Google",Facebook:"Facebook",Amazon:"LoginWithAmazon",Apple:"SignInWithApple"},J8=async e=>{window?.location&&(window.location.href=e.replace("http://","https://"))},kN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",HQ=e=>{const t=new Uint8Array(e);OA().getRandomValues(t);let n="",r;for(const o of t)n+=kN.charAt(o%kN.length);return{value:n,method:"S256",toCodeChallenge(){return r||(r=qQ(n),r)}}};function qQ(e){const t=new Ha;return t.update(e),VQ(Uu.convert(t.digestSync(),{urlSafe:!0}))}function VQ(e){return e.replace(/=/g,"")}const WQ=()=>PK(32),GQ=e=>{async function t(n){if(n.persisted&&await e.loadOAuthInFlight()){const o=zi("User cancelled OAuth flow.");await GA(o)}window.removeEventListener("pageshow",t)}window.addEventListener("pageshow",t)};async function eF(e){const t=Tt.getConfig().Auth?.Cognito;We(t),Nv(t),ir.setAuthConfig(t),e?.options?.prompt||await B8();let n="COGNITO",r;return typeof e?.provider=="string"?n=BQ[e.provider]:e?.provider?.custom?n=e.provider.custom:e?.provider?.idpIdentifier&&({idpIdentifier:r}=e.provider),KQ({oauthConfig:t.loginWith.oauth,clientId:t.userPoolClientId,provider:n,idpIdentifier:r,customState:e?.customState,preferPrivateSession:e?.options?.preferPrivateSession,options:{loginHint:e?.options?.loginHint,lang:e?.options?.lang,nonce:e?.options?.nonce,prompt:e?.options?.prompt},authSessionOpener:e?.options?.authSessionOpener})}const KQ=async({oauthConfig:e,provider:t,idpIdentifier:n,clientId:r,customState:o,preferPrivateSession:s,options:a,authSessionOpener:u})=>{const{domain:c,redirectSignIn:f,responseType:h,scopes:g}=e,{loginHint:m,lang:v,nonce:w,prompt:S}=a??{},C=WQ(),E=u||J8,A=o?`${C}-${kK(o)}`:C,{value:I,method:T,toCodeChallenge:N}=HQ(128),M=WA(e.redirectSignIn);Lv()&&ir.storeOAuthInFlight(!0),ir.storeOAuthState(A),ir.storePKCE(I);const R=new URLSearchParams;R.append("redirect_uri",M),R.append("response_type",h),R.append("client_id",r),n?R.append("idp_identifier",n):R.append("identity_provider",t),R.append("scope",g.join(" ")),m&&R.append("login_hint",m),v&&R.append("lang",v),w&&R.append("nonce",w),S&&R.append("prompt",S.toLowerCase()),R.append("state",A),h==="code"&&(R.append("code_challenge",N()),R.append("code_challenge_method",T));const k=`https://${c}/oauth2/authorize?${R.toString()}`;GQ(ir);const{type:L,error:q,url:F}=await E(k,f,s)??{};try{if(L==="error")throw zi(String(q));if(L==="canceled")throw zi(String(L));L==="success"&&F&&await Q8({currentUrl:F,clientId:r,domain:c,redirectUri:M,responseType:h,userAgentValue:vt(Fe.SignInWithRedirect),preferPrivateSession:s})}catch(D){throw await GA(D),D}},ZQ=async e=>{const t=e.getConfig().Auth?.Cognito;We(t);const{userPoolEndpoint:n,userPoolId:r}=t,{tokens:o}=await u8(e,{forceRefresh:!1});lc(o);const s=xQ({endpointResolver:rt({endpointOverride:n})}),{UserAttributes:a}=await s({region:nt(r),userAgentValue:vt(Fe.FetchUserAttributes)},{AccessToken:o.accessToken.toString()});return zK(a)},tF=()=>ZQ(Tt),YQ=async e=>{await e.clearOAuthData(),dr.clearTokens(),await c8(),zo.dispatch("auth",{event:"signedOut"},"Auth",$o)},QQ=async(e,t=!1,n)=>{Nv(e);const{loginWith:r,userPoolClientId:o}=e,{domain:s,redirectSignOut:a}=r.oauth,u=WA(a),c=`https://${s}/logout?${Object.entries({client_id:o,logout_uri:encodeURIComponent(u)}).map(([f,h])=>`${f}=${h}`).join("&")}`;return J8(c)},XQ=async(e,t,n,r)=>{const{isOAuthSignIn:o}=await t.loadOAuthSignIn(),s=await n.getOAuthMetadata();if(await YQ(t),o||s?.oauthSignIn)return QQ(e,!1)},JQ=e=>fn(xn,_n("RevokeToken"),Un(),{...An,...e}),eX=new Ln("Auth");async function tX(e){const t=Tt.getConfig().Auth?.Cognito;We(t),await nX(t);let n;try{Nv(t),n=!0}catch{n=!1}if(n){const r=new P8(Xf);r.setAuthConfig(t);const{type:o}=await XQ(t,r,dr)??{};if(o==="error")throw new Oe({name:ZK,message:"An error occurred when attempting to log out from OAuth provider."})}else dr.clearTokens(),await c8(),zo.dispatch("auth",{event:"signedOut"},"Auth",$o)}async function nX(e){try{const{userPoolEndpoint:t,userPoolId:n,userPoolClientId:r}=e,o=await dr.getTokenStore().loadTokens();R8(o),rX(o.accessToken)&&await JQ({endpointResolver:rt({endpointOverride:t})})({region:nt(n),userAgentValue:vt(Fe.SignOut)},{ClientId:r,Token:o.refreshToken})}catch{eX.debug("Client signOut error caught but will proceed with token removal")}}const rX=e=>!!e?.payload?.origin_jti,oX=e=>fn(xn,_n("GetUserAttributeVerificationCode"),Un(),{...An,...e}),sX=async e=>{const{userAttributeKey:t,options:n}=e,r=Tt.getConfig().Auth?.Cognito,o=n?.clientMetadata;We(r);const{userPoolEndpoint:s,userPoolId:a}=r,{tokens:u}=await Uv({forceRefresh:!1});lc(u);const c=oX({endpointResolver:rt({endpointOverride:s})}),{CodeDeliveryDetails:f}=await c({region:nt(a),userAgentValue:vt(Fe.SendUserAttributeVerificationCode)},{AccessToken:u.accessToken.toString(),ClientMetadata:o,AttributeName:t}),{DeliveryMedium:h,AttributeName:g,Destination:m}={...f};return{destination:m,deliveryMedium:h,attributeName:g}},iX={identityId:"identityId"},aX=new Ln("DefaultIdentityIdStore");class nF{setAuthConfig(t){Kg(t.Cognito),this.authConfig=t,this._authKeys=lX("Cognito",t.Cognito.identityPoolId)}constructor(t){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=t}async loadIdentityId(){Kg(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const t=await this.keyValueStorage.getItem(this._authKeys.identityId);return t?(this._hasGuestIdentityId=!0,{id:t,type:"guest"}):null}}catch(t){return aX.log("Error getting stored IdentityId.",t),null}}async storeIdentityId(t){Kg(this.authConfig?.Cognito),t.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,t.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=t.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const lX=(e,t)=>LA(iX)(`com.amplify.${e}`,t),R_=({endpointOverride:e})=>t=>e?{url:new Yi(e)}:wK(t);function rF(e){const t=Ms(e).payload.iss,n={};if(!t)throw new Oe({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const r=t.replace(/(^\w+:|^)\/\//,"");return n[r]=e,n}async function uX({tokens:e,authConfig:t,identityIdStore:n}){n.setAuthConfig({Cognito:t});const r=await n.loadIdentityId();if(r)return r.id;const o=e?.idToken?rF(e.idToken.toString()):{},s=await cX(o,t);return n.storeIdentityId({id:s,type:e?"primary":"guest"}),s}async function cX(e,t){const n=t?.identityPoolId,r=S_(n),o=yK({endpointResolver:R_({endpointOverride:t.identityPoolEndpoint})});let s;try{s=(await o({region:r},{IdentityPoolId:n,Logins:e})).IdentityId}catch(a){throw eo(a),new Oe(a)}if(!s)throw new Oe({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return s}const qp=new Ln("CognitoCredentialsProvider"),DN=3e3*1e3;class oF{constructor(t){this._nextCredentialsRefresh=0,this._identityIdStore=t}async clearCredentialsAndIdentityId(){qp.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){qp.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(t){const n=t.authenticated,{tokens:r}=t,{authConfig:o}=t;try{Kg(o?.Cognito)}catch{return}if(!n&&!o.Cognito.allowGuestAccess)return;const{forceRefresh:s}=t,a=this.hasTokenChanged(r),u=await uX({tokens:r,authConfig:o.Cognito,identityIdStore:this._identityIdStore});return(s||a)&&this.clearCredentials(),n?(XK(r),this.credsForOIDCTokens(o.Cognito,r,u)):this.getGuestCredentials(u,o.Cognito)}async getGuestCredentials(t,n){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return qp.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const r=S_(n.identityPoolId),o=XP({endpointResolver:R_({endpointOverride:n.identityPoolEndpoint})});let s;try{s=await o({region:r},{IdentityId:t})}catch(a){throw eo(a),new Oe(a)}if(s?.Credentials?.AccessKeyId&&s?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+DN;const a={credentials:{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration},identityId:t};return s.IdentityId&&(a.identityId=s.IdentityId,this._identityIdStore.storeIdentityId({id:s.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...a,isAuthenticatedCreds:!1},a}else throw new Oe({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(t,n,r){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return qp.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const o=n.idToken?rF(n.idToken.toString()):{},s=S_(t.identityPoolId),a=XP({endpointResolver:R_({endpointOverride:t.identityPoolEndpoint})});let u;try{u=await a({region:s},{IdentityId:r,Logins:o})}catch(c){throw eo(c),new Oe(c)}if(u?.Credentials?.AccessKeyId&&u?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+DN;const c={credentials:{accessKeyId:u.Credentials.AccessKeyId,secretAccessKey:u.Credentials.SecretKey,sessionToken:u.Credentials.SessionToken,expiration:u.Credentials.Expiration},identityId:r};return u.IdentityId&&(c.identityId=u.IdentityId,this._identityIdStore.storeIdentityId({id:u.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...c,isAuthenticatedCreds:!0,associatedIdToken:n.idToken?.toString()},c}else throw new Oe({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(t){return!!t&&!!this._credentialsAndIdentityId?.associatedIdToken&&t.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}const dX=new oF(new nF(Xf)),sF={configure(e,t){const n=s8(e),r=new RK({sameSite:"lax"}),o=t?.ssr?r:Xf,s=t?.ssr?new oF(new nF(r)):dX;if(!n.Auth||t?.Auth){Tt.configure(n,t);return}Yg.setAuthConfig(n.Auth),Yg.setKeyValueStorage(o),Tt.configure(n,{...t,Auth:{tokenProvider:Yg,credentialsProvider:s}})},getConfig(){return Tt.getConfig()}},fX="https://github.com/remit-mail/reader/issues/new",hX=["internal","acme","tailscale","off"],pX=["self","managed"],LN=(e,t,n)=>e.find(r=>r===t)??n,pc=()=>{const e=globalThis.__REMIT_CONFIG__??{};return{apiUrl:e.apiUrl??"/api",appOrigin:e.appOrigin??"",betterAuthEnabled:e.betterAuthEnabled??!1,cognito:{userPoolId:e.cognito?.userPoolId??"",clientId:e.cognito?.clientId??"",domain:e.cognito?.domain??"",region:e.cognito?.region??""},rum:{appMonitorId:e.rum?.appMonitorId??"",identityPoolId:e.rum?.identityPoolId??"",region:e.rum?.region??"eu-west-1"},mailboxPollIntervalSeconds:e.mailboxPollIntervalSeconds!=null?String(e.mailboxPollIntervalSeconds):void 0,disableDevtools:e.disableDevtools??!1,tlsMode:LN(hX,e.tlsMode,"off"),issuesUrl:e.issuesUrl??fX,updateMode:LN(pX,e.updateMode,"self")}},iF=()=>{const e=pc(),{userPoolId:t,clientId:n,domain:r,region:o}=e.cognito;return!t||!n?null:{userPoolId:t,userPoolClientId:n,domain:r,region:o,appOrigin:e.appOrigin}},Bv=()=>iF()!==null,aF=()=>{const e=iF();if(!e){console.warn("[auth] Cognito user pool is not configured. Running in local dev mode without Cognito auth.");return}const{userPoolId:t,userPoolClientId:n,domain:r,appOrigin:o}=e;sF.configure({Auth:{Cognito:{userPoolId:t,userPoolClientId:n,loginWith:r?{oauth:{domain:r,scopes:["openid","email","profile"],redirectSignIn:o?[o]:[],redirectSignOut:o?[o]:[],responseType:"code"}}:void 0}}})};var gX={};const Jg=Object.create(null),Sd=e=>gX||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?Jg:globalThis),Ei=new Proxy(Jg,{get(e,t){return Sd()[t]??Jg[t]},has(e,t){return t in Sd()||t in Jg},set(e,t,n){const r=Sd(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;const n=Sd(!0);return delete n[t],!0},ownKeys(){const e=Sd(!0);return Object.keys(e)}});Ei.NODE_ENV;var em=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};const mX=47;function lF(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===mX;)t--;return t===e.length?e:e.slice(0,t)}function vX(e){try{return(lF(new URL(e).pathname)||"/")!=="/"}catch{throw new em(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function yX(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new em(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof em?t:new em(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function UN(e,t="/api/auth"){if(yX(e),vX(e))return e;const n=lF(e);return!t||t==="/"?n:(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`)}function bX(e,t,n,r,o){{const s=Ei.BETTER_AUTH_URL||Ei.NEXT_PUBLIC_BETTER_AUTH_URL||Ei.PUBLIC_BETTER_AUTH_URL||Ei.NUXT_PUBLIC_BETTER_AUTH_URL||Ei.NUXT_PUBLIC_AUTH_URL||(Ei.BASE_URL!=="/"?Ei.BASE_URL:void 0);if(s)return UN(s,t)}if(typeof window<"u"&&window.location)return UN(window.location.origin,t)}const SX={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},wX=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,FN={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},CX=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function EX(e){return e instanceof Date&&!isNaN(e.getTime())}function _X(e){const t=CX.exec(e);if(!t)return null;const[,n,r,o,s,a,u,c,f,h,g]=t,m=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(s,10),parseInt(a,10),parseInt(u,10),c?parseInt(c.padEnd(3,"0"),10):0));if(f){const v=(parseInt(h,10)*60+parseInt(g,10))*(f==="+"?-1:1);m.setUTCMinutes(m.getUTCMinutes()+v)}return EX(m)?m:null}function xX(e,t={}){const{strict:n=!1,warnings:r=!1,reviver:o,parseDates:s=!0}=t;if(typeof e!="string")return e;const a=e.trim(),u=a.toLowerCase();if(u.length<=9&&u in FN)return FN[u];if(!wX.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(SX).some(([c,f])=>{const h=f.test(a);return h&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${c} pattern`),h})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(f,h)=>{if(f==="__proto__"||f==="constructor"&&h&&typeof h=="object"&&"prototype"in h){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(s&&typeof h=="string"){const g=_X(h);if(g)return g}return o?o(f,h):h})}catch(c){if(n)throw c;return e}}function AX(e,t={strict:!0}){return xX(e,t)}const IX=["javascript:","data:","vbscript:"];function RX(e){let t;try{t=new URL(e)}catch{return!0}return!IX.includes(t.protocol)}const TX={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&RX(e.data.url)&&typeof window<"u"&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}};let po=[],_i=0;const tm=4,OX=globalThis.nanostoresGlobal||={epoch:0};let MX=()=>{for(_i=0;_i<po.length;_i+=tm)po[_i](po[_i+1].value,po[_i+2],po[_i+3]);po.length=0};const uF=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(r){return n.lc=t.push(r),()=>{for(let s=_i+tm;s<po.length;)po[s]===r?po.splice(s,tm):s+=tm;let o=t.indexOf(r);~o&&(t.splice(o,1),--n.lc||n.off())}},notify(r,o){OX.epoch++;let s=!po.length&&!0;for(let a of t)po.push(a,n,r,o);s&&MX()},off(){},set(r){let o=n.value;o!==r&&(n.value=r,n.notify(o))},subscribe(r){let o=n.listen(r);return r(n.value),o},value:e};return n},PX=2,NX=5,Vp=6,Wp=10;let cF=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Wp]||(e.events[n+Wp]=r(o=>{e.events[n].reduceRight((s,a)=>(a(s),s),{shared:{},...o})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],s=o.indexOf(t);o.splice(s,1),o.length||(delete e.events[n],e.events[n+Wp](),delete e.events[n+Wp])}),kX=(e,t)=>cF(e,t,PX,n=>{let r=e.set,o=e.setKey;return e.setKey&&(e.setKey=(s,a)=>{let u;if(n({abort:()=>{u=!0},changed:s,newValue:{...e.value,[s]:a}}),!u)return o(s,a)}),e.set=s=>{let a;if(n({abort:()=>{a=!0},newValue:s}),!a)return r(s)},()=>{e.set=r,e.setKey=o}});const dF=1e3;let DX=(e,t)=>cF(e,r=>{let o=t(r);o&&e.events[Vp].push(o)},NX,r=>{let o=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),o(...a));let s=e.off;return e.events[Vp]=[],e.off=()=>{s(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[Vp])a();e.events[Vp]=[]}},dF)},()=>{e.listen=o,e.off=s}});function LX(e,t,n){let r=new Set(t);return e.listen((o,s,a)=>{(a===void 0?t.some(u=>o[u]!==s[u]):r.has(a)||r.has(a.split(/\.|\[/)[0]))&&n(o,s,a)})}function $N(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Am(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Am(e[n],t[n]))return!1;return!0}if($N(e)&&$N(t)){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!(o in t)||!Am(e[o],t[o]))return!1;return!0}return!1}function UX(e,t){return kX(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}const T_=Symbol.for("better-auth:auth-query");function FX(e){return T_ in e&&e[T_]===!0}function $X(e){const t=uF(e);return Object.defineProperty(t,T_,{value:!0}),t}const T1=Symbol.for("better-auth:broadcast-channel"),zX=()=>Math.floor(Date.now()/1e3);var jX=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:zX()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=t=>{if(t.key!==this.name)return;const n=JSON.parse(t.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function O1(e="better-auth.message"){return globalThis[T1]||(globalThis[T1]=new jX(e)),globalThis[T1]}const M1=Symbol.for("better-auth:focus-manager");var BX=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function zN(){return globalThis[M1]||(globalThis[M1]=new BX),globalThis[M1]}const P1=Symbol.for("better-auth:online-manager");var HX=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function N1(){return globalThis[P1]||(globalThis[P1]=new HX),globalThis[P1]}const k1=()=>Math.floor(Date.now()/1e3),qX=5;function VX(e){const{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:o={}}=e,s=o.sessionOptions?.refetchInterval??0,a=o.sessionOptions?.refetchOnWindowFocus??!0,u=o.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},f=()=>u||N1().isOnline,h=I=>{if(f()){if(I?.event==="storage"){t();return}if(I?.event==="poll"){c.lastSessionRequest=k1(),t();return}if(I?.event==="visibilitychange"){if(k1()-c.lastSessionRequest<qX)return;c.lastSessionRequest=k1(),t();return}t()}},g=I=>{O1().post({event:"session",data:{trigger:I},clientId:Math.random().toString(36).substring(7)})},m=()=>{s&&s>0&&(c.pollInterval=setInterval(()=>{n()&&h({event:"poll"})},s*1e3))},v=()=>{c.unsubscribeBroadcast=O1().subscribe(()=>{h({event:"storage"})})},w=()=>{a&&(c.unsubscribeFocus=zN().subscribe(()=>{h({event:"visibilitychange"})}))},S=()=>{c.unsubscribeOnline=N1().subscribe(I=>{I&&h({event:"visibilitychange"})})},C=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,m(),v(),w(),S(),C(),c.cleanupBroadcastSetup=O1().setup(),c.cleanupFocusSetup=zN().setup(),c.cleanupOnlineSetup=N1().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&(clearInterval(c.pollInterval),c.pollInterval=void 0),c.unsubscribeBroadcast&&(c.unsubscribeBroadcast(),c.unsubscribeBroadcast=void 0),c.unsubscribeFocus&&(c.unsubscribeFocus(),c.unsubscribeFocus=void 0),c.unsubscribeOnline&&(c.unsubscribeOnline(),c.unsubscribeOnline=void 0),c.unsubscribeSignal&&(c.unsubscribeSignal(),c.unsubscribeSignal=void 0),c.cleanupBroadcastSetup&&(c.cleanupBroadcastSetup(),c.cleanupBroadcastSetup=void 0),c.cleanupFocusSetup&&(c.cleanupFocusSetup(),c.cleanupFocusSetup=void 0),c.cleanupOnlineSetup&&(c.cleanupOnlineSetup(),c.cleanupOnlineSetup=void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:h,broadcastSessionUpdate:g}}const WX=()=>typeof window>"u",GX=dF;function KX(e,t){if(typeof window>"u")return;const n=e.get();n.data!==null||t===null||e.set({...n,data:t,error:null,isPending:!1})}function jN(e){return typeof e=="object"&&e!==null&&"data"in e&&"error"in e?e:{data:e,error:null}}function ZX(e){return!e||e.session===null&&e.user===null?null:e}function YX(e,t){return Am(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function QX(e,t){const n=uF(!1);let r,o=0,s=0;n.listen(()=>{s++,o=0});const a=v=>h(v),u=$X({data:null,error:null,isPending:!0,isRefetching:!1,refetch:a});UX(u,YX);const c=async(v,w)=>{const S=u.value;if(u.set({...S,isPending:S.data===null,isRefetching:!0,error:null,refetch:a}),v.aborted)return"aborted";try{const C=await e("/get-session",{method:"GET",query:w?.query,signal:v});if(v.aborted)return"aborted";let{data:E,error:A}=jN(C),I="fresh";if(E?.needsRefresh)try{const R=await e("/get-session",{method:"POST",signal:v});if(v.aborted)return"aborted";({data:E,error:A}=jN(R))}catch{if(v.aborted)return"aborted";I="stale"}if(A){const R=u.value,k=A?.status===401;return u.set({data:k?null:R.data,error:A,isPending:!1,isRefetching:!1,refetch:a}),"failed"}const T=ZX(E),N=u.value,M=N.data!=null&&T!=null&&Am(N.data,T)?N.data:T;return u.set({data:M,error:null,isPending:!1,isRefetching:!1,refetch:a}),I}catch(C){if(v.aborted)return"aborted";const E=u.value;return u.set({data:E.data,error:C,isPending:!1,isRefetching:!1,refetch:a}),"failed"}},f=()=>{const v=u.value.data?.session?.expiresAt,w=v instanceof Date?v.getTime():Number.POSITIVE_INFINITY;return Math.min(Date.now()+GX,w)},h=v=>{o=0,r?.cancel();const w=new AbortController,S={cancel:()=>w.abort(),promise:Promise.resolve().then(()=>w.signal.aborted?"aborted":c(w.signal,v)),revision:s};r=S;const C=E=>{r===S&&(r=void 0,E==="fresh"&&S.revision===s&&(o=f()))};return S.promise.then(C,()=>C("failed")),S.promise.then(()=>{})},g=()=>r?.revision===s?r.promise.then(()=>{}):Date.now()<o?Promise.resolve():h();let m=()=>{};return DX(u,()=>{let v;WX()||(v=setTimeout(()=>{g()},0));const w=VX({fetchSession:h,shouldPollSession:()=>u.value.data!=null,sessionSignal:n,options:t});return w.init(),m=w.broadcastSessionUpdate,()=>{v&&clearTimeout(v),w.cleanup()}}),{session:u,$sessionSignal:n,broadcastSessionUpdate:v=>m(v)}}function D1(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function O_(e,t,n=".",r){if(!D1(t))return O_(e,{},n,r);const o={...t};for(const s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;const a=e[s];a!=null&&(r&&r(o,s,a,n)||(Array.isArray(a)&&Array.isArray(o[s])?o[s]=[...a,...o[s]]:D1(a)&&D1(o[s])?o[s]=O_(a,o[s],(n?`${n}.`:"")+s.toString(),r):o[s]=a))}return o}function XX(e){return(...t)=>t.reduce((n,r)=>O_(n,r,"",e),{})}const JX=XX();var eJ=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}};const tJ=async(e,t)=>{let n=t||{};const r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(const h of t?.plugins||[]){var o,s,a,u,c;if(h.init){var f;const g=await((f=h.init)===null||f===void 0?void 0:f.call(h,e.toString(),n));n=g.options||n,e=g.url}r.onRequest.push((o=h.hooks)===null||o===void 0?void 0:o.onRequest),r.onResponse.push((s=h.hooks)===null||s===void 0?void 0:s.onResponse),r.onSuccess.push((a=h.hooks)===null||a===void 0?void 0:a.onSuccess),r.onError.push((u=h.hooks)===null||u===void 0?void 0:u.onError),r.onRetry.push((c=h.hooks)===null||c===void 0?void 0:c.onRetry)}return{url:e,options:n,hooks:r}};var BN=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},nJ=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function rJ(e){if(typeof e=="number")return new BN({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new BN(e);case"exponential":return new nJ(e);default:throw new Error("Invalid retry strategy")}}const oJ=["get","post","put","patch","delete"];function KA(e){if(!e.startsWith("@"))return{method:void 0,path:e};const t=e.indexOf("/"),n=e.slice(1,t===-1?void 0:t);return oJ.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}const sJ=e=>e==="."||e==="..",iJ=e=>e.split(":").map(t=>encodeURIComponent(t)).join(":");function aJ(e,t){const n=t.get(e);if(n===void 0)return iJ(e);if(sJ(n))throw new TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)}function lJ(e,t){const{baseURL:n,params:r,query:o}=t||{query:{},params:{},baseURL:""};let s=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";const{path:a}=KA(e);a!==e&&(e=`/${a}`),s.endsWith("/")||(s+="/");let[u,c]=e.replace(s,"").split("?");const f=new URLSearchParams(c);for(const[m,v]of Object.entries(o||{})){if(v==null)continue;let w;if(typeof v=="string")w=v;else if(Array.isArray(v)){for(const S of v)f.append(m,S);continue}else w=JSON.stringify(v);f.set(m,w)}const h=new Map;if(r)if(Array.isArray(r)){const m=u.split("/").filter(v=>v.startsWith(":"));for(const[v,w]of m.entries()){const S=r[v];h.set(w,String(S))}}else for(const[m,v]of Object.entries(r))h.set(`:${m}`,String(v));u=u.split("/").map(m=>aJ(m,h)).join("/"),u=u.replace(/^\/+/,"");let g=f.toString();return g=g.length>0?`?${g}`.replace(/\+/g,"%20"):"",s.startsWith("http")?new URL(`${u}${g}`,s):`${s}${u}${g}`}const uJ=async e=>{const t={},n=async r=>typeof r=="function"?await r():r;if(e?.auth){if(e.auth.type==="Bearer"){const r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type==="Basic"){const[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if(e.auth.type==="Custom"){const[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${r??""} ${o}`}}return t},cJ=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function dJ(e){const t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";const r=t.split(";").shift()||"";return cJ.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function fJ(e){try{return JSON.parse(e),!0}catch{return!1}}function fF(e){if(e===void 0)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t===null?!0:t!=="object"?!1:Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name==="Object"||typeof e.toJSON=="function"}function HN(e){try{return JSON.parse(e)}catch{return e}}function qN(e){return typeof e=="function"}function hJ(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<"u"&&qN(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&qN(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}function hF(...e){const t={};for(const n of e)if(n)if(n instanceof Headers)n.forEach((r,o)=>{t[o]=r});else{const r=Array.isArray(n)?n:Object.entries(n);for(const[o,s]of r)s!=null&&(t[o]=s)}return t}async function pJ(e){const t=new Headers(hF(e?.headers,await uJ(e)));if(!t.has("content-type")){const n=gJ(e?.body);n&&t.set("content-type",n)}return t}function gJ(e){return fF(e)?"application/json":null}function mJ(e){const t=e.get("content-type");return t?t.split(";")[0].trim().toLowerCase():null}function vJ(e,t){const{body:n}=e;return n?!fF(n)||typeof n=="string"?n:mJ(t)==="application/x-www-form-urlencoded"?new URLSearchParams(n).toString():JSON.stringify(n):null}function yJ(e,t){if(t?.method)return t.method.toUpperCase();const{method:n}=KA(e);return n?n.toUpperCase():t?.body?"POST":"GET"}function bJ(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var SJ=class pF extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,pF.prototype)}};async function Hd(e,t){const n=await e["~standard"].validate(t);if(n.issues)throw new SJ(n.issues);return n.value}function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}function wJ(e,t){if(yf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e){var t=wJ(e,"string");return yf(t)=="symbol"?t:t+""}function EJ(e,t,n){return(t=CJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VN(Object(n),!0).forEach(function(r){EJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const M_=async(e,t)=>{var n,r,o;const{hooks:s,url:a,options:u}=await tJ(e,t),c=hJ(u),f=new AbortController,h=(n=u.signal)!==null&&n!==void 0?n:f.signal,g=lJ(a,u),m=await pJ(u),v=vJ(u,m),w=yJ(a,u),S=ct(ct({},u),{},{url:g,headers:m,body:v,method:w,signal:h});for(const j of s.onRequest)if(j){const Z=await j(S);typeof Z=="object"&&Z!==null&&Object.assign(S,Z)}("pipeTo"in S&&typeof S.pipeTo=="function"||typeof(t==null||(r=t.body)===null||r===void 0?void 0:r.pipe)=="function")&&("duplex"in S||(S.duplex="half"));const{clearTimeout:C}=bJ(u,f);let E=await c(S.url,S);C();const A={response:E,request:S};for(const j of s.onResponse)if(j){var I;const Z=await j(ct(ct({},A),{},{response:!(t==null||(I=t.hookOptions)===null||I===void 0)&&I.cloneResponse?E.clone():E}));Z instanceof Response?E=Z:typeof Z=="object"&&Z!==null&&(E=Z.response)}if(E.ok){if(S.method==="HEAD")return{data:"",error:null};const j=dJ(E),Z={data:null,response:E,request:S};if(j==="json"||j==="text"){var T;const he=await E.text();Z.data=await((T=S.jsonParser)!==null&&T!==void 0?T:HN)(he)}else Z.data=await E[j]();S?.output&&S.output&&!S.disableValidation&&(Z.data=await Hd(S.output,Z.data));for(const he of s.onSuccess)if(he){var N;await he(ct(ct({},Z),{},{response:!(t==null||(N=t.hookOptions)===null||N===void 0)&&N.cloneResponse?E.clone():E}))}return t?.throw?Z.data:{data:Z.data,error:null}}const M=(o=t?.jsonParser)!==null&&o!==void 0?o:HN,R=await E.text(),k=fJ(R),L=k?await M(R):null,q={response:E,responseText:R,request:S,error:ct(ct({},L),{},{status:E.status,statusText:E.statusText})};for(const j of s.onError)if(j){var F;await j(ct(ct({},q),{},{response:!(t==null||(F=t.hookOptions)===null||F===void 0)&&F.cloneResponse?E.clone():E}))}if(t?.retry){var D;const j=rJ(t.retry),Z=(D=t.retryAttempt)!==null&&D!==void 0?D:0;if(await j.shouldAttemptRetry(Z,E)){for(const B of s.onRetry)B&&await B(A);const he=j.getDelay(Z);return await new Promise(B=>setTimeout(B,he)),await M_(e,ct(ct({},t),{},{retryAttempt:Z+1}))}}if(t?.throw)throw new eJ(E.status,E.statusText,k?L:R);return{data:null,error:ct(ct({},L),{},{status:E.status,statusText:E.statusText})}},_J=e=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(t,n){var r;let o=ct(ct({},n),e.query!==void 0&&{query:ct(ct({},e.query),n?.query)});const s=((r=e.plugins)===null||r===void 0||(r=r.find(f=>{var h;return!((h=f.schema)===null||h===void 0)&&h.config?t.startsWith(f.schema.config.baseURL||"")||t.startsWith(f.schema.config.prefix||""):!1}))===null||r===void 0?void 0:r.schema)||e.schema;if(s){var a,u;let f=t;!((a=s.config)===null||a===void 0)&&a.prefix&&f.startsWith(s.config.prefix)&&(f=f.replace(s.config.prefix,""),s.config.baseURL&&(t=t.replace(s.config.prefix,s.config.baseURL))),!((u=s.config)===null||u===void 0)&&u.baseURL&&f.startsWith(s.config.baseURL)&&(f=f.replace(s.config.baseURL,"")),f.startsWith("/")&&f.charAt(1)==="@"&&(f=f.substring(1));const h=s.schema[f];if(h){var c;const{method:g,path:m}=KA(f);g&&(t=t.slice(0,t.length-f.length)+m);let v=n?.headers;if(h.headers&&!n?.disableValidation){const S={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((A,I)=>{S[I.toLowerCase()]=A});else if(typeof n.headers=="object")for(const[A,I]of Object.entries(n.headers))I!=null&&(S[A.toLowerCase()]=I)}const C=await Hd(h.headers,S),E={};for(const[A,I]of Object.entries(C))E[A.toLowerCase()]=I;v=E}const w=(c=h.method)!==null&&c!==void 0?c:g;if(o=ct(ct(ct(ct({},o),w!==void 0&&{method:w}),h.output!==void 0&&{output:h.output}),v!==void 0&&{headers:v}),!n?.disableValidation){if(h.query&&(o.query=await Hd(h.query,n?.query),o.query!==null&&typeof o.query=="object")){const S=ct({},e.query);for(const C of Object.keys(S))n?.query&&Object.prototype.hasOwnProperty.call(n.query,C)&&(S[C]=n.query[C]);o.query=ct(ct({},S),o.query)}o=ct(ct({},o),{},{body:h.input?await Hd(h.input,n?.body):n?.body,params:h.params?await Hd(h.params,n?.params):n?.params})}return{url:t,options:o}}}return ct({url:t},(n!==void 0||e.query!==void 0)&&{options:o})}}),xJ=e=>{async function t(n,r){const o=ct(ct(ct({},e),r),{},{headers:hF(e?.headers,r?.headers),plugins:[...e?.plugins||[],_J(e||{}),...r?.plugins||[]]});if(e?.catchAllError)try{return await M_(n,o)}catch(s){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:s}}}return await M_(n,o)}return t};var Sa={};const AJ=e=>{if(typeof process>"u")return;const t="/api/auth";if(Sa.NEXT_PUBLIC_AUTH_URL)return Sa.NEXT_PUBLIC_AUTH_URL;if(typeof window>"u"){if(Sa.NEXTAUTH_URL)try{return Sa.NEXTAUTH_URL}catch{}if(Sa.VERCEL_URL)try{const n=Sa.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${n}${Sa.VERCEL_URL}`).origin}${t}`}catch{}}},IJ=e=>e==="/sign-out"||e==="/update-user"||e==="/update-session"||e==="/sign-up/email"||e==="/sign-in/email"||e==="/delete-user"||e==="/verify-email"||e==="/revoke-sessions"||e==="/revoke-session"||e==="/revoke-other-sessions"||e==="/change-email"||e==="/change-password",RJ=(e,t)=>{const n="credentials"in Request.prototype,r=bX(e?.baseURL,e?.basePath)??AJ()??"/api/auth",o=[],s={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:a,onError:u,onRequest:c,onResponse:f,...h}={},g=xJ({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(R){return R?AX(R,{strict:!1}):null},customFetchImpl:fetch,...h,plugins:[s,...h.plugins||[],TX,...o]}),{$sessionSignal:m,session:v,broadcastSessionUpdate:w}=QX(g,e);let S=!1;const C=R=>{S||R===null||(S=!0,KX(v,R))},E=[];let A={};const I={$sessionSignal:m,session:v},T={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},N=[{signal:"$sessionSignal",matcher:IJ,callback(R){R==="/sign-out"?w("signout"):(R==="/update-user"||R==="/update-session")&&w("updateUser")}}];for(const R of E)R.getAtoms&&Object.assign(I,R.getAtoms?.(g)),R.pathMethods&&Object.assign(T,R.pathMethods),R.atomListeners&&N.push(...R.atomListeners);const M={notify:R=>{I[R].set(!I[R].get())},listen:(R,k)=>{I[R].subscribe(k)},atoms:I};for(const R of E)R.getActions&&(A=JX(R.getActions?.(g,M,e)??{},A));return{get baseURL(){return r},pluginsActions:A,pluginsAtoms:I,pluginPathMethods:T,atomListeners:N,hydrateSession:C,$sessionSignal:m,$fetch:g,$store:M}};function TJ(e){return typeof e=="object"&&e!==null&&"get"in e&&typeof e.get=="function"&&"lc"in e&&typeof e.lc=="number"}function OJ(e){return e.charAt(0).toUpperCase()+e.slice(1)}const MJ=new RegExp("[\\p{Ll}\\d]+|\\p{Lu}+(?!\\p{Ll})|\\p{Lu}[\\p{Ll}\\d]+|\\p{Lo}+","gu"),PJ=/['\u2019]/g;function NJ(e){return e.replace(PJ,"").match(MJ)??[]}function kJ(e){return NJ(e).map(t=>t.toLowerCase()).join("-")}function DJ(e,t,n){const r=t[e],{fetchOptions:o,query:s,...a}=n||{};return r||(o?.method?o.method:a&&Object.keys(a).length>0?"POST":"GET")}function LJ(e,t,n,r,o){function s(a=[]){return new Proxy(function(){},{get(u,c){if(typeof c!="string"||c==="then"||c==="catch"||c==="finally")return;const f=[...a,c];let h=e;for(const g of f)if(h&&typeof h=="object"&&g in h)h=h[g];else{h=void 0;break}return typeof h=="function"||TJ(h)?h:s(f)},apply:async(u,c,f)=>{const h="/"+a.map(kJ).join("/"),g=f[0]||{},m=f[1]||{},{query:v,fetchOptions:w,...S}=g,C={...m,...w},E=DJ(h,n,g);return await t(h,{...C,body:E==="GET"?void 0:{...S,...C?.body||{}},query:v||C?.query,method:E,async onSuccess(A){if(await C?.onSuccess?.(A),!o||C.disableSignal)return;const I=o.filter(N=>N.matcher(h));if(!I.length)return;const T=new Set;for(const N of I){const M=r[N.signal];if(!M)return;if(T.has(N.signal))continue;T.add(N.signal);const R=M.get();setTimeout(()=>{M.set(!R)},10),N.callback?.(h)}}})}})}return s()}var L1={exports:{}},Le={};var WN;function UJ(){if(WN)return Le;WN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),m=Symbol.iterator;function v(U){return U===null||typeof U!="object"?null:(U=m&&U[m]||U["@@iterator"],typeof U=="function"?U:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(U,X,ie){this.props=U,this.context=X,this.refs=C,this.updater=ie||w}E.prototype.isReactComponent={},E.prototype.setState=function(U,X){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,X,"setState")},E.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function A(){}A.prototype=E.prototype;function I(U,X,ie){this.props=U,this.context=X,this.refs=C,this.updater=ie||w}var T=I.prototype=new A;T.constructor=I,S(T,E.prototype),T.isPureReactComponent=!0;var N=Array.isArray;function M(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function L(U,X,ie){var oe=ie.ref;return{$$typeof:e,type:U,key:X,ref:oe!==void 0?oe:null,props:ie}}function q(U,X){return L(U.type,X,U.props)}function F(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function D(U){var X={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(ie){return X[ie]})}var j=/\/+/g;function Z(U,X){return typeof U=="object"&&U!==null&&U.key!=null?D(""+U.key):X.toString(36)}function he(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(X){U.status==="pending"&&(U.status="fulfilled",U.value=X)},function(X){U.status==="pending"&&(U.status="rejected",U.reason=X)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function B(U,X,ie,oe,fe){var Me=typeof U;(Me==="undefined"||Me==="boolean")&&(U=null);var xe=!1;if(U===null)xe=!0;else switch(Me){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(U.$$typeof){case e:case t:xe=!0;break;case h:return xe=U._init,B(xe(U._payload),X,ie,oe,fe)}}if(xe)return fe=fe(U),xe=oe===""?"."+Z(U,0):oe,N(fe)?(ie="",xe!=null&&(ie=xe.replace(j,"$&/")+"/"),B(fe,X,ie,"",function(Ze){return Ze})):fe!=null&&(F(fe)&&(fe=q(fe,ie+(fe.key==null||U&&U.key===fe.key?"":(""+fe.key).replace(j,"$&/")+"/")+xe)),X.push(fe)),1;xe=0;var se=oe===""?".":oe+":";if(N(U))for(var Se=0;Se<U.length;Se++)oe=U[Se],Me=se+Z(oe,Se),xe+=B(oe,X,ie,Me,fe);else if(Se=v(U),typeof Se=="function")for(U=Se.call(U),Se=0;!(oe=U.next()).done;)oe=oe.value,Me=se+Z(oe,Se++),xe+=B(oe,X,ie,Me,fe);else if(Me==="object"){if(typeof U.then=="function")return B(he(U),X,ie,oe,fe);throw X=String(U),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return xe}function Q(U,X,ie){if(U==null)return U;var oe=[],fe=0;return B(U,oe,"","",function(Me){return X.call(ie,Me,fe++)}),oe}function ae(U){if(U._status===-1){var X=U._result;X=X(),X.then(function(ie){(U._status===0||U._status===-1)&&(U._status=1,U._result=ie)},function(ie){(U._status===0||U._status===-1)&&(U._status=2,U._result=ie)}),U._status===-1&&(U._status=0,U._result=X)}if(U._status===1)return U._result.default;throw U._result}var ue=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},we={map:Q,forEach:function(U,X,ie){Q(U,function(){X.apply(this,arguments)},ie)},count:function(U){var X=0;return Q(U,function(){X++}),X},toArray:function(U){return Q(U,function(X){return X})||[]},only:function(U){if(!F(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Le.Activity=g,Le.Children=we,Le.Component=E,Le.Fragment=n,Le.Profiler=o,Le.PureComponent=I,Le.StrictMode=r,Le.Suspense=c,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Le.__COMPILER_RUNTIME={__proto__:null,c:function(U){return R.H.useMemoCache(U)}},Le.cache=function(U){return function(){return U.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(U,X,ie){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var oe=S({},U.props),fe=U.key;if(X!=null)for(Me in X.key!==void 0&&(fe=""+X.key),X)!k.call(X,Me)||Me==="key"||Me==="__self"||Me==="__source"||Me==="ref"&&X.ref===void 0||(oe[Me]=X[Me]);var Me=arguments.length-2;if(Me===1)oe.children=ie;else if(1<Me){for(var xe=Array(Me),se=0;se<Me;se++)xe[se]=arguments[se+2];oe.children=xe}return L(U.type,fe,oe)},Le.createContext=function(U){return U={$$typeof:a,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:s,_context:U},U},Le.createElement=function(U,X,ie){var oe,fe={},Me=null;if(X!=null)for(oe in X.key!==void 0&&(Me=""+X.key),X)k.call(X,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(fe[oe]=X[oe]);var xe=arguments.length-2;if(xe===1)fe.children=ie;else if(1<xe){for(var se=Array(xe),Se=0;Se<xe;Se++)se[Se]=arguments[Se+2];fe.children=se}if(U&&U.defaultProps)for(oe in xe=U.defaultProps,xe)fe[oe]===void 0&&(fe[oe]=xe[oe]);return L(U,Me,fe)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(U){return{$$typeof:u,render:U}},Le.isValidElement=F,Le.lazy=function(U){return{$$typeof:h,_payload:{_status:-1,_result:U},_init:ae}},Le.memo=function(U,X){return{$$typeof:f,type:U,compare:X===void 0?null:X}},Le.startTransition=function(U){var X=R.T,ie={};R.T=ie;try{var oe=U(),fe=R.S;fe!==null&&fe(ie,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(M,ue)}catch(Me){ue(Me)}finally{X!==null&&ie.types!==null&&(X.types=ie.types),R.T=X}},Le.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Le.use=function(U){return R.H.use(U)},Le.useActionState=function(U,X,ie){return R.H.useActionState(U,X,ie)},Le.useCallback=function(U,X){return R.H.useCallback(U,X)},Le.useContext=function(U){return R.H.useContext(U)},Le.useDebugValue=function(){},Le.useDeferredValue=function(U,X){return R.H.useDeferredValue(U,X)},Le.useEffect=function(U,X){return R.H.useEffect(U,X)},Le.useEffectEvent=function(U){return R.H.useEffectEvent(U)},Le.useId=function(){return R.H.useId()},Le.useImperativeHandle=function(U,X,ie){return R.H.useImperativeHandle(U,X,ie)},Le.useInsertionEffect=function(U,X){return R.H.useInsertionEffect(U,X)},Le.useLayoutEffect=function(U,X){return R.H.useLayoutEffect(U,X)},Le.useMemo=function(U,X){return R.H.useMemo(U,X)},Le.useOptimistic=function(U,X){return R.H.useOptimistic(U,X)},Le.useReducer=function(U,X,ie){return R.H.useReducer(U,X,ie)},Le.useRef=function(U){return R.H.useRef(U)},Le.useState=function(U){return R.H.useState(U)},Le.useSyncExternalStore=function(U,X,ie){return R.H.useSyncExternalStore(U,X,ie)},Le.useTransition=function(){return R.H.useTransition()},Le.version="19.2.7",Le}var GN;function rh(){return GN||(GN=1,L1.exports=UJ()),L1.exports}var _=rh();const $=sc(_),FJ=e8({__proto__:null,default:$},[_]);function $J(e,t={}){const n=_.useRef(e.get()),{keys:r,deps:o=[e,r]}=t,s=_.useCallback(u=>{const c=f=>{n.current!==f&&(n.current=f,u())};return c(e.value),r?.length?LX(e,r,c):e.listen(c)},o),a=()=>n.current;return _.useSyncExternalStore(s,a,FX(e)?()=>e.init:a)}function zJ(e){return`use${OJ(e)}`}function jJ(e){const{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:o,$fetch:s,$store:a,atomListeners:u}=RJ(e),c={};for(const[f,h]of Object.entries(r))c[zJ(f)]=()=>$J(h);return LJ({...n,...c,hydrateSession:o,$fetch:s,$store:a},s,t,r,u)}const BJ=10,Mu=[],HJ=["x-correlation-id","x-request-id","x-amzn-requestid","x-amzn-trace-id","apigw-requestid","x-trace-id"];function qJ(e){const t=typeof e=="string"?e:e instanceof URL?e.href:e.url;try{return new URL(t,window.location.origin).pathname}catch{return t.split(/[?#]/)[0]}}function VJ(e,t){return t?.method?t.method.toUpperCase():typeof e!="string"&&!(e instanceof URL)&&e.method?e.method.toUpperCase():"GET"}function WJ(e){for(const t of HJ){const n=e.headers.get(t);if(n)return n}}function GJ(e){Mu.push(e),Mu.length>BJ&&Mu.shift()}function KN(e){const{input:t,init:n,response:r,durationMs:o}=e;GJ({method:VJ(t,n),path:qJ(t),status:r?.status??0,durationMs:Math.round(o),correlationId:r?WJ(r):void 0,timestamp:new Date().toISOString()})}function KJ(){return Mu.slice()}function ZJ(){for(let e=Mu.length-1;e>=0;e--){const t=Mu[e];if(t.status===0||t.status>=400)return t}}class ZA extends Error{constructor(t){super(t instanceof Error&&t.message?t.message:"The request could not be completed.",{cause:t}),this.name="NetworkError"}}const YJ=e=>typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError",gF=async(e,t)=>{const n=performance.now();try{const r=await fetch(e,{...t,redirect:"manual"}),o=r.type==="opaqueredirect"?new Response(null,{status:401}):r;return KN({input:e,init:t,response:o,durationMs:performance.now()-n}),o}catch(r){throw YJ(r)?r:(KN({input:e,init:t,durationMs:performance.now()-n}),new ZA(r))}},YA=()=>{try{return globalThis.sessionStorage??null}catch{return null}},Hv=()=>pc().betterAuthEnabled,QJ="EMAIL_PASSWORD_SIGN_UP_DISABLED",XJ=e=>typeof e=="object"&&e!==null&&e.code===QJ,qa=jJ(),JJ=60,eee=30,P_="remit.better-auth.token",tee=()=>{const e=YA()?.getItem(P_);if(!e)return null;try{const t=JSON.parse(e);if(t&&typeof t=="object"&&typeof t.value=="string"&&typeof t.expiresAt=="number")return{value:t.value,expiresAt:t.expiresAt}}catch{}return null},mF=e=>{const t=YA();if(t)try{if(!e){t.removeItem(P_);return}t.setItem(P_,JSON.stringify(e))}catch{}};let xa=null,Im=0;const nee=()=>xa||(xa=tee(),xa),Ma=()=>Math.floor(Date.now()/1e3),ree=e=>{const[,t]=e.split(".");if(!t)return Ma();try{const n=JSON.parse(atob(t.replace(/-/g,"+").replace(/_/g,"/")));return typeof n.exp=="number"?n.exp:Ma()}catch{return Ma()}};class Rm extends Error{status;constructor(t,n){super(t),this.name="AuthTokenError",this.status=n}}const oee=async()=>{const e=await gF("/api/auth/token",{credentials:"include"});if(!e.ok)throw new Rm(`Could not mint a session token: ${e.status} ${e.statusText}`,e.status);const t=await e.json();if(t&&typeof t=="object"&&"token"in t&&typeof t.token=="string")return t.token;throw new Rm("The token endpoint returned no token")};let wd=null;const see=()=>wd||(wd=oee().then(e=>(xa={value:e,expiresAt:ree(e)},mF(xa),Im=0,e)).finally(()=>{wd=null}),wd),iee=e=>e.expiresAt-JJ>Ma(),ZN=e=>e.expiresAt>Ma(),aee=e=>e instanceof ZA?!0:e instanceof Rm?e.status===408||e.status===429||(e.status??0)>=500:!1,lee=e=>e instanceof Rm&&(e.status===401||e.status===403),uee=async()=>{const e=nee();if(e&&iee(e)||e&&ZN(e)&&Ma()<Im)return e.value;try{return await see()}catch(t){if(lee(t))throw QA(),t.status===403&&qa.$store.notify("$sessionSignal"),t;if(e&&ZN(e)&&aee(t))return Im=Ma()+eee,e.value;throw t}},QA=()=>{Im=0,mF(null),xa=null};const cee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vF=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var dee={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const fee=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...u},c)=>_.createElement("svg",{ref:c,...dee,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vF("lucide",o),...u},[...a.map(([f,h])=>_.createElement(f,h)),...Array.isArray(s)?s:[s]]));const yt=(e,t)=>{const n=_.forwardRef(({className:r,...o},s)=>_.createElement(fee,{ref:s,iconNode:t,className:vF(`lucide-${cee(e)}`,r),...o}));return n.displayName=`${e}`,n};const hee=yt("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const pee=yt("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);const yF=yt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const gee=yt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const bF=yt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const mee=yt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const vee=yt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const yee=yt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const bee=yt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const See=yt("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const wee=yt("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);const Cee=yt("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const SF=yt("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);const Eee=yt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const wF=yt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const YN=yt("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);const _ee=yt("Mails",[["rect",{width:"16",height:"13",x:"6",y:"4",rx:"2",key:"1drq3f"}],["path",{d:"m22 7-7.1 3.78c-.57.3-1.23.3-1.8 0L6 7",key:"xn252p"}],["path",{d:"M2 8v11c0 1.1.9 2 2 2h14",key:"n13cji"}]]);const XA=yt("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const xee=yt("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);const Aee=yt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const Iee=yt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ree=yt("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const Tee=yt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);const Oee=yt("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const Mee=yt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const JA=yt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Pee=yt("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);const Nee=yt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const kee=yt("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const N_=yt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function CF(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=CF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dee(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=CF(e))&&(r&&(r+=" "),r+=t);return r}const eI="-",Lee=e=>{const t=Fee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const u=a.split(eI);return u[0]===""&&u.length!==1&&u.shift(),EF(u,t)||Uee(a)},getConflictingClassGroupIds:(a,u)=>{const c=n[a]||[];return u&&r[a]?[...c,...r[a]]:c}}},EF=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?EF(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(eI);return t.validators.find(({validator:a})=>a(s))?.classGroupId},QN=/^\[(.+)\]$/,Uee=e=>{if(QN.test(e)){const t=QN.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Fee=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zee(Object.entries(e.classGroups),n).forEach(([s,a])=>{k_(a,r,s,t)}),r},k_=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:XN(t,o);s.classGroupId=n;return}if(typeof o=="function"){if($ee(o)){k_(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,a])=>{k_(a,XN(t,s),n,r)})})},XN=(e,t)=>{let n=e;return t.split(eI).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$ee=e=>e.isThemeGetter,zee=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,u])=>[t+a,u])):s);return[n,o]}):e,jee=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return o(s,a),a},set(s,a){n.has(s)?n.set(s,a):o(s,a)}}},_F="!",Bee=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,a=u=>{const c=[];let f=0,h=0,g;for(let C=0;C<u.length;C++){let E=u[C];if(f===0){if(E===o&&(r||u.slice(C,C+s)===t)){c.push(u.slice(h,C)),h=C+s;continue}if(E==="/"){g=C;continue}}E==="["?f++:E==="]"&&f--}const m=c.length===0?u:u.substring(h),v=m.startsWith(_F),w=v?m.substring(1):m,S=g&&g>h?g-h:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}};return n?u=>n({className:u,parseClassName:a}):a},Hee=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},qee=e=>({cache:jee(e.cacheSize),parseClassName:Bee(e),...Lee(e)}),Vee=/\s+/,Wee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],a=e.trim().split(Vee);let u="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{modifiers:h,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:v}=n(f);let w=!!v,S=r(w?m.substring(0,v):m);if(!S){if(!w){u=f+(u.length>0?" "+u:u);continue}if(S=r(m),!S){u=f+(u.length>0?" "+u:u);continue}w=!1}const C=Hee(h).join(":"),E=g?C+_F:C,A=E+S;if(s.includes(A))continue;s.push(A);const I=o(S,w);for(let T=0;T<I.length;++T){const N=I[T];s.push(E+N)}u=f+(u.length>0?" "+u:u)}return u};function Gee(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=xF(t))&&(r&&(r+=" "),r+=n);return r}const xF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=xF(e[r]))&&(n&&(n+=" "),n+=t);return n};function Kee(e,...t){let n,r,o,s=a;function a(c){const f=t.reduce((h,g)=>g(h),e());return n=qee(f),r=n.cache.get,o=n.cache.set,s=u,u(c)}function u(c){const f=r(c);if(f)return f;const h=Wee(c,n);return o(c,h),h}return function(){return s(Gee.apply(null,arguments))}}const Lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},AF=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zee=/^\d+\/\d+$/,Yee=new Set(["px","full","screen"]),Qee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ete=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ms=e=>Pu(e)||Yee.has(e)||Zee.test(e),bi=e=>gc(e,"length",ute),Pu=e=>!!e&&!Number.isNaN(Number(e)),U1=e=>gc(e,"number",Pu),Cd=e=>!!e&&Number.isInteger(Number(e)),nte=e=>e.endsWith("%")&&Pu(e.slice(0,-1)),je=e=>AF.test(e),Si=e=>Qee.test(e),rte=new Set(["length","size","percentage"]),ote=e=>gc(e,rte,IF),ste=e=>gc(e,"position",IF),ite=new Set(["image","url"]),ate=e=>gc(e,ite,dte),lte=e=>gc(e,"",cte),Ed=()=>!0,gc=(e,t,n)=>{const r=AF.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ute=e=>Xee.test(e)&&!Jee.test(e),IF=()=>!1,cte=e=>ete.test(e),dte=e=>tte.test(e),fte=()=>{const e=Lt("colors"),t=Lt("spacing"),n=Lt("blur"),r=Lt("brightness"),o=Lt("borderColor"),s=Lt("borderRadius"),a=Lt("borderSpacing"),u=Lt("borderWidth"),c=Lt("contrast"),f=Lt("grayscale"),h=Lt("hueRotate"),g=Lt("invert"),m=Lt("gap"),v=Lt("gradientColorStops"),w=Lt("gradientColorStopPositions"),S=Lt("inset"),C=Lt("margin"),E=Lt("opacity"),A=Lt("padding"),I=Lt("saturate"),T=Lt("scale"),N=Lt("sepia"),M=Lt("skew"),R=Lt("space"),k=Lt("translate"),L=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",je,t],D=()=>[je,t],j=()=>["",ms,bi],Z=()=>["auto",Pu,je],he=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],ue=()=>["","0",je],we=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[Pu,je];return{cacheSize:500,separator:":",theme:{colors:[Ed],spacing:[ms,bi],blur:["none","",Si,je],brightness:U(),borderColor:[e],borderRadius:["none","","full",Si,je],borderSpacing:D(),borderWidth:j(),contrast:U(),grayscale:ue(),hueRotate:U(),invert:ue(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[nte,bi],inset:F(),margin:F(),opacity:U(),padding:D(),saturate:U(),scale:U(),sepia:ue(),skew:U(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",je]}],container:["container"],columns:[{columns:[Si]}],"break-after":[{"break-after":we()}],"break-before":[{"break-before":we()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...he(),je]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Cd,je]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",je]}],grow:[{grow:ue()}],shrink:[{shrink:ue()}],order:[{order:["first","last","none",Cd,je]}],"grid-cols":[{"grid-cols":[Ed]}],"col-start-end":[{col:["auto",{span:["full",Cd,je]},je]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[Ed]}],"row-start-end":[{row:["auto",{span:[Cd,je]},je]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",je]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",je,t]}],"min-w":[{"min-w":[je,t,"min","max","fit"]}],"max-w":[{"max-w":[je,t,"none","full","min","max","fit","prose",{screen:[Si]},Si]}],h:[{h:[je,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[je,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[je,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[je,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Si,bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",U1]}],"font-family":[{font:[Ed]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",je]}],"line-clamp":[{"line-clamp":["none",Pu,U1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ms,je]}],"list-image":[{"list-image":["none",je]}],"list-style-type":[{list:["none","disc","decimal",je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ms,bi]}],"underline-offset":[{"underline-offset":["auto",ms,je]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...he(),ste]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ote]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ate]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:B()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[ms,je]}],"outline-w":[{outline:[ms,bi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[ms,bi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Si,lte]}],"shadow-color":[{shadow:[Ed]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Si,je]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[I]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",je]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",je]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Cd,je]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",je]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ms,bi,U1]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},hte=Kee(fte);function rn(...e){return hte(Dee(e))}var F1={exports:{}},$n={};var JN;function pte(){if(JN)return $n;JN=1;var e=rh();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(c,f,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:c,containerInfo:f,implementation:h}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$n.createPortal=function(c,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(c,f,null,h)},$n.flushSync=function(c){var f=a.T,h=r.p;try{if(a.T=null,r.p=2,c)return c()}finally{a.T=f,r.p=h,r.d.f()}},$n.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},$n.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},$n.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var h=f.as,g=u(h,f.crossOrigin),m=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:m,fetchPriority:v}):h==="script"&&r.d.X(c,{crossOrigin:g,integrity:m,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},$n.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=u(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},$n.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,g=u(h,f.crossOrigin);r.d.L(c,h,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},$n.preloadModule=function(c,f){if(typeof c=="string")if(f){var h=u(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},$n.requestFormReset=function(c){r.d.r(c)},$n.unstable_batchedUpdates=function(c,f){return c(f)},$n.useFormState=function(c,f,h){return a.H.useFormState(c,f,h)},$n.useFormStatus=function(){return a.H.useHostTransitionStatus()},$n.version="19.2.7",$n}var ek;function RF(){if(ek)return F1.exports;ek=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),F1.exports=pte(),F1.exports}var gte=RF();const _d={action:null,nextPrefix:null,preventDefault:!1},mte={b:"goBrief",i:"goInbox",s:"goSent",f:"goFlagged",",":"goSettings"},vte={j:{action:"focusNext"},k:{action:"focusPrevious"},arrowdown:{action:"focusNext"},arrowup:{action:"focusPrevious"},home:{action:"focusFirst"},end:{action:"focusLast"},enter:{action:"openFocused"}," ":{action:"toggleSelect"},delete:{action:"delete"},backspace:{action:"delete"},u:{action:"toggleRead"},x:{action:"toggleSelect"},r:{action:"reply"},a:{action:"replyAll"},f:{action:"forward"},"#":{action:"delete"},s:{action:"toggleStar"},m:{action:"muteSender"},b:{action:"blockSender"},v:{action:"vipSender"},"!":{action:"markJunk"},i:{action:"toggleIntelligence"},d:{action:"toggleDensity"},"/":{action:"focusSearch"},c:{action:"compose"},"?":{action:"help"}};function yte(e,t){const n=e.key.toLowerCase(),r=e.metaKey||e.ctrlKey;if(e.inEditable)return{..._d,nextPrefix:t==="g"?null:t};if(e.onControl&&(n==="enter"||n===" "))return{..._d,nextPrefix:t==="g"?null:t};if(r&&n==="n")return{action:"compose",nextPrefix:null,preventDefault:!0};if(r&&n==="a")return{action:"selectAll",nextPrefix:null,preventDefault:!0};if(r)return{..._d,nextPrefix:t==="g"?null:t};if(n==="escape")return{action:"back",nextPrefix:null,preventDefault:!1};if(t==="g"){const a=mte[n===","?",":n]??null;return{action:a,nextPrefix:null,preventDefault:a!==null}}if(n==="g"&&!e.shiftKey)return{action:null,nextPrefix:"g",preventDefault:!0};if(e.shiftKey){const s=n==="j"||n==="arrowdown";if(s||(n==="k"||n==="arrowup"))return{action:s?"extendSelectDown":"extendSelectUp",nextPrefix:null,preventDefault:!0}}const o=vte[n];if(o){const s=o.requireShift===!0,a=n.length===1&&!/[a-z0-9]/.test(n);return!s&&e.shiftKey&&!a?_d:{action:o.action,nextPrefix:null,preventDefault:!0}}return _d}function bte(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}const Ste="data-message-row",wte='button, a[href], summary, [role="button"], [role="menuitem"], [role="tab"], [role="switch"], [role="checkbox"]';function Cte(e){if(!(e instanceof HTMLElement))return!1;const t=e.closest(wte);return t?!t.hasAttribute(Ste):!1}const Ete=["reply","replyAll","forward","delete","toggleStar","toggleRead","muteSender","blockSender","vipSender","markJunk"],_te=["focusNext","focusPrevious","focusFirst","focusLast","openFocused","toggleSelect","extendSelectDown","extendSelectUp","selectAll","toggleDensity"],Cn=(e,...t)=>({action:e,requires:t});Cn("help"),Cn("goBrief",{listIsNot:"brief"}),Cn("goFlagged",{listIsNot:"flagged"}),Cn("goInbox",{listIsNot:"inbox"}),Cn("goSent",{listIsNot:"sent"}),Cn("goSettings"),Cn("compose"),Cn("focusSearch"),Cn("toggleIntelligence"),[..._te.map(e=>Cn(e,"listVisible")),...Ete.map(e=>Cn(e,"aimed")),Cn("back","selection")],Cn("focusNext","threadOpen",{not:"listVisible"}),Cn("focusPrevious","threadOpen",{not:"listVisible"}),Cn("reply","threadOpen"),Cn("replyAll","threadOpen"),Cn("forward","threadOpen"),Cn("back");function xte(e,t){const n=t.at(-1);return n?n.handles.includes(e)?{outcome:"act",target:{kind:"overlay",frame:n}}:{outcome:"contained",by:{kind:"overlay",frame:n}}:null}const Ate="[data-escape-owner]";let zu=[],Ite=0;const Rte=()=>++Ite;function TF(){const[e]=_.useState(Rte);return e}const Tte=(e,t)=>e.depth-t.depth;function Ote(){return[...zu].sort(Tte).map(e=>({id:e.id,handles:Object.entries(e.run()).filter(([,t])=>t).map(([t])=>t)}))}function Mte(){let e;for(const t of zu)(!e||t.depth>e.depth)&&(e=t);return e}function gUe(e){return xte(e,Ote())}function Pte(e){if(e.key==="Escape"){const t=document.activeElement;return t instanceof Element&&t.closest(Ate)?null:"back"}return yte({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,inEditable:bte(e.target),onControl:Cte(e.target)},null).action}function tk(e){const t=Mte();if(!t)return;const n=Pte(e);if(!n)return;const r=t.run()[n];r&&(e.preventDefault(),e.stopImmediatePropagation(),r())}function nk(e){const t=zu.length===0;if(zu=e,t!==(e.length===0)){if(e.length>0){window.addEventListener("keydown",tk,!0);return}window.removeEventListener("keydown",tk,!0)}}function qv({id:e,open:t,answers:n={}}){const r=_.useRef(n);r.current=n;const o=TF();_.useEffect(()=>{if(!t)return;const s={id:e,depth:o,run:()=>r.current};return nk([...zu,s]),()=>{nk(zu.filter(a=>a!==s))}},[e,t,o])}const OF="inline-flex items-center justify-center gap-2 rounded-md font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface disabled:opacity-50 disabled:pointer-events-none",MF={primary:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface text-fg border border-line hover:bg-surface-sunken hover:border-line-strong",ghost:"text-fg-muted hover:bg-surface-sunken hover:text-fg",danger:"bg-danger text-accent-fg hover:opacity-90"},PF={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3.5 text-sm",touch:"h-11 w-11 text-sm"};function Xr({variant:e="primary",size:t="md",icon:n,className:r,children:o,ref:s,...a}){return O.jsxs("button",{type:"button",ref:s,className:rn(OF,MF[e],PF[t],r),...a,children:[n,o]})}function mUe({variant:e="primary",size:t="md",icon:n,external:r,className:o,children:s,...a}){return O.jsxs("a",{className:rn(OF,MF[e],PF[t],o),...r?{target:"_blank",rel:"noopener noreferrer"}:{},...a,children:[n,s]})}const Nte='a[href], button, input, select, textarea, iframe, [tabindex], [contenteditable]:not([contenteditable="false"])';function kte(e){if(Number(e.getAttribute("tabindex")??0)<0||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"||e.closest("[inert], [hidden], [aria-hidden='true']"))return!1;const t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function rk(e){const t=e.querySelectorAll('[role="dialog"][aria-modal="true"]');return[...(t[t.length-1]??e).querySelectorAll(Nte)].filter(kte)}const D_=new Set;function Dte(e){for(const t of D_)if(t>e)return!1;return!0}function Lte(e,t){return!(t instanceof HTMLElement)||t===document.body||t===document.documentElement?!1:!e.contains(t)}function Vv(e,t){const n=TF();_.useEffect(()=>{if(t)return D_.add(n),()=>{D_.delete(n)}},[t,n]),_.useEffect(()=>{if(!t)return;const r=document.activeElement instanceof HTMLElement?document.activeElement:null,o=e.current;return o&&(rk(o)[0]??o).focus(),()=>{r?.isConnected&&r.focus()}},[t,e]),_.useEffect(()=>{if(!t)return;const r=o=>{if(o.key!=="Tab"||o.defaultPrevented||!Dte(n))return;const s=e.current;if(!s)return;const a=document.activeElement;if(Lte(s,a))return;const u=rk(s),c=u[0],f=u.at(-1);if(!c||!f){o.preventDefault(),s.focus();return}const h=a instanceof HTMLElement&&u.includes(a);if(o.shiftKey){(!h||a===c)&&(o.preventDefault(),f.focus());return}(!h||a===f)&&(o.preventDefault(),c.focus())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,e,n])}const Ute=({label:e,onDismiss:t,className:n})=>O.jsx("button",{type:"button","aria-label":e,tabIndex:-1,onClick:t,className:rn("absolute inset-0 bg-canvas/80",n)}),Fte={info:"bg-accent-2/15 text-accent-2 border-accent-2/40",success:"bg-positive/15 text-positive border-positive/40",warning:"bg-warning/15 text-warning border-warning/40",danger:"bg-danger/15 text-danger border-danger/40"},$te={info:"bg-surface-sunken text-fg-muted",success:"bg-positive/10 text-positive",warning:"bg-warning/10 text-warning",danger:"bg-danger-soft text-danger"},zte={info:"status",success:"status",warning:"alert",danger:"alert"};function Zr({tone:e="info",variant:t="framed",onDismiss:n,role:r,className:o,children:s,...a}){const u=t==="soft";return O.jsxs("div",{role:r??zte[e],className:rn("flex gap-2 px-3 py-2 text-sm",u?rn("items-start rounded-md",$te[e]):rn("items-center border",Fte[e]),o),...a,children:[O.jsx("div",{className:"flex-1 min-w-0",children:s}),n&&(u?O.jsx(Xr,{variant:"ghost",size:"sm",icon:O.jsx(N_,{className:"size-3.5"}),onClick:n,"aria-label":"Dismiss",className:"-mr-1 shrink-0"}):O.jsx("button",{type:"button",onClick:n,"aria-label":"Dismiss",className:"shrink-0 rounded-md p-1 hover:bg-fg/10 transition-colors",children:O.jsx(N_,{className:"size-4","aria-hidden":"true"})}))]})}function ok({open:e,onClose:t,title:n,children:r,className:o,anchor:s="center"}){const a=_.useRef(null);if(qv({id:"dialog",open:e,answers:{back:t}}),Vv(a,e),!e)return null;const u=s==="left",c=s==="right";return O.jsxs("div",{className:rn("fixed inset-0 z-50 flex",u?"items-stretch justify-start":c?"items-stretch justify-end":"items-center justify-center px-4"),children:[O.jsx(Ute,{label:"Dismiss dialog",onDismiss:t}),O.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title",tabIndex:-1,className:rn("relative z-10 overflow-hidden border-line bg-surface shadow-xl",u?"safe-area-frame h-full w-72 max-w-[85vw] border-r":c?"safe-area-frame h-full w-[80vw] max-w-[320px] border-l":"w-full max-w-lg rounded-md border",o),children:[O.jsx("h2",{id:"dialog-title",className:"sr-only",children:n}),r]})]})}function NF({children:e,label:t}){return O.jsxs("span",{className:"relative inline-flex",children:[e,t!==void 0&&O.jsxs(O.Fragment,{children:[O.jsx("span",{"data-testid":"attention-dot",className:"absolute -right-1 -top-1 size-2 rounded-full bg-accent-2"}),O.jsx("span",{className:"sr-only",children:t})]})]})}function Wv({children:e,className:t}){return O.jsx("div",{"data-auth-page":!0,className:rn("flex min-h-dvh w-full flex-col items-center justify-center overflow-y-auto bg-surface-sunken pb-[max(2rem,env(safe-area-inset-bottom,0px))] pl-[max(1rem,env(safe-area-inset-left,0px))] pr-[max(1rem,env(safe-area-inset-right,0px))] pt-[max(2rem,env(safe-area-inset-top,0px))] text-fg",t),style:{backgroundImage:"radial-gradient(at 20% 0%, color-mix(in oklch, var(--accent) 8%, transparent) 0px, transparent 50%), radial-gradient(at 80% 100%, color-mix(in oklch, var(--accent) 8%, transparent) 0px, transparent 50%)"},children:O.jsx("div",{className:"w-full max-w-[26rem]",children:e})})}const jte="Secure sign-in powered by AWS Cognito";function tI(e){const t=e?.note??"Secure sign-in";return O.jsx("div",{className:"text-center pt-5",children:O.jsx("p",{className:"text-xs text-fg-muted",children:t})})}const Bte=()=>O.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"text-accent",children:[O.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),O.jsx("path",{d:"M3 7l9 6 9-6"})]});function Gv({wordmark:e="remit,",tagline:t="your email client in the cloud.",mark:n=O.jsx(Bte,{})}){return O.jsxs("div",{className:"text-center pb-6",children:[O.jsx("div",{className:"flex items-center justify-center pb-3",children:n}),O.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-[-0.01em] text-fg",children:e}),O.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:t})]})}const Hte={default:rn("flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors"),inline:"flex items-center gap-2 bg-transparent text-sm"};function bf({icon:e,className:t,variant:n="default",trailing:r,ref:o,...s}){return O.jsxs("div",{className:rn(Hte[n],t),children:[e&&O.jsx("span",{className:"text-fg-subtle shrink-0",children:e}),O.jsx("input",{ref:o,className:"min-w-0 flex-1 bg-transparent text-fg placeholder:text-fg-subtle outline-none",...s}),r]})}const qte={error:{container:"border-danger/50 bg-danger-soft",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning-soft",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},Vte={error:bF,warning:JA,info:Eee},Wte={error:"Error",warning:"Warning",info:"Information"},Gte=({id:e,severity:t,title:n,detail:r,action:o,onDismiss:s})=>{const a=qte[t],u=Vte[t];return O.jsxs("div",{role:t==="error"?"alert":"status","aria-live":t==="error"?"assertive":"polite",className:rn("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg",a.container),children:[O.jsx(u,{className:rn("size-5 shrink-0 mt-0.5",a.icon),"aria-hidden":"true"}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("p",{className:rn("text-sm font-medium",a.title),children:n}),r&&O.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r}),o&&O.jsx("a",{href:o.href,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-block text-xs font-medium text-accent-2 underline underline-offset-2",children:o.label})]}),O.jsx("button",{type:"button",onClick:()=>s(e),className:"shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors","aria-label":`Dismiss ${Wte[t].toLowerCase()}`,children:O.jsx(N_,{className:"size-4","aria-hidden":"true"})})]})},Kte=({errors:e,onDismiss:t})=>e.length===0?null:O.jsx("section",{"aria-label":"Notifications",className:"pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-[calc(1rem+env(safe-area-inset-top,0px))] sm:items-end sm:pr-6",children:O.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:e.map(n=>O.jsx(Gte,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,action:n.action,onDismiss:t},n.id))})});function Zte({className:e,children:t,...n}){return O.jsx("label",{className:rn("mb-1 block text-xs font-medium text-fg-muted",e),...n,children:t})}const Yte="Matches on what the messages say about themselves — sender, subject, list. No reading involved.",Qte={From:"From",Subject:"Subject",HasWords:"Has the words",ListId:"List",FromDomain:"Domain"};function Xte(e){return Qte[e]}const Jte={ListId:"The mailing list's List-Id header, matched exactly. New mail is matched as it arrives — mail delivered before this was set up may not carry it yet.",FromDomain:"The sender's registrable domain — matches anyone at it, subdomains included (a look-alike like example.com.evil.test never matches)."};function vUe(e){return Jte[e]}function ene(e){return e==="HasWords"}function kF(e){return e.clauses.length>0}function DF(e){return e.clauses.filter(t=>ene(t.field))}const yUe=["From","Subject","HasWords","ListId","FromDomain"],tne={all:"Match all",any:"Match any"};function bUe(e){return tne[e]}function nne(e){return e==="all"?"and":"or"}function SUe(e){if(e.status==="loading")return"Counting matches…";if(e.status==="error")return e.reason;if(e.count===0)return"No mail matches yet";const t=e.count===1?"message":"messages",n=`${e.count} ${t} match`;return e.stale?`${n} — recounting`:n}const rne={once:"Just once",standing:"Keep doing this",until:"Until a date"};function wUe(e){return rne[e]}function CUe(e){return e==="once"?"Apply now":e==="standing"?"Save rule":"Save until then"}const Gr={noMatch:"Add a clause so the rule has something to match.",bodyTextOnce:"Applying once can't read message bodies. Save this as a rule instead, or drop the “has the words” clause.",noAction:"Pick a folder to move into, or a label to apply.",unnamed:"Name this rule so you can find it later.",noUntilDate:"Pick the date this rule should stop on.",counting:"Counting matches — save once the count settles.",recounting:"Recounting matches — save once the count settles."},EUe="Can't count matches — “has the words” reads message bodies, which only a saved rule does.";function LF(e){if(e.status==="loading")return Gr.counting;if(e.status==="ready"&&e.stale)return Gr.recounting}function _Ue(e,t){return kF(e)?e.scope==="once"&&DF(e).length>0?Gr.bodyTextOnce:!e.moveMailboxId&&!e.labelId?Gr.noAction:(e.scope==="standing"||e.scope==="until")&&(e.name??"").trim()===""?Gr.unnamed:e.scope==="until"&&!e.until?Gr.noUntilDate:LF(t):Gr.noMatch}const nI=(e,t)=>t.length===0?[e]:e.split(t),one=(e,t)=>{const n=nI(e,t);return n[n.length-1]||e},Sf=(e,t)=>{if(t.length===0)return"";const n=e.lastIndexOf(t);return n===-1?"":e.slice(0,n)},UF=(e,t)=>nI(e,t).length-1,wf=(e,t)=>{const n=[];let r=e,o=Sf(r,t);for(;o&&o.length<r.length;)n.push(o),r=o,o=Sf(r,t);return n},sne=(e,t)=>{const n=new Set(e.map(a=>a.path)),r=new Set,o=[],s=a=>{if(!r.has(a.path)){r.add(a.path),o.push(a);for(const u of e)Sf(u.path,t)===a.path&&s(u)}};for(const a of e){const u=Sf(a.path,t);u&&n.has(u)||s(a)}return o},FF=(e,t)=>e.label.toLowerCase().includes(t)||e.path.toLowerCase().includes(t),ine=(e,t,n)=>{const r=new Set;if(!t)return r;for(const o of e)if(FF(o,t))for(const s of wf(o.path,n))r.add(s);return r},ane=(e,t,n,r=new Set)=>{const o=(u,c)=>({folder:u,depth:UF(u.path,n),context:c,expanded:r.has(u.path)});if(!t)return e.map(u=>o(u,!1));const s=new Set;for(const u of e)FF(u,t)&&s.add(u.path);const a=new Set(s);for(const u of s)for(const c of wf(u,n))a.add(c);return e.filter(u=>a.has(u.path)).map(u=>o(u,!s.has(u.path)))},lne=(e,t,n)=>{const r=new Set(e.map(o=>o.path));return e.filter(o=>wf(o.path,n).every(s=>!r.has(s)||t.has(s))).map(o=>({folder:o,depth:UF(o.path,n),context:!1,expanded:t.has(o.path)}))},une=(e,t)=>{if(t.length===0)return e.map((s,a)=>({kind:"folder",row:s,index:a}));const n=[],r=[],o=s=>{for(;r.length>0;){const a=r[r.length-1];if(!a||s?.startsWith(`${a.folder.path}${t}`))break;r.pop(),n.push({kind:"create",parent:a.folder,depth:a.depth+1})}};return e.forEach((s,a)=>{o(s.folder.path),n.push({kind:"folder",row:s,index:a}),s.expanded&&r.push(s)}),o(null),n},cne=e=>typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError",Do=e=>e!==void 0&&!e.context,$1=e=>e!==void 0&&!e.folder.isCurrent&&!e.context,z1=e=>{for(let t=0;t<e.length;t+=1)if(Do(e[t]))return t;return-1},dne=e=>{for(let t=e.length-1;t>=0;t-=1)if(Do(e[t]))return t;return-1},sk=(e,t,n)=>{const r=e.length;if(r<=0)return-1;const o=t<0?n===1?-1:r:t;for(let s=1;s<=r;s+=1){const a=((o+n*s)%r+r)%r;if(Do(e[a]))return a}return-1},fne=(e,t,n)=>{const r=e[t];if(!r)return-1;const o=Sf(r.folder.path,n);if(!o)return-1;for(let s=t-1;s>=0;s-=1)if(e[s]?.folder.path===o)return Do(e[s])?s:-1;return-1},L_="flex min-h-11 min-w-0 flex-1 items-center gap-2 px-3 py-2.5 text-left text-sm transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",$F=14,hne=60,U_=({depth:e})=>e>0?O.jsx("span",{"aria-hidden":"true",className:"shrink-0",style:{width:e*$F}}):null,F_=({depth:e})=>O.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute right-0 bottom-0 h-px bg-line",style:{left:hne+e*$F}}),pne=({label:e,depth:t,expanded:n,ariaLabel:r,selected:o=!1,context:s=!1,current:a=!1,currentTag:u,messageCount:c,failure:f,separated:h=!1,actions:g,tabIndex:m,onActivate:v,onFocus:w,ref:S})=>{const C=O.jsx(gee,{className:rn("size-4 shrink-0 text-fg-subtle transition-transform",n&&"rotate-90"),"aria-hidden":"true"}),E=O.jsx(Cee,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":"true"}),A=c===void 0?null:O.jsxs("span",{"aria-hidden":"true",className:"shrink-0 text-2xs text-fg-subtle",children:[c," ",c===1?"msg":"msgs"]}),I=O.jsxs("span",{className:"min-w-0 flex-1",children:[O.jsx("span",{className:"block truncate",children:e}),f&&O.jsxs("span",{className:"flex items-center gap-1 text-2xs text-danger",children:[O.jsx(bF,{className:"size-3 shrink-0","aria-hidden":"true"}),O.jsx("span",{className:"truncate",children:f})]})]}),T=f?`${r} — ${f}`:r;return s?O.jsxs("div",{className:"relative flex items-center",children:[O.jsxs("div",{role:"treeitem","aria-level":t+1,"aria-selected":!1,"aria-expanded":n,"aria-label":T,className:rn(L_,"opacity-60"),children:[O.jsx(U_,{depth:t}),C,E,I,A]}),g,h&&O.jsx(F_,{depth:t})]}):O.jsxs("div",{className:"relative flex items-center",children:[O.jsxs("button",{ref:S,type:"button",role:"treeitem","aria-level":t+1,"aria-selected":o,"aria-expanded":n,"aria-current":a?"true":void 0,"aria-label":T,tabIndex:m,onClick:v,onFocus:w,className:rn(L_,"hover:bg-surface-raised active:bg-surface-sunken",a&&"text-fg-muted"),children:[O.jsx(U_,{depth:t}),C,E,I,A,a&&u&&O.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:u}),o&&O.jsx(yF,{className:"size-4 shrink-0 text-accent","aria-hidden":"true"})]}),g,h&&O.jsx(F_,{depth:t})]})},ik=({label:e,ariaLabel:t,depth:n=0,prominence:r="prominent",separated:o=!1,onOpen:s})=>O.jsxs("div",{className:rn("relative",r==="prominent"&&"p-2"),children:[O.jsxs("button",{type:"button",onClick:s,"aria-label":t,"data-prominence":r,className:rn(L_,"w-full active:bg-surface-sunken",r==="prominent"?"rounded-lg border border-line-strong border-dashed font-medium text-fg-muted hover:border-accent-2 hover:text-accent-2":"text-fg-subtle hover:bg-surface-raised hover:text-fg-muted"),children:[O.jsx(U_,{depth:n}),O.jsx("span",{"aria-hidden":"true",className:"size-4 shrink-0"}),O.jsx(See,{className:"size-4 shrink-0","aria-hidden":"true"}),O.jsx("span",{className:"min-w-0 flex-1 truncate",children:e})]}),o&&O.jsx(F_,{depth:n})]}),zF={nameLabel:"Folder name",namePlaceholder:"Hotels",insideLabel:"Inside",create:"Create folder",cancel:"Cancel",createPending:"Creating folder…"},gne=({parentLabel:e,name:t,onNameChange:n,onSubmit:r,onCancel:o,pending:s=!1,error:a,labels:u})=>{const c={...zF,...u},f=_.useId(),h=_.useRef(null),g=_.useRef(null);return _.useEffect(()=>{h.current?.focus({preventScroll:!0}),g.current?.scrollIntoView({block:"nearest"})},[]),O.jsxs("div",{ref:g,className:"space-y-3 border-y border-line bg-surface-sunken px-3 py-3",children:[O.jsxs("div",{children:[O.jsx(Zte,{htmlFor:f,children:c.nameLabel}),O.jsx(bf,{id:f,ref:h,value:t,placeholder:c.namePlaceholder,onChange:m=>n(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r()),m.key==="Escape"&&(m.preventDefault(),o())}})]}),O.jsxs("p",{className:"text-xs text-fg-muted",children:[c.insideLabel," ",O.jsx("span",{className:"font-medium text-fg",children:e})]}),a&&O.jsx("p",{className:"text-xs text-danger",role:"alert",children:a}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Xr,{variant:"ghost",size:"md",onClick:o,className:"min-h-11 shrink-0",children:c.cancel}),O.jsx(Xr,{variant:"secondary",size:"md",onClick:r,disabled:s,className:"min-h-11 shrink-0",children:s?c.createPending:c.create})]})]})},mne={...zF,filterPlaceholder:"Filter folders…",filterAriaLabel:"Filter folders",treeAriaLabel:"Destination folders",currentSuffix:"(current folder)",currentTag:"current",contextSuffix:"(containing folder)",emptyMessage:e=>`No folders match "${e}"`,noFolders:"No folders to show",optionLabel:e=>`Move to ${e.label}`,newFolder:"New folder",newSubfolder:e=>`New folder inside ${e}`,topLevel:"Top level",nameRequired:"Give the folder a name.",createError:"Couldn't create that folder. Please try again."},vne=({folders:e,selectedId:t,onSelect:n,rowActions:r,rowFailure:o,onCreateFolder:s,onCancel:a,delimiter:u="/",labels:c,autoFocusFilter:f=!1})=>{const h={...mne,...c},[g,m]=_.useState(""),[v,w]=_.useState(()=>{const se=e.find(Se=>Se.id===t);return new Set(se?wf(se.path,u):[])}),[S,C]=_.useState(null),[E,A]=_.useState(""),[I,T]=_.useState(),[N,M]=_.useState(!1),[R,k]=_.useState(-1),L=_.useRef([]),q=_.useRef(null),F=_.useRef(!1),D=_.useRef(null);_.useEffect(()=>()=>D.current?.abort(),[]),_.useEffect(()=>{f&&q.current?.focus()},[f]);const j=g.trim().toLowerCase(),Z=_.useMemo(()=>sne(e,u),[e,u]),he=_.useMemo(()=>{const se=ine(Z,j,u);return se.size===0?v:new Set([...v,...se])},[Z,v,j,u]),B=_.useMemo(()=>j?ane(Z,j,u,he):lne(Z,he,u),[Z,j,u,he]),Q=_.useMemo(()=>s?une(B,u):void 0,[B,u,s]);_.useEffect(()=>{k(se=>Do(B[se])?se:z1(B))},[B]),_.useEffect(()=>{F.current&&(F.current=!1,!(R<0)&&L.current[R]?.focus())},[R]);const ae=_.useCallback((se,Se)=>{w(Ze=>{if(Se)return new Set([...wf(se,u),se]);const ve=new Set(Ze);return ve.delete(se),ve})},[u]),ue=_.useCallback(se=>{$1(se)&&n?.(se.folder.id),ae(se.folder.path,!se.expanded)},[n,ae]),we=_.useCallback(()=>{D.current?.abort(),C(null),A(""),T(void 0),M(!1)},[]),U=_.useCallback(se=>{D.current?.abort(),C({anchorId:se?.id??null,parentPath:se?.path??"",parentLabel:se?.label??h.topLevel}),A(""),T(void 0),M(!1)},[h.topLevel]),X=_.useCallback(()=>{if(!s||!S||N)return;const se=E.trim();if(se===""){T(h.nameRequired);return}M(!0),T(void 0),D.current?.abort();const Se=new AbortController;D.current=Se;const Ze=S.parentPath;s(se,Ze,Se.signal).then(ve=>{M(!1),C(null),A(""),Ze&&ae(Ze,!0),n?.(ve.id)}).catch(ve=>{cne(ve)||(T(ve instanceof Error?ve.message:h.createError),M(!1))})},[s,S,N,E,n,ae,h.nameRequired,h.createError]),ie=_.useCallback(se=>{const Se=se.target;if(!(Se instanceof Element)||!Se.closest('[role="treeitem"]'))return;const Ze=pt=>{se.preventDefault(),F.current=!0,k(pt)},ve=B[R];switch(se.key){case"ArrowDown":return Ze(sk(B,R,1));case"ArrowUp":return Ze(sk(B,R,-1));case"Home":return Ze(z1(B));case"End":return Ze(dne(B));case"ArrowRight":{if(!Do(ve)||!ve)return;if(se.preventDefault(),!ve.expanded){ae(ve.folder.path,!0);return}const pt=R+1;Do(B[pt])&&Ze(pt);return}case"ArrowLeft":{if(!Do(ve)||!ve)return;if(se.preventDefault(),ve.expanded){ae(ve.folder.path,!1);return}const pt=fne(B,R,u);pt>=0&&Ze(pt);return}case"Enter":case" ":{if(!Do(ve)||!ve)return;se.preventDefault(),ue(ve);return}case"Escape":se.preventDefault(),a?.();return;default:return}},[B,R,u,ue,ae,a]),oe=S!==null&&S.anchorId!==null&&(Q?.some(se=>se.kind==="create"&&se.parent.id===S.anchorId)??!1),fe=S&&O.jsx(gne,{parentLabel:S.parentLabel,name:E,onNameChange:se=>{A(se),T(void 0)},onSubmit:X,onCancel:we,pending:N,error:I,labels:h}),Me=se=>se.context?`${se.folder.label} ${h.contextSuffix}`:$1(se)?h.optionLabel(se.folder):`${se.folder.label} ${h.currentSuffix}`,xe=(se,Se,Ze)=>{const{folder:ve,depth:pt}=se,gt=$1(se);return O.jsx(pne,{ref:Ye=>{L.current[Se]=Ye},label:ve.label,depth:pt,expanded:se.expanded,context:se.context,current:ve.isCurrent,currentTag:h.currentTag,messageCount:ve.messageCount,selected:gt&&ve.id===t,separated:Ze,failure:o?.(ve),actions:r?.(ve),ariaLabel:Me(se),tabIndex:Se===R?0:-1,onActivate:()=>ue(se),onFocus:()=>k(Se)})};return O.jsxs("div",{className:"flex min-h-0 w-full min-w-0 flex-col",children:[O.jsx(bf,{ref:q,variant:"inline",className:"border-b border-line px-3 py-2",icon:O.jsx(Aee,{className:"size-4","aria-hidden":"true"}),type:"search",value:g,onChange:se=>m(se.target.value),onKeyDown:se=>{if(se.key==="Escape"){se.preventDefault(),a?.();return}if(se.key!=="ArrowDown")return;se.preventDefault();const Se=Do(B[R])?R:z1(B);Se<0||(F.current=!0,k(Se),L.current[Se]?.focus())},placeholder:h.filterPlaceholder,"aria-label":h.filterAriaLabel}),s&&O.jsx("div",{className:"shrink-0 border-b border-line","data-create-anchor":"top",children:S&&!oe?fe:O.jsx(ik,{label:h.newFolder,ariaLabel:h.newFolder,prominence:"prominent",onOpen:()=>U(null)})}),B.length===0?O.jsx("p",{className:"px-3 py-3 text-sm text-fg-muted","aria-live":"polite",children:e.length===0?h.noFolders:h.emptyMessage(g)}):O.jsx("div",{role:"tree","aria-label":h.treeAriaLabel,className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden pb-24",onKeyDown:ie,children:(Q??B.map((se,Se)=>({kind:"folder",row:se,index:Se}))).map((se,Se,Ze)=>{const ve=Se<Ze.length-1;return se.kind==="create"?O.jsx("div",{role:"none","data-create-anchor":se.parent.id,children:S?.anchorId===se.parent.id?fe:O.jsx(ik,{label:h.newFolder,ariaLabel:h.newSubfolder(se.parent.label),depth:se.depth,prominence:"quiet",separated:ve,onOpen:()=>U(se.parent)})},`new:${se.parent.id}`):O.jsx("div",{role:"none",children:xe(se.row,se.index,ve)},se.row.folder.id)})})]})},yne={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Spam",trash:"Trash",flagged:"Starred",all:"All Mail"};function bne(e){return yne[e]}const Sne=new Set(["all","flagged"]);function wne(e){return Sne.has(e)}const Cne=new Set(["[Gmail]","[Google Mail]"]);function Ene(e){if(e.role)return wne(e.role)?void 0:bne(e.role);if(!e.providerPath)return;const t=nI(e.providerPath,e.hierarchyDelimiter);if(!Cne.has(t[0]))return one(e.providerPath,e.hierarchyDelimiter)}function xUe(e){return e==="inbox"?O.jsx(SF,{className:"size-4"}):e==="drafts"?O.jsx(yee,{className:"size-4"}):e==="sent"?O.jsx(Iee,{className:"size-4"}):e==="archive"?O.jsx(hee,{className:"size-4"}):e==="junk"?O.jsx(XA,{className:"size-4"}):e==="trash"?O.jsx(Mee,{className:"size-4"}):e==="flagged"?O.jsx(Tee,{className:"size-4"}):O.jsx(_ee,{className:"size-4"})}const _ne={Inbox:"Inbox",Drafts:"Drafts",Sent:"Sent",Archive:"Archive",Junk:"Junk",Trash:"Trash",All:"All",Flagged:"Flagged"},AUe={Body:"Body"},IUe={Mail:"Mail",Calendar:"Calendar"},nu={Appointed:"Appointed",Flagged:"Flagged",Reserved:"Reserved",Proposed:"Proposed",Stale:"Stale",None:"None"},Pa={SignInDisabled:"sign_in_disabled",CallerDisabled:"caller_disabled",ForeignOrigin:"foreign_origin",StepUpRequired:"step_up_required",WrongPassword:"wrong_password",StepUpLocked:"step_up_locked",CannotDisableSelf:"cannot_disable_self"},ak={synced:"synced",failed:"failed"},RUe={Saved:"Saved",Deployment:"Deployment",Default:"Default"},TUe={NoBaseUrl:"NoBaseUrl",NoApiKey:"NoApiKey"},OUe={uncategorized:"uncategorized",personal:"personal",newsletter:"newsletter",marketing:"marketing",automated:"automated",transactional:"transactional",social:"social"},MUe={Wellknown:"wellknown",Vip:"vip"},PUe={Lookalike:"Lookalike",ForeignAddress:"ForeignAddress",Unrelated:"Unrelated"},NUe={abandoned:"abandoned"},kUe={none:"none",move:"move",delete:"delete"},DUe={MoveToInbox:"MoveToInbox",MoveToJunk:"MoveToJunk"},LUe={Confident:"Confident",Unsure:"Unsure"},UUe={Attachment:"attachment"},FUe={None:"None"},$Ue={Retrying:"Retrying",GaveUp:"GaveUp"};function jF(e){const[t,n]=_.useState(!1),r=t?mee:vee,o=t?"Hide password":"Show password";return O.jsx(bf,{...e,type:t?"text":"password",trailing:O.jsx("button",{type:"button","aria-label":o,"aria-pressed":t,title:o,onClick:()=>n(s=>!s),className:"-my-1 -mr-2 flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-md text-fg-subtle transition-colors hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:O.jsx(r,{className:"size-4","aria-hidden":!0})})})}const xne=e=>e===1?"message":"messages",Tm=e=>`${e.toLocaleString()} ${xne(e)}`,j1=(e,t)=>e.kind==="delete"?`delete ${Tm(e.count)}`:t===void 0?"empty it":`empty ${Tm(t)}`,BF=e=>e.kind==="delete"?"Nothing has been deleted.":"Nothing has been emptied.",Ane=(e,t,n={})=>{const{trashFolderLabel:r,staleFolderLabel:o,selectedCount:s}=n,a=BF(t);if(e==="none")return{title:"No folder is set as Trash",description:`${a} reader files deleted mail in the folder you set as Trash, and this account has none.`,pickerPrompt:"Which folder does this account use for deleted mail?",confirmLabel:`Set as Trash and ${j1(t,void 0)}`,cancelLabel:"Cancel"};if(e==="stale")return{title:"The Trash folder you chose is gone",description:o?`${a} You set ${o} as this account's Trash and it is no longer on the mail server — another mail app may have renamed or removed it.`:`${a} The folder you set as this account's Trash is no longer on the mail server — another mail app may have renamed or removed it.`,pickerPrompt:"Which folder should reader use instead?",confirmLabel:`Set as Trash and ${j1(t,void 0)}`,cancelLabel:"Cancel"};const u=t.kind==="delete"?`Deleting ${Tm(t.count)} there erases them from the mail server, and that cannot be restored.`:"Emptying a folder erases everything in it from the mail server, and that cannot be restored.";return{title:"Confirm this account's Trash folder",description:r?`${a} reader files this account's deleted mail in ${r} because of its name — you never chose it, and the mail server doesn't mark it as Trash. ${u}`:`${a} reader files this account's deleted mail in a folder it matched by name — you never chose it, and the mail server doesn't mark it as Trash. ${u}`,pickerPrompt:r?`Confirm ${r}, or pick the folder this account really uses.`:"Pick the folder this account really uses for deleted mail.",confirmLabel:`Set as Trash and ${j1(t,s)}`,cancelLabel:"Cancel"}},Ine=(e,t,n,r)=>e.kind==="appointing"?{headline:"Setting the Trash folder…",status:n}:t.kind==="delete"?{headline:`Deleting ${Tm(t.count)}…`,status:r?`Erasing them from ${n}. This can't be undone.`:`Moving them to ${n}`}:{headline:`Emptying ${n}…`,status:"This can't be undone."},Rne=(e,t,n,r)=>e==="unconfirmed"&&t.kind==="delete"&&n!==void 0&&r===n,Tne=(e,t,n)=>e==="mailbox-pending"?`${n} is still being created on the mail server. Wait for it to finish, then try again.`:`Couldn't set that folder as Trash. ${BF(t)} Please try again.`,One=({open:e,reason:t,action:n,folders:r,delimiter:o,trashFolderLabel:s,guessedMailboxId:a,staleFolderLabel:u,accountEmail:c,phase:f,selectedId:h,onSelect:g,onCreateFolder:m,onConfirm:v,onCancel:w})=>{const S=_.useRef(null),C=f.kind==="appointing"||f.kind==="acting";_.useEffect(()=>{C&&S.current?.focus()},[C]);const E=r.find(N=>N.id===h),A=Ane(t,n,{trashFolderLabel:s,staleFolderLabel:u,selectedCount:E?.messageCount}),I=Rne(t,n,a,h),T=n.kind==="emptyTrash"||I;if(!e)return null;if(C){const N=Ine(f,n,E?.label??"",I);return O.jsx(ok,{open:e,onClose:()=>{},title:A.title,children:O.jsxs("div",{ref:S,"data-escape-owner":!0,tabIndex:-1,className:"flex flex-col items-center gap-3 px-5 py-10 text-center outline-none",children:[O.jsx(wF,{className:"size-8 animate-spin text-accent-2"}),O.jsx("p",{className:"text-sm font-medium text-fg",children:N.headline}),O.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:N.status})]})})}return O.jsxs(ok,{open:e,onClose:w,title:A.title,children:[O.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[O.jsx(JA,{className:`size-4 shrink-0 ${T?"text-danger":"text-warning"}`}),O.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:A.title})]}),O.jsxs("div",{className:"flex max-h-[70vh] flex-col",children:[O.jsxs("div",{className:"space-y-1 px-5 py-4",children:[O.jsx("p",{className:"text-sm text-fg-muted",children:A.description}),c&&O.jsx("p",{className:"text-xs text-fg-subtle",children:c})]}),f.kind==="appoint-failed"&&O.jsx("div",{className:"px-5 pb-3",children:O.jsx(Zr,{tone:"danger",variant:"soft",children:Tne(f.cause,n,E?.label??"That folder")})}),O.jsx("p",{className:"px-5 pb-2 text-sm text-fg-muted",children:A.pickerPrompt}),O.jsx("div",{className:"flex h-[26rem] min-h-0 flex-1 overflow-hidden",children:O.jsx(vne,{folders:r,selectedId:h,delimiter:o,onSelect:g,onCreateFolder:t==="none"?m:void 0,onCancel:w,labels:{treeAriaLabel:"Folders on this account",optionLabel:N=>`Set ${N.label}${N.messageCount===void 0?"":`, ${N.messageCount} messages`}, as Trash`}})})]}),O.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[O.jsx(Xr,{variant:"secondary",size:"sm",onClick:w,children:A.cancelLabel}),E&&O.jsx(Xr,{variant:T?"danger":"primary",size:"sm",onClick:()=>v(E.id),children:O.jsx("span",{className:"truncate",children:A.confirmLabel})})]})]})},Mne={delete:{label:"Delete",present:"Deleting",past:"Deleted",destructive:!0},move:{label:"Move",present:"Moving",past:"Moved",destructive:!1},junk:{label:"Junk",present:"Marking as junk",past:"Marked as junk",destructive:!0},markRead:{label:"Mark read",present:"Marking read",past:"Marked read",destructive:!1},organize:{label:"Organize",present:"Organizing",past:"Organized",destructive:!1}},Pne=e=>Mne[e],Nne={match:"Apply to",properties:"Properties",folder:"Folder",rule:"Rule",name:"Name",review:"Review",run:"Run"},zUe=e=>Nne[e],jUe=({verb:e,mode:t,scope:n,fromSearch:r})=>{const o=r?["properties"]:t==="properties"?["match","properties"]:["match"];return e==="move"?[...o,"folder","review","run"]:e==="organize"?n==="standing"||n==="until"?[...o,"folder","rule","name","review","run"]:[...o,"folder","rule","review","run"]:[...o,"review","run"]},HF=(e,t)=>Math.max(0,e.indexOf(t)),BUe=(e,t)=>HF(e,t)===0||t==="run",qF=(e,t)=>({clauses:[...e.clauses],matchOperator:e.matchOperator,moveMailboxId:e.moveMailboxId,scope:t,until:e.until,name:e.name}),kne=e=>DF(qF(e,e.scope??"once")),lk=e=>{if(!(e.scope!=="standing"&&e.scope!=="until")&&!kF(qF(e,e.scope)))return Gr.noMatch},Dne="A rule only works within one account — clear the selection, or pick messages from a single account.",Lne="A destination only works within one account — clear the selection, or pick messages from a single account.",HUe="Matching beyond the messages you picked only works within one account — clear the selection, or pick messages from a single account.",Une="A rule only works within one folder — clear the selection, or pick messages from a single folder.",Fne="A destination only works within one folder — clear the selection, or pick messages from a single folder.",$ne={spansAccounts:{rule:Dne,destination:Lne},spansFolders:{rule:Une,destination:Fne}},zne="A match this wide applies once — use “Make this a filter” above the results to keep doing it.",qUe=(e,t)=>e==="escalated"?zne:t.rule,VUe=(e,t)=>{const n=e===void 0?"spansAccounts":t;if(!n)return{accountId:e};const r=$ne[n];return{accountId:n==="spansAccounts"?void 0:e,rule:r.rule,destination:r.destination}},WUe=e=>e===void 0?["selected"]:["selected","properties"],jne="This matches no messages, so there is nothing to do. Go back and change what it applies to.",Bne="Fill in every property, or take the empty one off.",Hne="Pick a destination first.",qne="Choose one of the three first.",GUe=(e,t,n)=>{if(e==="properties")return t.clauses.length===0?Gr.noMatch:t.clauses.some(r=>r.value.trim()==="")?Bne:void 0;if(e==="folder")return t.moveMailboxId?void 0:Hne;if(e==="rule"){if(!t.scope)return qne;const r=lk(t);return r||(t.scope==="once"&&kne(t).length>0?Gr.bodyTextOnce:t.scope==="until"&&!t.until?.trim()?Gr.noUntilDate:void 0)}if(e==="name"&&!t.name?.trim())return Gr.unnamed;if(e==="review"){const r=lk(t);return r||(n.status==="uncounted"?void 0:n.status==="ready"&&n.count===0&&!n.stale?jne:LF(n))}},KUe="Nothing matches this yet. Widen a property, or match on a different one.",ZUe=({state:e,verb:t,scope:n,matched:r,applied:o,failed:s,failureReason:a})=>{const{label:u,present:c,past:f}=Pne(t),h=f.toLowerCase(),g=n==="standing"||n==="until",v={screenTitle:e==="saving"||e==="backApplyRunning"||e==="statusUnknown"||e==="commitFailed"?u:"Done",showProgress:e==="backApplyRunning"||e==="backApplyComplete"||e==="backApplyFailed"||e==="backApplyRestartFailed"||e==="statusUnknown"||e==="runStopped",failureListLabel:`Not ${h}`};return e==="saving"?{...v,title:g?"Saving rule…":"Applying…",detail:"Nothing has been changed yet.",tone:"progress",dismissLabel:"Close"}:e==="backApplyRunning"?{...v,title:g?"Rule saved. Moving the mail already in your mailbox…":`${c} ${r} messages…`,detail:"This keeps running if you close the wizard.",tone:"progress",dismissLabel:"Close",cancelLabel:"Stop the run"}:e==="statusUnknown"?{...v,title:g?"Rule saved. Its progress over your existing mail is unknown":`${c} — progress unknown`,detail:g?"The connection dropped, so the bar shows the last that was read. The pass runs on the mail server, and the rule keeps working on new mail either way. This keeps checking.":"The connection dropped, so the bar shows the last that was read. The run is on the mail server and carries on either way. This keeps checking.",tone:"warning",dismissLabel:"Close",retryLabel:"Check again"}:e==="backApplyComplete"?{...v,title:g?"Rule saved and applied":`${f} ${o}`,detail:g?`${o} of ${r} already in your mailbox ${h}. New mail follows the rule as it arrives.`:`Every message the match reached was ${h}. Your mail server is still catching up, so the list can lag behind.`,tone:"success",dismissLabel:"Done"}:e==="backApplyFailed"?{...v,title:g?"Rule saved — some mail stayed put":`Not everything was ${h}`,detail:`${o} of ${r} ${h} · the mail server rejected ${s}.${g?" The rule itself is saved and keeps working on new mail.":""}`,tone:"warning",dismissLabel:"Close",retryLabel:`Retry ${s}`}:e==="runStopped"?{...v,title:`Stopped after ${o}`,detail:`${o} of ${r} ${h}. The rest were not sent, apart from the ones already on their way when you stopped — those may still have gone through.`,tone:"warning",dismissLabel:"Close",retryLabel:`Retry ${s}`}:e==="backApplyRestartFailed"?{...v,title:g?"Rule saved — the retry didn't start":"The retry didn't start",detail:`${o} of ${r} ${h} · the mail server rejected ${s}, which are still where they were.${g?" The rule itself is saved and keeps working on new mail.":""} Check your connection and try again.`,tone:"warning",dismissLabel:"Close",retryLabel:`Retry ${s}`}:e==="backApplyStartFailed"?{...v,title:"Rule saved",detail:"New mail follows it automatically. The pass over the mail already in your mailbox never started.",tone:"warning",dismissLabel:"Not now",retryLabel:"Run it over existing mail"}:e==="filterSaved"?{...v,title:"Filter saved",detail:"There is no mail in your mailbox to apply it to yet. New mail follows it as it arrives. You can see it, and when it expires, under Settings › Filters.",tone:"success",dismissLabel:"Done"}:{...v,title:g?"Couldn't save the rule":`Couldn't start ${u.toLowerCase()}`,detail:a??"Nothing has changed.",tone:"danger",dismissLabel:a===void 0?"Not now":"Close",retryLabel:a===void 0?"Try again":void 0}},Vne=e=>`${Xte(e.field)} "${e.value}"`,VF=(e,t)=>e.map(Vne).join(` ${nne(t)} `),Wne=(e,t)=>e==="selected"?`These ${t} messages`:"Its properties",YUe=e=>e==="selected"?"Only the messages ticked in the list.":Yte,Gne=e=>`Every message ${e}`,WF="the list is showing",QUe="This reaches every match on the mail server, including the ones the list has not loaded. The search is already the match, so there is nothing to widen.",XUe="This covers messages not shown in the list, and anything else matching by the time it runs.",JUe=({mode:e,selectedCount:t,clauses:n,matchOperator:r,escalatedScope:o})=>e==="escalated"?Gne(o??WF):e==="properties"?VF(n,r):Wne(e,t),e6e=({mode:e,selectedCount:t,clauses:n,matchOperator:r,escalatedScope:o,escalatedCount:s})=>{if(e==="selected")return`${t} messages`;if(e==="escalated"){const a=o??WF;return s===void 0?`every message ${a}`:`all ${s.toLocaleString()} messages ${a}`}return n.length===0?"every message":`every message where ${VF(n,r)}`},Kne={preparing:"Getting the new version ready",restarting:"Restarting Remit",reconnecting:"Waiting for Remit to answer again"};function uk(e){return Kne[e]}function Zne(e){return e<90?"This usually takes about a minute.":e<240?"Longer than usual. Remit is still trying to reach the server.":"Still no answer. Remit keeps trying."}function t6e(e,t=Date.now()){const n=Math.floor((t-e)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function n6e(e){return new Date(e).toLocaleDateString(void 0,{dateStyle:"medium"})}const ck=["preparing","restarting","reconnecting"],GF="fixed inset-0 z-50 flex flex-col items-center justify-center gap-6 bg-canvas p-6 text-center outline-none";function Yne({target:e,phase:t,elapsedSeconds:n}){const r=_.useRef(null);Vv(r,!0),qv({id:"self-update",open:!0});const o=ck.indexOf(t);return O.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"self-update-progress-title",tabIndex:-1,className:GF,children:[O.jsxs("div",{className:"max-w-md space-y-2",children:[O.jsxs("h1",{id:"self-update-progress-title",className:"text-lg font-semibold text-fg",children:["Installing Remit ",e]}),O.jsx("p",{className:"text-sm text-fg-muted",children:"Remit is restarting, so this page has no server to talk to for a moment. Leave this open — it reconnects on its own."})]}),O.jsx("ol",{className:"w-full max-w-sm space-y-2 text-left",children:ck.map((s,a)=>{const u=a<o,c=a===o;return O.jsxs("li",{className:rn("flex items-center gap-3 rounded-sm border px-row-inset py-2 text-sm",c?"border-line-strong bg-surface text-fg":"border-line bg-surface-sunken text-fg-subtle"),children:[u?O.jsx(yF,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}):c?O.jsx(wF,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}):O.jsx("span",{className:"size-4 shrink-0 rounded-full border border-line-strong"}),uk(s)]},s)})}),O.jsxs("p",{"aria-live":"polite",className:"max-w-md text-xs text-fg-subtle",children:[O.jsx("span",{className:"sr-only",children:`${uk(t)}. `}),Zne(n)]})]})}function Qne({attemptedVersion:e,previousVersion:t,elapsedSeconds:n,logsCommand:r,onRetryConnection:o}){const s=_.useRef(null);Vv(s,!0);const a=Math.max(1,Math.round(n/60));return O.jsxs("div",{ref:s,role:"alertdialog","aria-modal":"true","aria-labelledby":"self-update-unreachable-title",tabIndex:-1,className:GF,children:[O.jsx(XA,{className:"size-12 shrink-0 text-danger","aria-hidden":!0}),O.jsxs("div",{className:"max-w-lg space-y-3",children:[O.jsx("h1",{id:"self-update-unreachable-title",className:"text-lg font-semibold text-fg",children:"Remit has not answered since the restart"}),O.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing ",e," started ",a," minute",a===1?"":"s"," ago and the server has been silent since. Your mail is safe at your provider — it was never part of the update."]}),O.jsxs("p",{className:"text-sm text-fg-muted",children:["Remit rolls back to ",t," on its own when the new version fails to start, but this page cannot confirm that from here. Check the server directly:"]}),O.jsx("code",{className:"block rounded-xs bg-surface-sunken px-3 py-2 text-left text-xs text-fg-muted",children:r})]}),O.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:O.jsx(Xr,{size:"sm",onClick:o,children:"Try connecting again"})})]})}const Xne=()=>O.jsxs("div",{className:"hidden h-full w-[17%] min-w-40 max-w-64 shrink-0 flex-col gap-1 border-r border-line p-3 md:flex",children:[O.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((e,t)=>O.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[O.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),O.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},t))]}),Jne=()=>O.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((e,t)=>O.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[O.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),O.jsxs("div",{className:"flex-1 space-y-1.5",children:[O.jsxs("div",{className:"flex justify-between gap-2",children:[O.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),O.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),O.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),O.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},t))}),Kv=()=>O.jsxs("div",{className:"flex h-full animate-pulse bg-canvas","aria-hidden":"true",children:[O.jsx(Xne,{}),O.jsx(Jne,{})]}),Zv="03aac8a7c576965bacada29adb435a4558ecec75",ere="2026-11-11T08:42:27.421Z",tre=Zv.slice(0,7),nre=/^[0-9a-f]{40}$/.test(Zv),rre=nre?`https://github.com/remit-mail/reader/commit/${Zv}`:void 0;class Yv extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r,this.name="ApiError"}status;body}const $_=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),sl=e=>{const t=e instanceof Yv?e.body:e;if(!$_(t))return;const{code:n,details:r}=t;if(typeof n=="string")return{code:n,details:$_(r)?r:void 0}},ore=(e,t)=>{if($_(e)&&e.message!==void 0&&e.message!==null){const n=String(e.message);if(n)return n}return`Request failed with status ${t}`},sre=(e,t)=>new Yv(ore(e,t),t,e),hn=e=>{if(e instanceof Yv)return e.status;if(e&&typeof e=="object"){const t=e;if(typeof t.status=="number")return t.status;if(typeof t.statusCode=="number")return t.statusCode}},KF=e=>hn(e)!==void 0,Qv=e=>{const t=hn(e);return t!==void 0&&t>=500&&t<=599},Xv=e=>!!(typeof DOMException<"u"&&e instanceof DOMException&&e.name==="AbortError"||e&&typeof e=="object"&&"name"in e&&e.name==="AbortError"),ire=()=>typeof navigator<"u"&&navigator.onLine===!1,Jv=e=>Xv(e)||KF(e)?!1:e instanceof ZA?!0:ire(),are=e=>!KF(e)&&!Xv(e)&&!Jv(e),ZF=e=>Qv(e)||are(e),lre=e=>e instanceof Error&&e.name==="AuthTokenError"&&hn(e)===403,ey=e=>hn(e)===401||lre(e),ure=(e,t)=>{if(t?.softError===!0)return!0;const n=t?.softErrorStatuses;if(!Array.isArray(n))return!1;const r=hn(e);return r!==void 0&&n.includes(r)},cre=[502,503,504],dre=(e,t)=>{if(t?.restartExpected!==!0)return!1;const n=hn(e);return n!==void 0&&cre.includes(n)},fre=(e,t)=>Qv(e)?!dre(e,t)&&t?.ownsServerErrors!==!0:Xv(e)||Jv(e)||ey(e)?!1:ZF(e)?!0:!ure(e,t),rI={softError:!0},ty=(...e)=>({softErrorStatuses:e}),hre={restartExpected:!0},pre={ownsServerErrors:!0},YF=e=>hn(e)===404,gre=e=>Qv(e),z_=new Set;let QF=null,XF=null;const mre=e=>{XF=e},vre=e=>e instanceof Error?e:new Error(JF(e)),JF=e=>e instanceof Error?e.message||e.name:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:"An unexpected server error occurred.",yre=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`fatal-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,ju=(e,t)=>{const n={error:e,message:JF(e),correlationId:yre(),at:Date.now(),recoverable:t?.recoverable??gre(e),stack:e instanceof Error?e.stack:void 0,componentStack:t?.componentStack};QF=n,_re(`Fatal: ${n.message} [${n.correlationId}]`),XF?.recordError(vre(e),{fatal:"true",correlationId:n.correlationId});for(const r of z_)r(n);return n},bre=e=>(z_.add(e),()=>{z_.delete(e)}),Sre=()=>QF,wre=20,nm=[],Cre=new Set(["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"]);function Ere(e){return typeof e!="string"?!1:Cre.has(e.replace(/\.\s*$/,""))}function rm(e){nm.push(e),nm.length>wre&&nm.shift()}function _re(e){rm(e)}function xre(e){return e.map(t=>{if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}).join(" ")}function Are(){const e=console.error.bind(console);console.error=(...t)=>{rm(xre(t)),e(...t)},window.addEventListener("error",t=>{Ere(t.message)||(rm(`Uncaught ${t.error instanceof Error?`${t.error.name}: ${t.error.message}`:String(t.message)} (${t.filename}:${t.lineno})`),ju(t.error??t.message))}),window.addEventListener("unhandledrejection",t=>{const n=t.reason,r=n instanceof Error?`${n.name}: ${n.message}`:String(n);rm(`Unhandled rejection: ${r}`),ju(n)})}function Ire(){return nm.slice()}const Rre=8,gu=[];function Tre(e){const t=e.split(/[?#]/)[0],n=gu[gu.length-1];n&&n.path===t||(gu.push({path:t,timestamp:new Date().toISOString()}),gu.length>Rre&&gu.shift())}function Ore(){return gu.slice()}const B1=7500,dk=`
|
|
13
|
+
… (truncated — the copy action on this screen has the full report)`;function Bu(e){return{appShortSha:tre,appCommitUrl:rre,appBuildTime:ere,userAgent:navigator.userAgent,viewport:`${window.innerWidth}×${window.innerHeight}`,timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,href:window.location.href,recentErrors:Ire(),requests:KJ(),routes:Ore(),failingRequest:ZJ(),errorMessage:e?.errorMessage,stack:e?.stack,componentStack:e?.componentStack,quarantine:e?.quarantine,syncWarning:e?.syncWarning,title:e?.title}}function H1(e){return["```",e,"```"].join(`
|
|
14
|
+
`)}function e$(e){const t=/T(\d{2}:\d{2}:\d{2})/.exec(e);return t?t[1]:e}function Mre(e){return`- **Version**: ${e.appCommitUrl?`[\`${e.appShortSha}\`](${e.appCommitUrl})`:`\`${e.appShortSha}\``} built ${e.appBuildTime}`}function Pre(e){const t=e.status===0?"no response (transport failure)":`${e.status}`;return["## Failing request",`- **Endpoint**: \`${e.path}\``,`- **Method**: ${e.method}`,`- **Status**: ${t}`,`- **Correlation id**: ${e.correlationId??"(none)"}`,""]}function Nre(e){return e.length===0?["## Recent API requests","(none)",""]:["## Recent API requests","| Time | Method | Path | Status | Duration | Correlation |","| --- | --- | --- | --- | --- | --- |",...e.map(n=>{const r=n.status===0?"ERR":`${n.status}`;return`| ${e$(n.timestamp)} | ${n.method} | \`${n.path}\` | ${r} | ${n.durationMs}ms | ${n.correlationId??""} |`}),""]}function kre(e){return e.length===0?["## Navigation trail","(none)",""]:["## Navigation trail",...e.map(n=>`- ${e$(n.timestamp)} \`${n.path}\``),""]}function t$(e,t){const n=e.recentErrors.length>0?e.recentErrors.map(s=>` - ${s}`).join(`
|
|
15
|
+
`):" (none)",r=["## Environment",Mre(e),`- **Browser**: ${e.userAgent}`,`- **Viewport**: ${e.viewport}`,`- **Time**: ${e.timestamp} (${e.timezone})`,"","## URL",e.href,""];if(e.errorMessage&&r.push("## Error",e.errorMessage,""),e.failingRequest&&r.push(...Pre(e.failingRequest)),e.quarantine){const s=t?.quarantineStructure??e.quarantine.structure;r.push(e.quarantine.head,"",H1(s),"",e.quarantine.disclaimer,"")}e.syncWarning&&r.push(e.syncWarning,"");const o=t?.stack??e.stack;return o&&r.push("## Stacktrace",H1(o),""),e.componentStack&&r.push("## Component stack",H1(e.componentStack),""),r.push(...Nre(e.requests)),r.push(...kre(e.routes)),r.push("## Recent console errors",n,"","## Steps to reproduce","1. ","","## Expected behaviour","","## Actual behaviour",""),r.join(`
|
|
16
|
+
`)}function Dre(e){if(e.title)return e.title;if(!e.errorMessage)return"Bug: ";const t=e.errorMessage.split(`
|
|
17
|
+
`)[0].trim();return`Bug: ${t.length>120?`${t.slice(0,117)}…`:t}`}function Gp(e,t){const n=new URLSearchParams({title:Dre(e),body:t$(e,t)});return`${pc().issuesUrl}?${n.toString()}`}function Lre(e){return t$(e)}function oh(e){const t=Gp(e);if(t.length<=B1)return t;const n={...e,componentStack:void 0},r=[];e.stack&&r.push(["stack",e.stack]),e.quarantine?.structure&&r.push(["quarantineStructure",e.quarantine.structure]),r.sort((s,a)=>a[1].length-s[1].length);let o={};for(const[s,a]of r){if(Gp(n,o).length<=B1)break;let u=0,c=a.length,f=0;for(;u<=c;){const h=u+c>>1;Gp(n,{...o,[s]:a.slice(0,h)+dk}).length<=B1?(f=h,u=h+1):c=h-1}o={...o,[s]:a.slice(0,f)+dk}}return Gp(n,o)}function Ure(){const e=oh(Bu());window.open(e,"_blank","noopener,noreferrer")}const Fre="/mail",n$=()=>{const[e,t]=_.useState(()=>Sre());return _.useEffect(()=>bre(t),[]),e?O.jsx(r$,{fatal:e}):null},fk=e=>({errorMessage:e.message,stack:e.stack,componentStack:e.componentStack}),r$=({fatal:e,onRetry:t})=>{qv({id:"fatal-error",open:!0});const[n,r]=_.useState(!1),o=()=>{window.location.reload()},s=()=>{if(t){t();return}o()},a=()=>{const f=oh(Bu(fk(e)));window.open(f,"_blank","noopener,noreferrer")},u=async()=>{const f=Lre(Bu(fk(e)));await navigator.clipboard.writeText(f),r(!0),window.setTimeout(()=>r(!1),2e3)},c=e.recoverable?"The server returned an unexpected error. This is not your fault — nothing was saved or sent. Retry, or report a bug so we can fix it.":"Something went wrong and this page can't recover. This is not your fault — nothing was saved or sent. Go to your inbox, or report a bug so we can fix it.";return O.jsxs("div",{role:"alert","aria-live":"assertive","data-testid":"fatal-error-overlay",className:"fixed inset-0 z-[1000] flex flex-col items-center justify-center gap-6 bg-red-700 p-6 text-center text-white",children:[O.jsx(XA,{className:"size-16 shrink-0","aria-hidden":"true"}),O.jsxs("div",{className:"max-w-lg space-y-3",children:[O.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Something broke"}),O.jsx("p",{className:"text-base text-red-50",children:c}),O.jsx("p",{className:"break-words font-mono text-sm text-red-100",children:e.message}),O.jsxs("p",{className:"font-mono text-xs text-red-200",children:["Reference: ",e.correlationId]})]}),O.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[e.recoverable?O.jsx("button",{type:"button",onClick:s,className:"inline-flex min-h-11 items-center rounded-md bg-white px-5 text-sm font-semibold text-red-700 transition-colors hover:bg-red-50",children:"Retry"}):O.jsx("a",{href:Fre,className:"inline-flex min-h-11 items-center rounded-md bg-white px-5 text-sm font-semibold text-red-700 transition-colors hover:bg-red-50",children:"Go to inbox"}),O.jsx("button",{type:"button",onClick:a,className:"inline-flex min-h-11 items-center rounded-md border border-white/70 px-5 text-sm font-semibold text-white transition-colors hover:bg-white/10",children:"Report a bug"}),O.jsx("button",{type:"button",onClick:u,className:"inline-flex min-h-11 items-center rounded-md border border-white/70 px-5 text-sm font-semibold text-white transition-colors hover:bg-white/10",children:n?"Copied":"Copy full details"})]})]})},$re=({betterAuthEnabled:e,cognitoConfigured:t})=>e?"betterAuth":t?"cognito":"none",oI=e=>$re(e)==="cognito"?jte:void 0,zre="Fetch Error",jre=429,sI=(e,t)=>{if(e&&typeof e=="object"&&t in e){const n=e[t];if(typeof n=="string"&&n.trim().length>0)return n}},Cf=e=>sI(e,"message"),Bre=e=>Xv(e)?!1:sI(e,"statusText")===zre?!0:hn(e)===void 0,o$=e=>{if(Bre(e))return"network";const t=hn(e);return t===void 0?"fatal":t===jre?"rateLimited":t===404||t>=500?"fatal":Cf(e)?"validation":"fatal"},Hre="Can't reach the server. You may be offline — check your connection and try again.",qre="Too many requests from this address. Everyone behind the same address — other people on this network, and every tab you have open — shares one limit. Wait a minute and try again.",Vre=(e,t)=>t==="network"?Hre:t==="rateLimited"?qre:Cf(e)??"Please check your details and try again.",Wre=e=>{const t=hn(e);if(t===void 0)return"no response";const n=sI(e,"statusText");return n?`${t} ${n}`:String(t)},Gre=(e,t)=>{const n=Wre(e),r=hn(e)===404?"The endpoint did not respond as expected — check that the backend is running and up to date (see the deployment guide's troubleshooting section).":"The server returned an unexpected response.",o=Cf(e),s=o?` Server said: ${o}.`:"";return`${t.method} ${t.path} failed: ${n}. ${r}${s}`},Kre=(e,t)=>{ju(new Error(Gre(e,t)),{recoverable:!1})},Zre={SIGN_IN_DISABLED:"signInOff",ACCOUNT_DISABLED:"accountDisabled"},iI=e=>{if(hn(e)!==403||!e||typeof e!="object"||!("code"in e))return;const{code:t}=e;return typeof t=="string"?Zre[t]:void 0},Yre=/\/reset-password\/([^/]+)\/?$/,Qre=e=>{const t=Yre.exec(e);return t?.[1]?decodeURIComponent(t[1]):void 0},Xre="Your password was not set",Jre=e=>oh({...Bu({title:`Reset password: ${e}`,errorMessage:e}),href:`${window.location.origin}/reset-password/<token>`}),eoe=e=>{if(iI(e)==="signInOff")return{kind:"signInOff"};const t=e&&typeof e=="object"&&"code"in e?e.code:void 0;if(t==="INVALID_TOKEN")return{kind:"deadLink"};if(t==="PASSWORD_TOO_SHORT"||t==="PASSWORD_TOO_LONG")return{kind:"password",message:Cf(e)??"Use 12 to 128 characters."};const n=o$(e);if(n==="network")return{kind:"inline",message:"Can't reach the server. You may be offline. Check your connection and try again."};if(n==="rateLimited")return{kind:"inline",message:"Too many tries from this address. Wait a minute and try again."};const r=hn(e),o=Cf(e);return{kind:"server",message:`${Xre}. The server answered ${r??"nothing"}${o?`: ${o}`:""}.`}};function toe({token:e,onDone:t}){const[n,r]=_.useState(""),[o,s]=_.useState(null),[a,u]=_.useState(!1),c=_.useRef(null);_.useEffect(()=>{c.current?.focus()},[]);const f=async h=>{if(h.preventDefault(),a)return;s(null),u(!0);const g=await qa.resetPassword({newPassword:n,token:e}).then(m=>m.error??null,m=>m);if(u(!1),!g){t();return}s(eoe(g))};return O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsxs("form",{onSubmit:f,className:"mt-6 flex flex-col gap-4 rounded-lg border border-line bg-surface p-7 shadow-lg",children:[O.jsx("h1",{className:"text-base font-semibold text-fg",children:"Choose a new password"}),o?.kind==="deadLink"&&O.jsx(Zr,{tone:"danger",children:"This link no longer works. Ask for a new one."}),o?.kind==="signInOff"&&O.jsxs(Zr,{tone:"info",children:[O.jsx("p",{className:"font-medium",children:"Sign-in is turned off on this server."}),O.jsx("p",{className:"mt-1",children:"The link works once the person who runs this server turns sign-in back on."})]}),o?.kind==="inline"&&O.jsx(Zr,{tone:"danger",children:o.message}),o?.kind==="server"&&O.jsxs(Zr,{tone:"danger",children:[O.jsx("p",{children:o.message}),O.jsx("a",{href:Jre(o.message),target:"_blank",rel:"noreferrer",className:"mt-1 inline-block font-medium text-accent hover:underline",children:"Report an issue"})]}),O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"reset-new-password",className:"text-fg-muted",children:"New password"}),O.jsx(jF,{ref:c,id:"reset-new-password",autoComplete:"new-password",value:n,onChange:h=>{r(h.target.value),o?.kind==="password"&&s(null)},placeholder:"12 to 128 characters","aria-invalid":o?.kind==="password","aria-describedby":"reset-new-password-hint",required:!0}),O.jsx("p",{id:"reset-new-password-hint",className:"text-xs text-fg-muted",children:o?.kind==="password"?O.jsx("span",{className:"text-danger",role:"alert",children:o.message}):"Use 12 to 128 characters. Spaces and any symbols are fine. A long phrase is easy to remember."})]}),O.jsx(Xr,{type:"submit","aria-busy":a,children:"Set password"})]}),O.jsx(tI,{note:oI({betterAuthEnabled:!0,cognitoConfigured:!1})})]})}const noe=({onRetry:e,onReport:t})=>O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-line bg-surface p-7 shadow-lg",children:[O.jsxs(Zr,{tone:"warning",children:[O.jsx("p",{className:"font-medium",children:"Too many requests from this address"}),O.jsx("p",{className:"mt-1",children:"The server is limiting requests from your network address, so it could not check whether you are signed in. You have not been signed out."})]}),O.jsx("p",{className:"text-sm text-fg-muted",children:"Wait a minute and try again. Everyone behind the same address — other people on this network, and every tab you have open — shares one limit."}),O.jsx(Xr,{onClick:e,children:"Try again"}),O.jsx(Xr,{variant:"ghost",size:"sm",onClick:t,children:"Report an issue"})]})]}),roe=429,ooe=({data:e,isPending:t,error:n})=>{const r=iI(n);return r?{kind:"refused",refusal:r}:e?{kind:"active"}:t?{kind:"pending"}:hn(n)===roe?{kind:"rateLimited"}:{kind:"signedOut"}},soe={method:"POST",path:"/api/auth/sign-up/email"},ioe={method:"POST",path:"/api/auth/sign-in/email"},aoe=({notice:e})=>{const t=_.useRef(null);return _.useEffect(()=>{t.current?.focus()},[]),O.jsxs("div",{ref:t,tabIndex:-1,className:"outline-none",children:[e==="signInOff"&&O.jsxs(Zr,{tone:"info",children:[O.jsx("p",{className:"font-medium",children:"Sign-in is turned off on this server."}),O.jsx("p",{className:"mt-1",children:"The person who runs this server turned it off. Ask them when it is back."})]}),e==="accountDisabled"&&O.jsxs(Zr,{tone:"danger",children:[O.jsx("p",{className:"font-medium",children:"This account is disabled."}),O.jsx("p",{className:"mt-1",children:"Ask the person who runs this server."})]}),e==="passwordChanged"&&O.jsx(Zr,{tone:"success",children:"Password changed. Sign in with your new password."})]})},hk=({notice:e})=>{const[t,n]=_.useState("signIn"),[r,o]=_.useState(""),[s,a]=_.useState(""),[u,c]=_.useState(""),[f,h]=_.useState(null),[g,m]=_.useState(!1),[v,w]=_.useState(!1),[S,C]=_.useState(e),E=S==="signInOff",A=v||E?"signIn":t,I=(N,M)=>{const R=iI(N);if(R){C(R);return}if(XJ(N)){w(!0),n("signIn");return}const k=o$(N);if(k==="fatal"){Kre(N,M);return}h(Vre(N,k))},T=async N=>{if(N.preventDefault(),g)return;h(null),C(void 0),m(!0);const M=A==="signUp"?soe:ioe,R=await(A==="signUp"?qa.signUp.email({email:s,password:u,name:r}):qa.signIn.email({email:s,password:u})).then(k=>k.error??null,k=>k);m(!1),R&&I(R,M)};return O.jsxs(O.Fragment,{children:[O.jsx(n$,{}),O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsxs("form",{onSubmit:T,className:"mt-6 flex flex-col gap-4 rounded-lg border border-line bg-surface p-7 shadow-lg",children:[S&&O.jsx(aoe,{notice:S},S),E?null:v?O.jsx(Zr,{tone:"info",children:"New signups are currently closed. Sign in with an existing account, or contact your administrator for access."}):O.jsxs("div",{className:"flex gap-1",children:[O.jsx(Xr,{size:"sm",variant:A==="signIn"?"secondary":"ghost","aria-pressed":A==="signIn",onClick:()=>n("signIn"),children:"Sign in"}),O.jsx(Xr,{size:"sm",variant:A==="signUp"?"secondary":"ghost","aria-pressed":A==="signUp",onClick:()=>n("signUp"),children:"Create account"})]}),f&&O.jsx(Zr,{tone:"danger",children:f}),A==="signUp"&&O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"ba-name",className:"text-fg-muted",children:"Name"}),O.jsx(bf,{id:"ba-name",type:"text",autoComplete:"name",value:r,onChange:N=>o(N.target.value),placeholder:"Your name",required:!0})]}),O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"ba-email",className:"text-fg-muted",children:"Email"}),O.jsx(bf,{id:"ba-email",type:"email",autoComplete:"email",value:s,onChange:N=>a(N.target.value),placeholder:"you@example.com",required:!0,disabled:E})]}),O.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[O.jsx("label",{htmlFor:"ba-password",className:"text-fg-muted",children:"Password"}),O.jsx(jF,{id:"ba-password",autoComplete:A==="signUp"?"new-password":"current-password",value:u,onChange:N=>c(N.target.value),placeholder:"Your password",required:!0,disabled:E})]}),O.jsx(Xr,{type:"submit",disabled:E,children:A==="signUp"?"Create account":"Sign in"})]}),O.jsx(tI,{note:oI({betterAuthEnabled:Hv(),cognitoConfigured:!1})})]})]})},loe=({session:e,onRetry:t,notice:n,children:r})=>{const o=ooe(e);return o.kind==="active"?O.jsx(O.Fragment,{children:r}):o.kind==="pending"?O.jsx(Kv,{}):o.kind==="rateLimited"?O.jsx(noe,{onRetry:t,onReport:Ure}):o.kind==="refused"?O.jsx(hk,{notice:o.refusal},o.refusal):O.jsx(hk,{notice:n})},uoe=({children:e})=>{const{data:t,isPending:n,error:r,refetch:o}=qa.useSession(),[s,a]=_.useState(()=>Qre(window.location.pathname)),[u,c]=_.useState(void 0);return s?O.jsx(toe,{token:s,onDone:()=>{window.history.replaceState(null,"","/"),a(void 0),c("passwordChanged")}}):O.jsx(loe,{session:{data:t,isPending:n,error:r},onRetry:()=>{o()},notice:u,children:e})},coe=({children:e,fallback:t=null})=>{const{data:n}=qa.useSession();if(!n)return O.jsx(O.Fragment,{children:t});const r=async()=>{await qa.signOut(),QA()};return O.jsx(O.Fragment,{children:e({email:n.user.email??null,signOut:r})})},Om={configure:()=>{},getToken:uee,resetToken:QA,Shell:uoe,Account:coe};var q1,pk;function doe(){if(pk)return q1;pk=1;function e(){this.__data__=[],this.size=0}return q1=e,q1}var V1,gk;function sh(){if(gk)return V1;gk=1;function e(t,n){return t===n||t!==t&&n!==n}return V1=e,V1}var W1,mk;function ny(){if(mk)return W1;mk=1;var e=sh();function t(n,r){for(var o=n.length;o--;)if(e(n[o][0],r))return o;return-1}return W1=t,W1}var G1,vk;function foe(){if(vk)return G1;vk=1;var e=ny(),t=Array.prototype,n=t.splice;function r(o){var s=this.__data__,a=e(s,o);if(a<0)return!1;var u=s.length-1;return a==u?s.pop():n.call(s,a,1),--this.size,!0}return G1=r,G1}var K1,yk;function hoe(){if(yk)return K1;yk=1;var e=ny();function t(n){var r=this.__data__,o=e(r,n);return o<0?void 0:r[o][1]}return K1=t,K1}var Z1,bk;function poe(){if(bk)return Z1;bk=1;var e=ny();function t(n){return e(this.__data__,n)>-1}return Z1=t,Z1}var Y1,Sk;function goe(){if(Sk)return Y1;Sk=1;var e=ny();function t(n,r){var o=this.__data__,s=e(o,n);return s<0?(++this.size,o.push([n,r])):o[s][1]=r,this}return Y1=t,Y1}var Q1,wk;function ry(){if(wk)return Q1;wk=1;var e=doe(),t=foe(),n=hoe(),r=poe(),o=goe();function s(a){var u=-1,c=a==null?0:a.length;for(this.clear();++u<c;){var f=a[u];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=o,Q1=s,Q1}var X1,Ck;function moe(){if(Ck)return X1;Ck=1;var e=ry();function t(){this.__data__=new e,this.size=0}return X1=t,X1}var J1,Ek;function voe(){if(Ek)return J1;Ek=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return J1=e,J1}var eS,_k;function yoe(){if(_k)return eS;_k=1;function e(t){return this.__data__.get(t)}return eS=e,eS}var tS,xk;function boe(){if(xk)return tS;xk=1;function e(t){return this.__data__.has(t)}return tS=e,tS}var nS,Ak;function s$(){if(Ak)return nS;Ak=1;var e=typeof Up=="object"&&Up&&Up.Object===Object&&Up;return nS=e,nS}var rS,Ik;function Go(){if(Ik)return rS;Ik=1;var e=s$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return rS=n,rS}var oS,Rk;function oy(){if(Rk)return oS;Rk=1;var e=Go(),t=e.Symbol;return oS=t,oS}var sS,Tk;function Soe(){if(Tk)return sS;Tk=1;var e=oy(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function s(a){var u=n.call(a,o),c=a[o];try{a[o]=void 0;var f=!0}catch{}var h=r.call(a);return f&&(u?a[o]=c:delete a[o]),h}return sS=s,sS}var iS,Ok;function woe(){if(Ok)return iS;Ok=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return iS=n,iS}var aS,Mk;function mc(){if(Mk)return aS;Mk=1;var e=oy(),t=Soe(),n=woe(),r="[object Null]",o="[object Undefined]",s=e?e.toStringTag:void 0;function a(u){return u==null?u===void 0?o:r:s&&s in Object(u)?t(u):n(u)}return aS=a,aS}var lS,Pk;function Bs(){if(Pk)return lS;Pk=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return lS=e,lS}var uS,Nk;function aI(){if(Nk)return uS;Nk=1;var e=mc(),t=Bs(),n="[object AsyncFunction]",r="[object Function]",o="[object GeneratorFunction]",s="[object Proxy]";function a(u){if(!t(u))return!1;var c=e(u);return c==r||c==o||c==n||c==s}return uS=a,uS}var cS,kk;function Coe(){if(kk)return cS;kk=1;var e=Go(),t=e["__core-js_shared__"];return cS=t,cS}var dS,Dk;function Eoe(){if(Dk)return dS;Dk=1;var e=Coe(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return dS=n,dS}var fS,Lk;function i$(){if(Lk)return fS;Lk=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return fS=n,fS}var hS,Uk;function _oe(){if(Uk)return hS;Uk=1;var e=aI(),t=Eoe(),n=Bs(),r=i$(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,a=Function.prototype,u=Object.prototype,c=a.toString,f=u.hasOwnProperty,h=RegExp("^"+c.call(f).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(m){if(!n(m)||t(m))return!1;var v=e(m)?h:s;return v.test(r(m))}return hS=g,hS}var pS,Fk;function xoe(){if(Fk)return pS;Fk=1;function e(t,n){return t?.[n]}return pS=e,pS}var gS,$k;function il(){if($k)return gS;$k=1;var e=_oe(),t=xoe();function n(r,o){var s=t(r,o);return e(s)?s:void 0}return gS=n,gS}var mS,zk;function lI(){if(zk)return mS;zk=1;var e=il(),t=Go(),n=e(t,"Map");return mS=n,mS}var vS,jk;function sy(){if(jk)return vS;jk=1;var e=il(),t=e(Object,"create");return vS=t,vS}var yS,Bk;function Aoe(){if(Bk)return yS;Bk=1;var e=sy();function t(){this.__data__=e?e(null):{},this.size=0}return yS=t,yS}var bS,Hk;function Ioe(){if(Hk)return bS;Hk=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return bS=e,bS}var SS,qk;function Roe(){if(qk)return SS;qk=1;var e=sy(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function o(s){var a=this.__data__;if(e){var u=a[s];return u===t?void 0:u}return r.call(a,s)?a[s]:void 0}return SS=o,SS}var wS,Vk;function Toe(){if(Vk)return wS;Vk=1;var e=sy(),t=Object.prototype,n=t.hasOwnProperty;function r(o){var s=this.__data__;return e?s[o]!==void 0:n.call(s,o)}return wS=r,wS}var CS,Wk;function Ooe(){if(Wk)return CS;Wk=1;var e=sy(),t="__lodash_hash_undefined__";function n(r,o){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&o===void 0?t:o,this}return CS=n,CS}var ES,Gk;function Moe(){if(Gk)return ES;Gk=1;var e=Aoe(),t=Ioe(),n=Roe(),r=Toe(),o=Ooe();function s(a){var u=-1,c=a==null?0:a.length;for(this.clear();++u<c;){var f=a[u];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=o,ES=s,ES}var _S,Kk;function Poe(){if(Kk)return _S;Kk=1;var e=Moe(),t=ry(),n=lI();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return _S=r,_S}var xS,Zk;function Noe(){if(Zk)return xS;Zk=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return xS=e,xS}var AS,Yk;function iy(){if(Yk)return AS;Yk=1;var e=Noe();function t(n,r){var o=n.__data__;return e(r)?o[typeof r=="string"?"string":"hash"]:o.map}return AS=t,AS}var IS,Qk;function koe(){if(Qk)return IS;Qk=1;var e=iy();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return IS=t,IS}var RS,Xk;function Doe(){if(Xk)return RS;Xk=1;var e=iy();function t(n){return e(this,n).get(n)}return RS=t,RS}var TS,Jk;function Loe(){if(Jk)return TS;Jk=1;var e=iy();function t(n){return e(this,n).has(n)}return TS=t,TS}var OS,e3;function Uoe(){if(e3)return OS;e3=1;var e=iy();function t(n,r){var o=e(this,n),s=o.size;return o.set(n,r),this.size+=o.size==s?0:1,this}return OS=t,OS}var MS,t3;function uI(){if(t3)return MS;t3=1;var e=Poe(),t=koe(),n=Doe(),r=Loe(),o=Uoe();function s(a){var u=-1,c=a==null?0:a.length;for(this.clear();++u<c;){var f=a[u];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=o,MS=s,MS}var PS,n3;function Foe(){if(n3)return PS;n3=1;var e=ry(),t=lI(),n=uI(),r=200;function o(s,a){var u=this.__data__;if(u instanceof e){var c=u.__data__;if(!t||c.length<r-1)return c.push([s,a]),this.size=++u.size,this;u=this.__data__=new n(c)}return u.set(s,a),this.size=u.size,this}return PS=o,PS}var NS,r3;function cI(){if(r3)return NS;r3=1;var e=ry(),t=moe(),n=voe(),r=yoe(),o=boe(),s=Foe();function a(u){var c=this.__data__=new e(u);this.size=c.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=o,a.prototype.set=s,NS=a,NS}var kS,o3;function $oe(){if(o3)return kS;o3=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return kS=t,kS}var DS,s3;function zoe(){if(s3)return DS;s3=1;function e(t){return this.__data__.has(t)}return DS=e,DS}var LS,i3;function joe(){if(i3)return LS;i3=1;var e=uI(),t=$oe(),n=zoe();function r(o){var s=-1,a=o==null?0:o.length;for(this.__data__=new e;++s<a;)this.add(o[s])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,LS=r,LS}var US,a3;function Boe(){if(a3)return US;a3=1;function e(t,n){for(var r=-1,o=t==null?0:t.length;++r<o;)if(n(t[r],r,t))return!0;return!1}return US=e,US}var FS,l3;function Hoe(){if(l3)return FS;l3=1;function e(t,n){return t.has(n)}return FS=e,FS}var $S,u3;function a$(){if(u3)return $S;u3=1;var e=joe(),t=Boe(),n=Hoe(),r=1,o=2;function s(a,u,c,f,h,g){var m=c&r,v=a.length,w=u.length;if(v!=w&&!(m&&w>v))return!1;var S=g.get(a),C=g.get(u);if(S&&C)return S==u&&C==a;var E=-1,A=!0,I=c&o?new e:void 0;for(g.set(a,u),g.set(u,a);++E<v;){var T=a[E],N=u[E];if(f)var M=m?f(N,T,E,u,a,g):f(T,N,E,a,u,g);if(M!==void 0){if(M)continue;A=!1;break}if(I){if(!t(u,function(R,k){if(!n(I,k)&&(T===R||h(T,R,c,f,g)))return I.push(k)})){A=!1;break}}else if(!(T===N||h(T,N,c,f,g))){A=!1;break}}return g.delete(a),g.delete(u),A}return $S=s,$S}var zS,c3;function l$(){if(c3)return zS;c3=1;var e=Go(),t=e.Uint8Array;return zS=t,zS}var jS,d3;function qoe(){if(d3)return jS;d3=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(o,s){r[++n]=[s,o]}),r}return jS=e,jS}var BS,f3;function Voe(){if(f3)return BS;f3=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(o){r[++n]=o}),r}return BS=e,BS}var HS,h3;function Woe(){if(h3)return HS;h3=1;var e=oy(),t=l$(),n=sh(),r=a$(),o=qoe(),s=Voe(),a=1,u=2,c="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Map]",m="[object Number]",v="[object RegExp]",w="[object Set]",S="[object String]",C="[object Symbol]",E="[object ArrayBuffer]",A="[object DataView]",I=e?e.prototype:void 0,T=I?I.valueOf:void 0;function N(M,R,k,L,q,F,D){switch(k){case A:if(M.byteLength!=R.byteLength||M.byteOffset!=R.byteOffset)return!1;M=M.buffer,R=R.buffer;case E:return!(M.byteLength!=R.byteLength||!F(new t(M),new t(R)));case c:case f:case m:return n(+M,+R);case h:return M.name==R.name&&M.message==R.message;case v:case S:return M==R+"";case g:var j=o;case w:var Z=L&a;if(j||(j=s),M.size!=R.size&&!Z)return!1;var he=D.get(M);if(he)return he==R;L|=u,D.set(M,R);var B=r(j(M),j(R),L,q,F,D);return D.delete(M),B;case C:if(T)return T.call(M)==T.call(R)}return!1}return HS=N,HS}var qS,p3;function u$(){if(p3)return qS;p3=1;function e(t,n){for(var r=-1,o=n.length,s=t.length;++r<o;)t[s+r]=n[r];return t}return qS=e,qS}var VS,g3;function Hs(){if(g3)return VS;g3=1;var e=Array.isArray;return VS=e,VS}var WS,m3;function c$(){if(m3)return WS;m3=1;var e=u$(),t=Hs();function n(r,o,s){var a=o(r);return t(r)?a:e(a,s(r))}return WS=n,WS}var GS,v3;function Goe(){if(v3)return GS;v3=1;function e(t,n){for(var r=-1,o=t==null?0:t.length,s=0,a=[];++r<o;){var u=t[r];n(u,r,t)&&(a[s++]=u)}return a}return GS=e,GS}var KS,y3;function d$(){if(y3)return KS;y3=1;function e(){return[]}return KS=e,KS}var ZS,b3;function f$(){if(b3)return ZS;b3=1;var e=Goe(),t=d$(),n=Object.prototype,r=n.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(a){return a==null?[]:(a=Object(a),e(o(a),function(u){return r.call(a,u)}))}:t;return ZS=s,ZS}var YS,S3;function Koe(){if(S3)return YS;S3=1;function e(t,n){for(var r=-1,o=Array(t);++r<t;)o[r]=n(r);return o}return YS=e,YS}var QS,w3;function al(){if(w3)return QS;w3=1;function e(t){return t!=null&&typeof t=="object"}return QS=e,QS}var XS,C3;function Zoe(){if(C3)return XS;C3=1;var e=mc(),t=al(),n="[object Arguments]";function r(o){return t(o)&&e(o)==n}return XS=r,XS}var JS,E3;function dI(){if(E3)return JS;E3=1;var e=Zoe(),t=al(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(a){return t(a)&&r.call(a,"callee")&&!o.call(a,"callee")};return JS=s,JS}var qd={exports:{}},ew,_3;function Yoe(){if(_3)return ew;_3=1;function e(){return!1}return ew=e,ew}qd.exports;var x3;function fI(){return x3||(x3=1,(function(e,t){var n=Go(),r=Yoe(),o=t&&!t.nodeType&&t,s=o&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===o,u=a?n.Buffer:void 0,c=u?u.isBuffer:void 0,f=c||r;e.exports=f})(qd,qd.exports)),qd.exports}var tw,A3;function ay(){if(A3)return tw;A3=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,o){var s=typeof r;return o=o??e,!!o&&(s=="number"||s!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<o}return tw=n,tw}var nw,I3;function hI(){if(I3)return nw;I3=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return nw=t,nw}var rw,R3;function Qoe(){if(R3)return rw;R3=1;var e=mc(),t=hI(),n=al(),r="[object Arguments]",o="[object Array]",s="[object Boolean]",a="[object Date]",u="[object Error]",c="[object Function]",f="[object Map]",h="[object Number]",g="[object Object]",m="[object RegExp]",v="[object Set]",w="[object String]",S="[object WeakMap]",C="[object ArrayBuffer]",E="[object DataView]",A="[object Float32Array]",I="[object Float64Array]",T="[object Int8Array]",N="[object Int16Array]",M="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",F={};F[A]=F[I]=F[T]=F[N]=F[M]=F[R]=F[k]=F[L]=F[q]=!0,F[r]=F[o]=F[C]=F[s]=F[E]=F[a]=F[u]=F[c]=F[f]=F[h]=F[g]=F[m]=F[v]=F[w]=F[S]=!1;function D(j){return n(j)&&t(j.length)&&!!F[e(j)]}return rw=D,rw}var ow,T3;function Xoe(){if(T3)return ow;T3=1;function e(t){return function(n){return t(n)}}return ow=e,ow}var Vd={exports:{}};Vd.exports;var O3;function Joe(){return O3||(O3=1,(function(e,t){var n=s$(),r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===r,a=s&&n.process,u=(function(){try{var c=o&&o.require&&o.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}})();e.exports=u})(Vd,Vd.exports)),Vd.exports}var sw,M3;function pI(){if(M3)return sw;M3=1;var e=Qoe(),t=Xoe(),n=Joe(),r=n&&n.isTypedArray,o=r?t(r):e;return sw=o,sw}var iw,P3;function h$(){if(P3)return iw;P3=1;var e=Koe(),t=dI(),n=Hs(),r=fI(),o=ay(),s=pI(),a=Object.prototype,u=a.hasOwnProperty;function c(f,h){var g=n(f),m=!g&&t(f),v=!g&&!m&&r(f),w=!g&&!m&&!v&&s(f),S=g||m||v||w,C=S?e(f.length,String):[],E=C.length;for(var A in f)(h||u.call(f,A))&&!(S&&(A=="length"||v&&(A=="offset"||A=="parent")||w&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||o(A,E)))&&C.push(A);return C}return iw=c,iw}var aw,N3;function gI(){if(N3)return aw;N3=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,o=typeof r=="function"&&r.prototype||e;return n===o}return aw=t,aw}var lw,k3;function p$(){if(k3)return lw;k3=1;function e(t,n){return function(r){return t(n(r))}}return lw=e,lw}var uw,D3;function ese(){if(D3)return uw;D3=1;var e=p$(),t=e(Object.keys,Object);return uw=t,uw}var cw,L3;function tse(){if(L3)return cw;L3=1;var e=gI(),t=ese(),n=Object.prototype,r=n.hasOwnProperty;function o(s){if(!e(s))return t(s);var a=[];for(var u in Object(s))r.call(s,u)&&u!="constructor"&&a.push(u);return a}return cw=o,cw}var dw,U3;function ly(){if(U3)return dw;U3=1;var e=aI(),t=hI();function n(r){return r!=null&&t(r.length)&&!e(r)}return dw=n,dw}var fw,F3;function g$(){if(F3)return fw;F3=1;var e=h$(),t=tse(),n=ly();function r(o){return n(o)?e(o):t(o)}return fw=r,fw}var hw,$3;function nse(){if($3)return hw;$3=1;var e=c$(),t=f$(),n=g$();function r(o){return e(o,n,t)}return hw=r,hw}var pw,z3;function rse(){if(z3)return pw;z3=1;var e=nse(),t=1,n=Object.prototype,r=n.hasOwnProperty;function o(s,a,u,c,f,h){var g=u&t,m=e(s),v=m.length,w=e(a),S=w.length;if(v!=S&&!g)return!1;for(var C=v;C--;){var E=m[C];if(!(g?E in a:r.call(a,E)))return!1}var A=h.get(s),I=h.get(a);if(A&&I)return A==a&&I==s;var T=!0;h.set(s,a),h.set(a,s);for(var N=g;++C<v;){E=m[C];var M=s[E],R=a[E];if(c)var k=g?c(R,M,E,a,s,h):c(M,R,E,s,a,h);if(!(k===void 0?M===R||f(M,R,u,c,h):k)){T=!1;break}N||(N=E=="constructor")}if(T&&!N){var L=s.constructor,q=a.constructor;L!=q&&"constructor"in s&&"constructor"in a&&!(typeof L=="function"&&L instanceof L&&typeof q=="function"&&q instanceof q)&&(T=!1)}return h.delete(s),h.delete(a),T}return pw=o,pw}var gw,j3;function ose(){if(j3)return gw;j3=1;var e=il(),t=Go(),n=e(t,"DataView");return gw=n,gw}var mw,B3;function sse(){if(B3)return mw;B3=1;var e=il(),t=Go(),n=e(t,"Promise");return mw=n,mw}var vw,H3;function ise(){if(H3)return vw;H3=1;var e=il(),t=Go(),n=e(t,"Set");return vw=n,vw}var yw,q3;function ase(){if(q3)return yw;q3=1;var e=il(),t=Go(),n=e(t,"WeakMap");return yw=n,yw}var bw,V3;function lse(){if(V3)return bw;V3=1;var e=ose(),t=lI(),n=sse(),r=ise(),o=ase(),s=mc(),a=i$(),u="[object Map]",c="[object Object]",f="[object Promise]",h="[object Set]",g="[object WeakMap]",m="[object DataView]",v=a(e),w=a(t),S=a(n),C=a(r),E=a(o),A=s;return(e&&A(new e(new ArrayBuffer(1)))!=m||t&&A(new t)!=u||n&&A(n.resolve())!=f||r&&A(new r)!=h||o&&A(new o)!=g)&&(A=function(I){var T=s(I),N=T==c?I.constructor:void 0,M=N?a(N):"";if(M)switch(M){case v:return m;case w:return u;case S:return f;case C:return h;case E:return g}return T}),bw=A,bw}var Sw,W3;function use(){if(W3)return Sw;W3=1;var e=cI(),t=a$(),n=Woe(),r=rse(),o=lse(),s=Hs(),a=fI(),u=pI(),c=1,f="[object Arguments]",h="[object Array]",g="[object Object]",m=Object.prototype,v=m.hasOwnProperty;function w(S,C,E,A,I,T){var N=s(S),M=s(C),R=N?h:o(S),k=M?h:o(C);R=R==f?g:R,k=k==f?g:k;var L=R==g,q=k==g,F=R==k;if(F&&a(S)){if(!a(C))return!1;N=!0,L=!1}if(F&&!L)return T||(T=new e),N||u(S)?t(S,C,E,A,I,T):n(S,C,R,E,A,I,T);if(!(E&c)){var D=L&&v.call(S,"__wrapped__"),j=q&&v.call(C,"__wrapped__");if(D||j){var Z=D?S.value():S,he=j?C.value():C;return T||(T=new e),I(Z,he,E,A,T)}}return F?(T||(T=new e),r(S,C,E,A,I,T)):!1}return Sw=w,Sw}var ww,G3;function m$(){if(G3)return ww;G3=1;var e=use(),t=al();function n(r,o,s,a,u){return r===o?!0:r==null||o==null||!t(r)&&!t(o)?r!==r&&o!==o:e(r,o,s,a,n,u)}return ww=n,ww}var Cw={exports:{}},Ew={},_w={exports:{}},xw={};var K3;function cse(){if(K3)return xw;K3=1;var e=rh();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function u(g,m){var v=m(),w=r({inst:{value:v,getSnapshot:m}}),S=w[0].inst,C=w[1];return s(function(){S.value=v,S.getSnapshot=m,c(S)&&C({inst:S})},[g,v,m]),o(function(){return c(S)&&C({inst:S}),g(function(){c(S)&&C({inst:S})})},[g]),a(v),v}function c(g){var m=g.getSnapshot;g=g.value;try{var v=m();return!n(g,v)}catch{return!0}}function f(g,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return xw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,xw}var Z3;function dse(){return Z3||(Z3=1,_w.exports=cse()),_w.exports}var Y3;function fse(){if(Y3)return Ew;Y3=1;var e=rh(),t=dse();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,u=e.useMemo,c=e.useDebugValue;return Ew.useSyncExternalStoreWithSelector=function(f,h,g,m,v){var w=s(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function E(M){if(!A){if(A=!0,I=M,M=m(M),v!==void 0&&S.hasValue){var R=S.value;if(v(R,M))return T=R}return T=M}if(R=T,r(I,M))return R;var k=m(M);return v!==void 0&&v(R,k)?(I=M,R):(I=M,T=k)}var A=!1,I,T,N=g===void 0?null:g;return[function(){return E(h())},N===null?void 0:function(){return E(N())}]},[h,g,m,v]);var C=o(f,w[0],w[1]);return a(function(){S.hasValue=!0,S.value=C},[C]),c(C),C},Ew}var Q3;function hse(){return Q3||(Q3=1,Cw.exports=fse()),Cw.exports}var v$=hse();var ce=function(){return ce=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ce.apply(this,arguments)};function mI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function et(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lt(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(u){a={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}function $t(e,t,n){if(arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var wt;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(wt||(wt={}));var Va;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(Va||(Va={}));var j_=wt.Start,vI=wt.Stop,ih=wt.Raise,uy=wt.Send,y$=wt.Cancel,pse=wt.NullEvent,yI=wt.Assign;wt.After;wt.DoneState;var b$=wt.Log,gse=wt.Init,B_=wt.Invoke;wt.ErrorExecution;var X3=wt.ErrorPlatform,mse=wt.ErrorCustom,bI=wt.Update,vse=wt.Choose,yse=wt.Pure,S$=".",J3={},H_="xstate.guard",bse="",Kp;function SI(e,t,n){n===void 0&&(n=S$);var r=of(e,n),o=of(t,n);return dt(o)?dt(r)?o===r:!1:dt(r)?r in o:Object.keys(r).every(function(s){return s in o?SI(r[s],o[s]):!1})}function w$(e){try{return dt(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function q_(e,t){try{return vc(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function Sse(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function of(e,t){if(Sse(e))return e.value;if(vc(e))return Mm(e);if(typeof e!="string")return e;var n=q_(e,t);return Mm(n)}function Mm(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function Wd(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var s=r[o];n[s]=t(e[s],s,e,o)}return n}function eD(e,t,n){var r,o,s={};try{for(var a=et(Object.keys(e)),u=a.next();!u.done;u=a.next()){var c=u.value,f=e[c];n(f)&&(s[c]=t(f,c,e))}}catch(h){r={error:h}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return s}var wse=function(e){return function(t){var n,r,o=t;try{for(var s=et(e),a=s.next();!a.done;a=s.next()){var u=a.value;o=o[u]}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}};function Cse(e,t){return function(n){var r,o,s=n;try{for(var a=et(e),u=a.next();!u.done;u=a.next()){var c=u.value;s=s[t][c]}}catch(f){r={error:f}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return s}}function om(e){if(!e)return[[]];if(dt(e))return[[e]];var t=Gt(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:om(e[n]).map(function(o){return[n].concat(o)})}));return t}function Gt(e){var t;return(t=[]).concat.apply(t,$t([],lt(e),!1))}function C$(e){return vc(e)?e:[e]}function uo(e){return e===void 0?[]:C$(e)}function Pm(e,t,n){var r,o;if(ft(e))return e(t,n.data);var s={};try{for(var a=et(Object.keys(e)),u=a.next();!u.done;u=a.next()){var c=u.value,f=e[c];ft(f)?s[c]=f(t,n.data):s[c]=f}}catch(h){r={error:h}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return s}function Ese(e){return/^(done|error)\./.test(e)}function tD(e){return!!(e instanceof Promise||e!==null&&(ft(e)||typeof e=="object")&&ft(e.then))}function _se(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function xse(e,t){var n,r,o=lt([[],[]],2),s=o[0],a=o[1];try{for(var u=et(e),c=u.next();!c.done;c=u.next()){var f=c.value;t(f)?s.push(f):a.push(f)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return[s,a]}function E$(e,t){return Wd(e.states,function(n,r){if(n){var o=(dt(t)?void 0:t[r])||(n?n.current:void 0);if(o)return{current:o,states:E$(n,o)}}})}function Ase(e,t){return{current:t,states:E$(e,t)}}function nD(e,t,n,r){var o=e&&n.reduce(function(s,a){var u,c,f=a.assignment,h={state:r,action:a,_event:t},g={};if(ft(f))g=f(s,t.data,h);else try{for(var m=et(Object.keys(f)),v=m.next();!v.done;v=m.next()){var w=v.value,S=f[w];g[w]=ft(S)?S(s,t.data,h):S}}catch(C){u={error:C}}finally{try{v&&!v.done&&(c=m.return)&&c.call(m)}finally{if(u)throw u.error}}return Object.assign({},s,g)},e);return o}var Ise=function(){};function vc(e){return Array.isArray(e)}function ft(e){return typeof e=="function"}function dt(e){return typeof e=="string"}function _$(e,t){if(e)return dt(e)?{type:H_,name:e,predicate:t?t[e]:void 0}:ft(e)?{type:H_,name:e.name,predicate:e}:e}function Rse(e){try{return"subscribe"in e&&ft(e.subscribe)}catch{return!1}}var Ti=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();Kp={},Kp[Ti]=function(){return this},Kp[Symbol.observable]=function(){return this};function Hu(e){return!!e&&"__xstatenode"in e}function Tse(e){return!!e&&typeof e.send=="function"}var Ose=(function(){var e=0;return function(){return e++,e.toString(16)}})();function cy(e,t){return dt(e)||typeof e=="number"?ce({type:e},t):e}function Dn(e,t){if(!dt(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=cy(e);return ce({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function ru(e,t){var n=C$(t).map(function(r){return typeof r>"u"||typeof r=="string"||Hu(r)?{target:r,event:e}:ce(ce({},r),{event:e})});return n}function Mse(e){if(!(e===void 0||e===bse))return uo(e)}function x$(e,t,n,r,o){var s=e.options.guards,a={state:o,cond:t,_event:r};if(t.type===H_)return(s?.[t.name]||t.predicate)(n,r.data,a);var u=s?.[t.type];if(!u)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return u(n,r.data,a)}function A$(e){return typeof e=="string"?{type:e}:e}function sf(e,t,n){var r=function(){},o=typeof e=="object",s=o?e:null;return{next:((o?e.next:e)||r).bind(s),error:((o?e.error:t)||r).bind(s),complete:((o?e.complete:n)||r).bind(s)}}function Zp(e,t){return"".concat(e,":invocation[").concat(t,"]")}function V_(e){return(e.type===ih||e.type===uy&&e.to===Va.Internal)&&typeof e.delay!="number"}var Na=Dn({type:gse});function Nm(e,t){return t&&t[e]||void 0}function qu(e,t){var n;if(dt(e)||typeof e=="number"){var r=Nm(e,t);ft(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(ft(e))n={type:e.name||e.toString(),exec:e};else{var r=Nm(e.type,t);if(ft(r))n=ce(ce({},e),{exec:r});else if(r){var o=r.type||e.type;n=ce(ce(ce({},r),e),{type:o})}else n=e}return n}var _s=function(e,t){if(!e)return[];var n=vc(e)?e:[e];return n.map(function(r){return qu(r,t)})};function dy(e){var t=qu(e);return ce(ce({id:dt(e)?e:t.id},t),{type:t.type})}function I$(e,t){return{type:ih,event:typeof e=="function"?e:cy(e),delay:t?t.delay:void 0,id:t?.id}}function R$(e,t,n,r){var o={_event:n},s=Dn(ft(e.event)?e.event(t,n.data,o):e.event),a;if(dt(e.delay)){var u=r&&r[e.delay];a=ft(u)?u(t,n.data,o):u}else a=ft(e.delay)?e.delay(t,n.data,o):e.delay;return ce(ce({},e),{type:ih,_event:s,delay:a})}function fy(e,t){return{to:t?t.to:void 0,type:uy,event:ft(e)?e:cy(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:ft(e)?e.name:w$(e)}}function T$(e,t,n,r){var o={_event:n},s=Dn(ft(e.event)?e.event(t,n.data,o):e.event),a;if(dt(e.delay)){var u=r&&r[e.delay];a=ft(u)?u(t,n.data,o):u}else a=ft(e.delay)?e.delay(t,n.data,o):e.delay;var c=ft(e.to)?e.to(t,n.data,o):e.to;return ce(ce({},e),{to:c,_event:s,event:s.data,delay:a})}function O$(e,t){return fy(e,ce(ce({},t),{to:Va.Parent}))}function M$(){return O$(bI)}var P$=function(e,t,n){return ce(ce({},e),{value:dt(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},N$=function(e){return{type:y$,sendId:e}};function k$(e){var t=dy(e);return{type:wt.Start,activity:t,exec:void 0}}function D$(e){var t=ft(e)?e:dy(e);return{type:wt.Stop,activity:t,exec:void 0}}function L$(e,t,n){var r=ft(e.activity)?e.activity(t,n.data):e.activity,o=typeof r=="string"?{id:r}:r,s={type:wt.Stop,activity:o};return s}var U$=function(e){return{type:yI,assignment:e}};function F$(e,t){var n=t?"#".concat(t):"";return"".concat(wt.After,"(").concat(e,")").concat(n)}function Gd(e,t){var n="".concat(wt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function af(e,t){var n="".concat(wt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function wu(e,t){var n="".concat(wt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function $$(e,t){return fy(function(n,r){return r},ce(ce({},t),{to:e}))}function Pse(e){return{type:wt.Choose,conds:e}}var Nse=function(e){var t,n,r=[];try{for(var o=et(e),s=o.next();!s.done;s=o.next())for(var a=s.value,u=0;u<a.actions.length;){if(a.actions[u].type===yI){r.push(a.actions[u]),a.actions.splice(u,1);continue}u++}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r};function Ef(e,t,n,r,o,s,a){a===void 0&&(a=!1);var u=a?[]:Nse(o),c=u.length?nD(n,r,u,t):n,f=a?[n]:void 0,h=[];function g(w,S){var C;switch(S.type){case ih:{var E=R$(S,c,r,e.options.delays);return s&&typeof E.delay=="number"&&s(E,c,r),E}case uy:var A=T$(S,c,r,e.options.delays);return s&&A.to!==Va.Internal&&(w==="entry"?h.push(A):s(A,c,r)),A;case b$:{var I=P$(S,c,r);return s?.(I,c,r),I}case vse:{var T=S,N=(C=T.conds.find(function(B){var Q=_$(B.cond,e.options.guards);return!Q||x$(e,Q,c,r,s?void 0:t)}))===null||C===void 0?void 0:C.actions;if(!N)return[];var M=lt(Ef(e,t,c,r,[{type:w,actions:_s(uo(N),e.options.actions)}],s,a),2),R=M[0],k=M[1];return c=k,f?.push(c),R}case yse:{var N=S.get(c,r.data);if(!N)return[];var L=lt(Ef(e,t,c,r,[{type:w,actions:_s(uo(N),e.options.actions)}],s,a),2),q=L[0],F=L[1];return c=F,f?.push(c),q}case vI:{var I=L$(S,c,r);return s?.(I,n,r),I}case yI:{c=nD(c,r,[S],s?void 0:t),f?.push(c);break}default:var D=qu(S,e.options.actions),j=D.exec;if(s)s(D,c,r);else if(j&&f){var Z=f.length-1,he=ce(ce({},D),{exec:function(B){for(var Q=[],ae=1;ae<arguments.length;ae++)Q[ae-1]=arguments[ae];j.apply(void 0,$t([f[Z]],lt(Q),!1))}});D=he}return D}}function m(w){var S,C,E=[];try{for(var A=et(w.actions),I=A.next();!I.done;I=A.next()){var T=I.value,N=g(w.type,T);N&&(E=E.concat(N))}}catch(M){S={error:M}}finally{try{I&&!I.done&&(C=A.return)&&C.call(A)}finally{if(S)throw S.error}}return h.forEach(function(M){s(M,c,r)}),h.length=0,E}var v=Gt(o.map(m));return[v,c]}const z$=Object.freeze(Object.defineProperty({__proto__:null,after:F$,assign:U$,cancel:N$,choose:Pse,done:Gd,doneInvoke:af,error:wu,forwardTo:$$,getActionFunction:Nm,initEvent:Na,raise:I$,resolveActions:Ef,resolveLog:P$,resolveRaise:R$,resolveSend:T$,resolveStop:L$,send:fy,sendParent:O$,sendUpdate:M$,start:k$,stop:D$,toActionObject:qu,toActionObjects:_s,toActivityDefinition:dy},Symbol.toStringTag,{value:"Module"}));var km=[],mu=function(e,t){km.push(e);var n=t(e);return km.pop(),n},kse=function(e){return e(km[km.length-1])};function j$(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[Ti]=function(){return this},t}function Dse(e,t,n,r){var o,s=A$(e.src),a=(o=t?.options.services)===null||o===void 0?void 0:o[s.type],u=e.data?Pm(e.data,n,r):void 0,c=a?wI(a,e.id,u):j$(e.id);return c.meta=e,c}function wI(e,t,n){var r=j$(t);if(r.deferred=!0,Hu(e)){var o=r.state=mu(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return o}}return r}function Lse(e){try{return typeof e.send=="function"}catch{return!1}}function Use(e){return Lse(e)&&"id"in e}function Fse(e){var t;return ce((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[Ti]=function(){return this},t),e)}var Dm=function(e){return e.type==="atomic"||e.type==="final"};function B$(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function _f(e){return B$(e).filter(function(t){return t.type!=="history"})}function H$(e){var t=[e];return Dm(e)?t:t.concat(Gt(_f(e).map(H$)))}function Kd(e,t){var n,r,o,s,a,u,c,f,h=new Set(e),g=W_(h),m=new Set(t);try{for(var v=et(m),w=v.next();!w.done;w=v.next())for(var S=w.value,C=S.parent;C&&!m.has(C);)m.add(C),C=C.parent}catch(L){n={error:L}}finally{try{w&&!w.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}var E=W_(m);try{for(var A=et(m),I=A.next();!I.done;I=A.next()){var S=I.value;if(S.type==="compound"&&(!E.get(S)||!E.get(S).length))g.get(S)?g.get(S).forEach(function(q){return m.add(q)}):S.initialStateNodes.forEach(function(q){return m.add(q)});else if(S.type==="parallel")try{for(var T=(a=void 0,et(_f(S))),N=T.next();!N.done;N=T.next()){var M=N.value;m.has(M)||(m.add(M),g.get(M)?g.get(M).forEach(function(q){return m.add(q)}):M.initialStateNodes.forEach(function(q){return m.add(q)}))}}catch(q){a={error:q}}finally{try{N&&!N.done&&(u=T.return)&&u.call(T)}finally{if(a)throw a.error}}}}catch(L){o={error:L}}finally{try{I&&!I.done&&(s=A.return)&&s.call(A)}finally{if(o)throw o.error}}try{for(var R=et(m),k=R.next();!k.done;k=R.next())for(var S=k.value,C=S.parent;C&&!m.has(C);)m.add(C),C=C.parent}catch(L){c={error:L}}finally{try{k&&!k.done&&(f=R.return)&&f.call(R)}finally{if(c)throw c.error}}return m}function q$(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Dm(r))return r.key}else return{}}var o={};return n.forEach(function(s){o[s.key]=q$(s,t)}),o}function W_(e){var t,n,r=new Map;try{for(var o=et(e),s=o.next();!s.done;s=o.next()){var a=s.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function $se(e,t){var n=Kd([e],t);return q$(e,W_(n))}function Zd(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function zse(e){return $t([],lt(new Set(Gt($t([],lt(e.map(function(t){return t.ownEvents})),!1)))),!1)}function sm(e,t){return t.type==="compound"?_f(t).some(function(n){return n.type==="final"&&Zd(e,n)}):t.type==="parallel"?_f(t).every(function(n){return sm(e,n)}):!1}function jse(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function rD(e){return new Set(Gt(e.map(function(t){return t.tags})))}function V$(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(dt(e)||dt(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(o){return V$(e[o],t[o])})}function Bse(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function Hse(e,t){var n=e.exec,r=ce(ce({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var co=(function(){function e(t){var n=this,r;this.actions=[],this.activities=J3,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||J3,this.meta=jse(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&r!==void 0?r:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return zse(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,events:[],configuration:[],transitions:[],children:{}}):t;var r=Na;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=Na;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),dt(t))return[t];var o=Object.keys(t);return o.concat.apply(o,$t([],lt(o.map(function(s){return r.toStrings(t[s],n).map(function(a){return s+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=mI(t,["configuration","transitions","tags","machine"]);return ce(ce({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return SI(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Ise(!!this.machine);var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!r?.transitions.length&&r.transitions.some(function(o){return o.target!==void 0||o.actions.length})},e})(),qse={deferEvents:!1},oD=(function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ce(ce({},qse),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e})(),Aw=new Map,Vse=0,xd={bookId:function(){return"x:".concat(Vse++)},register:function(e,t){return Aw.set(e,t),e},get:function(e){return Aw.get(e)},free:function(e){Aw.delete(e)}};function CI(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Wse(){var e=CI();if(e&&"__xstate__"in e)return e.__xstate__}function Gse(e){if(CI()){var t=Wse();t&&t.register(e)}}function Kse(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,o=[],s=!1,a=function(){if(!s){for(s=!0;o.length>0;){var f=o.shift();n=e.transition(n,f,c),r.forEach(function(h){return h.next(n)})}s=!1}},u=Fse({id:t.id,send:function(f){o.push(f),a()},getSnapshot:function(){return n},subscribe:function(f,h,g){var m=sf(f,h,g);return r.add(m),m.next(n),{unsubscribe:function(){r.delete(m)}}}}),c={parent:t.parent,self:u,id:t.id||"anonymous",observers:r};return n=e.start?e.start(c):n,u}var G_={sync:!1,autoForward:!1},mn;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(mn||(mn={}));var Zse=(function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=mn.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(h,g){if(vc(h))return r.batch(h),r.state;var m=Dn(cy(h,g));if(r.status===mn.Stopped)return r.state;if(r.status!==mn.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(m.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
18
18
|
Event: `).concat(JSON.stringify(m.data)));return r.scheduler.schedule(function(){r.forward(m);var v=r._nextState(m);r.update(v,m)}),r._state},this.sendTo=function(h,g,m){var v=r.parent&&(g===Va.Parent||r.parent.id===g),w=v?r.parent:dt(g)?g===Va.Internal?r:r.children.get(g)||xd.get(g):Tse(g)?g:void 0;if(!w){if(!v)throw new Error("Unable to send event to child '".concat(g,"' from service '").concat(r.id,"'."));return}if("machine"in w){if(r.status!==mn.Stopped||r.parent!==w||r.state.done){var S=ce(ce({},h),{name:h.name===mse?"".concat(wu(r.id)):h.name,origin:r.sessionId});!m&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([w,S]):w.send(S)}}else!m&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([w,h.data]):w.send(h.data)},this._exec=function(h,g,m,v){v===void 0&&(v=r.machine.options.actions);var w=h.exec||Nm(h.type,v),S=ft(w)?w:w?w.exec:h.exec;if(S)try{return S(g,m.data,r.machine.config.predictableActionArguments?{action:h,_event:m}:{action:h,state:r.state,_event:m})}catch(Z){throw r.parent&&r.parent.send({type:"xstate.error",data:Z}),Z}switch(h.type){case ih:{var C=h;r.defer(C);break}case uy:var E=h;if(typeof E.delay=="number"){r.defer(E);return}else E.to?r.sendTo(E._event,E.to,m===Na):r.send(E._event);break;case y$:r.cancel(h.sendId);break;case j_:{if(r.status!==mn.Running)return;var A=h.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[A.id||A.type])break;if(A.type===wt.Invoke){var I=A$(A.src),T=r.machine.options.services?r.machine.options.services[I.type]:void 0,N=A.id,M=A.data,R="autoForward"in A?A.autoForward:!!A.forward;if(!T)return;var k=M?Pm(M,g,m):void 0;if(typeof T=="string")return;var L=ft(T)?T(g,m.data,{data:k,src:I,meta:A.meta}):T;if(!L)return;var q=void 0;Hu(L)&&(L=k?L.withContext(k):L,q={autoForward:R}),r.spawn(L,N,q)}else r.spawnActivity(A);break}case vI:{r.stopChild(h.activity.id);break}case b$:var F=h,D=F.label,j=F.value;D?r.logger(D,j):r.logger(j);break}};var o=ce(ce({},e.defaultOptions),n),s=o.clock,a=o.logger,u=o.parent,c=o.id,f=c!==void 0?c:t.id;this.id=f,this.logger=a,this.clock=s,this.parent=u,this.options=o,this.scheduler=new oD({deferEvents:this.options.deferEvents}),this.sessionId=xd.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:mu(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(t,n){var r,o;try{for(var s=et(t.actions),a=s.next();!a.done;a=s.next()){var u=a.value;this.exec(u,t,n)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}},e.prototype.update=function(t,n){var r,o,s,a,u,c,f,h,g=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===Na)&&this.options.execute)this.execute(this.state);else for(var m=void 0;m=this._outgoingQueue.shift();)m[0].send(m[1]);if(this.children.forEach(function(L){g.state.children[L.id]=L}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var v=et(this.eventListeners),w=v.next();!w.done;w=v.next()){var S=w.value;S(t.event)}}catch(L){r={error:L}}finally{try{w&&!w.done&&(o=v.return)&&o.call(v)}finally{if(r)throw r.error}}try{for(var C=et(this.listeners),E=C.next();!E.done;E=C.next()){var S=E.value;S(t,t.event)}}catch(L){s={error:L}}finally{try{E&&!E.done&&(a=C.return)&&a.call(C)}finally{if(s)throw s.error}}try{for(var A=et(this.contextListeners),I=A.next();!I.done;I=A.next()){var T=I.value;T(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(L){u={error:L}}finally{try{I&&!I.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}if(this.state.done){var N=t.configuration.find(function(L){return L.type==="final"&&L.parent===g.machine}),M=N&&N.doneData?Pm(N.doneData,t.context,n):void 0;this._doneEvent=af(this.id,M);try{for(var R=et(this.doneListeners),k=R.next();!k.done;k=R.next()){var S=k.value;S(this._doneEvent)}}catch(L){f={error:L}}finally{try{k&&!k.done&&(h=R.return)&&h.call(R)}finally{if(f)throw f.error}}this._stop(),this._stopChildren(),xd.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===mn.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var o=this,s=sf(t,n,r);this.listeners.add(s.next),this.status!==mn.NotStarted&&s.next(this.state);var a=function(){o.doneListeners.delete(a),o.stopListeners.delete(a),s.complete()};return this.status===mn.Stopped?s.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){o.listeners.delete(s.next),o.doneListeners.delete(a),o.stopListeners.delete(a)}}},e.prototype.onEvent=function(t){return this.eventListeners.add(t),this},e.prototype.onSend=function(t){return this.sendListeners.add(t),this},e.prototype.onChange=function(t){return this.contextListeners.add(t),this},e.prototype.onStop=function(t){return this.stopListeners.add(t),this},e.prototype.onDone=function(t){return this.status===mn.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},e.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},e.prototype.start=function(t){var n=this;if(this.status===mn.Running)return this;this.machine._init(),xd.register(this.sessionId,this),this.initialized=!0,this.status=mn.Running;var r=t===void 0?this.initialState:mu(this,function(){return Bse(t)?n.machine.resolveState(t):n.machine.resolveState(co.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,Na)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){ft(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,o,s,a,u,c,f,h;try{for(var g=et(this.listeners),m=g.next();!m.done;m=g.next()){var v=m.value;this.listeners.delete(v)}}catch(R){t={error:R}}finally{try{m&&!m.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}try{for(var w=et(this.stopListeners),S=w.next();!S.done;S=w.next()){var v=S.value;v(),this.stopListeners.delete(v)}}catch(R){r={error:R}}finally{try{S&&!S.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}try{for(var C=et(this.contextListeners),E=C.next();!E.done;E=C.next()){var v=E.value;this.contextListeners.delete(v)}}catch(R){s={error:R}}finally{try{E&&!E.done&&(a=C.return)&&a.call(C)}finally{if(s)throw s.error}}try{for(var A=et(this.doneListeners),I=A.next();!I.done;I=A.next()){var v=I.value;this.doneListeners.delete(v)}}catch(R){u={error:R}}finally{try{I&&!I.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}if(!this.initialized)return this;this.initialized=!1,this.status=mn.Stopped,this._initialState=void 0;try{for(var T=et(Object.keys(this.delayedEventsMap)),N=T.next();!N.done;N=T.next()){var M=N.value;this.clock.clearTimeout(this.delayedEventsMap[M])}}catch(R){f={error:R}}finally{try{N&&!N.done&&(h=T.return)&&h.call(T)}finally{if(f)throw f.error}}this.scheduler.clear(),this.scheduler=new oD({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=t._state)===null||r===void 0)&&r.done)){var o=Dn({type:"xstate.stop"}),s=mu(t,function(){var a=Gt($t([],lt(t.state.configuration),!1).sort(function(g,m){return m.order-g.order}).map(function(g){return _s(g.onExit,t.machine.options.actions)})),u=lt(Ef(t.machine,t.state,t.state.context,o,[{type:"exit",actions:a}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),c=u[0],f=u[1],h=new co({value:t.state.value,context:f,_event:o,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:c.filter(function(g){return!V_(g)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return h.changed=!0,h});t.update(s,o),t._stopChildren(),xd.free(t.sessionId)}}),this},e.prototype.batch=function(t){var n=this;if(!(this.status===mn.NotStarted&&this.options.deferEvents)){if(this.status!==mn.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(t.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var o,s,a=n.state,u=!1,c=[],f=function(v){var w=Dn(v);n.forward(w),a=mu(n,function(){return n.machine.transition(a,w,void 0,r||void 0)}),c.push.apply(c,$t([],lt(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(S){return Hse(S,a)})),!1)),u=u||!!a.changed};try{for(var h=et(t),g=h.next();!g.done;g=h.next()){var m=g.value;f(m)}}catch(v){o={error:v}}finally{try{g&&!g.done&&(s=h.return)&&s.call(h)}finally{if(o)throw o.error}}a.changed=u,a.actions=c,n.update(a,Dn(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var o=Dn(t);if(o.name.indexOf(X3)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(X3)===0}))throw o.data.data;var s=mu(this,function(){return r.machine.transition(r.state,o,void 0,n||void 0)});return s},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var o=et(this.forwardTo),s=o.next();!s.done;s=o.next()){var a=s.value,u=this.children.get(a);if(!u)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));u.send(t)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),ft(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==mn.Running)return wI(t,n);if(tD(t))return this.spawnPromise(Promise.resolve(t),n);if(ft(t))return this.spawnCallback(t,n);if(Use(t))return this.spawnActor(t,n);if(Rse(t))return this.spawnObservable(t,n);if(Hu(t))return this.spawnMachine(t,ce(ce({},r),{id:n}));if(_se(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var o=new e(t,ce(ce({},this.options),{parent:this,id:n.id||t.id})),s=ce(ce({},G_),n);s.sync&&o.onTransition(function(u){r.send(bI,{state:u,id:o.id})});var a=o;return this.children.set(o.id,a),s.autoForward&&this.forwardTo.add(o.id),o.onDone(function(u){r.removeChild(o.id),r.send(Dn(u,{origin:o.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=Kse(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,o=this,s=!1,a;t.then(function(c){s||(a=c,o.removeChild(n),o.send(Dn(af(n,c),{origin:n})))},function(c){if(!s){o.removeChild(n);var f=wu(n,c);try{o.send(Dn(f,{origin:n}))}catch{o.devTools&&o.devTools.send(f,o.state),o.machine.strict&&o.stop()}}});var u=(r={id:n,send:function(){},subscribe:function(c,f,h){var g=sf(c,f,h),m=!1;return t.then(function(v){m||(g.next(v),!m&&g.complete())},function(v){m||g.error(v)}),{unsubscribe:function(){return m=!0}}},stop:function(){s=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[Ti]=function(){return this},r);return this.children.set(n,u),u},e.prototype.spawnCallback=function(t,n){var r,o=this,s=!1,a=new Set,u=new Set,c,f=function(m){c=m,u.forEach(function(v){return v(m)}),!s&&o.send(Dn(m,{origin:n}))},h;try{h=t(f,function(m){a.add(m)})}catch(m){this.send(wu(n,m))}if(tD(h))return this.spawnPromise(h,n);var g=(r={id:n,send:function(m){return a.forEach(function(v){return v(m)})},subscribe:function(m){var v=sf(m);return u.add(v.next),{unsubscribe:function(){u.delete(v.next)}}},stop:function(){s=!0,ft(h)&&h()},toJSON:function(){return{id:n}},getSnapshot:function(){return c}},r[Ti]=function(){return this},r);return this.children.set(n,g),g},e.prototype.spawnObservable=function(t,n){var r,o=this,s,a=t.subscribe(function(c){s=c,o.send(Dn(c,{origin:n}))},function(c){o.removeChild(n),o.send(Dn(wu(n,c),{origin:n}))},function(){o.removeChild(n),o.send(Dn(af(n),{origin:n}))}),u=(r={id:n,send:function(){},subscribe:function(c,f,h){return t.subscribe(c,f,h)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return s},toJSON:function(){return{id:n}}},r[Ti]=function(){return this},r);return this.children.set(n,u),u},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(n){var r=n(this.state.context,t);this.spawnEffect(t.id,r)}},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[Ti]=function(){return this},r))},e.prototype.attachDev=function(){var t=CI();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(ce(ce({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:ce({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}Gse(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Ti]=function(){return this},e.prototype.getSnapshot=function(){return this.status===mn.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=W$,e})(),Yse=function(e){return dt(e)?ce(ce({},G_),{name:e}):ce(ce(ce({},G_),{name:Ose()}),e)};function Ad(e,t){var n=Yse(t);return kse(function(r){return r?r.spawn(e,n.name,n):wI(e,n.name)})}function W$(e,t){var n=new Zse(e,t);return n}function Qse(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Yp(e){return ce(ce({type:B_},e),{toJSON:function(){e.onDone,e.onError;var t=mI(e,["onDone","onError"]);return ce(ce({},t),{type:B_,src:Qse(e.src)})}})}var Qp="",K_="#",Iw="*",ou={},su=function(e){return e[0]===K_},Xse=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},Jse=(function(){function e(t,n,r,o){r===void 0&&(r="context"in t?t.context:void 0);var s=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(Xse(),n),this.parent=o?.parent,this.key=this.config.key||o?.key||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:S$),this.id=this.config.id||$t([this.machine.key],lt(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?Wd(this.config.states,function(f,h){var g,m=new e(f,{},void 0,{parent:s,key:h});return Object.assign(s.idMap,ce((g={},g[m.id]=m,g),m.idMap)),m}):ou;var u=0;function c(f){var h,g;f.order=u++;try{for(var m=et(B$(f)),v=m.next();!v.done;v=m.next()){var w=v.value;c(w)}}catch(S){h={error:S}}finally{try{v&&!v.done&&(g=m.return)&&g.call(m)}finally{if(h)throw h.error}}}c(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(f){var h=f.event;return h===Qp}):Qp in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=uo(this.config.entry||this.config.onEntry).map(function(f){return qu(f)}),this.onExit=uo(this.config.exit||this.config.onExit).map(function(f){return qu(f)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=uo(this.config.invoke).map(function(f,h){var g,m;if(Hu(f)){var v=Zp(s.id,h);return s.machine.options.services=ce((g={},g[v]=f,g),s.machine.options.services),Yp({src:v,id:v})}else if(dt(f.src)){var v=f.id||Zp(s.id,h);return Yp(ce(ce({},f),{id:v,src:f.src}))}else if(Hu(f.src)||ft(f.src)){var v=f.id||Zp(s.id,h);return s.machine.options.services=ce((m={},m[v]=f.src,m),s.machine.options.services),Yp(ce(ce({id:v},f),{src:v}))}else{var w=f.src;return Yp(ce(ce({id:Zp(s.id,h)},f),{src:w}))}}),this.activities=uo(this.config.activities).concat(this.invoke).map(function(f){return dy(f)}),this.transition=this.transition.bind(this),this.tags=uo(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||H$(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,o=r.actions,s=r.activities,a=r.guards,u=r.services,c=r.delays;return new e(this.config,{actions:ce(ce({},o),t.actions),activities:ce(ce({},s),t.activities),guards:ce(ce({},a),t.guards),services:ce(ce({},u),t.services),delays:ce(ce({},c),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return ft(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Wd(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===Qp,r=this.transitions.filter(function(o){var s=o.eventType===t;return n?s:s||o.eventType===Iw});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(s,a){var u=ft(s)?"".concat(t.id,":delay[").concat(a,"]"):s,c=F$(u,t.id);return t.onEntry.push(fy(c,{delay:s})),t.onExit.push(N$(c)),c},o=vc(n)?n.map(function(s,a){var u=r(s.delay,a);return ce(ce({},s),{event:u})}):Gt(Object.keys(n).map(function(s,a){var u=n[s],c=dt(u)?{target:u}:u,f=isNaN(+s)?s:+s,h=r(f,a);return uo(c).map(function(g){return ce(ce({},g),{event:h,delay:f})})}));return o.map(function(s){var a=s.delay;return ce(ce({},t.formatTransition(s)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var o=t instanceof co?t.value:of(t,this.delimiter);if(dt(o)){var s=this.getStateNode(o).initial;return s!==void 0?this.getStateNodes((n={},n[o]=s,n)):[this,this.states[o]]}var a=Object.keys(o),u=[this];return u.push.apply(u,$t([],lt(Gt(a.map(function(c){return r.getStateNode(c).getStateNodes(o[c])}))),!1)),u},e.prototype.handles=function(t){var n=w$(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof co?t:co.create(t),r=Array.from(Kd([],this.getStateNodes(n.value)));return new co(ce(ce({},n),{value:this.resolve(n.value),configuration:r,done:sm(r,this),tags:rD(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var o=this.getStateNode(t),s=o.next(n,r);return!s||!s.transitions.length?this.next(n,r):s},e.prototype.transitionCompoundNode=function(t,n,r){var o=Object.keys(t),s=this.getStateNode(o[0]),a=s._transition(t[o[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var o,s,a={};try{for(var u=et(Object.keys(t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=t[f];if(h){var g=this.getStateNode(f),m=g._transition(h,n,r);m&&(a[f]=m)}}}catch(E){o={error:E}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}var v=Object.keys(a).map(function(E){return a[E]}),w=Gt(v.map(function(E){return E.transitions})),S=v.some(function(E){return E.transitions.length>0});if(!S)return this.next(n,r);var C=Gt(Object.keys(a).map(function(E){return a[E].configuration}));return{transitions:w,exitSet:Gt(v.map(function(E){return E.exitSet})),configuration:C,source:n,actions:Gt(Object.keys(a).map(function(E){return a[E].actions}))}},e.prototype._transition=function(t,n,r){return dt(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,Dn(n))},e.prototype.next=function(t,n){var r,o,s=this,a=n.name,u=[],c=[],f;try{for(var h=et(this.getCandidates(a)),g=h.next();!g.done;g=h.next()){var m=g.value,v=m.cond,w=m.in,S=t.context,C=w?dt(w)&&su(w)?t.matches(of(this.getStateNodeById(w).path,this.delimiter)):SI(of(w,this.delimiter),wse(this.path.slice(0,-2))(t.value)):!0,E=!1;try{E=!v||x$(this.machine,v,S,n,t)}catch(T){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
19
19
|
`).concat(T.message))}if(E&&C){m.target!==void 0&&(c=m.target),u.push.apply(u,$t([],lt(m.actions),!1)),f=m;break}}}catch(T){r={error:T}}finally{try{g&&!g.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}if(f){if(!c.length)return{transitions:[f],exitSet:[],configuration:t.value?[this]:[],source:t,actions:u};var A=Gt(c.map(function(T){return s.getRelativeStateNodes(T,t.historyValue)})),I=!!f.internal;return{transitions:[f],exitSet:I?[]:Gt(c.map(function(T){return s.getPotentiallyReenteringNodes(T)})),configuration:A,source:t,actions:u}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,o=t;r&&r!==o;)n.push(r),r=r.parent;return r!==o?[]:(n.push(o),n)},e.prototype.getActions=function(t,n,r,o,s,a,u){var c,f,h,g,m=this,v=a?Kd([],this.getStateNodes(a.value)):[],w=new Set;try{for(var S=et(Array.from(t).sort(function(F,D){return F.order-D.order})),C=S.next();!C.done;C=S.next()){var E=C.value;(!Zd(v,E)||Zd(r.exitSet,E)||E.parent&&w.has(E.parent))&&w.add(E)}}catch(F){c={error:F}}finally{try{C&&!C.done&&(f=S.return)&&f.call(S)}finally{if(c)throw c.error}}try{for(var A=et(v),I=A.next();!I.done;I=A.next()){var E=I.value;(!Zd(t,E)||Zd(r.exitSet,E.parent))&&r.exitSet.push(E)}}catch(F){h={error:F}}finally{try{I&&!I.done&&(g=A.return)&&g.call(A)}finally{if(h)throw h.error}}r.exitSet.sort(function(F,D){return D.order-F.order});var T=Array.from(w).sort(function(F,D){return F.order-D.order}),N=new Set(r.exitSet),M=Gt(T.map(function(F){var D=[];if(F.type!=="final")return D;var j=F.parent;if(!j.parent)return D;D.push(Gd(F.id,F.doneData),Gd(j.id,F.doneData?Pm(F.doneData,o,s):void 0));var Z=j.parent;return Z.type==="parallel"&&_f(Z).every(function(he){return sm(r.configuration,he)})&&D.push(Gd(Z.id)),D})),R=T.map(function(F){var D=F.onEntry,j=F.activities.map(function(Z){return k$(Z)});return{type:"entry",actions:_s(u?$t($t([],lt(D),!1),lt(j),!1):$t($t([],lt(j),!1),lt(D),!1),m.machine.options.actions)}}).concat({type:"state_done",actions:M.map(function(F){return I$(F)})}),k=Array.from(N).map(function(F){return{type:"exit",actions:_s($t($t([],lt(F.onExit),!1),lt(F.activities.map(function(D){return D$(D)})),!1),m.machine.options.actions)}}),L=k.concat({type:"transition",actions:_s(r.actions,this.machine.options.actions)}).concat(R);if(n){var q=_s(Gt($t([],lt(t),!1).sort(function(F,D){return D.order-F.order}).map(function(F){return F.onExit})),this.machine.options.actions).filter(function(F){return!V_(F)});return L.concat({type:"stop",actions:q})}return L},e.prototype.transition=function(t,n,r,o){t===void 0&&(t=this.initialState);var s=Dn(n),a;if(t instanceof co)a=r===void 0?t:this.resolveState(co.from(t,r));else{var u=dt(t)?this.resolve(Mm(this.getResolvedPath(t))):this.resolve(t),c=r??this.machine.context;a=this.resolveState(co.from(u,c))}if(this.strict&&!this.events.includes(s.name)&&!Ese(s.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(s.name,"'"));var f=this._transition(a.value,a,s)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},h=Kd([],this.getStateNodes(a.value)),g=f.configuration.length?Kd(h,f.configuration):h;return f.configuration=$t([],lt(g),!1),this.resolveTransition(f,a,a.context,o,s)},e.prototype.resolveRaisedTransition=function(t,n,r,o){var s,a=t.actions;return t=this.transition(t,n,void 0,o),t._event=r,t.event=r.data,(s=t.actions).unshift.apply(s,$t([],lt(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,o,s){var a,u,c,f,h=this;s===void 0&&(s=Na);var g=t.configuration,m=!n||t.transitions.length>0,v=m?t.configuration:n?n.configuration:[],w=sm(v,this),S=m?$se(this.machine,g):void 0,C=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,E=this.getActions(new Set(v),w,t,r,s,n,o),A=n?ce({},n.activities):{};try{for(var I=et(E),T=I.next();!T.done;T=I.next()){var N=T.value;try{for(var M=(c=void 0,et(N.actions)),R=M.next();!R.done;R=M.next()){var k=R.value;k.type===j_?A[k.activity.id||k.activity.type]=k:k.type===vI&&(A[k.activity.id||k.activity.type]=!1)}}catch(oe){c={error:oe}}finally{try{R&&!R.done&&(f=M.return)&&f.call(M)}finally{if(c)throw c.error}}}}catch(oe){a={error:oe}}finally{try{T&&!T.done&&(u=I.return)&&u.call(I)}finally{if(a)throw a.error}}var L=lt(Ef(this,n,r,s,E,o,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),q=L[0],F=L[1],D=lt(xse(q,V_),2),j=D[0],Z=D[1],he=q.filter(function(oe){var fe;return oe.type===j_&&((fe=oe.activity)===null||fe===void 0?void 0:fe.type)===B_}),B=he.reduce(function(oe,fe){return oe[fe.activity.id]=Dse(fe.activity,h.machine,F,s),oe},n?ce({},n.children):{}),Q=new co({value:S||n.value,context:F,_event:s,_sessionid:n?n._sessionid:null,historyValue:S?C?Ase(C,S):void 0:n?n.historyValue:void 0,history:!S||t.source?n:void 0,actions:S?Z:[],activities:S?A:n?n.activities:{},events:[],configuration:v,transitions:t.transitions,children:B,done:w,tags:rD(v),machine:this}),ae=r!==F;Q.changed=s.name===bI||ae;var ue=Q.history;ue&&delete ue.history;var we=!w&&(this._transient||g.some(function(oe){return oe._transient}));if(!m&&(!we||s.name===Qp))return Q;var U=Q;if(!w)for(we&&(U=this.resolveRaisedTransition(U,{type:pse},s,o));j.length;){var X=j.shift();U=this.resolveRaisedTransition(U,X._event,s,o)}var ie=U.changed||(ue?!!U.actions.length||ae||typeof ue.value!=typeof U.value||!V$(U.value,ue.value):void 0);return U.changed=ie,U.history=ue,U},e.prototype.getStateNode=function(t){if(su(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=su(t)?t.slice(K_.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&su(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=q_(t,this.delimiter).slice(),r=this;n.length;){var o=n.shift();if(!o.length)break;r=r.getStateNode(o)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||ou;switch(this.type){case"parallel":return Wd(this.initialStateValue,function(s,a){return s?r.getStateNode(a).resolve(t[a]||s):ou});case"compound":if(dt(t)){var o=this.getStateNode(t);return o.type==="parallel"||o.type==="compound"?(n={},n[t]=o.initialStateValue,n):t}return Object.keys(t).length?Wd(t,function(s,a){return s?r.getStateNode(a).resolve(s):ou}):this.initialStateValue||{};default:return t||ou}},e.prototype.getResolvedPath=function(t){if(su(t)){var n=this.machine.idMap[t.slice(K_.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return q_(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=eD(this.states,function(r){return r.initialStateValue||ou},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=Dm(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;dt(n.target)?t=su(n.target)?Mm(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(Dm(this))return[this];if(this.type==="compound"&&!this.initial)return[this];var n=om(this.initialStateValue);return Gt(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=lt(t),r=n[0],o=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var s=this.getStateNode(r);if(s.type==="history")return s.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(o)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:eD(this.states,function(n,r){if(!t)return n.historyValue();var o=dt(t)?void 0:t[r];return n.historyValue(o||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var o=this.target;return o?Gt(om(o).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var s=Cse(r.path,"states")(t).current;return dt(s)?[r.getStateNode(s)]:Gt(om(s).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=Gt(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,o;if(this.__cache.events)return this.__cache.events;var s=this.states,a=new Set(this.ownEvents);if(s)try{for(var u=et(Object.keys(s)),c=u.next();!c.done;c=u.next()){var f=c.value,h=s[f];if(h.states)try{for(var g=(r=void 0,et(h.events)),m=g.next();!m.done;m=g.next()){var v=m.value;a.add("".concat(v))}}catch(w){r={error:w}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}}}catch(w){t={error:w}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!dt(r))return r;var o=r[0]===n.delimiter;if(o&&!n.parent)return n.getStateNodeByPath(r.slice(1));var s=o?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(s);return a}catch(u){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
20
20
|
`).concat(u.message))}else return n.getStateNodeByPath(s)})},e.prototype.formatTransition=function(t){var n=this,r=Mse(t.target),o="internal"in t?t.internal:r?r.some(function(c){return dt(c)&&c[0]===n.delimiter}):!0,s=this.machine.options.guards,a=this.resolveTarget(r),u=ce(ce({},t),{actions:_s(uo(t.actions)),cond:_$(t.cond,s),target:a,source:this,internal:o,eventType:t.event,toJSON:function(){return ce(ce({},u),{target:u.target?u.target.map(function(c){return"#".concat(c.id)}):void 0,source:"#".concat(n.id)})}});return u},e.prototype.formatTransitions=function(){var t,n,r=this,o;if(!this.config.on)o=[];else if(Array.isArray(this.config.on))o=this.config.on;else{var s=this.config.on,a=Iw,u=s[a],c=u===void 0?[]:u,f=mI(s,[typeof a=="symbol"?a:a+""]);o=Gt(Object.keys(f).map(function(A){var I=ru(A,f[A]);return I}).concat(ru(Iw,c)))}var h=this.config.always?ru("",this.config.always):[],g=this.config.onDone?ru(String(Gd(this.id)),this.config.onDone):[],m=Gt(this.invoke.map(function(A){var I=[];return A.onDone&&I.push.apply(I,$t([],lt(ru(String(af(A.id)),A.onDone)),!1)),A.onError&&I.push.apply(I,$t([],lt(ru(String(wu(A.id)),A.onError)),!1)),I})),v=this.after,w=Gt($t($t($t($t([],lt(g),!1),lt(m),!1),lt(o),!1),lt(h),!1).map(function(A){return uo(A).map(function(I){return r.formatTransition(I)})}));try{for(var S=et(v),C=S.next();!C.done;C=S.next()){var E=C.value;w.push(E)}}catch(A){t={error:A}}finally{try{C&&!C.done&&(n=S.return)&&n.call(S)}finally{if(t)throw t.error}}return w},e})();function yc(e,t){return new Jse(e,t)}var vs=U$,hy=M$,eie=$$,tie=_.useLayoutEffect;function sD(e){var t=_.useRef();return t.current||(t.current={v:e()}),t.current.v}var Lm=function(){return Lm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Lm.apply(this,arguments)},nie=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},rie=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(u){a={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s};function oie(e,t){var n=sD(function(){return typeof e=="function"?e():e}),r=t.context,o=t.guards,s=t.actions,a=t.activities,u=t.services,c=t.delays;t.state;var f=nie(t,["context","guards","actions","activities","services","delays","state"]),h=sD(function(){var g={context:r,guards:o,actions:s,activities:a,services:u,delays:c},m=n.withConfig(g,function(){return Lm(Lm({},n.context),r)});return W$(m,f)});return tie(function(){Object.assign(h.machine.options.actions,s),Object.assign(h.machine.options.guards,o),Object.assign(h.machine.options.activities,a),Object.assign(h.machine.options.services,u),Object.assign(h.machine.options.delays,c)},[s,o,a,u,c]),h}function sie(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=rie(t,2),o=r[0],s=o===void 0?{}:o,a=r[1],u=oie(e,s);return _.useEffect(function(){if(a){var c=u.subscribe(sf(a));return function(){c.unsubscribe()}}},[a]),_.useEffect(function(){var c=s.state;return u.start(c?co.create(c):void 0),function(){u.stop(),u.status=mn.NotStarted}},[]),u}function iie(e){return e.status!==0?e.getSnapshot():e.machine.initialState}function aie(e){return"state"in e&&"machine"in e}function lie(e){return"state"in e}var uie=function(e,t){return e===t},cie=function(e,t){if(aie(e)){if(e.status===0&&t.current)return t.current;var n=iie(e);return t.current=e.status===0?n:null,n}return lie(e)?e.state:void 0};function die(e,t,n,r){n===void 0&&(n=uie);var o=_.useRef(null),s=_.useCallback(function(c){var f=e.subscribe(c).unsubscribe;return f},[e]),a=_.useCallback(function(){return cie(e,o)},[e,r]),u=v$.useSyncExternalStoreWithSelector(s,a,a,t,n);return u}const fie=e=>{if(e instanceof Qr)return e;if(e instanceof Error){if(e.name==="InvalidStateError"){const{message:t,recoverySuggestion:n}=Fu[It.PasskeyAlreadyExists];return new Qr({name:It.PasskeyAlreadyExists,message:t,recoverySuggestion:n,underlyingError:e})}if(e.name==="NotAllowedError"){const{message:t,recoverySuggestion:n}=Fu[It.PasskeyRegistrationCanceled];return new Qr({name:It.PasskeyRegistrationCanceled,message:t,recoverySuggestion:n,underlyingError:e})}}return L8(e)},hie=async e=>{try{const t=U8();uc(t,It.PasskeyNotSupported);const n=PZ(e),r=await navigator.credentials.create({publicKey:n});return UZ(r),NZ(r)}catch(t){throw fie(t)}},pie=e=>fn(xn,_n("StartWebAuthnRegistration"),Un(),{...An,...e}),gie=e=>fn(xn,_n("CompleteWebAuthnRegistration"),Un(),{...An,...e});async function mie(){const e=Tt.getConfig().Auth?.Cognito;We(e);const{userPoolEndpoint:t,userPoolId:n}=e,{tokens:r}=await Uv();lc(r);const o=pie({endpointResolver:rt({endpointOverride:t})}),{CredentialCreationOptions:s}=await o({region:nt(n),userAgentValue:vt(Fe.StartWebAuthnRegistration)},{AccessToken:r.accessToken.toString()});LZ(s);const a=await hie(s);await gie({endpointResolver:rt({endpointOverride:t})})({region:nt(n),userAgentValue:vt(Fe.CompleteWebAuthnRegistration)},{AccessToken:r.accessToken.toString(),Credential:a})}const vie=e=>fn(xn,_n("ListWebAuthnCredentials"),Un(),{...An,...e});async function yie(e,t){const n=e.getConfig().Auth?.Cognito;We(n);const{userPoolEndpoint:r,userPoolId:o}=n,{tokens:s}=await e.Auth.fetchAuthSession();lc(s);const a=vie({endpointResolver:rt({endpointOverride:r})}),{Credentials:u=[],NextToken:c}=await a({region:nt(o),userAgentValue:vt(Fe.ListWebAuthnCredentials)},{AccessToken:s.accessToken.toString(),MaxResults:t?.pageSize,NextToken:t?.nextToken});return{credentials:u.map(h=>({credentialId:h.CredentialId,friendlyCredentialName:h.FriendlyCredentialName,relyingPartyId:h.RelyingPartyId,authenticatorAttachment:h.AuthenticatorAttachment,authenticatorTransports:h.AuthenticatorTransports,createdAt:h.CreatedAt?new Date(h.CreatedAt*1e3):void 0})),nextToken:c}}async function EI(e){return yie(Tt,e)}const _I=e=>e.context.actorRef?.getSnapshot(),xf=e=>_I(e)?.context,bie={category:Jr.AI,apis:[ws.CreateConversation,ws.DeleteConversation,ws.ListConversations,ws.UpdateConversation,ws.OnMessage,ws.SendMessage,ws.Generation]},Sie={apis:[Fe.DeleteUser,Fe.UpdatePassword],category:Jr.Auth},wie={apis:[Fe.SignUp,Fe.ConfirmSignUp,Fe.ResendSignUpCode,Fe.SignIn,Fe.ConfirmSignIn,Fe.FetchUserAttributes,Fe.SignOut,Fe.ResetPassword,Fe.ConfirmResetPassword,Fe.SignInWithRedirect],category:Jr.Auth},Cie={apis:[fo.UploadData],category:Jr.Storage},Eie={apis:[v_.NotifyMessageInteraction],category:Jr.InAppMessaging},_ie={category:Jr.Geo,apis:[tf.SearchByText,tf.SearchForSuggestions,tf.SearchByPlaceId]},xie={category:Jr.Geo,apis:[]},Aie={apis:[fo.UploadData],category:Jr.Storage},Iie={apis:[fo.UploadData,fo.Copy,fo.GetUrl,fo.List,fo.Remove,fo.GetDataAccess,fo.ListCallerAccessGrants],category:Jr.Storage};function Or(e){return e!=null&&!Array.isArray(e)&&typeof e=="object"}function Ps(e){return typeof e=="string"||typeof e=="object"&&Object.prototype.toString.call(e)==="[object String]"}function Rie(e){return Or(e)&&Object.prototype.toString.call(e)==="[object Map]"}function Tie(e){return Or(e)&&Object.prototype.toString.call(e)==="[object Set]"}function xI(e){if(e==null)return!0;if(Or(e)&&(Rie(e)||Tie(e)))return!e.size;if(Or(e)&&(Ps(e)||Array.isArray(e)))return!e.length;for(const t in e)if(Ns(e,t))return!1;return!0}function Oie(e){return Array.isArray(e)&&xI(e)}function Mie(...e){return e.every(Oie)}function G$(e){return Or(e)&&xI(e)}function Pie(...e){return e.every(G$)}function Ns(e,t){return e!=null&&Object.prototype.hasOwnProperty.call(e,t)}function ks(e){return typeof e=="function"}const Rt=(e,t)=>t?`${e}--${t}`:"",ur=(e,t,n)=>n?`${e}--${t}`:"";function Nie(...e){}function kie(e,t){const n={},r={};return Object.entries(e).forEach(([o,s])=>{t(o)?n[o]=s:r[o]=s}),[n,r]}const K$=({payload:e},t,n)=>{const{data:r,event:o}=e,{send:s}=t,{onSignIn:a,onSignOut:u}=n??{};switch(o){case"signedIn":{ks(a)&&a(e);break}case"signInWithRedirect":{s("SIGN_IN_WITH_REDIRECT");break}case"signedOut":{ks(u)&&u(),s("SIGN_OUT");break}case"tokenRefresh_failure":{if(r?.error?.name===$i.NetworkError)return;s("SIGN_OUT");break}}},Die=(e,t=K$)=>{const n=r=>t(r,e);return zo.listen("auth",n,"authenticator-hub-handler")},Z$=["+1","+7","+20","+27","+30","+31","+32","+33","+34","+36","+39","+40","+41","+43","+44","+45","+46","+47","+48","+49","+51","+52","+53","+54","+55","+56","+57","+58","+60","+61","+62","+63","+64","+65","+66","+81","+82","+84","+86","+90","+91","+92","+93","+94","+95","+98","+212","+213","+216","+218","+220","+221","+222","+223","+224","+225","+226","+227","+228","+229","+230","+231","+232","+233","+234","+235","+236","+237","+238","+239","+240","+241","+242","+243","+244","+245","+246","+248","+249","+250","+251","+252","+253","+254","+255","+256","+257","+258","+260","+261","+262","+263","+264","+265","+266","+267","+268","+269","+290","+291","+297","+298","+299","+345","+350","+351","+352","+353","+354","+355","+356","+357","+358","+359","+370","+371","+372","+373","+374","+375","+376","+377","+378","+379","+380","+381","+382","+385","+386","+387","+389","+420","+421","+423","+500","+501","+502","+503","+504","+505","+506","+507","+508","+509","+537","+590","+591","+593","+594","+595","+596","+597","+598","+599","+670","+672","+673","+674","+675","+676","+677","+678","+679","+680","+681","+682","+683","+685","+686","+687","+688","+689","+690","+691","+692","+850","+852","+853","+855","+856","+872","+880","+886","+960","+961","+962","+963","+964","+965","+966","+967","+968","+970","+971","+972","+973","+974","+975","+976","+977","+992","+993","+994","+995","+996","+998"],py={birthdate:{label:"Birthdate",placeholder:"Enter your Birthdate",type:"date",autocomplete:"bday",isRequired:!0},confirmation_code:{label:"Confirmation Code",placeholder:"Enter your Confirmation Code",type:"text",autocomplete:"one-time-code",isRequired:!0},confirm_password:{label:"Confirm Password",placeholder:"Please confirm your Password",type:"password",autocomplete:"new-password",isRequired:!0},email:{label:"Email",placeholder:"Enter your Email",type:"email",autocomplete:"username",isRequired:!0},family_name:{label:"Family Name",placeholder:"Enter your Family Name",type:"text",autocomplete:"family-name",isRequired:!0},given_name:{label:"Given Name",placeholder:"Enter your Given Name",type:"text",autocomplete:"given-name",isRequired:!0},middle_name:{label:"Middle Name",placeholder:"Enter your Middle Name",type:"text",autocomplete:"additional-name",isRequired:!0},name:{label:"Name",placeholder:"Enter your Name",type:"text",autocomplete:"name",isRequired:!0},nickname:{label:"Nickname",placeholder:"Enter your Nickname",type:"text",autocomplete:"tel",isRequired:!0},password:{label:"Password",placeholder:"Enter your Password",type:"password",autocomplete:"new-password",isRequired:!0},phone_number:{label:"Phone Number",placeholder:"Enter your Phone Number",type:"tel",autocomplete:"tel",dialCode:"+1",dialCodeList:Z$,isRequired:!0},preferred_username:{label:"Preferred Username",placeholder:"Enter your Preferred Username",type:"text",isRequired:!0},profile:{label:"Profile",placeholder:"Add your Profile",type:"url",autocomplete:"url",isRequired:!0},website:{label:"Website",placeholder:"Add your Website",type:"url",autocomplete:"url",isRequired:!0},username:{label:"Username",placeholder:"Enter your Username",type:"text",autocomplete:"username",isRequired:!0}},Lie=["^","$","*",".","[","]","{","}","(",")","?",'"',"!","@","#","%","&","/","\\",",",">","<","'",":",";","|","_","~","`","=","+","-"," "],Uie=(e,t)=>{if(t?.matches("federatedSignIn")){if(e.matches("signUpActor"))return"signUp";if(e.matches("signInActor"))return"signIn"}switch(!0){case e.matches("idle"):return"idle";case e.matches("setup"):return"setup";case e.matches("signOut"):return"signOut";case e.matches("authenticated"):return"authenticated";case t?.matches("confirmSignUp"):case t?.matches("resendSignUpCode"):return"confirmSignUp";case t?.matches("confirmSignIn"):return"confirmSignIn";case t?.matches("setupTotp.edit"):case t?.matches("setupTotp.submit"):return"setupTotp";case t?.matches("signIn.submit"):return t?.context.selectedAuthMethod!=null?"signInSelectAuthFactor":"signIn";case t?.matches("signIn.selectMethod"):return"signInSelectAuthFactor";case t?.matches("passkeyPrompt"):return"passkeyPrompt";case t?.matches("signIn"):return"signIn";case t?.matches("signUp"):case t?.matches("autoSignIn"):return"signUp";case t?.matches("forceChangePassword"):return"forceNewPassword";case t?.matches("forgotPassword"):return"forgotPassword";case t?.matches("confirmResetPassword"):return"confirmResetPassword";case t?.matches("selectUserAttributes"):return"verifyUser";case t?.matches("confirmVerifyUserAttribute"):return"confirmVerifyUser";case t?.matches("setupEmail"):return"setupEmail";case t?.matches("selectMfaType"):return"selectMfaType";case e.matches("getCurrentUser"):case t?.matches("fetchUserAttributes"):return"transition";default:return null}},Fie=e=>{const t=n=>r=>e({type:n,data:r});return{initializeMachine:t("INIT"),resendCode:t("RESEND"),selectAuthMethod:t("SELECT_METHOD"),signOut:t("SIGN_OUT"),submitForm:t("SUBMIT"),toShowAuthMethods:t("SHOW_AUTH_METHODS"),updateForm:t("CHANGE"),updateBlur:t("BLUR"),toFederatedSignIn:t("FEDERATED_SIGN_IN"),toForgotPassword:t("FORGOT_PASSWORD"),toSignIn:t("SIGN_IN"),toSignUp:t("SIGN_UP"),skipVerification:t("SKIP")}},$ie=e=>{const t=xf(e)??{},{allowedMfaTypes:n,availableAuthMethods:r,challengeName:o,codeDeliveryDetails:s,preferredChallenge:a,remoteError:u,selectedAuthMethod:c,validationError:f,totpSecretCode:h=null,unverifiedUserAttributes:g,username:m}=t,{socialProviders:v=[],loginMechanisms:w}=e.context?.config??{},S=w?.[0],C=t?.user??e.context?.user,E=!!(f&&Object.keys(f).length>0),A=_I(e),I=e.hasTag("pending")||A?.hasTag("pending"),T=Uie(e,A),N=(R=>{switch(R){case"idle":case"setup":return"configuring";case"authenticated":return"authenticated";default:return"unauthenticated"}})(T);return{allowedMfaTypes:n,authStatus:N,availableAuthMethods:r,challengeName:o,codeDeliveryDetails:s,error:u,hasValidationErrors:E,isPending:I,loginMechanism:S,preferredChallenge:a,route:T,selectedAuthMethod:c,socialProviders:v,totpSecretCode:h,unverifiedUserAttributes:g,user:C,username:m,validationErrors:f}},zie=({send:e,state:t})=>{const n=Fie(e),r=$ie(t);return{...n,...r}};var Cu;(function(e){e.Apple="Apple",e.Amazon="Amazon",e.Facebook="Facebook",e.Google="Google"})(Cu||(Cu={}));var iD;(function(e){e.Email="email",e.PhoneNumber="phone_number"})(iD||(iD={}));const jie=["birthdate","email","family_name","given_name","middle_name","name","nickname","phone_number","preferred_username","profile","website"],Bie=["username","email","phone_number"],Y$=[...Bie,...jie,"confirmation_code","password","confirm_password"],Hie=e=>Y$.includes(e),Q$=e=>Y$.includes(e),qie=e=>Array.isArray(e),Vie=e=>e?qie(e)?e:[e]:null,Wie=e=>{const t=e.trim().split("");for(let n=0;n<t.length;n++)n>0&&n<t.length-1&&(t[n]="*");return t.join("")},Gie=e=>{if(e.length<4)return e;const t=e.split("");for(let n=0;n<t.length-4;n++)t[n]="*";return t.join("")},Kie=e=>{const t=e.split("@");return`${Wie(t[0])}@${t[1]}`},Zie=(e,t)=>e==="Phone Number"?Gie(t):Kie(t),Yie=e=>Lie.some(t=>e.includes(t)),Qie=(e,t,n)=>encodeURI(`otpauth://totp/${e}:${t}?secret=${n}&issuer=${e}`);function Xie(e,...t){return Object.entries(e).reduce((n,[r,o])=>({...n,[r]:t.includes(r)?o:o?.trim()}),{})}const Jie={ADD_PROFILE:"Add your Profile",ADD_WEBSITE:"Add your Website",BACK_SIGN_IN:"Back to Sign In",BIRTHDATE:"Birthdate",CHANGE_PASSWORD:"Change Password",CHANGING_PASSWORD:"Changing",CODE:"Code",CODE_ARRIVAL:"It may take a minute to arrive",CODE_EMAILED:"Your code is on the way. To log in, enter the code we emailed to",CODE_SENT:"Your code is on the way. To log in, enter the code we sent you",CODE_TEXTED:"Your code is on the way. To log in, enter the code we texted to",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Please confirm your Password",CONFIRM_RESET_PASSWORD_HEADING:"Reset your Password",CONFIRM_SIGNUP_HEADING:"Confirm Sign Up",CONFIRM_SMS:"Confirm SMS Code",CONFIRM_EMAIL:"Confirm Email Code",CONFIRM_MFA_DEFAULT:"Confirm MFA Code",CONFIRM_TOTP:"Confirm TOTP Code",CONFIRM:"Confirm",CONFIRMATION_CODE:"Confirmation Code",CONFIRMING:"Confirming",CONTINUE:"Continue",CONTINUE_WITHOUT_PASSKEY:"Continue without a Passkey",CREATE_ACCOUNT:"Create Account",CREATE_ACCOUNT_WITH_EMAIL_OTP:"Create account with Email OTP",CREATE_ACCOUNT_WITH_PASSWORD:"Create account with Password",CREATE_ACCOUNT_WITH_SMS_OTP:"Create account with SMS OTP",CREATE_PASSKEY:"Create a Passkey",CREATING_ACCOUNT:"Creating Account",EMAIL_ADDRESS:"Email",EMAIL_OTP:"Email Message",ENTER_BIRTHDATE:"Enter your Birthdate",ENTER_CODE:"Enter your code",ENTER_CONFIRMATION_CODE:"Enter your Confirmation Code",ENTER_EMAIL:"Enter your Email",ENTER_FAMILY_NAME:"Enter your Family Name",ENTER_GIVEN_NAME:"Enter your Given Name",ENTER_MIDDLE_NAME:"Enter your Middle Name",ENTER_NAME:"Enter your Name",ENTER_NICK_NAME:"Enter your Nickname",ENTER_PASSWORD:"Enter your Password",ENTER_PHONE_NUMBER:"Enter your Phone Number",ENTER_PREFERRED_USERNAME:"Enter your Preferred Username",ENTER_USERNAME:"Enter your username",ENTER_USERNAME_FIRST:"Please enter your username first",EXISTING_PASSKEYS:"Existing Passkeys",FAMILY_NAME:"Family Name",GIVEN_NAME:"Given Name",FORGOT_PASSWORD:"Forgot Password?",FORGOT_YOUR_PASSWORD:"Forgot your password?",HIDE_PASSWORD:"Hide password",LOADING:"Loading",LOGIN_NAME:"Username",MIDDLE_NAME:"Middle Name",MFA_SETUP_SELECTION:"Multi-Factor Authentication Setup",MFA_SELECTION:"Multi-Factor Authentication",NAME:"Name",NICKNAME:"Nickname",NEW_PASSWORD:"New password",OR:"or",OTHER_SIGN_IN_OPTIONS:"Other sign-in options",PASSKEY_AUTHENTICATION_CANCELED:"Passkey authentication was canceled. Please try again or use a different sign-in method.",PASSKEY_CREATED_SUCCESS:"Passkey created successfully!",PASSKEY_LABEL:"Passkey",PASSKEY_PROMPT_DESCRIPTION:"Passkeys are WebAuthn credentials that validate your identity using biometric data like touch or facial recognition or device authentication like passwords or PINs, serving as a secure password replacement.",PASSKEY_PROMPT_HEADING:"Sign in faster with Passkey",PASSKEY_REGISTERED:"Your passkey has been successfully registered.",PASSKEY_REGISTRATION_FAILED:"Failed to create passkey. Please try again.",PASSWORD:"Password",PASSWORDLESS_NOT_ENABLED:"Passwordless authentication is not enabled for this account. Please contact your administrator or use password sign-in.",PHONE_NUMBER:"Phone Number",PREFERRED_USERNAME:"Preferred Username",PROFILE:"Profile",REGISTERING:"Registering",RESEND_CODE:"Resend Code",RESET_PASSWORD_HEADING:"Reset your password",RESET_PASSWORD:"Reset Password",SEND_CODE:"Send code",CODE_DELIVERY_FAILED:"Unable to send verification code. Please try again.",VERIFICATION_CODE_EXPIRED:"Your verification code has expired. Please request a new code.",VERIFICATION_CODE_INVALID:"The verification code you entered is incorrect. Please try again.",SENDING:"Sending",SELECT_MFA_TYPE:"Select MFA Type",SETUP_ANOTHER_PASSKEY:"Setup another Passkey",SETUP_EMAIL:"Setup Email",SETUP_TOTP:"Setup TOTP",SHOW_PASSWORD:"Show password",SIGN_IN_BUTTON:"Sign in",SIGN_IN_TAB:"Sign In",SIGN_IN_WITH_AMAZON:"Sign In with Amazon",SIGN_IN_WITH_APPLE:"Sign In with Apple",SIGN_IN_WITH_EMAIL:"Sign In with Email",SIGN_IN_WITH_FACEBOOK:"Sign In with Facebook",SIGN_IN_WITH_GOOGLE:"Sign In with Google",SIGN_IN_WITH_PASSKEY:"Sign In with Passkey",SIGN_IN_WITH_PASSWORD:"Sign In with Password",SIGN_IN_WITH_SMS:"Sign In with SMS",SIGN_IN:"Sign in to your account",SIGN_UP_BUTTON:"Create a new account",SIGNING_IN_BUTTON:"Signing in",SKIP:"Skip",SMS_MFA:"Text Message (SMS)",SUBMIT:"Submit",SUBMITTING:"Submitting",SOFTWARE_TOKEN_MFA:"Authenticator App (TOTP)",UPPERCASE_COPY:"COPY",USERNAME:"Username",VERIFY_CONTACT:"Verify Contact",VERIFY_HEADING:"Account recovery requires verified contact information",VERIFY:"Verify",WE_EMAILED:"We Emailed You",WE_SENT_CODE:"We Sent A Code",WE_TEXTED:"We Texted You",WEBSITE:"Website"},im={...Jie},me={...im};function de(e){return x8.get(e)}const AI=e=>{const t=e?.context.config?.loginMechanisms,[n]=t??["username"];return n},eae=e=>{const t={...e};for(const[n,r]of Object.entries(e)){const{label:o,placeholder:s}=r;t[n]={...r,label:o?de(o):void 0,placeholder:s?de(s):void 0}}return t},tae=e=>Object.entries(e).sort((t,n)=>{const r=t[1].order||Number.MAX_VALUE,o=n[1].order||Number.MAX_VALUE;return r-o}).filter(t=>t[1]!==void 0),nae="+1",Ds=e=>{let t=py[e];const{type:n}=t;return n==="tel"&&(t={...t,dialCode:nae}),t},gy=e=>{const t=AI(e);return{...Ds(t),autocomplete:"username"}},am=e=>({confirmation_code:{...Ds("confirmation_code"),label:"Code *",placeholder:"Code"}}),rae=e=>{const t=e.context.actorRef?.getSnapshot()?.context,n=t?.availableAuthMethods,r=t?.preferredChallenge,o=!n?.length||n.length===1&&n[0]==="PASSWORD"||n.length>1&&(!r||r==="PASSWORD"),s={username:{...gy(e)}};return o&&(s.password={...Ds("password"),autocomplete:"current-password"}),s},oae=e=>{const{loginMechanisms:t,signUpAttributes:n}=e.context.config,r=AI(e),s=e.context.actorRef?.getSnapshot()?.context?.availableAuthMethods,a=s&&s.length>1,u=Array.from(new Set([...t,"password","confirm_password",...n])),c={};for(const f of u)if(Q$(f)){const h=f===r?gy(e):Ds(f),g=a&&(f==="email"||f==="phone_number"||f==="password"||f==="confirm_password");c[f]={...h,...g&&{isRequired:!1}}}else console.debug(`Authenticator does not have a default implementation for ${f}. Customize SignUp FormFields to add your own.`);return c},sae=e=>({confirmation_code:{...Ds("confirmation_code"),placeholder:"Enter your code"}}),iae=e=>{const t=AI(e),{label:n}=py[t];return{username:{...gy(e),label:`Enter your ${n.toLowerCase()}`,placeholder:`Enter your ${n.toLowerCase()}`}}},aae=e=>({...am(),password:{...Ds("password"),label:"New Password",placeholder:"New Password"},confirm_password:{...Ds("confirm_password"),label:"Confirm Password",placeholder:"Confirm Password"}}),lae=e=>{const t=_I(e),{missingAttributes:n}=t.context,r=Array.from(new Set(["password","confirm_password",...n??[]])),o={};for(const s of r)Q$(s)?o[s]={...Ds(s)}:console.debug(`Authenticator does not have a default implementation for ${s}. Customize ForceNewPassword FormFields to add your own.`);return o},uae=e=>({email:Ds("email")}),cae={signIn:rae,signUp:oae,confirmSignUp:sae,confirmSignIn:am,forceNewPassword:lae,forgotPassword:iae,confirmResetPassword:aae,confirmVerifyUser:am,setupEmail:uae,setupTotp:am},dae=(e,t)=>{const n=cae[e];return n(t)},fae=(e,t)=>{const n=xf(t)?.formFields?.[e];return!n||Object.keys(n).length===0?{}:Object.entries(n).reduce((r,[o,s])=>{if((e==="signIn"||e==="forgotPassword")&&o==="username"){const u={...gy(t),...s};return{...r,[o]:u}}else if(Hie(o)){const u={...py[o],...s};return{...r,[o]:u}}else return{...r,[o]:s}},{})},hae=(e,t)=>{const n=dae(e,t),r=fae(e,t),o={...n,...r};return delete o.QR,eae(o)},pae=e=>e.map(t=>{const n=t[0],r={...t[1],order:void 0};return[n,r]}),gae=(e,t)=>{const n=hae(e,t);return pae(tae(n))},mae=e=>{switch(e){case"EMAIL_OTP":return de(me.CONFIRM_EMAIL);case"SMS_MFA":return de(me.CONFIRM_SMS);case"SOFTWARE_TOKEN_MFA":return de(me.CONFIRM_TOTP);default:return de(me.CONFIRM_MFA_DEFAULT)}},vae=e=>{const{DeliveryMedium:t,Destination:n}=e??{},r=t==="EMAIL",o=t==="SMS",s=de(me.CODE_ARRIVAL);return r||o?`${de(r?me.CODE_EMAILED:me.CODE_TEXTED)} ${n}. ${s}.`:`${de(me.CODE_SENT)}. ${s}.`},yae=e=>{const{DeliveryMedium:t}=e??{},n=t==="EMAIL";return de(!n&&t==="SMS"?me.WE_SENT_CODE:n?me.WE_EMAILED:me.WE_TEXTED)},bae={amazon:"Amazon",apple:"Apple",facebook:"Facebook",google:"Google"},Sae=(e,t)=>de(`Sign ${e==="signIn"?"In":"Up"} with ${bae[t]}`),wae=e=>de(e==="MFA_SETUP"?me.MFA_SETUP_SELECTION:me.MFA_SELECTION),Cae=e=>{switch(e){case"email":return de(me.EMAIL_ADDRESS);case"phone_number":return de(me.PHONE_NUMBER);default:return de(me.USERNAME)}},Eae=e=>{switch(e){case"EMAIL":return de(im.EMAIL_OTP);case"SMS":return de(im.SMS_MFA);case"TOTP":return de(im.SOFTWARE_TOKEN_MFA);default:return de(e)}},bn={getBackToSignInText:()=>de(me.BACK_SIGN_IN),getChangePasswordText:()=>de(me.CHANGE_PASSWORD),getChangingText:()=>de(me.CHANGING_PASSWORD),getConfirmText:()=>de(me.CONFIRM),getConfirmingText:()=>de(me.CONFIRMING),getContinueText:()=>de(me.CONTINUE),getCopyText:()=>de(me.UPPERCASE_COPY),getHidePasswordText:()=>de(me.HIDE_PASSWORD),getLoadingText:()=>de(me.LOADING),getOrText:()=>de(me.OR),getResendCodeText:()=>de(me.RESEND_CODE),getSendCodeText:()=>de(me.SEND_CODE),getSendingText:()=>de(me.SENDING),getShowPasswordText:()=>de(me.SHOW_PASSWORD),getSubmitText:()=>de(me.SUBMIT),getSubmittingText:()=>de(me.SUBMITTING),getSignInTabText:()=>de(me.SIGN_IN_TAB),getSignUpTabText:()=>de(me.CREATE_ACCOUNT),getForgotPasswordText:e=>de(e?me.FORGOT_PASSWORD:me.FORGOT_YOUR_PASSWORD),getSigningInText:()=>de(me.SIGNING_IN_BUTTON),getSignInText:()=>de(me.SIGN_IN_BUTTON),getCreatingAccountText:()=>de(me.CREATING_ACCOUNT),getCreateAccountText:()=>de(me.CREATE_ACCOUNT),getCreateAccountWithEmailText:()=>de(me.CREATE_ACCOUNT_WITH_EMAIL_OTP),getCreateAccountWithPasswordText:()=>de(me.CREATE_ACCOUNT_WITH_PASSWORD),getCreateAccountWithSmsText:()=>de(me.CREATE_ACCOUNT_WITH_SMS_OTP),getDeliveryMessageText:vae,getDeliveryMethodText:yae,getChallengeText:mae,getResetYourPasswordText:()=>de(me.RESET_PASSWORD),getSetupEmailText:()=>de(me.SETUP_EMAIL),getSetupTotpText:()=>de(me.SETUP_TOTP),getSetupTotpInstructionsText:()=>de("Copy and paste the secret key below into an authenticator app and then enter the code in the text field below."),getCopiedText:()=>de("COPIED"),getSignInWithFederationText:Sae,getMfaTypeLabelByValue:Eae,getSelectMfaTypeByChallengeName:wae,getSelectMfaTypeText:()=>de(me.SELECT_MFA_TYPE),getSkipText:()=>de(me.SKIP),getVerifyText:()=>de(me.VERIFY),getVerifyContactText:()=>de(me.VERIFY_CONTACT),getAccountRecoveryInfoText:()=>de(me.VERIFY_HEADING),getPasskeyPromptHeadingText:()=>de(me.PASSKEY_PROMPT_HEADING),getPasskeyPromptDescriptionText:()=>de(me.PASSKEY_PROMPT_DESCRIPTION),getCreatePasskeyText:()=>de(me.CREATE_PASSKEY),getRegisteringText:()=>de(me.REGISTERING),getContinueWithoutPasskeyText:()=>de(me.CONTINUE_WITHOUT_PASSKEY),getPasskeyCreatedSuccessText:()=>de(me.PASSKEY_CREATED_SUCCESS),getPasskeyRegisteredText:()=>de(me.PASSKEY_REGISTERED),getPasskeyRegistrationFailedText:()=>de(me.PASSKEY_REGISTRATION_FAILED),getPasskeyLabelText:()=>de(me.PASSKEY_LABEL),getExistingPasskeysText:()=>de(me.EXISTING_PASSKEYS),getSetupAnotherPasskeyText:()=>de(me.SETUP_ANOTHER_PASSKEY),getSignInWithPasswordText:()=>de(me.SIGN_IN_WITH_PASSWORD),getSignInWithEmailText:()=>de(me.SIGN_IN_WITH_EMAIL),getSignInWithSmsText:()=>de(me.SIGN_IN_WITH_SMS),getSignInWithPasskeyText:()=>de(me.SIGN_IN_WITH_PASSKEY),getOtherSignInOptionsText:()=>de(me.OTHER_SIGN_IN_OPTIONS),getEnterUsernameFirstText:()=>de(me.ENTER_USERNAME_FIRST),getUsernameLabelByLoginMechanism:Cae,getInvalidEmailText:()=>de("Please enter a valid email"),getRequiredFieldText:()=>de("This field is required")};var Rw,aD;function X$(){if(aD)return Rw;aD=1;function e(t,n){for(var r=-1,o=t==null?0:t.length,s=Array(o);++r<o;)s[r]=n(t[r],r,t);return s}return Rw=e,Rw}var Tw,lD;function _ae(){if(lD)return Tw;lD=1;var e=cI(),t=m$(),n=1,r=2;function o(s,a,u,c){var f=u.length,h=f,g=!c;if(s==null)return!h;for(s=Object(s);f--;){var m=u[f];if(g&&m[2]?m[1]!==s[m[0]]:!(m[0]in s))return!1}for(;++f<h;){m=u[f];var v=m[0],w=s[v],S=m[1];if(g&&m[2]){if(w===void 0&&!(v in s))return!1}else{var C=new e;if(c)var E=c(w,S,v,s,a,C);if(!(E===void 0?t(S,w,n|r,c,C):E))return!1}}return!0}return Tw=o,Tw}var Ow,uD;function J$(){if(uD)return Ow;uD=1;var e=Bs();function t(n){return n===n&&!e(n)}return Ow=t,Ow}var Mw,cD;function xae(){if(cD)return Mw;cD=1;var e=J$(),t=g$();function n(r){for(var o=t(r),s=o.length;s--;){var a=o[s],u=r[a];o[s]=[a,u,e(u)]}return o}return Mw=n,Mw}var Pw,dD;function e9(){if(dD)return Pw;dD=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return Pw=e,Pw}var Nw,fD;function Aae(){if(fD)return Nw;fD=1;var e=_ae(),t=xae(),n=e9();function r(o){var s=t(o);return s.length==1&&s[0][2]?n(s[0][0],s[0][1]):function(a){return a===o||e(a,o,s)}}return Nw=r,Nw}var kw,hD;function II(){if(hD)return kw;hD=1;var e=mc(),t=al(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return kw=r,kw}var Dw,pD;function RI(){if(pD)return Dw;pD=1;var e=Hs(),t=II(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function o(s,a){if(e(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||t(s)?!0:r.test(s)||!n.test(s)||a!=null&&s in Object(a)}return Dw=o,Dw}var Lw,gD;function Iae(){if(gD)return Lw;gD=1;var e=uI(),t="Expected a function";function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var s=function(){var a=arguments,u=o?o.apply(this,a):a[0],c=s.cache;if(c.has(u))return c.get(u);var f=r.apply(this,a);return s.cache=c.set(u,f)||c,f};return s.cache=new(n.Cache||e),s}return n.Cache=e,Lw=n,Lw}var Uw,mD;function Rae(){if(mD)return Uw;mD=1;var e=Iae(),t=500;function n(r){var o=e(r,function(a){return s.size===t&&s.clear(),a}),s=o.cache;return o}return Uw=n,Uw}var Fw,vD;function Tae(){if(vD)return Fw;vD=1;var e=Rae(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(o){var s=[];return o.charCodeAt(0)===46&&s.push(""),o.replace(t,function(a,u,c,f){s.push(c?f.replace(n,"$1"):u||a)}),s});return Fw=r,Fw}var $w,yD;function Oae(){if(yD)return $w;yD=1;var e=oy(),t=X$(),n=Hs(),r=II(),o=e?e.prototype:void 0,s=o?o.toString:void 0;function a(u){if(typeof u=="string")return u;if(n(u))return t(u,a)+"";if(r(u))return s?s.call(u):"";var c=u+"";return c=="0"&&1/u==-1/0?"-0":c}return $w=a,$w}var zw,bD;function TI(){if(bD)return zw;bD=1;var e=Oae();function t(n){return n==null?"":e(n)}return zw=t,zw}var jw,SD;function my(){if(SD)return jw;SD=1;var e=Hs(),t=RI(),n=Tae(),r=TI();function o(s,a){return e(s)?s:t(s,a)?[s]:n(r(s))}return jw=o,jw}var Bw,wD;function ah(){if(wD)return Bw;wD=1;var e=II();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Bw=t,Bw}var Hw,CD;function OI(){if(CD)return Hw;CD=1;var e=my(),t=ah();function n(r,o){o=e(o,r);for(var s=0,a=o.length;r!=null&&s<a;)r=r[t(o[s++])];return s&&s==a?r:void 0}return Hw=n,Hw}var qw,ED;function Mae(){if(ED)return qw;ED=1;var e=OI();function t(n,r,o){var s=n==null?void 0:e(n,r);return s===void 0?o:s}return qw=t,qw}var Vw,_D;function Pae(){if(_D)return Vw;_D=1;function e(t,n){return t!=null&&n in Object(t)}return Vw=e,Vw}var Ww,xD;function Nae(){if(xD)return Ww;xD=1;var e=my(),t=dI(),n=Hs(),r=ay(),o=hI(),s=ah();function a(u,c,f){c=e(c,u);for(var h=-1,g=c.length,m=!1;++h<g;){var v=s(c[h]);if(!(m=u!=null&&f(u,v)))break;u=u[v]}return m||++h!=g?m:(g=u==null?0:u.length,!!g&&o(g)&&r(v,g)&&(n(u)||t(u)))}return Ww=a,Ww}var Gw,AD;function kae(){if(AD)return Gw;AD=1;var e=Pae(),t=Nae();function n(r,o){return r!=null&&t(r,o,e)}return Gw=n,Gw}var Kw,ID;function Dae(){if(ID)return Kw;ID=1;var e=m$(),t=Mae(),n=kae(),r=RI(),o=J$(),s=e9(),a=ah(),u=1,c=2;function f(h,g){return r(h)&&o(g)?s(a(h),g):function(m){var v=t(m,h);return v===void 0&&v===g?n(m,h):e(g,v,u|c)}}return Kw=f,Kw}var Zw,RD;function MI(){if(RD)return Zw;RD=1;function e(t){return t}return Zw=e,Zw}var Yw,TD;function Lae(){if(TD)return Yw;TD=1;function e(t){return function(n){return n?.[t]}}return Yw=e,Yw}var Qw,OD;function Uae(){if(OD)return Qw;OD=1;var e=OI();function t(n){return function(r){return e(r,n)}}return Qw=t,Qw}var Xw,MD;function Fae(){if(MD)return Xw;MD=1;var e=Lae(),t=Uae(),n=RI(),r=ah();function o(s){return n(s)?e(r(s)):t(s)}return Xw=o,Xw}var Jw,PD;function $ae(){if(PD)return Jw;PD=1;var e=Aae(),t=Dae(),n=MI(),r=Hs(),o=Fae();function s(a){return typeof a=="function"?a:a==null?n:typeof a=="object"?r(a)?t(a[0],a[1]):e(a):o(a)}return Jw=s,Jw}var eC,ND;function t9(){if(ND)return eC;ND=1;var e=il(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return eC=t,eC}var tC,kD;function PI(){if(kD)return tC;kD=1;var e=t9();function t(n,r,o){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:o,writable:!0}):n[r]=o}return tC=t,tC}var nC,DD;function n9(){if(DD)return nC;DD=1;var e=PI(),t=sh(),n=Object.prototype,r=n.hasOwnProperty;function o(s,a,u){var c=s[a];(!(r.call(s,a)&&t(c,u))||u===void 0&&!(a in s))&&e(s,a,u)}return nC=o,nC}var rC,LD;function zae(){if(LD)return rC;LD=1;var e=n9(),t=my(),n=ay(),r=Bs(),o=ah();function s(a,u,c,f){if(!r(a))return a;u=t(u,a);for(var h=-1,g=u.length,m=g-1,v=a;v!=null&&++h<g;){var w=o(u[h]),S=c;if(w==="__proto__"||w==="constructor"||w==="prototype")return a;if(h!=m){var C=v[w];S=f?f(C,w,v):void 0,S===void 0&&(S=r(C)?C:n(u[h+1])?[]:{})}e(v,w,S),v=v[w]}return a}return rC=s,rC}var oC,UD;function jae(){if(UD)return oC;UD=1;var e=OI(),t=zae(),n=my();function r(o,s,a){for(var u=-1,c=s.length,f={};++u<c;){var h=s[u],g=e(o,h);a(g,h)&&t(f,n(h,o),g)}return f}return oC=r,oC}var sC,FD;function NI(){if(FD)return sC;FD=1;var e=p$(),t=e(Object.getPrototypeOf,Object);return sC=t,sC}var iC,$D;function Bae(){if($D)return iC;$D=1;var e=u$(),t=NI(),n=f$(),r=d$(),o=Object.getOwnPropertySymbols,s=o?function(a){for(var u=[];a;)e(u,n(a)),a=t(a);return u}:r;return iC=s,iC}var aC,zD;function Hae(){if(zD)return aC;zD=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return aC=e,aC}var lC,jD;function qae(){if(jD)return lC;jD=1;var e=Bs(),t=gI(),n=Hae(),r=Object.prototype,o=r.hasOwnProperty;function s(a){if(!e(a))return n(a);var u=t(a),c=[];for(var f in a)f=="constructor"&&(u||!o.call(a,f))||c.push(f);return c}return lC=s,lC}var uC,BD;function kI(){if(BD)return uC;BD=1;var e=h$(),t=qae(),n=ly();function r(o){return n(o)?e(o,!0):t(o)}return uC=r,uC}var cC,HD;function Vae(){if(HD)return cC;HD=1;var e=c$(),t=Bae(),n=kI();function r(o){return e(o,n,t)}return cC=r,cC}var dC,qD;function Wae(){if(qD)return dC;qD=1;var e=X$(),t=$ae(),n=jae(),r=Vae();function o(s,a){if(s==null)return{};var u=e(r(s),function(c){return[c]});return a=t(a),n(s,u,function(c,f){return a(c,f[0])})}return dC=o,dC}var Gae=Wae();const Kae=sc(Gae),Zae=!0,Yae="",Af=(e,t)=>`${e}${t}`.replace(/[^A-Z0-9+]/gi,""),Qae=(e,t)=>{switch(t){case"address":case"birthdate":case"email":case"family_name":case"gender":case"given_name":case"locale":case"middle_name":case"name":case"nickname":case"phone_number":case"picture":case"preferred_username":case"profile":case"updated_at":case"website":case"zoneinfo":return!0;default:return t.startsWith("custom:")}},Xae=e=>{const{phone_number:t,...n}=Kae(e,Qae);if(Ps(t)&&t!==Yae){const{country_code:r}=e;return{...n,phone_number:Af(r,t)}}return n},Jae=(e,t,n,r)=>{const{password:o,...s}=t,a=Xae(s),u=r&&r!=="PASSWORD";let c=a;r==="SMS_OTP"&&a.email&&(c={...a,email:""});const f={autoSignIn:u?{enabled:!0,authFlowType:"USER_AUTH",preferredChallenge:r}:Zae,userAttributes:{...n==="phone_number"?{...c,phone_number:e}:c}};return{username:e,password:u?void 0:o,options:f}},ele=({formValues:e,loginMechanisms:t})=>{const n=e.__authMethod;if(n==="SMS_OTP"){const{country_code:o,phone_number:s}=e;return Af(o,s)}if(n==="EMAIL_OTP")return e.email;if(t.includes("username"))return e.username;const r=t[0];if(r==="phone_number"){const{country_code:o,phone_number:s}=e;return Af(o,s)}return e[r]},tle=(e,t)=>{const n=[],r=t!==void 0;n.push("PASSWORD"),(r||e?.emailOtpEnabled)&&n.push("EMAIL_OTP"),(r||e?.smsOtpEnabled)&&n.push("SMS_OTP"),(r||e?.webAuthnEnabled)&&n.push("WEB_AUTHN");const o=t??[],s=n.filter(a=>!o.includes(a));if(s.length===0)throw new Error("InvalidPasswordlessSettings: All authentication methods are hidden");return s},{assign:He}=z$,nle=He({actorDoneData:void 0}),rle=He({challengeName:void 0}),ole=He({missingAttributes:void 0}),sle=He({remoteError:void 0}),ile=He({formValues:e=>({username:e.formValues?.username})}),ale=He({touched:{}}),lle=He({user:void 0}),ule=He({validationError:{}}),cle=He({totpSecretCode:(e,{data:t})=>{const{sharedSecret:n}=t.nextStep?.totpSetupDetails??{};return n}}),dle=He({allowedMfaTypes:(e,{data:t})=>t.nextStep?.allowedMFATypes}),fle=He({step:"SIGN_IN"}),hle=He({step:"SHOULD_CONFIRM_USER_ATTRIBUTE"}),ple=He({step:"CONFIRM_ATTRIBUTE_COMPLETE"}),gle=He({challengeName:(e,{data:t})=>{const{signInStep:n}=t.nextStep;switch(n){case"CONFIRM_SIGN_IN_WITH_SMS_CODE":return"SMS_MFA";case"CONFIRM_SIGN_IN_WITH_TOTP_CODE":return"SOFTWARE_TOKEN_MFA";case"CONFIRM_SIGN_IN_WITH_EMAIL_CODE":return"EMAIL_OTP";case"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION":case"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP":case"CONTINUE_SIGN_IN_WITH_TOTP_SETUP":return"MFA_SETUP";case"CONTINUE_SIGN_IN_WITH_MFA_SELECTION":return"SELECT_MFA_TYPE";default:return}}}),mle=He({username:({formValues:e,loginMechanisms:t})=>{const n=t[0],{username:r,country_code:o}=e;return n==="phone_number"?Af(o,r):r}}),vle=He({username:ele}),yle=He({username:({formValues:e,loginMechanisms:t})=>{const n=t[0],{username:r,country_code:o}=e;return n==="phone_number"?Af(o,r):r}}),ble=He({step:(e,{data:t})=>t.nextStep.signInStep==="DONE"?"SIGN_IN_COMPLETE":t.nextStep.signInStep}),Sle=He({step:(e,{data:t})=>t.nextStep.signUpStep==="DONE"?"SIGN_UP_COMPLETE":t.nextStep.signUpStep}),wle=He({step:(e,{data:t})=>t.nextStep.resetPasswordStep==="DONE"?"RESET_PASSWORD_COMPLETE":t.nextStep.resetPasswordStep}),Cle=He({missingAttributes:(e,{data:t})=>t.nextStep?.missingAttributes}),Ele=He({validationError:(e,{data:t})=>t}),_le=He({remoteError:(e,{data:t})=>{if(t.name==="NoUserPoolError")return"Configuration error (see console) – please contact the administrator";const n=t?.message||"";return n.includes("USER_AUTH flow not enabled")?de(me.PASSWORDLESS_NOT_ENABLED):n.includes("Cannot send code to either")?de(me.CODE_DELIVERY_FAILED):n.includes("Invalid code or auth state")?de(me.VERIFICATION_CODE_INVALID):n.includes("session is expired")?de(me.VERIFICATION_CODE_EXPIRED):n.includes("ceremony has been canceled")?de(me.PASSKEY_AUTHENTICATION_CANCELED):n||t}}),xle=He({user:(e,{data:t})=>t}),VD=e=>({Destination:e.destination,DeliveryMedium:e.deliveryMedium,AttributeName:e.attributName}),Ale=He({codeDeliveryDetails:(e,{data:t})=>t?.nextStep?.codeDeliveryDetails?VD(t.nextStep.codeDeliveryDetails):VD(t)}),Ile=He({formValues:(e,{data:t})=>{const{name:n,value:r}=t;return{...e.formValues,[n]:r}}}),Rle=He({formValues:(e,{data:t})=>Xie({...e.formValues,...t},"password")}),Tle=He({touched:(e,{data:t})=>({...e.touched,[t.name]:!0})}),Ole=He({unverifiedUserAttributes:(e,{data:t})=>{const n=t||e.fetchedUserAttributes;if(!n)return{};const{email:r,phone_number:o}=n;return{...r&&{email:r},...o&&{phone_number:o}}}}),Mle=He({selectedUserAttribute:void 0}),Ple=He({selectedUserAttribute:e=>e.formValues?.unverifiedAttr}),Nle=He({step:"CONFIRM_SIGN_UP"}),kle=He({selectedAuthMethod:(e,{data:t})=>t.method}),Dle=He({selectedAuthMethod:(e,{data:t})=>t?.__authMethod||"PASSWORD"}),Lle=He({step:"SELECT_AUTH_METHOD"}),Ule=He({fetchedUserAttributes:(e,t)=>t.data}),Fle=He({hasExistingPasskeys:(e,t)=>t.data}),$le=He({hasExistingPasskeys:!1}),lh={clearActorDoneData:nle,clearChallengeName:rle,clearError:sle,clearFormValues:ile,clearHasExistingPasskeys:$le,clearMissingAttributes:ole,clearSelectedUserAttribute:Mle,clearTouched:ale,clearUser:lle,clearValidationError:ule,handleBlur:Tle,handleInput:Ile,handleSubmit:Rle,setAllowedMfaTypes:dle,setChallengeName:gle,setCodeDeliveryDetails:Ale,setFetchedUserAttributes:Ule,setFieldErrors:Ele,setHasExistingPasskeys:Fle,setMissingAttributes:Cle,setNextResetPasswordStep:wle,setNextSignInStep:ble,setNextSignUpStep:Sle,setRemoteError:_le,setConfirmAttributeCompleteStep:ple,setConfirmSignUpSignUpStep:Nle,setSelectAuthMethodStep:Lle,setSelectedAuthMethod:kle,setSelectedAuthMethodFromForm:Dle,setShouldVerifyUserAttributeStep:hle,setSelectedUserAttribute:Ple,setSignInStep:fle,setTotpSecretCode:cle,setUser:xle,setUnverifiedUserAttributes:Ole,setUsernameForgotPassword:mle,setUsernameSignIn:yle,setUsernameSignUp:vle},zle=["CONFIRM_SIGN_IN_WITH_SMS_CODE","CONFIRM_SIGN_IN_WITH_TOTP_CODE","CONFIRM_SIGN_IN_WITH_EMAIL_CODE"],jle=(e,{data:t})=>t?.nextStep.signInStep==="CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",Ble=(e,{data:t})=>t?.nextStep?.signInStep==="RESET_PASSWORD",Hle=(e,{data:t})=>t?.nextStep.signInStep==="CONFIRM_SIGN_UP",qle=(e,{data:t})=>t?.nextStep.signUpStep==="COMPLETE_AUTO_SIGN_IN",Vle=(e,{data:t})=>t?.nextStep.signUpStep==="DONE"&&e.step==="CONFIRM_SIGN_UP",Wle=(e,{data:t})=>t?.nextStep.signInStep==="DONE",Gle=(e,{data:t})=>t?.nextStep.signUpStep==="DONE",Kle=(e,{data:t})=>t?.nextStep.resetPasswordStep==="DONE",Zle=(e,{data:t})=>t?.step==="CONFIRM_ATTRIBUTE_COMPLETE",Yle=(e,{data:t})=>t?.step==="CONFIRM_ATTRIBUTE_WITH_CODE",Qle=(e,{data:t})=>t?.step==="SHOULD_CONFIRM_USER_ATTRIBUTE",Xle=(e,{data:t})=>t?.step==="RESET_PASSWORD",Jle=(e,{data:t})=>t?.step==="CONFIRM_SIGN_UP",eue=({step:e})=>zle.includes(e),tue=({step:e})=>e==="CONTINUE_SIGN_IN_WITH_TOTP_SETUP",nue=({step:e})=>e==="CONTINUE_SIGN_IN_WITH_EMAIL_SETUP",rue=({step:e})=>["CONTINUE_SIGN_IN_WITH_MFA_SELECTION","CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION"].includes(e),oue=({step:e})=>e==="RESET_PASSWORD",sue=({step:e})=>e==="CONFIRM_RESET_PASSWORD_WITH_CODE",iue=({step:e})=>e==="CONFIRM_SIGN_UP",aue=(e,t)=>{const n=t.data||e.fetchedUserAttributes;if(!n)return!1;const{email:r,phone_number:o,phone_number_verified:s,email_verified:a}=n;return!r&&!o?!1:(a===void 0||a==="false")&&(s===void 0||s==="false")},lue=(e,{data:t})=>t.message==="User is already confirmed.",uue=({availableAuthMethods:e,preferredChallenge:t,selectedAuthMethod:n})=>e&&e.length>1&&(!t||n===null),cue=({passwordless:e,hasExistingPasskeys:t})=>{const{passkeyRegistrationPrompts:n}=e||{};return!n||t?!1:typeof n=="boolean"?n:n.afterSignin==="ALWAYS"},due=({passwordless:e,hasExistingPasskeys:t})=>{const{passkeyRegistrationPrompts:n}=e||{};return!n||t?!1:typeof n=="boolean"?n:n.afterSignup==="ALWAYS"},fue=({passwordless:e})=>e?.passkeyRegistrationPrompts!=null,hue=({selectedAuthMethod:e,step:t})=>e!=null&&t==="SELECT_AUTH_METHOD",vy={hasCompletedAttributeConfirmation:Zle,hasCompletedResetPassword:Kle,hasCompletedSignIn:Wle,hasCompletedSignUp:Gle,hasPasskeyRegistrationPrompts:fue,isConfirmSignUpStep:Jle,isConfirmUserAttributeStep:Yle,isResetPasswordStep:Xle,isShouldConfirmUserAttributeStep:Qle,isUserAlreadyConfirmed:lue,shouldAutoSignIn:qle,shouldManualSignIn:Vle,shouldConfirmResetPassword:sue,shouldConfirmSignIn:eue,shouldConfirmSignInWithNewPassword:jle,shouldConfirmSignUp:iue,shouldConfirmSignUpFromSignIn:Hle,shouldResetPassword:oue,shouldResetPasswordFromSignIn:Ble,shouldReturnToSelectMethod:hue,shouldSelectAuthMethod:uue,shouldSetupTotp:tue,shouldSetupEmail:nue,shouldSelectMfaType:rue,shouldVerifyAttribute:aue,shouldPromptPasskeyRegistration:cue,shouldPromptPasskeyRegistrationAfterSignup:due};var fC,WD;function r9(){if(WD)return fC;WD=1;var e=PI(),t=sh();function n(r,o,s){(s!==void 0&&!t(r[o],s)||s===void 0&&!(o in r))&&e(r,o,s)}return fC=n,fC}var hC,GD;function pue(){if(GD)return hC;GD=1;function e(t){return function(n,r,o){for(var s=-1,a=Object(n),u=o(n),c=u.length;c--;){var f=u[t?c:++s];if(r(a[f],f,a)===!1)break}return n}}return hC=e,hC}var pC,KD;function gue(){if(KD)return pC;KD=1;var e=pue(),t=e();return pC=t,pC}var Yd={exports:{}};Yd.exports;var ZD;function mue(){return ZD||(ZD=1,(function(e,t){var n=Go(),r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===r,a=s?n.Buffer:void 0,u=a?a.allocUnsafe:void 0;function c(f,h){if(h)return f.slice();var g=f.length,m=u?u(g):new f.constructor(g);return f.copy(m),m}e.exports=c})(Yd,Yd.exports)),Yd.exports}var gC,YD;function vue(){if(YD)return gC;YD=1;var e=l$();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return gC=t,gC}var mC,QD;function yue(){if(QD)return mC;QD=1;var e=vue();function t(n,r){var o=r?e(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.length)}return mC=t,mC}var vC,XD;function bue(){if(XD)return vC;XD=1;function e(t,n){var r=-1,o=t.length;for(n||(n=Array(o));++r<o;)n[r]=t[r];return n}return vC=e,vC}var yC,JD;function Sue(){if(JD)return yC;JD=1;var e=Bs(),t=Object.create,n=(function(){function r(){}return function(o){if(!e(o))return{};if(t)return t(o);r.prototype=o;var s=new r;return r.prototype=void 0,s}})();return yC=n,yC}var bC,eL;function wue(){if(eL)return bC;eL=1;var e=Sue(),t=NI(),n=gI();function r(o){return typeof o.constructor=="function"&&!n(o)?e(t(o)):{}}return bC=r,bC}var SC,tL;function Cue(){if(tL)return SC;tL=1;var e=ly(),t=al();function n(r){return t(r)&&e(r)}return SC=n,SC}var wC,nL;function Eue(){if(nL)return wC;nL=1;var e=mc(),t=NI(),n=al(),r="[object Object]",o=Function.prototype,s=Object.prototype,a=o.toString,u=s.hasOwnProperty,c=a.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var g=t(h);if(g===null)return!0;var m=u.call(g,"constructor")&&g.constructor;return typeof m=="function"&&m instanceof m&&a.call(m)==c}return wC=f,wC}var CC,rL;function o9(){if(rL)return CC;rL=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return CC=e,CC}var EC,oL;function _ue(){if(oL)return EC;oL=1;var e=n9(),t=PI();function n(r,o,s,a){var u=!s;s||(s={});for(var c=-1,f=o.length;++c<f;){var h=o[c],g=a?a(s[h],r[h],h,s,r):void 0;g===void 0&&(g=r[h]),u?t(s,h,g):e(s,h,g)}return s}return EC=n,EC}var _C,sL;function xue(){if(sL)return _C;sL=1;var e=_ue(),t=kI();function n(r){return e(r,t(r))}return _C=n,_C}var xC,iL;function Aue(){if(iL)return xC;iL=1;var e=r9(),t=mue(),n=yue(),r=bue(),o=wue(),s=dI(),a=Hs(),u=Cue(),c=fI(),f=aI(),h=Bs(),g=Eue(),m=pI(),v=o9(),w=xue();function S(C,E,A,I,T,N,M){var R=v(C,A),k=v(E,A),L=M.get(k);if(L){e(C,A,L);return}var q=N?N(R,k,A+"",C,E,M):void 0,F=q===void 0;if(F){var D=a(k),j=!D&&c(k),Z=!D&&!j&&m(k);q=k,D||j||Z?a(R)?q=R:u(R)?q=r(R):j?(F=!1,q=t(k,!0)):Z?(F=!1,q=n(k,!0)):q=[]:g(k)||s(k)?(q=R,s(R)?q=w(R):(!h(R)||f(R))&&(q=o(k))):F=!1}F&&(M.set(k,q),T(q,k,I,N,M),M.delete(k)),e(C,A,q)}return xC=S,xC}var AC,aL;function Iue(){if(aL)return AC;aL=1;var e=cI(),t=r9(),n=gue(),r=Aue(),o=Bs(),s=kI(),a=o9();function u(c,f,h,g,m){c!==f&&n(f,function(v,w){if(m||(m=new e),o(v))r(c,f,w,h,u,g,m);else{var S=g?g(a(c,w),v,w+"",c,f,m):void 0;S===void 0&&(S=v),t(c,w,S)}},s)}return AC=u,AC}var IC,lL;function Rue(){if(lL)return IC;lL=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return IC=e,IC}var RC,uL;function Tue(){if(uL)return RC;uL=1;var e=Rue(),t=Math.max;function n(r,o,s){return o=t(o===void 0?r.length-1:o,0),function(){for(var a=arguments,u=-1,c=t(a.length-o,0),f=Array(c);++u<c;)f[u]=a[o+u];u=-1;for(var h=Array(o+1);++u<o;)h[u]=a[u];return h[o]=s(f),e(r,this,h)}}return RC=n,RC}var TC,cL;function Oue(){if(cL)return TC;cL=1;function e(t){return function(){return t}}return TC=e,TC}var OC,dL;function Mue(){if(dL)return OC;dL=1;var e=Oue(),t=t9(),n=MI(),r=t?function(o,s){return t(o,"toString",{configurable:!0,enumerable:!1,value:e(s),writable:!0})}:n;return OC=r,OC}var MC,fL;function Pue(){if(fL)return MC;fL=1;var e=800,t=16,n=Date.now;function r(o){var s=0,a=0;return function(){var u=n(),c=t-(u-a);if(a=u,c>0){if(++s>=e)return arguments[0]}else s=0;return o.apply(void 0,arguments)}}return MC=r,MC}var PC,hL;function Nue(){if(hL)return PC;hL=1;var e=Mue(),t=Pue(),n=t(e);return PC=n,PC}var NC,pL;function kue(){if(pL)return NC;pL=1;var e=MI(),t=Tue(),n=Nue();function r(o,s){return n(t(o,s,e),o+"")}return NC=r,NC}var kC,gL;function Due(){if(gL)return kC;gL=1;var e=sh(),t=ly(),n=ay(),r=Bs();function o(s,a,u){if(!r(u))return!1;var c=typeof a;return(c=="number"?t(u)&&n(a,u.length):c=="string"&&a in u)?e(u[a],s):!1}return kC=o,kC}var DC,mL;function Lue(){if(mL)return DC;mL=1;var e=kue(),t=Due();function n(r){return e(function(o,s){var a=-1,u=s.length,c=u>1?s[u-1]:void 0,f=u>2?s[2]:void 0;for(c=r.length>3&&typeof c=="function"?(u--,c):void 0,f&&t(s[0],s[1],f)&&(c=u<3?void 0:c,u=1),o=Object(o);++a<u;){var h=s[a];h&&r(o,h,a,c)}return o})}return DC=n,DC}var LC,vL;function Uue(){if(vL)return LC;vL=1;var e=Iue(),t=Lue(),n=t(function(r,o,s){e(r,o,s)});return LC=n,LC}var Fue=Uue();const $ue=sc(Fue),yy=async(e,t,n,r)=>{const o=await Promise.all(r.map(a=>a(e,t,n))),s=$ue({},...o);return xI(s)?Promise.resolve():Promise.reject(s)},zue=8,jue=e=>Array.isArray(e),Bue=e=>{if(e)return jue(e)?Object.entries(e).map(([t,n])=>Object.keys(n)[0]):Object.keys(e)},ji={async getAmplifyConfig(){const e=sF.getConfig(),t=e.Auth?.Cognito,{loginWith:n,userAttributes:r}=e.Auth?.Cognito??{},o=n?Object.entries(n).filter(([f,h])=>f!=="oauth").filter(([f,h])=>!!h).map(f=>f[0]==="phone"?"phone_number":f[0]):void 0,s=Bue(r),a=n?.oauth?.providers?n.oauth.providers?.map(f=>f.toString().toLowerCase()):void 0,u=e.Auth?.Cognito?.passwordless,c={emailOtpEnabled:u?.emailOtpEnabled??u?.email_otp_enabled===!0,smsOtpEnabled:u?.smsOtpEnabled??u?.sms_otp_enabled===!0,webAuthnEnabled:!!(u?.webAuthn??u?.web_authn),preferredChallenge:u?.preferredChallenge??u?.preferred_challenge};return{...t,loginMechanisms:o,signUpAttributes:s,socialProviders:a,passwordlessCapabilities:c}},getCurrentUser:zv,handleSignIn:VA,handleSignUp:vQ,handleConfirmSignIn:Z8,handleConfirmSignUp:_Q,handleForgotPasswordSubmit:SQ,handleForgotPassword:K8,handleResendSignUpCode:CQ,async validateCustomSignUp(e,t){},async validateFormPassword(e,t,n){const{password:r}=e,{password:o}=t;if(!o||!n)return null;const s=[],a=n.minLength??zue;return r.length<a&&s.push(`Password must have at least ${a} characters`),n.requireLowercase&&!/[a-z]/.test(r)&&s.push("Password must have lower case letters"),n.requireUppercase&&!/[A-Z]/.test(r)&&s.push("Password must have upper case letters"),n.requireNumbers&&!/[0-9]/.test(r)&&s.push("Password must have numbers"),n.requireSpecialCharacters&&!Yie(r)&&s.push("Password must have special characters"),s.length!==0?{password:s}:null},async validateConfirmPassword(e,t){const{password:n,confirm_password:r}=e,{confirm_password:o,password:s}=t;if(!n&&!r)return null;if((n||r)&&n!==r&&(o&&s||n?.length>=6&&r?.length>=6))return{confirm_password:"Your passwords must match"}},async validatePreferredUsername(e,t){},async validateRequiredFieldsForAuthMethod(e){const t=e.__authMethod;if(!t)return null;if(t==="EMAIL_OTP"&&!e.email)return{email:"Email is required for Email OTP sign up"};if(t==="SMS_OTP"&&!e.phone_number)return{phone_number:"Phone number is required for SMS OTP sign up"};if(t==="PASSWORD"){const n={};return e.password||(n.password="Password is required"),e.confirm_password||(n.confirm_password="Confirm Password is required"),Object.keys(n).length>0?n:null}return null}};function Hue({services:e}){return yc({id:"forgotPasswordActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{cond:"shouldResetPassword",target:"confirmResetPassword"},{cond:"shouldConfirmResetPassword",target:"confirmResetPassword"},{target:"forgotPassword"}]},forgotPassword:{initial:"edit",entry:"sendUpdate",exit:["clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"}}},submit:{tags:"pending",entry:["sendUpdate","clearError","setUsernameForgotPassword"],invoke:{src:"handleResetPassword",onDone:{actions:["setCodeDeliveryDetails","setNextResetPasswordStep"],target:"#forgotPasswordActor.confirmResetPassword"},onError:{actions:"setRemoteError",target:"edit"}}}}},confirmResetPassword:{type:"parallel",exit:["clearFormValues","clearError","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateFields",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submission:{initial:"idle",states:{idle:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"},RESEND:"resendCode",CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"}}},validate:{entry:"sendUpdate",invoke:{src:"validateFields",onDone:{target:"pending",actions:"clearValidationError"},onError:{target:"idle",actions:"setFieldErrors"}}},resendCode:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"handleResetPassword",onDone:{target:"idle"},onError:{actions:"setRemoteError",target:"idle"}}},pending:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"handleConfirmResetPassword",onDone:[{cond:"hasCompletedResetPassword",actions:"setNextResetPasswordStep",target:"#forgotPasswordActor.resolved"},{actions:"setSignInStep",target:"#forgotPasswordActor.resolved"}],onError:{actions:"setRemoteError",target:"idle"}}}}}}},resolved:{type:"final",data:({step:t})=>({step:t})}}},{actions:{...lh,sendUpdate:hy()},guards:vy,services:{handleResetPassword({username:t}){return e.handleForgotPassword({username:t})},handleConfirmResetPassword({formValues:t,username:n}){const{confirmation_code:r,password:o}=t;return e.handleForgotPasswordSubmit({confirmationCode:r,newPassword:o,username:n})},validateFields(t){return yy(t.formValues,t.touched,t.passwordSettings,[ji.validateFormPassword,ji.validateConfirmPassword])}}})}const s9=e=>({entry:["sendUpdate","clearError"],invoke:{src:"signInWithRedirect",onDone:{target:e},onError:{actions:"setRemoteError",target:e}}}),que=e=>["CONTINUE_SIGN_IN_WITH_MFA_SELECTION","CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION"].includes(e)?"mfa_type":e==="CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"?"email":"confirmation_code",lm={onDone:[{cond:"hasCompletedSignIn",actions:"setNextSignInStep",target:"#signInActor.fetchUserAttributes"},{cond:"shouldConfirmSignInWithNewPassword",actions:["setMissingAttributes","setNextSignInStep"],target:"#signInActor.forceChangePassword"},{cond:"shouldResetPasswordFromSignIn",actions:"setNextSignInStep",target:"#signInActor.resetPassword"},{cond:"shouldConfirmSignUpFromSignIn",actions:"setNextSignInStep",target:"#signInActor.resendSignUpCode"},{actions:["setChallengeName","setMissingAttributes","setNextSignInStep","setTotpSecretCode","setAllowedMfaTypes","setCodeDeliveryDetails"],target:"#signInActor.init"}],onError:{actions:"setRemoteError",target:"edit"}},Xp=e=>({initial:"edit",exit:e,states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput"},RESEND:{target:"resend"}}},submit:{tags:"pending",entry:["sendUpdate","clearError"],invoke:{src:"confirmSignIn",...lm}},resend:{tags:"pending",entry:["sendUpdate","clearError"],invoke:{src:"resendSignInCode",onDone:{actions:["setCodeDeliveryDetails","sendUpdate"],target:"edit"},onError:{actions:"setRemoteError",target:"edit"}}}}});function Vue({services:e}){return yc({id:"signInActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{cond:"shouldConfirmSignIn",target:"confirmSignIn"},{cond:"shouldSetupTotp",target:"setupTotp"},{cond:"shouldSetupEmail",target:"setupEmail"},{cond:"shouldSelectMfaType",target:"selectMfaType"},{cond:({step:t})=>t==="CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",actions:"setActorDoneData",target:"forceChangePassword"},{target:"signIn"}]},federatedSignIn:{...s9("signIn")},fetchUserAttributes:{invoke:{src:"fetchUserAttributes",onDone:[{cond:"hasPasskeyRegistrationPrompts",actions:"setFetchedUserAttributes",target:"checkPasskeys"},{actions:"setFetchedUserAttributes",target:"evaluatePasskeyPrompt"}],onError:{actions:"setConfirmAttributeCompleteStep",target:"#signInActor.resolved"}}},checkPasskeys:{invoke:{src:async()=>{try{const t=await EI();return t.credentials&&t.credentials.length>0}catch{return!1}},onDone:{actions:"setHasExistingPasskeys",target:"evaluatePasskeyPrompt"},onError:{actions:"clearHasExistingPasskeys",target:"evaluatePasskeyPrompt"}}},evaluatePasskeyPrompt:{always:[{cond:"shouldPromptPasskeyRegistration",target:"#signInActor.passkeyPrompt"},{cond:"shouldVerifyAttribute",actions:["setShouldVerifyUserAttributeStep","setUnverifiedUserAttributes"],target:"#signInActor.resolved"},{actions:"setConfirmAttributeCompleteStep",target:"#signInActor.resolved"}]},resendSignUpCode:{invoke:{src:"handleResendSignUpCode",onDone:{actions:"setCodeDeliveryDetails",target:"#signInActor.resolved"},onError:{actions:"setRemoteError",target:"#signInActor.signIn"}}},resetPassword:{invoke:{src:"resetPassword",onDone:[{actions:"setCodeDeliveryDetails",target:"#signInActor.resolved"}],onError:{actions:["setRemoteError","sendUpdate"]}}},signIn:{initial:"edit",exit:"clearTouched",states:{edit:{entry:"sendUpdate",on:{CHANGE:{actions:"handleInput"},FEDERATED_SIGN_IN:{target:"#signInActor.federatedSignIn"},SHOW_AUTH_METHODS:{actions:"setUsernameSignIn",target:"selectMethod"},SUBMIT:[{cond:"shouldSelectAuthMethod",actions:"handleSubmit",target:"selectMethod"},{actions:"handleSubmit",target:"submit"}]}},selectMethod:{entry:["sendUpdate","setSelectAuthMethodStep","setUsernameSignIn"],on:{SELECT_METHOD:{actions:"setSelectedAuthMethod",target:"submit"},SUBMIT:{actions:["handleSubmit","setSelectedAuthMethodFromForm"],target:"submit"},SIGN_IN:{target:"edit"}}},submit:{tags:"pending",entry:["clearError","sendUpdate","setUsernameSignIn"],exit:"clearFormValues",invoke:{src:"handleSignIn",onDone:lm.onDone,onError:[{cond:"shouldReturnToSelectMethod",actions:"setRemoteError",target:"selectMethod"},lm.onError]}}}},confirmSignIn:{...Xp(["clearChallengeName","clearFormValues","clearError","clearTouched"])},forceChangePassword:{entry:"sendUpdate",type:"parallel",exit:["clearFormValues","clearError","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateFields",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{SIGN_IN:{actions:"setSignInStep",target:"#signInActor.resolved"},CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submit:{initial:"edit",entry:"clearError",states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"}}},validate:{entry:"sendUpdate",invoke:{src:"validateFields",onDone:{actions:"clearValidationError",target:"pending"},onError:{actions:"setFieldErrors",target:"edit"}}},pending:{tags:"pending",entry:["sendUpdate","clearError"],invoke:{src:"handleForceChangePassword",...lm}}}}}},setupTotp:{...Xp(["clearFormValues","clearError","clearTouched"])},setupEmail:{...Xp(["clearFormValues","clearError","clearTouched"])},selectMfaType:{...Xp(["clearFormValues","clearError","clearTouched"])},passkeyPrompt:{entry:"sendUpdate",on:{SUBMIT:{actions:"setConfirmAttributeCompleteStep",target:"resolved"},SKIP:{actions:"setConfirmAttributeCompleteStep",target:"resolved"}}},resolved:{type:"final",data:t=>({codeDeliveryDetails:t.codeDeliveryDetails,remoteError:t.remoteError,step:t.step,unverifiedUserAttributes:t.unverifiedUserAttributes,username:t.username})}}},{actions:{...lh,sendUpdate:hy()},guards:vy,services:{async fetchUserAttributes(){return tF()},resetPassword({username:t}){return K8({username:t})},handleResendSignUpCode({username:t}){return e.handleResendSignUpCode({username:t})},resendSignInCode({username:t,selectedAuthMethod:n,availableAuthMethods:r,preferredChallenge:o}){const s=n??o??r?.[0]??"PASSWORD";return e.handleSignIn({username:t,options:{authFlowType:"USER_AUTH",preferredChallenge:s}})},handleSignIn({formValues:t,username:n,selectedAuthMethod:r,availableAuthMethods:o,preferredChallenge:s}){const a=r??s??o?.[0]??"PASSWORD";if(a==="PASSWORD"){const{password:u}=t;return e.handleSignIn({username:n,password:u})}else return e.handleSignIn({username:n,options:{authFlowType:"USER_AUTH",preferredChallenge:a}})},confirmSignIn({formValues:t,step:n}){const r=que(n),{[r]:o}=t;return e.handleConfirmSignIn({challengeResponse:o})},async handleForceChangePassword({formValues:t}){let{password:n,phone_number:r,country_code:o,confirm_password:s,username:a,...u}=t,c;return r&&(c=`${o}${r}`.replace(/[^A-Z0-9+]/gi,""),u={...u,phone_number:c}),Z8({challengeResponse:n,options:{userAttributes:u}})},signInWithRedirect(t,{data:n}){return eF(n)},async validateFields(t){return yy(t.formValues,t.touched,t.passwordSettings,[ji.validateFormPassword,ji.validateConfirmPassword])}}})}const Wue={onDone:[{actions:"setCodeDeliveryDetails",target:"#signUpActor.resolved"}],onError:{actions:["setRemoteError","sendUpdate"]}},Gue={onDone:[{cond:"hasCompletedSignIn",actions:"setNextSignInStep",target:"#signUpActor.fetchUserAttributes"},{cond:"shouldConfirmSignInWithNewPassword",actions:"setNextSignInStep",target:"#signUpActor.resolved"},{cond:"shouldResetPasswordFromSignIn",actions:"setNextSignInStep",target:"#signUpActor.resetPassword"},{cond:"shouldConfirmSignUpFromSignIn",actions:"setNextSignInStep",target:"#signUpActor.resendSignUpCode"},{actions:["setNextSignInStep","setChallengeName","setMissingAttributes","setTotpSecretCode","setAllowedMfaTypes"],target:"#signUpActor.resolved"}],onError:{actions:"setRemoteError",target:"#signUpActor.resolved"}};function Kue({services:e}){return yc({id:"signUpActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{cond:"shouldConfirmSignUp",target:"confirmSignUp"},{target:"signUp"}]},autoSignIn:{tags:"pending",invoke:{src:"autoSignIn",...Gue}},fetchUserAttributes:{invoke:{src:"fetchUserAttributes",onDone:[{cond:"hasPasskeyRegistrationPrompts",actions:"setFetchedUserAttributes",target:"checkPasskeys"},{actions:"setFetchedUserAttributes",target:"evaluatePasskeyPrompt"}],onError:{actions:"setConfirmAttributeCompleteStep",target:"#signUpActor.resolved"}}},checkPasskeys:{invoke:{src:async()=>{try{const t=await EI();return t.credentials&&t.credentials.length>0}catch{return!1}},onDone:{actions:"setHasExistingPasskeys",target:"evaluatePasskeyPrompt"},onError:{actions:"clearHasExistingPasskeys",target:"evaluatePasskeyPrompt"}}},evaluatePasskeyPrompt:{always:[{cond:"shouldPromptPasskeyRegistrationAfterSignup",target:"#signUpActor.passkeyPrompt"},{cond:"shouldVerifyAttribute",actions:["setShouldVerifyUserAttributeStep","setUnverifiedUserAttributes"],target:"#signUpActor.resolved"},{actions:"setConfirmAttributeCompleteStep",target:"#signUpActor.resolved"}]},federatedSignIn:{...s9("signUp")},resetPassword:{invoke:{src:"resetPassword",...Wue}},resendSignUpCode:{tags:"pending",entry:"sendUpdate",exit:"sendUpdate",invoke:{src:"resendSignUpCode",onDone:{actions:["setCodeDeliveryDetails","sendUpdate"],target:"#signUpActor.confirmSignUp"},onError:[{cond:"isUserAlreadyConfirmed",target:"#signUpActor.resolved"},{actions:["setRemoteError","sendUpdate"],target:"#signUpActor.confirmSignUp"}]}},signUp:{type:"parallel",exit:"clearTouched",on:{FEDERATED_SIGN_IN:{target:"federatedSignIn"}},states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateSignUp",onDone:{actions:"clearValidationError",target:"valid"},onError:{actions:"setFieldErrors",target:"invalid"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{BLUR:{actions:"handleBlur",target:".pending"},CHANGE:{actions:"handleInput",target:".pending"}}},submission:{initial:"idle",states:{idle:{entry:["sendUpdate"],on:{SUBMIT:{actions:["setSelectedAuthMethodFromForm","handleSubmit"],target:"validate"}}},validate:{entry:"sendUpdate",invoke:{src:"validateSignUp",onDone:{target:"handleSignUp",actions:"clearValidationError"},onError:{actions:"setFieldErrors",target:"idle"}}},handleSignUp:{tags:"pending",entry:["setUsernameSignUp","clearError"],exit:"sendUpdate",invoke:{src:"handleSignUp",onDone:[{cond:"hasCompletedSignUp",actions:"setNextSignUpStep",target:"#signUpActor.resolved"},{cond:"shouldAutoSignIn",actions:"setNextSignUpStep",target:"#signUpActor.autoSignIn"},{actions:["setCodeDeliveryDetails","setNextSignUpStep"],target:"#signUpActor.init"}],onError:{actions:["sendUpdate","setRemoteError"],target:"idle"}}}}}}},confirmSignUp:{initial:"edit",entry:"sendUpdate",states:{edit:{on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"},RESEND:"#signUpActor.resendSignUpCode"}},submit:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"confirmSignUp",onDone:[{cond:"shouldAutoSignIn",actions:["setNextSignUpStep","clearFormValues"],target:"#signUpActor.autoSignIn"},{cond:"shouldManualSignIn",actions:["clearFormValues","setSignInStep"],target:"#signUpActor.resolved"},{actions:"setNextSignUpStep",target:"#signUpActor.init"}],onError:{actions:["setRemoteError","sendUpdate"],target:"edit"}}}}},passkeyPrompt:{entry:"sendUpdate",on:{SKIP:{actions:"setConfirmAttributeCompleteStep",target:"resolved"},SUBMIT:{actions:"setConfirmAttributeCompleteStep",target:"resolved"}}},resolved:{type:"final",data:t=>({challengeName:t.challengeName,missingAttributes:t.missingAttributes,remoteError:t.remoteError,step:t.step,totpSecretCode:t.totpSecretCode,username:t.username,unverifiedUserAttributes:t.unverifiedUserAttributes,allowedMfaTypes:t.allowedMfaTypes})}}},{actions:{...lh,sendUpdate:hy()},guards:vy,services:{autoSignIn(){return qA()},async fetchUserAttributes(){return tF()},confirmSignUp({formValues:t,username:n}){const{confirmation_code:r}=t,o={username:n,confirmationCode:r};return e.handleConfirmSignUp(o)},resendSignUpCode({username:t}){return e.handleResendSignUpCode({username:t})},signInWithRedirect(t,{data:n}){return eF(n)},handleSignUp(t){const{formValues:n,loginMechanisms:r,username:o,selectedAuthMethod:s,preferredChallenge:a}=t,u=r[0],f=Jae(o,n,u,s??a);return e.handleSignUp(f)},async validateSignUp(t){return yy(t.formValues,t.touched,t.passwordSettings,[e.validateFormPassword,e.validateConfirmPassword,e.validatePreferredUsername,e.validateRequiredFieldsForAuthMethod,e.validateCustomSignUp])}}})}const Zue=()=>yc({initial:"pending",id:"signOutActor",predictableActionArguments:!0,states:{pending:{tags:"pending",invoke:{src:"signOut",onDone:"resolved",onError:"rejected"}},resolved:{type:"final"},rejected:{type:"final"}}},{services:{signOut:()=>tX()}});function Yue(){return yc({id:"verifyUserAttributesActor",initial:"selectUserAttributes",predictableActionArguments:!0,states:{selectUserAttributes:{initial:"edit",exit:["clearError","clearTouched","sendUpdate"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:{target:"#verifyUserAttributesActor.resolved"},CHANGE:{actions:"handleInput"}}},submit:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"sendUserAttributeVerificationCode",onDone:{actions:["setSelectedUserAttribute","setCodeDeliveryDetails"],target:"#verifyUserAttributesActor.confirmVerifyUserAttribute"},onError:{actions:"setRemoteError",target:"edit"}}}}},confirmVerifyUserAttribute:{initial:"edit",exit:["clearError","clearFormValues","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:"#verifyUserAttributesActor.resolved",CHANGE:{actions:"handleInput"}}},submit:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"confirmVerifyUserAttribute",onDone:{actions:["setConfirmAttributeCompleteStep","clearSelectedUserAttribute"],target:"#verifyUserAttributesActor.resolved"},onError:{actions:"setRemoteError",target:"edit"}}}}},resolved:{type:"final",data:({step:e})=>({step:e})}}},{actions:{...lh,sendUpdate:hy()},services:{sendUserAttributeVerificationCode({formValues:{unverifiedAttr:e}}){return sX({userAttributeKey:e})},async confirmVerifyUserAttribute({formValues:{confirmation_code:e},selectedUserAttribute:t}){return IQ({confirmationCode:e,userAttributeKey:t})},async validateFields(e){return yy(e.formValues,e.touched,e.passwordSettings,[ji.validateFormPassword,ji.validateConfirmPassword])}}})}const Jp=(e,t)=>{const n=tle(e.passwordlessCapabilities,e.config?.passwordless?.hiddenAuthMethods),r=e.config?.passwordless?.preferredAuthMethod??e.passwordlessCapabilities?.preferredChallenge;return{...e.actorDoneData,step:e?.actorDoneData?.step??t,formValues:{},touched:{},validationError:{},formFields:e.config?.formFields,loginMechanisms:e.config?.loginMechanisms,passwordSettings:e.config?.passwordSettings,signUpAttributes:e.config?.signUpAttributes,socialProviders:e.config?.socialProviders,availableAuthMethods:n,preferredChallenge:r,passwordless:e.config?.passwordless}},{choose:Que,stop:Xue}=z$,Id=e=>Xue(e),Jue={on:{INIT:{actions:"configure",target:"getConfig"},SIGN_OUT:"#authenticator.signOut"}},ece={always:{actions:"configure",target:"getConfig"}};function tce(e){const{useNextWaitConfig:t,...n}=e??{};return yc({id:"authenticator",initial:"idle",context:{user:void 0,config:{},services:ji,actorRef:void 0,hasSetup:!1},predictableActionArguments:!0,states:{idle:{invoke:{src:"handleGetCurrentUser",onDone:{actions:"setUser",target:"setup"},onError:{target:"setup"}}},setup:{initial:"initConfig",states:{initConfig:t?ece:Jue,getConfig:{invoke:{src:"getAmplifyConfig",onDone:[{actions:["applyAmplifyConfig","setHasSetup"],cond:"hasUser",target:"#authenticator.authenticated"},{actions:["applyAmplifyConfig","setHasSetup"],target:"goToInitialState"}]}},goToInitialState:{always:[{cond:"isInitialStateSignUp",target:"#authenticator.signUpActor"},{cond:"isInitialStateResetPassword",target:"#authenticator.forgotPasswordActor"},{target:"#authenticator.signInActor"}]}}},getCurrentUser:{invoke:{src:"handleGetCurrentUser",onDone:{actions:"setUser",target:"#authenticator.authenticated"},onError:{target:"#authenticator.setup"}}},signInActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignInActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:Id("signInActor")}},on:{FORGOT_PASSWORD:"forgotPasswordActor",SELECT_METHOD:{actions:"forwardToActor"},SHOW_AUTH_METHODS:{actions:"forwardToActor"},SIGN_IN:"signInActor",SIGN_UP:"signUpActor","done.invoke.signInActor":[{cond:"hasCompletedAttributeConfirmation",target:"#authenticator.getCurrentUser"},{cond:"isShouldConfirmUserAttributeStep",actions:"setActorDoneData",target:"#authenticator.verifyUserAttributesActor"},{cond:"isResetPasswordStep",actions:"setActorDoneData",target:"#authenticator.forgotPasswordActor"},{cond:"isConfirmSignUpStep",actions:"setActorDoneData",target:"#authenticator.signUpActor"}]}},signUpActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignUpActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:Id("signUpActor")}},on:{SIGN_IN:"signInActor","done.invoke.signUpActor":[{cond:"hasCompletedAttributeConfirmation",target:"#authenticator.getCurrentUser"},{cond:"isShouldConfirmUserAttributeStep",actions:"setActorDoneData",target:"#authenticator.verifyUserAttributesActor"},{cond:"isConfirmUserAttributeStep",target:"#authenticator.verifyUserAttributesActor"},{actions:"setActorDoneData",target:"#authenticator.signInActor"}]}},forgotPasswordActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnForgotPasswordActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:Id("forgotPasswordActor")}},on:{SIGN_IN:"signInActor","done.invoke.forgotPasswordActor":[{target:"#authenticator.signInActor"}]}},verifyUserAttributesActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnVerifyUserAttributesActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:Id("verifyUserAttributesActor")}},on:{"done.invoke.verifyUserAttributesActor":[{actions:"setActorDoneData",target:"#authenticator.getCurrentUser"}]}},authenticated:{initial:"idle",states:{idle:{on:{TOKEN_REFRESH:"refreshUser"}},refreshUser:{invoke:{src:"#authenticator.getCurrentUser",onDone:{actions:"setUser",target:"idle"},onError:{target:"#authenticator.signOut"}}}},on:{SIGN_OUT:"signOut"}},signOut:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignOutActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:Id("signOutActor")}},on:{"done.invoke.signOutActor":{actions:"clearUser",target:"setup.getConfig"}}}},on:{SIGN_IN_WITH_REDIRECT:{target:"#authenticator.getCurrentUser"},CHANGE:{actions:"forwardToActor"},BLUR:{actions:"forwardToActor"},SUBMIT:{actions:"forwardToActor"},FEDERATED_SIGN_IN:{actions:"forwardToActor"},RESEND:{actions:"forwardToActor"},SIGN_IN:{actions:"forwardToActor"},SKIP:{actions:"forwardToActor"}}},{actions:{...lh,forwardToActor:Que([{cond:"hasActor",actions:eie(({actorRef:o})=>o)}]),setActorDoneData:vs({actorDoneData:(o,s)=>({challengeName:s.data.challengeName,codeDeliveryDetails:s.data.codeDeliveryDetails,missingAttributes:s.data.missingAttributes,remoteError:s.data.remoteError,username:s.data.username,step:s.data.step,totpSecretCode:s.data.totpSecretCode,unverifiedUserAttributes:s.data.unverifiedUserAttributes,allowedMfaTypes:s.data.allowedMfaTypes})}),applyAmplifyConfig:vs({passwordlessCapabilities:(o,{data:s})=>s.passwordlessCapabilities,config(o,{data:s}){const{loginMechanisms:a=s.loginMechanisms??[],signUpAttributes:u=s.signUpAttributes??[],socialProviders:c=s.socialProviders??[],initialState:f,formFields:h,passwordSettings:g=s.passwordFormat??{},passwordless:m}=o.config;return a.length===0&&a.push("username"),{formFields:nce(h)??{},initialState:f,loginMechanisms:a,passwordSettings:g,passwordless:m,signUpAttributes:u,socialProviders:c}}}),spawnSignInActor:vs({actorRef:(o,s)=>{const{services:a}=o,u=Vue({services:a}).withContext(Jp(o,"SIGN_IN"));return Ad(u,{name:"signInActor"})}}),spawnSignUpActor:vs({actorRef:(o,s)=>{const{services:a}=o,u=Kue({services:a}).withContext(Jp(o,"SIGN_UP"));return Ad(u,{name:"signUpActor"})}}),spawnForgotPasswordActor:vs({actorRef:(o,s)=>{const{services:a}=o,u=Hue({services:a}).withContext(Jp(o,"FORGOT_PASSWORD"));return Ad(u,{name:"forgotPasswordActor"})}}),spawnVerifyUserAttributesActor:vs({actorRef:o=>{const s=Yue().withContext(Jp(o));return Ad(s,{name:"verifyUserAttributesActor"})}}),spawnSignOutActor:vs({actorRef:o=>{const s=Zue().withContext({user:o?.user});return Ad(s,{name:"signOutActor"})}}),configure:vs((o,s)=>{const{services:a,...u}=G$(n)?s.data??{}:n;return{services:{...ji,...a},config:u}}),setHasSetup:vs({hasSetup:!0})},guards:{...vy,hasActor:({actorRef:o})=>!!o,isInitialStateSignUp:({config:o})=>o.initialState==="signUp",isInitialStateResetPassword:({config:o})=>o.initialState==="forgotPassword",shouldSetup:({hasSetup:o})=>!o,hasUser:({user:o})=>!!o},services:{getAmplifyConfig:({services:o})=>o.getAmplifyConfig(),handleGetCurrentUser:({services:o})=>o.getCurrentUser()}})}function nce(e){return e&&Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{let r=e[t][n];r.required=r.isRequired})}),e}const rce={small:{value:"1px"},medium:{value:"2px"},large:{value:"3px"}},oce={red:{10:{value:"hsl(0, 75%, 95%)"},20:{value:"hsl(0, 75%, 85%)"},40:{value:"hsl(0, 75%, 75%)"},60:{value:"hsl(0, 50%, 50%)"},80:{value:"hsl(0, 95%, 30%)"},90:{value:"hsl(0, 100%, 20%)"},100:{value:"hsl(0, 100%, 15%)"}},orange:{10:{value:"hsl(30, 75%, 95%)"},20:{value:"hsl(30, 75%, 85%)"},40:{value:"hsl(30, 75%, 75%)"},60:{value:"hsl(30, 50%, 50%)"},80:{value:"hsl(30, 95%, 30%)"},90:{value:"hsl(30, 100%, 20%)"},100:{value:"hsl(30, 100%, 15%)"}},yellow:{10:{value:"hsl(60, 75%, 95%)"},20:{value:"hsl(60, 75%, 85%)"},40:{value:"hsl(60, 75%, 75%)"},60:{value:"hsl(60, 50%, 50%)"},80:{value:"hsl(60, 95%, 30%)"},90:{value:"hsl(60, 100%, 20%)"},100:{value:"hsl(60, 100%, 15%)"}},green:{10:{value:"hsl(130, 60%, 95%)"},20:{value:"hsl(130, 60%, 90%)"},40:{value:"hsl(130, 44%, 63%)"},60:{value:"hsl(130, 43%, 46%)"},80:{value:"hsl(130, 33%, 37%)"},90:{value:"hsl(130, 27%, 29%)"},100:{value:"hsl(130, 22%, 23%)"}},teal:{10:{value:"hsl(190, 75%, 95%)"},20:{value:"hsl(190, 75%, 85%)"},40:{value:"hsl(190, 70%, 70%)"},60:{value:"hsl(190, 50%, 50%)"},80:{value:"hsl(190, 95%, 30%)"},90:{value:"hsl(190, 100%, 20%)"},100:{value:"hsl(190, 100%, 15%)"}},blue:{10:{value:"hsl(220, 95%, 95%)"},20:{value:"hsl(220, 85%, 85%)"},40:{value:"hsl(220, 70%, 70%)"},60:{value:"hsl(220, 50%, 50%)"},80:{value:"hsl(220, 95%, 30%)"},90:{value:"hsl(220, 100%, 20%)"},100:{value:"hsl(220, 100%, 15%)"}},purple:{10:{value:"hsl(300, 95%, 95%)"},20:{value:"hsl(300, 85%, 85%)"},40:{value:"hsl(300, 70%, 70%)"},60:{value:"hsl(300, 50%, 50%)"},80:{value:"hsl(300, 95%, 30%)"},90:{value:"hsl(300, 100%, 20%)"},100:{value:"hsl(300, 100%, 15%)"}},pink:{10:{value:"hsl(340, 95%, 95%)"},20:{value:"hsl(340, 90%, 85%)"},40:{value:"hsl(340, 70%, 70%)"},60:{value:"hsl(340, 50%, 50%)"},80:{value:"hsl(340, 95%, 30%)"},90:{value:"hsl(340, 100%, 20%)"},100:{value:"hsl(340, 100%, 15%)"}},neutral:{10:{value:"hsl(210, 5%, 98%)"},20:{value:"hsl(210, 5%, 94%)"},40:{value:"hsl(210, 5%, 87%)"},60:{value:"hsl(210, 10%, 58%)"},80:{value:"hsl(210, 10%, 40%)"},90:{value:"hsl(210, 25%, 25%)"},100:{value:"hsl(210, 50%, 10%)"}},primary:{10:{value:"{colors.teal.10.value}"},20:{value:"{colors.teal.20.value}"},40:{value:"{colors.teal.40.value}"},60:{value:"{colors.teal.60.value}"},80:{value:"{colors.teal.80.value}"},90:{value:"{colors.teal.90.value}"},100:{value:"{colors.teal.100.value}"}},secondary:{10:{value:"{colors.purple.10.value}"},20:{value:"{colors.purple.20.value}"},40:{value:"{colors.purple.40.value}"},60:{value:"{colors.purple.60.value}"},80:{value:"{colors.purple.80.value}"},90:{value:"{colors.purple.90.value}"},100:{value:"{colors.purple.100.value}"}},font:{primary:{value:"{colors.neutral.100.value}"},secondary:{value:"{colors.neutral.90.value}"},tertiary:{value:"{colors.neutral.80.value}"},disabled:{value:"{colors.neutral.60.value}"},inverse:{value:"{colors.white.value}"},interactive:{value:"{colors.primary.80.value}"},hover:{value:"{colors.primary.90.value}"},focus:{value:"{colors.primary.100.value}"},active:{value:"{colors.primary.100.value}"},info:{value:"{colors.blue.90.value}"},warning:{value:"{colors.orange.90.value}"},error:{value:"{colors.red.90.value}"},success:{value:"{colors.green.90.value}"}},background:{primary:{value:"{colors.white.value}"},secondary:{value:"{colors.neutral.10.value}"},tertiary:{value:"{colors.neutral.20.value}"},quaternary:{value:"{colors.neutral.60.value}"},disabled:{value:"{colors.background.tertiary.value}"},info:{value:"{colors.blue.10.value}"},warning:{value:"{colors.orange.10.value}"},error:{value:"{colors.red.10.value}"},success:{value:"{colors.green.10.value}"}},border:{primary:{value:"{colors.neutral.60.value}"},secondary:{value:"{colors.neutral.40.value}"},tertiary:{value:"{colors.neutral.20.value}"},disabled:{value:"{colors.border.tertiary.value}"},pressed:{value:"{colors.primary.100.value}"},focus:{value:"{colors.primary.100.value}"},error:{value:"{colors.red.80.value}"},info:{value:"{colors.blue.80.value}"},success:{value:"{colors.green.80.value}"},warning:{value:"{colors.orange.80.value}"}},shadow:{primary:{value:"hsla(210, 50%, 10%, 0.25)"},secondary:{value:"hsla(210, 50%, 10%, 0.15)"},tertiary:{value:"hsla(210, 50%, 10%, 0.05)"}},overlay:{5:{value:"hsla(0, 0%, 0%, 0.05)"},10:{value:"hsla(0, 0%, 0%, 0.1)"},20:{value:"hsla(0, 0%, 0%, 0.2)"},30:{value:"hsla(0, 0%, 0%, 0.3)"},40:{value:"hsla(0, 0%, 0%, 0.4)"},50:{value:"hsla(0, 0%, 0%, 0.5)"},60:{value:"hsla(0, 0%, 0%, 0.6)"},70:{value:"hsla(0, 0%, 0%, 0.7)"},80:{value:"hsla(0, 0%, 0%, 0.8)"},90:{value:"hsla(0, 0%, 0%, 0.9)"}},black:{value:"hsl(0, 0%, 0%)"},white:{value:"hsl(0, 0%, 100%)"},transparent:{value:"transparent"}},sce={alignItems:{value:"center"},justifyContent:{value:"space-between"},color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.tertiary.value}"},paddingBlock:{value:"{space.small.value}"},paddingInline:{value:"{space.medium.value}"},icon:{size:{value:"{fontSizes.xl.value}"}},heading:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"}},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"}}},ice={message:{backgroundColor:{value:"{colors.background.secondary.value}"},borderRadius:{value:"{radii.large.value}"},gap:{value:"{space.small.value}"},paddingBlock:{value:"{space.small.value}"},paddingInline:{value:"{space.small.value}"},user:{backgroundColor:{value:"{colors.background.secondary.value}"}},assistant:{backgroundColor:{value:"{colors.primary.10.value}"}},sender:{gap:{value:"{space.small.value}"},username:{color:{value:"{colors.font.primary.value}"},fontSize:{value:"inherit"},fontWeight:{value:"{fontWeights.bold.value}"}},timestamp:{color:{value:"{colors.font.tertiary.value}"},fontSize:{value:"inherit"},fontWeight:{value:"inherit"}}},body:{gap:{value:"{space.xs.value}"}},actions:{gap:{value:"{space.xs.value}"}}},form:{gap:{value:"{space.small.value}"},padding:{value:"{space.small.value}"}},attachment:{borderColor:{value:"{colors.border.secondary.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderRadius:{value:"{radii.small.value}"},fontSize:{value:"{fontSizes.small.value}"},paddingBlock:{value:"{space.xxxs.value}"},paddingInline:{value:"{space.xs.value}"},gap:{value:"{space.xs.value}"},list:{padding:{value:"{space.xs.value}"},paddingBlockStart:{value:"0"},gap:{value:"{space.xxs.value}"}},name:{color:{value:"{colors.font.primary.value}"},fontSize:{value:"{fontSizes.small.value}"},fontWeight:{value:"{fontWeights.normal.value}"}},size:{color:{value:"{colors.font.tertiary.value}"},fontSize:{value:"{fontSizes.small.value}"},fontWeight:{value:"{fontWeights.normal.value}"}},remove:{padding:{value:"{space.xxs.value}"}},image:{width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"}}}},ace={menu:{width:{value:"100%"},marginBlockStart:{value:"{space.xxxs}"},backgroundColor:{value:"{colors.background.primary}"},borderColor:{value:"{colors.border.primary}"},borderWidth:{value:"{borderWidths.small}"},borderStyle:{value:"solid"},borderRadius:{value:"{radii.small}"},options:{display:{value:"flex"},flexDirection:{value:"column"},maxHeight:{value:"300px"}},option:{backgroundColor:{value:"{colors.background.primary}"},color:{value:"currentcolor"},cursor:{value:"pointer"},transitionDuration:{value:"{time.short}"},transitionProperty:{value:"background-color, color"},transitionTimingFunction:{value:"ease"},_active:{backgroundColor:{value:"{colors.primary.80}"},color:{value:"{colors.white}"}}},_empty:{display:{value:"flex"}},_loading:{alignItems:{value:"center"},display:{value:"flex"},gap:{value:"{space.xxxs}"}},spaceShared:{paddingBlock:{value:"{space.xs}"},paddingInline:{value:"{space.small}"}}}},lce={maxWidth:{value:"60rem"},modal:{width:{value:"{space.relative.full}"},height:{value:"{space.relative.full}"},backgroundColor:{value:"{colors.overlay.50.value}"},top:{value:"{space.zero}"},left:{value:"{space.zero}"}},container:{widthMax:{value:"30rem"}},router:{borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},boxShadow:{value:"{shadows.medium.value}"}},footer:{paddingBottom:{value:"{space.medium.value}"}},form:{padding:{value:"{space.xl.value}"}},state:{inactive:{backgroundColor:{value:"{colors.background.secondary.value}"}}},orContainer:{color:{value:"{colors.neutral.80.value}"},orLine:{backgroundColor:{value:"{colors.background.primary.value}"}}}},uce={color:{value:"{colors.font.tertiary.value}"},lineHeight:{value:1},fontWeight:{value:"{fontWeights.semibold.value}"},fontSize:{value:"{fontSizes.small.value}"},textAlign:{value:"center"},width:{value:"{fontSizes.xxl.value}"},height:{value:"{fontSizes.xxl.value}"},backgroundColor:{value:"{colors.background.tertiary}"},borderRadius:{value:"100%"},borderColor:{value:"{colors.border.primary.value}"},borderWidth:{value:"{borderWidths.medium.value}"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"},borderColor:{value:"{colors.border.info.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"},borderColor:{value:"{colors.border.warning.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"},borderColor:{value:"{colors.border.success.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"},borderColor:{value:"{colors.border.error.value}"}},small:{fontSize:{value:"{fontSizes.xs.value}"},width:{value:"{fontSizes.xl.value}"},height:{value:"{fontSizes.xl.value}"}},large:{fontSize:{value:"{fontSizes.medium.value}"},width:{value:"{fontSizes.xxxl.value}"},height:{value:"{fontSizes.xxxl.value}"}}},cce={color:{value:"{colors.font.primary.value}"},lineHeight:{value:1},fontWeight:{value:"{fontWeights.semibold.value}"},fontSize:{value:"{fontSizes.small.value}"},textAlign:{value:"center"},paddingVertical:{value:"{space.xs.value}"},paddingHorizontal:{value:"{space.small.value}"},backgroundColor:{value:"{colors.background.tertiary.value}"},borderRadius:{value:"{radii.xl.value}"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"}},small:{fontSize:{value:"{fontSizes.xs.value}"},paddingVertical:{value:"{space.xxs.value}"},paddingHorizontal:{value:"{space.xs.value}"}},large:{fontSize:{value:"{fontSizes.medium.value}"},paddingVertical:{value:"{space.small.value}"},paddingHorizontal:{value:"{space.medium.value}"}}},dce={flexDirection:{value:"row"},flexWrap:{value:"wrap"},gap:{value:"0"},color:{value:"{colors.font.tertiary}"},item:{flexDirection:{value:"row"},color:{value:"inherit"},fontSize:{value:"inherit"},alignItems:{value:"center"},lineHeight:{value:"1"}},separator:{color:{value:"inherit"},fontSize:{value:"inherit"},paddingInline:{value:"{space.xxs}"}},link:{color:{value:"{components.link.color}"},fontSize:{value:"inherit"},fontWeight:{value:"normal"},textDecoration:{value:"none"},paddingInline:{value:"{space.xs}"},paddingBlock:{value:"{space.xxs}"},current:{color:{value:"inherit"},fontSize:{value:"inherit"},fontWeight:{value:"normal"},textDecoration:{value:"none"}}}},fce={fontWeight:{value:"{fontWeights.bold.value}"},transitionDuration:{value:"{components.fieldcontrol.transitionDuration.value}"},fontSize:{value:"{components.fieldcontrol.fontSize.value}"},lineHeight:{value:"{components.fieldcontrol.lineHeight.value}"},paddingBlockStart:{value:"{components.fieldcontrol.paddingBlockStart.value}"},paddingBlockEnd:{value:"{components.fieldcontrol.paddingBlockEnd.value}"},paddingInlineStart:{value:"{components.fieldcontrol.paddingInlineStart.value}"},paddingInlineEnd:{value:"{components.fieldcontrol.paddingInlineEnd.value}"},backgroundColor:{value:"transparent"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},borderWidth:{value:"{components.fieldcontrol.borderWidth.value}"},borderStyle:{value:"{components.fieldcontrol.borderStyle.value}"},borderRadius:{value:"{components.fieldcontrol.borderRadius.value}"},color:{value:"{colors.font.primary.value}"},_hover:{color:{value:"{colors.font.focus.value}"},backgroundColor:{value:"{colors.primary.10.value}"},borderColor:{value:"{colors.primary.60.value}"}},_focus:{color:{value:"{colors.font.focus.value}"},backgroundColor:{value:"{colors.primary.10.value}"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_active:{color:{value:"{colors.font.active.value}"},backgroundColor:{value:"{colors.primary.20.value}"},borderColor:{value:"{colors.primary.100.value}"}},_loading:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.tertiary.value}"}},_disabled:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.tertiary.value}"}},outlined:{info:{borderColor:{value:"{colors.blue.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.blue.100}"},_hover:{borderColor:{value:"{colors.blue.60.value}"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.100.value}"}},_focus:{borderColor:{value:"{colors.blue.100.value}"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.100.value}"},boxShadow:{value:"{components.fieldcontrol.info._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.blue.100.value}"},backgroundColor:{value:"{colors.blue.20.value}"},color:{value:"{colors.blue.100.value}"}}},warning:{borderColor:{value:"{colors.orange.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.orange.100}"},_hover:{borderColor:{value:"{colors.orange.60.value}"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.100.value}"}},_focus:{borderColor:{value:"{colors.orange.100.value}"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.100.value}"},boxShadow:{value:"{components.fieldcontrol.warning._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.orange.100.value}"},backgroundColor:{value:"{colors.orange.20.value}"},color:{value:"{colors.orange.100.value}"}}},success:{borderColor:{value:"{colors.green.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.green.100}"},_hover:{borderColor:{value:"{colors.green.60.value}"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.100.value}"}},_focus:{borderColor:{value:"{colors.green.100.value}"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.100.value}"},boxShadow:{value:"{components.fieldcontrol.success._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.green.100.value}"},backgroundColor:{value:"{colors.green.20.value}"},color:{value:"{colors.green.100.value}"}}},error:{borderColor:{value:"{colors.red.80.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.red.100}"},_hover:{borderColor:{value:"{colors.red.80.value}"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.100.value}"}},_focus:{borderColor:{value:"{colors.red.100.value}"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.100.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.red.100.value}"},backgroundColor:{value:"{colors.red.20.value}"},color:{value:"{colors.red.100.value}"}}},overlay:{borderColor:{value:"{colors.overlay.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.primary.value}"},_hover:{borderColor:{value:"{colors.overlay.60.value}"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.neutral.90.value}"}},_focus:{borderColor:{value:"{colors.overlay.90.value}"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.neutral.90.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.overlay.90.value}"},backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.neutral.100.value}"}}}},primary:{borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},backgroundColor:{value:"{colors.primary.80.value}"},color:{value:"{colors.font.inverse.value}"},_disabled:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_loading:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.100.value}"},color:{value:"{colors.font.inverse.value}"}},info:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.info._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.100.value}"},color:{value:"{colors.font.inverse.value}"}}},warning:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.100.value}"},color:{value:"{colors.font.inverse.value}"}}},error:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.100.value}"},color:{value:"{colors.font.inverse.value}"}}},success:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.success._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.100.value}"},color:{value:"{colors.font.inverse.value}"}}},overlay:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.70}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.90.value}"},color:{value:"{colors.font.inverse.value}"}}}},menu:{borderWidth:{value:"{space.zero.value}"},backgroundColor:{value:"transparent"},justifyContent:{value:"start"},_hover:{color:{value:"{colors.font.inverse.value}"},backgroundColor:{value:"{colors.primary.80.value}"}},_focus:{color:{value:"{colors.font.inverse.value}"},backgroundColor:{value:"{colors.primary.80.value}"}},_active:{color:{value:"{colors.font.inverse.value}"},backgroundColor:{value:"{colors.primary.90.value}"}},_disabled:{color:{value:"{colors.font.disabled.value}"}}},link:{backgroundColor:{value:"transparent"},borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small.value}"},color:{value:"{colors.font.interactive.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.10.value}"},color:{value:"{colors.font.hover.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.10.value}"},color:{value:"{colors.font.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.20.value}"},color:{value:"{colors.font.active.value}"}},_disabled:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled.value}"}},_loading:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled.value}"}},info:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.blue.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.100.value}"},boxShadow:{value:"{components.fieldcontrol.info._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.20.value}"},color:{value:"{colors.blue.100.value}"}}},warning:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.orange.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.100.value}"},boxShadow:{value:"{components.fieldcontrol.warning._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.20.value}"},color:{value:"{colors.orange.100.value}"}}},success:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.green.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.100.value}"},boxShadow:{value:"{components.fieldcontrol.success._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.20.value}"},color:{value:"{colors.green.100.value}"}}},error:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.red.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.100.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.20.value}"},color:{value:"{colors.red.100.value}"}}},overlay:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.neutral.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.overlay.80.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.overlay.90.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.overlay.90.value}"}}}},warning:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.red.60}"},borderWidth:{value:"{borderWidths.small}"},color:{value:"{colors.red.60}"},_hover:{borderColor:{value:"{colors.red.80}"},backgroundColor:{value:"{colors.red.10}"},color:{value:"{colors.font.error}"}},_focus:{borderColor:{value:"{colors.red.80}"},backgroundColor:{value:"{colors.red.10}"},color:{value:"{colors.red.80}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow}"}},_active:{borderColor:{value:"{colors.red.100}"},backgroundColor:{value:"{colors.red.20}"},color:{value:"{colors.red.100}"}},_disabled:{borderColor:{value:"{colors.border.tertiary}"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled}"}},_loading:{borderColor:{value:"{colors.border.tertiary}"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled}"}}},destructive:{borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small}"},borderStyle:{value:"solid"},backgroundColor:{value:"{colors.red.60}"},color:{value:"{colors.font.inverse}"},_disabled:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled}"},color:{value:"{colors.font.disabled}"}},_loading:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled}"},color:{value:"{colors.font.disabled}"}},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.80}"},color:{value:"{colors.font.inverse}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.80}"},color:{value:"{colors.font.inverse}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.100}"},color:{value:"{colors.font.inverse}"}}},small:{fontSize:{value:"{components.fieldcontrol.small.fontSize.value}"},paddingBlockStart:{value:"{components.fieldcontrol.small.paddingBlockStart.value}"},paddingBlockEnd:{value:"{components.fieldcontrol.small.paddingBlockEnd.value}"},paddingInlineStart:{value:"{components.fieldcontrol.small.paddingInlineStart.value}"},paddingInlineEnd:{value:"{components.fieldcontrol.small.paddingInlineEnd.value}"}},large:{fontSize:{value:"{components.fieldcontrol.large.fontSize.value}"},paddingBlockStart:{value:"{components.fieldcontrol.large.paddingBlockStart.value}"},paddingBlockEnd:{value:"{components.fieldcontrol.large.paddingBlockEnd.value}"},paddingInlineStart:{value:"{components.fieldcontrol.large.paddingInlineStart.value}"},paddingInlineEnd:{value:"{components.fieldcontrol.large.paddingInlineEnd.value}"}},loaderWrapper:{alignItems:{value:"center"},gap:{value:"{space.xs.value}"}}},hce={backgroundColor:{value:"{colors.background.primary.value}"},borderRadius:{value:"{radii.xs.value}"},borderWidth:{value:"0"},borderStyle:{value:"solid"},borderColor:{value:"transparent"},boxShadow:{value:"none"},padding:{value:"{space.medium.value}"},outlined:{backgroundColor:{value:"{components.card.backgroundColor.value}"},borderRadius:{value:"{radii.xs.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},boxShadow:{value:"{components.card.boxShadow.value}"}},elevated:{backgroundColor:{value:"{components.card.backgroundColor.value}"},borderRadius:{value:"{radii.xs.value}"},borderWidth:{value:"0"},borderStyle:{value:"solid"},borderColor:{value:"transparent"},boxShadow:{value:"{shadows.medium.value}"}}},pce={cursor:{value:"pointer"},alignItems:{value:"center"},_disabled:{cursor:{value:"not-allowed"}},button:{position:{value:"relative"},alignItems:{value:"center"},justifyContent:{value:"center"},color:{value:"{colors.font.inverse.value}"},before:{width:{value:"100%"},height:{value:"100%"},borderWidth:{value:"{borderWidths.medium.value}"},borderRadius:{value:"20%"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"}},_focus:{outlineColor:{value:"{colors.transparent.value}"},outlineStyle:{value:"solid"},outlineWidth:{value:"{outlineWidths.medium.value}"},outlineOffset:{value:"{outlineOffsets.medium.value}"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_disabled:{borderColor:{value:"{colors.border.disabled.value}"}},_error:{borderColor:{value:"{colors.border.error.value}"},_focus:{borderColor:{value:"{colors.border.error.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}}}},icon:{backgroundColor:{value:"{colors.primary.80.value}"},borderRadius:{value:"20%"},opacity:{value:"{opacities.0.value}"},transform:{value:"scale(0)"},transitionProperty:{value:"all"},transitionDuration:{value:"{time.short.value}"},transitionTimingFunction:{value:"ease-in-out"},_checked:{opacity:{value:"{opacities.100.value}"},transform:{value:"scale(1)"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}},_indeterminate:{opacity:{value:"{opacities.100.value}"},transform:{value:"scale(1)"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}}},label:{color:{value:"{components.text.color.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"}}}},gce={alignItems:{value:"flex-start"},alignContent:{value:"center"},flexDirection:{value:"column"},justifyContent:{value:"center"}},mce={pagination:{current:{color:{value:"{components.pagination.current.color}"},backgroundColor:{value:"{components.pagination.current.backgroundColor}"}},button:{color:{value:"{components.pagination.button.color}"},_hover:{backgroundColor:{value:"{components.pagination.button.hover.backgroundColor}"},color:{value:"{components.pagination.button.hover.color}"}},_disabled:{color:{value:"{components.pagination.button.disabled.color}"}}}},search:{input:{color:{value:"{components.searchfield.color}"}},button:{color:{value:"{components.searchfield.button.color}"},_active:{backgroundColor:{value:"{components.searchfield.button._active.backgroundColor}"},borderColor:{value:"{components.searchfield.button._active.borderColor}"},color:{value:"{components.searchfield.button._active.color}"}},_disabled:{backgroundColor:{value:"{components.searchfield.button._disabled.backgroundColor}"},borderColor:{value:"{components.searchfield.button._disabled.borderColor}"},color:{value:"{components.searchfield.button._disabled.color}"}},_focus:{backgroundColor:{value:"{components.searchfield.button._focus.backgroundColor}"},borderColor:{value:"{components.searchfield.button._focus.borderColor}"},color:{value:"{components.searchfield.button._focus.color}"}},_hover:{backgroundColor:{value:"{components.searchfield.button._hover.backgroundColor}"},borderColor:{value:"{components.searchfield.button._hover.borderColor}"},color:{value:"{components.searchfield.button._hover.color}"}}}}},vce={fontSize:{value:"{fontSizes.xs}"},gap:{value:"{space.relative.medium}"},svg:{path:{fill:{value:"{colors.font.primary}"}}},toolTip:{bottom:{value:"{space.large}"},color:{value:"{colors.teal.100}"},fontSize:{value:"{fontSizes.xxs}"}}},yce={height:{value:"{space.relative.full.value}"}},bce={borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},borderWidth:{value:"{borderWidths.medium.value}"},label:{color:{value:"{colors.font.tertiary.value}"},paddingInline:{value:"{space.medium.value}"},fontSize:{value:"{fontSizes.small.value}"},backgroundColor:{value:"{colors.background.primary.value}"}},small:{borderWidth:{value:"{borderWidths.small.value}"}},large:{borderWidth:{value:"{borderWidths.large.value}"}},opacity:{value:"{opacities.60.value}"}},Sce={backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"dashed"},borderWidth:{value:"{borderWidths.small}"},color:{value:"{colors.font.primary}"},gap:{value:"{space.small}"},paddingBlock:{value:"{space.xl}"},paddingInline:{value:"{space.large}"},textAlign:{value:"center"},_active:{backgroundColor:{value:"{colors.primary.10}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.primary}"}},_disabled:{backgroundColor:{value:"{colors.background.disabled}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.disabled}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.disabled}"}},accepted:{backgroundColor:{value:"{colors.background.success}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.success}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.success}"}},rejected:{backgroundColor:{value:"{colors.background.error}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.error}"}}},wce={backgroundColor:{value:"{colors.background.primary.value}"},item:{borderColor:{value:"{colors.border.secondary.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderRadius:{value:"{radii.small.value}"},trigger:{alignItems:{value:"center"},backgroundColor:{value:"{colors.background.primary.value}"},color:{value:"inherit"},gap:{value:"{space.small.value}"},justifyContent:{value:"space-between"},paddingBlock:{value:"{space.xs.value}"},paddingInline:{value:"{space.small.value}"},_hover:{color:{value:"inherit"},backgroundColor:{value:"{colors.overlay.5.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:{offsetX:"0",offsetY:"0",blurRadius:"0",spreadRadius:"2px",color:"{colors.border.focus.value}"}}}},content:{color:{value:"inherit"},paddingInline:{value:"{space.small.value}"},paddingBlockEnd:{value:"{space.small.value}"},paddingBlockStart:{value:"{space.xxxs.value}"}},icon:{color:{value:"{colors.font.tertiary.value}"},transitionDuration:{value:"{time.medium.value}"},transitionTimingFunction:{value:"cubic-bezier(0.87, 0, 0.13, 1)"}}}},Cce={gap:{value:"{space.xs.value}"},fontSize:{value:"{fontSizes.medium.value}"},flexDirection:{value:"column"},small:{gap:{value:"{space.xxxs.value}"},fontSize:{value:"{fontSizes.small.value}"}},large:{gap:{value:"{space.small.value}"},fontSize:{value:"{fontSizes.large.value}"}},label:{color:{value:"{colors.font.secondary.value}"}}},Ece={borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderRadius:{value:"{radii.small.value}"},color:{value:"{colors.font.primary.value}"},paddingBlockStart:{value:"{space.xs.value}"},paddingBlockEnd:{value:"{space.xs.value}"},paddingInlineStart:{value:"{space.medium.value}"},paddingInlineEnd:{value:"{space.medium.value}"},fontSize:{value:"{components.field.fontSize.value}"},lineHeight:{value:"{lineHeights.medium.value}"},transitionDuration:{value:"{time.medium.value}"},outlineColor:{value:"{colors.transparent.value}"},outlineStyle:{value:"solid"},outlineWidth:{value:"{outlineWidths.medium.value}"},outlineOffset:{value:"{outlineOffsets.medium.value}"},small:{fontSize:{value:"{components.field.small.fontSize.value}"},paddingBlockStart:{value:"{space.xxs.value}"},paddingBlockEnd:{value:"{space.xxs.value}"},paddingInlineStart:{value:"{space.small.value}"},paddingInlineEnd:{value:"{space.small.value}"}},large:{fontSize:{value:"{components.field.large.fontSize.value}"},paddingBlockStart:{value:"{space.xs.value}"},paddingBlockEnd:{value:"{space.xs.value}"},paddingInlineStart:{value:"{space.medium.value}"},paddingInlineEnd:{value:"{space.medium.value}"}},quiet:{borderStyle:{value:"none"},borderInlineStart:{value:"none"},borderInlineEnd:{value:"none"},borderBlockStart:{value:"none"},borderRadius:{value:"0"},_focus:{borderBlockEndColor:{value:"transparent"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_error:{borderBlockEndColor:{value:"{colors.border.error.value}"},_focus:{borderBlockEndColor:{value:"transparent"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}}}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.border.focus.value}"}}},_disabled:{color:{value:"{colors.font.disabled.value}"},cursor:{value:"not-allowed"},borderColor:{value:"{colors.transparent.value}"},backgroundColor:{value:"{colors.background.disabled.value}"}},_error:{borderColor:{value:"{colors.border.error.value}"},color:{value:"{colors.font.error.value}"},_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.border.error.value}"}}}},info:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.blue.100.value}"}}}},warning:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.orange.100.value}"}}}},success:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.green.100.value}"}}}},overlay:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.overlay.90.value}"}}}}},_ce={gap:{value:"{space.zero.value}"},vertical:{alignItems:{value:"center"}},outer:{alignItems:{value:"center"}}},xce={backgroundColor:{value:"transparent"},borderRadius:{value:"{radii.xs.value}"},flexDirection:{value:"column"},gap:{value:"{components.field.gap.value}"},legend:{color:{value:"{colors.font.primary.value}"},fontSize:{value:"{components.field.fontSize.value}"},fontWeight:{value:"{fontWeights.bold.value}"},lineHeight:{value:"{lineHeights.medium.value}"},small:{fontSize:"{components.field.small.fontSize.value}"},large:{fontSize:"{components.field.large.fontSize.value}"}},outlined:{padding:"{space.medium.value}",borderColor:"{colors.neutral.40.value}",borderWidth:"{borderWidths.small.value}",borderStyle:"solid",small:{padding:"{space.small.value}"},large:{padding:"{space.large.value}"}},small:{gap:"{components.field.small.gap.value}"},large:{gap:"{components.field.large.gap.value}"}},Ace={error:{color:{value:"{colors.font.error.value}"},fontSize:{value:"{fontSizes.small.value}"}},description:{color:{value:"{colors.font.secondary.value}"},fontStyle:{value:"italic"},fontSize:{value:"{fontSizes.small.value}"}}},Ice={dropzone:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"dashed"},borderWidth:{value:"{borderWidths.small}"},gap:{value:"{space.small}"},paddingBlock:{value:"{space.xl}"},paddingInline:{value:"{space.large}"},textAlign:{value:"center"},_active:{backgroundColor:{value:"{colors.primary.10}"},borderRadius:{value:"{components.fileuploader.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.fileuploader.dropzone.borderStyle}"},borderWidth:{value:"{borderWidths.medium}"}},icon:{color:{value:"{colors.border.primary}"},fontSize:{value:"{fontSizes.xxl}"}},text:{color:{value:"{colors.font.tertiary}"},fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"}}},file:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},paddingBlock:{value:"{space.xs}"},paddingInline:{value:"{space.small}"},gap:{value:"{space.small}"},alignItems:{value:"baseline"},name:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},size:{fontSize:{value:"{fontSizes.small}"},fontWeight:{value:"{fontWeights.normal}"},color:{value:"{colors.font.tertiary}"}},image:{width:{value:"{space.xxl}"},height:{value:"{space.xxl}"},backgroundColor:{value:"{colors.background.secondary}"},color:{value:"{colors.font.tertiary}"},borderRadius:{value:"{radii.small}"}}},filelist:{flexDirection:{value:"column"},gap:{value:"{space.small}"}},loader:{strokeLinecap:{value:"round"},strokeEmpty:{value:"{colors.border.secondary}"},strokeFilled:{value:"{components.loader.strokeFilled}"},strokeWidth:{value:"{borderWidths.large}"}},previewer:{backgroundColor:{value:"{colors.background.primary}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},borderRadius:{value:"{radii.small}"},paddingBlock:{value:"{space.zero}"},paddingInline:{value:"{space.zero}"},maxHeight:{value:"40rem"},maxWidth:{value:"auto"},text:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},body:{paddingBlock:{value:"{space.medium}"},paddingInline:{value:"{space.medium}"},gap:{value:"{space.small}"}},footer:{justifyContent:{value:"flex-end"}}}},Rce={gap:{value:"{space.medium.value}"},justifyContent:{value:"normal"},alignItems:{value:"stretch"},alignContent:{value:"normal"},flexWrap:{value:"nowrap"}},Tce={color:{value:"{colors.font.primary.value}"},lineHeight:{value:"{lineHeights.small.value}"},1:{fontSize:{value:"{fontSizes.xxxxl.value}"},fontWeight:{value:"{fontWeights.light.value}"}},2:{fontSize:{value:"{fontSizes.xxxl.value}"},fontWeight:{value:"{fontWeights.normal.value}"}},3:{fontSize:{value:"{fontSizes.xxl.value}"},fontWeight:{value:"{fontWeights.medium.value}"}},4:{fontSize:{value:"{fontSizes.xl.value}"},fontWeight:{value:"{fontWeights.semibold.value}"}},5:{fontSize:{value:"{fontSizes.large.value}"},fontWeight:{value:"{fontWeights.bold.value}"}},6:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.extrabold.value}"}}},Oce={highlighted:{fontWeight:{value:"{fontWeights.bold}"}}},Mce={lineHeight:{value:1},height:{value:"1em"}},Pce={color:{value:"{components.fieldcontrol.color.value}"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},fontSize:{value:"{components.fieldcontrol.fontSize.value}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor.value}"}}},Nce={maxWidth:{value:"100%"},height:{value:"auto"},objectFit:{value:"initial"},objectPosition:{value:"initial"}},kce={banner:{height:{value:"150px "},width:{value:"400px "}},button:{backgroundColor:{value:"#e8e8e8"},borderRadius:{value:"5px"},color:{value:"black"}},dialog:{height:{value:"50vh"},minHeight:{value:"400px"},minWidth:{value:"400px"},width:{value:"30vw"}},header:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.extrabold.value}"}}},Dce={active:{color:{value:"{colors.font.active.value}"}},color:{value:"{colors.font.interactive.value}"},focus:{color:{value:"{colors.font.focus.value}"}},hover:{color:{value:"{colors.font.hover.value}"}},visited:{color:{value:"{colors.font.interactive.value}"}}},Lce={cameraModule:{backgroundColor:{value:"{colors.background.primary.value}"}}},Uce={width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"},fontSize:{value:"{fontSizes.xs.value}"},strokeEmpty:{value:"{colors.neutral.20.value}"},strokeFilled:{value:"{colors.primary.80.value}"},strokeLinecap:{value:"round"},animationDuration:{value:"1s"},small:{width:{value:"{fontSizes.small.value}"},height:{value:"{fontSizes.small.value}"},fontSize:{value:"{fontSizes.xxs.value}"}},large:{width:{value:"{fontSizes.large.value}"},height:{value:"{fontSizes.large.value}"},fontSize:{value:"{fontSizes.small.value}"}},linear:{width:{value:"100%"},minWidth:{value:"5rem"},fontSize:{value:"{fontSizes.xxs.value}"},strokeWidth:{value:"{fontSizes.xxs.value}"},strokeFilled:{value:"{colors.primary.80.value}"},strokeEmpty:{value:"{colors.neutral.20.value}"},strokeLinecap:{value:"round"},animationDuration:{value:"1s"},small:{strokeWidth:{value:"{fontSizes.xxxs.value}"},fontSize:{value:"{fontSizes.xxxs.value}"}},large:{strokeWidth:{value:"{fontSizes.xs.value}"},fontSize:{value:"{fontSizes.xs.value}"}}},text:{fill:{value:"{colors.font.primary.value}"}}},Fce={backgroundColor:{value:"{colors.background.primary.value}"},borderRadius:{value:"{radii.medium.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},boxShadow:{value:"{shadows.large.value}"},flexDirection:{value:"column"},gap:{value:"{space.zero.value}"},maxWidth:{value:"30rem"},minWidth:{value:"14rem"},small:{width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"}},large:{width:{value:"{fontSizes.xxxl.value}"},height:{value:"{fontSizes.xxxl.value}"}},item:{minHeight:{value:"2.5rem"},paddingInlineStart:{value:"{space.medium.value}"},paddingInlineEnd:{value:"{space.medium.value}"}}},$ce={alignItems:{value:"center"},backgroundColor:{value:"{colors.background.tertiary.value}"},borderColor:{value:"transparent"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small.value}"},borderRadius:{value:"{radii.xs.value}"},color:{value:"{colors.font.primary.value}"},justifyContent:{value:"flex-start"},paddingBlock:{value:"{space.small.value}"},paddingInline:{value:"{space.medium.value}"},lineHeight:{value:"{lineHeights.small.value}"},icon:{size:{value:"{fontSizes.xl.value}"}},heading:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"}},dismiss:{gap:{value:"{space.xxs.value}"}},plain:{color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}}},outlined:{color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.primary.value}"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.info.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.error.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.success.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.warning.value}"}}},filled:{color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.secondary.value}"},borderColor:{value:"transparent"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"},borderColor:{value:"transparent"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"},borderColor:{value:"transparent"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"},borderColor:{value:"transparent"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"},borderColor:{value:"transparent"}}}},zce={current:{alignItems:{value:"center"},justifyContent:{value:"center"},color:{value:"{colors.font.inverse.value}"},fontSize:{value:"{fontSizes.small.value}"},backgroundColor:{value:"{colors.overlay.40.value}"}},button:{color:{value:"{colors.font.primary.value}"},paddingInlineStart:{value:"{space.xxs.value}"},paddingInlineEnd:{value:"{space.xxs.value}"},transitionProperty:{value:"background-color"},transitionDuration:{value:"{time.medium.value}"},hover:{backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.font.primary.value}"}},disabled:{color:{value:"{colors.font.disabled.value}"}}},ellipsis:{alignItems:{value:"baseline"},justifyContent:{value:"center"},paddingInlineStart:{value:"{space.xs.value}"},paddingInlineEnd:{value:"{space.xs.value}"}},itemContainer:{marginLeft:{value:"{space.xxxs.value}"},marginRight:{value:"{space.xxxs.value}"}},itemShared:{height:{value:"{fontSizes.xxl.value}"},minWidth:{value:"{fontSizes.xxl.value}"},borderRadius:{value:"{fontSizes.medium.value}"}}},jce={color:{value:"{components.fieldcontrol.color.value}"},button:{color:{value:"{components.button.color.value}"},_active:{backgroundColor:{value:"{components.button._active.backgroundColor.value}"},borderColor:{value:"{components.button._active.borderColor.value}"},color:{value:"{components.button._active.color.value}"}},_disabled:{backgroundColor:{value:"{components.button._disabled.backgroundColor.value}"},borderColor:{value:"{components.button._disabled.borderColor.value}"},color:{value:"{components.button._disabled.color.value}"}},_error:{color:{value:"{components.button.outlined.error.color.value}"},backgroundColor:{value:"{components.button.outlined.error.backgroundColor.value}"},borderColor:{value:"{components.button.outlined.error.borderColor.value}"},_active:{borderColor:{value:"{components.button.outlined.error._active.borderColor.value}"},backgroundColor:{value:"{components.button.outlined.error._active.backgroundColor.value}"},color:{value:"{components.button.outlined.error._active.color.value}"}},_focus:{borderColor:{value:"{components.button.outlined.error._focus.borderColor.value}"},backgroundColor:{value:"{components.button.outlined.error._focus.backgroundColor.value}"},color:{value:"{components.button.outlined.error._focus.color.value}"},boxShadow:{value:"{components.button.outlined.error._focus.boxShadow.value}"}},_hover:{borderColor:{value:"{components.button.outlined.error._hover.borderColor.value}"},backgroundColor:{value:"{components.button.outlined.error._hover.backgroundColor.value}"},color:{value:"{components.button.outlined.error._hover.color.value}"}}},_focus:{backgroundColor:{value:"{components.button._focus.backgroundColor.value}"},borderColor:{value:"{components.button._focus.borderColor.value}"},color:{value:"{components.button._focus.color.value}"}},_hover:{backgroundColor:{value:"{components.button._hover.backgroundColor.value}"},borderColor:{value:"{components.button._hover.borderColor.value}"},color:{value:"{components.button._hover.color.value}"}}}},Bce={color:{value:"{components.fieldcontrol.color}"},borderColor:{value:"{components.fieldcontrol.borderColor}"},fontSize:{value:"{components.fieldcontrol.fontSize}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor}"}}},Hce={borderRadius:{value:"{radii.small.value}"},transitionDuration:{value:"{time.long.value}"},startColor:{value:"{colors.background.secondary.value}"},endColor:{value:"{colors.background.tertiary.value}"},small:{height:{value:"{space.small.value}"}},default:{height:{value:"{space.medium.value}"}},large:{height:{value:"{space.large.value}"}}},qce={alignItems:{value:"center"},justifyContent:{value:"flex-start"},gap:{value:"inherit"},_disabled:{cursor:{value:"not-allowed"}},button:{alignItems:{value:"center"},justifyContent:{value:"center"},width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"},boxSizing:{value:"border-box"},borderWidth:{value:"{borderWidths.medium.value}"},borderStyle:{value:"solid"},borderRadius:{value:"50%"},borderColor:{value:"{colors.border.primary.value}"},color:{value:"{colors.background.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},transitionProperty:{value:"all"},transitionDuration:{value:"{time.medium.value}"},outlineColor:{value:"{colors.transparent.value}"},outlineStyle:{value:"solid"},outlineWidth:{value:"{outlineWidths.medium.value}"},outlineOffset:{value:"{outlineOffsets.medium.value}"},padding:{value:"{borderWidths.medium.value}"},small:{width:{value:"{fontSizes.small.value}"},height:{value:"{fontSizes.small.value}"}},large:{width:{value:"{fontSizes.large.value}"},height:{value:"{fontSizes.large.value}"}},_checked:{color:{value:"{colors.primary.80.value}"},_disabled:{color:{value:"{colors.background.disabled.value}"}}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_error:{borderColor:{value:"{colors.border.error.value}"},_focus:{boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}}},_disabled:{borderColor:{value:"{colors.border.disabled.value}"},backgroundColor:{value:"{colors.background.primary.value}"}}},label:{color:{value:"{components.text.color.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"}}}},Vce={radio:{borderWidth:{value:"{components.radio.button.borderWidth}"},borderColor:{value:"{components.radio.button.borderColor}"},backgroundColor:{value:"{components.radio.button.backgroundColor}"},_checked:{color:{value:"{components.radio.button._checked.color}"}},label:{color:{value:"{components.radio.label.color}"}}},legend:{color:{value:"{components.fieldset.legend.color}"},fontWeight:{value:"{fontWeights.normal}"}}},Wce={large:{size:{value:"{fontSizes.xxxl.value}"}},default:{size:{value:"{fontSizes.xl.value}"}},small:{size:{value:"{fontSizes.small.value}"}},filled:{color:{value:"{colors.secondary.80.value}"}},empty:{color:{value:"{colors.background.tertiary.value}"}}},Gce={color:{value:"{components.fieldcontrol.color.value}"},button:{color:{value:"{components.button.color.value}"},backgroundColor:{value:"{colors.background.primary.value}"},_active:{backgroundColor:{value:"{components.button._active.backgroundColor.value}"},borderColor:{value:"{components.button._active.borderColor.value}"},color:{value:"{components.button._active.color.value}"}},_disabled:{backgroundColor:{value:"{components.button._disabled.backgroundColor.value}"},borderColor:{value:"{components.button._disabled.borderColor.value}"},color:{value:"{components.button._disabled.color.value}"}},_focus:{backgroundColor:{value:"{components.button._focus.backgroundColor.value}"},borderColor:{value:"{components.button._focus.borderColor.value}"},color:{value:"{components.button._focus.color.value}"}},_hover:{backgroundColor:{value:"{components.button._hover.backgroundColor.value}"},borderColor:{value:"{components.button._hover.borderColor.value}"},color:{value:"{components.button._hover.color.value}"}}}},Kce={color:{value:"{components.fieldcontrol.color}"},backgroundColor:{value:"{colors.background.primary.value}"},paddingInlineEnd:{value:"{space.xxl.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"{colors.background.disabled.value}"}},wrapper:{flex:{value:"1"},display:{value:"block"},position:{value:"relative"},cursor:{value:"pointer"}},iconWrapper:{alignItems:{value:"center"},position:{value:"absolute"},top:{value:"50%"},right:{value:"{space.medium.value}"},transform:{value:"translateY(-50%)"},pointerEvents:{value:"none"},small:{right:{value:"{space.xs.value}"}},large:{right:{value:"{space.medium.value}"}}},option:{backgroundColor:{value:"transparent"},color:{value:"{colors.font.primary.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"transparent"}}},whiteSpace:{value:"nowrap"},minWidth:{value:"6.5rem"},small:{minWidth:{value:"5.5rem"},paddingInlineEnd:{value:"{space.xl.value}"}},large:{minWidth:{value:"7.5rem"},paddingInlineEnd:{value:"{space.xxl.value}"}},expanded:{paddingBlock:{value:"{space.xs.value}"},paddingInline:{value:"{space.small.value}"},option:{paddingBlock:{value:"{space.xs.value}"},paddingInline:{value:"{space.small.value}"}}}},Zce={borderColor:{value:"{components.fieldcontrol.borderColor}"},color:{value:"{components.fieldcontrol.color}"},flexDirection:{value:"column"},fontSize:{value:"{components.fieldcontrol.fontSize}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor}"}},label:{color:{value:"{components.field.label.color}"}}},Yce={paddingBlock:{value:"{space.xs.value}"},track:{backgroundColor:{value:"{colors.background.quaternary.value}"},borderRadius:{value:"9999px"},height:{value:"0.375rem"},minWidth:{value:"10rem"}},range:{backgroundColor:{value:"{colors.primary.80.value}"},borderRadius:{value:"9999px"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}},thumb:{width:{value:"1.25rem"},height:{value:"1.25rem"},backgroundColor:{value:"{colors.background.primary.value}"},boxShadow:{value:"{shadows.small.value}"},borderRadius:{value:"50%"},borderWidth:{value:"{borderWidths.medium.value}"},borderColor:{value:"{colors.border.primary.value}"},borderStyle:{value:"solid"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"},borderColor:{value:"transparent"},boxShadow:{value:"none"}},_hover:{backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.focus.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}}},small:{track:{height:{value:"0.25rem"}},thumb:{width:{value:"1rem"},height:{value:"1rem"}}},large:{track:{height:{value:"0.625rem"}},thumb:{width:{value:"1.5rem"},height:{value:"1.5rem"}}}},Qce={borderColor:{value:"{components.fieldcontrol.borderColor}"},flexDirection:{value:"column"},input:{color:{value:"{components.fieldcontrol.color}"},fontSize:{value:"{components.fieldcontrol.fontSize}"},textAlign:{value:"center"}},button:{color:{value:"{components.button.color}"},backgroundColor:{value:"{colors.transparent}"},_active:{color:{value:"{components.button._active.color}"},backgroundColor:{value:"{components.button._active.backgroundColor}"}},_focus:{color:{value:"{components.button._focus.color}"},backgroundColor:{value:"{components.button._focus.backgroundColor}"}},_disabled:{color:{value:"{components.button._disabled.color}"},backgroundColor:{value:"{components.fieldcontrol._disabled.backgroundColor}"}},_hover:{color:{value:"{components.button._hover.color}"},backgroundColor:{value:"{components.button._hover.backgroundColor}"}}}},Xce={dropzone:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"dashed"},borderWidth:{value:"{borderWidths.small}"},gap:{value:"{space.small}"},paddingBlock:{value:"{space.xl}"},paddingInline:{value:"{space.large}"},textAlign:{value:"center"},_active:{backgroundColor:{value:"{colors.primary.10}"},borderRadius:{value:"{components.storagemanager.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.storagemanager.dropzone.borderStyle}"},borderWidth:{value:"{borderWidths.medium}"}},icon:{color:{value:"{colors.border.primary}"},fontSize:{value:"{fontSizes.xxl}"}},text:{color:{value:"{colors.font.tertiary}"},fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"}}},file:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},paddingBlock:{value:"{space.xs}"},paddingInline:{value:"{space.small}"},gap:{value:"{space.small}"},alignItems:{value:"baseline"},name:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},size:{fontSize:{value:"{fontSizes.small}"},fontWeight:{value:"{fontWeights.normal}"},color:{value:"{colors.font.tertiary}"}},image:{width:{value:"{space.xxl}"},height:{value:"{space.xxl}"},backgroundColor:{value:"{colors.background.secondary}"},color:{value:"{colors.font.tertiary}"},borderRadius:{value:"{radii.small}"}}},filelist:{flexDirection:{value:"column"},gap:{value:"{space.small}"}},loader:{strokeLinecap:{value:"round"},strokeEmpty:{value:"{colors.border.secondary}"},strokeFilled:{value:"{components.loader.strokeFilled}"},strokeWidth:{value:"{borderWidths.large}"}},previewer:{backgroundColor:{value:"{colors.background.primary}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},borderRadius:{value:"{radii.small}"},paddingBlock:{value:"{space.zero}"},paddingInline:{value:"{space.zero}"},maxHeight:{value:"40rem"},maxWidth:{value:"auto"},text:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},body:{paddingBlock:{value:"{space.medium}"},paddingInline:{value:"{space.medium}"},gap:{value:"{space.small}"}},footer:{justifyContent:{value:"flex-end"}}}},Jce={_disabled:{opacity:{value:"{opacities.60.value}"}},_focused:{shadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},fontSize:{value:"{fontSizes.medium.value}"},large:{fontSize:{value:"{fontSizes.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"}},label:{padding:{value:"{space.xs.value}"}},thumb:{backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderRadius:{value:"{radii.xxxl.value}"},checked:{transform:{value:"{transforms.slideX.medium.value}"}},transition:{duration:{value:"{time.medium.value}"}},width:{value:"{space.relative.medium.value}"}},track:{backgroundColor:{value:"{colors.background.quaternary.value}"},borderRadius:{value:"{radii.xxxl.value}"},checked:{backgroundColor:{value:"{colors.primary.80.value}"}},height:{value:"{space.relative.medium.value}"},padding:{value:"{outlineWidths.medium.value}"},transition:{duration:{value:"{time.short.value}"}},width:{value:"{space.relative.xl.value}"},_error:{backgroundColor:{value:"{colors.background.error.value}"}}}},ede={borderCollapse:{value:"collapse"},display:{value:"table"},width:{value:"100%"},head:{display:{value:"table-header-group"},verticalAlign:{value:"middle"}},body:{display:{value:"table-row-group"},verticalAlign:{value:"middle"}},foot:{display:{value:"table-footer-group"},verticalAlign:{value:"middle"}},row:{display:{value:"table-row"},verticalAlign:{value:"middle"},hover:{backgroundColor:{value:"{colors.background.tertiary.value}"}},striped:{backgroundColor:{value:"{colors.background.secondary.value}"}}},header:{borderColor:{value:"{colors.border.tertiary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small.value}"},color:{value:"{colors.font.primary.value}"},display:{value:"table-cell"},fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"},padding:{value:"{space.medium.value}"},verticalAlign:{value:"middle"},large:{fontSize:{value:"{fontSizes.large.value}"},padding:{value:"{space.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"},padding:{value:"{space.xs.value}"}}},data:{borderColor:{value:"{colors.border.tertiary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small.value}"},color:{value:"{colors.font.primary.value}"},display:{value:"table-cell"},fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.normal.value}"},padding:{value:"{space.medium.value}"},verticalAlign:{value:"middle"},large:{fontSize:{value:"{fontSizes.large.value}"},padding:{value:"{space.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"},padding:{value:"{space.xs.value}"}}},caption:{captionSide:{value:"bottom"},color:{value:"{colors.font.primary.value}"},display:{value:"table-caption"},fontSize:{value:"{fontSizes.medium.value}"},textAlign:{value:"center"},wordBreak:{value:"break-all"},large:{fontSize:{value:"{fontSizes.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"}}}},tde={backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.secondary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.medium.value}"},gap:{value:"0"},item:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.secondary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.medium.value}"},color:{value:"{colors.font.secondary.value}"},fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"},paddingVertical:{value:"{space.small.value}"},paddingHorizontal:{value:"{space.medium.value}"},textAlign:{value:"center"},transitionDuration:{value:"{time.medium.value}"},_hover:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"none"},color:{value:"{colors.font.hover.value}"}},_focus:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"{borderWidths.medium}",color:"{colors.border.focus.value}"}},color:{value:"{colors.font.focus.value}"}},_active:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.font.interactive.value}"},boxShadow:{value:"none"},color:{value:"{colors.font.interactive.value}"}},_disabled:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.tertiary.value}"},boxShadow:{value:"none"},color:{value:"{colors.font.disabled.value}"}}},panel:{backgroundColor:{value:"transparent"},paddingInline:{value:"0"},paddingBlock:{value:"{space.small.value}"}}},nde={color:{value:"{colors.font.primary.value}"},primary:{color:{value:"{colors.font.primary.value}"}},secondary:{color:{value:"{colors.font.secondary.value}"}},tertiary:{color:{value:"{colors.font.tertiary.value}"}},error:{color:{value:"{colors.font.error.value}"}},warning:{color:{value:"{colors.font.warning.value}"}},success:{color:{value:"{colors.font.success.value}"}},info:{color:{value:"{colors.font.info.value}"}}},rde={color:{value:"{components.fieldcontrol.color.value}"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor.value}"}}},ode={color:{value:"{components.fieldcontrol.color.value}"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},fontSize:{value:"{components.fieldcontrol.fontSize.value}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor.value}"}}},sde={borderColor:{value:"{colors.border.primary.value}"},color:{value:"{colors.font.primary.value}"},_hover:{backgroundColor:{value:"{colors.overlay.10.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},color:{value:"{colors.font.primary.value}"}},_active:{backgroundColor:{value:"{colors.transparent.value}"}},_disabled:{backgroundColor:{value:"{colors.transparent.value}"},borderColor:{value:"{colors.border.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{borderColor:{value:"{colors.border.pressed.value}"},color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.overlay.20.value}"},_hover:{backgroundColor:{value:"{colors.overlay.30.value}"}}},primary:{backgroundColor:{value:"{colors.transparent.value}"},borderWidth:{value:"{borderWidths.small.value}"},_focus:{borderColor:{value:"{colors.border.focus.value}"},backgroundColor:{value:"{colors.transparent.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"},color:{value:"{colors.font.primary.value}"}},_hover:{backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.font.primary.value}"}},_disabled:{borderColor:{value:"{colors.border.disabled.value}"},backgroundColor:{value:"{colors.background.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{backgroundColor:{value:"{colors.primary.80.value}"},borderColor:{value:"{colors.primary.80.value}"},color:{value:"{colors.background.primary.value}"},_focus:{backgroundColor:{value:"{colors.border.focus.value}"},borderColor:{value:"{colors.border.focus.value}"},color:{value:"{colors.background.primary.value}"}},_hover:{borderColor:{value:"{colors.primary.60.value}"},backgroundColor:{value:"{colors.primary.60.value}"},boxShadow:{value:"{colors.primary.60.value}"},color:{value:"{colors.background.primary.value}"}}}},link:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"},_hover:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"}},_focus:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"}},_disabled:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.90.value}"},_focus:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.90.value}"}},_hover:{color:{value:"{colors.overlay.90.value}"},backgroundColor:{value:"{colors.transparent.value}"}}}}},ide={alignItems:{value:"center"},alignContent:{value:"center"},justifyContent:{value:"flex-start"}},ade={accordion:wce,aiConversation:ice,alert:sce,authenticator:lce,autocomplete:ace,avatar:uce,badge:cce,breadcrumbs:dce,button:fce,card:hce,checkbox:pce,checkboxfield:gce,collection:mce,copy:vce,countrycodeselect:yce,divider:bce,dropzone:Sce,field:Cce,fieldcontrol:Ece,fieldgroup:_ce,fieldmessages:Ace,fieldset:xce,fileuploader:Ice,flex:Rce,heading:Tce,icon:Mce,highlightmatch:Oce,image:Nce,inappmessaging:kce,input:Pce,link:Dce,liveness:Lce,loader:Uce,menu:Fce,message:$ce,pagination:zce,passwordfield:jce,phonenumberfield:Bce,placeholder:Hce,radio:qce,radiogroup:Vce,rating:Wce,searchfield:Gce,select:Kce,selectfield:Zce,sliderfield:Yce,stepperfield:Qce,storagemanager:Xce,switchfield:Jce,table:ede,tabs:tde,text:nde,textareafield:rde,textfield:ode,togglebutton:sde,togglebuttongroup:ide},lde={default:{variable:{value:`'InterVariable', 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont,
|
|
@@ -77,7 +77,7 @@ Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}},pE=n,p
|
|
|
77
77
|
The chosen QR Code version cannot contain this amount of data.
|
|
78
78
|
Minimum version required to store current data is: `+F+`.
|
|
79
79
|
`);const D=I(R,k,q),j=e.getSymbolSize(R),Z=new r(j);return v(Z,R),w(Z),S(Z,R),E(Z,k,0),R>=7&&C(Z,R),A(Z,D),isNaN(L)&&(L=a.getBestMask(Z,E.bind(null,Z,k))),a.applyMask(L,Z),E(Z,k,L),{modules:Z,version:R,errorCorrectionLevel:k,maskPattern:L,segments:q}}return YC.create=function(R,k){if(typeof R>"u"||R==="")throw new Error("No input text");let L=t.M,q,F;return typeof k<"u"&&(L=t.from(k.errorCorrectionLevel,t.M),q=f.from(k.version),F=a.from(k.maskPattern),k.toSJISFunc&&e.setToSJISFunction(k.toSJISFunc)),N(R,q,L,F)},YC}var mE={},vE={},l4;function k9(){return l4||(l4=1,(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:s,scale:s?4:a,margin:o,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},e.getImageWidth=function(r,o){const s=e.getScale(r,o);return Math.floor((r+o.margin*2)*s)},e.qrToImageData=function(r,o,s){const a=o.modules.size,u=o.modules.data,c=e.getScale(a,s),f=Math.floor((a+s.margin*2)*c),h=s.margin*c,g=[s.color.light,s.color.dark];for(let m=0;m<f;m++)for(let v=0;v<f;v++){let w=(m*f+v)*4,S=s.color.light;if(m>=h&&v>=h&&m<f-h&&v<f-h){const C=Math.floor((m-h)/c),E=Math.floor((v-h)/c);S=g[u[C*a+E]?1:0]}r[w++]=S.r,r[w++]=S.g,r[w++]=S.b,r[w]=S.a}}})(vE)),vE}var u4;function Khe(){return u4||(u4=1,(function(e){const t=k9();function n(o,s,a){o.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=a,s.width=a,s.style.height=a+"px",s.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(s,a,u){let c=u,f=a;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),a||(f=r()),c=t.getOptions(c);const h=t.getImageWidth(s.modules.size,c),g=f.getContext("2d"),m=g.createImageData(h,h);return t.qrToImageData(m.data,s,c),n(g,f,h),g.putImageData(m,0,0),f},e.renderToDataURL=function(s,a,u){let c=u;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),c||(c={});const f=e.render(s,a,c),h=c.type||"image/png",g=c.rendererOpts||{};return f.toDataURL(h,g.quality)}})(mE)),mE}var yE={},c4;function Zhe(){if(c4)return yE;c4=1;const e=k9();function t(o,s){const a=o.a/255,u=s+'="'+o.hex+'"';return a<1?u+" "+s+'-opacity="'+a.toFixed(2).slice(1)+'"':u}function n(o,s,a){let u=o+s;return typeof a<"u"&&(u+=" "+a),u}function r(o,s,a){let u="",c=0,f=!1,h=0;for(let g=0;g<o.length;g++){const m=Math.floor(g%s),v=Math.floor(g/s);!m&&!f&&(f=!0),o[g]?(h++,g>0&&m>0&&o[g-1]||(u+=f?n("M",m+a,.5+v+a):n("m",c,0),c=0,f=!1),m+1<s&&o[g+1]||(u+=n("h",h),h=0)):c++}return u}return yE.render=function(s,a,u){const c=e.getOptions(a),f=s.modules.size,h=s.modules.data,g=f+c.margin*2,m=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+g+"v"+g+'H0z"/>':"",v="<path "+t(c.color.dark,"stroke")+' d="'+r(h,f,c.margin)+'"/>',w='viewBox="0 0 '+g+" "+g+'"',C='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+w+' shape-rendering="crispEdges">'+m+v+`</svg>
|
|
80
|
-
`;return typeof u=="function"&&u(null,C),C},yE}var d4;function Yhe(){if(d4)return iu;d4=1;const e=The(),t=Ghe(),n=Khe(),r=Zhe();function o(s,a,u,c,f){const h=[].slice.call(arguments,1),g=h.length,m=typeof h[g-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(g<2)throw new Error("Too few arguments provided");g===2?(f=u,u=a,a=c=void 0):g===3&&(a.getContext&&typeof f>"u"?(f=c,c=void 0):(f=c,c=u,u=a,a=void 0))}else{if(g<1)throw new Error("Too few arguments provided");return g===1?(u=a,a=c=void 0):g===2&&!a.getContext&&(c=u,u=a,a=void 0),new Promise(function(v,w){try{const S=t.create(u,c);v(s(S,a,c))}catch(S){w(S)}})}try{const v=t.create(u,c);f(null,s(v,a,c))}catch(v){f(v)}}return iu.create=t.create,iu.toCanvas=o.bind(null,n.render),iu.toDataURL=o.bind(null,n.renderToDataURL),iu.toString=o.bind(null,function(s,a,u){return r.render(s,u)}),iu}var Qhe=Yhe();const Xhe=sc(Qhe),Jhe=e=>e==="signIn"||e==="signUp",JI=e=>!!e&&(e==="EMAIL_OTP"||e==="SMS_MFA"),{getConfirmText:epe,getConfirmingText:tpe,getBackToSignInText:npe,getResendCodeText:rpe}=bn,Iy=()=>{const{isPending:e,toSignIn:t,challengeName:n,resendCode:r,selectedAuthMethod:o,availableAuthMethods:s}=ot(c=>[c.isPending,c.toSignIn,c.challengeName,c.resendCode,c.selectedAuthMethod,c.availableAuthMethods]),a=!!o&&o!=="PASSWORD"||!!s?.some(c=>c!=="PASSWORD"),u=JI(n)&&a&&r;return $.createElement(Pe,{direction:"column"},$.createElement(zt,{isDisabled:e,type:"submit",variation:"primary",isLoading:e,loadingText:tpe()},epe()),u&&$.createElement(zt,{onClick:r,type:"button"},rpe()),$.createElement(zt,{onClick:t,type:"button",variation:"link",size:"small"},npe()))},ope=new Ln("SetupTotp-logger"),{getSetupTotpText:spe,getCopiedText:ipe,getLoadingText:ape}=bn,Hi=({className:e,variation:t})=>{const{totpSecretCode:n,isPending:r,username:o,QRFields:s}=ot(T=>[T.isPending,T.totpSecretCode,T.username]),{handleChange:a,handleSubmit:u}=Pr(),{components:{SetupTotp:{Header:c=Hi.Header,Footer:f=Hi.Footer}}}=Mr(),[h,g]=_.useState(!0),[m,v]=_.useState(),[w,S]=_.useState("COPY"),{totpIssuer:C="AWSCognito",totpUsername:E=o}=s??{},A=_.useCallback(async()=>{try{const T=Qie(C,E,n),N=await Xhe.toDataURL(T);v(N)}catch(T){ope.error(T)}finally{g(!1)}},[C,E,n]);_.useEffect(()=>{m||A()},[A,m]);const I=()=>{navigator.clipboard.writeText(n),S(ipe())};return _.createElement(fr,{className:e,variation:t},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-totp":"",method:"post",onChange:a,onSubmit:u},_.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:r},_.createElement(c,null),_.createElement(Pe,{direction:"column"},h?_.createElement("p",null,ape(),"…"):_.createElement("img",{"data-amplify-qrcode":!0,src:m,alt:"qr code",width:"228",height:"228"}),_.createElement(Pe,{"data-amplify-copy":!0},_.createElement("div",null,n),_.createElement(Pe,{"data-amplify-copy-svg":!0,onClick:I},_.createElement("div",{"data-amplify-copy-tooltip":!0},w),_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})))),_.createElement(Ko,null),_.createElement(pr,null)),_.createElement(Iy,null),_.createElement(f,null))))};Hi.Header=function(){return _.createElement(Yn,{level:3},spe())};Hi.Footer=function(){return null};const{getSubmitText:lpe,getSubmittingText:upe}=bn,Ry=e=>{const{cancelButtonSendType:t,cancelButtonText:n,submitButtonText:r}=e,{isPending:o,resendCode:s,skipVerification:a,toSignIn:u}=ot(g=>[g.isPending]),c=()=>{switch(t){case"SKIP":a();break;case"RESEND":s();break;case"SIGN_IN":u();break;default:return}},f=o?$.createElement($.Fragment,null,upe(),"…"):$.createElement($.Fragment,null,lpe()),h=r??f;return $.createElement(Pe,{direction:"column"},$.createElement(zt,{variation:"primary",isDisabled:o,type:"submit"},h),$.createElement(Pe,{direction:"column",alignItems:"center"},$.createElement(zt,{onClick:c,type:"button",variation:"link",size:"small"},n)))},cpe=()=>$.createElement("svg",{"aria-label":"Apple icon",className:"amplify-icon federated-sign-in-icon",fill:"#000",preserveAspectRatio:"xMidYMid",stroke:"#000",strokeWidth:"0",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"})),dpe=()=>$.createElement("svg",{"aria-label":"Google icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},$.createElement("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285F4"}),$.createElement("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34A853"}),$.createElement("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782",fill:"#FBBC05"}),$.createElement("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#EB4335"})),fpe=()=>$.createElement(p9,{className:"federated-sign-in-icon",ariaLabel:"Facebook icon",viewBox:{minX:0,minY:0,width:279,height:538},pathData:"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z",fill:"#1877F2"}),hpe=()=>$.createElement("svg",{"aria-label":"Amazon icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 243 264",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},$.createElement("path",{d:"M230.826 208.039C227.468 203.683 208.551 205.982 200.056 206.998C197.471 207.321 197.076 205.042 199.407 203.405C214.475 192.665 239.201 195.766 242.082 199.364C244.966 202.982 241.337 228.071 227.173 240.049C225.001 241.888 222.93 240.904 223.898 238.468C227.077 230.431 234.205 212.419 230.826 208.039ZM123.769 264C71.0234 264 39.0764 241.955 14.7853 217.542C9.97339 212.706 3.71799 206.296 0.311513 200.691C-1.09773 198.372 2.59096 195.022 5.04421 196.844C35.239 219.268 79.1012 239.538 122.53 239.538C151.82 239.538 188.046 227.47 217.669 214.868C222.147 212.966 222.147 219.18 221.512 221.061C221.183 222.032 206.515 236.221 186.247 247.047C167.304 257.166 143.397 264 123.769 264Z",fill:"#F2541B"}),$.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M142.943 111.185C142.943 124.756 143.268 136.054 136.406 148.123C130.856 157.913 122.027 163.95 112.222 163.95C98.8288 163.95 90.9806 153.772 90.9806 138.693C90.9806 109.036 117.677 103.647 142.943 103.647V111.185ZM178.166 196.081C175.858 198.15 171.635 198.22 169.914 196.894C157.974 187.684 149.89 173.688 149.89 173.688C130.706 193.156 117.127 199 92.2879 199C62.8772 199 40 180.905 40 144.729C40 116.461 55.3552 97.2408 77.2563 87.823C96.2094 79.5256 122.684 78.0173 142.943 75.7517C142.943 75.7517 144.633 53.933 138.699 45.9806C134.098 39.8163 126.272 36.9329 119.089 36.9329C106.127 36.8829 93.61 43.9051 91.1262 57.4188C90.4136 61.2829 87.5533 64.5261 84.54 64.206L51.0823 60.5922C48.5156 60.2951 45.0381 57.6639 45.8636 53.3081C53.644 12.3684 90.7373 0 123.989 0C140.983 0 163.21 4.51651 176.608 17.3349C193.597 33.1648 191.969 54.2755 191.969 77.2722V131.51C191.969 147.835 198.768 154.987 205.151 163.775C207.376 166.953 207.886 170.714 205.04 173.032C197.902 178.999 178.166 196.081 178.166 196.081Z",fill:"#F2541B"})),ng=e=>{const{icon:t,provider:n,text:r}=e,{toFederatedSignIn:o}=ot(),s=u=>{u.preventDefault(),o({provider:n})};let a;return t==="facebook"?a=$.createElement(fpe,null):t==="google"?a=$.createElement(dpe,null):t==="amazon"?a=$.createElement(hpe,null):t==="apple"&&(a=$.createElement(cpe,null)),$.createElement(zt,{onClick:s,className:"federated-sign-in-button",gap:"1rem"},a,$.createElement(Yr,{as:"span"},r))},{getSignInWithFederationText:rg,getOrText:ppe}=bn;function D9(){const{route:e,socialProviders:t}=ot(({route:n,socialProviders:r})=>[n,r]);return t.length===0?null:$.createElement(Pe,{direction:"column",padding:"0 0 1rem 0",className:"federated-sign-in-container"},t.map(n=>{switch(n){case"amazon":return $.createElement(ng,{icon:"amazon",key:n,provider:Cu.Amazon,text:rg(e,n)});case"apple":return $.createElement(ng,{icon:"apple",key:n,provider:Cu.Apple,text:rg(e,n)});case"facebook":return $.createElement(ng,{icon:"facebook",key:n,provider:Cu.Facebook,text:rg(e,n)});case"google":return $.createElement(ng,{icon:"google",key:n,provider:Cu.Google,text:rg(e,n)});default:console.error(`Authenticator does not support ${n}. Please open an issue: https://github.com/aws-amplify/amplify-ui/issues/choose`)}}),$.createElement(qI,{size:"small",label:ppe()}))}const{getSignInText:og,getSigningInText:gpe,getForgotPasswordText:mpe,getSignInWithEmailText:vpe,getSignInWithSmsText:ype,getSignInWithPasskeyText:bpe,getOtherSignInOptionsText:Spe,getEnterUsernameFirstText:wpe}=bn;function Ls(){const{isPending:e,availableAuthMethods:t,preferredChallenge:n,toShowAuthMethods:r}=ot(E=>[E.isPending,E.availableAuthMethods,E.preferredChallenge,E.toShowAuthMethods]),{handleChange:o,handleSubmit:s}=Pr(),[a,u]=$.useState(""),{components:{SignIn:{Header:c=Ls.Header,Footer:f=Ls.Footer}}}=Mr(),g=t&&t.length>1&&n,m=a.trim().length>0,v=$.useCallback(E=>{const{name:A,value:I}=E.target;A==="username"&&typeof I=="string"&&u(I),o(E)},[o]),w=()=>{if(!n)return og();switch(n){case"EMAIL_OTP":return vpe();case"SMS_OTP":return ype();case"WEB_AUTHN":return bpe();default:return og()}},S=E=>{E.preventDefault(),s(E)},C=E=>{E.preventDefault(),r()};return $.createElement(ke,null,$.createElement(c,null),$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:g?S:s,onChange:v},$.createElement(D9,null),$.createElement(Pe,{direction:"column"},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:e},$.createElement(xy,null,$.createElement("legend",null,og())),$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(zt,{isDisabled:e,type:"submit",variation:"primary",isLoading:e,loadingText:gpe()},g?w():og()),g&&$.createElement(zt,{onClick:C,size:"small",variation:"link",isDisabled:e||!m,title:m?void 0:wpe()},Spe()),$.createElement(f,null))))}const Cpe=()=>{const{toForgotPassword:e}=ot(t=>[t.toForgotPassword]);return $.createElement(ke,{"data-amplify-footer":""},$.createElement(zt,{onClick:e,size:"small",variation:"link"},mpe()))};Ls.Footer=Cpe;Ls.Header=function(){return null};const{getCreateAccountText:f4,getCreatingAccountText:Epe,getCreateAccountWithEmailText:_pe,getCreateAccountWithPasswordText:xpe,getCreateAccountWithSmsText:Ape,getOrText:Ipe}=bn;function yo(){const{hasValidationErrors:e,isPending:t,availableAuthMethods:n,preferredChallenge:r,selectedAuthMethod:o}=ot(I=>[I.hasValidationErrors,I.isPending,I.availableAuthMethods,I.preferredChallenge,I.selectedAuthMethod]),{handleChange:s,handleBlur:a,handleSubmit:u}=Pr(),{components:{SignUp:{Header:c=yo.Header,FormFields:f=yo.FormFields,Footer:h=yo.Footer}}}=Mr(),g=n?.filter(I=>I!=="WEB_AUTHN"),m=g&&g.length>1,v=r&&r!=="WEB_AUTHN"?r:"PASSWORD",w=g?.filter(I=>I!==v)??[],C=(o??v)!=="PASSWORD",E=I=>{switch(I){case"EMAIL_OTP":return _pe();case"SMS_OTP":return Ape();case"PASSWORD":return m?xpe():f4();default:return f4()}},A=I=>T=>{T.preventDefault();const N=T.target.closest("form");if(N){if(!N.__authMethod){const M=document.createElement("input");M.name="__authMethod",N.appendChild(M)}N.__authMethod.type="hidden",N.__authMethod.value=I,N.requestSubmit()}};return $.createElement(ke,null,$.createElement(c,null),$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signup":"",method:"post",onChange:s,onSubmit:u,onBlur:a},$.createElement(D9,null),$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:t},$.createElement(Pe,{direction:"column"},$.createElement(f,{includePassword:!C}),$.createElement(pr,null)),$.createElement(zt,{isDisabled:(!m||w.length==0)&&e||t,isFullWidth:!0,type:"submit",variation:"primary",isLoading:t,loadingText:Epe(),onClick:A(v)},E(v)),m&&w.length>0&&$.createElement($.Fragment,null,$.createElement(Pe,{justifyContent:"center",padding:"medium 0"},Ipe()),w.map(I=>$.createElement(zt,{key:I,isDisabled:t,isFullWidth:!0,type:"button",variation:"primary",onClick:A(I)},E(I)))),$.createElement(h,null))))}yo.Header=function(){return null};yo.FormFields=function(){return $.createElement(Ko,null)};yo.Footer=function(){return null};const{getSignInTabText:Rpe,getSignUpTabText:Tpe}=bn,Ope=({className:e,hideSignUp:t,variation:n})=>{const{route:r,toSignIn:o,toSignUp:s}=ot(a=>[a.route,a.toSignIn,a.toSignUp]);return $.createElement(fr,{className:e,variation:n},t?$.createElement(ke,{"data-amplify-router-content":""},r==="signIn"&&$.createElement(Ls,null)):$.createElement(Ea.Container,{value:r,isLazy:!0,onValueChange:a=>{a!==r&&(a==="signIn"?o():s())}},$.createElement(Ea.List,{spacing:"equal",indicatorPosition:"top"},$.createElement(Ea.Item,{value:"signIn"},Rpe()),$.createElement(Ea.Item,{value:"signUp"},Tpe())),$.createElement(Ea.Panel,{value:"signIn","data-amplify-router-content":""},$.createElement(Ls,null)),$.createElement(Ea.Panel,{value:"signUp","data-amplify-router-content":""},$.createElement(yo,null))))},{getAccountRecoveryInfoText:Mpe,getSkipText:Ppe}=bn,Ga=({className:e,variation:t})=>{const{isPending:n}=ot(u=>[u.isPending]),{handleChange:r,handleSubmit:o}=Pr(),{components:{ConfirmVerifyUser:{Header:s=Ga.Header,Footer:a=Ga.Footer}}}=Mr();return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmverifyuser":"",method:"post",onChange:r,onSubmit:o},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(s,null),$.createElement(Pe,{direction:"column"},$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(Ry,{cancelButtonText:Ppe(),cancelButtonSendType:"SKIP"}),$.createElement(a,null))))};Ga.Header=function(){return $.createElement(Yn,{level:3},Mpe())};Ga.Footer=function(){return null};const{getSkipText:Npe,getVerifyText:kpe,getVerifyContactText:Dpe,getAccountRecoveryInfoText:Lpe}=bn,Upe=e=>Object.entries(e).map(([t,n],r)=>{const o=py[t].label;return $.createElement(WI,{name:"unverifiedAttr",value:t,key:t,defaultChecked:r===0},de(o),":"," ",Zie(o,n))}),Ka=({className:e,variation:t})=>{const{components:{VerifyUser:{Header:n=Ka.Header,Footer:r=Ka.Footer}}}=Mr(),{isPending:o,unverifiedUserAttributes:s}=ot(({isPending:h,unverifiedUserAttributes:g})=>[h,g]),{handleChange:a,handleSubmit:u}=Pr(),c=o?$.createElement($.Fragment,null,"Verifying…"):$.createElement($.Fragment,null,kpe()),f=$.createElement(GI,{legend:Dpe(),name:"verify_context",isDisabled:o,legendHidden:!0},Upe(s));return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-verifyuser":"",method:"post",onChange:a,onSubmit:u},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:o},$.createElement(n,null),f,$.createElement(pr,null),$.createElement(Ry,{cancelButtonText:Npe(),cancelButtonSendType:"SKIP",submitButtonText:c}),$.createElement(r,null))))};Ka.Header=function(){return $.createElement(Yn,{level:3},Lpe())};Ka.Footer=function(){return null};const{getChallengeText:Fpe,getDeliveryMessageText:$pe,getDeliveryMethodText:zpe}=bn,Za=({className:e,variation:t})=>{const{isPending:n,challengeName:r,codeDeliveryDetails:o}=ot(h=>[h.isPending,h.challengeName,h.codeDeliveryDetails]),{handleChange:s,handleSubmit:a}=Pr(),{components:{ConfirmSignIn:{Header:u=Za.Header,Footer:c=Za.Footer}}}=Mr(),f=JI(r)&&o;return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmsignin":"",method:"post",onChange:s,onSubmit:a},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(u,null),$.createElement(Pe,{direction:"column"},f&&$.createElement(Yr,{className:"amplify-authenticator__subtitle"},$pe(o)),$.createElement(Ko,null),$.createElement(pr,null)),$.createElement(Iy,null),$.createElement(c,null))))};function jpe(){const{challengeName:e,codeDeliveryDetails:t}=ot(({challengeName:r,codeDeliveryDetails:o})=>[r,o]),n=JI(e)&&t;return $.createElement($.Fragment,null,$.createElement(Yn,{level:3},Fpe(e)),n&&$.createElement(Yn,{level:5},zpe(t)))}Za.Header=jpe;Za.Footer=function(){return null};const{getResendCodeText:Bpe,getResetYourPasswordText:Hpe}=bn,Ya=({className:e,variation:t})=>{const{isPending:n}=ot(c=>[c.isPending]),{handleBlur:r,handleChange:o,handleSubmit:s}=Pr(),{components:{ConfirmResetPassword:{Header:a=Ya.Header,Footer:u=Ya.Footer}}}=Mr();return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmresetpassword":"",method:"post",onSubmit:s,onChange:o,onBlur:r},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(a,null),$.createElement(Pe,{direction:"column"},$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(Ry,{cancelButtonSendType:"RESEND",cancelButtonText:Bpe()}),$.createElement(u,null))))};Ya.Header=function(){const t=Hpe();return $.createElement(Yn,{level:3},t)};Ya.Footer=function(){return null};const{getBackToSignInText:qpe,getSendingText:Vpe,getSendCodeText:Wpe,getResetYourPasswordText:Gpe}=bn,qi=({className:e,variation:t})=>{const{isPending:n}=ot(u=>[u.isPending]),{handleChange:r,handleSubmit:o}=Pr(),{components:{ForgotPassword:{Header:s=qi.Header,Footer:a=qi.Footer}}}=Mr();return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-forgotpassword":"",method:"post",onChange:r,onSubmit:o},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(s,null),$.createElement(Pe,{direction:"column"},$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(Ry,{cancelButtonText:qpe(),cancelButtonSendType:"SIGN_IN",submitButtonText:n?$.createElement($.Fragment,null,Vpe(),"…"):$.createElement($.Fragment,null,Wpe())}),$.createElement(a,null))))};qi.Header=function(){return $.createElement(Yn,{level:3},Gpe())};qi.Footer=function(){return null};const{getMfaTypeLabelByValue:Kpe,getSelectMfaTypeByChallengeName:Zpe,getSelectMfaTypeText:Ype}=bn,Vi=({className:e,variation:t})=>{const{isPending:n,allowedMfaTypes:r=[]}=ot(c=>[c.isPending,c.allowedMfaTypes]),{handleChange:o,handleSubmit:s}=Pr(),{components:{SelectMfaType:{Header:a=Vi.Header,Footer:u=Vi.Footer}}}=Mr();return _.createElement(fr,{className:e,variation:t},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-select-mfa-type":"",method:"post",onChange:o,onSubmit:s},_.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(a,null),_.createElement(Pe,{direction:"column"},_.createElement(GI,{name:"mfa_type",legend:Ype(),legendHidden:!0,isDisabled:n,isRequired:!0},r.map((c,f)=>_.createElement(WI,{name:"mfa_type",key:c,value:c,defaultChecked:f===0},Kpe(c)))),_.createElement(pr,null)),_.createElement(Iy,null),_.createElement(u,null))))};Vi.Header=function(){const{challengeName:t}=ot(n=>[n.challengeName]);return _.createElement(Yn,{level:3},Zpe(t))};Vi.Footer=function(){return null};const{getSetupEmailText:Qpe}=bn,Wi=({className:e,variation:t})=>{const{isPending:n}=ot(u=>[u.isPending]),{handleChange:r,handleSubmit:o}=Pr(),{components:{SetupEmail:{Header:s=Wi.Header,Footer:a=Wi.Footer}}}=Mr();return _.createElement(fr,{className:e,variation:t},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-email":"",method:"post",onChange:r,onSubmit:o},_.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(s,null),_.createElement(Pe,{direction:"column"},_.createElement(Ko,null),_.createElement(pr,null)),_.createElement(Iy,null),_.createElement(a,null))))};Wi.Header=function(){return _.createElement(Yn,{level:3},Qpe())};Wi.Footer=function(){return null};const{getSignInWithPasswordText:tx,getSignInWithEmailText:Xpe,getSignInWithSmsText:Jpe,getSignInWithPasskeyText:ege,getSigningInText:tge,getBackToSignInText:nge,getOrText:rge,getUsernameLabelByLoginMechanism:oge}=bn,sge=e=>{switch(e){case"EMAIL_OTP":return Xpe();case"SMS_OTP":return Jpe();case"WEB_AUTHN":return ege();case"PASSWORD":return tx();default:return tx()}},ige=({className:e,variation:t})=>{const{isPending:n,username:r,availableAuthMethods:o,toSignIn:s,selectAuthMethod:a,loginMechanism:u}=ot(S=>[S.isPending,S.username,S.availableAuthMethods,S.toSignIn,S.selectAuthMethod,S.loginMechanism]),{handleChange:c,handleSubmit:f}=Pr(),h=o??[],g=h.includes("PASSWORD"),m=h.filter(S=>S!=="PASSWORD"),v=S=>{a({method:S})},w=oge(u);return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":!0,"data-amplify-authenticator-signinselect":!0,method:"post",onSubmit:f,onChange:c},$.createElement(Pe,{direction:"column"},$.createElement(ch,{label:w,name:"username",value:r,isReadOnly:!0,isDisabled:!0}),g&&$.createElement($.Fragment,null,$.createElement(VI,{label:"Password",name:"password",autoComplete:"current-password",isDisabled:n}),$.createElement(zt,{isDisabled:n,type:"submit",variation:"primary",isFullWidth:!0,isLoading:n,loadingText:tge()},tx())),g&&m.length>0&&$.createElement(qI,{label:rge()}),m.length>0&&$.createElement(Pe,{direction:"column",gap:"0.5rem"},m.map(S=>$.createElement(zt,{key:S,variation:"primary",isFullWidth:!0,isDisabled:n,onClick:()=>v(S)},sge(S)))),$.createElement(pr,null),$.createElement(zt,{onClick:s,size:"small",variation:"link",isDisabled:n},nge()))))},age=e=>{const{className:t,...n}=e;return _.createElement(ke,{as:"span",width:"1em",height:"1em",className:Ne(re.Icon,t),...n},_.createElement("svg",{width:"54",height:"54",viewBox:"0 0 54 54",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M22.9333 38.9333L41.7333 20.1333L38 16.4L22.9333 31.4667L15.3333 23.8667L11.6 27.6L22.9333 38.9333ZM26.6667 53.3333C22.9778 53.3333 19.5111 52.6333 16.2667 51.2333C13.0222 49.8333 10.2 47.9333 7.8 45.5333C5.4 43.1333 3.5 40.3111 2.1 37.0667C0.7 33.8222 0 30.3556 0 26.6667C0 22.9778 0.7 19.5111 2.1 16.2667C3.5 13.0222 5.4 10.2 7.8 7.8C10.2 5.4 13.0222 3.5 16.2667 2.1C19.5111 0.7 22.9778 0 26.6667 0C30.3556 0 33.8222 0.7 37.0667 2.1C40.3111 3.5 43.1333 5.4 45.5333 7.8C47.9333 10.2 49.8333 13.0222 51.2333 16.2667C52.6333 19.5111 53.3333 22.9778 53.3333 26.6667C53.3333 30.3556 52.6333 33.8222 51.2333 37.0667C49.8333 40.3111 47.9333 43.1333 45.5333 45.5333C43.1333 47.9333 40.3111 49.8333 37.0667 51.2333C33.8222 52.6333 30.3556 53.3333 26.6667 53.3333Z",fill:"currentColor"})))},lge=e=>{const{className:t,...n}=e;return _.createElement(ke,{as:"span",width:"1em",height:"1em",className:Ne(re.Icon,t),...n},_.createElement("svg",{width:"195",height:"128",viewBox:"0 0 195 128",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("circle",{cx:"60",cy:"36",r:"31",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M60 69C84.4313 69 105.396 83.8504 114.357 105.021C116.774 110.729 115.382 116.168 111.798 120.23C108.191 124.319 102.358 127 96 127H24C17.6416 127 11.8094 124.319 8.20215 120.23C4.61836 116.168 3.22626 110.729 5.64258 105.021C14.6036 83.8504 35.5687 69 60 69Z",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"122",cy:"26",r:"25",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("mask",{id:"path-4-inside-1_4178_10171",fill:"white"},_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z"})),_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z",fill:"#00404D",stroke:"#00404D",strokeWidth:"4",mask:"url(#path-4-inside-1_4178_10171)"}),_.createElement("circle",{cx:"167.5",cy:"49.5",r:"19.5",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.89 43.65L161.26 54.18H167.89",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.5 60.42C173.316 60.42 178.03 55.7056 178.03 49.89V48.72",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"173.74",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("circle",{cx:"160.48",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M104 112C116.129 112 126.457 104.288 130.347 93.5H147.5L155.5 101.5L168 89L180.5 101.5L193 89L180.5 76.5H130.984C127.705 64.6779 116.866 56 104 56C88.536 56 76 68.536 76 84C76 99.464 88.536 112 104 112ZM104 98C111.732 98 118 91.732 118 84C118 76.268 111.732 70 104 70C96.268 70 90 76.268 90 84C90 91.732 96.268 98 104 98Z",fill:"#BCECF5"}),_.createElement("path",{d:"M130.347 93.5V92.5H129.645L129.407 93.1608L130.347 93.5ZM147.5 93.5L148.207 92.7929L147.914 92.5H147.5V93.5ZM155.5 101.5L154.793 102.207L155.5 102.914L156.207 102.207L155.5 101.5ZM168 89L168.707 88.2929L168 87.5858L167.293 88.2929L168 89ZM180.5 101.5L179.793 102.207L180.5 102.914L181.207 102.207L180.5 101.5ZM193 89L193.707 89.7071L194.414 89L193.707 88.2929L193 89ZM180.5 76.5L181.207 75.7929L180.914 75.5H180.5V76.5ZM130.984 76.5L130.021 76.7673L130.224 77.5H130.984V76.5ZM129.407 93.1608C125.655 103.565 115.694 111 104 111V113C116.564 113 127.259 105.011 131.288 93.8392L129.407 93.1608ZM147.5 92.5H130.347V94.5H147.5V92.5ZM156.207 100.793L148.207 92.7929L146.793 94.2071L154.793 102.207L156.207 100.793ZM167.293 88.2929L154.793 100.793L156.207 102.207L168.707 89.7071L167.293 88.2929ZM181.207 100.793L168.707 88.2929L167.293 89.7071L179.793 102.207L181.207 100.793ZM192.293 88.2929L179.793 100.793L181.207 102.207L193.707 89.7071L192.293 88.2929ZM179.793 77.2071L192.293 89.7071L193.707 88.2929L181.207 75.7929L179.793 77.2071ZM130.984 77.5H180.5V75.5H130.984V77.5ZM104 57C116.405 57 126.859 65.3669 130.021 76.7673L131.948 76.2327C128.552 63.9889 117.327 55 104 55V57ZM77 84C77 69.0883 89.0883 57 104 57V55C87.9837 55 75 67.9837 75 84H77ZM104 111C89.0883 111 77 98.9117 77 84H75C75 100.016 87.9837 113 104 113V111ZM117 84C117 91.1797 111.18 97 104 97V99C112.284 99 119 92.2843 119 84H117ZM104 71C111.18 71 117 76.8203 117 84H119C119 75.7157 112.284 69 104 69V71ZM91 84C91 76.8203 96.8203 71 104 71V69C95.7157 69 89 75.7157 89 84H91ZM104 97C96.8203 97 91 91.1797 91 84H89C89 92.2843 95.7157 99 104 99V97Z",fill:"#00404D"}),_.createElement("path",{d:"M138.5 57V66",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M139 104V124",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M134 61.5L143 61.5",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M129 114L149 114",stroke:"#00404D",strokeWidth:"2"})))},{getPasskeyPromptHeadingText:uge,getPasskeyPromptDescriptionText:cge,getCreatePasskeyText:dge,getRegisteringText:fge,getContinueWithoutPasskeyText:hge,getPasskeyCreatedSuccessText:pge,getPasskeyRegisteredText:gge,getPasskeyRegistrationFailedText:mge,getPasskeyLabelText:vge,getExistingPasskeysText:yge,getSetupAnotherPasskeyText:bge,getContinueText:Sge}=bn;function wge({className:e,variation:t}){const[n,r]=$.useState(!1),[o,s]=$.useState(null),[a,u]=$.useState(!1),[c,f]=$.useState([]),{submitForm:h,isPending:g}=ot(E=>[E.submitForm,E.isPending]),m=$.useCallback(async()=>{try{const E=await EI();f(E.credentials||[])}catch{}},[]);$.useEffect(()=>{n&&m()},[n,m]);const v=$.useCallback(()=>{h({type:"SKIP"})},[h]),w=$.useCallback(()=>{h({type:"SUBMIT"})},[h]),S=$.useCallback(async()=>{try{s(null),u(!0),await mie(),r(!0)}catch(E){const A=E,I=A.name??"",T=A.message??"";if(I==="PasskeyRegistrationCanceled"||I==="NotAllowedError"||T.includes("canceled")||T.includes("cancelled")||T.includes("ceremony has been canceled")||T.includes("not allowed")){v();return}s(mge())}finally{u(!1)}},[v]);if(n)return $.createElement(fr,{className:e,variation:t},$.createElement(Pe,{direction:"column",padding:"large","data-amplify-authenticator-passkeyprompt":""},$.createElement(Pe,{direction:"column",gap:"xs"},$.createElement(age,{className:"amplify-authenticator__passkey-success-icon"}),$.createElement(Yn,{level:4},pge()),$.createElement(Yr,null,gge())),c.length>0&&$.createElement(ke,{marginTop:"large"},$.createElement(Yn,{level:5},yge()),$.createElement(Pe,{direction:"column",gap:"xs",marginTop:"xs"},c.map((E,A)=>$.createElement(ke,{key:E.credentialId,className:"amplify-authenticator__passkey-credential-item"},$.createElement(Yr,{fontSize:"small"},E.friendlyCredentialName??`${vge()} ${A+1}`))))),$.createElement(Pe,{direction:"column",gap:"medium",marginTop:"large"},$.createElement(zt,{onClick:()=>{r(!1),S()},variation:"link"},bge()),$.createElement(zt,{onClick:()=>w(),variation:"primary",isFullWidth:!0},Sge()))));const C=g||a;return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-passkeyprompt":""},$.createElement(Pe,{direction:"column",gap:"medium"},$.createElement(Yn,{level:4},uge()),$.createElement(Yr,null,cge()),$.createElement(Pe,{justifyContent:"center"},$.createElement(lge,{className:"amplify-authenticator__passkey-icon"})),$.createElement(Pe,{direction:"column",gap:"medium"},$.createElement(zt,{onClick:()=>{S()},variation:"primary",isDisabled:C,isLoading:a,loadingText:fge()},dge()),$.createElement(zt,{onClick:v,variation:"link",isDisabled:C},hge()),o&&$.createElement(Yr,{className:"amplify-authenticator__passkey-error"},o),$.createElement(pr,null)))))}function h4(){return null}const Cge=e=>{switch(e){case"authenticated":case"idle":case"setup":case"transition":return h4;case"confirmSignUp":return Wa;case"confirmSignIn":return Za;case"selectMfaType":return Vi;case"setupEmail":return Wi;case"setupTotp":return Hi;case"signIn":case"signUp":return Ope;case"signInSelectAuthFactor":return ige;case"passkeyPrompt":return wge;case"forceNewPassword":return vo;case"forgotPassword":return qi;case"confirmResetPassword":return Ya;case"verifyUser":return Ka;case"confirmVerifyUser":return Ga;default:return console.warn(`Unhandled Authenticator route - please open an issue: ${e}`),h4}};function Ege({className:e,hideSignUp:t,variation:n}){const{route:r}=ot(({route:s})=>[s]),o=_.useMemo(()=>Cge(r),[r]);return $.createElement(o,{className:e,hideSignUp:Jhe(r)?t:void 0,variation:n})}const _ge={Header:()=>null,SignIn:{Header:Ls.Header,Footer:Ls.Footer},SignUp:{Header:yo.Header,FormFields:yo.FormFields,Footer:yo.Footer},ConfirmSignUp:{Header:Wa.Header,Footer:Wa.Footer},SelectMfaType:{Header:Vi.Header,Footer:Vi.Footer},SetupEmail:{Header:Wi.Header,Footer:Wi.Footer},SetupTotp:{Header:Hi.Header,Footer:Hi.Footer},ConfirmResetPassword:{Header:Ya.Header,Footer:Ya.Footer},ConfirmSignIn:{Header:Za.Header,Footer:Za.Footer},VerifyUser:{Header:Ka.Header,Footer:Ka.Footer},ConfirmVerifyUser:{Header:Ga.Header,Footer:Ga.Footer},ForceNewPassword:{Header:vo.Header,Footer:vo.Footer,FormFields:vo.FormFields},ForgotPassword:{Header:qi.Header,Footer:qi.Footer},Footer:()=>null};function xge({children:e,className:t,components:n,formFields:r,hideSignUp:o,initialState:s,loginMechanisms:a,passwordSettings:u,passwordless:c,signUpAttributes:f,services:h,socialProviders:g,variation:m}){bhe({message:"The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.",shouldWarn:!1});const{route:v,signOut:w,user:S}=ot(({route:A,signOut:I,user:T})=>[A,I,T]);Yde({initialState:s,loginMechanisms:a,passwordSettings:u,passwordless:c,services:h,signUpAttributes:f,socialProviders:g,formFields:r});const C=_.useMemo(()=>({components:{..._ge,...n}}),[n]);return v==="authenticated"||v==="signOut"?e?_.createElement(_.Fragment,null,ks(e)?e({signOut:w,user:S}):e):null:_.createElement(T9.Provider,{value:C},_.createElement(Ege,{className:t,hideSignUp:o,variation:m}))}function Zo(e){return Xde({componentName:"Authenticator",packageName:"react",version:yhe}),_.createElement(d9,null,_.createElement(xge,{...e}))}Zo.Provider=d9;Zo.ForgotPassword=qi;Zo.SetupTotp=Hi;Zo.SignIn=Ls;Zo.SignUp=yo;Zo.ForceNewPassword=vo;Zo.SelectMfaType=Vi;Zo.SetupEmail=Wi;const L9=({cssText:e,...t})=>e===void 0||/<\/style/i.test(e)?null:_.createElement("style",{...t,dangerouslySetInnerHTML:{__html:e}});L9.displayName="Style";const U9=({theme:e,...t})=>{if(!e)return null;const{name:n,cssText:r}=e;return _.createElement(L9,{...t,cssText:r,id:`amplify-theme-${n}`})};U9.displayName="ThemeStyle";function Age({children:e,colorMode:t,direction:n="ltr",nonce:r,theme:o}){const s=_.useMemo(()=>({theme:Sy(o),colorMode:t}),[o,t]);return _.createElement(f9.Provider,{value:s},_.createElement(Zfe,{dir:n},_.createElement("div",{"data-amplify-theme":s.theme.name,"data-amplify-color-mode":t,dir:n},e),o?_.createElement(U9,{theme:s.theme,nonce:r}):null))}const Ige=({configured:e,authStatus:t})=>t==="authenticated",Rge=e=>e?e.signInDetails?.loginId??e.username??null:null,Tge=({children:e,fallback:t=null})=>{const{authStatus:n,signOut:r,user:o}=ot(s=>[s.authStatus,s.signOut,s.user]);return Ige({configured:!0,authStatus:n})?O.jsx(O.Fragment,{children:e({email:Rge(o),signOut:()=>r()})}):O.jsx(O.Fragment,{children:t})},Oge=({children:e,fallback:t=null})=>Bv()?O.jsx(Tge,{fallback:t,children:e}):O.jsx(O.Fragment,{children:t}),p4='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',qs=e=>`var(${e})`,Wt=qs("--accent"),Mge=qs("--accent-hover"),g4=qs("--accent-soft"),Od=qs("--accent-fg"),m4=qs("--surface"),au=qs("--fg"),Pge=qs("--surface-sunken"),sg=qs("--fg-muted"),Md=qs("--line"),Nge=Sy({name:"remit",tokens:{colors:{brand:{primary:{10:{value:g4},20:{value:g4},40:{value:Wt},60:{value:Wt},80:{value:Wt},90:{value:Wt},100:{value:Wt}}},background:{primary:{value:m4},secondary:{value:Pge}},font:{primary:{value:au},secondary:{value:sg},tertiary:{value:sg},interactive:{value:Wt},inverse:{value:Od},hover:{value:Wt},focus:{value:Wt},active:{value:Wt}},border:{primary:{value:Md},secondary:{value:Md},focus:{value:Wt}}},fonts:{default:{variable:{value:p4},static:{value:p4}}},radii:{small:{value:"3px"},medium:{value:"5px"},large:{value:"7px"}},components:{authenticator:{router:{borderColor:{value:Md},borderWidth:{value:"1px"},boxShadow:{value:"0 10px 30px -10px rgb(15 23 42 / 0.18), 0 4px 12px -6px rgb(15 23 42 / 0.1)"},backgroundColor:{value:m4}},form:{padding:{value:"1.75rem"}},orContainer:{color:{value:sg}}},button:{color:{value:au},primary:{backgroundColor:{value:Wt},color:{value:Od},_hover:{backgroundColor:{value:Mge},color:{value:Od}},_focus:{backgroundColor:{value:Wt},color:{value:Od}},_active:{backgroundColor:{value:Wt},color:{value:Od}}},link:{color:{value:Wt},_hover:{color:{value:Wt},backgroundColor:{value:"transparent"}},_focus:{color:{value:Wt},backgroundColor:{value:"transparent"}},_active:{color:{value:Wt},backgroundColor:{value:"transparent"}}}},fieldcontrol:{color:{value:au},borderColor:{value:Md},_focus:{borderColor:{value:Wt},boxShadow:{value:`0 0 0 2px ${Wt}`}}},field:{label:{color:{value:au}}},tabs:{borderColor:{value:Md},item:{color:{value:sg},backgroundColor:{value:"transparent"},_active:{color:{value:Wt},borderColor:{value:Wt},backgroundColor:{value:"transparent"}},_hover:{color:{value:Wt}},_focus:{color:{value:Wt}}}},heading:{color:{value:au}},text:{color:{value:au}}}}}),kge={signIn:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"}},signUp:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"},confirm_password:{placeholder:"Confirm your password"}}},Dge=()=>O.jsx(Zr,{tone:"warning",className:"fixed top-0 left-0 right-0 z-50 h-7 sm:h-10 overflow-hidden border-x-0 border-t-0",children:O.jsxs("span",{className:"flex items-center gap-2",children:[O.jsx("strong",{className:"font-semibold shrink-0",children:"Local dev"}),O.jsx("span",{className:"truncate hidden sm:inline",children:"— Cognito not configured. Set VITE_COGNITO_USER_POOL_ID and VITE_COGNITO_CLIENT_ID in .env.local to enable sign-in."}),O.jsx("span",{className:"truncate sm:hidden",children:"— no Cognito; signed out"})]})}),Lge=()=>O.jsx(tI,{note:oI({betterAuthEnabled:!1,cognitoConfigured:Bv()})}),Uge=({children:e})=>{const{authStatus:t}=ot(n=>[n.authStatus]);return t==="authenticated"?O.jsx(O.Fragment,{children:e}):t==="configuring"?O.jsx(Kv,{}):O.jsx(Age,{theme:Nge,children:O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsx(Zo,{hideSignUp:!1,formFields:kge,components:{Footer:Lge}})]})})},Fge=({children:e})=>Bv()?O.jsx(Zo.Provider,{children:O.jsx(Uge,{children:e})}):O.jsxs("div",{className:"pt-7 sm:pt-10 [&_#main-content]:h-[calc(100dvh-1.75rem)] sm:[&_#main-content]:h-[calc(100dvh-2.5rem)]",children:[O.jsx(Dge,{}),e]}),F9=60;let Nu=null;const $9=()=>Math.floor(Date.now()/1e3),$ge=e=>e!==null&&e.expiresAt-F9>$9(),zge=async()=>{const t=(await Uv()).tokens?.idToken;return t?(Nu={value:t.toString(),expiresAt:t.payload.exp??$9()+F9},Nu.value):(Nu=null,null)},jge=async()=>Bv()?$ge(Nu)?Nu.value:zge():null,Bge=()=>{Nu=null},Um={configure:aF,getToken:jge,resetToken:Bge,Shell:Fge,Account:Oge},Hge=({children:e})=>Hv()?O.jsx(Om.Shell,{children:e}):O.jsx(Um.Shell,{children:e}),qge=e=>Hv()?O.jsx(Om.Account,{...e}):O.jsx(Um.Account,{...e}),Vge={configure:aF,getToken:()=>Hv()?Om.getToken():Um.getToken(),resetToken:()=>{Om.resetToken(),Um.resetToken()},Shell:Hge,Account:qge};var bc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Wge=class extends bc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},eR=new Wge,Gge={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Kge=class{#e=Gge;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Aa=new Kge;function Zge(e){setTimeout(e,0)}var Yge=typeof window>"u"||"Deno"in globalThis;function Vn(){}function Qge(e,t){return typeof e=="function"?e(t):e}function nx(e){return typeof e=="number"&&e>=0&&e!==1/0}function z9(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ui(e,t){return typeof e=="function"?e(t):e}function Ir(e,t){return typeof e=="function"?e(t):e}function v4(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:a,stale:u}=e;if(a){if(r){if(t.queryHash!==tR(a,t.options))return!1}else if(!If(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||o&&o!==t.state.fetchStatus||s&&!s(t))}function y4(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Qa(t.options.mutationKey)!==Qa(s))return!1}else if(!If(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function tR(e,t){return(t?.queryKeyHashFn||Qa)(e)}function Qa(e){return JSON.stringify(e,(t,n)=>rx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function If(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>If(e[n],t[n])):!1}var Xge=Object.prototype.hasOwnProperty;function j9(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=b4(e)&&b4(t);if(!r&&!(rx(e)&&rx(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),u=a.length,c=r?new Array(u):{};let f=0;for(let h=0;h<u;h++){const g=r?h:a[h],m=e[g],v=t[g];if(m===v){c[g]=m,(r?h<s:Xge.call(e,g))&&f++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){c[g]=v;continue}const w=j9(m,v,n+1);c[g]=w,w===m&&f++}return s===u&&f===s?e:c}function Fm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function b4(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rx(e){if(!S4(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!S4(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function S4(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jge(e){return new Promise(t=>{Aa.setTimeout(t,e)})}function ox(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?j9(e,t):t}function eme(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function tme(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var nR=Symbol();function B9(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===nR?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rR(e,t){return typeof e=="function"?e(...t):!!e}function nme(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Rf=(()=>{let e=()=>Yge;return{isServer(){return e()},setIsServer(t){e=t}}})();function sx(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var rme=Zge;function ome(){let e=[],t=0,n=u=>{u()},r=u=>{u()},o=rme;const s=u=>{t?e.push(u):o(()=>{n(u)})},a=()=>{const u=e;e=[],u.length&&o(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;t++;try{c=u()}finally{t--,t||a()}return c},batchCalls:u=>(...c)=>{s(()=>{u(...c)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{o=u}}}var yn=ome(),sme=class extends bc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},$m=new sme;function ime(e){return Math.min(1e3*2**e,3e4)}function H9(e){return(e??"online")==="online"?$m.isOnline():!0}var ix=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function q9(e){let t=!1,n=0,r;const o=sx(),s=()=>o.status!=="pending",a=S=>{if(!s()){const C=new ix(S);m(C),e.onCancel?.(C)}},u=()=>{t=!0},c=()=>{t=!1},f=()=>eR.isFocused()&&(e.networkMode==="always"||$m.isOnline())&&e.canRun(),h=()=>H9(e.networkMode)&&e.canRun(),g=S=>{s()||(r?.(),o.resolve(S))},m=S=>{s()||(r?.(),o.reject(S))},v=()=>new Promise(S=>{r=C=>{(s()||f())&&S(C)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),w=()=>{if(s())return;let S;const C=n===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(E){S=Promise.reject(E)}Promise.resolve(S).then(g).catch(E=>{if(s())return;const A=e.retry??(Rf.isServer()?0:3),I=e.retryDelay??ime,T=typeof I=="function"?I(n,E):I,N=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,E);if(t||!N){m(E);return}n++,e.onFail?.(n,E),Jge(T).then(()=>f()?void 0:v()).then(()=>{t?m(E):w()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(r?.(),o),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?w():v().then(w),o)}}var V9=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nx(this.gcTime)&&(this.#e=Aa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rf.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Aa.clearTimeout(this.#e),this.#e=void 0)}};function ame(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},c=0;const f=async()=>{let h=!1;const g=w=>{nme(w,()=>t.signal,()=>h=!0)},m=B9(t.options,t.fetchOptions),v=async(w,S,C)=>{if(h)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return g(M),M})(),I=await m(A),{maxPages:T}=t.options,N=C?tme:eme;return{pages:N(w.pages,I,T),pageParams:N(w.pageParams,S,T)}};if(o&&s.length){const w=o==="backward",S=w?W9:ax,C={pages:s,pageParams:a},E=S(r,C);u=await v(C,E,w)}else{const w=e??s.length;do{const S=c===0?a[0]??r.initialPageParam:ax(r,u);if(c>0&&S==null)break;u=await v(u,S),c++}while(c<w)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function ax(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function r6e(e,t){return t?ax(e,t)!=null:!1}function o6e(e,t){return!t||!e.getPreviousPageParam?!1:W9(e,t)!=null}var lme=class extends V9{#e;#t;#n;#r;#s;#o;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=C4(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=C4(this.options);t.data!==void 0&&(this.setState(w4(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=ox(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(Vn).catch(Vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ir(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nR||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ui(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!z9(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#i||this.#c()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const c=B9(this.options,t),h=(()=>{const g={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(g),g})();return this.#i=!1,this.options.persister?this.options.persister(c,h,this):c(h)},a=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return r(c),c})();(this.#e==="infinite"?ame(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#o=q9({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof ix&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#l({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const c=await this.#o.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof ix){if(c.silent)return this.#o.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#l({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...G9(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...w4(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),yn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function G9(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H9(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function w4(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function C4(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ume=class extends bc{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=sx(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#s;#o;#a;#i;#c;#l;#p;#d;#f;#u;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),E4(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ir(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),t._defaulted&&!Fm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&_4(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Ir(this.options.enabled,this.#t)!==Ir(t.enabled,this.#t)||Ui(this.options.staleTime,this.#t)!==Ui(t.staleTime,this.#t))&&this.#m();const o=this.#v();r&&(this.#t!==n||Ir(this.options.enabled,this.#t)!==Ir(t.enabled,this.#t)||o!==this.#u)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return dme(this,n)&&(this.#r=n,this.#o=this.options,this.#s=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#g.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#C();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Vn)),t}#m(){this.#S();const e=Ui(this.options.staleTime,this.#t);if(Rf.isServer()||this.#r.isStale||!nx(e))return;const n=z9(this.#r.dataUpdatedAt,e)+1;this.#d=Aa.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#u=e,!(Rf.isServer()||Ir(this.options.enabled,this.#t)===!1||!nx(this.#u)||this.#u===0)&&(this.#f=Aa.setInterval(()=>{(this.options.refetchIntervalInBackground||eR.isFocused())&&this.#h()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#S(){this.#d!==void 0&&(Aa.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Aa.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#r,s=this.#s,a=this.#o,c=e!==n?e.state:this.#n,{state:f}=e;let h={...f},g=!1,m;if(t._optimisticResults){const k=this.hasListeners(),L=!k&&E4(e,t),q=k&&_4(e,n,t,r);(L||q)&&(h={...h,...G9(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:S}=h;m=h.data;let C=!1;if(t.placeholderData!==void 0&&m===void 0&&S==="pending"){let k;o?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(k=o.data,C=!0):k=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,k!==void 0&&(S="success",m=ox(o?.data,k,t),g=!0)}if(t.select&&m!==void 0&&!C)if(o&&m===s?.data&&t.select===this.#c)m=this.#l;else try{this.#c=t.select,m=t.select(m),m=ox(o?.data,m,t),this.#l=m,this.#i=null}catch(k){this.#i=k}this.#i&&(v=this.#i,m=this.#l,w=Date.now(),S="error");const E=h.fetchStatus==="fetching",A=S==="pending",I=S==="error",T=A&&E,N=m!==void 0,R={status:S,fetchStatus:h.fetchStatus,isPending:A,isSuccess:S==="success",isError:I,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:h.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:E,isRefetching:E&&!A,isLoadingError:I&&!N,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:I&&N,isStale:oR(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Ir(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const k=R.data!==void 0,L=R.status==="error"&&!k,q=j=>{L?j.reject(R.error):k&&j.resolve(R.data)},F=()=>{const j=this.#a=R.promise=sx();q(j)},D=this.#a;switch(D.status){case"pending":e.queryHash===n.queryHash&&q(D);break;case"fulfilled":(L||R.data!==D.value)&&F();break;case"rejected":(!L||R.error!==D.reason)&&F();break}}return R}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#o=this.options,this.#s.data!==void 0&&(this.#p=this.#t),Fm(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#g.size)return!0;const s=new Set(o??this.#g);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(a=>{const u=a;return this.#r[u]!==e[u]&&s.has(u)})};this.#E({listeners:n()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){yn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function cme(e,t){return Ir(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ir(t.retryOnMount,e)===!1)}function E4(e,t){return cme(e,t)||e.state.data!==void 0&&lx(e,t,t.refetchOnMount)}function lx(e,t,n){if(Ir(t.enabled,e)!==!1&&Ui(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&oR(e,t)}return!1}function _4(e,t,n,r){return(e!==t||Ir(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&oR(e,n)}function oR(e,t){return Ir(t.enabled,e)!==!1&&e.isStaleByTime(Ui(t.staleTime,e))}function dme(e,t){return!Fm(e.getCurrentResult(),t)}var fme=class extends V9{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||K9(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=q9({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,a)=>{this.#s({type:"failed",failureCount:s,error:a})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#r.canStart();try{if(r)t();else{this.#s({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#s({type:"pending",context:a,variables:e,isPaused:o})}const s=await this.#r.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#s({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#s({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),yn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function K9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Z9=class extends bc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new fme({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=ig(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ig(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ig(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ig(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>y4(t,n))}findAll(e={}){return this.getAll().filter(t=>y4(e,t))}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return yn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Vn))))}};function ig(e){return e.options.scope?.id}var hme=class extends bc{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Fm(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Qa(n.mutationKey)!==Qa(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??K9();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){yn.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,o)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(t.data,null,n,r,o)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,o)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(void 0,t.error,n,r,o)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Y9=class extends bc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??tR(r,t);let s=this.get(o);return s||(s=new lme({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>v4(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>v4(e,n)):t}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pme=class{#e;#t;#n;#r;#s;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new Y9,this.#t=e.mutationCache||new Z9,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=eR.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=$m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ui(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,a=Qge(t,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return yn.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;yn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return yn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Vn).catch(Vn)}invalidateQueries(e,t={}){return yn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=yn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Vn)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ui(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Vn).catch(Vn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Vn).catch(Vn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return $m.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Qa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{If(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(Qa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{If(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=tR(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===nR&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Q9=_.createContext(void 0),cl=e=>{const t=_.useContext(Q9);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gme=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),O.jsx(Q9.Provider,{value:e,children:t})),X9=_.createContext(!1),mme=()=>_.useContext(X9);X9.Provider;function vme(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var yme=_.createContext(vme()),bme=()=>_.useContext(yme),Sme=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?rR(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},wme=e=>{_.useEffect(()=>{e.clearReset()},[e])},Cme=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||rR(n,[e.error,r])),Eme=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_me=(e,t)=>e.isLoading&&e.isFetching&&!t,xme=(e,t)=>e?.suspense&&t.isPending,x4=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ame(e,t,n){const r=mme(),o=bme(),s=cl(),a=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const u=s.getQueryCache().get(a.queryHash),c=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Eme(a),Sme(a,o,u),wme(o);const f=!s.getQueryCache().get(a.queryHash),[h]=_.useState(()=>new t(s,a)),g=h.getOptimisticResult(a),m=!r&&c;if(_.useSyncExternalStore(_.useCallback(v=>{const w=m?h.subscribe(yn.batchCalls(v)):Vn;return h.updateResult(),w},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),_.useEffect(()=>{h.setOptions(a)},[a,h]),xme(a,g))throw x4(a,h,o);if(Cme({result:g,errorResetBoundary:o,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw g.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,g),a.experimental_prefetchInRender&&!Rf.isServer()&&_me(g,r)&&(f?x4(a,h,o):u?.promise)?.catch(Vn).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?g:h.trackResult(g)}function Xa(e,t){return Ame(e,ume)}function sR(e,t){const n=cl(),[r]=_.useState(()=>new hme(n,e));_.useEffect(()=>{r.setOptions(e)},[r,e]);const o=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(yn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=_.useCallback((a,u)=>{r.mutate(a,u).catch(Vn)},[r]);if(o.error&&rR(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const Ime="modulepreload",Rme=function(e){return"/"+e},A4={},Re=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");o=c(n.map(f=>{if(f=Rme(f),f in A4)return;A4[f]=!0;const h=f.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Ime,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((v,w)=>{m.addEventListener("load",v),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return o.then(a=>{for(const u of a||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})};var I4=_.use,Eu=typeof window<"u"?_.useLayoutEffect:_.useEffect;function bE(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Tme(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function Ome(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}const J9=!1;function Tf(e){return e[e.length-1]}function Mme(e){return typeof e=="function"}function Ia(e,t){return Mme(e)?e(t):e}const ez=Object.prototype.hasOwnProperty,R4=Object.prototype.propertyIsEnumerable;function tz(e){for(const t in e)if(ez.call(e,t))return!0;return!1}const Pme=()=>Object.create(null),wa=(e,t)=>Ra(e,t,Pme);function Ra(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const o=t,s=M4(e)&&M4(o);if(!s&&!(zm(e)&&zm(o)))return o;const a=s?e:T4(e);if(!a)return o;const u=s?o:T4(o);if(!u)return o;const c=a.length,f=u.length,h=s?new Array(f):n();let g=0;for(let m=0;m<f;m++){const v=s?m:u[m],w=e[v],S=o[v];if(w===S){h[v]=w,(s?m<c:ez.call(e,v))&&g++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){h[v]=S;continue}const C=Ra(w,S,n,r+1);h[v]=C,C===w&&g++}return c===f&&g===c?e:h}function T4(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!R4.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!R4.call(e,o))return!1;r.push(o)}return r}function zm(e){if(!O4(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!O4(n)||!n.hasOwnProperty("isPrototypeOf"))}function O4(e){return Object.prototype.toString.call(e)==="[object Object]"}function M4(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Da(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Da(e[r],t[r],n))return!1;return!0}if(zm(e)&&zm(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!Da(e[a],t[a],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&o++;let s=0;for(const a in t)if((!r||t[a]!==void 0)&&(s++,s>o||!Da(e[a],t[a],n)))return!1;return o===s}return!1}function Vu(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function Nme(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Of(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const kme=/[\x00-\x1f\x7f"<>`{}]/g;function Dme(e){return e.replace(kme,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function P4(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Dme(t)}const Lme=["http:","https:","mailto:","tel:"];function jm(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Pd(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=P4(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+P4(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function Ume(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Fme(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ts(){throw new Error("Invariant failed")}function Mf(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const a=t.get(s);if(a)return o(a),a.value},set(s,a){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const u=t.get(s);if(u)u.value=a,o(u);else{const c={key:s,value:a,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(s,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Ni=4,nz=5;function $me(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function rz(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const a=$me(s);if(a){const[u,c]=a,f=s.charCodeAt(u+1);if(f===45){if(u+2<s.length&&s.charCodeAt(u+2)===36){const h=u+3,g=c;if(h<g)return n[0]=3,n[1]=t+u,n[2]=t+h,n[3]=t+g,n[4]=t+c+1,n[5]=o,n}}else if(f===36){const h=u+1,g=u+2;return g===c?(n[0]=2,n[1]=t+u,n[2]=t+h,n[3]=t+g,n[4]=t+c+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+g,n[3]=t+c,n[4]=t+c+1,n[5]=o,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Ty(e,t,n,r,o,s,a){a?.(n);let u=r;{const c=n.fullPath??n.from,f=c.length,h=n.options?.caseSensitive??e,g=n.options?.params?.parse??n.options?.parseParams;for(;u<f;){const v=rz(c,u,t);let w;const S=u,C=v[5];switch(u=C+1,s++,v[0]){case 0:{const E=c.substring(v[2],v[3]);if(h){const A=o.static?.get(E);if(A)w=A;else{o.static??=new Map;const I=Ta(n.fullPath??n.from);I.parent=o,I.depth=s,w=I,o.static.set(E,I)}}else{const A=E.toLowerCase(),I=o.staticInsensitive?.get(A);if(I)w=I;else{o.staticInsensitive??=new Map;const T=Ta(n.fullPath??n.from);T.parent=o,T.depth=s,w=T,o.staticInsensitive.set(A,T)}}break}case 1:{const E=c.substring(S,v[1]),A=c.substring(v[4],C),I=h&&!!(E||A),T=E?I?E:E.toLowerCase():void 0,N=A?I?A:A.toLowerCase():void 0,M=!g&&o.dynamic?.find(R=>!R.parse&&R.caseSensitive===I&&R.prefix===T&&R.suffix===N);if(M)w=M;else{const R=wE(1,n.fullPath??n.from,I,T,N);w=R,R.depth=s,R.parent=o,o.dynamic??=[],o.dynamic.push(R)}break}case 3:{const E=c.substring(S,v[1]),A=c.substring(v[4],C),I=h&&!!(E||A),T=E?I?E:E.toLowerCase():void 0,N=A?I?A:A.toLowerCase():void 0,M=!g&&o.optional?.find(R=>!R.parse&&R.caseSensitive===I&&R.prefix===T&&R.suffix===N);if(M)w=M;else{const R=wE(3,n.fullPath??n.from,I,T,N);w=R,R.parent=o,R.depth=s,o.optional??=[],o.optional.push(R)}break}case 2:{const E=c.substring(S,v[1]),A=c.substring(v[4],C),I=h&&!!(E||A),T=E?I?E:E.toLowerCase():void 0,N=A?I?A:A.toLowerCase():void 0,M=wE(2,n.fullPath??n.from,I,T,N);w=M,M.parent=o,M.depth=s,o.wildcard??=[],o.wildcard.push(M)}}o=w}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=Ta(n.fullPath??n.from);v.kind=nz,v.parent=o,s++,v.depth=s,o.pathless??=[],o.pathless.push(v),o=v}const m=(n.path||!n.children)&&!n.isRoot;if(m&&c.endsWith("/")){const v=Ta(n.fullPath??n.from);v.kind=Ni,v.parent=o,s++,v.depth=s,o.index=v,o=v}o.parse=g??null,o.priority=n.options?.params?.priority??0,m&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)Ty(e,t,c,u,o,s,a)}function SE(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ii(e){if(e.pathless)for(const t of e.pathless)Ii(t);if(e.static)for(const t of e.static.values())Ii(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ii(t);if(e.dynamic?.length){e.dynamic.sort(SE);for(const t of e.dynamic)Ii(t)}if(e.optional?.length){e.optional.sort(SE);for(const t of e.optional)Ii(t)}if(e.wildcard?.length){e.wildcard.sort(SE);for(const t of e.wildcard)Ii(t)}}function Ta(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function wE(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:o}}function zme(e,t){const n=Ta("/"),r=new Uint16Array(6);for(const o of e)Ty(!1,r,o,1,n,0);Ii(n),t.masksTree=n,t.flatCache=Mf(1e3)}function jme(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=iR(e,t.masksTree);return t.flatCache.set(e,r),r}function Bme(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let a=o.singleCache.get(s);return a||(a=Ta("/"),Ty(t,new Uint16Array(6),{from:e},1,a,0),o.singleCache.set(s,a)),iR(r,a,n)}function Hme(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=iR(e,t.segmentTree,n)}catch(a){if(a instanceof URIError)s=null;else throw a}return s&&(s.branch=sz(s.route)),t.matchCache.set(r,s),s}function qme(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Vme(e,t=!1,n){const r=Ta(e.fullPath),o=new Uint16Array(6),s={},a={};let u=0;return Ty(t,o,e,1,r,0,c=>{if(n?.(c,u),c.id in s&&Ts(),s[c.id]=c,u!==0&&c.path){const f=qme(c.fullPath);(!a[f]||c.fullPath.endsWith("/"))&&(a[f]=c)}u++}),Ii(r),{processedTree:{segmentTree:r,singleCache:Mf(1e3),matchCache:Mf(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:a}}function iR(e,t,n=!1){const r=e.split("/"),o=Gme(e,r,t,n);if(!o)return null;const[s]=oz(e,r,o);return{route:o.node.route,rawParams:s}}function oz(e,t,n){const r=Wme(n.node);let o=null;const s=Object.create(null);let a=n.extract?.part??0,u=n.extract?.node??0,c=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;a++,u++,c++,f++){const h=r[u];if(h.kind===Ni)break;if(h.kind===nz){f--,a--,c--;continue}const g=t[a],m=c;if(g&&(c+=g.length),h.kind===1){o??=n.node.fullPath.split("/");const v=o[f],w=h.prefix?.length??0;if(v.charCodeAt(w)===123){const S=h.suffix?.length??0,C=v.substring(w+2,v.length-S-1),E=g.substring(w,g.length-S);s[C]=decodeURIComponent(E)}else{const S=v.substring(1);s[S]=decodeURIComponent(g)}}else if(h.kind===3){if(n.skipped&1<<u){a--,c=m-1;continue}o??=n.node.fullPath.split("/");const v=o[f],w=h.prefix?.length??0,S=h.suffix?.length??0,C=v.substring(w+3,v.length-S-1),E=h.suffix||h.prefix?g.substring(w,g.length-S):g;E&&(s[C]=decodeURIComponent(E))}else if(h.kind===2){const v=h,w=e.substring(m+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),S=decodeURIComponent(w);s["*"]=S,s._splat=S;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:a,node:u,path:c,segment:f}]}function sz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Wme(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Gme(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!Tf(t),s=o&&e!=="/",a=t.length-(o?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let c=null,f=null;for(;u.length;){const h=u.pop(),{node:g,index:m,skipped:v,depth:w,statics:S,dynamics:C,optionals:E}=h;let{extract:A,rawParams:I}=h;if(g.kind===2&&g.route&&!lg(f,h))continue;if(g.parse){if(!N4(e,t,h))continue;I=h.rawParams,A=h.extract}r&&g.route&&g.kind!==Ni&&lg(c,h)&&(c=h);const T=m===a;if(T&&(g.route&&(!s||g.kind===Ni||g.kind===2)&&lg(f,h)&&(f=h),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const N=T?void 0:t[m];let M;if(T&&g.index){const R={node:g.index,index:m,skipped:v,depth:w+1,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I};let k=!0;if(g.index.parse&&(N4(e,t,R)||(k=!1)),k){if(!C&&!E&&!v&&Kme(S,a))return R;lg(f,R)&&(f=R)}}if(g.wildcard)for(let R=g.wildcard.length-1;R>=0;R--){const k=g.wildcard[R],{prefix:L,suffix:q}=k;if(!(L&&(T||!(k.caseSensitive?N:M??=N.toLowerCase()).startsWith(L)))){if(q){if(T)continue;const F=t.slice(m).join("/").slice(-q.length);if((k.caseSensitive?F:F.toLowerCase())!==q)continue}u.push({node:k,index:a,skipped:v,depth:w+1,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I})}}if(g.optional){const R=v|1<<w,k=w+1;for(let L=g.optional.length-1;L>=0;L--){const q=g.optional[L];u.push({node:q,index:m,skipped:R,depth:k,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I})}if(!T)for(let L=g.optional.length-1;L>=0;L--){const q=g.optional[L],{prefix:F,suffix:D}=q;if(F||D){const j=q.caseSensitive?N:M??=N.toLowerCase();if(F&&!j.startsWith(F)||D&&!j.endsWith(D))continue}u.push({node:q,index:m+1,skipped:v,depth:k,statics:S,dynamics:C,optionals:E+ag(a,m),extract:A,rawParams:I})}}if(!T&&g.dynamic&&N)for(let R=g.dynamic.length-1;R>=0;R--){const k=g.dynamic[R],{prefix:L,suffix:q}=k;if(L||q){const F=k.caseSensitive?N:M??=N.toLowerCase();if(L&&!F.startsWith(L)||q&&!F.endsWith(q))continue}u.push({node:k,index:m+1,skipped:v,depth:w+1,statics:S,dynamics:C+ag(a,m),optionals:E,extract:A,rawParams:I})}if(!T&&g.staticInsensitive){const R=g.staticInsensitive.get(M??=N.toLowerCase());R&&u.push({node:R,index:m+1,skipped:v,depth:w+1,statics:S+ag(a,m),dynamics:C,optionals:E,extract:A,rawParams:I})}if(!T&&g.static){const R=g.static.get(N);R&&u.push({node:R,index:m+1,skipped:v,depth:w+1,statics:S+ag(a,m),dynamics:C,optionals:E,extract:A,rawParams:I})}if(g.pathless){const R=w+1;for(let k=g.pathless.length-1;k>=0;k--){const L=g.pathless[k];u.push({node:L,index:m,skipped:v,depth:R,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I})}}}if(f)return f;if(r&&c){let h=c.index;for(let m=0;m<c.index;m++)h+=t[m].length;const g=h===e.length?"/":e.slice(h);return c.rawParams??=Object.create(null),c.rawParams["**"]=decodeURIComponent(g),c}return null}function ag(e,t){return 2**(e-t-1)}function Kme(e,t){return e===2**(t-1)-1}function N4(e,t,n){let r,o;try{[r,o]=oz(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=o,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function lg(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ni)>(e.node.kind===Ni)||t.node.kind===Ni==(e.node.kind===Ni)&&t.depth>e.depth))):!0}function um(e){return aR(e.filter(t=>t!==void 0).join("/"))}function aR(e){return e.replace(/\/{2,}/g,"/")}function iz(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Is(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function az(e){return Is(iz(e))}function Bm(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Zme(e,t,n){return Bm(e,n)===Bm(t,n)}function Yme({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let a;if(r){a=o?t:s?e:e+"\0"+t;const f=r.get(a);if(f)return f}let u;if(s)u=e.split("/");else if(o)u=t.split("/");else{for(u=e.split("/");u.length>1&&Tf(u)==="";)u.pop();const f=t.split("/");for(let h=0,g=f.length;h<g;h++){const m=f[h];m===""?h?h===g-1&&u.push(m):u=[m]:m===".."?u.pop():m==="."||u.push(m)}}u.length>1&&(Tf(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));const c=aR(u.join("/"))||"/";return a&&r&&r.set(a,c),c}function Qme(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function CE(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>D4(o,n)).join("/"):D4(r,n)}function k4({path:e,params:t,decoder:n,...r}){let o=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const a=e.length;let u=0,c,f="";for(;u<a;){const h=u;c=rz(e,h,c);const g=c[5];if(u=g+1,h===g)continue;const m=c[0];if(m===0){f+="/"+e.substring(h,g);continue}if(m===2){const v=t._splat;s._splat=v,s["*"]=v;const w=e.substring(h,c[1]),S=e.substring(c[4],g);if(!v){o=!0,(w||S)&&(f+="/"+w+S);continue}const C=CE("_splat",t,n);f+="/"+w+C+S;continue}if(m===1){const v=e.substring(c[2],c[3]);!o&&!(v in t)&&(o=!0),s[v]=t[v];const w=e.substring(h,c[1]),S=e.substring(c[4],g),C=CE(v,t,n)??"undefined";f+="/"+w+C+S;continue}if(m===3){const v=e.substring(c[2],c[3]),w=t[v];if(w==null)continue;s[v]=w;const S=e.substring(h,c[1]),C=e.substring(c[4],g),E=CE(v,t,n)??"";f+="/"+S+E+C;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:s,interpolatedPath:f||"/",isMissingParams:o}}function D4(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function jn(e){return e?.isNotFound===!0}function Xme(){try{return sessionStorage}catch{return}}const Jme="tsr-scroll-restoration-v1_3",lz=Xme();function eve(){try{return JSON.parse(lz?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function tve(){try{lz?.setItem(Jme,JSON.stringify(vu))}catch{}}const vu=eve(),L4="data-scroll-restoration-id",nve=e=>e.state.__TSR_key||e.href;function rve(e){const t=e.getAttribute(L4);if(t)return`[${L4}="${t}"]`;let n="",r=e,o;for(;o=r.parentNode;){let s=1,a=r;for(;a=a.previousElementSibling;)s++;const u=`${r.localName}:nth-child(${s})`;n=n?`${u} > ${n}`:u,r=o}return n}let ug=!1;const cm="window";function ux(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function U4(e){const t=new Set;for(const n of e){if(n===cm)continue;const r=ux(n);r&&t.add(r)}return t}function ove(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const o=e.options.getScrollRestorationKey||nve,s=new Set,a=u=>{const c=vu[u]||={};for(const f of s)f===document?c[cm]={scrollX,scrollY}:f.isConnected&&(c[rve(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,ug=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{ug||s.add(u.target)},!0),e.subscribe("onBeforeLoad",u=>{u.fromLocation&&a(o(u.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{a(o(e.stores.resolvedLocation.get()??e.stores.location.get())),tve()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",u=>{const c=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors,h=r.next,g=r.hash;let m;if(s.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const v=o(u.toLocation),w=u.fromLocation&&o(u.fromLocation);if(r.restoring&&w&&w!==v){const S=vu[w];if(S){let C=vu[v];for(const E in S){if(E===cm){if(h)continue}else{const A=ux(E);if(!A||h&&f&&(m??=U4(f),m.has(A)))continue}C||(C=vu[v]={}),C[E]??=S[E]}}}ug=!0;try{const S=u.toLocation.hash,C=u.toLocation.state.__hashScrollIntoViewOptions??!0;let E=!1;if(h){!S&&f&&(m??=U4(f));const A=S&&C&&g,I=r.restoring?vu[v]:void 0;if(I)for(const T in I){const{scrollX:N,scrollY:M}=I[T];if(T===cm){if(A)continue;scrollTo({top:M,left:N,behavior:c}),E=!0}else{const R=ux(T);R&&(R.scrollLeft=N,R.scrollTop=M,m?.delete(R))}}if(!S){const T={top:0,left:0,behavior:c};if(E||scrollTo(T),m)for(const N of m)N.scrollTo(T)}}!E&&S&&C&&document.getElementById(S)?.scrollIntoView(C)}finally{ug=!1}}))}function sve(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function EE(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function ive(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=EE(o):Array.isArray(s)?s.push(EE(o)):n[r]=[s,EE(o)]}return n}const ave=uve(JSON.parse),lve=cve(JSON.stringify,JSON.parse);function uve(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=ive(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function cve(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=sve(o,r);return s?`?${s}`:""}}const La="__root__";function Sc(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ar(e){return e instanceof Response&&!!e.options}function dve(e){return{input:({url:t})=>{for(const n of e)t=cx(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=uz(e[n],t);return t}}}function fve(e){const t=az(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),o=`${r}/`;return{input:({url:s})=>{const a=e.caseSensitive?s.pathname:s.pathname.toLowerCase();return a===r?s.pathname="/":a.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},output:({url:s})=>(s.pathname=um(["/",t,s.pathname]),s)}}function cx(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function uz(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function hve(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:o,init:s}=t,a=new Map,u=new Map,c=new Map,f=n(e.status),h=n(e.loadedAt),g=n(e.isLoading),m=n(e.isTransitioning),v=n(e.location),w=n(e.resolvedLocation),S=n(e.statusCode),C=n(e.redirect),E=n([]),A=n([]),I=n([]),T=r(()=>_E(a,E.get())),N=r(()=>_E(u,A.get())),M=r(()=>_E(c,I.get())),R=r(()=>E.get()[0]),k=r(()=>E.get().some(Q=>a.get(Q)?.get().status==="pending")),L=r(()=>({locationHref:v.get().href,resolvedLocationHref:w.get()?.href,status:f.get()})),q=r(()=>({status:f.get(),loadedAt:h.get(),isLoading:g.get(),isTransitioning:m.get(),matches:T.get(),location:v.get(),resolvedLocation:w.get(),statusCode:S.get(),redirect:C.get()})),F=Mf(64);function D(Q){let ae=F.get(Q);return ae||(ae=r(()=>{const ue=E.get();for(const we of ue){const U=a.get(we);if(U&&U.routeId===Q)return U.get()}}),F.set(Q,ae)),ae}const j={status:f,loadedAt:h,isLoading:g,isTransitioning:m,location:v,resolvedLocation:w,statusCode:S,redirect:C,matchesId:E,pendingIds:A,cachedIds:I,matches:T,pendingMatches:N,cachedMatches:M,firstId:R,hasPending:k,matchRouteDeps:L,matchStores:a,pendingMatchStores:u,cachedMatchStores:c,__store:q,getRouteMatchStore:D,setMatches:Z,setPending:he,setCached:B};Z(e.matches),s?.(j);function Z(Q){xE(Q,a,E,n,o)}function he(Q){xE(Q,u,A,n,o)}function B(Q){xE(Q,c,I,n,o)}return j}function _E(e,t){const n=[];for(const r of t){const o=e.get(r);o&&n.push(o.get())}return n}function xE(e,t,n,r,o){const s=e.map(u=>u.id),a=new Set(s);o(()=>{for(const u of t.keys())a.has(u)||t.delete(u);for(const u of e){const c=t.get(u.id);if(!c){const f=r(u);f.routeId=u.routeId,t.set(u.id,f);continue}c.routeId=u.routeId,c.get()!==u&&c.set(u)}Fme(n.get(),s)||n.set(s)})}const dx=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},pve=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Oy=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Ua=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const a=e.matches[s];if(!a)continue;const u=e.router.getMatch(a.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},F4=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),o=r>=0?r:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=o);for(let a=s;a>=0;a--){const u=e.matches[a];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return a}return n?s:o},ki=(e,t,n)=>{if(!(!ar(n)&&!jn(n)))throw ar(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:ar(n)?"redirected":jn(n)?"notFound":r.status==="pending"?"success":r.status,context:Ua(e,t.index),isFetching:!1,error:n})),jn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ar(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},cz=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},$4=(e,t,n)=>{const r=Ua(e,n);e.updateMatch(t,o=>({...o,context:r}))},Nd=(e,t,n)=>{const{id:r,routeId:o}=e.matches[t],s=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,ki(e,e.router.getMatch(r),n);try{s.options.onError?.(n)}catch(a){n=a,ki(e,e.router.getMatch(r),n)}e.updateMatch(r,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ar(n)&&!jn(n)&&(e.serialError??=n)},dz=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Oy(e,t)&&(n.options.loader||n.options.beforeLoad||hz(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{dx(e)},o);r._nonReactive.pendingTimeout=s}},gve=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;dz(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&ki(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},mve=(e,t,n,r)=>{const o=e.router.getMatch(t);let s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Vu(()=>{s?.resolve(),s=void 0});const{paramsError:a,searchError:u}=o;a&&Nd(e,n,a),u&&Nd(e,n,u),dz(e,t,r,o);const c=new AbortController;let f=!1;const h=()=>{f||(f=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:c})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{h(),g()});return}o._nonReactive.beforeLoadPromise=Vu();const m={...Ua(e,n,!1),...o.__routeContext},{search:v,params:w,cause:S}=o,C=Oy(e,t),E={search:v,abortController:c,params:w,preload:C,context:m,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},A=T=>{if(T===void 0){e.router.batch(()=>{h(),g()});return}(ar(T)||jn(T))&&(h(),Nd(e,n,T)),e.router.batch(()=>{h(),e.updateMatch(t,N=>({...N,__beforeLoadContext:T})),g()})};let I;try{if(I=r.options.beforeLoad(E),Of(I))return h(),I.catch(T=>{Nd(e,n,T)}).then(A)}catch(T){h(),Nd(e,n,T)}A(I)},vve=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>u(),a=()=>mve(e,n,t,o),u=()=>{if(cz(e,n))return;const c=gve(e,n,o);return Of(c)?c.then(a):a()};return s()},yve=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,a,u])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:u,scripts:a,styles:s?.styles}))},fz=(e,t,n,r,o)=>{const s=t[r-1],{params:a,loaderDeps:u,abortController:c,cause:f}=e.router.getMatch(n),h=Ua(e,r),g=Oy(e,n);return{params:a,deps:u,preload:!!g,parentMatchPromise:s,abortController:c,context:h,location:e.location,navigate:m=>e.router.navigate({...m,_fromLocation:e.location}),cause:g?"preload":f,route:o,...e.router.options.additionalContext}},z4=async(e,t,n,r,o)=>{try{const s=e.router.getMatch(n);try{(!(J9??e.router.isServer)||s.ssr===!0)&&Pf(o);const a=o.options.loader,u=typeof a=="function"?a:a?.handler,c=u?.(fz(e,t,n,r,o)),f=!!u&&Of(c);if((f||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,g=>({...g,isFetching:"loader"})),u){const g=f?await c:c;ki(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,m=>({...m,loaderData:g}))}o._lazyPromise&&await o._lazyPromise;const h=s._nonReactive.minPendingPromise;h&&await h,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:Ua(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let u=a;if(u?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Ua(e,r)}));return}const c=s._nonReactive.minPendingPromise;c&&await c,jn(a)&&await o.options.notFoundComponent?.preload?.(),ki(e,e.router.getMatch(n),a);try{o.options.onError?.(a)}catch(f){u=f,ki(e,e.router.getMatch(n),f)}!ar(u)&&!jn(u)&&await Pf(o,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:Ua(e,r),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),ki(e,a,s)}},bve=async(e,t,n)=>{async function r(v,w,S,C,E){const A=Date.now()-w.updatedAt,I=v?E.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:E.options.staleTime??e.router.options.defaultStaleTime??0,T=E.options.shouldReload,N=typeof T=="function"?T(fz(e,t,o,n,E)):T,{status:M,invalid:R}=C,k=A>=I&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);a=M==="success"&&(R||(N??k)),v&&E.options.preload===!1||(a&&!e.sync&&h?(u=!0,(async()=>{try{await z4(e,t,o,n,E);const L=e.router.getMatch(o);L._nonReactive.loaderPromise?.resolve(),L._nonReactive.loadPromise?.resolve(),L._nonReactive.loaderPromise=void 0,L._nonReactive.loadPromise=void 0}catch(L){ar(L)&&await e.router.navigate(L.options)}})()):M!=="success"||a?await z4(e,t,o,n,E):$4(e,o,n))}const{id:o,routeId:s}=e.matches[n];let a=!1,u=!1;const c=e.router.looseRoutesById[s],f=c.options.loader,h=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(cz(e,o)){if(!e.router.getMatch(o))return e.matches[n];$4(e,o,n)}else{const v=e.router.getMatch(o),w=e.router.stores.matchesId.get()[n],S=(w&&e.router.stores.matchStores.get(w)||null)?.routeId===s?w:e.router.stores.matches.get().find(E=>E.routeId===s)?.id,C=Oy(e,o);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&h)return v;await v._nonReactive.loaderPromise;const E=e.router.getMatch(o),A=E._nonReactive.error||E.error;A&&ki(e,E,A),E.status==="pending"&&await r(C,v,S,E,c)}else{const E=C&&!e.router.stores.matchStores.has(o),A=e.router.getMatch(o);A._nonReactive.loaderPromise=Vu(),E!==A.preload&&e.updateMatch(o,I=>({...I,preload:E})),await r(C,v,S,A,c)}}const g=e.router.getMatch(o);u||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,u||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const m=u?g.isFetching:!1;return m!==g.isFetching||g.invalid!==!1?(e.updateMatch(o,v=>({...v,isFetching:m,invalid:!1})),e.router.getMatch(o)):g};async function j4(e){const t=e,n=[];pve(t.router)&&dx(t);let r;for(let m=0;m<t.matches.length;m++){try{const v=vve(t,m);Of(v)&&await v}catch(v){if(ar(v))throw v;if(jn(v))r=v;else if(!t.preload)throw v;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const o=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?F4(t,r):void 0,a=r&&t.preload?0:s!==void 0?Math.min(s+1,o):o;let u,c;for(let m=0;m<a;m++)n.push(bve(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const v of m){if(v.status!=="rejected")continue;const w=v.reason;if(ar(w))throw w;jn(w)?u??=w:c??=w}if(c!==void 0)throw c}const f=u??(r&&!t.preload?r:void 0);let h=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const m=F4(t,f);m===void 0&&Ts();const v=t.matches[m],w=t.router.looseRoutesById[v.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),f.routeId=v.routeId;const C=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,E=>({...E,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),h=m,await Pf(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||t.router.getMatch(m.id)?.globalNotFound&&t.updateMatch(m.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Pf(m,["errorComponent"])}for(let m=0;m<=h;m++){const{id:v,routeId:w}=t.matches[m],S=t.router.looseRoutesById[w];try{const C=yve(t,v,S);if(C){const E=await C;t.updateMatch(v,A=>({...A,...E}))}}catch(C){console.error(`Error executing head for route ${w}:`,C)}}const g=dx(t);if(Of(g)&&await g,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function B4(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Pf(e,t=dm){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:o,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===dm?(()=>{if(e._componentsPromise===void 0){const r=B4(e,dm);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():B4(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function hz(e){for(const t of dm)if(e.options[t]?.preload)return!0;return!1}const dm=["component","errorComponent","pendingComponent","notFoundComponent"];var Fi="__TSR_index",H4="popstate",q4="beforeunload";function Sve(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:a}))},o=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},s=async({task:a,navigateOpts:u,...c})=>{if(u?.ignoreBlocker??!1){a();return}const f=e.getBlockers?.()??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&f.length&&h)for(const g of f){const m=Hm(c.path,c.state);if(await g.blockerFn({currentLocation:t,nextLocation:m,action:c.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,u,c)=>{const f=t.state[Fi];u=V4(f+1,u),s({task:()=>{e.pushState(a,u),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:u})},replace:(a,u,c)=>{const f=t.state[Fi];u=V4(f,u),s({task:()=>{e.replaceState(a,u),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:u})},go:(a,u)=>{s({task:()=>{e.go(a),o({type:"GO",index:a})},navigateOpts:u,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Fi]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,a]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(f=>f!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function V4(e,t){t||(t={});const n=lR();return{...t,key:n,__TSR_key:n,[Fi]:e}}function wve(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,a=k=>o=k,u=(k=>k),c=(()=>Hm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const k=lR();t.history.replaceState({[Fi]:0,key:k,__TSR_key:k},"")}let f=c(),h,g=!1,m=!1,v=!1,w=!1;const S=()=>f;let C,E;const A=()=>{C&&(R._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),R._ignoreSubscribers=!1,C=void 0,E=void 0,h=void 0)},I=(k,L,q)=>{const F=u(L);E||(h=f),f=Hm(L,q),C={href:F,state:q,isPush:C?.isPush||k==="push"},E||(E=Promise.resolve().then(()=>A()))},T=k=>{f=c(),R.notify({type:k})},N=async()=>{if(m){m=!1;return}const k=c(),L=k.state[Fi]-f.state[Fi],q=L===1,F=L===-1,D=!q&&!F||g;g=!1;const j=D?"GO":F?"BACK":"FORWARD",Z=D?{type:"GO",index:L}:{type:F?"BACK":"FORWARD"};if(v)v=!1;else{const he=s();if(typeof document<"u"&&he.length){for(const B of he)if(await B.blockerFn({currentLocation:f,nextLocation:k,action:j})){m=!0,t.history.go(1),R.notify(Z);return}}}f=c(),R.notify(Z)},M=k=>{if(w){w=!1;return}let L=!1;const q=s();if(typeof document<"u"&&q.length)for(const F of q){const D=F.enableBeforeUnload??!0;if(D===!0){L=!0;break}if(typeof D=="function"&&D()===!0){L=!0;break}}if(L)return k.preventDefault(),k.returnValue=""},R=Sve({getLocation:S,getLength:()=>t.history.length,pushState:(k,L)=>I("push",k,L),replaceState:(k,L)=>I("replace",k,L),back:k=>(k&&(v=!0),w=!0,t.history.back()),forward:k=>{k&&(v=!0),w=!0,t.history.forward()},go:k=>{g=!0,t.history.go(k)},createHref:k=>u(k),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(q4,M,{capture:!0}),t.removeEventListener(H4,N)},onBlocked:()=>{h&&f!==h&&(f=h)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(q4,M,{capture:!0}),t.addEventListener(H4,N),t.history.pushState=function(...k){const L=n.apply(t.history,k);return R._ignoreSubscribers||T("PUSH"),L},t.history.replaceState=function(...k){const L=r.apply(t.history,k);return R._ignoreSubscribers||T("REPLACE"),L},R}function Cve(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Hm(e,t){const n=Cve(e),r=n.indexOf("#"),o=n.indexOf("?"),s=lR();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[Fi]:0,key:s,__TSR_key:s}}}function lR(){return(Math.random()+1).toString(36).substring(7)}function ku(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Eve=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,a=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Qme(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=wve()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=Mf(1e3),h=this.buildRouteTree(),this.setRoutes(h)}if(!this.stores&&this.latestLocation){const h=this.getStoreConfig(this);this.batch=h.batch,this.stores=hve(xve(this.latestLocation),h),ove(this)}let u=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(s||o!==c||a!==f){this.basepath=c;const h=[],g=az(c);g&&g!=="/"&&h.push(fve({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:dve(h),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Vme(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&zme(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:c,search:f,hash:h,href:g,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const E=this.options.parseSearch(f),A=this.options.stringifySearch(E);return{href:c+A+h,publicHref:c+A+h,pathname:Pd(c).path,external:!1,searchStr:A,search:wa(r?.search,E),hash:Pd(h.slice(1)).path,state:Ra(r?.state,m)}}const v=new URL(g,this.origin),w=cx(this.rewrite,v),S=this.options.parseSearch(w.search),C=this.options.stringifySearch(S);return w.search=C,{href:w.href.replace(w.origin,""),publicHref:g,pathname:Pd(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:C,search:wa(r?.search,S),hash:Pd(w.hash.slice(1)).path,state:Ra(r?.state,m)}},s=o(n),{__tempLocation:a,__tempKey:u}=s.state;if(a&&(!u||u===this.tempLocationKey)){const c=o(a);return c.state.key=s.state.key,c.state.__TSR_key=s.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>Yme({base:n,to:r.includes("//")?aR(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>Ave({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(a);s.from;const c=s.unsafeRelative==="path"?a.pathname:s.from??u.fullPath,f=s.to?`${s.to}`:void 0,h=u.search,g=Object.assign(Object.create(null),u.params),m=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(c,"."),v=f?this.resolvePathWithBase(m,f):m,w=s.params===!1||s.params===null?Object.create(null):(s.params??!0)===!0?g:Object.assign(g,Ia(s.params,g)),S=this.routesByPath[Is(v)];let C;if(S)C=this.getRouteBranch(S);else if(v.includes("$"))C=[];else{const F=this.getMatchedRoutes(v);C=F.matchedRoutes,this.options.notFoundRoute&&(!F.foundRoute||F.foundRoute.path!=="/"&&F.routeParams["**"])&&(C=[...C,this.options.notFoundRoute])}if(C.length&&tz(w))for(const F of C){const D=F.options.params?.stringify??F.options.stringifyParams;if(D)try{Object.assign(w,D(w))}catch{}}const E=n.leaveParams?v:Pd(k4({path:v,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let A=h;if(n._includeValidateSearch&&this.options.search?.strict){const F={};C.forEach(D=>{if(D.options.validateSearch)try{Object.assign(F,fm(D.options.validateSearch,{...F,...A}))}catch{}}),A=F}A=Ive({search:A,dest:s,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),A=wa(h,A);const I=this.options.stringifySearch(A),T=s.hash===!0?a.hash:s.hash?Ia(s.hash,a.hash):void 0,N=T?`#${T}`:"";let M=s.state===!0?a.state:s.state?Ia(s.state,a.state):{};M=Ra(a.state,M);const R=`${E}${I}${N}`;let k,L,q=!1;if(this.rewrite){const F=new URL(R,this.origin),D=uz(this.rewrite,F);k=F.href.replace(F.origin,""),D.origin!==this.origin?(L=D.href,q=!0):L=D.pathname+D.search+D.hash}else k=Ume(R),L=k;return{publicHref:L,href:k,pathname:E,search:A,searchStr:I,state:M,hash:T??"",external:q,unmaskOnReload:s.unmaskOnReload}},o=(s={},a)=>{const u=r(s);let c=a?r(a):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=jme(u.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:g,params:m,...v}=h.route,w=m===!1||m===null?Object.create(null):(m??!0)===!0?f:Object.assign(f,Ia(m,f));a={from:n.from,...v,params:w},c=r(a)}}}return c&&(u.maskedLocation=c),u};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{let s;const a=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(g=>{o.state[g]=this.latestLocation.state[g]});const h=Da(o.state,this.latestLocation.state);return f.forEach(g=>{delete o.state[g]}),h},u=Is(this.latestLocation.href)===Is(o.href);let c=this.commitLocationPromise;if(this.commitLocationPromise=Vu(()=>{c?.resolve(),c=void 0}),u&&a())this.load();else{let{maskedLocation:f,hashScrollIntoView:h,...g}=o;f&&(g={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,s=o.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:r})}return this._scroll.next=o.resetScroll??!0,this.history.subscribers.size||this.load(s?{action:{type:s}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:a,href:u,...c}={})=>{if(u){const g=this.history.location.state.__TSR_index,m=Hm(u,{__TSR_index:n?g:g+1}),v=new URL(m.pathname,this.origin);c.to=cx(this.rewrite,v).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...a})=>{let u=!1;if(o)try{new URL(`${o}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!o){const f=this.buildLocation({to:n,...a});o=o??f.publicHref,s=s??f.publicHref}const c=!u&&s?s:o;if(jm(c,this.protocolAllowlist))return;if(!a.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(c):window.location.href=c;return}return this.buildAndCommitLocation({...a,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(o=>!n.some(s=>s.id===o.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let o,s,a;const u=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const h=this.latestLocation,g=ku(h,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await j4({router:this,sync:n?.sync,forceStaleReload:u.href===h.href,matches:this.stores.pendingMatches.get(),location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,v=null,w=null,S=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),E=C.length,A=this.stores.matches.get();m=E?A.filter(N=>!this.stores.pendingMatchStores.has(N.id)):null;const I=new Set;for(const N of this.stores.pendingMatchStores.values())N.routeId&&I.add(N.routeId);const T=new Set;for(const N of this.stores.matchStores.values())N.routeId&&T.add(N.routeId);v=E?A.filter(N=>!I.has(N.routeId)):null,w=E?C.filter(N=>!T.has(N.routeId)):null,S=E?C.filter(N=>T.has(N.routeId)):A,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),E&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(N=>N.status!=="error"&&N.status!=="notFound"&&N.status!=="redirected")]),this.clearExpiredCache())});for(const[C,E]of[[v,"onLeave"],[w,"onEnter"],[S,"onStay"]])if(C)for(const A of C)this.looseRoutesById[A.routeId].options[E]?.(A)})})}})}catch(h){ar(h)?(o=h,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):jn(h)&&(s=h);const g=o?o.status:s?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(g),this.stores.redirect.set(o)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(f=>f.status==="error")&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(ku(s,a)):r.types;if(u===!1){n();return}o={update:n,types:u}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStores.get(n);if(o){o.set(r);return}const s=this.stores.matchStores.get(n);if(s){s.set(r);return}const a=this.stores.cachedMatchStores.get(n);if(a){const u=r(a.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(c=>c.filter(f=>f!==n)):a.set(u)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&jm(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(o=>!r(o))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=o=>{const s=this.looseRoutesById[o.routeId];if(!s.options.loader)return!0;const a=(o.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:n-o.updatedAt>=a};this.clearCache({filter:r})},this.loadRouteChunk=Pf,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...s,...this.stores.cachedIds.get()]),u=o.filter(c=>!a.has(c.id));if(u.length){const c=this.stores.cachedMatches.get();this.stores.setCached([...c,...u])}try{return o=await j4({router:this,matches:o,location:r,preload:!0,updateMatch:(c,f)=>{s.has(c)?o=o.map(h=>h.id===c?f(h):h):this.updateMatch(c,f)}}),o}catch(c){if(ar(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});jn(c)||console.error(c);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const a=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=Bme(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!u||n.params&&!Da(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Da(a.search,s.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??lve,parseSearch:e.parseSearch??ave,protocolAllowlist:e.protocolAllowlist??Lme}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=sz(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:o}=n;let{matchedRoutes:s}=n,a=!1;(r?r.path!=="/"&&o["**"]:Is(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:a=!0);const u=a?Tve(this.options.notFoundMode,s):void 0,c=new Array(s.length),f=new Map;for(const h of this.stores.matchStores.values())h.routeId&&f.set(h.routeId,h.get());for(let h=0;h<s.length;h++){const g=s[h],m=c[h-1];let v,w,S;{const D=m?.search??e.search,j=m?._strictSearch??void 0;try{const Z=fm(g.options.validateSearch,{...D})??void 0;v={...D,...Z},w={...j,...Z},S=void 0}catch(Z){let he=Z;if(Z instanceof qm||(he=new qm(Z.message,{cause:Z})),t?.throwOnError)throw he;v=D,w={},S=he}}const C=g.options.loaderDeps?.({search:v})??"",E=C?JSON.stringify(C):"",{interpolatedPath:A,usedParams:I}=k4({path:g.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),T=g.id+A+E,N=this.getMatch(T),M=f.get(g.id),R=N?._strictParams??I;let k;if(!N)try{W4(g,R)}catch(D){if(jn(D)||ar(D)?k=D:k=new _ve(D.message,{cause:D}),t?.throwOnError)throw k}Object.assign(o,R);const L=M?"stay":"enter";let q;if(N)q={...N,cause:L,params:M?.params??o,_strictParams:R,search:wa(M?M.search:N.search,v),_strictSearch:w};else{const D=g.options.loader||g.options.beforeLoad||g.lazyFn||hz(g)?"pending":"success";q={id:T,ssr:g.options.ssr,index:h,routeId:g.id,params:M?.params??o,_strictParams:R,pathname:A,updatedAt:Date.now(),search:M?wa(M.search,v):v,_strictSearch:w,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:k,__routeContext:void 0,_nonReactive:{loadPromise:Vu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:L,loaderDeps:M?Ra(M.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}t?.preload||(q.globalNotFound=u===g.id),q.searchError=S;const F=this.getParentContext(m);q.context={...F,...q.__routeContext,...q.__beforeLoadContext},c[h]=q}for(let h=0;h<c.length;h++){const g=c[h],m=this.looseRoutesById[g.routeId],v=this.getMatch(g.id),w=f.get(g.routeId);if(g.params=w?wa(w.params,o):o,!v){const S=c[h-1],C=this.getParentContext(S);if(m.options.context){const E={deps:g.loaderDeps,params:g.params,context:C??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:c,routeId:m.id};g.__routeContext=m.options.context(E)??void 0}g.context={...C,...g.__routeContext,...g.__beforeLoadContext}}}return c}matchRoutesLightweight(e){const t=Tf(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:o}=this.getMatchedRoutes(e.pathname),s=Tf(r),a={...e.search};for(const g of r)try{Object.assign(a,fm(g.options.validateSearch,a))}catch{}const u=t&&this.stores.matchStores.get(t)?.get(),c=u&&u.routeId===s.id&&u.pathname===e.pathname;let f;if(c)f=u.params;else{const g=Object.assign(Object.create(null),o);for(const m of r)try{W4(m,g)}catch{}f=g}const h={matchedRoutes:r,fullPath:s.fullPath,search:a,params:f};return this.lightweightCache.set(e,[t,h]),h}},qm=class extends Error{},_ve=class extends Error{};function xve(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function fm(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new qm("Async validation not supported");if(n.issues)throw new qm(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Ave({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),o=Is(e);let s;const a=Hme(o,n,!0);return a&&(s=a.route,Object.assign(r,a.rawParams)),{matchedRoutes:a?.branch||[t.__root__],routeParams:r,foundRoute:s}}function Ive({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Rve(n)(e,t,r??!1)}function Rve(e){let t,n;const r=[];for(const s of e){const a=s.options;if("search"in a)a.search?.middlewares&&r.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){const c=({search:f,next:h})=>{const g=h(a.preSearchFilters?a.preSearchFilters.reduce((m,v)=>v(m),f):f);return a.postSearchFilters?a.postSearchFilters.reduce((m,v)=>v(m),g):g};r.push(c)}const u=a.validateSearch;if(u){const c=({search:f,next:h,meta:g})=>{const m=h(f);if(n)try{const v=fm(u,m);if(g&&v)for(const w in v)w in m||(g.defaulted||=new Map).set(w,v[w]);return{...m,...v}}catch{}return m};r.push(c)}}const o=(s,a,u)=>{if(s>=r.length){if(!t.search)return{};if(t.search===!0)return a;const f=Ia(t.search,a);return u&&(u.explicit=f),f}const c=(f,h)=>{if(h){const g=u||{};return{search:o(s+1,f,g),meta:g}}return o(s+1,f,u)};return r[s]({search:a,next:c,meta:u})};return function(a,u,c){return t=u,n=c,o(0,a)}}function Tve(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return La}function W4(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const Ove="Error preloading route! ☝️";var pz=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=La:this.parentRoute||Ts();let o=r?La:n?.path;o&&o!=="/"&&(o=iz(o));const s=n?.id||o;let a=r?La:um([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);o==="__root__"&&(o="/"),a!=="__root__"&&(a=um(["/",a]));const u=a==="__root__"?"/":um([this.parentRoute.fullPath,o]);this._path=o,this._id=a,this._fullPath=u,this._to=Is(u)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Sc({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Mve=class extends pz{constructor(e){super(e)}};function uR(e){const t=e.errorComponent??cR;return O.jsx(Pve,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var Pve=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function cR({error:e}){const[t,n]=_.useState(!1);return O.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[O.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[O.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),O.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),O.jsx("div",{style:{height:".25rem"}}),t?O.jsx("div",{children:O.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?O.jsx("code",{children:e.message}):null})}):null]})}function Nve({children:e,fallback:t=null}){return gz()?O.jsx($.Fragment,{children:e}):O.jsx($.Fragment,{children:t})}function gz(){return $.useSyncExternalStore(kve,()=>!0,()=>!1)}function kve(){return()=>{}}var mz=_.createContext(null);function gr(e){return _.useContext(mz)}var My=_.createContext(void 0),Dve=_.createContext(void 0),Bt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Bt||{});function Lve({update:e,notify:t,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:a,shallowPropagate:u};function r(f,h,g){const m=h.depsTail;if(m!==void 0&&m.dep===f)return;const v=m!==void 0?m.nextDep:h.deps;if(v!==void 0&&v.dep===f){v.version=g,h.depsTail=v;return}const w=f.subsTail;if(w!==void 0&&w.version===g&&w.sub===h)return;const S=h.depsTail=f.subsTail={version:g,dep:f,sub:h,prevDep:m,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=S),m!==void 0?m.nextDep=S:h.deps=S,w!==void 0?w.nextSub=S:f.subs=S}function o(f,h=f.sub){const g=f.dep,m=f.prevDep,v=f.nextDep,w=f.nextSub,S=f.prevSub;return v!==void 0?v.prevDep=m:h.depsTail=m,m!==void 0?m.nextDep=v:h.deps=v,w!==void 0?w.prevSub=S:g.subsTail=S,S!==void 0?S.nextSub=w:(g.subs=w)===void 0&&n(g),v}function s(f){let h=f.nextSub,g;e:do{const m=f.sub;let v=m.flags;if(v&60?v&12?v&4?!(v&48)&&c(f,m)?(m.flags=v|40,v&=1):v=0:m.flags=v&-9|32:v=0:m.flags=v|32,v&2&&t(m),v&1){const w=m.subs;if(w!==void 0){const S=(f=w).nextSub;S!==void 0&&(g={value:h,prev:g},h=S);continue}}if((f=h)!==void 0){h=f.nextSub;continue}for(;g!==void 0;)if(f=g.value,g=g.prev,f!==void 0){h=f.nextSub;continue e}break}while(!0)}function a(f,h){let g,m=0,v=!1;e:do{const w=f.dep,S=w.flags;if(h.flags&16)v=!0;else if((S&17)===17){if(e(w)){const C=w.subs;C.nextSub!==void 0&&u(C),v=!0}}else if((S&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(g={value:f,prev:g}),f=w.deps,h=w,++m;continue}if(!v){const C=f.nextDep;if(C!==void 0){f=C;continue}}for(;m--;){const C=h.subs,E=C.nextSub!==void 0;if(E?(f=g.value,g=g.prev):f=C,v){if(e(h)){E&&u(C),h=f.sub;continue}v=!1}else h.flags&=-33;h=f.sub;const A=f.nextDep;if(A!==void 0){f=A;continue e}}return v}while(!0)}function u(f){do{const h=f.sub,g=h.flags;(g&48)===32&&(h.flags=g|16,(g&6)===2&&t(h))}while((f=f.nextSub)!==void 0)}function c(f,h){let g=h.depsTail;for(;g!==void 0;){if(g===f)return!0;g=g.prevDep}return!1}}function Uve(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}const fx=[];let hm=0;const{link:G4,unlink:Fve,propagate:$ve,checkDirty:vz,shallowPropagate:K4}=Lve({update(e){return e._update()},notify(e){fx[hx++]=e,e.flags&=~Bt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Bt.Mutable|Bt.Dirty,Vm(e))}});let cg=0,hx=0,ko,px=0;function yz(e){try{++px,e()}finally{--px||bz()}}function Vm(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Fve(n,e)}function bz(){if(!(px>0)){for(;cg<hx;){const e=fx[cg];fx[cg++]=void 0,e.notify()}cg=0,hx=0}}function Z4(e,t){const n=typeof e=="function",r=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Bt.None:Bt.Mutable,get(){return ko!==void 0&&G4(o,ko,hm),o._snapshot},subscribe(s){const a=Uve(s),u={current:!1},c=zve(()=>{o.get(),u.current?a.next?.(o._snapshot):u.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(s){const a=ko,u=t?.compare??Object.is;if(n)ko=o,++hm,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=Bt.Mutable|Bt.RecursedCheck);try{const c=o._snapshot,f=typeof s=="function"?s(c):s===void 0&&n?r(c):s;return c===void 0||!u(c,f)?(o._snapshot=f,!0):!1}finally{ko=a,n&&(o.flags&=~Bt.RecursedCheck),Vm(o)}}};return n?(o.flags=Bt.Mutable|Bt.Dirty,o.get=function(){const s=o.flags;if(s&Bt.Dirty||s&Bt.Pending&&vz(o.deps,o)){if(o._update()){const a=o.subs;a!==void 0&&K4(a)}}else s&Bt.Pending&&(o.flags=s&~Bt.Pending);return ko!==void 0&&G4(o,ko,hm),o._snapshot}):o.set=function(s){if(o._update(s)){const a=o.subs;a!==void 0&&($ve(a),K4(a),bz())}},o}function zve(e){const t=()=>{const r=ko;ko=n,++hm,n.depsTail=void 0,n.flags=Bt.Watching|Bt.RecursedCheck;try{return e()}finally{ko=r,n.flags&=~Bt.RecursedCheck,Vm(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Bt.Watching|Bt.RecursedCheck,notify(){const r=this.flags;r&Bt.Dirty||r&Bt.Pending&&vz(this.deps,this)?t():this.flags=Bt.Watching},stop(){this.flags=Bt.None,this.depsTail=void 0,Vm(this)}};return t(),n}function jve(e,t){return e===t}function hr(e,t,n=jve){const r=_.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(a);return u},[e]),o=_.useCallback(()=>e?.get(),[e]);return v$.useSyncExternalStoreWithSelector(r,o,o,t,n)}var AE={get(){},subscribe(){return{unsubscribe(){}}}};function Bve(e,t){const n=_.useRef();return r=>{const o=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Ra(n.current,o):o}}function dl(e){const t=gr(),n=_.useContext(e.from?Dve:My),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),o=Bve(e,t),s=hr(r??AE,a=>a?o(a):AE);if(s!==AE)return s;(e.shouldThrow??!0)&&Ts()}function Sz(e){return dl({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function wz(e){const{select:t,...n}=e;return dl({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Cz(e){return dl({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Py(e){return dl({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function dh(e){const t=gr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function i6e(e){const t=gr(),n=dh(),r=_.useRef(null);return Eu(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Ez(e){return dl({...e,select:t=>e.select?e.select(t.context):t.context})}function Hve(e,t){const n=gr(),r=Ome(t),{activeProps:o,inactiveProps:s,activeOptions:a,to:u,preload:c,preloadDelay:f,preloadIntentProximity:h,hashScrollIntoView:g,replace:m,startTransition:v,resetScroll:w,viewTransition:S,children:C,target:E,disabled:A,style:I,className:T,onClick:N,onBlur:M,onFocus:R,onMouseEnter:k,onMouseLeave:L,onTouchStart:q,ignoreBlocker:F,params:D,search:j,hash:Z,state:he,mask:B,reloadDocument:Q,unsafeRelative:ae,from:ue,_fromLocation:we,...U}=e,X=gz(),ie=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=hr(n.stores.location,Pt=>Pt,(Pt,Rn)=>Pt.href===Rn.href),fe=_.useMemo(()=>{const Pt={_fromLocation:oe,...ie};return n.buildLocation(Pt)},[n,oe,ie]),Me=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,xe=fe.maskedLocation?fe.maskedLocation.external:fe.external,se=_.useMemo(()=>Zve(Me,xe,n.history,A),[A,xe,Me,n.history]),Se=_.useMemo(()=>{if(se?.external)return jm(se.href,n.protocolAllowlist)?void 0:se.href;if(!Yve(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),jm(u,n.protocolAllowlist)?void 0:u}catch{}},[u,se,n.protocolAllowlist]),Ze=_.useMemo(()=>{if(Se)return!1;if(a?.exact){if(!Zme(oe.pathname,fe.pathname,n.basepath))return!1}else{const Pt=Bm(oe.pathname,n.basepath),Rn=Bm(fe.pathname,n.basepath);if(!(Pt.startsWith(Rn)&&(Pt.length===Rn.length||Pt[Rn.length]==="/")))return!1}return(a?.includeSearch??!0)&&!Da(oe.search,fe.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?X&&oe.hash===fe.hash:!0},[a?.exact,a?.explicitUndefined,a?.includeHash,a?.includeSearch,oe,Se,X,fe.hash,fe.pathname,fe.search,n.basepath]),ve=Ze?Ia(o,{})??qve:IE,pt=Ze?IE:Ia(s,{})??IE,gt=[T,ve.className,pt.className].filter(Boolean).join(" "),Ye=(I||ve.style||pt.style)&&{...I,...ve.style,...pt.style},[pn,Qe]=_.useState(!1),Gs=_.useRef(!1),Yo=e.reloadDocument||Se?!1:c??n.options.defaultPreload,ta=f??n.options.defaultPreloadDelay??0,ro=_.useCallback(()=>{n.preloadRoute({...ie,_builtLocation:fe}).catch(Pt=>{console.warn(Pt),console.warn(Ove)})},[n,ie,fe]);Tme(r,_.useCallback(Pt=>{Pt?.isIntersecting&&ro()},[ro]),Kve,{disabled:!!A||Yo!=="viewport"}),_.useEffect(()=>{Gs.current||!A&&Yo==="render"&&(ro(),Gs.current=!0)},[A,ro,Yo]);const xc=Pt=>{const Rn=Pt.currentTarget.getAttribute("target"),_o=E!==void 0?E:Rn;if(!A&&!Qve(Pt)&&!Pt.defaultPrevented&&(!_o||_o==="_self")&&Pt.button===0){Pt.preventDefault(),fee.flushSync(()=>{Qe(!0)});const vl=n.subscribe("onResolved",()=>{vl(),Qe(!1)});n.navigate({...ie,replace:m,resetScroll:w,hashScrollIntoView:g,startTransition:v,viewTransition:S,ignoreBlocker:F})}};if(Se)return{...U,ref:r,href:Se,...C&&{children:C},...E&&{target:E},...A&&{disabled:A},...I&&{style:I},...T&&{className:T},...N&&{onClick:N},...M&&{onBlur:M},...R&&{onFocus:R},...k&&{onMouseEnter:k},...L&&{onMouseLeave:L},...q&&{onTouchStart:q}};const Sh=Pt=>{if(A||Yo!=="intent")return;if(!ta){ro();return}const Rn=Pt.currentTarget;if(kd.has(Rn))return;const _o=setTimeout(()=>{kd.delete(Rn),ro()},ta);kd.set(Rn,_o)},db=Pt=>{A||Yo!=="intent"||ro()},Fn=Pt=>{if(A||!Yo||!ta)return;const Rn=Pt.currentTarget,_o=kd.get(Rn);_o&&(clearTimeout(_o),kd.delete(Rn))};return{...U,...ve,...pt,href:se?.href,ref:r,onClick:lu([N,xc]),onBlur:lu([M,Fn]),onFocus:lu([R,Sh]),onMouseEnter:lu([k,Sh]),onMouseLeave:lu([L,Fn]),onTouchStart:lu([q,db]),disabled:!!A,target:E,...Ye&&{style:Ye},...gt&&{className:gt},...A&&Vve,...Ze&&Wve,...X&&pn&&Gve}}var IE={},qve={className:"active"},Vve={role:"link","aria-disabled":!0},Wve={"data-status":"active","aria-current":"page"},Gve={"data-transitioning":"transitioning"},kd=new WeakMap,Kve={rootMargin:"100px"},lu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Zve(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Yve(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}function a6e(e){return _.forwardRef(function(n,r){return O.jsx(dR,{...n,_asChild:e,ref:r})})}var dR=_.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=Hve(r,t),a=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...c}=s;return _.createElement("a",c,a)}return _.createElement(n,s,a)});function Qve(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Xve=class extends pz{constructor(t){super(t),this.useMatch=n=>dl({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ez({...n,from:this.id}),this.useSearch=n=>Py({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Cz({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>wz({...n,from:this.id}),this.useLoaderData=n=>Sz({...n,from:this.id}),this.useNavigate=()=>dh({from:this.fullPath}),this.Link=$.forwardRef((n,r)=>O.jsx(dR,{ref:r,from:this.fullPath,...n}))}};function Jve(e){return new Xve(e)}function eye(){return e=>nye(e)}var tye=class extends Mve{constructor(e){super(e),this.useMatch=t=>dl({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Ez({...t,from:this.id}),this.useSearch=t=>Py({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Cz({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>wz({...t,from:this.id}),this.useLoaderData=t=>Sz({...t,from:this.id}),this.useNavigate=()=>dh({from:this.fullPath}),this.Link=$.forwardRef((t,n)=>O.jsx(dR,{ref:n,from:this.fullPath,...t}))}};function nye(e){return new tye(e)}function Ee(e){return new rye(e,{silent:!0}).createRoute}var rye=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=Jve(n);return r.isRoot=!1,r},this.silent=t?.silent}};function Ie(e,t){let n,r,o,s;const a=()=>(n||(n=e().then(c=>{n=void 0,r=c[t??"default"]}).catch(c=>{if(o=c,Nme(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(f)||(sessionStorage.setItem(f,"1"),s=!0)}})),n),u=function(f){if(s)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!r)if(I4)I4(a());else throw a();return _.createElement(r,f)};return u.preload=a,u}function oye(e){const t=gr(),n=`not-found-${hr(t.stores.location,r=>r.pathname)}-${hr(t.stores.status,r=>r)}`;return O.jsx(uR,{getResetKey:()=>n,onCatch:(r,o)=>{if(jn(r))e.onCatch?.(r,o);else throw r},errorComponent:({error:r})=>{if(jn(r))return e.fallback?.(r);throw r},children:e.children})}function sye(){return O.jsx("p",{children:"Not Found"})}function yu(e){return O.jsx(O.Fragment,{children:e.children})}function _z(e,t,n){return t.options.notFoundComponent?O.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?O.jsx(e.options.defaultNotFoundComponent,{...n}):O.jsx(sye,{})}function iye(e){return null}function aye(){return iye(gr()),null}var lye=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,uye=(e,t)=>e[0]===t[0]&&e[1]===t[1],xz=_.memo(function({matchId:t}){const n=gr(),r=n.stores.matchStores.get(t);r||Ts();const o=hr(n.stores.loadedAt,a=>a),s=hr(r,a=>a,lye);return O.jsx(cye,{router:n,matchId:t,resetKey:o,matchState:_.useMemo(()=>{const a=s.routeId,u=n.routesById[a].parentRoute?.id;return{routeId:a,ssr:s.ssr,_displayPending:s._displayPending,parentRouteId:u}},[s._displayPending,s.routeId,s.ssr,n.routesById])})});function cye({router:e,matchId:t,resetKey:n,matchState:r}){const o=e.routesById[r.routeId],s=o.options.pendingComponent??e.options.defaultPendingComponent,a=s?O.jsx(s,{}):null,u=o.options.errorComponent??e.options.defaultErrorComponent,c=o.options.onCatch??e.options.defaultOnCatch,f=o.isRoot?o.options.notFoundComponent??e.options.notFoundRoute?.options.component:o.options.notFoundComponent,h=r.ssr===!1||r.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||h)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||h))?_.Suspense:yu,m=u?uR:yu,v=f?oye:yu;return O.jsxs(o.isRoot?o.options.shellComponent??yu:yu,{children:[O.jsx(My.Provider,{value:t,children:O.jsx(g,{fallback:a,children:O.jsx(m,{getResetKey:()=>n,errorComponent:u||cR,onCatch:(w,S)=>{if(jn(w))throw w.routeId??=r.routeId,w;c?.(w,S)},children:O.jsx(v,{fallback:w=>{if(w.routeId??=r.routeId,!f||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!o.isRoot)throw w;return _.createElement(f,w)},children:h||r._displayPending?O.jsx(Nve,{fallback:a,children:O.jsx(Y4,{matchId:t})}):O.jsx(Y4,{matchId:t})})})})}),r.parentRouteId===La?O.jsxs(O.Fragment,{children:[O.jsx(dye,{}),e.options.scrollRestoration&&J9?O.jsx(aye,{}):null]}):null]})}function dye(){const e=gr(),t=_.useRef();return Eu(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...ku(e.stores.location.get(),r??n)}),t.current=n},[hr(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var Y4=_.memo(function({matchId:t}){const n=gr(),r=(h,g)=>n.getMatch(h.id)?._nonReactive[g]??h._nonReactive[g],o=n.stores.matchStores.get(t);o||Ts();const s=hr(o,h=>h),a=s.routeId,u=n.routesById[a],c=_.useMemo(()=>{const h=(n.routesById[a].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:a,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return h?JSON.stringify(h):void 0},[a,s.loaderDeps,s._strictParams,s._strictSearch,n.options.defaultRemountDeps,n.routesById]),f=_.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?O.jsx(h,{},c):O.jsx(Az,{})},[c,u.options.component,n.options.defaultComponent]);if(s._displayPending)throw r(s,"displayPendingPromise");if(s._forcePending)throw r(s,"minPendingPromise");if(s.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const g=n.getMatch(s.id);if(g&&!g._nonReactive.minPendingPromise){const m=Vu();g._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),g._nonReactive.minPendingPromise=void 0},h)}}throw r(s,"loadPromise")}if(s.status==="notFound")return jn(s.error)||Ts(),_z(n,u,s.error);if(s.status==="redirected")throw ar(s.error)||Ts(),r(s,"loadPromise");if(s.status==="error")throw s.error;return f}),Az=_.memo(function(){const t=gr(),n=_.useContext(My);let r,o=!1,s;{const f=n?t.stores.matchStores.get(n):void 0;[r,o]=hr(f,h=>[h?.routeId,h?.globalNotFound??!1],uye),s=hr(t.stores.matchesId,h=>h[h.findIndex(g=>g===n)+1])}const a=r?t.routesById[r]:void 0,u=t.options.defaultPendingComponent?O.jsx(t.options.defaultPendingComponent,{}):null;if(o)return a||Ts(),_z(t,a,void 0);if(!s)return null;const c=O.jsx(xz,{matchId:s});return r===La?O.jsx(_.Suspense,{fallback:u,children:c}):c});function fye(){const e=gr(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),o=hr(e.stores.isLoading,g=>g),s=hr(e.stores.hasPending,g=>g),a=bE(o),u=o||n||s,c=bE(u),f=o||s,h=bE(f);return e.startTransition=g=>{r(!0),_.startTransition(()=>{g(),r(!1)})},_.useEffect(()=>{const g=e.history.subscribe(e.load),m=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Is(e.latestLocation.publicHref)!==Is(m.publicHref)&&e.commitLocation({...m,replace:!0}),()=>{g()}},[e,e.history]),Eu(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(m){console.error(m)}})()},[e]),Eu(()=>{a&&!o&&e.emit({type:"onLoad",...ku(e.stores.location.get(),e.stores.resolvedLocation.get())})},[a,e,o]),Eu(()=>{h&&!f&&e.emit({type:"onBeforeRouteMount",...ku(e.stores.location.get(),e.stores.resolvedLocation.get())})},[f,h,e]),Eu(()=>{if(c&&!u){const g=ku(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...g}),yz(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,c,e]),null}function hye(){const e=gr(),t=e.routesById[La].options.pendingComponent??e.options.defaultPendingComponent,n=t?O.jsx(t,{}):null,r=O.jsxs(typeof document<"u"&&e.ssr?yu:_.Suspense,{fallback:n,children:[O.jsx(fye,{}),O.jsx(pye,{})]});return e.options.InnerWrap?O.jsx(e.options.InnerWrap,{children:r}):r}function pye(){const e=gr(),t=hr(e.stores.firstId,o=>o),n=hr(e.stores.loadedAt,o=>o),r=t?O.jsx(xz,{matchId:t}):null;return O.jsx(My.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:O.jsx(uR,{getResetKey:()=>n,errorComponent:cR,onCatch:void 0,children:r})})}var gye=e=>({createMutableStore:Z4,createReadonlyStore:Z4,batch:yz}),mye=e=>new vye(e),vye=class extends Eve{constructor(e){super(e,gye)}};function yye({router:e,children:t,...n}){tz(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=O.jsx(mz.Provider,{value:e,children:t});return e.options.Wrap?O.jsx(e.options.Wrap,{children:r}):r}function bye({router:e,...t}){return O.jsx(yye,{router:e,...t,children:O.jsx(hye,{})})}var RE={exports:{}},Dd={},TE={exports:{}},OE={};var Q4;function Sye(){return Q4||(Q4=1,(function(e){function t(B,Q){var ae=B.length;B.push(Q);e:for(;0<ae;){var ue=ae-1>>>1,we=B[ue];if(0<o(we,Q))B[ue]=Q,B[ae]=we,ae=ue;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var Q=B[0],ae=B.pop();if(ae!==Q){B[0]=ae;e:for(var ue=0,we=B.length,U=we>>>1;ue<U;){var X=2*(ue+1)-1,ie=B[X],oe=X+1,fe=B[oe];if(0>o(ie,ae))oe<we&&0>o(fe,ie)?(B[ue]=fe,B[oe]=ae,ue=oe):(B[ue]=ie,B[X]=ae,ue=X);else if(oe<we&&0>o(fe,ae))B[ue]=fe,B[oe]=ae,ue=oe;else break e}}return Q}function o(B,Q){var ae=B.sortIndex-Q.sortIndex;return ae!==0?ae:B.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var c=[],f=[],h=1,g=null,m=3,v=!1,w=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function T(B){for(var Q=n(f);Q!==null;){if(Q.callback===null)r(f);else if(Q.startTime<=B)r(f),Q.sortIndex=Q.expirationTime,t(c,Q);else break;Q=n(f)}}function N(B){if(S=!1,T(B),!w)if(n(c)!==null)w=!0,M||(M=!0,D());else{var Q=n(f);Q!==null&&he(N,Q.startTime-B)}}var M=!1,R=-1,k=5,L=-1;function q(){return C?!0:!(e.unstable_now()-L<k)}function F(){if(C=!1,M){var B=e.unstable_now();L=B;var Q=!0;try{e:{w=!1,S&&(S=!1,A(R),R=-1),v=!0;var ae=m;try{t:{for(T(B),g=n(c);g!==null&&!(g.expirationTime>B&&q());){var ue=g.callback;if(typeof ue=="function"){g.callback=null,m=g.priorityLevel;var we=ue(g.expirationTime<=B);if(B=e.unstable_now(),typeof we=="function"){g.callback=we,T(B),Q=!0;break t}g===n(c)&&r(c),T(B)}else r(c);g=n(c)}if(g!==null)Q=!0;else{var U=n(f);U!==null&&he(N,U.startTime-B),Q=!1}}break e}finally{g=null,m=ae,v=!1}Q=void 0}}finally{Q?D():M=!1}}}var D;if(typeof I=="function")D=function(){I(F)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,Z=j.port2;j.port1.onmessage=F,D=function(){Z.postMessage(null)}}else D=function(){E(F,0)};function he(B,Q){R=E(function(){B(e.unstable_now())},Q)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(B){switch(m){case 1:case 2:case 3:var Q=3;break;default:Q=m}var ae=m;m=Q;try{return B()}finally{m=ae}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,Q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ae=m;m=B;try{return Q()}finally{m=ae}},e.unstable_scheduleCallback=function(B,Q,ae){var ue=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ue+ae:ue):ae=ue,B){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=ae+we,B={id:h++,callback:Q,priorityLevel:B,startTime:ae,expirationTime:we,sortIndex:-1},ae>ue?(B.sortIndex=ae,t(f,B),n(c)===null&&B===n(f)&&(S?(A(R),R=-1):S=!0,he(N,ae-ue))):(B.sortIndex=we,t(c,B),w||v||(w=!0,M||(M=!0,D()))),B},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(B){var Q=m;return function(){var ae=m;m=Q;try{return B.apply(this,arguments)}finally{m=ae}}}})(OE)),OE}var X4;function wye(){return X4||(X4=1,TE.exports=Sye()),TE.exports}var J4;function Cye(){if(J4)return Dd;J4=1;var e=wye(),t=rh(),n=yF();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var l=i,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d:null}function a(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function u(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function c(i){if(s(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,p=l;;){var y=d.return;if(y===null)break;var b=y.alternate;if(b===null){if(p=y.return,p!==null){d=p;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===d)return c(y),i;if(b===p)return c(y),l;b=b.sibling}throw Error(r(188))}if(d.return!==p.return)d=y,p=b;else{for(var x=!1,P=y.child;P;){if(P===d){x=!0,d=y,p=b;break}if(P===p){x=!0,p=y,d=b;break}P=P.sibling}if(!x){for(P=b.child;P;){if(P===d){x=!0,d=b,p=y;break}if(P===p){x=!0,p=b,d=y;break}P=P.sibling}if(!x)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:l}function h(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=h(i),l!==null)return l;i=i.sibling}return null}var g=Object.assign,m=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),I=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var j=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===j?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case M:return"SuspenseList";case L:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case I:return i.displayName||"Context";case A:return(i._context.displayName||"Context")+".Consumer";case T:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case R:return l=i.displayName||null,l!==null?l:Z(i.type)||"Memo";case k:l=i._payload,i=i._init;try{return Z(i(l))}catch{}}return null}var he=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ue=[],we=-1;function U(i){return{current:i}}function X(i){0>we||(i.current=ue[we],ue[we]=null,we--)}function ie(i,l){we++,ue[we]=i.current,i.current=l}var oe=U(null),fe=U(null),Me=U(null),xe=U(null);function se(i,l){switch(ie(Me,l),ie(fe,i),ie(oe,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?XM(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=XM(l),i=JM(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}X(oe),ie(oe,i)}function Se(){X(oe),X(fe),X(Me)}function Ze(i){i.memoizedState!==null&&ie(xe,i);var l=oe.current,d=JM(l,i.type);l!==d&&(ie(fe,i),ie(oe,d))}function ve(i){fe.current===i&&(X(oe),X(fe)),xe.current===i&&(X(xe),pd._currentValue=ae)}var pt,gt;function Ye(i){if(pt===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);pt=l&&l[1]||"",gt=-1<d.stack.indexOf(`
|
|
80
|
+
`;return typeof u=="function"&&u(null,C),C},yE}var d4;function Yhe(){if(d4)return iu;d4=1;const e=The(),t=Ghe(),n=Khe(),r=Zhe();function o(s,a,u,c,f){const h=[].slice.call(arguments,1),g=h.length,m=typeof h[g-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(g<2)throw new Error("Too few arguments provided");g===2?(f=u,u=a,a=c=void 0):g===3&&(a.getContext&&typeof f>"u"?(f=c,c=void 0):(f=c,c=u,u=a,a=void 0))}else{if(g<1)throw new Error("Too few arguments provided");return g===1?(u=a,a=c=void 0):g===2&&!a.getContext&&(c=u,u=a,a=void 0),new Promise(function(v,w){try{const S=t.create(u,c);v(s(S,a,c))}catch(S){w(S)}})}try{const v=t.create(u,c);f(null,s(v,a,c))}catch(v){f(v)}}return iu.create=t.create,iu.toCanvas=o.bind(null,n.render),iu.toDataURL=o.bind(null,n.renderToDataURL),iu.toString=o.bind(null,function(s,a,u){return r.render(s,u)}),iu}var Qhe=Yhe();const Xhe=sc(Qhe),Jhe=e=>e==="signIn"||e==="signUp",JI=e=>!!e&&(e==="EMAIL_OTP"||e==="SMS_MFA"),{getConfirmText:epe,getConfirmingText:tpe,getBackToSignInText:npe,getResendCodeText:rpe}=bn,Iy=()=>{const{isPending:e,toSignIn:t,challengeName:n,resendCode:r,selectedAuthMethod:o,availableAuthMethods:s}=ot(c=>[c.isPending,c.toSignIn,c.challengeName,c.resendCode,c.selectedAuthMethod,c.availableAuthMethods]),a=!!o&&o!=="PASSWORD"||!!s?.some(c=>c!=="PASSWORD"),u=JI(n)&&a&&r;return $.createElement(Pe,{direction:"column"},$.createElement(zt,{isDisabled:e,type:"submit",variation:"primary",isLoading:e,loadingText:tpe()},epe()),u&&$.createElement(zt,{onClick:r,type:"button"},rpe()),$.createElement(zt,{onClick:t,type:"button",variation:"link",size:"small"},npe()))},ope=new Ln("SetupTotp-logger"),{getSetupTotpText:spe,getCopiedText:ipe,getLoadingText:ape}=bn,Hi=({className:e,variation:t})=>{const{totpSecretCode:n,isPending:r,username:o,QRFields:s}=ot(T=>[T.isPending,T.totpSecretCode,T.username]),{handleChange:a,handleSubmit:u}=Pr(),{components:{SetupTotp:{Header:c=Hi.Header,Footer:f=Hi.Footer}}}=Mr(),[h,g]=_.useState(!0),[m,v]=_.useState(),[w,S]=_.useState("COPY"),{totpIssuer:C="AWSCognito",totpUsername:E=o}=s??{},A=_.useCallback(async()=>{try{const T=Qie(C,E,n),N=await Xhe.toDataURL(T);v(N)}catch(T){ope.error(T)}finally{g(!1)}},[C,E,n]);_.useEffect(()=>{m||A()},[A,m]);const I=()=>{navigator.clipboard.writeText(n),S(ipe())};return _.createElement(fr,{className:e,variation:t},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-totp":"",method:"post",onChange:a,onSubmit:u},_.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:r},_.createElement(c,null),_.createElement(Pe,{direction:"column"},h?_.createElement("p",null,ape(),"…"):_.createElement("img",{"data-amplify-qrcode":!0,src:m,alt:"qr code",width:"228",height:"228"}),_.createElement(Pe,{"data-amplify-copy":!0},_.createElement("div",null,n),_.createElement(Pe,{"data-amplify-copy-svg":!0,onClick:I},_.createElement("div",{"data-amplify-copy-tooltip":!0},w),_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})))),_.createElement(Ko,null),_.createElement(pr,null)),_.createElement(Iy,null),_.createElement(f,null))))};Hi.Header=function(){return _.createElement(Yn,{level:3},spe())};Hi.Footer=function(){return null};const{getSubmitText:lpe,getSubmittingText:upe}=bn,Ry=e=>{const{cancelButtonSendType:t,cancelButtonText:n,submitButtonText:r}=e,{isPending:o,resendCode:s,skipVerification:a,toSignIn:u}=ot(g=>[g.isPending]),c=()=>{switch(t){case"SKIP":a();break;case"RESEND":s();break;case"SIGN_IN":u();break;default:return}},f=o?$.createElement($.Fragment,null,upe(),"…"):$.createElement($.Fragment,null,lpe()),h=r??f;return $.createElement(Pe,{direction:"column"},$.createElement(zt,{variation:"primary",isDisabled:o,type:"submit"},h),$.createElement(Pe,{direction:"column",alignItems:"center"},$.createElement(zt,{onClick:c,type:"button",variation:"link",size:"small"},n)))},cpe=()=>$.createElement("svg",{"aria-label":"Apple icon",className:"amplify-icon federated-sign-in-icon",fill:"#000",preserveAspectRatio:"xMidYMid",stroke:"#000",strokeWidth:"0",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"})),dpe=()=>$.createElement("svg",{"aria-label":"Google icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},$.createElement("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285F4"}),$.createElement("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34A853"}),$.createElement("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782",fill:"#FBBC05"}),$.createElement("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#EB4335"})),fpe=()=>$.createElement(p9,{className:"federated-sign-in-icon",ariaLabel:"Facebook icon",viewBox:{minX:0,minY:0,width:279,height:538},pathData:"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z",fill:"#1877F2"}),hpe=()=>$.createElement("svg",{"aria-label":"Amazon icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 243 264",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},$.createElement("path",{d:"M230.826 208.039C227.468 203.683 208.551 205.982 200.056 206.998C197.471 207.321 197.076 205.042 199.407 203.405C214.475 192.665 239.201 195.766 242.082 199.364C244.966 202.982 241.337 228.071 227.173 240.049C225.001 241.888 222.93 240.904 223.898 238.468C227.077 230.431 234.205 212.419 230.826 208.039ZM123.769 264C71.0234 264 39.0764 241.955 14.7853 217.542C9.97339 212.706 3.71799 206.296 0.311513 200.691C-1.09773 198.372 2.59096 195.022 5.04421 196.844C35.239 219.268 79.1012 239.538 122.53 239.538C151.82 239.538 188.046 227.47 217.669 214.868C222.147 212.966 222.147 219.18 221.512 221.061C221.183 222.032 206.515 236.221 186.247 247.047C167.304 257.166 143.397 264 123.769 264Z",fill:"#F2541B"}),$.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M142.943 111.185C142.943 124.756 143.268 136.054 136.406 148.123C130.856 157.913 122.027 163.95 112.222 163.95C98.8288 163.95 90.9806 153.772 90.9806 138.693C90.9806 109.036 117.677 103.647 142.943 103.647V111.185ZM178.166 196.081C175.858 198.15 171.635 198.22 169.914 196.894C157.974 187.684 149.89 173.688 149.89 173.688C130.706 193.156 117.127 199 92.2879 199C62.8772 199 40 180.905 40 144.729C40 116.461 55.3552 97.2408 77.2563 87.823C96.2094 79.5256 122.684 78.0173 142.943 75.7517C142.943 75.7517 144.633 53.933 138.699 45.9806C134.098 39.8163 126.272 36.9329 119.089 36.9329C106.127 36.8829 93.61 43.9051 91.1262 57.4188C90.4136 61.2829 87.5533 64.5261 84.54 64.206L51.0823 60.5922C48.5156 60.2951 45.0381 57.6639 45.8636 53.3081C53.644 12.3684 90.7373 0 123.989 0C140.983 0 163.21 4.51651 176.608 17.3349C193.597 33.1648 191.969 54.2755 191.969 77.2722V131.51C191.969 147.835 198.768 154.987 205.151 163.775C207.376 166.953 207.886 170.714 205.04 173.032C197.902 178.999 178.166 196.081 178.166 196.081Z",fill:"#F2541B"})),ng=e=>{const{icon:t,provider:n,text:r}=e,{toFederatedSignIn:o}=ot(),s=u=>{u.preventDefault(),o({provider:n})};let a;return t==="facebook"?a=$.createElement(fpe,null):t==="google"?a=$.createElement(dpe,null):t==="amazon"?a=$.createElement(hpe,null):t==="apple"&&(a=$.createElement(cpe,null)),$.createElement(zt,{onClick:s,className:"federated-sign-in-button",gap:"1rem"},a,$.createElement(Yr,{as:"span"},r))},{getSignInWithFederationText:rg,getOrText:ppe}=bn;function D9(){const{route:e,socialProviders:t}=ot(({route:n,socialProviders:r})=>[n,r]);return t.length===0?null:$.createElement(Pe,{direction:"column",padding:"0 0 1rem 0",className:"federated-sign-in-container"},t.map(n=>{switch(n){case"amazon":return $.createElement(ng,{icon:"amazon",key:n,provider:Cu.Amazon,text:rg(e,n)});case"apple":return $.createElement(ng,{icon:"apple",key:n,provider:Cu.Apple,text:rg(e,n)});case"facebook":return $.createElement(ng,{icon:"facebook",key:n,provider:Cu.Facebook,text:rg(e,n)});case"google":return $.createElement(ng,{icon:"google",key:n,provider:Cu.Google,text:rg(e,n)});default:console.error(`Authenticator does not support ${n}. Please open an issue: https://github.com/aws-amplify/amplify-ui/issues/choose`)}}),$.createElement(qI,{size:"small",label:ppe()}))}const{getSignInText:og,getSigningInText:gpe,getForgotPasswordText:mpe,getSignInWithEmailText:vpe,getSignInWithSmsText:ype,getSignInWithPasskeyText:bpe,getOtherSignInOptionsText:Spe,getEnterUsernameFirstText:wpe}=bn;function Ls(){const{isPending:e,availableAuthMethods:t,preferredChallenge:n,toShowAuthMethods:r}=ot(E=>[E.isPending,E.availableAuthMethods,E.preferredChallenge,E.toShowAuthMethods]),{handleChange:o,handleSubmit:s}=Pr(),[a,u]=$.useState(""),{components:{SignIn:{Header:c=Ls.Header,Footer:f=Ls.Footer}}}=Mr(),g=t&&t.length>1&&n,m=a.trim().length>0,v=$.useCallback(E=>{const{name:A,value:I}=E.target;A==="username"&&typeof I=="string"&&u(I),o(E)},[o]),w=()=>{if(!n)return og();switch(n){case"EMAIL_OTP":return vpe();case"SMS_OTP":return ype();case"WEB_AUTHN":return bpe();default:return og()}},S=E=>{E.preventDefault(),s(E)},C=E=>{E.preventDefault(),r()};return $.createElement(ke,null,$.createElement(c,null),$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:g?S:s,onChange:v},$.createElement(D9,null),$.createElement(Pe,{direction:"column"},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:e},$.createElement(xy,null,$.createElement("legend",null,og())),$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(zt,{isDisabled:e,type:"submit",variation:"primary",isLoading:e,loadingText:gpe()},g?w():og()),g&&$.createElement(zt,{onClick:C,size:"small",variation:"link",isDisabled:e||!m,title:m?void 0:wpe()},Spe()),$.createElement(f,null))))}const Cpe=()=>{const{toForgotPassword:e}=ot(t=>[t.toForgotPassword]);return $.createElement(ke,{"data-amplify-footer":""},$.createElement(zt,{onClick:e,size:"small",variation:"link"},mpe()))};Ls.Footer=Cpe;Ls.Header=function(){return null};const{getCreateAccountText:f4,getCreatingAccountText:Epe,getCreateAccountWithEmailText:_pe,getCreateAccountWithPasswordText:xpe,getCreateAccountWithSmsText:Ape,getOrText:Ipe}=bn;function yo(){const{hasValidationErrors:e,isPending:t,availableAuthMethods:n,preferredChallenge:r,selectedAuthMethod:o}=ot(I=>[I.hasValidationErrors,I.isPending,I.availableAuthMethods,I.preferredChallenge,I.selectedAuthMethod]),{handleChange:s,handleBlur:a,handleSubmit:u}=Pr(),{components:{SignUp:{Header:c=yo.Header,FormFields:f=yo.FormFields,Footer:h=yo.Footer}}}=Mr(),g=n?.filter(I=>I!=="WEB_AUTHN"),m=g&&g.length>1,v=r&&r!=="WEB_AUTHN"?r:"PASSWORD",w=g?.filter(I=>I!==v)??[],C=(o??v)!=="PASSWORD",E=I=>{switch(I){case"EMAIL_OTP":return _pe();case"SMS_OTP":return Ape();case"PASSWORD":return m?xpe():f4();default:return f4()}},A=I=>T=>{T.preventDefault();const N=T.target.closest("form");if(N){if(!N.__authMethod){const M=document.createElement("input");M.name="__authMethod",N.appendChild(M)}N.__authMethod.type="hidden",N.__authMethod.value=I,N.requestSubmit()}};return $.createElement(ke,null,$.createElement(c,null),$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signup":"",method:"post",onChange:s,onSubmit:u,onBlur:a},$.createElement(D9,null),$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:t},$.createElement(Pe,{direction:"column"},$.createElement(f,{includePassword:!C}),$.createElement(pr,null)),$.createElement(zt,{isDisabled:(!m||w.length==0)&&e||t,isFullWidth:!0,type:"submit",variation:"primary",isLoading:t,loadingText:Epe(),onClick:A(v)},E(v)),m&&w.length>0&&$.createElement($.Fragment,null,$.createElement(Pe,{justifyContent:"center",padding:"medium 0"},Ipe()),w.map(I=>$.createElement(zt,{key:I,isDisabled:t,isFullWidth:!0,type:"button",variation:"primary",onClick:A(I)},E(I)))),$.createElement(h,null))))}yo.Header=function(){return null};yo.FormFields=function(){return $.createElement(Ko,null)};yo.Footer=function(){return null};const{getSignInTabText:Rpe,getSignUpTabText:Tpe}=bn,Ope=({className:e,hideSignUp:t,variation:n})=>{const{route:r,toSignIn:o,toSignUp:s}=ot(a=>[a.route,a.toSignIn,a.toSignUp]);return $.createElement(fr,{className:e,variation:n},t?$.createElement(ke,{"data-amplify-router-content":""},r==="signIn"&&$.createElement(Ls,null)):$.createElement(Ea.Container,{value:r,isLazy:!0,onValueChange:a=>{a!==r&&(a==="signIn"?o():s())}},$.createElement(Ea.List,{spacing:"equal",indicatorPosition:"top"},$.createElement(Ea.Item,{value:"signIn"},Rpe()),$.createElement(Ea.Item,{value:"signUp"},Tpe())),$.createElement(Ea.Panel,{value:"signIn","data-amplify-router-content":""},$.createElement(Ls,null)),$.createElement(Ea.Panel,{value:"signUp","data-amplify-router-content":""},$.createElement(yo,null))))},{getAccountRecoveryInfoText:Mpe,getSkipText:Ppe}=bn,Ga=({className:e,variation:t})=>{const{isPending:n}=ot(u=>[u.isPending]),{handleChange:r,handleSubmit:o}=Pr(),{components:{ConfirmVerifyUser:{Header:s=Ga.Header,Footer:a=Ga.Footer}}}=Mr();return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmverifyuser":"",method:"post",onChange:r,onSubmit:o},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(s,null),$.createElement(Pe,{direction:"column"},$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(Ry,{cancelButtonText:Ppe(),cancelButtonSendType:"SKIP"}),$.createElement(a,null))))};Ga.Header=function(){return $.createElement(Yn,{level:3},Mpe())};Ga.Footer=function(){return null};const{getSkipText:Npe,getVerifyText:kpe,getVerifyContactText:Dpe,getAccountRecoveryInfoText:Lpe}=bn,Upe=e=>Object.entries(e).map(([t,n],r)=>{const o=py[t].label;return $.createElement(WI,{name:"unverifiedAttr",value:t,key:t,defaultChecked:r===0},de(o),":"," ",Zie(o,n))}),Ka=({className:e,variation:t})=>{const{components:{VerifyUser:{Header:n=Ka.Header,Footer:r=Ka.Footer}}}=Mr(),{isPending:o,unverifiedUserAttributes:s}=ot(({isPending:h,unverifiedUserAttributes:g})=>[h,g]),{handleChange:a,handleSubmit:u}=Pr(),c=o?$.createElement($.Fragment,null,"Verifying…"):$.createElement($.Fragment,null,kpe()),f=$.createElement(GI,{legend:Dpe(),name:"verify_context",isDisabled:o,legendHidden:!0},Upe(s));return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-verifyuser":"",method:"post",onChange:a,onSubmit:u},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:o},$.createElement(n,null),f,$.createElement(pr,null),$.createElement(Ry,{cancelButtonText:Npe(),cancelButtonSendType:"SKIP",submitButtonText:c}),$.createElement(r,null))))};Ka.Header=function(){return $.createElement(Yn,{level:3},Lpe())};Ka.Footer=function(){return null};const{getChallengeText:Fpe,getDeliveryMessageText:$pe,getDeliveryMethodText:zpe}=bn,Za=({className:e,variation:t})=>{const{isPending:n,challengeName:r,codeDeliveryDetails:o}=ot(h=>[h.isPending,h.challengeName,h.codeDeliveryDetails]),{handleChange:s,handleSubmit:a}=Pr(),{components:{ConfirmSignIn:{Header:u=Za.Header,Footer:c=Za.Footer}}}=Mr(),f=JI(r)&&o;return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmsignin":"",method:"post",onChange:s,onSubmit:a},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(u,null),$.createElement(Pe,{direction:"column"},f&&$.createElement(Yr,{className:"amplify-authenticator__subtitle"},$pe(o)),$.createElement(Ko,null),$.createElement(pr,null)),$.createElement(Iy,null),$.createElement(c,null))))};function jpe(){const{challengeName:e,codeDeliveryDetails:t}=ot(({challengeName:r,codeDeliveryDetails:o})=>[r,o]),n=JI(e)&&t;return $.createElement($.Fragment,null,$.createElement(Yn,{level:3},Fpe(e)),n&&$.createElement(Yn,{level:5},zpe(t)))}Za.Header=jpe;Za.Footer=function(){return null};const{getResendCodeText:Bpe,getResetYourPasswordText:Hpe}=bn,Ya=({className:e,variation:t})=>{const{isPending:n}=ot(c=>[c.isPending]),{handleBlur:r,handleChange:o,handleSubmit:s}=Pr(),{components:{ConfirmResetPassword:{Header:a=Ya.Header,Footer:u=Ya.Footer}}}=Mr();return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmresetpassword":"",method:"post",onSubmit:s,onChange:o,onBlur:r},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(a,null),$.createElement(Pe,{direction:"column"},$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(Ry,{cancelButtonSendType:"RESEND",cancelButtonText:Bpe()}),$.createElement(u,null))))};Ya.Header=function(){const t=Hpe();return $.createElement(Yn,{level:3},t)};Ya.Footer=function(){return null};const{getBackToSignInText:qpe,getSendingText:Vpe,getSendCodeText:Wpe,getResetYourPasswordText:Gpe}=bn,qi=({className:e,variation:t})=>{const{isPending:n}=ot(u=>[u.isPending]),{handleChange:r,handleSubmit:o}=Pr(),{components:{ForgotPassword:{Header:s=qi.Header,Footer:a=qi.Footer}}}=Mr();return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-forgotpassword":"",method:"post",onChange:r,onSubmit:o},$.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},$.createElement(s,null),$.createElement(Pe,{direction:"column"},$.createElement(Ko,null)),$.createElement(pr,null),$.createElement(Ry,{cancelButtonText:qpe(),cancelButtonSendType:"SIGN_IN",submitButtonText:n?$.createElement($.Fragment,null,Vpe(),"…"):$.createElement($.Fragment,null,Wpe())}),$.createElement(a,null))))};qi.Header=function(){return $.createElement(Yn,{level:3},Gpe())};qi.Footer=function(){return null};const{getMfaTypeLabelByValue:Kpe,getSelectMfaTypeByChallengeName:Zpe,getSelectMfaTypeText:Ype}=bn,Vi=({className:e,variation:t})=>{const{isPending:n,allowedMfaTypes:r=[]}=ot(c=>[c.isPending,c.allowedMfaTypes]),{handleChange:o,handleSubmit:s}=Pr(),{components:{SelectMfaType:{Header:a=Vi.Header,Footer:u=Vi.Footer}}}=Mr();return _.createElement(fr,{className:e,variation:t},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-select-mfa-type":"",method:"post",onChange:o,onSubmit:s},_.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(a,null),_.createElement(Pe,{direction:"column"},_.createElement(GI,{name:"mfa_type",legend:Ype(),legendHidden:!0,isDisabled:n,isRequired:!0},r.map((c,f)=>_.createElement(WI,{name:"mfa_type",key:c,value:c,defaultChecked:f===0},Kpe(c)))),_.createElement(pr,null)),_.createElement(Iy,null),_.createElement(u,null))))};Vi.Header=function(){const{challengeName:t}=ot(n=>[n.challengeName]);return _.createElement(Yn,{level:3},Zpe(t))};Vi.Footer=function(){return null};const{getSetupEmailText:Qpe}=bn,Wi=({className:e,variation:t})=>{const{isPending:n}=ot(u=>[u.isPending]),{handleChange:r,handleSubmit:o}=Pr(),{components:{SetupEmail:{Header:s=Wi.Header,Footer:a=Wi.Footer}}}=Mr();return _.createElement(fr,{className:e,variation:t},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-email":"",method:"post",onChange:r,onSubmit:o},_.createElement(Pe,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(s,null),_.createElement(Pe,{direction:"column"},_.createElement(Ko,null),_.createElement(pr,null)),_.createElement(Iy,null),_.createElement(a,null))))};Wi.Header=function(){return _.createElement(Yn,{level:3},Qpe())};Wi.Footer=function(){return null};const{getSignInWithPasswordText:tx,getSignInWithEmailText:Xpe,getSignInWithSmsText:Jpe,getSignInWithPasskeyText:ege,getSigningInText:tge,getBackToSignInText:nge,getOrText:rge,getUsernameLabelByLoginMechanism:oge}=bn,sge=e=>{switch(e){case"EMAIL_OTP":return Xpe();case"SMS_OTP":return Jpe();case"WEB_AUTHN":return ege();case"PASSWORD":return tx();default:return tx()}},ige=({className:e,variation:t})=>{const{isPending:n,username:r,availableAuthMethods:o,toSignIn:s,selectAuthMethod:a,loginMechanism:u}=ot(S=>[S.isPending,S.username,S.availableAuthMethods,S.toSignIn,S.selectAuthMethod,S.loginMechanism]),{handleChange:c,handleSubmit:f}=Pr(),h=o??[],g=h.includes("PASSWORD"),m=h.filter(S=>S!=="PASSWORD"),v=S=>{a({method:S})},w=oge(u);return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":!0,"data-amplify-authenticator-signinselect":!0,method:"post",onSubmit:f,onChange:c},$.createElement(Pe,{direction:"column"},$.createElement(ch,{label:w,name:"username",value:r,isReadOnly:!0,isDisabled:!0}),g&&$.createElement($.Fragment,null,$.createElement(VI,{label:"Password",name:"password",autoComplete:"current-password",isDisabled:n}),$.createElement(zt,{isDisabled:n,type:"submit",variation:"primary",isFullWidth:!0,isLoading:n,loadingText:tge()},tx())),g&&m.length>0&&$.createElement(qI,{label:rge()}),m.length>0&&$.createElement(Pe,{direction:"column",gap:"0.5rem"},m.map(S=>$.createElement(zt,{key:S,variation:"primary",isFullWidth:!0,isDisabled:n,onClick:()=>v(S)},sge(S)))),$.createElement(pr,null),$.createElement(zt,{onClick:s,size:"small",variation:"link",isDisabled:n},nge()))))},age=e=>{const{className:t,...n}=e;return _.createElement(ke,{as:"span",width:"1em",height:"1em",className:Ne(re.Icon,t),...n},_.createElement("svg",{width:"54",height:"54",viewBox:"0 0 54 54",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M22.9333 38.9333L41.7333 20.1333L38 16.4L22.9333 31.4667L15.3333 23.8667L11.6 27.6L22.9333 38.9333ZM26.6667 53.3333C22.9778 53.3333 19.5111 52.6333 16.2667 51.2333C13.0222 49.8333 10.2 47.9333 7.8 45.5333C5.4 43.1333 3.5 40.3111 2.1 37.0667C0.7 33.8222 0 30.3556 0 26.6667C0 22.9778 0.7 19.5111 2.1 16.2667C3.5 13.0222 5.4 10.2 7.8 7.8C10.2 5.4 13.0222 3.5 16.2667 2.1C19.5111 0.7 22.9778 0 26.6667 0C30.3556 0 33.8222 0.7 37.0667 2.1C40.3111 3.5 43.1333 5.4 45.5333 7.8C47.9333 10.2 49.8333 13.0222 51.2333 16.2667C52.6333 19.5111 53.3333 22.9778 53.3333 26.6667C53.3333 30.3556 52.6333 33.8222 51.2333 37.0667C49.8333 40.3111 47.9333 43.1333 45.5333 45.5333C43.1333 47.9333 40.3111 49.8333 37.0667 51.2333C33.8222 52.6333 30.3556 53.3333 26.6667 53.3333Z",fill:"currentColor"})))},lge=e=>{const{className:t,...n}=e;return _.createElement(ke,{as:"span",width:"1em",height:"1em",className:Ne(re.Icon,t),...n},_.createElement("svg",{width:"195",height:"128",viewBox:"0 0 195 128",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("circle",{cx:"60",cy:"36",r:"31",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M60 69C84.4313 69 105.396 83.8504 114.357 105.021C116.774 110.729 115.382 116.168 111.798 120.23C108.191 124.319 102.358 127 96 127H24C17.6416 127 11.8094 124.319 8.20215 120.23C4.61836 116.168 3.22626 110.729 5.64258 105.021C14.6036 83.8504 35.5687 69 60 69Z",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"122",cy:"26",r:"25",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("mask",{id:"path-4-inside-1_4178_10171",fill:"white"},_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z"})),_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z",fill:"#00404D",stroke:"#00404D",strokeWidth:"4",mask:"url(#path-4-inside-1_4178_10171)"}),_.createElement("circle",{cx:"167.5",cy:"49.5",r:"19.5",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.89 43.65L161.26 54.18H167.89",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.5 60.42C173.316 60.42 178.03 55.7056 178.03 49.89V48.72",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"173.74",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("circle",{cx:"160.48",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M104 112C116.129 112 126.457 104.288 130.347 93.5H147.5L155.5 101.5L168 89L180.5 101.5L193 89L180.5 76.5H130.984C127.705 64.6779 116.866 56 104 56C88.536 56 76 68.536 76 84C76 99.464 88.536 112 104 112ZM104 98C111.732 98 118 91.732 118 84C118 76.268 111.732 70 104 70C96.268 70 90 76.268 90 84C90 91.732 96.268 98 104 98Z",fill:"#BCECF5"}),_.createElement("path",{d:"M130.347 93.5V92.5H129.645L129.407 93.1608L130.347 93.5ZM147.5 93.5L148.207 92.7929L147.914 92.5H147.5V93.5ZM155.5 101.5L154.793 102.207L155.5 102.914L156.207 102.207L155.5 101.5ZM168 89L168.707 88.2929L168 87.5858L167.293 88.2929L168 89ZM180.5 101.5L179.793 102.207L180.5 102.914L181.207 102.207L180.5 101.5ZM193 89L193.707 89.7071L194.414 89L193.707 88.2929L193 89ZM180.5 76.5L181.207 75.7929L180.914 75.5H180.5V76.5ZM130.984 76.5L130.021 76.7673L130.224 77.5H130.984V76.5ZM129.407 93.1608C125.655 103.565 115.694 111 104 111V113C116.564 113 127.259 105.011 131.288 93.8392L129.407 93.1608ZM147.5 92.5H130.347V94.5H147.5V92.5ZM156.207 100.793L148.207 92.7929L146.793 94.2071L154.793 102.207L156.207 100.793ZM167.293 88.2929L154.793 100.793L156.207 102.207L168.707 89.7071L167.293 88.2929ZM181.207 100.793L168.707 88.2929L167.293 89.7071L179.793 102.207L181.207 100.793ZM192.293 88.2929L179.793 100.793L181.207 102.207L193.707 89.7071L192.293 88.2929ZM179.793 77.2071L192.293 89.7071L193.707 88.2929L181.207 75.7929L179.793 77.2071ZM130.984 77.5H180.5V75.5H130.984V77.5ZM104 57C116.405 57 126.859 65.3669 130.021 76.7673L131.948 76.2327C128.552 63.9889 117.327 55 104 55V57ZM77 84C77 69.0883 89.0883 57 104 57V55C87.9837 55 75 67.9837 75 84H77ZM104 111C89.0883 111 77 98.9117 77 84H75C75 100.016 87.9837 113 104 113V111ZM117 84C117 91.1797 111.18 97 104 97V99C112.284 99 119 92.2843 119 84H117ZM104 71C111.18 71 117 76.8203 117 84H119C119 75.7157 112.284 69 104 69V71ZM91 84C91 76.8203 96.8203 71 104 71V69C95.7157 69 89 75.7157 89 84H91ZM104 97C96.8203 97 91 91.1797 91 84H89C89 92.2843 95.7157 99 104 99V97Z",fill:"#00404D"}),_.createElement("path",{d:"M138.5 57V66",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M139 104V124",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M134 61.5L143 61.5",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M129 114L149 114",stroke:"#00404D",strokeWidth:"2"})))},{getPasskeyPromptHeadingText:uge,getPasskeyPromptDescriptionText:cge,getCreatePasskeyText:dge,getRegisteringText:fge,getContinueWithoutPasskeyText:hge,getPasskeyCreatedSuccessText:pge,getPasskeyRegisteredText:gge,getPasskeyRegistrationFailedText:mge,getPasskeyLabelText:vge,getExistingPasskeysText:yge,getSetupAnotherPasskeyText:bge,getContinueText:Sge}=bn;function wge({className:e,variation:t}){const[n,r]=$.useState(!1),[o,s]=$.useState(null),[a,u]=$.useState(!1),[c,f]=$.useState([]),{submitForm:h,isPending:g}=ot(E=>[E.submitForm,E.isPending]),m=$.useCallback(async()=>{try{const E=await EI();f(E.credentials||[])}catch{}},[]);$.useEffect(()=>{n&&m()},[n,m]);const v=$.useCallback(()=>{h({type:"SKIP"})},[h]),w=$.useCallback(()=>{h({type:"SUBMIT"})},[h]),S=$.useCallback(async()=>{try{s(null),u(!0),await mie(),r(!0)}catch(E){const A=E,I=A.name??"",T=A.message??"";if(I==="PasskeyRegistrationCanceled"||I==="NotAllowedError"||T.includes("canceled")||T.includes("cancelled")||T.includes("ceremony has been canceled")||T.includes("not allowed")){v();return}s(mge())}finally{u(!1)}},[v]);if(n)return $.createElement(fr,{className:e,variation:t},$.createElement(Pe,{direction:"column",padding:"large","data-amplify-authenticator-passkeyprompt":""},$.createElement(Pe,{direction:"column",gap:"xs"},$.createElement(age,{className:"amplify-authenticator__passkey-success-icon"}),$.createElement(Yn,{level:4},pge()),$.createElement(Yr,null,gge())),c.length>0&&$.createElement(ke,{marginTop:"large"},$.createElement(Yn,{level:5},yge()),$.createElement(Pe,{direction:"column",gap:"xs",marginTop:"xs"},c.map((E,A)=>$.createElement(ke,{key:E.credentialId,className:"amplify-authenticator__passkey-credential-item"},$.createElement(Yr,{fontSize:"small"},E.friendlyCredentialName??`${vge()} ${A+1}`))))),$.createElement(Pe,{direction:"column",gap:"medium",marginTop:"large"},$.createElement(zt,{onClick:()=>{r(!1),S()},variation:"link"},bge()),$.createElement(zt,{onClick:()=>w(),variation:"primary",isFullWidth:!0},Sge()))));const C=g||a;return $.createElement(fr,{className:e,variation:t},$.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-passkeyprompt":""},$.createElement(Pe,{direction:"column",gap:"medium"},$.createElement(Yn,{level:4},uge()),$.createElement(Yr,null,cge()),$.createElement(Pe,{justifyContent:"center"},$.createElement(lge,{className:"amplify-authenticator__passkey-icon"})),$.createElement(Pe,{direction:"column",gap:"medium"},$.createElement(zt,{onClick:()=>{S()},variation:"primary",isDisabled:C,isLoading:a,loadingText:fge()},dge()),$.createElement(zt,{onClick:v,variation:"link",isDisabled:C},hge()),o&&$.createElement(Yr,{className:"amplify-authenticator__passkey-error"},o),$.createElement(pr,null)))))}function h4(){return null}const Cge=e=>{switch(e){case"authenticated":case"idle":case"setup":case"transition":return h4;case"confirmSignUp":return Wa;case"confirmSignIn":return Za;case"selectMfaType":return Vi;case"setupEmail":return Wi;case"setupTotp":return Hi;case"signIn":case"signUp":return Ope;case"signInSelectAuthFactor":return ige;case"passkeyPrompt":return wge;case"forceNewPassword":return vo;case"forgotPassword":return qi;case"confirmResetPassword":return Ya;case"verifyUser":return Ka;case"confirmVerifyUser":return Ga;default:return console.warn(`Unhandled Authenticator route - please open an issue: ${e}`),h4}};function Ege({className:e,hideSignUp:t,variation:n}){const{route:r}=ot(({route:s})=>[s]),o=_.useMemo(()=>Cge(r),[r]);return $.createElement(o,{className:e,hideSignUp:Jhe(r)?t:void 0,variation:n})}const _ge={Header:()=>null,SignIn:{Header:Ls.Header,Footer:Ls.Footer},SignUp:{Header:yo.Header,FormFields:yo.FormFields,Footer:yo.Footer},ConfirmSignUp:{Header:Wa.Header,Footer:Wa.Footer},SelectMfaType:{Header:Vi.Header,Footer:Vi.Footer},SetupEmail:{Header:Wi.Header,Footer:Wi.Footer},SetupTotp:{Header:Hi.Header,Footer:Hi.Footer},ConfirmResetPassword:{Header:Ya.Header,Footer:Ya.Footer},ConfirmSignIn:{Header:Za.Header,Footer:Za.Footer},VerifyUser:{Header:Ka.Header,Footer:Ka.Footer},ConfirmVerifyUser:{Header:Ga.Header,Footer:Ga.Footer},ForceNewPassword:{Header:vo.Header,Footer:vo.Footer,FormFields:vo.FormFields},ForgotPassword:{Header:qi.Header,Footer:qi.Footer},Footer:()=>null};function xge({children:e,className:t,components:n,formFields:r,hideSignUp:o,initialState:s,loginMechanisms:a,passwordSettings:u,passwordless:c,signUpAttributes:f,services:h,socialProviders:g,variation:m}){bhe({message:"The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.",shouldWarn:!1});const{route:v,signOut:w,user:S}=ot(({route:A,signOut:I,user:T})=>[A,I,T]);Yde({initialState:s,loginMechanisms:a,passwordSettings:u,passwordless:c,services:h,signUpAttributes:f,socialProviders:g,formFields:r});const C=_.useMemo(()=>({components:{..._ge,...n}}),[n]);return v==="authenticated"||v==="signOut"?e?_.createElement(_.Fragment,null,ks(e)?e({signOut:w,user:S}):e):null:_.createElement(T9.Provider,{value:C},_.createElement(Ege,{className:t,hideSignUp:o,variation:m}))}function Zo(e){return Xde({componentName:"Authenticator",packageName:"react",version:yhe}),_.createElement(d9,null,_.createElement(xge,{...e}))}Zo.Provider=d9;Zo.ForgotPassword=qi;Zo.SetupTotp=Hi;Zo.SignIn=Ls;Zo.SignUp=yo;Zo.ForceNewPassword=vo;Zo.SelectMfaType=Vi;Zo.SetupEmail=Wi;const L9=({cssText:e,...t})=>e===void 0||/<\/style/i.test(e)?null:_.createElement("style",{...t,dangerouslySetInnerHTML:{__html:e}});L9.displayName="Style";const U9=({theme:e,...t})=>{if(!e)return null;const{name:n,cssText:r}=e;return _.createElement(L9,{...t,cssText:r,id:`amplify-theme-${n}`})};U9.displayName="ThemeStyle";function Age({children:e,colorMode:t,direction:n="ltr",nonce:r,theme:o}){const s=_.useMemo(()=>({theme:Sy(o),colorMode:t}),[o,t]);return _.createElement(f9.Provider,{value:s},_.createElement(Zfe,{dir:n},_.createElement("div",{"data-amplify-theme":s.theme.name,"data-amplify-color-mode":t,dir:n},e),o?_.createElement(U9,{theme:s.theme,nonce:r}):null))}const Ige=({configured:e,authStatus:t})=>t==="authenticated",Rge=e=>e?e.signInDetails?.loginId??e.username??null:null,Tge=({children:e,fallback:t=null})=>{const{authStatus:n,signOut:r,user:o}=ot(s=>[s.authStatus,s.signOut,s.user]);return Ige({configured:!0,authStatus:n})?O.jsx(O.Fragment,{children:e({email:Rge(o),signOut:()=>r()})}):O.jsx(O.Fragment,{children:t})},Oge=({children:e,fallback:t=null})=>Bv()?O.jsx(Tge,{fallback:t,children:e}):O.jsx(O.Fragment,{children:t}),p4='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',qs=e=>`var(${e})`,Wt=qs("--accent"),Mge=qs("--accent-hover"),g4=qs("--accent-soft"),Od=qs("--accent-fg"),m4=qs("--surface"),au=qs("--fg"),Pge=qs("--surface-sunken"),sg=qs("--fg-muted"),Md=qs("--line"),Nge=Sy({name:"remit",tokens:{colors:{brand:{primary:{10:{value:g4},20:{value:g4},40:{value:Wt},60:{value:Wt},80:{value:Wt},90:{value:Wt},100:{value:Wt}}},background:{primary:{value:m4},secondary:{value:Pge}},font:{primary:{value:au},secondary:{value:sg},tertiary:{value:sg},interactive:{value:Wt},inverse:{value:Od},hover:{value:Wt},focus:{value:Wt},active:{value:Wt}},border:{primary:{value:Md},secondary:{value:Md},focus:{value:Wt}}},fonts:{default:{variable:{value:p4},static:{value:p4}}},radii:{small:{value:"3px"},medium:{value:"5px"},large:{value:"7px"}},components:{authenticator:{router:{borderColor:{value:Md},borderWidth:{value:"1px"},boxShadow:{value:"0 10px 30px -10px rgb(15 23 42 / 0.18), 0 4px 12px -6px rgb(15 23 42 / 0.1)"},backgroundColor:{value:m4}},form:{padding:{value:"1.75rem"}},orContainer:{color:{value:sg}}},button:{color:{value:au},primary:{backgroundColor:{value:Wt},color:{value:Od},_hover:{backgroundColor:{value:Mge},color:{value:Od}},_focus:{backgroundColor:{value:Wt},color:{value:Od}},_active:{backgroundColor:{value:Wt},color:{value:Od}}},link:{color:{value:Wt},_hover:{color:{value:Wt},backgroundColor:{value:"transparent"}},_focus:{color:{value:Wt},backgroundColor:{value:"transparent"}},_active:{color:{value:Wt},backgroundColor:{value:"transparent"}}}},fieldcontrol:{color:{value:au},borderColor:{value:Md},_focus:{borderColor:{value:Wt},boxShadow:{value:`0 0 0 2px ${Wt}`}}},field:{label:{color:{value:au}}},tabs:{borderColor:{value:Md},item:{color:{value:sg},backgroundColor:{value:"transparent"},_active:{color:{value:Wt},borderColor:{value:Wt},backgroundColor:{value:"transparent"}},_hover:{color:{value:Wt}},_focus:{color:{value:Wt}}}},heading:{color:{value:au}},text:{color:{value:au}}}}}),kge={signIn:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"}},signUp:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"},confirm_password:{placeholder:"Confirm your password"}}},Dge=()=>O.jsx(Zr,{tone:"warning",className:"fixed top-0 left-0 right-0 z-50 h-7 sm:h-10 overflow-hidden border-x-0 border-t-0",children:O.jsxs("span",{className:"flex items-center gap-2",children:[O.jsx("strong",{className:"font-semibold shrink-0",children:"Local dev"}),O.jsx("span",{className:"truncate hidden sm:inline",children:"— Cognito not configured. Set VITE_COGNITO_USER_POOL_ID and VITE_COGNITO_CLIENT_ID in .env.local to enable sign-in."}),O.jsx("span",{className:"truncate sm:hidden",children:"— no Cognito; signed out"})]})}),Lge=()=>O.jsx(tI,{note:oI({betterAuthEnabled:!1,cognitoConfigured:Bv()})}),Uge=({children:e})=>{const{authStatus:t}=ot(n=>[n.authStatus]);return t==="authenticated"?O.jsx(O.Fragment,{children:e}):t==="configuring"?O.jsx(Kv,{}):O.jsx(Age,{theme:Nge,children:O.jsxs(Wv,{children:[O.jsx(Gv,{}),O.jsx(Zo,{hideSignUp:!1,formFields:kge,components:{Footer:Lge}})]})})},Fge=({children:e})=>Bv()?O.jsx(Zo.Provider,{children:O.jsx(Uge,{children:e})}):O.jsxs("div",{className:"pt-7 sm:pt-10 [&_#main-content]:h-[calc(100dvh-1.75rem)] sm:[&_#main-content]:h-[calc(100dvh-2.5rem)]",children:[O.jsx(Dge,{}),e]}),F9=60;let Nu=null;const $9=()=>Math.floor(Date.now()/1e3),$ge=e=>e!==null&&e.expiresAt-F9>$9(),zge=async()=>{const t=(await Uv()).tokens?.idToken;return t?(Nu={value:t.toString(),expiresAt:t.payload.exp??$9()+F9},Nu.value):(Nu=null,null)},jge=async()=>Bv()?$ge(Nu)?Nu.value:zge():null,Bge=()=>{Nu=null},Um={configure:aF,getToken:jge,resetToken:Bge,Shell:Fge,Account:Oge},Hge=({children:e})=>Hv()?O.jsx(Om.Shell,{children:e}):O.jsx(Um.Shell,{children:e}),qge=e=>Hv()?O.jsx(Om.Account,{...e}):O.jsx(Um.Account,{...e}),Vge={configure:aF,getToken:()=>Hv()?Om.getToken():Um.getToken(),resetToken:()=>{Om.resetToken(),Um.resetToken()},Shell:Hge,Account:qge};var bc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Wge=class extends bc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},eR=new Wge,Gge={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Kge=class{#e=Gge;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Aa=new Kge;function Zge(e){setTimeout(e,0)}var Yge=typeof window>"u"||"Deno"in globalThis;function Vn(){}function Qge(e,t){return typeof e=="function"?e(t):e}function nx(e){return typeof e=="number"&&e>=0&&e!==1/0}function z9(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ui(e,t){return typeof e=="function"?e(t):e}function Ir(e,t){return typeof e=="function"?e(t):e}function v4(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:a,stale:u}=e;if(a){if(r){if(t.queryHash!==tR(a,t.options))return!1}else if(!If(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||o&&o!==t.state.fetchStatus||s&&!s(t))}function y4(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Qa(t.options.mutationKey)!==Qa(s))return!1}else if(!If(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function tR(e,t){return(t?.queryKeyHashFn||Qa)(e)}function Qa(e){return JSON.stringify(e,(t,n)=>rx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function If(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>If(e[n],t[n])):!1}var Xge=Object.prototype.hasOwnProperty;function j9(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=b4(e)&&b4(t);if(!r&&!(rx(e)&&rx(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),u=a.length,c=r?new Array(u):{};let f=0;for(let h=0;h<u;h++){const g=r?h:a[h],m=e[g],v=t[g];if(m===v){c[g]=m,(r?h<s:Xge.call(e,g))&&f++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){c[g]=v;continue}const w=j9(m,v,n+1);c[g]=w,w===m&&f++}return s===u&&f===s?e:c}function Fm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function b4(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rx(e){if(!S4(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!S4(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function S4(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jge(e){return new Promise(t=>{Aa.setTimeout(t,e)})}function ox(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?j9(e,t):t}function eme(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function tme(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var nR=Symbol();function B9(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===nR?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rR(e,t){return typeof e=="function"?e(...t):!!e}function nme(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Rf=(()=>{let e=()=>Yge;return{isServer(){return e()},setIsServer(t){e=t}}})();function sx(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var rme=Zge;function ome(){let e=[],t=0,n=u=>{u()},r=u=>{u()},o=rme;const s=u=>{t?e.push(u):o(()=>{n(u)})},a=()=>{const u=e;e=[],u.length&&o(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;t++;try{c=u()}finally{t--,t||a()}return c},batchCalls:u=>(...c)=>{s(()=>{u(...c)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{o=u}}}var yn=ome(),sme=class extends bc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},$m=new sme;function ime(e){return Math.min(1e3*2**e,3e4)}function H9(e){return(e??"online")==="online"?$m.isOnline():!0}var ix=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function q9(e){let t=!1,n=0,r;const o=sx(),s=()=>o.status!=="pending",a=S=>{if(!s()){const C=new ix(S);m(C),e.onCancel?.(C)}},u=()=>{t=!0},c=()=>{t=!1},f=()=>eR.isFocused()&&(e.networkMode==="always"||$m.isOnline())&&e.canRun(),h=()=>H9(e.networkMode)&&e.canRun(),g=S=>{s()||(r?.(),o.resolve(S))},m=S=>{s()||(r?.(),o.reject(S))},v=()=>new Promise(S=>{r=C=>{(s()||f())&&S(C)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),w=()=>{if(s())return;let S;const C=n===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(E){S=Promise.reject(E)}Promise.resolve(S).then(g).catch(E=>{if(s())return;const A=e.retry??(Rf.isServer()?0:3),I=e.retryDelay??ime,T=typeof I=="function"?I(n,E):I,N=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,E);if(t||!N){m(E);return}n++,e.onFail?.(n,E),Jge(T).then(()=>f()?void 0:v()).then(()=>{t?m(E):w()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(r?.(),o),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?w():v().then(w),o)}}var V9=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nx(this.gcTime)&&(this.#e=Aa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rf.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Aa.clearTimeout(this.#e),this.#e=void 0)}};function ame(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},c=0;const f=async()=>{let h=!1;const g=w=>{nme(w,()=>t.signal,()=>h=!0)},m=B9(t.options,t.fetchOptions),v=async(w,S,C)=>{if(h)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return g(M),M})(),I=await m(A),{maxPages:T}=t.options,N=C?tme:eme;return{pages:N(w.pages,I,T),pageParams:N(w.pageParams,S,T)}};if(o&&s.length){const w=o==="backward",S=w?W9:ax,C={pages:s,pageParams:a},E=S(r,C);u=await v(C,E,w)}else{const w=e??s.length;do{const S=c===0?a[0]??r.initialPageParam:ax(r,u);if(c>0&&S==null)break;u=await v(u,S),c++}while(c<w)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function ax(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function r6e(e,t){return t?ax(e,t)!=null:!1}function o6e(e,t){return!t||!e.getPreviousPageParam?!1:W9(e,t)!=null}var lme=class extends V9{#e;#t;#n;#r;#s;#o;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=C4(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=C4(this.options);t.data!==void 0&&(this.setState(w4(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=ox(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(Vn).catch(Vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ir(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nR||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ui(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!z9(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#i||this.#c()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const c=B9(this.options,t),h=(()=>{const g={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(g),g})();return this.#i=!1,this.options.persister?this.options.persister(c,h,this):c(h)},a=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return r(c),c})();(this.#e==="infinite"?ame(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#o=q9({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof ix&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#l({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const c=await this.#o.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof ix){if(c.silent)return this.#o.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#l({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...G9(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...w4(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),yn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function G9(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H9(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function w4(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function C4(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ume=class extends bc{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=sx(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#s;#o;#a;#i;#c;#l;#p;#d;#f;#u;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),E4(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ir(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),t._defaulted&&!Fm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&_4(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Ir(this.options.enabled,this.#t)!==Ir(t.enabled,this.#t)||Ui(this.options.staleTime,this.#t)!==Ui(t.staleTime,this.#t))&&this.#m();const o=this.#v();r&&(this.#t!==n||Ir(this.options.enabled,this.#t)!==Ir(t.enabled,this.#t)||o!==this.#u)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return dme(this,n)&&(this.#r=n,this.#o=this.options,this.#s=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#g.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#C();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Vn)),t}#m(){this.#S();const e=Ui(this.options.staleTime,this.#t);if(Rf.isServer()||this.#r.isStale||!nx(e))return;const n=z9(this.#r.dataUpdatedAt,e)+1;this.#d=Aa.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#u=e,!(Rf.isServer()||Ir(this.options.enabled,this.#t)===!1||!nx(this.#u)||this.#u===0)&&(this.#f=Aa.setInterval(()=>{(this.options.refetchIntervalInBackground||eR.isFocused())&&this.#h()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#S(){this.#d!==void 0&&(Aa.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Aa.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#t,r=this.options,o=this.#r,s=this.#s,a=this.#o,c=e!==n?e.state:this.#n,{state:f}=e;let h={...f},g=!1,m;if(t._optimisticResults){const k=this.hasListeners(),L=!k&&E4(e,t),q=k&&_4(e,n,t,r);(L||q)&&(h={...h,...G9(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:S}=h;m=h.data;let C=!1;if(t.placeholderData!==void 0&&m===void 0&&S==="pending"){let k;o?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(k=o.data,C=!0):k=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,k!==void 0&&(S="success",m=ox(o?.data,k,t),g=!0)}if(t.select&&m!==void 0&&!C)if(o&&m===s?.data&&t.select===this.#c)m=this.#l;else try{this.#c=t.select,m=t.select(m),m=ox(o?.data,m,t),this.#l=m,this.#i=null}catch(k){this.#i=k}this.#i&&(v=this.#i,m=this.#l,w=Date.now(),S="error");const E=h.fetchStatus==="fetching",A=S==="pending",I=S==="error",T=A&&E,N=m!==void 0,R={status:S,fetchStatus:h.fetchStatus,isPending:A,isSuccess:S==="success",isError:I,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:h.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:E,isRefetching:E&&!A,isLoadingError:I&&!N,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:I&&N,isStale:oR(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Ir(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const k=R.data!==void 0,L=R.status==="error"&&!k,q=j=>{L?j.reject(R.error):k&&j.resolve(R.data)},F=()=>{const j=this.#a=R.promise=sx();q(j)},D=this.#a;switch(D.status){case"pending":e.queryHash===n.queryHash&&q(D);break;case"fulfilled":(L||R.data!==D.value)&&F();break;case"rejected":(!L||R.error!==D.reason)&&F();break}}return R}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#o=this.options,this.#s.data!==void 0&&(this.#p=this.#t),Fm(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#g.size)return!0;const s=new Set(o??this.#g);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(a=>{const u=a;return this.#r[u]!==e[u]&&s.has(u)})};this.#E({listeners:n()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){yn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function cme(e,t){return Ir(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ir(t.retryOnMount,e)===!1)}function E4(e,t){return cme(e,t)||e.state.data!==void 0&&lx(e,t,t.refetchOnMount)}function lx(e,t,n){if(Ir(t.enabled,e)!==!1&&Ui(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&oR(e,t)}return!1}function _4(e,t,n,r){return(e!==t||Ir(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&oR(e,n)}function oR(e,t){return Ir(t.enabled,e)!==!1&&e.isStaleByTime(Ui(t.staleTime,e))}function dme(e,t){return!Fm(e.getCurrentResult(),t)}var fme=class extends V9{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||K9(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=q9({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,a)=>{this.#s({type:"failed",failureCount:s,error:a})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#r.canStart();try{if(r)t();else{this.#s({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#s({type:"pending",context:a,variables:e,isPaused:o})}const s=await this.#r.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#s({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#s({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),yn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function K9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Z9=class extends bc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new fme({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=ig(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ig(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ig(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ig(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>y4(t,n))}findAll(e={}){return this.getAll().filter(t=>y4(e,t))}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return yn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Vn))))}};function ig(e){return e.options.scope?.id}var hme=class extends bc{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Fm(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Qa(n.mutationKey)!==Qa(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??K9();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){yn.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,o)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(t.data,null,n,r,o)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,o)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(void 0,t.error,n,r,o)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Y9=class extends bc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??tR(r,t);let s=this.get(o);return s||(s=new lme({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>v4(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>v4(e,n)):t}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pme=class{#e;#t;#n;#r;#s;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new Y9,this.#t=e.mutationCache||new Z9,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=eR.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=$m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ui(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,a=Qge(t,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return yn.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;yn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return yn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Vn).catch(Vn)}invalidateQueries(e,t={}){return yn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=yn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Vn)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ui(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Vn).catch(Vn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Vn).catch(Vn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return $m.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Qa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{If(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(Qa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{If(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=tR(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===nR&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Q9=_.createContext(void 0),cl=e=>{const t=_.useContext(Q9);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gme=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),O.jsx(Q9.Provider,{value:e,children:t})),X9=_.createContext(!1),mme=()=>_.useContext(X9);X9.Provider;function vme(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var yme=_.createContext(vme()),bme=()=>_.useContext(yme),Sme=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?rR(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},wme=e=>{_.useEffect(()=>{e.clearReset()},[e])},Cme=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||rR(n,[e.error,r])),Eme=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_me=(e,t)=>e.isLoading&&e.isFetching&&!t,xme=(e,t)=>e?.suspense&&t.isPending,x4=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ame(e,t,n){const r=mme(),o=bme(),s=cl(),a=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const u=s.getQueryCache().get(a.queryHash),c=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Eme(a),Sme(a,o,u),wme(o);const f=!s.getQueryCache().get(a.queryHash),[h]=_.useState(()=>new t(s,a)),g=h.getOptimisticResult(a),m=!r&&c;if(_.useSyncExternalStore(_.useCallback(v=>{const w=m?h.subscribe(yn.batchCalls(v)):Vn;return h.updateResult(),w},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),_.useEffect(()=>{h.setOptions(a)},[a,h]),xme(a,g))throw x4(a,h,o);if(Cme({result:g,errorResetBoundary:o,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw g.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,g),a.experimental_prefetchInRender&&!Rf.isServer()&&_me(g,r)&&(f?x4(a,h,o):u?.promise)?.catch(Vn).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?g:h.trackResult(g)}function Xa(e,t){return Ame(e,ume)}function sR(e,t){const n=cl(),[r]=_.useState(()=>new hme(n,e));_.useEffect(()=>{r.setOptions(e)},[r,e]);const o=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(yn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=_.useCallback((a,u)=>{r.mutate(a,u).catch(Vn)},[r]);if(o.error&&rR(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const Ime="modulepreload",Rme=function(e){return"/"+e},A4={},Re=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");o=c(n.map(f=>{if(f=Rme(f),f in A4)return;A4[f]=!0;const h=f.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Ime,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((v,w)=>{m.addEventListener("load",v),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return o.then(a=>{for(const u of a||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})};var I4=_.use,Eu=typeof window<"u"?_.useLayoutEffect:_.useEffect;function bE(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Tme(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{t(s)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function Ome(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}const J9=!1;function Tf(e){return e[e.length-1]}function Mme(e){return typeof e=="function"}function Ia(e,t){return Mme(e)?e(t):e}const ez=Object.prototype.hasOwnProperty,R4=Object.prototype.propertyIsEnumerable;function tz(e){for(const t in e)if(ez.call(e,t))return!0;return!1}const Pme=()=>Object.create(null),wa=(e,t)=>Ra(e,t,Pme);function Ra(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const o=t,s=M4(e)&&M4(o);if(!s&&!(zm(e)&&zm(o)))return o;const a=s?e:T4(e);if(!a)return o;const u=s?o:T4(o);if(!u)return o;const c=a.length,f=u.length,h=s?new Array(f):n();let g=0;for(let m=0;m<f;m++){const v=s?m:u[m],w=e[v],S=o[v];if(w===S){h[v]=w,(s?m<c:ez.call(e,v))&&g++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){h[v]=S;continue}const C=Ra(w,S,n,r+1);h[v]=C,C===w&&g++}return c===f&&g===c?e:h}function T4(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!R4.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!R4.call(e,o))return!1;r.push(o)}return r}function zm(e){if(!O4(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!O4(n)||!n.hasOwnProperty("isPrototypeOf"))}function O4(e){return Object.prototype.toString.call(e)==="[object Object]"}function M4(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Da(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Da(e[r],t[r],n))return!1;return!0}if(zm(e)&&zm(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!Da(e[a],t[a],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&o++;let s=0;for(const a in t)if((!r||t[a]!==void 0)&&(s++,s>o||!Da(e[a],t[a],n)))return!1;return o===s}return!1}function Vu(e){let t,n;const r=new Promise((o,s)=>{t=o,n=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function Nme(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Of(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const kme=/[\x00-\x1f\x7f"<>`{}]/g;function Dme(e){return e.replace(kme,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function P4(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Dme(t)}const Lme=["http:","https:","mailto:","tel:"];function jm(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Pd(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",o;for(;(o=t.exec(e))!==null;)r+=P4(e.slice(n,o.index))+o[0],n=t.lastIndex;r=r+P4(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function Ume(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Fme(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ts(){throw new Error("Invariant failed")}function Mf(e){const t=new Map;let n,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const a=t.get(s);if(a)return o(a),a.value},set(s,a){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const u=t.get(s);if(u)u.value=a,o(u);else{const c={key:s,value:a,prev:r};r&&(r.next=c),r=c,n||(n=c),t.set(s,c)}},clear(){t.clear(),n=void 0,r=void 0}}}const Ni=4,nz=5;function $me(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function rz(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,s=e.substring(t,o);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const a=$me(s);if(a){const[u,c]=a,f=s.charCodeAt(u+1);if(f===45){if(u+2<s.length&&s.charCodeAt(u+2)===36){const h=u+3,g=c;if(h<g)return n[0]=3,n[1]=t+u,n[2]=t+h,n[3]=t+g,n[4]=t+c+1,n[5]=o,n}}else if(f===36){const h=u+1,g=u+2;return g===c?(n[0]=2,n[1]=t+u,n[2]=t+h,n[3]=t+g,n[4]=t+c+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+g,n[3]=t+c,n[4]=t+c+1,n[5]=o,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Ty(e,t,n,r,o,s,a){a?.(n);let u=r;{const c=n.fullPath??n.from,f=c.length,h=n.options?.caseSensitive??e,g=n.options?.params?.parse??n.options?.parseParams;for(;u<f;){const v=rz(c,u,t);let w;const S=u,C=v[5];switch(u=C+1,s++,v[0]){case 0:{const E=c.substring(v[2],v[3]);if(h){const A=o.static?.get(E);if(A)w=A;else{o.static??=new Map;const I=Ta(n.fullPath??n.from);I.parent=o,I.depth=s,w=I,o.static.set(E,I)}}else{const A=E.toLowerCase(),I=o.staticInsensitive?.get(A);if(I)w=I;else{o.staticInsensitive??=new Map;const T=Ta(n.fullPath??n.from);T.parent=o,T.depth=s,w=T,o.staticInsensitive.set(A,T)}}break}case 1:{const E=c.substring(S,v[1]),A=c.substring(v[4],C),I=h&&!!(E||A),T=E?I?E:E.toLowerCase():void 0,N=A?I?A:A.toLowerCase():void 0,M=!g&&o.dynamic?.find(R=>!R.parse&&R.caseSensitive===I&&R.prefix===T&&R.suffix===N);if(M)w=M;else{const R=wE(1,n.fullPath??n.from,I,T,N);w=R,R.depth=s,R.parent=o,o.dynamic??=[],o.dynamic.push(R)}break}case 3:{const E=c.substring(S,v[1]),A=c.substring(v[4],C),I=h&&!!(E||A),T=E?I?E:E.toLowerCase():void 0,N=A?I?A:A.toLowerCase():void 0,M=!g&&o.optional?.find(R=>!R.parse&&R.caseSensitive===I&&R.prefix===T&&R.suffix===N);if(M)w=M;else{const R=wE(3,n.fullPath??n.from,I,T,N);w=R,R.parent=o,R.depth=s,o.optional??=[],o.optional.push(R)}break}case 2:{const E=c.substring(S,v[1]),A=c.substring(v[4],C),I=h&&!!(E||A),T=E?I?E:E.toLowerCase():void 0,N=A?I?A:A.toLowerCase():void 0,M=wE(2,n.fullPath??n.from,I,T,N);w=M,M.parent=o,M.depth=s,o.wildcard??=[],o.wildcard.push(M)}}o=w}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=Ta(n.fullPath??n.from);v.kind=nz,v.parent=o,s++,v.depth=s,o.pathless??=[],o.pathless.push(v),o=v}const m=(n.path||!n.children)&&!n.isRoot;if(m&&c.endsWith("/")){const v=Ta(n.fullPath??n.from);v.kind=Ni,v.parent=o,s++,v.depth=s,o.index=v,o=v}o.parse=g??null,o.priority=n.options?.params?.priority??0,m&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)Ty(e,t,c,u,o,s,a)}function SE(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ii(e){if(e.pathless)for(const t of e.pathless)Ii(t);if(e.static)for(const t of e.static.values())Ii(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ii(t);if(e.dynamic?.length){e.dynamic.sort(SE);for(const t of e.dynamic)Ii(t)}if(e.optional?.length){e.optional.sort(SE);for(const t of e.optional)Ii(t)}if(e.wildcard?.length){e.wildcard.sort(SE);for(const t of e.wildcard)Ii(t)}}function Ta(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function wE(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:o}}function zme(e,t){const n=Ta("/"),r=new Uint16Array(6);for(const o of e)Ty(!1,r,o,1,n,0);Ii(n),t.masksTree=n,t.flatCache=Mf(1e3)}function jme(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=iR(e,t.masksTree);return t.flatCache.set(e,r),r}function Bme(e,t,n,r,o){e||="/",r||="/";const s=t?`case\0${e}`:e;let a=o.singleCache.get(s);return a||(a=Ta("/"),Ty(t,new Uint16Array(6),{from:e},1,a,0),o.singleCache.set(s,a)),iR(r,a,n)}function Hme(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let s;try{s=iR(e,t.segmentTree,n)}catch(a){if(a instanceof URIError)s=null;else throw a}return s&&(s.branch=sz(s.route)),t.matchCache.set(r,s),s}function qme(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Vme(e,t=!1,n){const r=Ta(e.fullPath),o=new Uint16Array(6),s={},a={};let u=0;return Ty(t,o,e,1,r,0,c=>{if(n?.(c,u),c.id in s&&Ts(),s[c.id]=c,u!==0&&c.path){const f=qme(c.fullPath);(!a[f]||c.fullPath.endsWith("/"))&&(a[f]=c)}u++}),Ii(r),{processedTree:{segmentTree:r,singleCache:Mf(1e3),matchCache:Mf(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:a}}function iR(e,t,n=!1){const r=e.split("/"),o=Gme(e,r,t,n);if(!o)return null;const[s]=oz(e,r,o);return{route:o.node.route,rawParams:s}}function oz(e,t,n){const r=Wme(n.node);let o=null;const s=Object.create(null);let a=n.extract?.part??0,u=n.extract?.node??0,c=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;a++,u++,c++,f++){const h=r[u];if(h.kind===Ni)break;if(h.kind===nz){f--,a--,c--;continue}const g=t[a],m=c;if(g&&(c+=g.length),h.kind===1){o??=n.node.fullPath.split("/");const v=o[f],w=h.prefix?.length??0;if(v.charCodeAt(w)===123){const S=h.suffix?.length??0,C=v.substring(w+2,v.length-S-1),E=g.substring(w,g.length-S);s[C]=decodeURIComponent(E)}else{const S=v.substring(1);s[S]=decodeURIComponent(g)}}else if(h.kind===3){if(n.skipped&1<<u){a--,c=m-1;continue}o??=n.node.fullPath.split("/");const v=o[f],w=h.prefix?.length??0,S=h.suffix?.length??0,C=v.substring(w+3,v.length-S-1),E=h.suffix||h.prefix?g.substring(w,g.length-S):g;E&&(s[C]=decodeURIComponent(E))}else if(h.kind===2){const v=h,w=e.substring(m+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),S=decodeURIComponent(w);s["*"]=S,s._splat=S;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:a,node:u,path:c,segment:f}]}function sz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Wme(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Gme(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!Tf(t),s=o&&e!=="/",a=t.length-(o?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let c=null,f=null;for(;u.length;){const h=u.pop(),{node:g,index:m,skipped:v,depth:w,statics:S,dynamics:C,optionals:E}=h;let{extract:A,rawParams:I}=h;if(g.kind===2&&g.route&&!lg(f,h))continue;if(g.parse){if(!N4(e,t,h))continue;I=h.rawParams,A=h.extract}r&&g.route&&g.kind!==Ni&&lg(c,h)&&(c=h);const T=m===a;if(T&&(g.route&&(!s||g.kind===Ni||g.kind===2)&&lg(f,h)&&(f=h),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const N=T?void 0:t[m];let M;if(T&&g.index){const R={node:g.index,index:m,skipped:v,depth:w+1,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I};let k=!0;if(g.index.parse&&(N4(e,t,R)||(k=!1)),k){if(!C&&!E&&!v&&Kme(S,a))return R;lg(f,R)&&(f=R)}}if(g.wildcard)for(let R=g.wildcard.length-1;R>=0;R--){const k=g.wildcard[R],{prefix:L,suffix:q}=k;if(!(L&&(T||!(k.caseSensitive?N:M??=N.toLowerCase()).startsWith(L)))){if(q){if(T)continue;const F=t.slice(m).join("/").slice(-q.length);if((k.caseSensitive?F:F.toLowerCase())!==q)continue}u.push({node:k,index:a,skipped:v,depth:w+1,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I})}}if(g.optional){const R=v|1<<w,k=w+1;for(let L=g.optional.length-1;L>=0;L--){const q=g.optional[L];u.push({node:q,index:m,skipped:R,depth:k,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I})}if(!T)for(let L=g.optional.length-1;L>=0;L--){const q=g.optional[L],{prefix:F,suffix:D}=q;if(F||D){const j=q.caseSensitive?N:M??=N.toLowerCase();if(F&&!j.startsWith(F)||D&&!j.endsWith(D))continue}u.push({node:q,index:m+1,skipped:v,depth:k,statics:S,dynamics:C,optionals:E+ag(a,m),extract:A,rawParams:I})}}if(!T&&g.dynamic&&N)for(let R=g.dynamic.length-1;R>=0;R--){const k=g.dynamic[R],{prefix:L,suffix:q}=k;if(L||q){const F=k.caseSensitive?N:M??=N.toLowerCase();if(L&&!F.startsWith(L)||q&&!F.endsWith(q))continue}u.push({node:k,index:m+1,skipped:v,depth:w+1,statics:S,dynamics:C+ag(a,m),optionals:E,extract:A,rawParams:I})}if(!T&&g.staticInsensitive){const R=g.staticInsensitive.get(M??=N.toLowerCase());R&&u.push({node:R,index:m+1,skipped:v,depth:w+1,statics:S+ag(a,m),dynamics:C,optionals:E,extract:A,rawParams:I})}if(!T&&g.static){const R=g.static.get(N);R&&u.push({node:R,index:m+1,skipped:v,depth:w+1,statics:S+ag(a,m),dynamics:C,optionals:E,extract:A,rawParams:I})}if(g.pathless){const R=w+1;for(let k=g.pathless.length-1;k>=0;k--){const L=g.pathless[k];u.push({node:L,index:m,skipped:v,depth:R,statics:S,dynamics:C,optionals:E,extract:A,rawParams:I})}}}if(f)return f;if(r&&c){let h=c.index;for(let m=0;m<c.index;m++)h+=t[m].length;const g=h===e.length?"/":e.slice(h);return c.rawParams??=Object.create(null),c.rawParams["**"]=decodeURIComponent(g),c}return null}function ag(e,t){return 2**(e-t-1)}function Kme(e,t){return e===2**(t-1)-1}function N4(e,t,n){let r,o;try{[r,o]=oz(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=o,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function lg(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ni)>(e.node.kind===Ni)||t.node.kind===Ni==(e.node.kind===Ni)&&t.depth>e.depth))):!0}function um(e){return aR(e.filter(t=>t!==void 0).join("/"))}function aR(e){return e.replace(/\/{2,}/g,"/")}function iz(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Is(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function az(e){return Is(iz(e))}function Bm(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Zme(e,t,n){return Bm(e,n)===Bm(t,n)}function Yme({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),s=!o&&t===".";let a;if(r){a=o?t:s?e:e+"\0"+t;const f=r.get(a);if(f)return f}let u;if(s)u=e.split("/");else if(o)u=t.split("/");else{for(u=e.split("/");u.length>1&&Tf(u)==="";)u.pop();const f=t.split("/");for(let h=0,g=f.length;h<g;h++){const m=f[h];m===""?h?h===g-1&&u.push(m):u=[m]:m===".."?u.pop():m==="."||u.push(m)}}u.length>1&&(Tf(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));const c=aR(u.join("/"))||"/";return a&&r&&r.set(a,c),c}function Qme(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>t.get(s)??s)}function CE(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>D4(o,n)).join("/"):D4(r,n)}function k4({path:e,params:t,decoder:n,...r}){let o=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:o};const a=e.length;let u=0,c,f="";for(;u<a;){const h=u;c=rz(e,h,c);const g=c[5];if(u=g+1,h===g)continue;const m=c[0];if(m===0){f+="/"+e.substring(h,g);continue}if(m===2){const v=t._splat;s._splat=v,s["*"]=v;const w=e.substring(h,c[1]),S=e.substring(c[4],g);if(!v){o=!0,(w||S)&&(f+="/"+w+S);continue}const C=CE("_splat",t,n);f+="/"+w+C+S;continue}if(m===1){const v=e.substring(c[2],c[3]);!o&&!(v in t)&&(o=!0),s[v]=t[v];const w=e.substring(h,c[1]),S=e.substring(c[4],g),C=CE(v,t,n)??"undefined";f+="/"+w+C+S;continue}if(m===3){const v=e.substring(c[2],c[3]),w=t[v];if(w==null)continue;s[v]=w;const S=e.substring(h,c[1]),C=e.substring(c[4],g),E=CE(v,t,n)??"";f+="/"+S+E+C;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:s,interpolatedPath:f||"/",isMissingParams:o}}function D4(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function jn(e){return e?.isNotFound===!0}function Xme(){try{return sessionStorage}catch{return}}const Jme="tsr-scroll-restoration-v1_3",lz=Xme();function eve(){try{return JSON.parse(lz?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function tve(){try{lz?.setItem(Jme,JSON.stringify(vu))}catch{}}const vu=eve(),L4="data-scroll-restoration-id",nve=e=>e.state.__TSR_key||e.href;function rve(e){const t=e.getAttribute(L4);if(t)return`[${L4}="${t}"]`;let n="",r=e,o;for(;o=r.parentNode;){let s=1,a=r;for(;a=a.previousElementSibling;)s++;const u=`${r.localName}:nth-child(${s})`;n=n?`${u} > ${n}`:u,r=o}return n}let ug=!1;const cm="window";function ux(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function U4(e){const t=new Set;for(const n of e){if(n===cm)continue;const r=ux(n);r&&t.add(r)}return t}function ove(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const o=e.options.getScrollRestorationKey||nve,s=new Set,a=u=>{const c=vu[u]||={};for(const f of s)f===document?c[cm]={scrollX,scrollY}:f.isConnected&&(c[rve(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,ug=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{ug||s.add(u.target)},!0),e.subscribe("onBeforeLoad",u=>{u.fromLocation&&a(o(u.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{a(o(e.stores.resolvedLocation.get()??e.stores.location.get())),tve()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",u=>{const c=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors,h=r.next,g=r.hash;let m;if(s.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const v=o(u.toLocation),w=u.fromLocation&&o(u.fromLocation);if(r.restoring&&w&&w!==v){const S=vu[w];if(S){let C=vu[v];for(const E in S){if(E===cm){if(h)continue}else{const A=ux(E);if(!A||h&&f&&(m??=U4(f),m.has(A)))continue}C||(C=vu[v]={}),C[E]??=S[E]}}}ug=!0;try{const S=u.toLocation.hash,C=u.toLocation.state.__hashScrollIntoViewOptions??!0;let E=!1;if(h){!S&&f&&(m??=U4(f));const A=S&&C&&g,I=r.restoring?vu[v]:void 0;if(I)for(const T in I){const{scrollX:N,scrollY:M}=I[T];if(T===cm){if(A)continue;scrollTo({top:M,left:N,behavior:c}),E=!0}else{const R=ux(T);R&&(R.scrollLeft=N,R.scrollTop=M,m?.delete(R))}}if(!S){const T={top:0,left:0,behavior:c};if(E||scrollTo(T),m)for(const N of m)N.scrollTo(T)}}!E&&S&&C&&document.getElementById(S)?.scrollIntoView(C)}finally{ug=!1}}))}function sve(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function EE(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function ive(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,o]of t.entries()){const s=n[r];s==null?n[r]=EE(o):Array.isArray(s)?s.push(EE(o)):n[r]=[s,EE(o)]}return n}const ave=uve(JSON.parse),lve=cve(JSON.stringify,JSON.parse);function uve(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=ive(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function cve(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const s=sve(o,r);return s?`?${s}`:""}}const La="__root__";function Sc(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ar(e){return e instanceof Response&&!!e.options}function dve(e){return{input:({url:t})=>{for(const n of e)t=cx(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=uz(e[n],t);return t}}}function fve(e){const t=az(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),o=`${r}/`;return{input:({url:s})=>{const a=e.caseSensitive?s.pathname:s.pathname.toLowerCase();return a===r?s.pathname="/":a.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},output:({url:s})=>(s.pathname=um(["/",t,s.pathname]),s)}}function cx(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function uz(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function hve(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:o,init:s}=t,a=new Map,u=new Map,c=new Map,f=n(e.status),h=n(e.loadedAt),g=n(e.isLoading),m=n(e.isTransitioning),v=n(e.location),w=n(e.resolvedLocation),S=n(e.statusCode),C=n(e.redirect),E=n([]),A=n([]),I=n([]),T=r(()=>_E(a,E.get())),N=r(()=>_E(u,A.get())),M=r(()=>_E(c,I.get())),R=r(()=>E.get()[0]),k=r(()=>E.get().some(Q=>a.get(Q)?.get().status==="pending")),L=r(()=>({locationHref:v.get().href,resolvedLocationHref:w.get()?.href,status:f.get()})),q=r(()=>({status:f.get(),loadedAt:h.get(),isLoading:g.get(),isTransitioning:m.get(),matches:T.get(),location:v.get(),resolvedLocation:w.get(),statusCode:S.get(),redirect:C.get()})),F=Mf(64);function D(Q){let ae=F.get(Q);return ae||(ae=r(()=>{const ue=E.get();for(const we of ue){const U=a.get(we);if(U&&U.routeId===Q)return U.get()}}),F.set(Q,ae)),ae}const j={status:f,loadedAt:h,isLoading:g,isTransitioning:m,location:v,resolvedLocation:w,statusCode:S,redirect:C,matchesId:E,pendingIds:A,cachedIds:I,matches:T,pendingMatches:N,cachedMatches:M,firstId:R,hasPending:k,matchRouteDeps:L,matchStores:a,pendingMatchStores:u,cachedMatchStores:c,__store:q,getRouteMatchStore:D,setMatches:Z,setPending:he,setCached:B};Z(e.matches),s?.(j);function Z(Q){xE(Q,a,E,n,o)}function he(Q){xE(Q,u,A,n,o)}function B(Q){xE(Q,c,I,n,o)}return j}function _E(e,t){const n=[];for(const r of t){const o=e.get(r);o&&n.push(o.get())}return n}function xE(e,t,n,r,o){const s=e.map(u=>u.id),a=new Set(s);o(()=>{for(const u of t.keys())a.has(u)||t.delete(u);for(const u of e){const c=t.get(u.id);if(!c){const f=r(u);f.routeId=u.routeId,t.set(u.id,f);continue}c.routeId=u.routeId,c.get()!==u&&c.set(u)}Fme(n.get(),s)||n.set(s)})}const dx=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},pve=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Oy=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Ua=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let s=0;s<=o;s++){const a=e.matches[s];if(!a)continue;const u=e.router.getMatch(a.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},F4=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),o=r>=0?r:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=o);for(let a=s;a>=0;a--){const u=e.matches[a];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return a}return n?s:o},ki=(e,t,n)=>{if(!(!ar(n)&&!jn(n)))throw ar(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:ar(n)?"redirected":jn(n)?"notFound":r.status==="pending"?"success":r.status,context:Ua(e,t.index),isFetching:!1,error:n})),jn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ar(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},cz=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},$4=(e,t,n)=>{const r=Ua(e,n);e.updateMatch(t,o=>({...o,context:r}))},Nd=(e,t,n)=>{const{id:r,routeId:o}=e.matches[t],s=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,ki(e,e.router.getMatch(r),n);try{s.options.onError?.(n)}catch(a){n=a,ki(e,e.router.getMatch(r),n)}e.updateMatch(r,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ar(n)&&!jn(n)&&(e.serialError??=n)},dz=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Oy(e,t)&&(n.options.loader||n.options.beforeLoad||hz(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{dx(e)},o);r._nonReactive.pendingTimeout=s}},gve=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;dz(e,t,n,r);const o=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&ki(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},mve=(e,t,n,r)=>{const o=e.router.getMatch(t);let s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Vu(()=>{s?.resolve(),s=void 0});const{paramsError:a,searchError:u}=o;a&&Nd(e,n,a),u&&Nd(e,n,u),dz(e,t,r,o);const c=new AbortController;let f=!1;const h=()=>{f||(f=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:c})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{h(),g()});return}o._nonReactive.beforeLoadPromise=Vu();const m={...Ua(e,n,!1),...o.__routeContext},{search:v,params:w,cause:S}=o,C=Oy(e,t),E={search:v,abortController:c,params:w,preload:C,context:m,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},A=T=>{if(T===void 0){e.router.batch(()=>{h(),g()});return}(ar(T)||jn(T))&&(h(),Nd(e,n,T)),e.router.batch(()=>{h(),e.updateMatch(t,N=>({...N,__beforeLoadContext:T})),g()})};let I;try{if(I=r.options.beforeLoad(E),Of(I))return h(),I.catch(T=>{Nd(e,n,T)}).then(A)}catch(T){h(),Nd(e,n,T)}A(I)},vve=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],s=()=>u(),a=()=>mve(e,n,t,o),u=()=>{if(cz(e,n))return;const c=gve(e,n,o);return Of(c)?c.then(a):a()};return s()},yve=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([s,a,u])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:u,scripts:a,styles:s?.styles}))},fz=(e,t,n,r,o)=>{const s=t[r-1],{params:a,loaderDeps:u,abortController:c,cause:f}=e.router.getMatch(n),h=Ua(e,r),g=Oy(e,n);return{params:a,deps:u,preload:!!g,parentMatchPromise:s,abortController:c,context:h,location:e.location,navigate:m=>e.router.navigate({...m,_fromLocation:e.location}),cause:g?"preload":f,route:o,...e.router.options.additionalContext}},z4=async(e,t,n,r,o)=>{try{const s=e.router.getMatch(n);try{(!(J9??e.router.isServer)||s.ssr===!0)&&Pf(o);const a=o.options.loader,u=typeof a=="function"?a:a?.handler,c=u?.(fz(e,t,n,r,o)),f=!!u&&Of(c);if((f||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,g=>({...g,isFetching:"loader"})),u){const g=f?await c:c;ki(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,m=>({...m,loaderData:g}))}o._lazyPromise&&await o._lazyPromise;const h=s._nonReactive.minPendingPromise;h&&await h,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:Ua(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let u=a;if(u?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Ua(e,r)}));return}const c=s._nonReactive.minPendingPromise;c&&await c,jn(a)&&await o.options.notFoundComponent?.preload?.(),ki(e,e.router.getMatch(n),a);try{o.options.onError?.(a)}catch(f){u=f,ki(e,e.router.getMatch(n),f)}!ar(u)&&!jn(u)&&await Pf(o,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:Ua(e,r),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),ki(e,a,s)}},bve=async(e,t,n)=>{async function r(v,w,S,C,E){const A=Date.now()-w.updatedAt,I=v?E.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:E.options.staleTime??e.router.options.defaultStaleTime??0,T=E.options.shouldReload,N=typeof T=="function"?T(fz(e,t,o,n,E)):T,{status:M,invalid:R}=C,k=A>=I&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);a=M==="success"&&(R||(N??k)),v&&E.options.preload===!1||(a&&!e.sync&&h?(u=!0,(async()=>{try{await z4(e,t,o,n,E);const L=e.router.getMatch(o);L._nonReactive.loaderPromise?.resolve(),L._nonReactive.loadPromise?.resolve(),L._nonReactive.loaderPromise=void 0,L._nonReactive.loadPromise=void 0}catch(L){ar(L)&&await e.router.navigate(L.options)}})()):M!=="success"||a?await z4(e,t,o,n,E):$4(e,o,n))}const{id:o,routeId:s}=e.matches[n];let a=!1,u=!1;const c=e.router.looseRoutesById[s],f=c.options.loader,h=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(cz(e,o)){if(!e.router.getMatch(o))return e.matches[n];$4(e,o,n)}else{const v=e.router.getMatch(o),w=e.router.stores.matchesId.get()[n],S=(w&&e.router.stores.matchStores.get(w)||null)?.routeId===s?w:e.router.stores.matches.get().find(E=>E.routeId===s)?.id,C=Oy(e,o);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&h)return v;await v._nonReactive.loaderPromise;const E=e.router.getMatch(o),A=E._nonReactive.error||E.error;A&&ki(e,E,A),E.status==="pending"&&await r(C,v,S,E,c)}else{const E=C&&!e.router.stores.matchStores.has(o),A=e.router.getMatch(o);A._nonReactive.loaderPromise=Vu(),E!==A.preload&&e.updateMatch(o,I=>({...I,preload:E})),await r(C,v,S,A,c)}}const g=e.router.getMatch(o);u||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,u||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const m=u?g.isFetching:!1;return m!==g.isFetching||g.invalid!==!1?(e.updateMatch(o,v=>({...v,isFetching:m,invalid:!1})),e.router.getMatch(o)):g};async function j4(e){const t=e,n=[];pve(t.router)&&dx(t);let r;for(let m=0;m<t.matches.length;m++){try{const v=vve(t,m);Of(v)&&await v}catch(v){if(ar(v))throw v;if(jn(v))r=v;else if(!t.preload)throw v;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const o=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?F4(t,r):void 0,a=r&&t.preload?0:s!==void 0?Math.min(s+1,o):o;let u,c;for(let m=0;m<a;m++)n.push(bve(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const v of m){if(v.status!=="rejected")continue;const w=v.reason;if(ar(w))throw w;jn(w)?u??=w:c??=w}if(c!==void 0)throw c}const f=u??(r&&!t.preload?r:void 0);let h=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const m=F4(t,f);m===void 0&&Ts();const v=t.matches[m],w=t.router.looseRoutesById[v.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),f.routeId=v.routeId;const C=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,E=>({...E,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),h=m,await Pf(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||t.router.getMatch(m.id)?.globalNotFound&&t.updateMatch(m.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Pf(m,["errorComponent"])}for(let m=0;m<=h;m++){const{id:v,routeId:w}=t.matches[m],S=t.router.looseRoutesById[w];try{const C=yve(t,v,S);if(C){const E=await C;t.updateMatch(v,A=>({...A,...E}))}}catch(C){console.error(`Error executing head for route ${w}:`,C)}}const g=dx(t);if(Of(g)&&await g,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function B4(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Pf(e,t=dm){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:o,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===dm?(()=>{if(e._componentsPromise===void 0){const r=B4(e,dm);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():B4(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function hz(e){for(const t of dm)if(e.options[t]?.preload)return!0;return!1}const dm=["component","errorComponent","pendingComponent","notFoundComponent"];var Fi="__TSR_index",H4="popstate",q4="beforeunload";function Sve(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:a}))},o=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},s=async({task:a,navigateOpts:u,...c})=>{if(u?.ignoreBlocker??!1){a();return}const f=e.getBlockers?.()??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&f.length&&h)for(const g of f){const m=Hm(c.path,c.state);if(await g.blockerFn({currentLocation:t,nextLocation:m,action:c.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,u,c)=>{const f=t.state[Fi];u=V4(f+1,u),s({task:()=>{e.pushState(a,u),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:u})},replace:(a,u,c)=>{const f=t.state[Fi];u=V4(f,u),s({task:()=>{e.replaceState(a,u),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:u})},go:(a,u)=>{s({task:()=>{e.go(a),o({type:"GO",index:a})},navigateOpts:u,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Fi]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,a]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(f=>f!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function V4(e,t){t||(t={});const n=lR();return{...t,key:n,__TSR_key:n,[Fi]:e}}function wve(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const s=()=>o,a=k=>o=k,u=(k=>k),c=(()=>Hm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const k=lR();t.history.replaceState({[Fi]:0,key:k,__TSR_key:k},"")}let f=c(),h,g=!1,m=!1,v=!1,w=!1;const S=()=>f;let C,E;const A=()=>{C&&(R._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),R._ignoreSubscribers=!1,C=void 0,E=void 0,h=void 0)},I=(k,L,q)=>{const F=u(L);E||(h=f),f=Hm(L,q),C={href:F,state:q,isPush:C?.isPush||k==="push"},E||(E=Promise.resolve().then(()=>A()))},T=k=>{f=c(),R.notify({type:k})},N=async()=>{if(m){m=!1;return}const k=c(),L=k.state[Fi]-f.state[Fi],q=L===1,F=L===-1,D=!q&&!F||g;g=!1;const j=D?"GO":F?"BACK":"FORWARD",Z=D?{type:"GO",index:L}:{type:F?"BACK":"FORWARD"};if(v)v=!1;else{const he=s();if(typeof document<"u"&&he.length){for(const B of he)if(await B.blockerFn({currentLocation:f,nextLocation:k,action:j})){m=!0,t.history.go(1),R.notify(Z);return}}}f=c(),R.notify(Z)},M=k=>{if(w){w=!1;return}let L=!1;const q=s();if(typeof document<"u"&&q.length)for(const F of q){const D=F.enableBeforeUnload??!0;if(D===!0){L=!0;break}if(typeof D=="function"&&D()===!0){L=!0;break}}if(L)return k.preventDefault(),k.returnValue=""},R=Sve({getLocation:S,getLength:()=>t.history.length,pushState:(k,L)=>I("push",k,L),replaceState:(k,L)=>I("replace",k,L),back:k=>(k&&(v=!0),w=!0,t.history.back()),forward:k=>{k&&(v=!0),w=!0,t.history.forward()},go:k=>{g=!0,t.history.go(k)},createHref:k=>u(k),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(q4,M,{capture:!0}),t.removeEventListener(H4,N)},onBlocked:()=>{h&&f!==h&&(f=h)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(q4,M,{capture:!0}),t.addEventListener(H4,N),t.history.pushState=function(...k){const L=n.apply(t.history,k);return R._ignoreSubscribers||T("PUSH"),L},t.history.replaceState=function(...k){const L=r.apply(t.history,k);return R._ignoreSubscribers||T("REPLACE"),L},R}function Cve(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Hm(e,t){const n=Cve(e),r=n.indexOf("#"),o=n.indexOf("?"),s=lR();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[Fi]:0,key:s,__TSR_key:s}}}function lR(){return(Math.random()+1).toString(36).substring(7)}function ku(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Eve=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,a=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Qme(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=wve()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=Mf(1e3),h=this.buildRouteTree(),this.setRoutes(h)}if(!this.stores&&this.latestLocation){const h=this.getStoreConfig(this);this.batch=h.batch,this.stores=hve(xve(this.latestLocation),h),ove(this)}let u=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(s||o!==c||a!==f){this.basepath=c;const h=[],g=az(c);g&&g!=="/"&&h.push(fve({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:dve(h),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Vme(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&zme(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:c,search:f,hash:h,href:g,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const E=this.options.parseSearch(f),A=this.options.stringifySearch(E);return{href:c+A+h,publicHref:c+A+h,pathname:Pd(c).path,external:!1,searchStr:A,search:wa(r?.search,E),hash:Pd(h.slice(1)).path,state:Ra(r?.state,m)}}const v=new URL(g,this.origin),w=cx(this.rewrite,v),S=this.options.parseSearch(w.search),C=this.options.stringifySearch(S);return w.search=C,{href:w.href.replace(w.origin,""),publicHref:g,pathname:Pd(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:C,search:wa(r?.search,S),hash:Pd(w.hash.slice(1)).path,state:Ra(r?.state,m)}},s=o(n),{__tempLocation:a,__tempKey:u}=s.state;if(a&&(!u||u===this.tempLocationKey)){const c=o(a);return c.state.key=s.state.key,c.state.__TSR_key=s.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>Yme({base:n,to:r.includes("//")?aR(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>Ave({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(a);s.from;const c=s.unsafeRelative==="path"?a.pathname:s.from??u.fullPath,f=s.to?`${s.to}`:void 0,h=u.search,g=Object.assign(Object.create(null),u.params),m=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(c,"."),v=f?this.resolvePathWithBase(m,f):m,w=s.params===!1||s.params===null?Object.create(null):(s.params??!0)===!0?g:Object.assign(g,Ia(s.params,g)),S=this.routesByPath[Is(v)];let C;if(S)C=this.getRouteBranch(S);else if(v.includes("$"))C=[];else{const F=this.getMatchedRoutes(v);C=F.matchedRoutes,this.options.notFoundRoute&&(!F.foundRoute||F.foundRoute.path!=="/"&&F.routeParams["**"])&&(C=[...C,this.options.notFoundRoute])}if(C.length&&tz(w))for(const F of C){const D=F.options.params?.stringify??F.options.stringifyParams;if(D)try{Object.assign(w,D(w))}catch{}}const E=n.leaveParams?v:Pd(k4({path:v,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let A=h;if(n._includeValidateSearch&&this.options.search?.strict){const F={};C.forEach(D=>{if(D.options.validateSearch)try{Object.assign(F,fm(D.options.validateSearch,{...F,...A}))}catch{}}),A=F}A=Ive({search:A,dest:s,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),A=wa(h,A);const I=this.options.stringifySearch(A),T=s.hash===!0?a.hash:s.hash?Ia(s.hash,a.hash):void 0,N=T?`#${T}`:"";let M=s.state===!0?a.state:s.state?Ia(s.state,a.state):{};M=Ra(a.state,M);const R=`${E}${I}${N}`;let k,L,q=!1;if(this.rewrite){const F=new URL(R,this.origin),D=uz(this.rewrite,F);k=F.href.replace(F.origin,""),D.origin!==this.origin?(L=D.href,q=!0):L=D.pathname+D.search+D.hash}else k=Ume(R),L=k;return{publicHref:L,href:k,pathname:E,search:A,searchStr:I,state:M,hash:T??"",external:q,unmaskOnReload:s.unmaskOnReload}},o=(s={},a)=>{const u=r(s);let c=a?r(a):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=jme(u.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:g,params:m,...v}=h.route,w=m===!1||m===null?Object.create(null):(m??!0)===!0?f:Object.assign(f,Ia(m,f));a={from:n.from,...v,params:w},c=r(a)}}}return c&&(u.maskedLocation=c),u};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{let s;const a=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(g=>{o.state[g]=this.latestLocation.state[g]});const h=Da(o.state,this.latestLocation.state);return f.forEach(g=>{delete o.state[g]}),h},u=Is(this.latestLocation.href)===Is(o.href);let c=this.commitLocationPromise;if(this.commitLocationPromise=Vu(()=>{c?.resolve(),c=void 0}),u&&a())this.load();else{let{maskedLocation:f,hashScrollIntoView:h,...g}=o;f&&(g={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,s=o.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:r})}return this._scroll.next=o.resetScroll??!0,this.history.subscribers.size||this.load(s?{action:{type:s}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:a,href:u,...c}={})=>{if(u){const g=this.history.location.state.__TSR_index,m=Hm(u,{__TSR_index:n?g:g+1}),v=new URL(m.pathname,this.origin);c.to=cx(this.rewrite,v).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...a})=>{let u=!1;if(o)try{new URL(`${o}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!o){const f=this.buildLocation({to:n,...a});o=o??f.publicHref,s=s??f.publicHref}const c=!u&&s?s:o;if(jm(c,this.protocolAllowlist))return;if(!a.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(c):window.location.href=c;return}return this.buildAndCommitLocation({...a,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(o=>!n.some(s=>s.id===o.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let o,s,a;const u=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const h=this.latestLocation,g=ku(h,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await j4({router:this,sync:n?.sync,forceStaleReload:u.href===h.href,matches:this.stores.pendingMatches.get(),location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,v=null,w=null,S=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),E=C.length,A=this.stores.matches.get();m=E?A.filter(N=>!this.stores.pendingMatchStores.has(N.id)):null;const I=new Set;for(const N of this.stores.pendingMatchStores.values())N.routeId&&I.add(N.routeId);const T=new Set;for(const N of this.stores.matchStores.values())N.routeId&&T.add(N.routeId);v=E?A.filter(N=>!I.has(N.routeId)):null,w=E?C.filter(N=>!T.has(N.routeId)):null,S=E?C.filter(N=>T.has(N.routeId)):A,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),E&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(N=>N.status!=="error"&&N.status!=="notFound"&&N.status!=="redirected")]),this.clearExpiredCache())});for(const[C,E]of[[v,"onLeave"],[w,"onEnter"],[S,"onStay"]])if(C)for(const A of C)this.looseRoutesById[A.routeId].options[E]?.(A)})})}})}catch(h){ar(h)?(o=h,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):jn(h)&&(s=h);const g=o?o.status:s?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(g),this.stores.redirect.set(o)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(f=>f.status==="error")&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(ku(s,a)):r.types;if(u===!1){n();return}o={update:n,types:u}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStores.get(n);if(o){o.set(r);return}const s=this.stores.matchStores.get(n);if(s){s.set(r);return}const a=this.stores.cachedMatchStores.get(n);if(a){const u=r(a.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(c=>c.filter(f=>f!==n)):a.set(u)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(o);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&jm(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(o=>!r(o))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=o=>{const s=this.looseRoutesById[o.routeId];if(!s.options.loader)return!0;const a=(o.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:n-o.updatedAt>=a};this.clearCache({filter:r})},this.loadRouteChunk=Pf,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...s,...this.stores.cachedIds.get()]),u=o.filter(c=>!a.has(c.id));if(u.length){const c=this.stores.cachedMatches.get();this.stores.setCached([...c,...u])}try{return o=await j4({router:this,matches:o,location:r,preload:!0,updateMatch:(c,f)=>{s.has(c)?o=o.map(h=>h.id===c?f(h):h):this.updateMatch(c,f)}}),o}catch(c){if(ar(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});jn(c)||console.error(c);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const a=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=Bme(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!u||n.params&&!Da(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Da(a.search,s.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??lve,parseSearch:e.parseSearch??ave,protocolAllowlist:e.protocolAllowlist??Lme}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=sz(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:o}=n;let{matchedRoutes:s}=n,a=!1;(r?r.path!=="/"&&o["**"]:Is(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:a=!0);const u=a?Tve(this.options.notFoundMode,s):void 0,c=new Array(s.length),f=new Map;for(const h of this.stores.matchStores.values())h.routeId&&f.set(h.routeId,h.get());for(let h=0;h<s.length;h++){const g=s[h],m=c[h-1];let v,w,S;{const D=m?.search??e.search,j=m?._strictSearch??void 0;try{const Z=fm(g.options.validateSearch,{...D})??void 0;v={...D,...Z},w={...j,...Z},S=void 0}catch(Z){let he=Z;if(Z instanceof qm||(he=new qm(Z.message,{cause:Z})),t?.throwOnError)throw he;v=D,w={},S=he}}const C=g.options.loaderDeps?.({search:v})??"",E=C?JSON.stringify(C):"",{interpolatedPath:A,usedParams:I}=k4({path:g.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),T=g.id+A+E,N=this.getMatch(T),M=f.get(g.id),R=N?._strictParams??I;let k;if(!N)try{W4(g,R)}catch(D){if(jn(D)||ar(D)?k=D:k=new _ve(D.message,{cause:D}),t?.throwOnError)throw k}Object.assign(o,R);const L=M?"stay":"enter";let q;if(N)q={...N,cause:L,params:M?.params??o,_strictParams:R,search:wa(M?M.search:N.search,v),_strictSearch:w};else{const D=g.options.loader||g.options.beforeLoad||g.lazyFn||hz(g)?"pending":"success";q={id:T,ssr:g.options.ssr,index:h,routeId:g.id,params:M?.params??o,_strictParams:R,pathname:A,updatedAt:Date.now(),search:M?wa(M.search,v):v,_strictSearch:w,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:k,__routeContext:void 0,_nonReactive:{loadPromise:Vu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:L,loaderDeps:M?Ra(M.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}t?.preload||(q.globalNotFound=u===g.id),q.searchError=S;const F=this.getParentContext(m);q.context={...F,...q.__routeContext,...q.__beforeLoadContext},c[h]=q}for(let h=0;h<c.length;h++){const g=c[h],m=this.looseRoutesById[g.routeId],v=this.getMatch(g.id),w=f.get(g.routeId);if(g.params=w?wa(w.params,o):o,!v){const S=c[h-1],C=this.getParentContext(S);if(m.options.context){const E={deps:g.loaderDeps,params:g.params,context:C??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:c,routeId:m.id};g.__routeContext=m.options.context(E)??void 0}g.context={...C,...g.__routeContext,...g.__beforeLoadContext}}}return c}matchRoutesLightweight(e){const t=Tf(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:o}=this.getMatchedRoutes(e.pathname),s=Tf(r),a={...e.search};for(const g of r)try{Object.assign(a,fm(g.options.validateSearch,a))}catch{}const u=t&&this.stores.matchStores.get(t)?.get(),c=u&&u.routeId===s.id&&u.pathname===e.pathname;let f;if(c)f=u.params;else{const g=Object.assign(Object.create(null),o);for(const m of r)try{W4(m,g)}catch{}f=g}const h={matchedRoutes:r,fullPath:s.fullPath,search:a,params:f};return this.lightweightCache.set(e,[t,h]),h}},qm=class extends Error{},_ve=class extends Error{};function xve(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function fm(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new qm("Async validation not supported");if(n.issues)throw new qm(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Ave({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),o=Is(e);let s;const a=Hme(o,n,!0);return a&&(s=a.route,Object.assign(r,a.rawParams)),{matchedRoutes:a?.branch||[t.__root__],routeParams:r,foundRoute:s}}function Ive({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Rve(n)(e,t,r??!1)}function Rve(e){let t,n;const r=[];for(const s of e){const a=s.options;if("search"in a)a.search?.middlewares&&r.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){const c=({search:f,next:h})=>{const g=h(a.preSearchFilters?a.preSearchFilters.reduce((m,v)=>v(m),f):f);return a.postSearchFilters?a.postSearchFilters.reduce((m,v)=>v(m),g):g};r.push(c)}const u=a.validateSearch;if(u){const c=({search:f,next:h,meta:g})=>{const m=h(f);if(n)try{const v=fm(u,m);if(g&&v)for(const w in v)w in m||(g.defaulted||=new Map).set(w,v[w]);return{...m,...v}}catch{}return m};r.push(c)}}const o=(s,a,u)=>{if(s>=r.length){if(!t.search)return{};if(t.search===!0)return a;const f=Ia(t.search,a);return u&&(u.explicit=f),f}const c=(f,h)=>{if(h){const g=u||{};return{search:o(s+1,f,g),meta:g}}return o(s+1,f,u)};return r[s]({search:a,next:c,meta:u})};return function(a,u,c){return t=u,n=c,o(0,a)}}function Tve(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return La}function W4(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const Ove="Error preloading route! ☝️";var pz=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=La:this.parentRoute||Ts();let o=r?La:n?.path;o&&o!=="/"&&(o=iz(o));const s=n?.id||o;let a=r?La:um([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);o==="__root__"&&(o="/"),a!=="__root__"&&(a=um(["/",a]));const u=a==="__root__"?"/":um([this.parentRoute.fullPath,o]);this._path=o,this._id=a,this._fullPath=u,this._to=Is(u)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Sc({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Mve=class extends pz{constructor(e){super(e)}};function uR(e){const t=e.errorComponent??cR;return O.jsx(Pve,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var Pve=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function cR({error:e}){const[t,n]=_.useState(!1);return O.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[O.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[O.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),O.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),O.jsx("div",{style:{height:".25rem"}}),t?O.jsx("div",{children:O.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?O.jsx("code",{children:e.message}):null})}):null]})}function Nve({children:e,fallback:t=null}){return gz()?O.jsx($.Fragment,{children:e}):O.jsx($.Fragment,{children:t})}function gz(){return $.useSyncExternalStore(kve,()=>!0,()=>!1)}function kve(){return()=>{}}var mz=_.createContext(null);function gr(e){return _.useContext(mz)}var My=_.createContext(void 0),Dve=_.createContext(void 0),Bt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Bt||{});function Lve({update:e,notify:t,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:a,shallowPropagate:u};function r(f,h,g){const m=h.depsTail;if(m!==void 0&&m.dep===f)return;const v=m!==void 0?m.nextDep:h.deps;if(v!==void 0&&v.dep===f){v.version=g,h.depsTail=v;return}const w=f.subsTail;if(w!==void 0&&w.version===g&&w.sub===h)return;const S=h.depsTail=f.subsTail={version:g,dep:f,sub:h,prevDep:m,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=S),m!==void 0?m.nextDep=S:h.deps=S,w!==void 0?w.nextSub=S:f.subs=S}function o(f,h=f.sub){const g=f.dep,m=f.prevDep,v=f.nextDep,w=f.nextSub,S=f.prevSub;return v!==void 0?v.prevDep=m:h.depsTail=m,m!==void 0?m.nextDep=v:h.deps=v,w!==void 0?w.prevSub=S:g.subsTail=S,S!==void 0?S.nextSub=w:(g.subs=w)===void 0&&n(g),v}function s(f){let h=f.nextSub,g;e:do{const m=f.sub;let v=m.flags;if(v&60?v&12?v&4?!(v&48)&&c(f,m)?(m.flags=v|40,v&=1):v=0:m.flags=v&-9|32:v=0:m.flags=v|32,v&2&&t(m),v&1){const w=m.subs;if(w!==void 0){const S=(f=w).nextSub;S!==void 0&&(g={value:h,prev:g},h=S);continue}}if((f=h)!==void 0){h=f.nextSub;continue}for(;g!==void 0;)if(f=g.value,g=g.prev,f!==void 0){h=f.nextSub;continue e}break}while(!0)}function a(f,h){let g,m=0,v=!1;e:do{const w=f.dep,S=w.flags;if(h.flags&16)v=!0;else if((S&17)===17){if(e(w)){const C=w.subs;C.nextSub!==void 0&&u(C),v=!0}}else if((S&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(g={value:f,prev:g}),f=w.deps,h=w,++m;continue}if(!v){const C=f.nextDep;if(C!==void 0){f=C;continue}}for(;m--;){const C=h.subs,E=C.nextSub!==void 0;if(E?(f=g.value,g=g.prev):f=C,v){if(e(h)){E&&u(C),h=f.sub;continue}v=!1}else h.flags&=-33;h=f.sub;const A=f.nextDep;if(A!==void 0){f=A;continue e}}return v}while(!0)}function u(f){do{const h=f.sub,g=h.flags;(g&48)===32&&(h.flags=g|16,(g&6)===2&&t(h))}while((f=f.nextSub)!==void 0)}function c(f,h){let g=h.depsTail;for(;g!==void 0;){if(g===f)return!0;g=g.prevDep}return!1}}function Uve(e,t,n){const r=typeof e=="object",o=r?e:void 0;return{next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}const fx=[];let hm=0;const{link:G4,unlink:Fve,propagate:$ve,checkDirty:vz,shallowPropagate:K4}=Lve({update(e){return e._update()},notify(e){fx[hx++]=e,e.flags&=~Bt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Bt.Mutable|Bt.Dirty,Vm(e))}});let cg=0,hx=0,ko,px=0;function yz(e){try{++px,e()}finally{--px||bz()}}function Vm(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Fve(n,e)}function bz(){if(!(px>0)){for(;cg<hx;){const e=fx[cg];fx[cg++]=void 0,e.notify()}cg=0,hx=0}}function Z4(e,t){const n=typeof e=="function",r=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Bt.None:Bt.Mutable,get(){return ko!==void 0&&G4(o,ko,hm),o._snapshot},subscribe(s){const a=Uve(s),u={current:!1},c=zve(()=>{o.get(),u.current?a.next?.(o._snapshot):u.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(s){const a=ko,u=t?.compare??Object.is;if(n)ko=o,++hm,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=Bt.Mutable|Bt.RecursedCheck);try{const c=o._snapshot,f=typeof s=="function"?s(c):s===void 0&&n?r(c):s;return c===void 0||!u(c,f)?(o._snapshot=f,!0):!1}finally{ko=a,n&&(o.flags&=~Bt.RecursedCheck),Vm(o)}}};return n?(o.flags=Bt.Mutable|Bt.Dirty,o.get=function(){const s=o.flags;if(s&Bt.Dirty||s&Bt.Pending&&vz(o.deps,o)){if(o._update()){const a=o.subs;a!==void 0&&K4(a)}}else s&Bt.Pending&&(o.flags=s&~Bt.Pending);return ko!==void 0&&G4(o,ko,hm),o._snapshot}):o.set=function(s){if(o._update(s)){const a=o.subs;a!==void 0&&($ve(a),K4(a),bz())}},o}function zve(e){const t=()=>{const r=ko;ko=n,++hm,n.depsTail=void 0,n.flags=Bt.Watching|Bt.RecursedCheck;try{return e()}finally{ko=r,n.flags&=~Bt.RecursedCheck,Vm(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Bt.Watching|Bt.RecursedCheck,notify(){const r=this.flags;r&Bt.Dirty||r&Bt.Pending&&vz(this.deps,this)?t():this.flags=Bt.Watching},stop(){this.flags=Bt.None,this.depsTail=void 0,Vm(this)}};return t(),n}function jve(e,t){return e===t}function hr(e,t,n=jve){const r=_.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(a);return u},[e]),o=_.useCallback(()=>e?.get(),[e]);return v$.useSyncExternalStoreWithSelector(r,o,o,t,n)}var AE={get(){},subscribe(){return{unsubscribe(){}}}};function Bve(e,t){const n=_.useRef();return r=>{const o=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Ra(n.current,o):o}}function dl(e){const t=gr(),n=_.useContext(e.from?Dve:My),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),o=Bve(e,t),s=hr(r??AE,a=>a?o(a):AE);if(s!==AE)return s;(e.shouldThrow??!0)&&Ts()}function Sz(e){return dl({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function wz(e){const{select:t,...n}=e;return dl({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Cz(e){return dl({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Py(e){return dl({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function dh(e){const t=gr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function i6e(e){const t=gr(),n=dh(),r=_.useRef(null);return Eu(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Ez(e){return dl({...e,select:t=>e.select?e.select(t.context):t.context})}function Hve(e,t){const n=gr(),r=Ome(t),{activeProps:o,inactiveProps:s,activeOptions:a,to:u,preload:c,preloadDelay:f,preloadIntentProximity:h,hashScrollIntoView:g,replace:m,startTransition:v,resetScroll:w,viewTransition:S,children:C,target:E,disabled:A,style:I,className:T,onClick:N,onBlur:M,onFocus:R,onMouseEnter:k,onMouseLeave:L,onTouchStart:q,ignoreBlocker:F,params:D,search:j,hash:Z,state:he,mask:B,reloadDocument:Q,unsafeRelative:ae,from:ue,_fromLocation:we,...U}=e,X=gz(),ie=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=hr(n.stores.location,Pt=>Pt,(Pt,Rn)=>Pt.href===Rn.href),fe=_.useMemo(()=>{const Pt={_fromLocation:oe,...ie};return n.buildLocation(Pt)},[n,oe,ie]),Me=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,xe=fe.maskedLocation?fe.maskedLocation.external:fe.external,se=_.useMemo(()=>Zve(Me,xe,n.history,A),[A,xe,Me,n.history]),Se=_.useMemo(()=>{if(se?.external)return jm(se.href,n.protocolAllowlist)?void 0:se.href;if(!Yve(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),jm(u,n.protocolAllowlist)?void 0:u}catch{}},[u,se,n.protocolAllowlist]),Ze=_.useMemo(()=>{if(Se)return!1;if(a?.exact){if(!Zme(oe.pathname,fe.pathname,n.basepath))return!1}else{const Pt=Bm(oe.pathname,n.basepath),Rn=Bm(fe.pathname,n.basepath);if(!(Pt.startsWith(Rn)&&(Pt.length===Rn.length||Pt[Rn.length]==="/")))return!1}return(a?.includeSearch??!0)&&!Da(oe.search,fe.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?X&&oe.hash===fe.hash:!0},[a?.exact,a?.explicitUndefined,a?.includeHash,a?.includeSearch,oe,Se,X,fe.hash,fe.pathname,fe.search,n.basepath]),ve=Ze?Ia(o,{})??qve:IE,pt=Ze?IE:Ia(s,{})??IE,gt=[T,ve.className,pt.className].filter(Boolean).join(" "),Ye=(I||ve.style||pt.style)&&{...I,...ve.style,...pt.style},[pn,Qe]=_.useState(!1),Gs=_.useRef(!1),Yo=e.reloadDocument||Se?!1:c??n.options.defaultPreload,ta=f??n.options.defaultPreloadDelay??0,ro=_.useCallback(()=>{n.preloadRoute({...ie,_builtLocation:fe}).catch(Pt=>{console.warn(Pt),console.warn(Ove)})},[n,ie,fe]);Tme(r,_.useCallback(Pt=>{Pt?.isIntersecting&&ro()},[ro]),Kve,{disabled:!!A||Yo!=="viewport"}),_.useEffect(()=>{Gs.current||!A&&Yo==="render"&&(ro(),Gs.current=!0)},[A,ro,Yo]);const xc=Pt=>{const Rn=Pt.currentTarget.getAttribute("target"),_o=E!==void 0?E:Rn;if(!A&&!Qve(Pt)&&!Pt.defaultPrevented&&(!_o||_o==="_self")&&Pt.button===0){Pt.preventDefault(),gte.flushSync(()=>{Qe(!0)});const vl=n.subscribe("onResolved",()=>{vl(),Qe(!1)});n.navigate({...ie,replace:m,resetScroll:w,hashScrollIntoView:g,startTransition:v,viewTransition:S,ignoreBlocker:F})}};if(Se)return{...U,ref:r,href:Se,...C&&{children:C},...E&&{target:E},...A&&{disabled:A},...I&&{style:I},...T&&{className:T},...N&&{onClick:N},...M&&{onBlur:M},...R&&{onFocus:R},...k&&{onMouseEnter:k},...L&&{onMouseLeave:L},...q&&{onTouchStart:q}};const Sh=Pt=>{if(A||Yo!=="intent")return;if(!ta){ro();return}const Rn=Pt.currentTarget;if(kd.has(Rn))return;const _o=setTimeout(()=>{kd.delete(Rn),ro()},ta);kd.set(Rn,_o)},db=Pt=>{A||Yo!=="intent"||ro()},Fn=Pt=>{if(A||!Yo||!ta)return;const Rn=Pt.currentTarget,_o=kd.get(Rn);_o&&(clearTimeout(_o),kd.delete(Rn))};return{...U,...ve,...pt,href:se?.href,ref:r,onClick:lu([N,xc]),onBlur:lu([M,Fn]),onFocus:lu([R,Sh]),onMouseEnter:lu([k,Sh]),onMouseLeave:lu([L,Fn]),onTouchStart:lu([q,db]),disabled:!!A,target:E,...Ye&&{style:Ye},...gt&&{className:gt},...A&&Vve,...Ze&&Wve,...X&&pn&&Gve}}var IE={},qve={className:"active"},Vve={role:"link","aria-disabled":!0},Wve={"data-status":"active","aria-current":"page"},Gve={"data-transitioning":"transitioning"},kd=new WeakMap,Kve={rootMargin:"100px"},lu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Zve(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Yve(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}function a6e(e){return _.forwardRef(function(n,r){return O.jsx(dR,{...n,_asChild:e,ref:r})})}var dR=_.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...s}=Hve(r,t),a=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...c}=s;return _.createElement("a",c,a)}return _.createElement(n,s,a)});function Qve(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Xve=class extends pz{constructor(t){super(t),this.useMatch=n=>dl({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ez({...n,from:this.id}),this.useSearch=n=>Py({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Cz({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>wz({...n,from:this.id}),this.useLoaderData=n=>Sz({...n,from:this.id}),this.useNavigate=()=>dh({from:this.fullPath}),this.Link=$.forwardRef((n,r)=>O.jsx(dR,{ref:r,from:this.fullPath,...n}))}};function Jve(e){return new Xve(e)}function eye(){return e=>nye(e)}var tye=class extends Mve{constructor(e){super(e),this.useMatch=t=>dl({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Ez({...t,from:this.id}),this.useSearch=t=>Py({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Cz({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>wz({...t,from:this.id}),this.useLoaderData=t=>Sz({...t,from:this.id}),this.useNavigate=()=>dh({from:this.fullPath}),this.Link=$.forwardRef((t,n)=>O.jsx(dR,{ref:n,from:this.fullPath,...t}))}};function nye(e){return new tye(e)}function Ee(e){return new rye(e,{silent:!0}).createRoute}var rye=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=Jve(n);return r.isRoot=!1,r},this.silent=t?.silent}};function Ie(e,t){let n,r,o,s;const a=()=>(n||(n=e().then(c=>{n=void 0,r=c[t??"default"]}).catch(c=>{if(o=c,Nme(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(f)||(sessionStorage.setItem(f,"1"),s=!0)}})),n),u=function(f){if(s)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!r)if(I4)I4(a());else throw a();return _.createElement(r,f)};return u.preload=a,u}function oye(e){const t=gr(),n=`not-found-${hr(t.stores.location,r=>r.pathname)}-${hr(t.stores.status,r=>r)}`;return O.jsx(uR,{getResetKey:()=>n,onCatch:(r,o)=>{if(jn(r))e.onCatch?.(r,o);else throw r},errorComponent:({error:r})=>{if(jn(r))return e.fallback?.(r);throw r},children:e.children})}function sye(){return O.jsx("p",{children:"Not Found"})}function yu(e){return O.jsx(O.Fragment,{children:e.children})}function _z(e,t,n){return t.options.notFoundComponent?O.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?O.jsx(e.options.defaultNotFoundComponent,{...n}):O.jsx(sye,{})}function iye(e){return null}function aye(){return iye(gr()),null}var lye=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,uye=(e,t)=>e[0]===t[0]&&e[1]===t[1],xz=_.memo(function({matchId:t}){const n=gr(),r=n.stores.matchStores.get(t);r||Ts();const o=hr(n.stores.loadedAt,a=>a),s=hr(r,a=>a,lye);return O.jsx(cye,{router:n,matchId:t,resetKey:o,matchState:_.useMemo(()=>{const a=s.routeId,u=n.routesById[a].parentRoute?.id;return{routeId:a,ssr:s.ssr,_displayPending:s._displayPending,parentRouteId:u}},[s._displayPending,s.routeId,s.ssr,n.routesById])})});function cye({router:e,matchId:t,resetKey:n,matchState:r}){const o=e.routesById[r.routeId],s=o.options.pendingComponent??e.options.defaultPendingComponent,a=s?O.jsx(s,{}):null,u=o.options.errorComponent??e.options.defaultErrorComponent,c=o.options.onCatch??e.options.defaultOnCatch,f=o.isRoot?o.options.notFoundComponent??e.options.notFoundRoute?.options.component:o.options.notFoundComponent,h=r.ssr===!1||r.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||h)&&(o.options.wrapInSuspense??s??(o.options.errorComponent?.preload||h))?_.Suspense:yu,m=u?uR:yu,v=f?oye:yu;return O.jsxs(o.isRoot?o.options.shellComponent??yu:yu,{children:[O.jsx(My.Provider,{value:t,children:O.jsx(g,{fallback:a,children:O.jsx(m,{getResetKey:()=>n,errorComponent:u||cR,onCatch:(w,S)=>{if(jn(w))throw w.routeId??=r.routeId,w;c?.(w,S)},children:O.jsx(v,{fallback:w=>{if(w.routeId??=r.routeId,!f||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!o.isRoot)throw w;return _.createElement(f,w)},children:h||r._displayPending?O.jsx(Nve,{fallback:a,children:O.jsx(Y4,{matchId:t})}):O.jsx(Y4,{matchId:t})})})})}),r.parentRouteId===La?O.jsxs(O.Fragment,{children:[O.jsx(dye,{}),e.options.scrollRestoration&&J9?O.jsx(aye,{}):null]}):null]})}function dye(){const e=gr(),t=_.useRef();return Eu(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...ku(e.stores.location.get(),r??n)}),t.current=n},[hr(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var Y4=_.memo(function({matchId:t}){const n=gr(),r=(h,g)=>n.getMatch(h.id)?._nonReactive[g]??h._nonReactive[g],o=n.stores.matchStores.get(t);o||Ts();const s=hr(o,h=>h),a=s.routeId,u=n.routesById[a],c=_.useMemo(()=>{const h=(n.routesById[a].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:a,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return h?JSON.stringify(h):void 0},[a,s.loaderDeps,s._strictParams,s._strictSearch,n.options.defaultRemountDeps,n.routesById]),f=_.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?O.jsx(h,{},c):O.jsx(Az,{})},[c,u.options.component,n.options.defaultComponent]);if(s._displayPending)throw r(s,"displayPendingPromise");if(s._forcePending)throw r(s,"minPendingPromise");if(s.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const g=n.getMatch(s.id);if(g&&!g._nonReactive.minPendingPromise){const m=Vu();g._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),g._nonReactive.minPendingPromise=void 0},h)}}throw r(s,"loadPromise")}if(s.status==="notFound")return jn(s.error)||Ts(),_z(n,u,s.error);if(s.status==="redirected")throw ar(s.error)||Ts(),r(s,"loadPromise");if(s.status==="error")throw s.error;return f}),Az=_.memo(function(){const t=gr(),n=_.useContext(My);let r,o=!1,s;{const f=n?t.stores.matchStores.get(n):void 0;[r,o]=hr(f,h=>[h?.routeId,h?.globalNotFound??!1],uye),s=hr(t.stores.matchesId,h=>h[h.findIndex(g=>g===n)+1])}const a=r?t.routesById[r]:void 0,u=t.options.defaultPendingComponent?O.jsx(t.options.defaultPendingComponent,{}):null;if(o)return a||Ts(),_z(t,a,void 0);if(!s)return null;const c=O.jsx(xz,{matchId:s});return r===La?O.jsx(_.Suspense,{fallback:u,children:c}):c});function fye(){const e=gr(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),o=hr(e.stores.isLoading,g=>g),s=hr(e.stores.hasPending,g=>g),a=bE(o),u=o||n||s,c=bE(u),f=o||s,h=bE(f);return e.startTransition=g=>{r(!0),_.startTransition(()=>{g(),r(!1)})},_.useEffect(()=>{const g=e.history.subscribe(e.load),m=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Is(e.latestLocation.publicHref)!==Is(m.publicHref)&&e.commitLocation({...m,replace:!0}),()=>{g()}},[e,e.history]),Eu(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(m){console.error(m)}})()},[e]),Eu(()=>{a&&!o&&e.emit({type:"onLoad",...ku(e.stores.location.get(),e.stores.resolvedLocation.get())})},[a,e,o]),Eu(()=>{h&&!f&&e.emit({type:"onBeforeRouteMount",...ku(e.stores.location.get(),e.stores.resolvedLocation.get())})},[f,h,e]),Eu(()=>{if(c&&!u){const g=ku(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...g}),yz(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,c,e]),null}function hye(){const e=gr(),t=e.routesById[La].options.pendingComponent??e.options.defaultPendingComponent,n=t?O.jsx(t,{}):null,r=O.jsxs(typeof document<"u"&&e.ssr?yu:_.Suspense,{fallback:n,children:[O.jsx(fye,{}),O.jsx(pye,{})]});return e.options.InnerWrap?O.jsx(e.options.InnerWrap,{children:r}):r}function pye(){const e=gr(),t=hr(e.stores.firstId,o=>o),n=hr(e.stores.loadedAt,o=>o),r=t?O.jsx(xz,{matchId:t}):null;return O.jsx(My.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:O.jsx(uR,{getResetKey:()=>n,errorComponent:cR,onCatch:void 0,children:r})})}var gye=e=>({createMutableStore:Z4,createReadonlyStore:Z4,batch:yz}),mye=e=>new vye(e),vye=class extends Eve{constructor(e){super(e,gye)}};function yye({router:e,children:t,...n}){tz(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=O.jsx(mz.Provider,{value:e,children:t});return e.options.Wrap?O.jsx(e.options.Wrap,{children:r}):r}function bye({router:e,...t}){return O.jsx(yye,{router:e,...t,children:O.jsx(hye,{})})}var RE={exports:{}},Dd={},TE={exports:{}},OE={};var Q4;function Sye(){return Q4||(Q4=1,(function(e){function t(B,Q){var ae=B.length;B.push(Q);e:for(;0<ae;){var ue=ae-1>>>1,we=B[ue];if(0<o(we,Q))B[ue]=Q,B[ae]=we,ae=ue;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var Q=B[0],ae=B.pop();if(ae!==Q){B[0]=ae;e:for(var ue=0,we=B.length,U=we>>>1;ue<U;){var X=2*(ue+1)-1,ie=B[X],oe=X+1,fe=B[oe];if(0>o(ie,ae))oe<we&&0>o(fe,ie)?(B[ue]=fe,B[oe]=ae,ue=oe):(B[ue]=ie,B[X]=ae,ue=X);else if(oe<we&&0>o(fe,ae))B[ue]=fe,B[oe]=ae,ue=oe;else break e}}return Q}function o(B,Q){var ae=B.sortIndex-Q.sortIndex;return ae!==0?ae:B.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var c=[],f=[],h=1,g=null,m=3,v=!1,w=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function T(B){for(var Q=n(f);Q!==null;){if(Q.callback===null)r(f);else if(Q.startTime<=B)r(f),Q.sortIndex=Q.expirationTime,t(c,Q);else break;Q=n(f)}}function N(B){if(S=!1,T(B),!w)if(n(c)!==null)w=!0,M||(M=!0,D());else{var Q=n(f);Q!==null&&he(N,Q.startTime-B)}}var M=!1,R=-1,k=5,L=-1;function q(){return C?!0:!(e.unstable_now()-L<k)}function F(){if(C=!1,M){var B=e.unstable_now();L=B;var Q=!0;try{e:{w=!1,S&&(S=!1,A(R),R=-1),v=!0;var ae=m;try{t:{for(T(B),g=n(c);g!==null&&!(g.expirationTime>B&&q());){var ue=g.callback;if(typeof ue=="function"){g.callback=null,m=g.priorityLevel;var we=ue(g.expirationTime<=B);if(B=e.unstable_now(),typeof we=="function"){g.callback=we,T(B),Q=!0;break t}g===n(c)&&r(c),T(B)}else r(c);g=n(c)}if(g!==null)Q=!0;else{var U=n(f);U!==null&&he(N,U.startTime-B),Q=!1}}break e}finally{g=null,m=ae,v=!1}Q=void 0}}finally{Q?D():M=!1}}}var D;if(typeof I=="function")D=function(){I(F)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,Z=j.port2;j.port1.onmessage=F,D=function(){Z.postMessage(null)}}else D=function(){E(F,0)};function he(B,Q){R=E(function(){B(e.unstable_now())},Q)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(B){switch(m){case 1:case 2:case 3:var Q=3;break;default:Q=m}var ae=m;m=Q;try{return B()}finally{m=ae}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,Q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ae=m;m=B;try{return Q()}finally{m=ae}},e.unstable_scheduleCallback=function(B,Q,ae){var ue=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ue+ae:ue):ae=ue,B){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=ae+we,B={id:h++,callback:Q,priorityLevel:B,startTime:ae,expirationTime:we,sortIndex:-1},ae>ue?(B.sortIndex=ae,t(f,B),n(c)===null&&B===n(f)&&(S?(A(R),R=-1):S=!0,he(N,ae-ue))):(B.sortIndex=we,t(c,B),w||v||(w=!0,M||(M=!0,D()))),B},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(B){var Q=m;return function(){var ae=m;m=Q;try{return B.apply(this,arguments)}finally{m=ae}}}})(OE)),OE}var X4;function wye(){return X4||(X4=1,TE.exports=Sye()),TE.exports}var J4;function Cye(){if(J4)return Dd;J4=1;var e=wye(),t=rh(),n=RF();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var l=i,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d:null}function a(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function u(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function c(i){if(s(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,p=l;;){var y=d.return;if(y===null)break;var b=y.alternate;if(b===null){if(p=y.return,p!==null){d=p;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===d)return c(y),i;if(b===p)return c(y),l;b=b.sibling}throw Error(r(188))}if(d.return!==p.return)d=y,p=b;else{for(var x=!1,P=y.child;P;){if(P===d){x=!0,d=y,p=b;break}if(P===p){x=!0,p=y,d=b;break}P=P.sibling}if(!x){for(P=b.child;P;){if(P===d){x=!0,d=b,p=y;break}if(P===p){x=!0,p=b,d=y;break}P=P.sibling}if(!x)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:l}function h(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=h(i),l!==null)return l;i=i.sibling}return null}var g=Object.assign,m=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),I=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var j=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===j?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case M:return"SuspenseList";case L:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case I:return i.displayName||"Context";case A:return(i._context.displayName||"Context")+".Consumer";case T:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case R:return l=i.displayName||null,l!==null?l:Z(i.type)||"Memo";case k:l=i._payload,i=i._init;try{return Z(i(l))}catch{}}return null}var he=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ue=[],we=-1;function U(i){return{current:i}}function X(i){0>we||(i.current=ue[we],ue[we]=null,we--)}function ie(i,l){we++,ue[we]=i.current,i.current=l}var oe=U(null),fe=U(null),Me=U(null),xe=U(null);function se(i,l){switch(ie(Me,l),ie(fe,i),ie(oe,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?XM(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=XM(l),i=JM(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}X(oe),ie(oe,i)}function Se(){X(oe),X(fe),X(Me)}function Ze(i){i.memoizedState!==null&&ie(xe,i);var l=oe.current,d=JM(l,i.type);l!==d&&(ie(fe,i),ie(oe,d))}function ve(i){fe.current===i&&(X(oe),X(fe)),xe.current===i&&(X(xe),pd._currentValue=ae)}var pt,gt;function Ye(i){if(pt===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);pt=l&&l[1]||"",gt=-1<d.stack.indexOf(`
|
|
81
81
|
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
82
82
|
`+pt+i+gt}var pn=!1;function Qe(i,l){if(!i||pn)return"";pn=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Y){var K=Y}Reflect.construct(i,[],ne)}else{try{ne.call()}catch(Y){K=Y}i.call(ne.prototype)}}else{try{throw Error()}catch(Y){K=Y}(ne=i())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Y){if(Y&&K&&typeof Y.stack=="string")return[Y.stack,K.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=p.DetermineComponentFrameRoot(),x=b[0],P=b[1];if(x&&P){var z=x.split(`
|
|
83
83
|
`),G=P.split(`
|
|
@@ -90,7 +90,7 @@ Error generating stack: `+p.message+`
|
|
|
90
90
|
|
|
91
91
|
`);k=D.pop()??"";for(const j of D){const Z=j.split(`
|
|
92
92
|
`),he=[];let B;for(const ue of Z)if(ue.startsWith("data:"))he.push(ue.replace(/^data:\s*/,""));else if(ue.startsWith("event:"))B=ue.replace(/^event:\s*/,"");else if(ue.startsWith("id:"))g=ue.replace(/^id:\s*/,"");else if(ue.startsWith("retry:")){const we=Number.parseInt(ue.replace(/^retry:\s*/,""),10);Number.isNaN(we)||(S=we)}let Q,ae=!1;if(he.length){const ue=he.join(`
|
|
93
|
-
`);try{Q=JSON.parse(ue),ae=!0}catch{Q=ue}}ae&&(o&&await o(Q),r&&(Q=await r(Q))),n?.({data:Q,event:B,id:g,retry:S}),he.length&&(yield Q)}}}finally{E.removeEventListener("abort",L),R.releaseLock()}break}catch(I){if(t?.(I),a!==void 0&&C>=a)break;const T=Math.min(S*2**(C-1),u??3e4);await m(T)}}}()}}const Iye=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Rye=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Tye=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Iz=({allowReserved:e,explode:t,name:n,style:r,value:o})=>{if(!t){const u=(e?o:o.map(c=>encodeURIComponent(c))).join(Rye(r));switch(r){case"label":return`.${u}`;case"matrix":return`;${n}=${u}`;case"simple":return u;default:return`${n}=${u}`}}const s=Iye(r),a=o.map(u=>r==="label"||r==="simple"?e?u:encodeURIComponent(u):Ny({allowReserved:e,name:n,value:u})).join(s);return r==="label"||r==="matrix"?s+a:a},Ny=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Rz=({allowReserved:e,explode:t,name:n,style:r,value:o,valueOnly:s})=>{if(o instanceof Date)return s?o.toISOString():`${n}=${o.toISOString()}`;if(r!=="deepObject"&&!t){let c=[];Object.entries(o).forEach(([h,g])=>{c=[...c,h,e?g:encodeURIComponent(g)]});const f=c.join(",");switch(r){case"form":return`${n}=${f}`;case"label":return`.${f}`;case"matrix":return`;${n}=${f}`;default:return f}}const a=Tye(r),u=Object.entries(o).map(([c,f])=>Ny({allowReserved:e,name:r==="deepObject"?`${n}[${c}]`:c,value:f})).join(a);return r==="label"||r==="matrix"?a+u:u},Oye=/\{[^{}]+\}/g,Mye=({path:e,url:t})=>{let n=t;const r=t.match(Oye);if(r)for(const o of r){let s=!1,a=o.substring(1,o.length-1),u="simple";a.endsWith("*")&&(s=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),u="label"):a.startsWith(";")&&(a=a.substring(1),u="matrix");const c=e[a];if(c==null)continue;if(Array.isArray(c)){n=n.replace(o,Iz({explode:s,name:a,style:u,value:c}));continue}if(typeof c=="object"){n=n.replace(o,Rz({explode:s,name:a,style:u,value:c,valueOnly:!0}));continue}if(u==="matrix"){n=n.replace(o,`;${Ny({name:a,value:c})}`);continue}const f=encodeURIComponent(u==="label"?`.${c}`:c);n=n.replace(o,f)}return n},Pye=({baseUrl:e,path:t,query:n,querySerializer:r,url:o})=>{const s=o.startsWith("/")?o:`/${o}`;let a=(e??"")+s;t&&(a=Mye({path:t,url:a}));let u=n?r(n):"";return u.startsWith("?")&&(u=u.substring(1)),u&&(a+=`?${u}`),a};function tU(e){const t=e.body!==void 0;if(t&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}const Nye=async(e,t)=>{const n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},Tz=({parameters:e={},...t}={})=>r=>{const o=[];if(r&&typeof r=="object")for(const s in r){const a=r[s];if(a==null)continue;const u=e[s]||t;if(Array.isArray(a)){const c=Iz({allowReserved:u.allowReserved,explode:!0,name:s,style:"form",value:a,...u.array});c&&o.push(c)}else if(typeof a=="object"){const c=Rz({allowReserved:u.allowReserved,explode:!0,name:s,style:"deepObject",value:a,...u.object});c&&o.push(c)}else{const c=Ny({allowReserved:u.allowReserved,name:s,value:a});c&&o.push(c)}}return o.join("&")},kye=e=>{if(!e)return"stream";const t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(n=>t.startsWith(n)))return"blob";if(t.startsWith("text/"))return"text"}},Dye=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):!1;async function Lye(e){for(const t of e.security??[]){if(Dye(e,t.name))continue;const n=await Nye(t,e.auth);if(!n)continue;const r=t.name??"Authorization";switch(t.in){case"query":e.query||(e.query={}),e.query[r]=n;break;case"cookie":e.headers.append("Cookie",`${r}=${n}`);break;default:e.headers.set(r,n);break}}}const nU=e=>Pye({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Tz(e.querySerializer),url:e.url}),rU=(e,t)=>{const n={...e,...t};return n.baseUrl?.endsWith("/")&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=Oz(e.headers,t.headers),n},Uye=e=>{const t=[];return e.forEach((n,r)=>{t.push([r,n])}),t},Oz=(...e)=>{const t=new Headers;for(const n of e){if(!n)continue;const r=n instanceof Headers?Uye(n):Object.entries(n);for(const[o,s]of r)if(s===null)t.delete(o);else if(Array.isArray(s))for(const a of s)t.append(o,a);else s!==void 0&&t.set(o,typeof s=="object"?JSON.stringify(s):s)}return t};class ME{fns=[];clear(){this.fns=[]}eject(t){const n=this.getInterceptorIndex(t);this.fns[n]&&(this.fns[n]=null)}exists(t){const n=this.getInterceptorIndex(t);return!!this.fns[n]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,n){const r=this.getInterceptorIndex(t);return this.fns[r]?(this.fns[r]=n,t):!1}use(t){return this.fns.push(t),this.fns.length-1}}const Fye=()=>({error:new ME,request:new ME,response:new ME}),$ye=Tz({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),zye={"Content-Type":"application/json"},Mz=(e={})=>({...xye,headers:zye,parseAs:"auto",querySerializer:$ye,...e}),jye=(e={})=>{let t=rU(Mz(),e);const n=()=>({...t}),r=h=>(t=rU(t,h),n()),o=Fye(),s=async h=>{const g={...t,...h,fetch:h.fetch??t.fetch??globalThis.fetch,headers:Oz(t.headers,h.headers),serializedBody:void 0};g.security&&await Lye(g),g.requestValidator&&await g.requestValidator(g),g.body!==void 0&&g.bodySerializer&&(g.serializedBody=g.bodySerializer(g.body)),(g.body===void 0||g.serializedBody==="")&&g.headers.delete("Content-Type");const m=g,v=nU(m);return{opts:m,url:v}},a=async h=>{const g=h.throwOnError??t.throwOnError,m=h.responseStyle??t.responseStyle;let v,w;try{const{opts:S,url:C}=await s(h),E={redirect:"follow",...S,body:tU(S)};v=new Request(C,E);for(const M of o.request.fns)M&&(v=await M(v,S));const A=S.fetch;w=await A(v);for(const M of o.response.fns)M&&(w=await M(w,v,S));const I={request:v,response:w};if(w.ok){const M=(S.parseAs==="auto"?kye(w.headers.get("Content-Type")):S.parseAs)??"json";if(w.status===204||w.headers.get("Content-Length")==="0"){let k;switch(M){case"arrayBuffer":case"blob":case"text":k=await w[M]();break;case"formData":k=new FormData;break;case"stream":k=w.body;break;default:k={};break}return S.responseStyle==="data"?k:{data:k,...I}}let R;switch(M){case"arrayBuffer":case"blob":case"formData":case"text":R=await w[M]();break;case"json":{const k=await w.text();R=k?JSON.parse(k):{};break}case"stream":return S.responseStyle==="data"?w.body:{data:w.body,...I}}return M==="json"&&(S.responseValidator&&await S.responseValidator(R),S.responseTransformer&&(R=await S.responseTransformer(R))),S.responseStyle==="data"?R:{data:R,...I}}const T=await w.text();let N;try{N=JSON.parse(T)}catch{}throw N??T}catch(S){let C=S;for(const E of o.error.fns)E&&(C=await E(C,w,v,h));if(C=C||{},g)throw C;return m==="data"?void 0:{error:C,request:v,response:w}}},u=h=>g=>a({...g,method:h}),c=h=>async g=>{const{opts:m,url:v}=await s(g);return Aye({...m,body:m.body,method:h,onRequest:async(w,S)=>{let C=new Request(w,S);for(const E of o.request.fns)E&&(C=await E(C,m));return C},serializedBody:tU(m),url:v})};return{buildUrl:h=>nU({...t,...h}),connect:u("CONNECT"),delete:u("DELETE"),get:u("GET"),getConfig:n,head:u("HEAD"),interceptors:o,options:u("OPTIONS"),patch:u("PATCH"),post:u("POST"),put:u("PUT"),request:a,setConfig:r,sse:{connect:c("CONNECT"),delete:c("DELETE"),get:c("GET"),head:c("HEAD"),options:c("OPTIONS"),patch:c("PATCH"),post:c("POST"),put:c("PUT"),trace:c("TRACE")},trace:u("TRACE")}},le=jye(Mz({baseUrl:"https://api.remit.example.com"}));let oU=!1;const Bye=e=>{oU||(le.interceptors.request.use(async t=>{const n=await e.getToken();return n&&t.headers.set("Authorization",`Bearer ${n}`),t}),oU=!0)},Hye=({children:e})=>O.jsx(O.Fragment,{children:e}),qye={configure:()=>{},getToken:async()=>null,resetToken:()=>{},Shell:Hye,Account:({fallback:e=null})=>O.jsx(O.Fragment,{children:e})},Pz=_.createContext(qye),Vye=Pz.Provider,Wye=()=>_.useContext(Pz),Wm=new Set;let Gm=!1;const fR=()=>{if(!Gm){Gm=!0;for(const e of Wm)e(!0)}},Gye=()=>Gm,Kye=e=>(Wm.add(e),()=>{Wm.delete(e)}),sU=()=>{Gm=!1;for(const e of Wm)e(!1)},hR=(e,t)=>{if(ey(e)){fR();return}pre(e,t)&&ju(e)},Zye=(e,t)=>{hR(e,t.meta)},Yye=(e,t,n,r)=>{hR(e,r.meta)},gx=e=>new TextEncoder().encode(e),Nz={},mx={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),Nz[e]=t,mx[t]=e}function Qye(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(r in mx)t[n/2]=mx[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return t}function Fa(e){let t="";for(let n=0;n<e.byteLength;n++)t+=Nz[e[n]];return t}const Nf=e=>e instanceof Uint8Array?e:typeof e=="string"?gx(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),Xye=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";class Us{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const n=new Us({...t,headers:{...t.headers}});return n.query&&(n.query=Jye(n.query)),n}static isInstance(t){if(!t)return!1;const n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return Us.clone(this)}}function Jye(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}class kf{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const n=t;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}const iU=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},$a=e=>encodeURIComponent(e).replace(/[!'()*]/g,ebe),ebe=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function pR(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=$a(n),Array.isArray(r))for(let o=0,s=r.length;o<s;o++)t.push(`${n}=${$a(r[o])}`);else{let o=n;(r||typeof r=="string")&&(o+=`=${$a(r)}`),t.push(o)}}return t.join("&")}const dg="[aws-rum-web:unknown.unknown]";class pe{static configure(t){pe.debugEnabled=t}static getCallerInfo(){var t,n;try{const r=new Error().stack;if(!r)return dg;const o=r.split(`
|
|
93
|
+
`);try{Q=JSON.parse(ue),ae=!0}catch{Q=ue}}ae&&(o&&await o(Q),r&&(Q=await r(Q))),n?.({data:Q,event:B,id:g,retry:S}),he.length&&(yield Q)}}}finally{E.removeEventListener("abort",L),R.releaseLock()}break}catch(I){if(t?.(I),a!==void 0&&C>=a)break;const T=Math.min(S*2**(C-1),u??3e4);await m(T)}}}()}}const Iye=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Rye=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Tye=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Iz=({allowReserved:e,explode:t,name:n,style:r,value:o})=>{if(!t){const u=(e?o:o.map(c=>encodeURIComponent(c))).join(Rye(r));switch(r){case"label":return`.${u}`;case"matrix":return`;${n}=${u}`;case"simple":return u;default:return`${n}=${u}`}}const s=Iye(r),a=o.map(u=>r==="label"||r==="simple"?e?u:encodeURIComponent(u):Ny({allowReserved:e,name:n,value:u})).join(s);return r==="label"||r==="matrix"?s+a:a},Ny=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Rz=({allowReserved:e,explode:t,name:n,style:r,value:o,valueOnly:s})=>{if(o instanceof Date)return s?o.toISOString():`${n}=${o.toISOString()}`;if(r!=="deepObject"&&!t){let c=[];Object.entries(o).forEach(([h,g])=>{c=[...c,h,e?g:encodeURIComponent(g)]});const f=c.join(",");switch(r){case"form":return`${n}=${f}`;case"label":return`.${f}`;case"matrix":return`;${n}=${f}`;default:return f}}const a=Tye(r),u=Object.entries(o).map(([c,f])=>Ny({allowReserved:e,name:r==="deepObject"?`${n}[${c}]`:c,value:f})).join(a);return r==="label"||r==="matrix"?a+u:u},Oye=/\{[^{}]+\}/g,Mye=({path:e,url:t})=>{let n=t;const r=t.match(Oye);if(r)for(const o of r){let s=!1,a=o.substring(1,o.length-1),u="simple";a.endsWith("*")&&(s=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),u="label"):a.startsWith(";")&&(a=a.substring(1),u="matrix");const c=e[a];if(c==null)continue;if(Array.isArray(c)){n=n.replace(o,Iz({explode:s,name:a,style:u,value:c}));continue}if(typeof c=="object"){n=n.replace(o,Rz({explode:s,name:a,style:u,value:c,valueOnly:!0}));continue}if(u==="matrix"){n=n.replace(o,`;${Ny({name:a,value:c})}`);continue}const f=encodeURIComponent(u==="label"?`.${c}`:c);n=n.replace(o,f)}return n},Pye=({baseUrl:e,path:t,query:n,querySerializer:r,url:o})=>{const s=o.startsWith("/")?o:`/${o}`;let a=(e??"")+s;t&&(a=Mye({path:t,url:a}));let u=n?r(n):"";return u.startsWith("?")&&(u=u.substring(1)),u&&(a+=`?${u}`),a};function tU(e){const t=e.body!==void 0;if(t&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}const Nye=async(e,t)=>{const n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},Tz=({parameters:e={},...t}={})=>r=>{const o=[];if(r&&typeof r=="object")for(const s in r){const a=r[s];if(a==null)continue;const u=e[s]||t;if(Array.isArray(a)){const c=Iz({allowReserved:u.allowReserved,explode:!0,name:s,style:"form",value:a,...u.array});c&&o.push(c)}else if(typeof a=="object"){const c=Rz({allowReserved:u.allowReserved,explode:!0,name:s,style:"deepObject",value:a,...u.object});c&&o.push(c)}else{const c=Ny({allowReserved:u.allowReserved,name:s,value:a});c&&o.push(c)}}return o.join("&")},kye=e=>{if(!e)return"stream";const t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(n=>t.startsWith(n)))return"blob";if(t.startsWith("text/"))return"text"}},Dye=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):!1;async function Lye(e){for(const t of e.security??[]){if(Dye(e,t.name))continue;const n=await Nye(t,e.auth);if(!n)continue;const r=t.name??"Authorization";switch(t.in){case"query":e.query||(e.query={}),e.query[r]=n;break;case"cookie":e.headers.append("Cookie",`${r}=${n}`);break;default:e.headers.set(r,n);break}}}const nU=e=>Pye({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Tz(e.querySerializer),url:e.url}),rU=(e,t)=>{const n={...e,...t};return n.baseUrl?.endsWith("/")&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=Oz(e.headers,t.headers),n},Uye=e=>{const t=[];return e.forEach((n,r)=>{t.push([r,n])}),t},Oz=(...e)=>{const t=new Headers;for(const n of e){if(!n)continue;const r=n instanceof Headers?Uye(n):Object.entries(n);for(const[o,s]of r)if(s===null)t.delete(o);else if(Array.isArray(s))for(const a of s)t.append(o,a);else s!==void 0&&t.set(o,typeof s=="object"?JSON.stringify(s):s)}return t};class ME{fns=[];clear(){this.fns=[]}eject(t){const n=this.getInterceptorIndex(t);this.fns[n]&&(this.fns[n]=null)}exists(t){const n=this.getInterceptorIndex(t);return!!this.fns[n]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,n){const r=this.getInterceptorIndex(t);return this.fns[r]?(this.fns[r]=n,t):!1}use(t){return this.fns.push(t),this.fns.length-1}}const Fye=()=>({error:new ME,request:new ME,response:new ME}),$ye=Tz({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),zye={"Content-Type":"application/json"},Mz=(e={})=>({...xye,headers:zye,parseAs:"auto",querySerializer:$ye,...e}),jye=(e={})=>{let t=rU(Mz(),e);const n=()=>({...t}),r=h=>(t=rU(t,h),n()),o=Fye(),s=async h=>{const g={...t,...h,fetch:h.fetch??t.fetch??globalThis.fetch,headers:Oz(t.headers,h.headers),serializedBody:void 0};g.security&&await Lye(g),g.requestValidator&&await g.requestValidator(g),g.body!==void 0&&g.bodySerializer&&(g.serializedBody=g.bodySerializer(g.body)),(g.body===void 0||g.serializedBody==="")&&g.headers.delete("Content-Type");const m=g,v=nU(m);return{opts:m,url:v}},a=async h=>{const g=h.throwOnError??t.throwOnError,m=h.responseStyle??t.responseStyle;let v,w;try{const{opts:S,url:C}=await s(h),E={redirect:"follow",...S,body:tU(S)};v=new Request(C,E);for(const M of o.request.fns)M&&(v=await M(v,S));const A=S.fetch;w=await A(v);for(const M of o.response.fns)M&&(w=await M(w,v,S));const I={request:v,response:w};if(w.ok){const M=(S.parseAs==="auto"?kye(w.headers.get("Content-Type")):S.parseAs)??"json";if(w.status===204||w.headers.get("Content-Length")==="0"){let k;switch(M){case"arrayBuffer":case"blob":case"text":k=await w[M]();break;case"formData":k=new FormData;break;case"stream":k=w.body;break;default:k={};break}return S.responseStyle==="data"?k:{data:k,...I}}let R;switch(M){case"arrayBuffer":case"blob":case"formData":case"text":R=await w[M]();break;case"json":{const k=await w.text();R=k?JSON.parse(k):{};break}case"stream":return S.responseStyle==="data"?w.body:{data:w.body,...I}}return M==="json"&&(S.responseValidator&&await S.responseValidator(R),S.responseTransformer&&(R=await S.responseTransformer(R))),S.responseStyle==="data"?R:{data:R,...I}}const T=await w.text();let N;try{N=JSON.parse(T)}catch{}throw N??T}catch(S){let C=S;for(const E of o.error.fns)E&&(C=await E(C,w,v,h));if(C=C||{},g)throw C;return m==="data"?void 0:{error:C,request:v,response:w}}},u=h=>g=>a({...g,method:h}),c=h=>async g=>{const{opts:m,url:v}=await s(g);return Aye({...m,body:m.body,method:h,onRequest:async(w,S)=>{let C=new Request(w,S);for(const E of o.request.fns)E&&(C=await E(C,m));return C},serializedBody:tU(m),url:v})};return{buildUrl:h=>nU({...t,...h}),connect:u("CONNECT"),delete:u("DELETE"),get:u("GET"),getConfig:n,head:u("HEAD"),interceptors:o,options:u("OPTIONS"),patch:u("PATCH"),post:u("POST"),put:u("PUT"),request:a,setConfig:r,sse:{connect:c("CONNECT"),delete:c("DELETE"),get:c("GET"),head:c("HEAD"),options:c("OPTIONS"),patch:c("PATCH"),post:c("POST"),put:c("PUT"),trace:c("TRACE")},trace:u("TRACE")}},le=jye(Mz({baseUrl:"https://api.remit.example.com"}));let oU=!1;const Bye=e=>{oU||(le.interceptors.request.use(async t=>{const n=await e.getToken();return n&&t.headers.set("Authorization",`Bearer ${n}`),t}),oU=!0)},Hye=({children:e})=>O.jsx(O.Fragment,{children:e}),qye={configure:()=>{},getToken:async()=>null,resetToken:()=>{},Shell:Hye,Account:({fallback:e=null})=>O.jsx(O.Fragment,{children:e})},Pz=_.createContext(qye),Vye=Pz.Provider,Wye=()=>_.useContext(Pz),Wm=new Set;let Gm=!1;const fR=()=>{if(!Gm){Gm=!0;for(const e of Wm)e(!0)}},Gye=()=>Gm,Kye=e=>(Wm.add(e),()=>{Wm.delete(e)}),sU=()=>{Gm=!1;for(const e of Wm)e(!1)},hR=(e,t)=>{if(ey(e)){fR();return}fre(e,t)&&ju(e)},Zye=(e,t)=>{hR(e,t.meta)},Yye=(e,t,n,r)=>{hR(e,r.meta)},gx=e=>new TextEncoder().encode(e),Nz={},mx={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),Nz[e]=t,mx[t]=e}function Qye(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(r in mx)t[n/2]=mx[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return t}function Fa(e){let t="";for(let n=0;n<e.byteLength;n++)t+=Nz[e[n]];return t}const Nf=e=>e instanceof Uint8Array?e:typeof e=="string"?gx(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),Xye=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";class Us{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const n=new Us({...t,headers:{...t.headers}});return n.query&&(n.query=Jye(n.query)),n}static isInstance(t){if(!t)return!1;const n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return Us.clone(this)}}function Jye(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}class kf{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const n=t;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}const iU=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},$a=e=>encodeURIComponent(e).replace(/[!'()*]/g,ebe),ebe=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function pR(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=$a(n),Array.isArray(r))for(let o=0,s=r.length;o<s;o++)t.push(`${n}=${$a(r[o])}`);else{let o=n;(r||typeof r=="string")&&(o+=`=${$a(r)}`),t.push(o)}}return t.join("&")}const dg="[aws-rum-web:unknown.unknown]";class pe{static configure(t){pe.debugEnabled=t}static getCallerInfo(){var t,n;try{const r=new Error().stack;if(!r)return dg;const o=r.split(`
|
|
94
94
|
`);if(o.length<4)return dg;const s=o[3];if(!s)return dg;const a=s.match(/at (?:(.+?)\s+\()?/);if(a&&a.length>=2){const u=a[1].trim(),c=u.split(".");if(c.length>=2){const f=(t=c[c.length-2])!==null&&t!==void 0?t:"unknown",h=(n=c[c.length-1])!==null&&n!==void 0?n:"unknown";return`[aws-rum-web:${f}.${h}]`}return`[aws-rum-web:${u}]`}}catch{}return dg}static info(t,...n){if(!pe.debugEnabled)return;const r=this.getCallerInfo();console.info(r,t,...n)}static debug(t,...n){if(!pe.debugEnabled)return;const r=this.getCallerInfo();console.debug(r,t,...n)}static warn(t,...n){if(!pe.debugEnabled)return;const r=this.getCallerInfo();console.warn(r,t,...n)}static error(t,...n){if(!pe.debugEnabled)return;const r=this.getCallerInfo();console.error(r,t,...n)}}pe.debugEnabled=!1;const aU=2048,lU=.2,tbe=()=>typeof CompressionStream<"u",nbe=async e=>{const t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())},rbe=async e=>{const t=e.length;if(pe.debug(`compressIfBeneficial called, payload size: ${t}B`),!tbe())return pe.debug("CompressionStream not supported, skipping compression"),{body:e,compressed:!1};if(t<aU)return pe.debug(`Payload size ${t}B below threshold ${aU}B, skipping compression`),{body:e,compressed:!1};const n=await nbe(e),r=1-n.length/t;return r>=lU?(pe.debug(`Compressed ${t}B -> ${n.length}B (${(r*100).toFixed(1)}% reduction)`),{body:n,compressed:!0}):(pe.debug(`Compression ratio ${(r*100).toFixed(1)}% below threshold ${lU*100}%, skipping`),{body:e,compressed:!1})},obe="POST",sbe="application/json",ibe="text/plain;charset=UTF-8",abe=64e3;class lbe{constructor(t,n){this.sendFetch=async r=>{var o,s;const a=JSON.stringify(uU(r)),u=(s=(o=this.config.compressionStrategy)===null||o===void 0?void 0:o.enabled)!==null&&s!==void 0?s:!1,{body:c,compressed:f}=u?await rbe(a):{body:a,compressed:!1},h=await this.getHttpRequestOptions(r,c,sbe,f);let g=new Us(h);return this.signing&&(g=await this.signing.sign(g)),this.config.fetchRequestHandler.handle(g)},this.sendBeacon=async r=>{const o=JSON.stringify(uU(r));if(o.length>abe)throw new Error("Payload too large for sendBeacon");const s=await this.getHttpRequestOptions(r,o,ibe,!1);let a=new Us(s);return this.signing&&(a=await this.signing.presign(a)),this.config.beaconRequestHandler.handle(a)},this.getHttpRequestOptions=async(r,o,s,a)=>{const u=this.config.endpoint.pathname.replace(/\/$/,""),c=Object.assign({"content-type":s,host:this.config.endpoint.host},this.config.headers);a&&(c["Content-Encoding"]="gzip");const f={method:obe,protocol:this.config.endpoint.protocol,port:Number(this.config.endpoint.port)||void 0,headers:c,hostname:this.config.endpoint.hostname,path:`${u}/appmonitors/${r.AppMonitorDetails.id}`,body:o};return this.signing?Object.assign(Object.assign({},f),{headers:Object.assign(Object.assign({},f.headers),{"X-Amz-Content-Sha256":await this.signing.hashAndEncode(o)})}):f},this.config=t,this.signing=n}}const uU=e=>{const t=[];e.RumEvents.forEach(r=>t.push(ube(r)));let n={BatchId:e.BatchId,AppMonitorDetails:e.AppMonitorDetails,UserDetails:e.UserDetails,RumEvents:t};return e.SessionMetadata&&(n=Object.assign(Object.assign({},n),{SessionMetadata:e.SessionMetadata})),e.Alias&&(n=Object.assign(Object.assign({},n),{Alias:e.Alias})),n},ube=e=>({id:e.id,timestamp:Math.round(e.timestamp.getTime()/1e3),type:e.type,metadata:e.metadata,details:e.details});class cbe{handle(t){const n=this.sendBeacon(t);return new Promise((r,o)=>{n?r({response:new kf({statusCode:200})}):o()})}updateHttpClientConfig(t,n){}httpHandlerConfigs(){return{}}sendBeacon(t){let n=t.path;if(t.query){const s=pR(t.query);s&&(n+=`?${s}`)}const{port:r}=t,o=`${t.protocol}//${t.hostname}${r?`:${r}`:""}${n}`;return navigator.sendBeacon(o,t.body)}}const dbe=(e=0)=>new Promise((t,n)=>{e&&setTimeout(()=>{const r=new Error(`Request did not complete within ${e} ms`);r.name="TimeoutError",n(r)},e)});let fbe=class{constructor({fetchFunction:t,requestTimeout:n}={}){this.requestTimeout=n,this.fetchFunction=t}destroy(){}handle(t,{abortSignal:n}={}){const r=this.requestTimeout;if(n?.aborted){const m=new Error("Request aborted");return m.name="AbortError",Promise.reject(m)}let o=t.path;if(t.query){const m=pR(t.query);m&&(o+=`?${m}`)}const{port:s,method:a}=t,u=`${t.protocol}//${t.hostname}${s?`:${s}`:""}${o}`,f={body:a==="GET"||a==="HEAD"?void 0:t.body,headers:new Headers(t.headers),method:a};typeof AbortController<"u"&&(f.signal=n);const h=new Request(u,f),g=[this.fetchFunction.apply(window,[h]).then(m=>{const v=m.headers,w={};for(const C of v.entries())w[C[0]]=C[1];return m.body!==void 0?{response:new kf({headers:w,statusCode:m.status,body:m.body})}:m.blob().then(C=>({response:new kf({headers:w,statusCode:m.status,body:C})}))}),dbe(r)];return n&&g.push(new Promise((m,v)=>{n.onabort=()=>{const w=new Error("Request aborted");w.name="AbortError",v(w)}})),Promise.race(g)}updateHttpClientConfig(t,n){}httpHandlerConfigs(){return{}}};const gR=e=>{if(crypto)return crypto.getRandomValues(e);if(msCrypto)return msCrypto.getRandomValues(e);throw new Error("No crypto library found.")},kz=[];for(let e=0;e<256;e++)kz[e]=(e+256).toString(16).substr(1);const ky="X-Amzn-Trace-Id",Dy="traceparent",hbe=2,pbe=32,gbe=16,mbe=4,Dz=(e,t)=>Array.isArray(t)?t.some(n=>n.test(e)):t,Lz={logicalServiceName:"rum.aws.amazon.com",urlsToInclude:[/.*/],urlsToExclude:[/cognito\-identity\.([^\.]*\.)?amazonaws\.com/,/sts\.([^\.]*\.)?amazonaws\.com/],stackTraceLength:200,recordAllRequests:!1,addXRayTraceIdHeader:!1},vbe=e=>200<=e&&e<300,Uz=e=>Math.floor(e/100)===4,mR=e=>Math.floor(e/100)===5,vR=e=>e===429,Fz=(e,t)=>{const n=t.urlsToInclude.some(o=>o.test(e)),r=t.urlsToExclude.some(o=>o.test(e));return n&&!r},_u=()=>Date.now()/1e3,ybe=(e,t,n)=>{const r={request:{}};return r.request.method=t?.method?t.method:"GET",r.request.traced=n,r.request.url=pm(e),r},$z=(e,t,n,r)=>({version:"1.0.0",name:e,origin:"AWS::RUM::AppMonitor",id:Bz(),start_time:t,trace_id:n?_be():Ebe(),end_time:void 0,subsegments:[],in_progress:!1}),zz=(e,t,n)=>{const r={id:Bz(),name:e,start_time:t,end_time:void 0,in_progress:!1,namespace:e.endsWith(".amazonaws.com")?"aws":"remote"};return n&&(r.http=n),r},jz=e=>{try{return e.hostname?e.hostname:e.url?new URL(e.url).hostname:new URL(e.toString()).hostname}catch{return window.location.hostname}},bbe=(e,t,n,r)=>{e.headers||(e.headers={}),r?e.headers[Dy]=bR(t,n):e.headers[ky]=yR(t,n)},Sbe=(e,t,n,r)=>{r?e.set(Dy,bR(t,n)):e.set(ky,yR(t,n))},yR=(e,t)=>"Root="+e+";Parent="+t+";Sampled=1",bR=(e,t)=>"00-"+e+"-"+t+"-01",wbe=e=>e?.length===mbe&&e[0].length===hbe&&e[1].length===pbe&&e[2].length===gbe&&(e[3]==="00"||e[3]==="01"),Cbe=(e,t)=>{var n,r;const o={};if(e)if(t){const s=(n=e.get(Dy))===null||n===void 0?void 0:n.split("-");s&&wbe(s)&&(o.traceId=s[1],o.segmentId=s[2])}else{const s=(r=e.get(ky))===null||r===void 0?void 0:r.split(";");s?.length===3&&(o.traceId=s[0].split("Root=")[1],o.segmentId=s[1].split("Parent=")[1])}return o},pm=e=>e.url?e.url:e.toString(),Ebe=()=>`1-${xbe()}-${Abe()}`,_be=()=>{const e=new Uint8Array(16);return gR(e),`${SR(e)}`},Bz=()=>{const e=new Uint8Array(8);return gR(e),SR(e)},xbe=()=>Math.floor(Date.now()/1e3).toString(16),Abe=()=>{const e=new Uint8Array(12);return gR(e),SR(e)},SR=e=>{let t="";for(let n=0;n<e.length;n++)t+=kz[e[n]];return t};class Ibe{constructor(t,n,r=o=>2e3*Math.pow(2,o-1)){this.handler=t,this.retries=n,this.backoff=r}async handle(t){let n=this.retries;for(;;)try{const r=await this.handler.handle(t);if(vbe(r.response.statusCode))return r;throw r.response.statusCode}catch(r){if(typeof r=="number"&&!vR(r)&&!mR(r))throw new Error(`${r}`);if(n<=0)throw r;n--,await this.sleep(this.backoff(this.retries-n))}}async sleep(t){return new Promise(n=>setTimeout(n,t))}updateHttpClientConfig(t,n){}httpHandlerConfigs(){return{}}}const Wu="cwr_c",Km="cwr_i",Zm="cwr_s",Ym="cwr_u",Rbe=3e4,Tbe="arw-module",cU="CWR: Cannot dispatch; no AWS credentials.";class Obe{constructor(t,n,r,o,s){this.disableCodes=["403","404"],this.shouldPurgeCredentials=!0,this.dispatchFetch=async()=>{if(this.doRequest()){const a=this.createRequest();return pe.info(`Dispatching ${a.RumEvents.length} events via fetch`),this.rum.sendFetch(a).catch(this.handleReject)}},this.dispatchBeacon=async()=>{if(this.doRequest()){const a=this.createRequest();return pe.info(`Dispatching ${a.RumEvents.length} events via beacon`),this.rum.sendBeacon(a).catch(()=>this.rum.sendFetch(a))}},this.dispatchFetchFailSilent=async()=>this.dispatchFetch().catch(a=>{pe.error("Dispatch fetch failed silently:",a)}),this.dispatchBeaconFailSilent=async()=>this.dispatchBeacon().catch(a=>{pe.error("Dispatch beacon failed silently:",a)}),this.flushSync=()=>{if(document.visibilityState==="hidden"&&this.doRequest(!0)){let a=this.rum.sendBeacon,u=this.rum.sendFetch;this.config.useBeacon||([a,u]=[u,a]);const c=this.createRequest(!0);pe.debug(`Flushing ${c.RumEvents.length} events on page hide`),a(c).catch(()=>u(c)).catch(f=>{pe.error("Page hide flush failed:",f)})}},this.handleReject=a=>{throw a instanceof Error&&(a.message==="403"&&this.config.signing&&this.shouldPurgeCredentials?(this.shouldPurgeCredentials=!1,this.forceRebuildClient()):this.disableCodes.includes(a.message)&&(pe.error("Dispatch failed with status code:",a.message),this.disable())),a},this.defaultClientBuilder=(a,u,c,f)=>{const h=c&&this.signingConfigFactory?this.signingConfigFactory(c,u):void 0;return new lbe({fetchRequestHandler:new Ibe(new fbe({fetchFunction:this.config.fetchFunction}),this.config.retries),beaconRequestHandler:new cbe,endpoint:a,region:u,credentials:c,headers:this.headers,compressionStrategy:f},h)},this.applicationId=t,this.region=n,this.endpoint=r,this.eventCache=o,this.enabled=!0,this.buildClient=s.clientBuilder||this.defaultClientBuilder,this.config=s,this.headers=s.headers,this.startDispatchTimer(),s.signing?this.rum={sendFetch:()=>Promise.reject(new Error(cU)),sendBeacon:()=>Promise.reject(new Error(cU))}:this.rum=this.buildClient(this.endpoint,this.region,void 0,this.config.compressionStrategy),this.credentialStorageKey=this.config.cookieAttributes.unique?`${Wu}_${t}`:Wu,this.identityStorageKey=this.config.cookieAttributes.unique?`${Km}_${t}`:Km}enable(){this.enabled=!0,this.startDispatchTimer()}disable(){this.stopDispatchTimer(),this.enabled=!1,pe.warn("Dispatch disabled")}setAwsCredentials(t){this.credentialProvider=t,this.rum=this.buildClient(this.endpoint,this.region,t,this.config.compressionStrategy),typeof t=="function"&&t()}setCognitoCredentialProviderFactory(t){this.cognitoCredentialProviderFactory=t}setSigningConfigFactory(t){this.signingConfigFactory=t}setCognitoCredentials(t,n){this.identityPoolId=t,this.guestRoleArn=n,this.cognitoCredentialProviderFactory&&this.setAwsCredentials(this.cognitoCredentialProviderFactory(this.config,this.applicationId,t,n))}startDispatchTimer(){document.addEventListener("visibilitychange",this.flushSync),document.addEventListener("pagehide",this.flushSync),!(this.config.dispatchInterval<=0||this.dispatchTimerId)&&(this.dispatchTimerId=window.setInterval(this.dispatchFetchFailSilent,this.config.dispatchInterval))}stopDispatchTimer(){document.removeEventListener("visibilitychange",this.flushSync),document.removeEventListener("pagehide",this.flushSync),this.dispatchTimerId&&(window.clearInterval(this.dispatchTimerId),this.dispatchTimerId=void 0)}doRequest(t=!1){return this.enabled?t&&this.eventCache.hasCandidates()?!0:this.eventCache.hasEvents():!1}createRequest(t=!1){return{BatchId:Ou(),AppMonitorDetails:this.eventCache.getAppMonitorDetails(),UserDetails:this.eventCache.getUserDetails(),SessionMetadata:JSON.stringify(this.eventCache.getCommonMetadata()),RumEvents:this.eventCache.getEventBatch(t),Alias:this.config.alias}}forceRebuildClient(){pe.warn("Removing credentials from local storage"),localStorage.removeItem(this.credentialStorageKey),this.identityPoolId?(pe.info("Rebuilding client with fresh cognito credentials"),localStorage.removeItem(this.identityStorageKey),this.setCognitoCredentials(this.identityPoolId,this.guestRoleArn)):this.credentialProvider&&(pe.info("Rebuilding client with most recently passed provider"),this.setAwsCredentials(this.credentialProvider))}}const Hz={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),Hz[e]=t}function Mbe(e){let t="";for(let n=0;n<e.byteLength;n++)t+=Hz[e[n]];return t}class Pbe{format(t){const n=[];for(const s of Object.keys(t)){const a=gx(s);n.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(t[s]))}const r=new Uint8Array(n.reduce((s,a)=>s+a.byteLength,0));let o=0;for(const s of n)r.set(s,o),o+=s.byteLength;return r}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?Vr.boolTrue:Vr.boolFalse]);case"byte":return Uint8Array.from([Vr.byte,t.value]);case"short":const n=new DataView(new ArrayBuffer(3));return n.setUint8(0,Vr.short),n.setInt16(1,t.value,!1),new Uint8Array(n.buffer);case"integer":const r=new DataView(new ArrayBuffer(5));return r.setUint8(0,Vr.integer),r.setInt32(1,t.value,!1),new Uint8Array(r.buffer);case"long":const o=new Uint8Array(9);return o[0]=Vr.long,o.set(t.value.bytes,1),o;case"binary":const s=new DataView(new ArrayBuffer(3+t.value.byteLength));s.setUint8(0,Vr.byteArray),s.setUint16(1,t.value.byteLength,!1);const a=new Uint8Array(s.buffer);return a.set(t.value,3),a;case"string":const u=gx(t.value),c=new DataView(new ArrayBuffer(3+u.byteLength));c.setUint8(0,Vr.string),c.setUint16(1,u.byteLength,!1);const f=new Uint8Array(c.buffer);return f.set(u,3),f;case"timestamp":const h=new Uint8Array(9);return h[0]=Vr.timestamp,h.set(wR.fromNumber(t.value.valueOf()).bytes,1),h;case"uuid":if(!Nbe.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const g=new Uint8Array(17);return g[0]=Vr.uuid,g.set(Qye(t.value.replace(/-/g,"")),1),g}}}var Vr;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(Vr||(Vr={}));const Nbe=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class wR{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const n=new Uint8Array(8);for(let r=7,o=Math.abs(Math.round(t));r>-1&&o>0;r--,o/=256)n[r]=o;return t<0&&dU(n),new wR(n)}valueOf(){const t=this.bytes.slice(0),n=t[0]&128;return n&&dU(t),parseInt(Fa(t),16)*(n?-1:1)}toString(){return String(this.valueOf())}}function dU(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const kbe="X-Amz-Algorithm",Dbe="X-Amz-Credential",qz="X-Amz-Date",Lbe="X-Amz-SignedHeaders",Ube="X-Amz-Expires",Vz="X-Amz-Signature",Wz="X-Amz-Security-Token",Gz="authorization",Kz=qz.toLowerCase(),Fbe="date",$be=[Gz,Kz,Fbe],zbe=Vz.toLowerCase(),vx="x-amz-content-sha256",jbe=Wz.toLowerCase(),Bbe={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Hbe=/^proxy-/,qbe=/^sec-/,PE="AWS4-HMAC-SHA256",Vbe="AWS4-HMAC-SHA256-PAYLOAD",Wbe="UNSIGNED-PAYLOAD",Gbe=50,Zz="aws4_request",Kbe=3600*24*7,Zbe=({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===zbe)continue;const o=$a(r);t.push(o);const s=e[r];typeof s=="string"?n[o]=`${o}=${$a(s)}`:Array.isArray(s)&&(n[o]=s.slice(0).reduce((a,u)=>a.concat([`${o}=${$a(u)}`]),[]).sort().join("&"))}return t.sort().map(r=>n[r]).filter(r=>r).join("&")},Ybe=e=>Qbe(e).toISOString().replace(/\.\d{3}Z$/,"Z"),Qbe=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class Xbe{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:n,region:r,service:o,sha256:s,uriEscapePath:a=!0}){this.service=o,this.sha256=s,this.uriEscapePath=a,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=iU(r),this.credentialProvider=iU(n)}createCanonicalRequest(t,n,r){const o=Object.keys(n).sort();return`${t.method}
|
|
95
95
|
${this.getCanonicalPath(t)}
|
|
96
96
|
${Zbe(t)}
|
|
@@ -210,4 +210,4 @@ ${n.join(`
|
|
|
210
210
|
|
|
211
211
|
`)}return C.write("payload.value = newResult;"),C.write("return payload;"),C.compile()};let a;const u=vv,c=!So.jitless,h=c&&eRe.value,g=t.catchall;let m;e._zod.parse=(v,w)=>{m??(m=r.value);const S=v.value;return u(S)?c&&h&&w?.async===!1&&w.jitless!==!0?(a||(a=s(t.shape)),v=a(v,w),g?ZB([],S,v,w,m,e,w?.abortEarly===!0):v):n(v,w):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function Z6(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Rs(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(a=>Gi(a,r,Vo())))}),t)}const bOe=te("$ZodUnion",(e,t)=>{Zt.init(e,t),mt(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),mt(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),mt(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),mt(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){const o=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>sT(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const a=[];for(const u of t.options){const c=u._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(u=>Z6(u,r,e,o)):Z6(a,r,e,o)}}),SOe=te("$ZodIntersection",(e,t)=>{Zt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,f])=>Y6(n,c,f)):Y6(n,s,a)}});function mA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ec(e)&&ec(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const s of r){if(s==="__proto__")continue;const a=mA(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],a=mA(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Y6(e,t,n){const r=new Map;let o;const s=new Map,a=(f,h)=>{let g;if(f.code==="unrecognized_keys"&&!f.path?.length)o??(o=f),g=f.keys;else if(f.code==="invalid_key"&&f.origin==="record"&&f.path?.length===1){const m=String(f.path[0]);s.has(m)||s.set(m,f),g=[m]}else return!1;for(const m of g)r.has(m)||r.set(m,{}),r.get(m)[h]=!0;return!0};for(const f of t.issues)a(f,"l")||e.issues.push(f);for(const f of n.issues)a(f,"r")||e.issues.push(f);const u=[...r].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(u.length){const f=o?u.filter(h=>o.keys.includes(h)):[];f.length&&e.issues.push({...o,keys:f});for(const h of u)!f.includes(h)&&s.has(h)&&e.issues.push(s.get(h))}const c=mA(t.value,n.value);if(!c.valid){if(Rs(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const wOe=te("$ZodRecord",(e,t)=>{Zt.init(e,t);const n=So.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{const s=r.value;if(!ec(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const a=[],u=t.keyType._zod.values;if(u&&!t.partial){r.value=n?n.alloc(e,r,{},o):{};const c=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){if(c.add(typeof h=="number"?h.toString():h),h==="__proto__")continue;const g=t.keyType._zod.run({value:h,issues:[]},o);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(g.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(w=>Gi(w,o,Vo())),input:h,path:[h],inst:e});continue}const m=g.value;if(m==="__proto__")continue;const v=t.valueType._zod.run({value:s[h],issues:[]},o);v instanceof Promise?a.push(v.then(w=>{w.issues.length&&r.issues.push(...Tu(h,w.issues)),r.value[m]=w.value})):(v.issues.length&&r.issues.push(...Tu(h,v.issues)),r.value[m]=v.value)}let f;for(const h in s)if(!c.has(h))if(t.mode==="loose"){if(h==="__proto__")continue;r.value[h]=s[h]}else f=f??[],f.push(h);f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:f,continue:!0})}else{r.value=n?n.alloc(e,r,{},o):{};let c;for(const f of Reflect.ownKeys(s)){if(f==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,f))continue;let h=t.keyType._zod.run({value:f,issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&cT.test(f)&&h.issues.length){const w=t.keyType._zod.run({value:Number(f),issues:[]},o);if(w instanceof Promise)throw new Error("Async schemas not supported in object keys currently");w.issues.length===0&&(h=w)}if(h.issues.length){t.mode==="loose"?r.value[f]=s[f]:u?(c=c??[],c.push(f)):r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(w=>Gi(w,o,Vo())),input:f,path:[f],inst:e});continue}const m=h.value;if(m==="__proto__")continue;const v=t.valueType._zod.run({value:s[f],issues:[]},o);v instanceof Promise?a.push(v.then(w=>{w.issues.length&&r.issues.push(...Tu(f,w.issues)),r.value[m]=w.value})):(v.issues.length&&r.issues.push(...Tu(f,v.issues)),r.value[m]=v.value)}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}return a.length?Promise.all(a).then(()=>r):r}}),COe=te("$ZodEnum",(e,t)=>{Zt.init(e,t);const n=fA(t.entries),r=new Set(n);e._zod.values=r,mt(e,"pattern",o=>{const s=fA(o.def.entries).filter(a=>tRe.has(typeof a));return new RegExp(s.length?`^(${s.map(a=>tc(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,s)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),EOe=te("$ZodLiteral",(e,t)=>{Zt.init(e,t);const n=new Set(t.values);e._zod.values=n,mt(e,"pattern",r=>{const o=r.def.values;return new RegExp(o.length?`^(${o.map(s=>typeof s=="string"?tc(s):s?tc(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),_Oe=te("$ZodTransform",(e,t)=>{Zt.init(e,t),e._zod.optin="optional",So.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new NB(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new ja;return n.value=o,n}});function Q6(e,t){return e.value=t.issues.length?void 0:t.value,e}const YB=te("$ZodOptional",(e,t)=>{Zt.init(e,t),mt(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",mt(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),mt(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${sT(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>Q6(n,s)):Q6(n,o)}return t.innerType._zod.run(n,r)}}),xOe=te("$ZodExactOptional",(e,t)=>{YB.init(e,t),mt(e,"values",n=>n.def.innerType._zod.values),mt(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),AOe=te("$ZodNullable",(e,t)=>{Zt.init(e,t),mt(e,"optin",n=>n.def.innerType._zod.optin),mt(e,"optout",n=>n.def.innerType._zod.optout),mt(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${sT(r.source)}|null)$`):void 0}),mt(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),IOe=te("$ZodDefault",(e,t)=>{Zt.init(e,t),e._zod.optin="defaulted",mt(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>X6(s,t)):X6(o,t)}});function X6(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ROe=te("$ZodPrefault",(e,t)=>{Zt.init(e,t),e._zod.optin="defaulted",mt(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),TOe=te("$ZodNonOptional",(e,t)=>{Zt.init(e,t),mt(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>J6(s,e)):J6(o,e)}});function J6(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function e5(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Gi(o,r,Vo()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const OOe=te("$ZodCatch",(e,t)=>{Zt.init(e,t),mt(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),mt(e,"optout",n=>n.def.innerType._zod.optout),mt(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>e5(n,s,t,r)):e5(n,o,t,r)}}),MOe=te("$ZodPipe",(e,t)=>{Zt.init(e,t),mt(e,"values",n=>n.def.in._zod.values),mt(e,"optin",n=>n.def.in._zod.optin),mt(e,"optout",n=>n.def.out._zod.optout),mt(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(a=>$g(a,t.in,r)):$g(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>$g(s,t.out,r)):$g(o,t.out,r)}});function $g(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const POe=te("$ZodReadonly",(e,t)=>{Zt.init(e,t),mt(e,"propValues",n=>n.def.innerType._zod.propValues),mt(e,"values",n=>n.def.innerType._zod.values),mt(e,"optin",n=>n.def.innerType?._zod?.optin),mt(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t5):t5(o)}});function t5(e){return e.memo||(e.value=Object.freeze(e.value)),e}const NOe=te("$ZodCustom",(e,t)=>{mr.init(e,t),Zt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>n5(s,n,r,e));n5(o,n,r,e)}});function n5(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Wf(o))}}class kOe extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const vA="~memo",r5=[];function QB(e){return e!==null&&typeof e=="object"}function a_(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const XB=new WeakMap,Xd=0,wm=1,pf=2;function Cm(e,t,n){const r=XB.get(e);if(r!==void 0)return r?pf:Xd;if(t.has(e))return pf;t.add(e);let o=Xd;const s=h=>{if(o!==pf&&h?._zod){const g=Cm(h,t);g>o&&(o=g)}},a=(h,g)=>{let m=Xd;for(const v of Reflect.ownKeys(h)){const w=Object.getOwnPropertyDescriptor(h,v);if(!w.enumerable)continue;const S=w.get?wm:w.value?._zod?Cm(w.value,t):Xd;S>m&&(m=S)}return m},u=h=>{h>o&&(o=h)},c=e._zod.def;switch(c.type){case"object":{const h=EB(c);u(h?a(h):wm),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(const h of c.items)s(h);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(const h of c.options)s(h);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{const h=c._cachedInner??void 0;u(h?Cm(h,t):wm);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const h in c){const g=Object.getOwnPropertyDescriptor(c,h);if(!g||g.get)continue;const m=g.value;if(!(!m||typeof m!="object")){if(m._zod)s(m);else if(Array.isArray(m))for(const v of m)s(v)}}}return t.delete(e),DOe(e,o)}function DOe(e,t){return t!==wm&&XB.set(e,t===pf),t}function LOe(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let zg;const jg=[],UOe={alloc(e,t,n){const r=zg;if(!r)return n;zg=void 0;const o={value:n,issues:null};return r.set(t.value,o),jg.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(o,s)=>{if(s.direction!=="backward"&&$Oe(s,o.value))throw new kOe;return n(o,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,o,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const a=e._zod.parse,u=(c,f)=>{if(n===void 0){const E=Cm(e,new Set);if(E===Xd)return e._zod.parse=a,e._zod.run===u&&(e._zod.run=a),a(c,f);E===pf||r?n=!0:r=!0}const h=c.value;if(!QB(h))return a(c,f);let g=f[vA];g||(g={buckets:new WeakMap,backEdges:void 0},f[vA]=g);let m;o===f?m=s:(m=LOe(g,e),o=f,s=m);const v=m.get(h);if(v)return c.value=v.value,v.issues?v.issues.length&&c.issues.push(...a_(v.issues)):(c.memo=!0,g.backEdges??(g.backEdges=new WeakSet),g.backEdges.add(v.value)),c;zg=m;const w=jg.length,S=a(c,f);zg=void 0;const C=jg.length>w?jg.pop():void 0;return S instanceof Promise?S.then(E=>(C&&(C.issues=E.issues.length?a_(E.issues):r5),E)):(C&&(C.issues=S.issues.length?a_(S.issues):r5),S)};e._zod.parse=u,e._zod.run===a&&(e._zod.run=u)})}};function FOe(){return UOe}function $Oe(e,t){const n=e[vA]?.backEdges;return n!==void 0&&QB(t)&&n.has(t)}const zOe=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(s,a){return s==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const a=o(s.expected),u=fRe(s.input),c=o(u,s.input);return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${RB(s.values[0])}`:`Invalid option: expected one of ${z6(s.values,"|")}`;case"too_big":{const a=s.exact?"exactly ":s.inclusive?"<=":"<",u=t(s.origin);return u?`Too big: expected ${s.origin??"value"} to have ${a}${s.maximum.toString()} ${u.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${a}${s.maximum.toString()}`}case"too_small":{const a=s.exact?"exactly ":s.inclusive?">=":">",u=t(s.origin);return u?`Too small: expected ${s.origin} to have ${a}${s.minimum.toString()} ${u.unit}`:`Too small: expected ${s.origin} to be ${a}${s.minimum.toString()}`}case"invalid_format":{const a=s;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${n[a.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${z6(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(u=>`'${u}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function jOe(){return{localeError:zOe()}}var o5;class BOe{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function HOe(){return new BOe}(o5=globalThis).__zod_globalRegistry??(o5.__zod_globalRegistry=HOe());const Jd=globalThis.__zod_globalRegistry;function pT(e){return e.checks&&(e.checks=[...e.checks]),e}function qOe(e,t){return new e(pT({type:"string",..._e(t)}))}function JB(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._e(t)})}function VOe(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._e(t)})}function WOe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._e(t)})}function GOe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._e(t)})}function KOe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._e(t)})}function ZOe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._e(t)})}function YOe(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._e(t)})}function QOe(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._e(t)})}function XOe(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._e(t)})}function JOe(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._e(t)})}function e2e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._e(t)})}function t2e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._e(t)})}function n2e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._e(t)})}function r2e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._e(t)})}function o2e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._e(t)})}function s2e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._e(t)})}function i2e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._e(t)})}function a2e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._e(t)})}function l2e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._e(t)})}function u2e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._e(t)})}function c2e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._e(t)})}function d2e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._e(t)})}function eH(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._e(t)})}function tH(e,t){return new e({type:"string",format:"date",check:"string_format",..._e(t)})}function f2e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._e(t)})}function h2e(e,t){return new e({type:"string",format:"duration",check:"string_format",..._e(t)})}function p2e(e,t){return new e(pT({type:"number",checks:[],..._e(t)}))}function S8e(e,t){return new e(pT({type:"number",coerce:!0,checks:[],..._e(t)}))}function g2e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._e(t)})}function m2e(e,t){return new e({type:"boolean",..._e(t)})}function v2e(e){return new e({type:"unknown"})}function y2e(e,t){return new e({type:"never",..._e(t)})}function s5(e,t){return new FB({check:"less_than",..._e(t),value:e,inclusive:!1})}function l_(e,t){return new FB({check:"less_than",..._e(t),value:e,inclusive:!0})}function i5(e,t){return new $B({check:"greater_than",..._e(t),value:e,inclusive:!1})}function u_(e,t){return new $B({check:"greater_than",..._e(t),value:e,inclusive:!0})}function a5(e,t){return new mTe({check:"multiple_of",..._e(t),value:e})}function nH(e,t){return new yTe({check:"max_length",..._e(t),maximum:e})}function wv(e,t){return new bTe({check:"min_length",..._e(t),minimum:e})}function rH(e,t){return new STe({check:"length_equals",..._e(t),length:e})}function b2e(e,t){return new wTe({check:"string_format",format:"regex",..._e(t),pattern:e})}function S2e(e){return new CTe({check:"string_format",format:"lowercase",..._e(e)})}function w2e(e){return new ETe({check:"string_format",format:"uppercase",..._e(e)})}function C2e(e,t){return new _Te({check:"string_format",format:"includes",..._e(t),includes:e})}function E2e(e,t){return new xTe({check:"string_format",format:"starts_with",..._e(t),prefix:e})}function _2e(e,t){return new ATe({check:"string_format",format:"ends_with",..._e(t),suffix:e})}function Cc(e){return new ITe({check:"overwrite",tx:e})}function x2e(e){return Cc(t=>t.normalize(e))}function A2e(){return Cc(e=>e.trim())}function I2e(){return Cc(e=>e.toLowerCase())}function R2e(){return Cc(e=>e.toUpperCase())}function T2e(){return Cc(e=>JIe(e))}function O2e(e,t,n){return new e({type:"array",element:t,..._e(n)})}function M2e(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._e(n)})}function P2e(e,t){const n=N2e(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Wf(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Wf(s))}},e(r.value,r)),t);return n}function N2e(e,t){const n=new mr({check:"custom",..._e(t)});return n._zod.check=e,n}function gf(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Xi(e,r,n[r]);return e}function oH(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Jd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Zi(e,t,n,r,o){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(n,s),!0}function dn(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const u=e._zod.toJSONSchema?.();if(u)a.schema=u;else{const h={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,h);else{const m=a.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,m,h)}const g=e._zod.parent;g&&(a.ref||(a.ref=g),dn(g,t,h),t.seen.get(g).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&gf(a.schema,c),t.io==="input"&&qn(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function l5(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function sH(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const a of e.seen.entries()){const u=e.metadataRegistry.get(a[0])?.id;if(u){const c=r.get(u);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,a[0])}}const o=a=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(a[0])?.id,m=e.external.uri??(w=>w);if(g)return{ref:m(g)};const v=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=v,{defId:v,ref:`${m("__shared")}#/${u}/${l5(v)}`}}const c="#",f=`${c}/${u}/`;if(a[1]===n&&!a[1].schema.id)return{ref:c};const h=a[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:f+l5(h)}},s=a=>{if(a[1].schema.$ref)return;const u=a[1],{ref:c,defId:f}=o(a);u.def={...u.schema},f&&(u.defId=f);const h=u.schema;for(const g in h)delete h[g];h.$ref=c};if(e.cycles==="throw")for(const a of e.seen.entries()){const u=a[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
212
212
|
|
|
213
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const u=a[1];if(t===a[0]){s(a);continue}if(e.external){const f=e.external.registry.get(a[0])?.id;if(t!==a[0]&&f){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(u.cycle){s(a);continue}u.count>1&&e.reused==="ref"&&s(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function iH(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;iH(r);const o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;const s=r.type;for(const a of Array.isArray(s)?s:[s]){if(typeof a!="string")return;n.includes(a)||n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const aH=new Set(["type","properties","required","additionalProperties"]),u5=["oneOf","anyOf"];function c5(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function yA(e){const t=[];for(const s of e){if(typeof s!="object"||s.type!=="object")return null;for(const a in s)if(!aH.has(a))return null;t.push(s)}const n={},r=new Set;for(const s of t){for(const a in s.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const u=[];for(const f of t){const h=f.properties?.[a]??c5(f);h!=null&&(u.some(g=>JSON.stringify(g)===JSON.stringify(h))||u.push(h))}const c=u.length===1?u[0]:yA(u)??{allOf:u};Xi(n,a,c)}for(const a of s.required??[])r.add(a)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(s=>s.additionalProperties===!1))o.additionalProperties=!1;else{const s=[];for(const a of t){const u=c5(a);u&&!s.some(c=>JSON.stringify(c)===JSON.stringify(u))&&s.push(u)}s.length===1?o.additionalProperties=s[0]:s.length>1&&(o.additionalProperties={allOf:s})}return o}function k2e(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of aH)if(o in e)return;const n=t.filter(o=>u5.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=yA(t);else{const o=n[0],s=u5.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;const a=t.filter(c=>c!==o),u=o[s].map(c=>yA([...a,c]));if(u.some(c=>!c))return;r={[s]:u}}r&&(delete e.allOf,gf(e,r))}function lH(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const c=e.seen.get(u);if(c.ref===null)return;const f=c.def??c.schema,h={...f},g=c.ref;if(c.ref=null,g){r(g);const v=e.seen.get(g),w=v.schema;if(w.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(w)):gf(f,w),gf(f,h),u._zod.parent===g)for(const C in f)C==="$ref"||C==="allOf"||C in h||delete f[C];if(w.$ref&&v.def)for(const C in f)C==="$ref"||C==="allOf"||C in v.def&&JSON.stringify(f[C])===JSON.stringify(v.def[C])&&delete f[C]}const m=u._zod.parent;if(m&&m!==g){r(m);const v=e.seen.get(m);if(v?.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const w in f)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(f[w])===JSON.stringify(v.def[w])&&delete f[w]}e.override({zodSchema:u,jsonSchema:f,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const u of[...e.seen.entries()].reverse())r(u[0]);if(e.target!=="openapi-3.0")for(const u of e.seen.entries())iH(u[1].def??u[1].schema);for(const u of e.deferred)u();if(e.intersections.length){const u=new Map;for(const c of e.seen.values())for(const f of[c.schema,c.def]){const h=f?.allOf;if(!Array.isArray(h))continue;const g=u.get(h);g?g.push(f):u.set(h,[f])}for(const c of e.intersections)for(const f of u.get(c)??[])k2e(f)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}gf(o,n.defId?n.schema:n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;const a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const u of e.seen.entries()){const c=u[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Xi(a,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?o.$defs=a:o.definitions=a);try{const u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cv(t,"input",e.processors),output:Cv(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function qn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return qn(r.element,n);if(r.type==="set")return qn(r.valueType,n);if(r.type==="lazy")return qn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return qn(r.innerType,n);if(r.type==="intersection")return qn(r.left,n)||qn(r.right,n);if(r.type==="record"||r.type==="map")return qn(r.keyType,n)||qn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:qn(r.in,n)||qn(r.out,n);if(r.type==="object"){for(const o in r.shape)if(qn(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(qn(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(qn(o,n))return!0;return!!(r.rest&&qn(r.rest,n))}return!1}const D2e=(e,t={})=>n=>{const r=oH({...n,processors:t});return dn(e,r),sH(r,e),lH(r,e)},Cv=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},a=oH({...o??{},target:s,io:t,processors:n});return dn(e,a),sH(a,e),lH(a,e)},nc=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},rc=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},d5=(e,t)=>{nc(e,"minimum",t),rc(e,"maximum",t)},uH=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},cH=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},dH=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},fH=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},f5=(e,t)=>nc(e,"minimum",t.minimum),h5=(e,t)=>rc(e,"maximum",t.maximum),p5=e=>(t,n)=>{fH(t,n.format);const[r,o]=e[n.format];nc(t,"minimum",r),rc(t,"maximum",o)},L2e={greater_than:(e,t)=>nc(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>rc(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>uH(e,t.value),number_format:p5(TB),bigint_format:p5(rRe),min_length:f5,max_length:h5,length_equals:(e,t)=>d5(e,t.length),min_size:f5,max_size:h5,size_equals:(e,t)=>d5(e,t.size),string_format:(e,t)=>{fH(e,t.format),t.pattern&&cH(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>dH(e,t.mime)};function mo(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const s of r)L2e[s._zod.def.check]?.(t,s._zod.def);const o=e._zod.bag;o.minimum!==void 0&&nc(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&nc(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&rc(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&rc(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&uH(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&dH(t,o.mime);for(const s of o.patterns??[])cH(t,s);return t}const U2e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},F2e=new Map([[WB,rTe],[hT,oTe]]),hH=e=>F2e.get(e)??e,$2e=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:a,format:u,patterns:c,contentEncoding:f,laxFormat:h}=mo(e);if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),u&&(o.format=U2e[u]??u,o.format===""&&delete o.format,(u==="time"||h)&&delete o.format),f&&(o.contentEncoding=f),c&&c.size>0){const g=[...c].map(hH);g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},z2e=(e,t,n,r)=>{const o=n,{minimum:s,maximum:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:f,isInt:h}=mo(e);o.type=h?"integer":"number";const g=typeof f=="number"&&f>=(s??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(g?v?(o.minimum=f,o.exclusiveMinimum=!0):o.exclusiveMinimum=f:typeof s=="number"&&(o.minimum=s),m?v?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof a=="number"&&(o.maximum=a),u){const w=new Set;for(const E of u)Number.isFinite(E)&&E!==0?w.add(Math.abs(E)):Zi(e,t,o,r,`A multipleOf divisor of ${E} cannot be represented in JSON Schema`);const[S,...C]=w;S!==void 0&&(o.multipleOf=S),C.length&&(o.allOf=[...o.allOf??[],...C.map(E=>({multipleOf:E}))])}},j2e=(e,t,n,r)=>{n.type="boolean"},B2e=(e,t,n,r)=>{n.not={}},H2e=(e,t,n,r)=>{},q2e=(e,t,n,r)=>{const o=e._zod.def,s=fA(o.entries);if(s.length===0){n.not={};return}s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),n.enum=s},V2e=(e,t,n,r)=>{const o=e._zod.def;if(o.values.length===0){n.not={};return}const s=[];for(const a of o.values)if(a===void 0){if(Zi(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(Zi(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),s.every(a=>typeof a=="boolean")&&(n.type="boolean"),s.every(a=>a===null)&&(n.type="null"),n.enum=s},W2e=(e,t,n,r)=>{Zi(e,t,n,r,"Custom types cannot be represented in JSON Schema")},G2e=(e,t,n,r)=>{Zi(e,t,n,r,"Transforms cannot be represented in JSON Schema")},K2e=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:a,maximum:u}=mo(e);typeof a=="number"&&(o.minItems=a),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=dn(s.element,t,{...r,path:[...r.path,"items"]})};function Ev(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Ev(t.out):t.type==="catch"?Ev(t.innerType):e._zod.optin}const Z2e=(e,t,n,r)=>{const o=n,s=e._zod.def,a=s.shape;if(Object.getOwnPropertySymbols(a).length&&Zi(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const f in a)Xi(o.properties,f,dn(a[f],t,{...r,path:[...r.path,"properties",f]}));const c=[];for(const f of Object.keys(a)){const h=s.shape[f];(t.io==="input"?Ev(h)===void 0:h._zod.optout===void 0)&&c.push(f)}c.length>0&&(o.required=c),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=dn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Y2e=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((u,c)=>dn(u,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=a:n.anyOf=a},Q2e=(e,t,n,r)=>{const o=e._zod.def,s=dn(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=dn(o.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,c=[...u(s)?s.allOf:[s],...u(a)?a.allOf:[a]];n.allOf=c,t.intersections.push(c)};function bA(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const w=e.get(t)?.def;if(!w)return t;const S=bA(e,w,n);return S===w?t:S}for(const w of["anyOf","oneOf"]){const S=t[w];if(!Array.isArray(S))continue;const C=S.map(E=>bA(e,E,n));C.some((E,A)=>E!==S[A])&&(t={...t,[w]:C})}const r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(w=>w==="number"||w==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!s?.some(w=>typeof w=="number"))return t;const{minimum:a,maximum:u,exclusiveMinimum:c,exclusiveMaximum:f,multipleOf:h,format:g,id:m,...v}=t;return v.enum?v.enum=v.enum.map(w=>typeof w=="number"?String(w):w):typeof v.const=="number"&&(v.const=String(v.const)),o&&(v.type="string",s||(v.pattern=(r.includes("number")?cT:fTe).source)),v}const SA=new WeakMap;function X2e(e){const t=new Map;for(const r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);const n=new Map;for(const r of SA.get(e)??[]){const o=e.seen.get(r),s=(o?.def??o?.schema)?.propertyNames;if(!s||s===!0||n.has(s))continue;const a=bA(t,s,new Set);a!==s&&n.set(s,a)}if(n.size)for(const r of e.seen.values())for(const o of[r.schema,r.def]){const s=o&&n.get(o.propertyNames);s&&(o.propertyNames=s)}}const J2e=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const a=s.keyType,u=mo(a).patterns;if(s.mode==="loose"&&u&&u.size>0){const h=dn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const g of u)Xi(o.patternProperties,hH(g).source,h)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=dn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]});let h=SA.get(t);h||(h=[],SA.set(t,h),t.deferred.push(()=>X2e(t))),h.push(e)}o.additionalProperties=dn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const c=a._zod.values,f=t.io==="input"&&Ev(s.valueType)!==void 0;if(c&&!s.partial&&!f){const h=[...c].filter(g=>typeof g=="string"||typeof g=="number");h.length>0&&(o.required=h.map(String))}},eMe=(e,t,n,r)=>{const o=e._zod.def,s=dn(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},tMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},gT=Symbol();function pH(e,t,n,r,o){let s=!1;const a=JSON.stringify(e,(u,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Zi(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),gT):JSON.parse(a)}const nMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const a=pH(o.defaultValue,e,t,n,r);a!==gT&&(n.default=a)},rMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const a=pH(o.defaultValue,e,t,n,r);a!==gT&&(n._prefault=a)},oMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{Zi(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},sMe=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?o.out:o.in:o.out;dn(a,t,r);const u=t.seen.get(e);u.ref=a},iMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},gH=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},g5=new WeakSet([Object.prototype,Error.prototype]);function Bg(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const aMe=(e,t)=>{_Re.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);g5.has(n)||(g5.add(n),Bg(n,"format",r=>o=>IRe(r,o)),Bg(n,"flatten",r=>o=>ARe(r,o)),Bg(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,hA,2)}),Bg(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,hA,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},no=te("ZodError",aMe,void 0,{Parent:Error}),lMe=eb(no),uMe=tb(no),cMe=lT(no),dMe=uT(no),fMe=NRe(no),hMe=kRe(no),pMe=DRe(no),gMe=LRe(no),mMe=URe(no),vMe=FRe(no),yMe=$Re(no),bMe=zRe(no);function SMe(){So.localeError||Vo(jOe())}function rb(){So.memoizer||Vo({memoizer:FOe()})}const Yt=te("ZodType",(e,t)=>(SMe(),Zt.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(Rr(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ji(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(pPe(e,t))},superRefine(e,t){return this.check(gPe(e,t))},overwrite(e){return this.check(Cc(e))},optional(){return y5(this)},exactOptional(){return tPe(this)},nullable(){return b5(this)},nullish(){return y5(b5(this))},nonoptional(e){return aPe(this,e)},array(){return wH(this)},or(e){return CH([this,e])},and(e){return YMe(this,e)},transform(e){return S5(this,ePe(e))},default(e){return oPe(this,e)},prefault(e){return iPe(this,e)},catch(e){return uPe(this,e)},pipe(e){return S5(this,e)},readonly(){return fPe(this)},describe(e){const t=this.clone();return Jd.add(t,{description:e}),t},meta(...e){if(e.length===0)return Jd.get(this);const t=this.clone();return Jd.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return MB(this,"~standard",{...jB(this),jsonSchema:{input:Cv(this,"input"),output:Cv(this,"output")}})},set"~standard"(e){Ki(this,"~standard",e)},parse:function e(t,n){return lMe(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await uMe(this,t,n,{callee:e})},safeParse(e,t){return cMe(this,e,t)},async safeParseAsync(e,t){return dMe(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ki(this,"spa",e)},validate(e,t){return ORe(this,e,t)},validateAsync(e,t){return PRe(this,e,t)},encode:function e(t,n){return fMe(this,t,n,{callee:e})},decode:function e(t,n){return hMe(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await pMe(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await gMe(this,t,n,{callee:e})},safeEncode(e,t){return mMe(this,e,t)},safeDecode(e,t){return vMe(this,e,t)},async safeEncodeAsync(e,t){return yMe(this,e,t)},async safeDecodeAsync(e,t){return bMe(this,e,t)},toJSONSchema(e){return D2e(this,{})(e)},get description(){return Jd.get(this)?.description},get _def(){return this._zod.def}}),mH=te("_ZodString",(e,t)=>{fT.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$2e(e,n,r)},PB({format:e=>mo(e).format??null,minLength:e=>mo(e).minimum??null,maxLength:e=>mo(e).maximum??null},{regex(...e){return this.check(b2e(...e))},includes(...e){return this.check(C2e(...e))},startsWith(...e){return this.check(E2e(...e))},endsWith(...e){return this.check(_2e(...e))},min(...e){return this.check(wv(...e))},max(...e){return this.check(nH(...e))},length(...e){return this.check(rH(...e))},nonempty(...e){return this.check(wv(1,...e))},lowercase(e){return this.check(S2e(e))},uppercase(e){return this.check(w2e(e))},trim(){return this.check(A2e())},normalize(...e){return this.check(x2e(...e))},toLowerCase(){return this.check(I2e())},toUpperCase(){return this.check(R2e())},slugify(){return this.check(T2e())}})),wMe=te("ZodString",(e,t)=>{fT.init(e,t),mH.init(e,t)},{email(e){return this.check(JB(bH,e))},url(e){return this.check(YOe(xMe,e))},jwt(e){return this.check(d2e(zMe,e))},emoji(e){return this.check(QOe(AMe,e))},guid(e){return this.check(VOe(_Me,e))},uuid(e){return this.check(WOe(Hg,e))},uuidv4(e){return this.check(GOe(Hg,e))},uuidv6(e){return this.check(KOe(Hg,e))},uuidv7(e){return this.check(ZOe(Hg,e))},nanoid(e){return this.check(XOe(IMe,e))},cuid(e){return this.check(JOe(RMe,e))},cuid2(e){return this.check(e2e(TMe,e))},ulid(e){return this.check(t2e(OMe,e))},base64(e){return this.check(l2e(UMe,e))},base64url(e){return this.check(u2e(FMe,e))},xid(e){return this.check(n2e(MMe,e))},ksuid(e){return this.check(r2e(PMe,e))},ipv4(e){return this.check(o2e(NMe,e))},ipv6(e){return this.check(s2e(kMe,e))},cidrv4(e){return this.check(i2e(DMe,e))},cidrv6(e){return this.check(a2e(LMe,e))},e164(e){return this.check(c2e($Me,e))},datetime(e){return this.check(eH(vH,e))},date(e){return this.check(tH(yH,e))},time(e){return this.check(f2e(CMe,e))},duration(e){return this.check(h2e(EMe,e))}});function Kn(e){return qOe(wMe,e)}const Qt=te("ZodStringFormat",(e,t)=>{Vt.init(e,t),mH.init(e,t)}),vH=te("ZodISODateTime",(e,t)=>{GTe.init(e,t),Qt.init(e,t)}),yH=te("ZodISODate",(e,t)=>{KTe.init(e,t),Qt.init(e,t)}),CMe=te("ZodISOTime",(e,t)=>{ZTe.init(e,t),Qt.init(e,t)}),EMe=te("ZodISODuration",(e,t)=>{YTe.init(e,t),Qt.init(e,t)}),bH=te("ZodEmail",(e,t)=>{NTe.init(e,t),Qt.init(e,t)});function w8e(e){return JB(bH,e)}const _Me=te("ZodGUID",(e,t)=>{MTe.init(e,t),Qt.init(e,t)}),Hg=te("ZodUUID",(e,t)=>{PTe.init(e,t),Qt.init(e,t)}),xMe=te("ZodURL",(e,t)=>{$Te.init(e,t),Qt.init(e,t)}),AMe=te("ZodEmoji",(e,t)=>{zTe.init(e,t),Qt.init(e,t)}),IMe=te("ZodNanoID",(e,t)=>{jTe.init(e,t),Qt.init(e,t)}),RMe=te("ZodCUID",(e,t)=>{BTe.init(e,t),Qt.init(e,t)}),TMe=te("ZodCUID2",(e,t)=>{HTe.init(e,t),Qt.init(e,t)}),OMe=te("ZodULID",(e,t)=>{qTe.init(e,t),Qt.init(e,t)}),MMe=te("ZodXID",(e,t)=>{VTe.init(e,t),Qt.init(e,t)}),PMe=te("ZodKSUID",(e,t)=>{WTe.init(e,t),Qt.init(e,t)}),NMe=te("ZodIPv4",(e,t)=>{QTe.init(e,t),Qt.init(e,t)}),kMe=te("ZodIPv6",(e,t)=>{JTe.init(e,t),Qt.init(e,t)}),DMe=te("ZodCIDRv4",(e,t)=>{eOe.init(e,t),Qt.init(e,t)}),LMe=te("ZodCIDRv6",(e,t)=>{nOe.init(e,t),Qt.init(e,t)}),UMe=te("ZodBase64",(e,t)=>{rOe.init(e,t),Qt.init(e,t)}),FMe=te("ZodBase64URL",(e,t)=>{sOe.init(e,t),Qt.init(e,t)}),$Me=te("ZodE164",(e,t)=>{iOe.init(e,t),Qt.init(e,t)}),zMe=te("ZodJWT",(e,t)=>{lOe.init(e,t),Qt.init(e,t)}),SH=te("ZodNumber",(e,t)=>{GB.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>z2e(e,n,r,o),e.isFinite=!0},PB({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=mo(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=mo(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=mo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>mo(e).format??null},{gt(e,t){return this.check(i5(e,t))},gte(e,t){return this.check(u_(e,t))},min(e,t){return this.check(u_(e,t))},lt(e,t){return this.check(s5(e,t))},lte(e,t){return this.check(l_(e,t))},max(e,t){return this.check(l_(e,t))},int(e){return this.check(m5(e))},safe(e){return this.check(m5(e))},positive(e){return this.check(i5(0,e))},nonnegative(e){return this.check(u_(0,e))},negative(e){return this.check(s5(0,e))},nonpositive(e){return this.check(l_(0,e))},multipleOf(e,t){return this.check(a5(e,t))},step(e,t){return this.check(a5(e,t))},finite(){return this}}));function wA(e){return p2e(SH,e)}const jMe=te("ZodNumberFormat",(e,t)=>{uOe.init(e,t),SH.init(e,t)});function m5(e){return g2e(jMe,e)}const BMe=te("ZodBoolean",(e,t)=>{cOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>j2e(e,n,r)});function mT(e){return m2e(BMe,e)}const HMe=te("ZodUnknown",(e,t)=>{dOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>H2e()});function _v(){return v2e(HMe)}const qMe=te("ZodNever",(e,t)=>{fOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>B2e(e,n,r)});function VMe(e){return y2e(qMe,e)}const WMe=te("ZodArray",(e,t)=>{rb(),gOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>K2e(e,n,r,o),e.element=t.element},{min(e,t){return this.check(wv(e,t))},nonempty(e){return this.check(wv(1,e))},max(e,t){return this.check(nH(e,t))},length(e,t){return this.check(rH(e,t))},unwrap(){return this.element}});function wH(e,t){return O2e(WMe,e,t)}const GMe=te("ZodObject",(e,t)=>{rb(),yOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Z2e(e,n,r,o),vRe(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return vT(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Rr(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Rr(this._zod.def,{catchall:_v()}))},loose(){return this.clone(Rr(this._zod.def,{catchall:_v()}))},strict(){return this.clone(Rr(this._zod.def,{catchall:VMe()}))},strip(){return this.clone(Rr(this._zod.def,{catchall:void 0}))},extend(e){return iRe(this,e)},safeExtend(e){return aRe(this,e)},merge(e){return lRe(this,e)},pick(e){return oRe(this,e)},omit(e){return sRe(this,e)},partial(...e){return j6(EH,this,e[0])},exactPartial(...e){return j6(_H,this,e[0],"exactPartial")},required(...e){return uRe(xH,this,e[0])}});function wo(e,t){const n={type:"object",shape:e??{},..._e(t)};return new GMe(n)}const KMe=te("ZodUnion",(e,t)=>{bOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Y2e(e,n,r,o),e.options=t.options});function CH(e,t){return new KMe({type:"union",options:e,..._e(t)})}const ZMe=te("ZodIntersection",(e,t)=>{SOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Q2e(e,n,r,o)});function YMe(e,t){return new ZMe({type:"intersection",left:e,right:t})}const v5=te("ZodRecord",(e,t)=>{rb(),wOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>J2e(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function QMe(e,t,n){return!t||!t._zod?new v5({type:"record",keyType:Kn(),valueType:e,..._e(t)}):new v5({type:"record",keyType:e,valueType:t,..._e(n)})}const CA=te("ZodEnum",(e,t)=>{COe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>q2e(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const a of r)if(n.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new CA({...t,checks:[],..._e(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new CA({...t,checks:[],..._e(o),entries:s})}});function vT(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new CA({type:"enum",entries:n,..._e(t)})}const XMe=te("ZodLiteral",(e,t)=>{EOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>V2e(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ml(e,t){return new XMe({type:"literal",values:Array.isArray(e)?e:[e],..._e(t)})}const JMe=te("ZodTransform",(e,t)=>{rb(),_Oe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>G2e(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new NB(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Wf(s,n.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Wf(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function ePe(e){return new JMe({type:"transform",transform:e})}const EH=te("ZodOptional",(e,t)=>{YB.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gH(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function y5(e){return new EH({type:"optional",innerType:e})}const _H=te("ZodExactOptional",(e,t)=>{xOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gH(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function tPe(e){return new _H({type:"optional",innerType:e})}const nPe=te("ZodNullable",(e,t)=>{AOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function b5(e){return new nPe({type:"nullable",innerType:e})}const rPe=te("ZodDefault",(e,t)=>{IOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function oPe(e,t){return new rPe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():IB(t)}})}const sPe=te("ZodPrefault",(e,t)=>{ROe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function iPe(e,t){return new sPe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():IB(t)}})}const xH=te("ZodNonOptional",(e,t)=>{TOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function aPe(e,t){return new xH({type:"nonoptional",innerType:e,..._e(t)})}const lPe=te("ZodCatch",(e,t)=>{OOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uPe(e,t){return new lPe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:bRe(t)})}const cPe=te("ZodPipe",(e,t)=>{MOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sMe(e,n,r,o),e.in=t.in,e.out=t.out});function S5(e,t){return new cPe({type:"pipe",in:e,out:t})}const dPe=te("ZodReadonly",(e,t)=>{POe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>iMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function fPe(e){return new dPe({type:"readonly",innerType:e})}const hPe=te("ZodCustom",(e,t)=>{NOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>W2e(e,n,r,o)});function pPe(e,t={}){return M2e(hPe,e,t)}function gPe(e,t){return P2e(e,t)}function mPe(e){return eH(vH,e)}function vPe(e){return tH(yH,e)}wo({kind:ml("Boolean"),value:mT()});wo({kind:ml("String"),value:Kn()});wo({kind:ml("Number"),value:wA()});wo({kind:ml("StringList"),value:wH(Kn())});wo({kind:ml("Map"),value:QMe(Kn(),Kn())});wo({kind:ml("MutedFlag"),value:wo({value:mT(),setAt:wA(),setBy:Kn().optional(),expiresAt:wA().optional(),reason:Kn().optional()})});const yPe=e=>e.hierarchyDelimiter.length===0?[e.fullPath]:e.fullPath.split(e.hierarchyDelimiter),Gf=e=>{const t=yPe(e);return t[t.length-1]||e.fullPath},bPe=(e,t)=>{switch(e.kind){case"appointed":case"flagged":return{allowed:!0,mailbox:e.mailbox};case"proposed":return t==="resolved"?{allowed:!0,mailbox:e.mailbox}:{allowed:!1,reason:"unconfirmed"};case"appointment_stale":return{allowed:!1,reason:"stale"};default:return{allowed:!1,reason:"none"}}},SPe=(e,t)=>bPe(e,t).allowed,wPe={[nu.Appointed]:{kind:"appointed",mailbox:null},[nu.Flagged]:{kind:"flagged",mailbox:null},[nu.Reserved]:{kind:"reserved",mailbox:null},[nu.Proposed]:{kind:"proposed",mailbox:null},[nu.Stale]:{kind:"appointment_stale",appointedMailboxId:"",fallback:{kind:"none"}},[nu.None]:{kind:"none"}},CPe=(e,t)=>SPe(wPe[e],t),yT=()=>typeof navigator<"u"&&(navigator.language||navigator.languages?.[0])||"en-US",Wo=(e,t)=>new Intl.NumberFormat(yT(),t).format(e),EPe=/^-?\d+$/,bT=e=>{if(e instanceof Date)return e;if(typeof e=="number")return new Date(e);if(typeof e=="string"){const t=e.trim();return EPe.test(t)?new Date(Number(t)):new Date(t)}return new Date(Number.NaN)},ST=e=>Number.isFinite(e.getTime()),ef=(e,t)=>{const n=bT(e);return ST(n)?new Intl.DateTimeFormat(yT(),t).format(n):""},AH=(e,t)=>ef(e,{short:{month:"short",day:"numeric"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"},time:{hour:"numeric",minute:"numeric"},datetime:{month:"short",day:"numeric",hour:"numeric",minute:"numeric"}}[t]),C8e=e=>{const t=bT(e);if(!ST(t))return"";const n=new Intl.RelativeTimeFormat(yT(),{numeric:"auto"}),r=Date.now(),o=t.getTime()-r,s=Math.round(o/1e3),a=Math.round(o/(1e3*60)),u=Math.round(o/(1e3*60*60)),c=Math.round(o/(1e3*60*60*24)),f=Math.round(o/(1e3*60*60*24*7));return Math.abs(s)<60?n.format(s,"second"):Math.abs(a)<60?n.format(a,"minute"):Math.abs(u)<24?n.format(u,"hour"):Math.abs(c)<7?n.format(c,"day"):Math.abs(f)<4?n.format(f,"week"):AH(t,"medium")},E8e=e=>{const t=bT(e);if(!ST(t))return"";const n=new Date,r=t.toDateString()===n.toDateString(),o=new Date(n);o.setDate(o.getDate()-1);const s=t.toDateString()===o.toDateString(),a=new Date(n);a.setDate(a.getDate()-6);const u=t>=a&&t<n,c=t.getFullYear()===n.getFullYear();return r?ef(t,{hour:"numeric",minute:"numeric"}):s?"Yesterday":u?ef(t,{weekday:"long"}):c?ef(t,{month:"short",day:"numeric"}):ef(t,{month:"short",day:"numeric",year:"numeric"})},_Pe=e=>`Move ${e===1?"1":Wo(e)} ${e===1?"message":"messages"} to Trash?`,_8e=({targets:e,trashByAccount:t,hasAppointments:n,isError:r})=>{if(r)return"unavailable";if(!n||e.length===0)return"unknown";let o=!1,s=!1;for(const a of e){if(a.accountId===void 0)return"unknown";const u=t.get(a.accountId);if(u===void 0)return"unknown";if(u.source==="Stale")return"staleTrash";if(u.mailboxId===void 0)return"noTrash";u.mailboxId===a.mailboxId&&(o=!0,CPe(u.source,"confirmed")||(s=!0))}return s?"unconfirmed":o?"permanent":"trash"},xPe=e=>e==="permanent"||e==="unconfirmed",x8e=(e,t,n={})=>{const r=e===1?"1":Wo(e),o=e===1?"message":"messages",{trashFolderLabel:s,staleFolderLabel:a}=n;if(t==="noTrash")return{title:`Can't delete ${r} ${o} yet`,description:"No folder on this account is set as Trash, so there is nowhere to move the mail. Nothing has been deleted.",confirmLabel:"Pick a Trash folder"};if(t==="staleTrash")return{title:`Can't delete ${r} ${o} yet`,description:a?`The folder you set as this account's Trash — ${a} — is gone from the mail server. Nothing has been deleted.`:"The folder you set as this account's Trash is gone from the mail server. Nothing has been deleted.",confirmLabel:"Pick another folder"};if(t==="unconfirmed"){const u=s?`reader files this account's deleted mail in ${s} because of its name — nobody confirmed it.`:"reader files this account's deleted mail in a folder it matched by name — nobody confirmed it.";return{title:"Confirm this account's Trash folder",description:e>0?`${u} Deleting ${r} ${o} there erases them from the mail server, and that cannot be restored. Nothing has been deleted.`:`${u} Emptying a folder erases everything in it from the mail server, and that cannot be restored. Nothing has been emptied.`,confirmLabel:"Confirm the folder"}}return t==="unavailable"?{title:`Can't delete ${r} ${o}`,description:"reader couldn't read this account's folder settings, so it can't say whether this would move the mail to Trash or erase it. Nothing has been deleted.",confirmLabel:"Sign in again"}:t==="unknown"?{title:`Delete ${r} ${o}?`,description:"Checking where this account files deleted mail…",confirmLabel:"Delete"}:t==="permanent"?{title:`Permanently delete ${r} ${o}?`,description:"They are erased from the mail server and cannot be restored.",confirmLabel:"Delete permanently"}:{title:_Pe(e),description:"You can restore them from Trash later.",confirmLabel:"Move to Trash"}},APe={delete:(e,t)=>`Deleting ${e} of ${t}…`,move:(e,t)=>`Moving ${e} of ${t}…`,markRead:(e,t)=>`Marking ${e} of ${t} as read…`},IPe={delete:"moved to Trash",move:"moved",markRead:"marked as read"},IH=(e,t)=>e==="delete"&&xPe(t)?"permanently deleted":IPe[e],RPe={delete:"couldn't be deleted",move:"couldn't be moved",markRead:"couldn't be marked as read"},TPe={delete:"Couldn't delete these messages",move:"Couldn't move these messages",markRead:"Couldn't mark these messages as read"},OPe={delete:"The delete didn't finish.",move:"The move didn't finish.",markRead:"The update didn't finish."},A8e=(e,t,n)=>APe[e](Wo(t),Wo(n)),MPe=(e,t,n="trash")=>`${Wo(t)} ${IH(e,n)}. Your mail server is still catching up.`,PPe=e=>`Stopped after ${Wo(e)}`,NPe=(e,t,n,r="trash")=>`${Wo(t)} of ${Wo(n)} ${IH(e,r)}. The rest were not sent, apart from the ones already on their way when you stopped — those may still have gone through.`,w5=(e,t)=>t>0?`Stopped after ${Wo(t)} — some messages ${RPe[e]}`:TPe[e],kPe=e=>OPe[e],DPe={delete:e=>`A delete of ${e} messages`,move:e=>`A move of ${e} messages`,markRead:e=>`Marking ${e} messages as read`},LPe=(e,t,n)=>`${DPe[e](Wo(t))}${n?` in ${n}`:""} is still running — stop it first.`,I8e=e=>e==="delete"?"danger":"info",R8e=(e,t,n,r)=>n.error!==void 0?null:n.cancelled?{severity:"warning",title:PPe(n.done),detail:NPe(e,n.done,t,r)}:{severity:"info",title:MPe(e,n.done,r)},RH=100,UPe=(e,t)=>e.kind==="move"?[t,e.destinationMailboxId]:[t],FPe=new AbortController().signal,EA=async e=>e.then(t=>({ok:!0,value:t}),t=>({ok:!1,error:t})),$Pe=(e,t=RH)=>{if(e.length===0)return[];const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},zPe=(e,t=RH)=>{const n=new Map;for(const r of e){const o=n.get(r.accountId);if(o){o.push(r.id);continue}n.set(r.accountId,[r.id])}return[...n.values()].flatMap(r=>$Pe(r,t))},TH=async(e,t,n,r)=>{const o=zPe(e),s=e.length;let a=0,u=0;const c=[];for(let f=0;f<o.length;f++){if(r.aborted)return c.push(...o.slice(f).flat()),{done:a,failedIds:c,refused:u,cancelled:!0};const h=o[f],g=await EA(t(h,r));if(!g.ok)return c.push(...o.slice(f).flat()),r.aborted?{done:a,failedIds:c,refused:u,cancelled:!0}:(n({done:a,total:s}),{done:a,failedIds:c,refused:u,cancelled:!1,error:g.error});u+=g.value?.failureCount??0,a+=h.length,n({done:a,total:s})}return{done:a,failedIds:c,refused:u,cancelled:!1}},T8e=async(e,t)=>{await TH(e.map(n=>({id:n,accountId:void 0})),async n=>(await t(n),{successCount:n.length,failureCount:0}),()=>{},FPe)},jPe=async(e,t,n,r,o)=>{let s=0,a=0;const u=[];let c;do{if(o.aborted)return{done:s,failedIds:u,refused:a,cancelled:!0};const f=await EA(e(c,o));if(!f.ok)return o.aborted?{done:s,failedIds:u,refused:a,cancelled:!0}:{done:s,failedIds:u,refused:a,cancelled:!1,error:f.error};const h=f.value;if(h.ids.length>0){const g=await EA(n(h.ids,o));if(!g.ok)return o.aborted?{done:s,failedIds:u,refused:a,cancelled:!0}:{done:s,failedIds:u,refused:a,cancelled:!1,error:g.error};a+=g.value?.failureCount??0,s+=h.ids.length,r({done:s,total:t})}c=h.continuationToken}while(c);return{done:s,failedIds:u,refused:a,cancelled:!1}},BPe=e=>({done:e.done,total:Math.max(e.total,e.done)}),HPe=e=>typeof e=="object"&&e!==null&&Array.isArray(e.pages),qPe=e=>typeof e=="object"&&e!==null&&Array.isArray(e.items),VPe=(e,t)=>e===void 0?e:HPe(e)?{...e,pages:e.pages.map(n=>({...n,items:t(n.items)}))}:qPe(e)?{...e,items:t(e.items)}:e,WPe=e=>{const t=[];for(const n of new Set(e))t.push(IIe({path:{mailboxId:n}})),t.push(bB({path:{mailboxId:n}}));return t.push(wB()),t},O8e=(e,t)=>Promise.all(t.map(n=>e.cancelQueries({queryKey:n}))),M8e=(e,t)=>t.flatMap(n=>e.getQueriesData({queryKey:n})).filter(n=>n[1]!==void 0).map(([n,r])=>({queryKey:n,data:r})),P8e=(e,t,n)=>{const r=o=>VPe(o,n);for(const o of t)e.setQueriesData({queryKey:o},r)},N8e=(e,t)=>{for(const n of t)e.setQueryData(n.queryKey,n.data)},GPe=(e,t)=>{for(const n of t)e.invalidateQueries({queryKey:n})},OH=_.createContext(void 0),KPe=e=>{if(e.action)return e.action;if((e.severity??"error")==="error")return{label:"Report an issue",href:oh(Bu({title:`Bug: ${e.title}`,errorMessage:e.detail?`${e.title} — ${e.detail}`:e.title,stack:e.error instanceof Error?e.error.stack:void 0}))}},ZPe=()=>{const e=_.useContext(OH);if(!e)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return e},C5=5,YPe=(e,t,n)=>({title:e,detail:MH(n)??t,error:n}),MH=e=>{if(e!=null){if(e instanceof Error)return e.message||void 0;if(typeof e=="string")return e||void 0;if(typeof e=="object"&&"message"in e&&typeof e.message=="string")return e.message||void 0}},k8e=e=>sl(e)?.code==="message_gone_from_server",D8e=e=>{const t=MH(e);return t?t.startsWith("Message not found"):!1},QPe=(e,t,n)=>e.severity===n&&e.title===t.title&&e.detail===t.detail,XPe=(e,t)=>{const r=[...e.filter(o=>!QPe(o,{title:t.title,detail:t.detail,severity:t.severity},t.severity)),t];return r.length<=C5?r:r.slice(r.length-C5)},JPe=(e,t)=>e.filter(n=>n.id!==t),eNe=(e,t,n)=>({id:t,severity:e.severity??"error",title:e.title,detail:e.detail,action:e.action,createdAt:n}),tNe=new Set(["none","stale","unconfirmed"]),nNe=new Set(Object.values(Ane)),c_=(e,t)=>{const n=e?.[t];return typeof n=="string"?n:void 0},rNe=e=>{const t=sl(e);if(t?.code!=="folder_role_unresolved")return;const{details:n}=t;if(!n)return;const r=c_(n,"reason"),o=c_(n,"role"),s=c_(n,"accountId");if(!(!r||!tNe.has(r))&&!(!o||!nNe.has(o)||!s))return{reason:r,role:o,accountId:s}},oNe=e=>sl(e)?.code==="mailbox_not_settled",sNe=3e4,iNe=1e3,aNe="The folder couldn't be created on the mail server. Please try again.",lNe="The folder was created but the mail server hasn't confirmed it yet, so nothing was attached to it. It's in your folder list — try again in a moment.",uNe=(e,t)=>new Promise((n,r)=>{if(t?.aborted){r(t.reason);return}const o=setTimeout(()=>{t?.removeEventListener("abort",s),n()},e),s=()=>{clearTimeout(o),r(t?.reason)};t?.addEventListener("abort",s,{once:!0})});async function cNe({fetchMailboxes:e,mailboxId:t,signal:n,timeoutMs:r=sNe,pollIntervalMs:o=iNe,delay:s=uNe,now:a=Date.now}){const u=a()+r;for(;;){n?.throwIfAborted();const f=(await e()).find(h=>h.mailboxId===t);if(f?.syncStatus===uk.synced)return f;if(f?.syncStatus===uk.failed)throw new Error(aNe);if(a()>=u)throw new Error(lNe);await s(o,n)}}function PH(e,t){const n=e.trim();return t?`${t.fullPath}${t.hierarchyDelimiter}${n}`:n}const E5=(e,t)=>{const n=t.length===0?[e]:e.split(t);return n[0]?.toLowerCase()==="inbox"&&(n[0]="INBOX"),n.join(t)};function dNe({name:e,delimiter:t,parent:n,existingPaths:r}){const o=e.trim();if(o==="")return"Enter a folder name.";if(t.length>0&&o.includes(t))return`A folder name can't contain "${t}".`;const s=E5(PH(o,n),t);if(r.some(u=>E5(u,t)===s))return"A folder with that name already exists."}function fNe(e){const t=cl(),{data:n}=Xa({...cA({path:{accountId:e??""}}),enabled:!!e}),r=sR({...pIe(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:nT({path:{accountId:e}})})}}),o=_.useRef(new Map),s=_.useCallback(async(u,c,f)=>{if(!e)throw new Error("No account to create the folder in. Pick messages from a single account first.");const h=n?.items??[],g=c?h.find(C=>C.fullPath===c):void 0;if(c&&!g)throw new Error(`Couldn't find the folder "${c}" to create this one inside.`);const m=g?{fullPath:g.fullPath,hierarchyDelimiter:g.hierarchyDelimiter}:void 0,v=PH(u,m);let w=o.current.get(v);if(!w){const C=m?.hierarchyDelimiter??h[0]?.hierarchyDelimiter??"/",E=dNe({name:u,delimiter:C,parent:m,existingPaths:h.map(I=>I.fullPath)});if(E)throw new Error(E);w=(await r.mutateAsync({path:{accountId:e},body:{fullPath:v,namespaceType:"personal"}})).mailboxId,o.current.set(v,w)}const S=await cNe({mailboxId:w,signal:f,fetchMailboxes:async()=>(await t.fetchQuery({...cA({path:{accountId:e}}),staleTime:0})).items??[]});return o.current.delete(v),{id:S.mailboxId,label:Gf(S),path:S.fullPath}},[r,e,n,t]);return{createFolder:_.useCallback((u,c)=>s(u,"",c),[s]),createFolderIn:s,mutation:r}}const hNe=()=>{const{t:e}=mB("mail",{useSuspense:!1});return _.useCallback((t,n)=>e(t,{defaultValue:n}),[e])},d_={Inbox:"inbox",Drafts:"drafts",Sent:"sent",Archive:"archive",Junk:"junk",Trash:"trash",All:"all",Flagged:"flagged"},L8e={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Junk",trash:"Trash",all:"All",flagged:"Flagged"},Kf=["inbox","flagged","drafts","sent","archive","all","junk","trash"];function ob(e){const t=new Map,n=[...e].sort((r,o)=>Kf.indexOf(d_[r.role])-Kf.indexOf(d_[o.role]));for(const r of n){if(!r.mailboxId||t.has(r.mailboxId))continue;const o=d_[r.role];o&&t.set(r.mailboxId,o)}return t}function NH(e,t,n){const r=e.displayNameOverride?.trim();if(r)return r;const o=Gf(e);return!t||!n?o:n(`sidebar.${t}`,o)}const pNe=new Set(["sent","drafts","trash"]),U8e=e=>e===void 0||!pNe.has(e),F8e=100,gNe=e=>e.trim().toLowerCase()==="inbox",mNe=(e,t)=>{if(e.hierarchyDelimiter.length===0)return!1;const n=`${e.fullPath}${e.hierarchyDelimiter}`;return t.some(r=>r.mailboxId!==e.mailboxId&&r.fullPath.startsWith(n))},vNe=["Appointed","Flagged","Reserved"],yNe=(e,t)=>e.mailboxId!==t.mailboxId?!1:e.source==="Stale"?t.specialUse?.includes(e.role)??!1:vNe.includes(e.source),bNe=(e,t)=>t.find(n=>yNe(n,e))?.role;function $8e(e,t,n){if(gNe(e.fullPath))return{deletable:!1,reason:"inbox",message:"The inbox can't be deleted."};const r=bNe(e,n);return r?{deletable:!1,reason:"role",message:`This folder is your ${r} folder. Reassign that role before deleting it.`}:mNe(e,t)?{deletable:!1,reason:"children",message:"This folder has subfolders. Delete them first."}:{deletable:!0}}function SNe(e,t){return e.filter(n=>n.mailboxId!==t)}function z8e(e){return{total:e,moved:0,phase:e===0?"moved":"moving"}}function j8e(e,t){if(e.phase!=="moving")return e;const n=Math.min(e.total,e.moved+Math.max(0,t));return{...e,moved:n,phase:n>=e.total?"moved":"moving"}}function B8e(e,t){return{...e,phase:"failed",error:t}}function H8e(e){return`Moved ${e.moved} of ${e.total}`}function q8e(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function V8e(e){return e>0?"choose-fate":"confirm-empty"}const wNe=new Set(["outbox","postvak uit","boîte d'envoi","postausgang","buzón de salida","posta in uscita","送信トレイ","送件匣","发件箱","skrzynka nadawcza"]),CNe=e=>{const t=Gf(e).trim().toLowerCase();return wNe.has(t)},_5=Kf.length,ENe=(e,t)=>{const n=ob(t);return[...e.filter(o=>{const s=n.get(o.mailboxId);return s==="drafts"||s==="sent"?!1:!CNe(o)})].sort((o,s)=>{const a=n.has(o.mailboxId)?Kf.indexOf(n.get(o.mailboxId)??"inbox"):_5,u=n.has(s.mailboxId)?Kf.indexOf(n.get(s.mailboxId)??"inbox"):_5;return a!==u?a-u:Gf(o).localeCompare(Gf(s),void 0,{sensitivity:"base",numeric:!0})})},_Ne=e=>e[0]?.hierarchyDelimiter??"/",xNe=({mailboxes:e,folderAppointments:t,currentMailboxId:n,excludeMailboxId:r,translator:o})=>{const s=ENe(e,t),a=ob(t);return(r?SNe(s,r):s).map(c=>({id:c.mailboxId,label:NH(c,a.get(c.mailboxId),o),path:c.fullPath,isCurrent:c.mailboxId===n,messageCount:c.messageCount}))},kH=_.createContext(void 0),x5=Symbol("appoint-failed"),ANe=({children:e})=>{const t=cl(),n=hNe(),[r,o]=_.useState(null),[s,a]=_.useState(),[u,c]=_.useState({kind:"choosing"}),f=r?.accountId,{data:h}=Xa({...rT(),staleTime:1/0,enabled:!!f}),{data:g}=Xa({...cA({path:{accountId:f??""}}),enabled:!!f}),{createFolderIn:m}=fNe(f),v=sR({...fIe(),meta:ty(409)}),w=h?.accounts.find(D=>D.accountId===f),S=_.useMemo(()=>g?.items??[],[g]),C=_.useMemo(()=>w?.folderAppointments??[],[w]),E=_.useMemo(()=>xNe({mailboxes:S,folderAppointments:C,translator:n}),[S,C,n]),A=C.find(D=>D.role===r?.role),I=r?.guessedMailboxId??A?.mailboxId,T=S.find(D=>D.mailboxId===I),N=r?.trashFolderLabel??(T?NH(T,ob(C).get(T.mailboxId),n):void 0),M=_.useRef(null),R=_.useCallback(()=>{M.current=null,o(null),a(void 0),c({kind:"choosing"})},[]),k=_.useCallback(D=>{M.current=D,o(D),c({kind:"choosing"}),a(D.reason==="unconfirmed"?D.guessedMailboxId:void 0)},[]),L=_.useCallback(D=>{M.current===D&&R()},[R]),q=_.useCallback(D=>{r&&(c({kind:"appointing"}),v.mutateAsync({path:{accountId:r.accountId,role:r.role},body:{mailboxId:D}}).catch(j=>(c({kind:"appoint-failed",cause:oNe(j)?"mailbox-pending":"generic"}),x5)).then(async j=>{j!==x5&&(await t.invalidateQueries({queryKey:yB()}),c({kind:"acting"}),await r.onAppointed(),L(r))}).catch(()=>L(r)))},[r,v,t,L]),F=_.useMemo(()=>({requestAppointment:k}),[k]);return O.jsxs(kH.Provider,{value:F,children:[e,r&&O.jsx(Pne,{open:!0,reason:r.reason,action:r.action,folders:E,delimiter:_Ne(S),trashFolderLabel:N,guessedMailboxId:I,staleFolderLabel:r.staleFolderLabel??A?.staleAppointmentPath,accountEmail:(h?.accounts.length??0)>1?w?.email:void 0,phase:u,selectedId:s,onSelect:a,onCreateFolder:m,onConfirm:q,onCancel:R})]})},INe=()=>{const e=_.useContext(kH);if(!e)throw new Error("useRoleAppointmentPrompt must be used within a RoleAppointmentPromptProvider");return e},DH=_.createContext(void 0),RNe=({children:e})=>{const[t,n]=_.useState(void 0),r=_.useRef(void 0),o=_.useRef(void 0),s=_.useRef(void 0),a=_.useRef(new Set),u=cl(),{pushError:c}=ZPe(),{requestAppointment:f}=INe(),h=_.useRef(async()=>({kind:"ran",outcome:{done:0,failedIds:[],refused:0,cancelled:!1}})),g=_.useCallback(S=>{GPe(u,WPe(UPe(S.action,S.mailboxId)));const C=new Set;if(S.accountId&&C.add(S.accountId),S.source.kind==="targets")for(const E of S.source.targets)E.accountId&&C.add(E.accountId);for(const E of C)u.invalidateQueries({queryKey:nT({path:{accountId:E}})})},[u]),m=_.useCallback(async S=>{const C=s.current;if(C)return{kind:"refused",reason:LPe(C.action.kind,C.matched,C.mailboxLabel)};const E=Symbol("bulk-run"),A=new AbortController;r.current=A,o.current=E,s.current=S,S.claimEnding&&(a.current.add(E),S.claimEnding(()=>a.current.delete(E))),n({action:S.action,mailboxId:S.mailboxId,progress:{done:0,total:S.matched}});const I=R=>{o.current===E&&n(k=>k&&{...k,progress:BPe(R)})},T=S.source.kind==="targets"?await TH(S.source.targets,S.applyBatch,I,A.signal):await jPe(S.source.fetchPage,S.matched,S.applyBatch,I,A.signal),N=a.current.delete(E);o.current===E&&(o.current=void 0,s.current=void 0,n(void 0));const M=T.error?rNe(T.error):void 0;return M?f({accountId:M.accountId,role:M.role,reason:M.reason,action:{kind:"delete",count:S.matched},onAppointed:async()=>{const R=await h.current({...S,claimEnding:void 0});R.kind==="refused"&&c({title:w5(S.action.kind,0),detail:R.reason})}}):T.error?c(YPe(w5(S.action.kind,T.done),kPe(S.action.kind),T.error)):T.refused>0&&c({severity:"warning",title:T.refused>1?`Couldn't delete ${T.refused} of ${S.matched} messages yet`:"Couldn't delete this message yet",detail:"Something else moved them while the delete was being prepared. They are back where they now sit — try again."}),N||S.reportEnding?.(S.action.kind,S.matched,T),T.done>0&&g(S),{kind:"ran",outcome:T}},[g,c,f]);h.current=m;const v=_.useCallback(S=>{s.current?.mailboxId===S&&r.current?.abort()},[]);_.useEffect(()=>{const S=a.current;return()=>{r.current?.abort(),r.current=void 0,o.current=void 0,s.current=void 0,S.clear()}},[]);const w=_.useMemo(()=>({run:t,start:m,stop:v}),[t,m,v]);return O.jsx(DH.Provider,{value:w,children:e})},W8e=()=>{const e=_.useContext(DH);if(!e)throw new Error("useBulkRun must be used within a BulkRunProvider");return e},TNe=600,ONe=300,LH="remit logs",MNe="https://github.com/remit-mail/reader/releases/tag/";function UH(e,t){const n=t?.check.lastCheckedAt;return n!==void 0&&n!==e.since}function PNe(e){const t=hn(e);return`The check could not be requested — ${t===void 0?"the server did not answer":`the server answered ${t}`}. Run \`remit logs backend\` to see why.`}const NNe={checking:"preparing",pulling:"preparing",snapshotting:"preparing",stopping:"restarting",starting:"restarting",verifying:"reconnecting",committing:"reconnecting",rollingBack:"reconnecting",recovering:"reconnecting"};function wT(e){return NNe[e]??"reconnecting"}function FH(e){const t=hn(e);return t===404||t===403||t===401}function _A(e,t){const n=e?.run??null;return n===null||n.outcome!==null||n.runId===t?null:n}function $H(e,t){const n=e?.check;if(n?.status==="ok"&&!(!n.updateAvailable||!n.latestVersion))return{version:n.latestVersion,releasedAt:xv(n.publishedAt)??t,releaseNotesUrl:n.releaseNotesUrl??zH(n.latestVersion),summary:n.summary??""}}function kNe(e){const t=e?.check.schemaVersion,n=e?.currentSchemaVersion;return t===void 0||n===void 0?!1:t>n}function xA(){return TNe+ONe}function AA(e,t){return Math.max(0,Math.floor((t-e)/1e3))}function xv(e){if(!e)return;const t=Date.parse(e);return Number.isNaN(t)?void 0:t}function zH(e){return`${MNe}${e}`}function Zf(e,t,n,r,o){return{status:"applying",runId:e,version:t,target:n,phase:r,elapsedSeconds:o}}function DNe(e,t,n){switch(n){case"succeeded":return{status:"succeeded",runId:t.runId,version:t.targetVersion,previousVersion:t.fromVersion,releaseNotesUrl:e.check.releaseNotesUrl??zH(t.targetVersion)};case"rolledBack":return{status:"rolledBack",runId:t.runId,version:t.fromVersion,attemptedVersion:t.targetVersion,reason:t.message,logsCommand:t.logCommand};case"rollbackFailed":return{status:"rollbackFailed",runId:t.runId,attemptedVersion:t.targetVersion,previousVersion:t.fromVersion,reason:t.message,logsCommand:t.logCommand};case"abandoned":return{status:"abandoned",runId:t.runId,version:t.fromVersion,attemptedVersion:t.targetVersion,reason:t.message,logsCommand:t.logCommand};default:return n}}function LNe(e,t,n,r){const o=e.check,s=xv(o.lastCheckedAt);if(n!==null)return{status:"checkFailed",version:e.currentVersion,reason:n,lastCheckedAt:s};if(t!==null&&!UH(t,e))return{status:"checking",version:e.currentVersion};if(o.status==="failed")return{status:"checkFailed",version:e.currentVersion,reason:o.error??"Remit could not reach the update service.",lastCheckedAt:s};if(o.status==="disabled")return{status:"neverChecked",version:e.currentVersion,lastCheckedAt:s};const a=$H(e,r);return a?{status:"available",version:e.currentVersion,release:a}:{status:"upToDate",version:e.currentVersion,checkedAt:xv(o.lastCheckedAt)??r}}function A5(e,t,n){return{surface:{status:"ready",section:e,overlay:t},releaseHeld:n}}function jH(e,t,n,r){return{status:"ready",section:Zf(e,t,n,"reconnecting",r),overlay:{kind:"applying",target:n,phase:"reconnecting",elapsedSeconds:r}}}function BH(e,t,n,r,o){return{status:"ready",section:Zf(e,t,n,"reconnecting",r),overlay:{kind:"neverCameBack",attemptedVersion:n,previousVersion:t,elapsedSeconds:r,logsCommand:o}}}function UNe(e,t){return{surface:BH(e.runId,e.previousVersion,e.attemptedVersion,t,LH),releaseHeld:!1}}function FNe(e,t,n,r,o){const s=AA(e.startedAt,o),a=t?.currentVersion??e.previousVersion,u=!r&&n!==null&&n.runId===e.runId;if(u&&n!==null&&n.outcome!==null)return null;if(u&&n!==null){const c=wT(n.phase);return A5(Zf(n.runId,a,n.targetVersion,c,s),{kind:"applying",target:n.targetVersion,phase:c,elapsedSeconds:s},!1)}return r?s>xA()?UNe(e,s):{surface:jH(e.runId,e.previousVersion,e.attemptedVersion,s),releaseHeld:!1}:t===void 0?{surface:{status:"loading"},releaseHeld:!1}:s>xA()?{surface:{status:"ready",section:{status:"unreachable",runId:e.runId,previousVersion:e.previousVersion,attemptedVersion:e.attemptedVersion,elapsedSeconds:s,logsCommand:n?.logCommand??LH},overlay:{kind:"none"}},releaseHeld:!0}:A5(Zf(e.runId,a,e.attemptedVersion,e.phase,s),{kind:"applying",target:e.attemptedVersion,phase:e.phase,elapsedSeconds:s},!1)}function I5(e){const{data:t,isError:n,dismissedRunId:r,checkPress:o,checkFailure:s,sighting:a,now:u}=e;if(n){const h=_A(t,r);if(h!==null){const g=a!==null&&a.runId===h.runId?a.observedAt:u,m=AA(g,u);return m>xA()?BH(h.runId,h.fromVersion,h.targetVersion,m,h.logCommand):jH(h.runId,h.fromVersion,h.targetVersion,m)}return{status:"ready",section:{status:"checkFailed",version:t?.currentVersion??"the current version",reason:"Remit could not reach the update service."},overlay:{kind:"none"}}}if(!t)return{status:"loading"};const c=t.run,f=c!==null&&r!==null&&c.runId===r;if(c!==null&&!f&&c.outcome!==null)return{status:"ready",section:DNe(t,c,c.outcome),overlay:{kind:"none"}};if(c!==null&&!f&&c.outcome===null){const h=AA(xv(c.startedAt)??u,u),g=wT(c.phase);return{status:"ready",section:Zf(c.runId,c.fromVersion,c.targetVersion,g,h),overlay:{kind:"applying",target:c.targetVersion,phase:g,elapsedSeconds:h}}}return{status:"ready",section:LNe(t,o,s,u),overlay:{kind:"none"}}}function $Ne(e){const{data:t,isError:n,error:r,held:o,now:s}=e,a=t?.run??null;if(FH(r)&&!o)return{surface:{status:"absent"},releaseHeld:!0};if(o){const u=FNe(o,t,a,n,s);return u||{surface:I5(e),releaseHeld:!0}}return{surface:I5(e),releaseHeld:!1}}const zNe=3e4,jNe=5e3,BNe=rI,HNe={...rI,...gre},qNe=3e4,VNe="The updater did not answer. Run `remit logs updater` to see why.";function WNe(e,t,n,r){if(FH(e)&&!n)return!1;const o=t!==null&&t.outcome===null;return n||o||r?jNe:zNe}function GNe(){const e=cl(),[t,n]=_.useState(null),[r,o]=_.useState(null),[s,a]=_.useState(null),[u,c]=_.useState(null),[f,h]=_.useState(null),g=_.useRef(t);g.current=t;const m=_.useRef(s);m.current=s;const v=e.getQueryData(dA()),w=t!==null||_A(v,r)!==null,S=Xa({...$Ie(),retry:!1,meta:w?HNe:BNe,refetchInterval:D=>WNe(D.state.error,D.state.data?.run??null,g.current!==null,m.current!==null)}),C=_.useRef(S.data);C.current=S.data;const E=$Ne({data:S.data,isError:S.isError,error:S.error,held:t,dismissedRunId:r,checkPress:s,checkFailure:u,sighting:f,now:Date.now()}),A=_A(S.data,r);_.useEffect(()=>{if(A===null){h(D=>D===null?D:null);return}h(D=>D!==null&&D.runId===A.runId?D:{runId:A.runId,observedAt:Date.now()})},[A]);const I=_.useRef(null);I.current=E.surface.status==="ready"&&"runId"in E.surface.section?E.surface.section.runId:null;const{releaseHeld:T}=E;_.useEffect(()=>{T&&n(D=>D===null?D:null)},[T]),_.useEffect(()=>{s!==null&&UH(s,S.data)&&a(null)},[s,S.data]),_.useEffect(()=>{if(s===null)return;const D=s.pressedAt+qNe-Date.now(),j=setTimeout(()=>{a(null),c(VNe)},Math.max(0,D));return()=>clearTimeout(j)},[s]);const{refetch:N}=S,M=_.useCallback(()=>{c(null),a({pressedAt:Date.now(),since:C.current?.check.lastCheckedAt}),vB({query:{refresh:!0},throwOnError:!0}).then(()=>{N()}).catch(D=>{hR(D,rI),a(null),c(PNe(D))})},[N]),R=_.useCallback(()=>{N()},[N]),k=sR({...zIe(),meta:{softError:!0},onSuccess:D=>{const j=D.run;j!==null&&(n({runId:j.runId,attemptedVersion:j.targetVersion,previousVersion:j.fromVersion,phase:wT(j.phase),startedAt:Date.now()}),o(null)),e.setQueryData(dA(),D)},onError:()=>{N()}}),{mutate:L}=k,q=_.useCallback(D=>{L({body:{targetVersion:D}})},[L]),F=_.useCallback(()=>{I.current!==null&&o(I.current),n(null),a(null),c(null)},[]);return{surface:E.surface,appliesSchemaMigration:kNe(S.data),currentVersion:S.data?.currentVersion,release:$H(S.data,Date.now()),onCheck:M,install:q,onDismissResult:F,onRetryConnection:R}}const CT=_.createContext(null);function KNe({children:e}){const t=GNe();return _.createElement(CT.Provider,{value:t},e)}function ZNe(){const e=_.useContext(CT);if(e===null)throw new Error("useSelfUpdate must be used within a SelfUpdateProvider");return e}function YNe(){return _.useContext(CT)}function QNe(){const{surface:e,onRetryConnection:t}=ZNe();if(e.status!=="ready")return null;const{overlay:n}=e;return n.kind==="applying"?O.jsx(Xne,{target:n.target,phase:n.phase,elapsedSeconds:n.elapsedSeconds}):n.kind==="neverCameBack"?O.jsx(Jne,{attemptedVersion:n.attemptedVersion,previousVersion:n.previousVersion,elapsedSeconds:n.elapsedSeconds,logsCommand:n.logsCommand,onRetryConnection:t}):null}const XNe=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,JNe=({children:e})=>{const[t,n]=_.useState([]),r=_.useCallback(u=>{if(u.error!=null&&ZF(u.error))return ju(u.error).correlationId;const c=eNe({...u,action:KPe(u)},XNe(),Date.now());return n(f=>XPe(f,c)),c.id},[]),o=_.useCallback(u=>{n(c=>JPe(c,u))},[]),s=_.useCallback(()=>{n([])},[]),a=_.useMemo(()=>({errors:t,pushError:r,dismissError:o,clearAll:s}),[t,r,o,s]);return O.jsxs(OH.Provider,{value:a,children:[e,O.jsx(Yte,{errors:t,onDismiss:o})]})},R5="mt-6 inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md bg-accent px-4 text-sm font-medium text-accent-fg hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring";function HH(){const[e,t]=_.useState(Gye),{Account:n}=Wye(),r=_.useRef(null);return _.useEffect(()=>Kye(t),[]),qv({id:"signed-out",open:e}),Vv(r,e),e?O.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-canvas/80 p-4 backdrop-blur-sm",children:O.jsxs("div",{ref:r,role:"alertdialog","aria-modal":"true","aria-labelledby":"signed-out-title","aria-describedby":"signed-out-text",tabIndex:-1,className:"w-full max-w-sm rounded-lg border border-line bg-surface p-6 shadow-xl outline-none",children:[O.jsx("h2",{id:"signed-out-title",className:"text-lg font-semibold text-fg",children:"You're signed out"}),O.jsx("p",{id:"signed-out-text",className:"mt-2 text-sm text-fg-muted",children:"The server no longer accepts this session. Sign in again to carry on here; you will come back to this screen."}),O.jsx(n,{fallback:O.jsxs("button",{type:"button",onClick:()=>{sU(),window.location.reload()},className:R5,children:[O.jsx(ek,{className:"size-4","aria-hidden":"true"}),"Sign in"]}),children:({signOut:o})=>O.jsxs("button",{type:"button",onClick:()=>{sU(),o()},className:R5,children:[O.jsx(ek,{className:"size-4","aria-hidden":"true"}),"Sign in"]})})]})}):null}const eke=({error:e,reset:t,info:n})=>{if(ey(e))return fR(),O.jsx(HH,{});const r=Qv(e),o=ju(e,{recoverable:r,componentStack:n?.componentStack});return O.jsx(r$,{fatal:o,onRetry:r?t:void 0})},ea=eye()({component:rke,errorComponent:eke}),tke=()=>{const{t:e}=mB("common",{useSuspense:!1});return O.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-canvas focus:text-fg focus:rounded-md",children:e("accessibility.skipToContent","Skip to main content")})},nke=({children:e})=>pc().updateMode==="managed"?e:O.jsxs(KNe,{children:[e,O.jsx(QNe,{})]});function rke(){return O.jsxs(JNe,{children:[O.jsx(ANe,{children:O.jsx(RNe,{children:O.jsx(nke,{children:O.jsxs(GIe,{children:[O.jsx(tke,{}),O.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:O.jsx(_.Suspense,{fallback:O.jsx(Kv,{}),children:O.jsx(Az,{})})})]})})})}),O.jsx(n$,{}),O.jsx(HH,{})]})}const oke=Ee("/")({beforeLoad:()=>{throw Sc({to:"/mail/brief"})}}),ske=pc().apiUrl;le.setConfig({baseUrl:ske,fetch:gF});le.interceptors.error.use((e,t)=>e instanceof Yv||!t?e:are(e,t.status));const ike=()=>Re(()=>import("./calendar-Dm6uO2dA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),ake=Ee("/calendar")({loader:({context:{queryClient:e}})=>{e.prefetchQuery(rT())},component:Ie(ike,"component")}),lke=()=>Re(()=>import("./import-LYqvEMAJ.js"),__vite__mapDeps([14,15,16,17,18,19,20,21,22])),uke=Ee("/import")({component:Ie(lke,"component")}),cke=vT(["match","properties","folder","rule","name","review","run"]),dke=ml("search"),fke=dke.optional().catch(void 0),hke=()=>Py({from:"/mail",select:e=>e.wizardFrom}),pke=cke.optional().catch(void 0),gke=(e,t)=>HF(e,t)+1,qH=()=>Py({from:"/mail",select:e=>e.wizard}),mke=()=>{const e=dh();return _.useCallback((t,n)=>{e({to:".",search:r=>({...r,wizard:t,wizardFrom:n})})},[e])},G8e=()=>{const e=qH(),t=mke(),[n,r]=_.useState("organize"),o=_.useCallback(a=>{r(a),t("match")},[t]),s=_.useCallback(()=>{t("properties","search")},[t]);return{verb:n,start:o,startFromSearch:s,isOpen:e!==void 0}},K8e=e=>{const t=gr(),n=dh(),r=qH(),o=hke(),s=_.useRef(r!==void 0),a=_.useRef(o),u=_.useRef(void 0);_.useEffect(()=>{u.current=void 0},[r]),_.useEffect(()=>{if(!s.current)return;s.current=!1;const g=a.current;(async()=>(await n({to:".",search:m=>({...m,wizard:void 0,wizardFrom:void 0}),replace:!0}),await n({to:".",search:m=>({...m,wizard:e,wizardFrom:g})})))()},[e,n]);const c=_.useCallback(g=>{g===r||u.current===g||(u.current=g,n({to:".",search:m=>({...m,wizard:g})}))},[n,r]),f=_.useCallback(()=>{t.history.back()},[t]),h=_.useCallback((g,m)=>{t.history.go(-gke(g,m))},[t]);return{step:r,goToStep:c,goBack:f,closeWizard:h}},bh=wo({q:Kn().optional()}),ET=bh.extend({}),VH=bh.extend({}),vke=bh.extend({}),WH=bh.extend({}),yke=ET,bke=bh.extend({wizard:pke,wizardFrom:fke}),f_=wo({body:Kn().optional()}),Z8e=e=>{const{body:t,...n}=e;return n},_T={brief:ET.extend(f_.shape),flagged:VH.extend(f_.shape),mailbox:WH.extend(f_.shape)},Ske=new Map;function Y8e(e){const t=new Map;for(const n of e){const r=ob(n.folderAppointments);for(const[o,s]of r)t.set(o,{role:s});for(const o of n.mailboxes){const s=r.get(o.mailboxId),a={providerPath:o.fullPath,hierarchyDelimiter:o.hierarchyDelimiter};t.set(o.mailboxId,s?{role:s,...a}:a)}}return t}function Q8e(e){const t=[];for(const[n,r]of e)r.role==="junk"&&t.push(n);return t}function X8e(e,t){const n=t[0];if(!e)return n?{mailboxId:n}:{};for(const o of t){const s=e.get(o);if(s&&xne(s)!==void 0)return{mailboxId:o,folder:s}}if(!n)return{};const r=e.get(n);return{mailboxId:n,...r?{folder:r}:{}}}const wke=_.createContext(null),J8e=()=>_.useContext(wke)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,resultFolderIndex:Ske,searchQuery:"",searchInput:"",searchViewKey:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onRaiseIntelligence:()=>{}},Cke=()=>Re(()=>import("./mail-S3HHCKeG.js"),__vite__mapDeps([23,5,4,3,1,2,6,7,8,9,10,11,24,25,26,27,28,29,30,31,32,17,13,33,34,35,36,37,38,39,40,41,42,43,44,45])),Eke=Ee("/mail")({loader:({context:{queryClient:e}})=>{e.prefetchQuery(rT()),e.prefetchQuery({...jIe(),staleTime:6e4})},component:Ie(Cke,"component"),validateSearch:bke}),_ke=()=>Re(()=>import("./onboarding-DGPNq5IJ.js"),__vite__mapDeps([46,47,15,16,17,18,19,30,10,21,45,48,22])),xke=Ee("/onboarding")({component:Ie(_ke,"component")});function Ake(){const e=YNe(),t=e?.surface.status==="ready"&&e.surface.section.status==="available";return O.jsx(NF,{label:t?"Update available":void 0,children:O.jsx($ee,{className:"size-4"})})}function Ike(){return Xa({...TIe()})}const h_={listed:"Sync warnings",unread:"Warnings could not be read",signedOut:"Session ended"};function Rke(e,t){if(ey(t))return h_.signedOut;if(t)return h_.unread;if(e&&((e.entries?.length??0)>0||(e.warnings?.length??0)>0))return h_.listed}function Tke(){const e=Ike();return Rke(e.data,e.error)}function Oke(){const e=Tke();return O.jsx(NF,{label:e,children:O.jsx(JA,{className:"size-4"})})}const Mke=ty(403,404),eFe={...ty(403,404,409,429),...mre},Pke=new Set([Pa.SignInDisabled,Pa.CallerDisabled]),GH=e=>{if(hn(e)!==403)return!1;const t=sl(e)?.code;return t!==void 0&&Pke.has(t)},Nke=e=>{if(Jv(e))return"The server could not be reached. Nothing changed. Try again.";const t=sl(e)?.code;return t===Pa.CannotDisableSelf?"You cannot disable your own account, so one account always stays on.":t===Pa.StepUpRequired?"The password check did not carry over to the action. Nothing changed. Try again.":t===Pa.ForeignOrigin?"The server refused a request from this address. Nothing changed. Open this page from the server's own address.":hn(e)===404?"That account is gone, or this server no longer has a People page. Reload the page.":"Something went wrong on the server. Nothing changed. Try again."},tFe=e=>Jv(e)?"The server could not be reached. Check your connection and try again.":"The server did not answer as expected. Try again.",nFe=e=>{if(hn(e)===401||GH(e))return{kind:"signedOut"};const t=sl(e)?.code;return t===Pa.WrongPassword?{kind:"wrongPassword"}:t===Pa.StepUpLocked?{kind:"locked"}:{kind:"failed",reason:Nke(e)}},rFe=(e,t)=>e==="Disable"?{title:`Disable ${t}?`,body:"They are signed out everywhere within 15 minutes and cannot sign in until you enable them again. Their calendar feed links stop working. Their mail stays.",confirmLabel:"Disable",failedTitle:`${t} was not disabled`,destructive:!0}:e==="Enable"?{title:`Enable ${t}?`,body:"They can sign in again with their password. Calendar feed links they shared before stay off; they make new ones in Settings.",confirmLabel:"Enable",failedTitle:`${t} was not enabled`,destructive:!1}:e==="SignOut"?{title:`Sign ${t} out everywhere?`,body:"Every session and connected app of theirs ends within 15 minutes. They can sign in again with their password.",confirmLabel:"Sign out everywhere",failedTitle:`${t} was not signed out`,destructive:!0}:{title:`Reset the password of ${t}?`,body:"Their password stops working at once and they are signed out everywhere. You get a link to give them, which works once, for 24 hours.",confirmLabel:"Make a reset link",failedTitle:`No reset link was made for ${t}`,destructive:!0},oFe=(e,t)=>{const n=hn(t),r=sl(t)?.code,o=t instanceof Error?t.message:String(t),s=[n??"no response",r,o].filter(a=>a!==void 0&&a!=="").join(" ");return oh(Bu({title:`People: ${e}`,errorMessage:`${e}. The server answered: ${s}`}))},kke=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),sFe=(e,t)=>kke(new Date(e),t)?"Today":AH(e,"medium"),iFe=(e,t)=>e.map(n=>n.userId===t.userId?t:n),Dke=()=>({...UIe(),meta:Mke,retry:!1}),Lke=()=>{const e=Xa(Dke()),t=e.isError&&GH(e.error);return _.useEffect(()=>{t&&fR()},[t]),{...e,unavailable:e.isError&&YF(e.error)}},KH=_.createContext([]),Uke=KH.Provider,Fke=()=>_.useContext(KH),$ke=()=>Re(()=>import("./settings-4eabvjnS.js"),[]),zke=[{id:"accounts",label:"Accounts",icon:O.jsx(CF,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:O.jsx(Fee,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:O.jsx(Aee,{className:"size-4"})},{id:"filters",label:"Filters",icon:O.jsx(_ee,{className:"size-4"})},{id:"labels",label:"Labels",icon:O.jsx(Dee,{className:"size-4"})},{id:"classification",label:"Mail classification",icon:O.jsx(Nee,{className:"size-4"})},{id:"calendars",label:"Calendars",icon:O.jsx(bee,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:O.jsx(Oee,{className:"size-4"})},{id:"warnings",label:"Warnings",icon:O.jsx(Oke,{})},{id:"advanced",label:"Advanced",icon:O.jsx(Ake,{})}],jke={id:"people",label:"People",icon:O.jsx(Uee,{className:"size-4"})},aFe=()=>{const e=Lke(),t=Fke(),n=[...zke];if(n.splice(1,0,...t.map(({id:o,label:s,icon:a})=>({id:o,label:s,icon:a}))),!e.isSuccess)return n;const r=n.findIndex(o=>o.id==="advanced");return[...n.slice(0,r),jke,...n.slice(r)]},Bke=Ee("/settings")({component:Ie($ke,"component")}),Hke=["year","month","week","day","agenda"],qke=vT(Hke),ZH="week",lFe=e=>e==="agenda";function Vke(e){const t=qke.safeParse(e);return t.success?t.data:void 0}const Wke=/^\d{4}-\d{2}-\d{2}$/;function Gke(e){if(!Wke.test(e))return;const[t,n,r]=e.split("-").map(Number),o=Date.UTC(t,n-1,r),s=new Date(o);if(s.getUTCFullYear()===t&&s.getUTCMonth()===n-1&&s.getUTCDate()===r)return e}const oc=e=>String(e).padStart(2,"0");function YH(e){return`${e.getFullYear()}-${oc(e.getMonth()+1)}-${oc(e.getDate())}`}function Kke(e,t){return{view:Vke(e.view)??ZH,date:Gke(e.date)??t}}function uFe(e,t,n){const[r,o,s]=e.split("-").map(Number);if(t==="year")return T5(r+n,o,s);if(t==="month")return T5(r,o+n,s);const a=t==="day"?1:7,u=new Date(Date.UTC(r,o-1,s+a*n));return Zke(u)}const Zke=e=>`${e.getUTCFullYear()}-${oc(e.getUTCMonth()+1)}-${oc(e.getUTCDate())}`;function T5(e,t,n){const r=e+Math.floor((t-1)/12),o=((t-1)%12+12)%12+1,s=new Date(Date.UTC(r,o,0)).getUTCDate();return`${r}-${oc(o)}-${oc(Math.min(n,s))}`}const Yke=Kn().min(1);function Qke(e){const t=e==null?[]:[e].flat(),n=new Set;for(const r of t){if(typeof r!="string"&&typeof r!="number")continue;const o=Yke.safeParse(String(r));o.success&&n.add(o.data)}return[...n].sort()}const xT=wo({calendarId:_v().transform(Qke).transform(e=>e.length===0?void 0:e).optional()});function cFe(e,t){return t?e==="week"?"day":e==="year"?"month":e:e}const Xke=Ee("/calendar/")({validateSearch:xT,beforeLoad:({search:e,location:t})=>{throw Sc({to:"/calendar/$view/$date",params:{view:ZH,date:YH(new Date)},search:e,hash:t.hash,replace:!0})}}),Jke=Ee("/mail/")({validateSearch:yke,beforeLoad:({search:e,location:t})=>{throw Sc({to:"/mail/brief",search:e,hash:t.hash,replace:!0})}}),e3e=()=>Re(()=>import("./_mailboxId-DlqMqGqM.js"),__vite__mapDeps([49,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,50,51,39,38,9,52,53,45,18,54,55,8,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,69,37,35,36,70,71,72,73,74,75,76])),t3e=Ee("/mail/$mailboxId")({component:Ie(e3e,"component"),validateSearch:WH}),n3e=()=>Re(()=>import("./brief-CbjthOAj.js"),__vite__mapDeps([77,13])),r3e=()=>Re(()=>import("./brief-BAVboLUI.js"),__vite__mapDeps([78,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,79,52,53,45,9,39,38,18,54,55,8,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,69,70,71,35,36,37,80,76])),o3e=Ee("/mail/brief")({component:Ie(r3e,"component"),validateSearch:ET,errorComponent:Ie(n3e,"errorComponent")}),s3e=()=>Re(()=>import("./flagged-Bjq-IpS_.js"),__vite__mapDeps([81,13])),i3e=()=>Re(()=>import("./flagged-DF7M44oi.js"),__vite__mapDeps([82,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,83,52,53,45,9,39,38,18,54,55,8,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,69,51,37,80,76])),a3e=Ee("/mail/flagged")({component:Ie(i3e,"component"),validateSearch:VH,errorComponent:Ie(s3e,"errorComponent")}),l3e=()=>Re(()=>import("./outbox-M7c0xAzB.js"),__vite__mapDeps([84,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,85,53,45,43,72,40,9,36,64,86,87,76])),u3e=Ee("/mail/outbox")({component:Ie(l3e,"component"),validateSearch:vke}),c3e=Ee("/reset-password/$token")({beforeLoad:()=>{throw Sc({to:"/"})}}),d3e=()=>Re(()=>import("./index-CJFN6_qF.js"),[]),f3e=Ee("/settings/")({component:Ie(d3e,"component")}),h3e=()=>Re(()=>import("./_slotId-DDM7bXIa.js"),__vite__mapDeps([88,4,3,6,89,7,18,90,40,74])),p3e=Ee("/settings/$slotId")({component:Ie(h3e,"component")}),g3e=()=>Re(()=>import("./accounts-LD3DHIQP.js"),__vite__mapDeps([91,47,15,16,17,18,19,30,10,21,45,48,29,92,33,13,56,6,93,89,7,90,40,74,61,86])),m3e=wo({editAccountId:Kn().optional(),focusSmtp:mT().optional(),connected:Kn().optional(),oauthError:Kn().optional(),oauthEmail:Kn().optional(),missingServices:Kn().optional()}),v3e=Ee("/settings/accounts")({component:Ie(g3e,"component"),validateSearch:m3e}),y3e=()=>Re(()=>import("./advanced-CwHXjE5M.js"),__vite__mapDeps([94,20,4,3,5,6,19,56,18,21,87,75,95,66,64,93,45,89,7,90,40,74])),b3e=Ee("/settings/advanced")({component:Ie(y3e,"component")}),S3e=()=>Re(()=>import("./appearance-DXhCiVla.js"),__vite__mapDeps([96,6,93,45,89,7,18,90,40,74,65])),w3e=Ee("/settings/appearance")({component:Ie(S3e,"component")}),C3e=()=>Re(()=>import("./calendars-fNaRHaAx.js"),__vite__mapDeps([97,59,13,38,16,17,19,61,98,31,99,100,25,74,33,18,37,101,6,89,7,90,40])),E3e=Ee("/settings/calendars")({component:Ie(C3e,"component")}),_3e=()=>Re(()=>import("./classification-CRDKgH1K.js"),__vite__mapDeps([102,103,13,16,17,33,92,18,6,89,7,90,40,74])),x3e=Ee("/settings/classification")({component:Ie(_3e,"component")}),A3e=()=>Re(()=>import("./filters-DKLKnl_R.js"),__vite__mapDeps([104,13,3,71,67,32,16,17,61,69,65,75,73,18,6,89,7,90,40,74])),I3e=Ee("/settings/filters")({component:Ie(A3e,"component")}),R3e=()=>Re(()=>import("./folders-CBDVbqCE.js"),__vite__mapDeps([105,68,42,6,89,7,18,90,40,74,13,16,17,25])),T3e=Ee("/settings/folders")({component:Ie(R3e,"component")}),O3e=()=>Re(()=>import("./labels-CMfUV9F8.js"),__vite__mapDeps([106,69,16,17,71,6,89,7,18,90,40,74,13,33])),M3e=Ee("/settings/labels")({component:Ie(O3e,"component")}),P3e=()=>Re(()=>import("./people-WnhpS7pI.js"),__vite__mapDeps([107,103,101,55,6,89,7,18,90,40,74])),N3e=Ee("/settings/people")({component:Ie(P3e,"component")}),k3e=()=>Re(()=>import("./senders-CjrCpj3s.js"),__vite__mapDeps([108,31,6,93,45,13,89,7,18,90,40,74])),D3e=Ee("/settings/senders")({component:Ie(k3e,"component")}),L3e=()=>Re(()=>import("./suggested-vips-D5AG6FUm.js"),[]),U3e=Ee("/settings/suggested-vips")({component:Ie(L3e,"component")}),F3e=()=>Re(()=>import("./warnings-CxANki4C.js"),__vite__mapDeps([109,41,38,18,75,101,95,13,6,93,45,89,7,90,40,74])),$3e=Ee("/settings/warnings")({component:Ie(F3e,"component")}),z3e=()=>Re(()=>import("./_view._date-aunsrlO1.js"),__vite__mapDeps([110,59,13,38,98,31,111,112,4,3,5,12,58,60,10,61,62,64,113,44,17,90,114,115,99,100,25,74,116,63,16,40,2,117])),j3e=Ee("/calendar/$view/$date")({validateSearch:xT,beforeLoad:({params:e,search:t,location:n})=>{const r=Kke(e,YH(new Date));if(!(r.view===e.view&&r.date===e.date))throw Sc({to:"/calendar/$view/$date",params:r,search:t,hash:n.hash,replace:!0})},component:Ie(z3e,"component")}),B3e=()=>Re(()=>import("./index-BhHZ2hYz.js"),__vite__mapDeps([118,50,51,39,5,4,3,34,11,38,9,52,53,45,24,17,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,37,35,36,70,71,72,73,74,75])),H3e=Ee("/mail/$mailboxId/")({component:Ie(B3e,"component")}),q3e=()=>Re(()=>import("./_threadId-BSH0itQ1.js"),[]),V3e=Ee("/mail/$mailboxId/$threadId")({component:Ie(q3e,"component")}),W3e=()=>Re(()=>import("./index-CLJXg4M_.js"),__vite__mapDeps([119,79,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,70,71,35,36,37,80])),G3e=Ee("/mail/brief/")({component:Ie(W3e,"component")}),K3e=()=>Re(()=>import("./_threadId-CdQh_MJ8.js"),[]),Z3e=Ee("/mail/brief/$threadId")({component:Ie(K3e,"component")}),Y3e=()=>Re(()=>import("./index-icM3qGGf.js"),__vite__mapDeps([120,83,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,51,37,80])),Q3e=Ee("/mail/flagged/")({component:Ie(Y3e,"component")}),X3e=()=>Re(()=>import("./_threadId-Bp-Ew-3E.js"),[]),J3e=Ee("/mail/flagged/$threadId")({component:Ie(X3e,"component")}),eDe=()=>Re(()=>import("./index-6pj7tvZO.js"),__vite__mapDeps([121,85,53,45,34,11,4,3,5,24,43,72,40,9,36,64,86,87])),tDe=Ee("/mail/outbox/")({component:Ie(eDe,"component")}),nDe=()=>Re(()=>import("./index-DtqBFgK5.js"),[]),rDe=Ee("/calendar/$view/$date/")({component:Ie(nDe,"component")}),oDe=()=>Re(()=>import("./_calendarObjectId-CVhLhFXf.js"),[]),sDe=Ee("/calendar/$view/$date/$calendarObjectId")({component:Ie(oDe,"component")}),Os=e=>String(e).padStart(2,"0"),QH=e=>`${e.getUTCFullYear()}-${Os(e.getUTCMonth()+1)}-${Os(e.getUTCDate())}`,AT=e=>{const t=e<0?"-":"+",n=Math.abs(e);return`${t}${Os(Math.floor(n/60))}:${Os(n%60)}`};function XH(e,t){const n=new Date(`${e}T${t}:00`);return`${e}T${t}:00${AT(-n.getTimezoneOffset())}`}const p_=new Map;function iDe(e){if(p_.has(e))return p_.get(e);let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{t=void 0}return p_.set(e,t),t}function IA(e,t){const n=iDe(e);if(!n)return Number.NaN;const r=n.formatToParts(new Date(t)),o=u=>Number(r.find(c=>c.type===u)?.value),s=o("hour")%24;return(Date.UTC(o("year"),o("month")-1,o("day"),s,o("minute"),o("second"))-t)/6e4}function O5(e,t,n){if(n==="")return`${e}T${t}:00+00:00`;const r=Date.parse(`${e}T${t}:00Z`),o=IA(n,r);if(Number.isNaN(o))return XH(e,t);const s=IA(n,r-o*6e4);return`${e}T${t}:00${AT(Number.isNaN(s)?o:s)}`}function M5(e,t){const n=Date.parse(e),r=IA(t,n),o=Number.isNaN(r)?-new Date(n).getTimezoneOffset():r,s=new Date(n+o*6e4);return`${QH(s)}T${Os(s.getUTCHours())}:${Os(s.getUTCMinutes())}:${Os(s.getUTCSeconds())}${AT(o)}`}const Av=e=>XH(e,"00:00");function Di(e,t){const[n,r,o]=e.split("-").map(Number);return QH(new Date(Date.UTC(n,r-1,o+t)))}function g_(e){const[t,n,r]=e.split("-").map(Number),o=new Date(Date.UTC(t,n-1,r));return Di(e,-((o.getUTCDay()+6)%7))}function aDe(e,t){const[n,r]=t.split("-").map(Number);if(e==="year")return[`${n}-01-01`,`${n+1}-01-01`];if(e==="month"){const s=`${n}-${Os(r)}-01`,a=r===12?`${n+1}-01-01`:`${n}-${Os(r+1)}-01`;return[g_(s),Di(g_(Di(a,-1)),7)]}if(e==="day")return[t,Di(t,1)];const o=g_(t);return[o,Di(o,7)]}function dFe(e,t){const[n,r]=aDe(e,t);return{from:Av(n),to:Av(r)}}function fFe(e,t){return{from:Av(e),to:Av(Di(e,t))}}const lDe=mPe({offset:!0,local:!1}),JH=vPe(),P5=_v().transform(e=>{const t=CH([lDe,JH]).safeParse(e);return t.success?t.data:void 0}).optional(),uDe=xT.extend({start:P5,end:P5}),qg=e=>JH.safeParse(e).success;function Vg(e){return{date:e,endDate:e,startTime:"09:00",endTime:"10:00",allDay:!1}}function hFe(e,t,n,r){if(e===void 0||t===void 0)return Vg(n);if(qg(e)&&qg(t)){const a=Di(t,-1);return a<e?Vg(n):{date:e,endDate:a,startTime:"",endTime:"",allDay:!0}}if(qg(e)||qg(t)||Date.parse(t)<=Date.parse(e))return Vg(n);const o=M5(e,r),s=M5(t,r);return{date:o.slice(0,10),endDate:s.slice(0,10),startTime:o.slice(11,16),endTime:s.slice(11,16),allDay:!1}}function pFe(e,t){return e.allDay?{start:e.date,end:Di(e.endDate,1)}:{start:O5(e.date,e.startTime,t),end:O5(e.endDate,e.endTime,t)}}const cDe=()=>Re(()=>import("./new-CKTDsGv_.js"),__vite__mapDeps([122,123,115,60,99,100,59,13,38,25,74,112,111,98,31,62,4,3,12,5,114,116,124,16,17,33])),dDe=Ee("/calendar/$view/$date/new")({validateSearch:uDe,component:Ie(cDe,"component")}),fDe=()=>Re(()=>import("./index-KN8V6cN7.js"),__vite__mapDeps([125,50,51,39,5,4,3,34,11,38,9,52,53,45,24,17,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,37,35,36,70,71,72,73,74,75])),hDe=Ee("/mail/$mailboxId/$threadId/")({component:Ie(fDe,"component")}),pDe=()=>Re(()=>import("./_messageId-KN8V6cN7.js"),__vite__mapDeps([126,50,51,39,5,4,3,34,11,38,9,52,53,45,24,17,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,37,35,36,70,71,72,73,74,75])),gDe=Ee("/mail/$mailboxId/$threadId/$messageId")({component:Ie(pDe,"component")}),mDe=()=>Re(()=>import("./compose._-_outboxMessageId_-CHBzY_fa.js"),__vite__mapDeps([127,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),vDe=Ee("/mail/$mailboxId/compose/{-$outboxMessageId}")({component:Ie(mDe,"component")}),yDe=()=>Re(()=>import("./index-DN1DLs0X.js"),__vite__mapDeps([128,79,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,70,71,35,36,37,80])),bDe=Ee("/mail/brief/$threadId/")({component:Ie(yDe,"component")}),SDe=()=>Re(()=>import("./_messageId-DN1DLs0X.js"),__vite__mapDeps([129,79,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,70,71,35,36,37,80])),wDe=Ee("/mail/brief/$threadId/$messageId")({component:Ie(SDe,"component")}),CDe=()=>Re(()=>import("./compose._-_outboxMessageId_-D7hd8Tdl.js"),__vite__mapDeps([130,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),EDe=Ee("/mail/brief/compose/{-$outboxMessageId}")({component:Ie(CDe,"component")}),_De=()=>Re(()=>import("./index-DVrkUlX2.js"),__vite__mapDeps([131,83,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,51,37,80])),xDe=Ee("/mail/flagged/$threadId/")({component:Ie(_De,"component")}),ADe=()=>Re(()=>import("./_messageId-DVrkUlX2.js"),__vite__mapDeps([132,83,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,51,37,80])),IDe=Ee("/mail/flagged/$threadId/$messageId")({component:Ie(ADe,"component")}),RDe=()=>Re(()=>import("./compose._-_outboxMessageId_-B33uCNdX.js"),__vite__mapDeps([133,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),TDe=Ee("/mail/flagged/compose/{-$outboxMessageId}")({component:Ie(RDe,"component")}),ODe=()=>Re(()=>import("./compose._-_outboxMessageId_-DiYwMDkQ.js"),__vite__mapDeps([134,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),MDe=Ee("/mail/outbox/compose/{-$outboxMessageId}")({component:Ie(ODe,"component")}),PDe=()=>Re(()=>import("./_outboxMessageId-BIrIq3Vo.js"),__vite__mapDeps([135,85,53,45,34,11,4,3,5,24,43,72,40,9,36,64,86,87])),NDe=Ee("/mail/outbox/draft/$outboxMessageId")({component:Ie(PDe,"component")}),kDe=()=>Re(()=>import("./index-BWIWbASS.js"),__vite__mapDeps([136,137,59,13,38,112,111,62,4,3,12,5,116,100,25,99,74,33])),DDe=Ee("/calendar/$view/$date/$calendarObjectId/")({component:Ie(kDe,"component")}),LDe=()=>Re(()=>import("./_recurrenceId-0huvJmsM.js"),[]),UDe=Ee("/calendar/$view/$date/$calendarObjectId/$recurrenceId")({component:Ie(LDe,"component")}),FDe=()=>Re(()=>import("./edit-BZa7tCBO.js"),__vite__mapDeps([138,123,115,60,99,100,59,13,38,25,74,112,111,98,31,62,4,3,12,5,114,116,124,16,17,33])),$De=Ee("/calendar/$view/$date/$calendarObjectId/edit")({component:Ie(FDe,"component")}),zDe=()=>Re(()=>import("./suggestion._suggestionId-CDQ4j2h8.js"),__vite__mapDeps([139,59,13,38,115,60,99,100,25,74,62,116,63,57,124,16,17,4,3,12,5])),jDe=Ee("/calendar/$view/$date/suggestion/$suggestionId")({component:Ie(zDe,"component")}),BDe=()=>Re(()=>import("./task._calendarTaskId-DQA8KsVJ.js"),__vite__mapDeps([140,59,13,38,111,4,3,12,5,113,100,25])),HDe=Ee("/calendar/$view/$date/task/$calendarTaskId")({component:Ie(BDe,"component")}),qDe=()=>Re(()=>import("./index-CKwz4x5U.js"),__vite__mapDeps([141,137,59,13,38,112,111,62,4,3,12,5,116,100,25,99,74,33])),VDe=Ee("/calendar/$view/$date/$calendarObjectId/$recurrenceId/")({component:Ie(qDe,"component")}),WDe=()=>Re(()=>import("./edit-DNs-CH-e.js"),__vite__mapDeps([142,123,115,60,99,100,59,13,38,25,74,112,111,98,31,62,4,3,12,5,114,116,124,16,17,33])),GDe=Ee("/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit")({component:Ie(WDe,"component")}),KDe=Ee("/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}")({validateSearch:_T.mailbox}),ZDe=Ee("/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}")({validateSearch:_T.brief}),YDe=Ee("/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}")({validateSearch:_T.flagged}),QDe=oke.update({id:"/",path:"/",getParentRoute:()=>ea}),IT=ake.update({id:"/calendar",path:"/calendar",getParentRoute:()=>ea}),XDe=uke.update({id:"/import",path:"/import",getParentRoute:()=>ea}),Ec=Eke.update({id:"/mail",path:"/mail",getParentRoute:()=>ea}),JDe=xke.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>ea}),Qn=Bke.update({id:"/settings",path:"/settings",getParentRoute:()=>ea}),eLe=Xke.update({id:"/",path:"/",getParentRoute:()=>IT}),tLe=Jke.update({id:"/",path:"/",getParentRoute:()=>Ec}),sb=t3e.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>Ec}),ib=o3e.update({id:"/brief",path:"/brief",getParentRoute:()=>Ec}),ab=a3e.update({id:"/flagged",path:"/flagged",getParentRoute:()=>Ec}),lb=u3e.update({id:"/outbox",path:"/outbox",getParentRoute:()=>Ec}),nLe=c3e.update({id:"/reset-password/$token",path:"/reset-password/$token",getParentRoute:()=>ea}),rLe=f3e.update({id:"/",path:"/",getParentRoute:()=>Qn}),oLe=p3e.update({id:"/$slotId",path:"/$slotId",getParentRoute:()=>Qn}),sLe=v3e.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Qn}),iLe=b3e.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Qn}),aLe=w3e.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Qn}),lLe=E3e.update({id:"/calendars",path:"/calendars",getParentRoute:()=>Qn}),uLe=x3e.update({id:"/classification",path:"/classification",getParentRoute:()=>Qn}),cLe=I3e.update({id:"/filters",path:"/filters",getParentRoute:()=>Qn}),dLe=T3e.update({id:"/folders",path:"/folders",getParentRoute:()=>Qn}),fLe=M3e.update({id:"/labels",path:"/labels",getParentRoute:()=>Qn}),hLe=N3e.update({id:"/people",path:"/people",getParentRoute:()=>Qn}),pLe=D3e.update({id:"/senders",path:"/senders",getParentRoute:()=>Qn}),gLe=U3e.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Qn}),mLe=$3e.update({id:"/warnings",path:"/warnings",getParentRoute:()=>Qn}),_c=j3e.update({id:"/$view/$date",path:"/$view/$date",getParentRoute:()=>IT}),vLe=H3e.update({id:"/",path:"/",getParentRoute:()=>sb}),RT=V3e.update({id:"/$threadId",path:"/$threadId",getParentRoute:()=>sb}),yLe=G3e.update({id:"/",path:"/",getParentRoute:()=>ib}),TT=Z3e.update({id:"/$threadId",path:"/$threadId",getParentRoute:()=>ib}),bLe=Q3e.update({id:"/",path:"/",getParentRoute:()=>ab}),OT=J3e.update({id:"/$threadId",path:"/$threadId",getParentRoute:()=>ab}),SLe=tDe.update({id:"/",path:"/",getParentRoute:()=>lb}),wLe=rDe.update({id:"/",path:"/",getParentRoute:()=>_c}),ub=sDe.update({id:"/$calendarObjectId",path:"/$calendarObjectId",getParentRoute:()=>_c}),CLe=dDe.update({id:"/new",path:"/new",getParentRoute:()=>_c}),ELe=hDe.update({id:"/",path:"/",getParentRoute:()=>RT}),eq=gDe.update({id:"/$messageId",path:"/$messageId",getParentRoute:()=>RT}),_Le=vDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>sb}),xLe=bDe.update({id:"/",path:"/",getParentRoute:()=>TT}),tq=wDe.update({id:"/$messageId",path:"/$messageId",getParentRoute:()=>TT}),ALe=EDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>ib}),ILe=xDe.update({id:"/",path:"/",getParentRoute:()=>OT}),nq=IDe.update({id:"/$messageId",path:"/$messageId",getParentRoute:()=>OT}),RLe=TDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>ab}),TLe=MDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>lb}),OLe=NDe.update({id:"/draft/$outboxMessageId",path:"/draft/$outboxMessageId",getParentRoute:()=>lb}),MLe=DDe.update({id:"/",path:"/",getParentRoute:()=>ub}),MT=UDe.update({id:"/$recurrenceId",path:"/$recurrenceId",getParentRoute:()=>ub}),PLe=$De.update({id:"/edit",path:"/edit",getParentRoute:()=>ub}),NLe=jDe.update({id:"/suggestion/$suggestionId",path:"/suggestion/$suggestionId",getParentRoute:()=>_c}),kLe=HDe.update({id:"/task/$calendarTaskId",path:"/task/$calendarTaskId",getParentRoute:()=>_c}),DLe=VDe.update({id:"/",path:"/",getParentRoute:()=>MT}),LLe=GDe.update({id:"/edit",path:"/edit",getParentRoute:()=>MT}),ULe=KDe.update({id:"/$mode/{-$outboxMessageId}",path:"/$mode/{-$outboxMessageId}",getParentRoute:()=>eq}),FLe=ZDe.update({id:"/$mode/{-$outboxMessageId}",path:"/$mode/{-$outboxMessageId}",getParentRoute:()=>tq}),$Le=YDe.update({id:"/$mode/{-$outboxMessageId}",path:"/$mode/{-$outboxMessageId}",getParentRoute:()=>nq}),zLe={CalendarViewDateCalendarObjectIdRecurrenceIdEditRoute:LLe,CalendarViewDateCalendarObjectIdRecurrenceIdIndexRoute:DLe},jLe=MT._addFileChildren(zLe),BLe={CalendarViewDateCalendarObjectIdRecurrenceIdRoute:jLe,CalendarViewDateCalendarObjectIdEditRoute:PLe,CalendarViewDateCalendarObjectIdIndexRoute:MLe},HLe=ub._addFileChildren(BLe),qLe={CalendarViewDateCalendarObjectIdRoute:HLe,CalendarViewDateNewRoute:CLe,CalendarViewDateIndexRoute:wLe,CalendarViewDateSuggestionSuggestionIdRoute:NLe,CalendarViewDateTaskCalendarTaskIdRoute:kLe},VLe=_c._addFileChildren(qLe),WLe={CalendarIndexRoute:eLe,CalendarViewDateRoute:VLe},GLe=IT._addFileChildren(WLe),KLe={MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:ULe},ZLe=eq._addFileChildren(KLe),YLe={MailMailboxIdThreadIdMessageIdRoute:ZLe,MailMailboxIdThreadIdIndexRoute:ELe},QLe=RT._addFileChildren(YLe),XLe={MailMailboxIdThreadIdRoute:QLe,MailMailboxIdIndexRoute:vLe,MailMailboxIdComposeChar123OutboxMessageIdChar125Route:_Le},JLe=sb._addFileChildren(XLe),e4e={MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:FLe},t4e=tq._addFileChildren(e4e),n4e={MailBriefThreadIdMessageIdRoute:t4e,MailBriefThreadIdIndexRoute:xLe},r4e=TT._addFileChildren(n4e),o4e={MailBriefThreadIdRoute:r4e,MailBriefIndexRoute:yLe,MailBriefComposeChar123OutboxMessageIdChar125Route:ALe},s4e=ib._addFileChildren(o4e),i4e={MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:$Le},a4e=nq._addFileChildren(i4e),l4e={MailFlaggedThreadIdMessageIdRoute:a4e,MailFlaggedThreadIdIndexRoute:ILe},u4e=OT._addFileChildren(l4e),c4e={MailFlaggedThreadIdRoute:u4e,MailFlaggedIndexRoute:bLe,MailFlaggedComposeChar123OutboxMessageIdChar125Route:RLe},d4e=ab._addFileChildren(c4e),f4e={MailOutboxIndexRoute:SLe,MailOutboxComposeChar123OutboxMessageIdChar125Route:TLe,MailOutboxDraftOutboxMessageIdRoute:OLe},h4e=lb._addFileChildren(f4e),p4e={MailMailboxIdRoute:JLe,MailBriefRoute:s4e,MailFlaggedRoute:d4e,MailOutboxRoute:h4e,MailIndexRoute:tLe},g4e=Ec._addFileChildren(p4e),m4e={SettingsSlotIdRoute:oLe,SettingsAccountsRoute:sLe,SettingsAdvancedRoute:iLe,SettingsAppearanceRoute:aLe,SettingsCalendarsRoute:lLe,SettingsClassificationRoute:uLe,SettingsFiltersRoute:cLe,SettingsFoldersRoute:dLe,SettingsLabelsRoute:fLe,SettingsPeopleRoute:hLe,SettingsSendersRoute:pLe,SettingsSuggestedVipsRoute:gLe,SettingsWarningsRoute:mLe,SettingsIndexRoute:rLe},v4e=Qn._addFileChildren(m4e),y4e={IndexRoute:QDe,CalendarRoute:GLe,ImportRoute:XDe,MailRoute:g4e,OnboardingRoute:JDe,SettingsRoute:v4e,ResetPasswordTokenRoute:nLe},b4e=ea._addFileChildren(y4e)._addFileTypes(),S4e=(e,t,n)=>{const r=mye({routeTree:b4e,context:{queryClient:e},history:n,stringifySearch:Cxe,defaultPreload:"intent",defaultPendingComponent:Kv,defaultPendingMs:200,defaultPendingMinMs:300});return r.subscribe("onResolved",o=>{t.recordPageView(o.toLocation.pathname),Mre(o.toLocation.pathname)}),r},De=e=>typeof e=="string",jd=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},N5=e=>e==null?"":""+e,w4e=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},C4e=/###/g,k5=e=>e&&e.indexOf("###")>-1?e.replace(C4e,"."):e,D5=e=>!e||De(e),mf=(e,t,n)=>{const r=De(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(D5(e))return{};const s=k5(r[o]);!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++o}return D5(e)?{}:{obj:e,k:k5(r[o])}},L5=(e,t,n)=>{const{obj:r,k:o}=mf(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let s=t[t.length-1],a=t.slice(0,t.length-1),u=mf(e,a,Object);for(;u.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),u=mf(e,a,Object),u?.obj&&typeof u.obj[`${u.k}.${s}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=n},E4e=(e,t,n,r)=>{const{obj:o,k:s}=mf(e,t,Object);o[s]=o[s]||[],o[s].push(n)},Iv=(e,t)=>{const{obj:n,k:r}=mf(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},_4e=(e,t,n)=>{const r=Iv(e,n);return r!==void 0?r:Iv(t,n)},rq=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?De(e[r])||e[r]instanceof String||De(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):rq(e[r],t[r],n):e[r]=t[r]);return e},du=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var x4e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const A4e=e=>De(e)?e.replace(/[&<>"'\/]/g,t=>x4e[t]):e;class I4e{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const R4e=[" ",",","?","!",";"],T4e=new I4e(20),O4e=(e,t,n)=>{t=t||"",n=n||"";const r=R4e.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const o=T4e.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!o.test(e);if(!s){const a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(s=!0)}return s},RA=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let s=0;s<r.length;){if(!o||typeof o!="object")return;let a,u="";for(let c=s;c<r.length;++c)if(c!==s&&(u+=n),u+=r[c],a=o[u],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<r.length-1)continue;s+=c-s+1;break}o=a}return o},Rv=e=>e?.replace("_","-"),M4e={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Tv{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||M4e,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(De(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Tv(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Tv(this.logger,t)}}var Fo=new Tv;class cb{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u.apply(u,[t,...r])})}}class U5 extends cb{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,a=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;t.indexOf(".")>-1?u=t.split("."):(u=[t,n],r&&(Array.isArray(r)?u.push(...r):De(r)&&s?u.push(...r.split(s)):u.push(r)));const c=Iv(this.data,u);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=u[0],n=u[1],r=u.slice(2).join(".")),c||!a||!De(r)?c:RA(this.data?.[t]?.[n],r,s)}addResource(t,n,r,o){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=[t,n];r&&(u=u.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(u=t.split("."),o=n,n=u[1]),this.addNamespaces(n),L5(this.data,u,o),s.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(De(r[s])||Array.isArray(r[s]))&&this.addResource(t,n,s,r[s],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,s){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[t,n];t.indexOf(".")>-1&&(u=t.split("."),o=r,r=n,n=u[1]),this.addNamespaces(n);let c=Iv(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?rq(c,r,s):c={...c,...r},L5(this.data,u,c),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var oq={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(s=>{t=this.processors[s]?.process(t,n,r,o)??t}),t}};const F5={},$5=e=>!De(e)&&typeof e!="boolean"&&typeof e!="number";class Ov extends cb{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),w4e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Fo.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!O4e(t,r,o);if(a&&!u){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:De(s)?[s]:s};const f=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),t=f.join(o)}return{key:t,namespaces:De(s)?[s]:s}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(t[t.length-1],n),c=u[u.length-1],f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode"){if(h){const F=n.nsSeparator||this.options.nsSeparator;return o?{res:`${c}${F}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${F}${a}`}return o?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const g=this.resolve(t,n);let m=g?.res;const v=g?.usedKey||a,w=g?.exactUsedKey||a,S=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,A=n.count!==void 0&&!De(n.count),I=Ov.hasDefaultValue(n),T=A?this.pluralResolver.getSuffix(f,n.count,n):"",N=n.ordinal&&A?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",M=A&&!n.ordinal&&n.count===0,R=M&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${T}`]||n[`defaultValue${N}`]||n.defaultValue;let k=m;E&&!m&&I&&(k=R);const L=$5(k),q=Object.prototype.toString.apply(k);if(E&&k&&L&&S.indexOf(q)<0&&!(De(C)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,k,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(g.res=F,g.usedParams=this.getUsedParamsDetails(n),g):F}if(s){const F=Array.isArray(k),D=F?[]:{},j=F?w:v;for(const Z in k)if(Object.prototype.hasOwnProperty.call(k,Z)){const he=`${j}${s}${Z}`;I&&!m?D[Z]=this.translate(he,{...n,defaultValue:$5(R)?R[Z]:void 0,joinArrays:!1,ns:u}):D[Z]=this.translate(he,{...n,joinArrays:!1,ns:u}),D[Z]===he&&(D[Z]=k[Z])}m=D}}else if(E&&De(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,t,n,r));else{let F=!1,D=!1;!this.isValidLookup(m)&&I&&(F=!0,m=R),this.isValidLookup(m)||(D=!0,m=a);const Z=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:m,he=I&&R!==m&&this.options.updateMissing;if(D||F||he){if(this.logger.log(he?"updateKey":"missingKey",f,c,a,he?R:m),s){const ue=this.resolve(a,{...n,keySeparator:!1});ue&&ue.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const Q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Q&&Q[0])for(let ue=0;ue<Q.length;ue++)B.push(Q[ue]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(n.lng||this.language):B.push(n.lng||this.language);const ae=(ue,we,U)=>{const X=I&&U!==m?U:Z;this.options.missingKeyHandler?this.options.missingKeyHandler(ue,c,we,X,he,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ue,c,we,X,he,n),this.emit("missingKey",ue,c,we,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?B.forEach(ue=>{const we=this.pluralResolver.getSuffixes(ue,n);M&&n[`defaultValue${this.options.pluralSeparator}zero`]&&we.indexOf(`${this.options.pluralSeparator}zero`)<0&&we.push(`${this.options.pluralSeparator}zero`),we.forEach(U=>{ae([ue],a+U,n[`defaultValue${U}`]||R)})}):ae(B,a,R))}m=this.extendTranslation(m,t,n,g,r),D&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(D||F)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,F?m:void 0))}return o?(g.res=m,g.usedParams=this.getUsedParamsDetails(n),g):m}extendTranslation(t,n,r,o,s){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=De(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const m=t.match(this.interpolator.nestingRegexp);h=m&&m.length}let g=r.replace&&!De(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),t=this.interpolator.interpolate(t,g,r.lng||this.language||o.usedLng,r),f){const m=t.match(this.interpolator.nestingRegexp),v=m&&m.length;h<v&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var m=arguments.length,v=new Array(m),w=0;w<m;w++)v[w]=arguments[w];return s?.[0]===v[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):a.translate(...v,n)},r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,c=De(u)?[u]:u;return t!=null&&c?.length&&r.applyPostProcessor!==!1&&(t=oq.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,s,a,u;return De(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(c,n),h=f.key;o=h;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const m=n.count!==void 0&&!De(n.count),v=m&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(De(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(C=>{this.isValidLookup(r)||(u=C,!F5[`${S[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(F5[`${S[0]}-${C}`]=!0,this.logger.warn(`key "${o}" for languages "${S.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(E=>{if(this.isValidLookup(r))return;a=E;const A=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(A,h,E,C,n);else{let T;m&&(T=this.pluralResolver.getSuffix(E,n.count,n));const N=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(A.push(h+T),n.ordinal&&T.indexOf(M)===0&&A.push(h+T.replace(M,this.options.pluralSeparator)),v&&A.push(h+N)),w){const R=`${h}${this.options.contextSeparator}${n.context}`;A.push(R),m&&(A.push(R+T),n.ordinal&&T.indexOf(M)===0&&A.push(R+T.replace(M,this.options.pluralSeparator)),v&&A.push(R+N))}}let I;for(;I=A.pop();)this.isValidLookup(r)||(s=I,r=this.getResource(E,C,I,n))}))})}),{res:r,usedKey:o,exactUsedKey:s,usedLng:a,usedNS:u}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!De(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const s of n)delete o[s]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class z5{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fo.create("languageUtils")}getScriptPartFromCode(t){if(t=Rv(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Rv(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(De(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),De(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],s=a=>{a&&(this.isSupportedCode(a)?o.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return De(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):De(t)&&s(this.formatLanguageCode(t)),r.forEach(a=>{o.indexOf(a)<0&&s(this.formatLanguageCode(a))}),o}}const j5={zero:0,one:1,two:2,few:3,many:4,other:5},B5={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class P4e{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Fo.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Rv(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:o});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),B5;if(!t.match(/-|_/))return B5;const c=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(c,n)}return this.pluralRulesCache[s]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,s)=>j5[o]-j5[s]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const H5=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=_4e(e,t,n);return!s&&o&&De(n)&&(s=RA(e,n,r),s===void 0&&(s=RA(t,n,r))),s},m_=e=>e.replace(/\$/g,"$$$$");class N4e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fo.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:s,prefixEscaped:a,suffix:u,suffixEscaped:c,formatSeparator:f,unescapeSuffix:h,unescapePrefix:g,nestingPrefix:m,nestingPrefixEscaped:v,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:C,maxReplaces:E,alwaysFormat:A}=t.interpolation;this.escape=n!==void 0?n:A4e,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=s?du(s):a||"{{",this.suffix=u?du(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=m?du(m):v||du("$t("),this.nestingSuffix=w?du(w):S||du(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=E||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let s,a,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=v=>{if(v.indexOf(this.formatSeparator)<0){const E=H5(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,r,{...o,...n,interpolationkey:v}):E}const w=v.split(this.formatSeparator),S=w.shift().trim(),C=w.join(this.formatSeparator).trim();return this.format(H5(n,c,S,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...o,...n,interpolationkey:S})};this.resetRegExp();const h=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>m_(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?m_(this.escape(v)):m_(v)}].forEach(v=>{for(u=0;s=v.regex.exec(t);){const w=s[1].trim();if(a=f(w),a===void 0)if(typeof h=="function"){const C=h(t,s,o);a=De(C)?C:""}else if(o&&Object.prototype.hasOwnProperty.call(o,w))a="";else if(g){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),a="";else!De(a)&&!this.useRawValueToEscape&&(a=N5(a));const S=v.safeValue(a);if(t=t.replace(s[0],S),g?(v.regex.lastIndex+=a.length,v.regex.lastIndex-=s[0].length):v.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,a;const u=(c,f)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const g=c.split(new RegExp(`${h}[ ]*{`));let m=`{${g[1]}`;c=g[0],m=this.interpolate(m,a);const v=m.match(/'/g),w=m.match(/"/g);((v?.length??0)%2===0&&!w||w.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),f&&(a={...f,...a})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,S),`${c}${h}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;o=this.nestingRegexp.exec(t);){let c=[];a={...r},a=a.replace&&!De(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let f=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const h=o[1].split(this.formatSeparator).map(g=>g.trim());o[1]=h.shift(),c=h,f=!0}if(s=n(u.call(this,o[1].trim(),a),a),s&&o[0]===t&&!De(s))return s;De(s)||(s=N5(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),s=""),f&&(s=c.reduce((h,g)=>this.format(h,g,r.lng,{...r,interpolationkey:o[1].trim()}),s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}const k4e=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(a=>{if(a){const[u,...c]=a.split(":"),f=c.join(":").trim().replace(/^'+|'+$/g,""),h=u.trim();n[h]||(n[h]=f),f==="false"&&(n[h]=!1),f==="true"&&(n[h]=!0),isNaN(f)||(n[h]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},fu=e=>{const t={};return(n,r,o)=>{let s=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(s={...s,[o.interpolationkey]:void 0});const a=r+JSON.stringify(s);let u=t[a];return u||(u=e(Rv(r),o),t[a]=u),u(n)}};class D4e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fo.create("formatter"),this.options=t,this.formats={number:fu((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return s=>o.format(s)}),currency:fu((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>o.format(s)}),datetime:fu((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return s=>o.format(s)}),relativetime:fu((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return s=>o.format(s,r.range||"day")}),list:fu((n,r)=>{const o=new Intl.ListFormat(n,{...r});return s=>o.format(s)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=fu(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(u=>u.indexOf(")")>-1)){const u=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,u)].join(this.formatSeparator)}return s.reduce((u,c)=>{const{formatName:f,formatOptions:h}=k4e(c);if(this.formats[f]){let g=u;try{const m=o?.formatParams?.[o.interpolationkey]||{},v=m.locale||m.lng||o.locale||o.lng||r;g=this.formats[f](u,v,{...h,...o,...m})}catch(m){this.logger.warn(m)}return g}else this.logger.warn(`there was no format function for ${f}`);return u},t)}}const L4e=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class U4e extends cb{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Fo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,o.backend,o)}queueLoad(t,n,r,o){const s={},a={},u={},c={};return t.forEach(f=>{let h=!0;n.forEach(g=>{const m=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,h=!1,a[m]===void 0&&(a[m]=!0),s[m]===void 0&&(s[m]=!0),c[g]===void 0&&(c[g]=!0)))}),h||(u[f]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const o=t.split("|"),s=o[0],a=o[1];n&&this.emit("failedLoading",s,a,n),!n&&r&&this.store.addResourceBundle(s,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const u={};this.queue.forEach(c=>{E4e(c.loaded,[s],a),L4e(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(f=>{u[f]||(u[f]={});const h=c.loaded[f];h.length&&h.forEach(g=>{u[f][g]===void 0&&(u[f][g]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:s,callback:a});return}this.readingCalls++;const u=(f,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&h&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,s*2,a)},s);return}a(f,h)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const f=c(t,n);f&&typeof f.then=="function"?f.then(h=>u(null,h)).catch(u):u(null,f)}catch(f){u(f)}return}return c(t,n,u)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();De(t)&&(t=this.languageUtils.toResolveHierarchy(t)),De(n)&&(n=[n]);const s=this.queueLoad(t,n,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],s=r[1];this.read(o,s,"read",void 0,void 0,(a,u)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${o} failed`,a),!a&&u&&this.logger.log(`${n}loaded namespace ${s} for language ${o}`,u),this.loaded(t,a,u)})}saveMissing(t,n,r,o,s){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const c={...a,isUpdate:s},f=this.backend.create.bind(this.backend);if(f.length<6)try{let h;f.length===5?h=f(t,n,r,o,c):h=f(t,n,r,o),h&&typeof h.then=="function"?h.then(g=>u(null,g)).catch(u):u(null,h)}catch(h){u(h)}else f(t,n,r,o,u,c)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const q5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),De(e[1])&&(t.defaultValue=e[1]),De(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),V5=e=>(De(e.ns)&&(e.ns=[e.ns]),De(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),De(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Wg=()=>{},F4e=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Yf extends cb{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=V5(t),this.services={},this.logger=Fo,this.modules={external:[]},F4e(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(De(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=q5();this.options={...o,...this.options,...V5(n)},this.options.interpolation={...o.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const s=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Fo.init(s(this.modules.logger),this.options):Fo.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=D4e;const g=new z5(this.options);this.store=new U5(this.options.resources,this.options);const m=this.services;m.logger=Fo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new P4e(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=s(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new N4e(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new U4e(s(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(v){for(var w=arguments.length,S=new Array(w>1?w-1:0),C=1;C<w;C++)S[C-1]=arguments[C];t.emit(v,...S)}),this.modules.languageDetector&&(m.languageDetector=s(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=s(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Ov(this.services,this.options),this.translator.on("*",function(v){for(var w=arguments.length,S=new Array(w>1?w-1:0),C=1;C<w;C++)S[C-1]=arguments[C];t.emit(v,...S)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Wg),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const c=jd(),f=()=>{const h=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),r(g,m)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wg;const o=De(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};o?a(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload?.forEach?.(u=>a(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const o=jd();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Wg),this.services.backendConnector.reload(t,n,s=>{o.resolve(),r(s)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&oq.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=jd();this.emit("languageChanging",t);const s=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,f)=>{f?(s(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},u=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const f=De(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,h=>{a(h,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),o}getFixedT(t,n,r){var o=this;const s=function(a,u){let c;if(typeof u!="object"){for(var f=arguments.length,h=new Array(f>2?f-2:0),g=2;g<f;g++)h[g-2]=arguments[g];c=o.options.overloadTranslationOptionHandler([a,u].concat(h))}else c={...u};c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||s.keyPrefix);const m=o.options.keySeparator||".";let v;return c.keyPrefix&&Array.isArray(a)?v=a.map(w=>`${c.keyPrefix}${m}${w}`):v=c.keyPrefix?`${c.keyPrefix}${m}${a}`:a,o.t(v,c)};return De(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(u,c)=>{const f=this.services.backendConnector.state[`${u}|${c}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,a);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!o||a(s,t)))}loadNamespaces(t,n){const r=jd();return this.options.ns?(De(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=jd();De(t)&&(t=[t]);const o=this.options.preload||[],s=t.filter(a=>o.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=o.concat(s),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new z5(q5());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Yf(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wg;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},s=new Yf(o);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(u=>{s[u]=this[u]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const u=Object.keys(this.store.data).reduce((c,f)=>(c[f]={...this.store.data[f]},Object.keys(c[f]).reduce((h,g)=>(h[g]={...c[f][g]},h),{})),{});s.store=new U5(u,o),s.services.resourceStore=s.store}return s.translator=new Ov(s.services,o),s.translator.on("*",function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),h=1;h<c;h++)f[h-1]=arguments[h];s.emit(u,...f)}),s.init(o,n),s.translator.options=o,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Bn=Yf.createInstance();Bn.createInstance=Yf.createInstance;Bn.createInstance;Bn.dir;Bn.init;Bn.loadResources;Bn.reloadResources;Bn.use;Bn.changeLanguage;Bn.getFixedT;Bn.t;Bn.exists;Bn.setDefaultNamespace;Bn.hasLoadedNamespace;Bn.loadNamespaces;Bn.loadLanguages;const{slice:$4e,forEach:z4e}=[];function j4e(e){return z4e.call($4e.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function B4e(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const W5=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,H4e=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let s=`${e}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!W5.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!W5.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},G5={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=H4e(e,t,o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var q4e={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return G5.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:s}=t;n&&typeof document<"u"&&G5.create(n,e,r,o,s)}},V4e={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const s=r.substring(1).split("&");for(let a=0;a<s.length;a++){const u=s[a].indexOf("=");u>0&&s[a].substring(0,u)===t&&(n=s[a].substring(u+1))}}return n}},W4e={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const s=o.substring(1);if(t){const a=s.split("&");for(let u=0;u<a.length;u++){const c=a[u].indexOf("=");c>0&&a[u].substring(0,c)===t&&(r=a[u].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let hu=null;const K5=()=>{if(hu!==null)return hu;try{if(hu=typeof window<"u"&&window.localStorage!==null,!hu)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{hu=!1}return hu};var G4e={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&K5())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&K5()&&window.localStorage.setItem(n,e)}};let pu=null;const Z5=()=>{if(pu!==null)return pu;try{if(pu=typeof window<"u"&&window.sessionStorage!==null,!pu)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{pu=!1}return pu};var K4e={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Z5())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Z5()&&window.sessionStorage.setItem(n,e)}},Z4e={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let s=0;s<n.length;s++)t.push(n[s]);r&&t.push(r),o&&t.push(o)}return t.length>0?t:void 0}},Y4e={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Q4e={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},X4e={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let sq=!1;try{document.cookie,sq=!0}catch{}const iq=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];sq||iq.splice(1,1);const J4e=()=>({order:iq,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class aq{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=j4e(n,this.options||{},J4e()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(q4e),this.addDetector(V4e),this.addDetector(G4e),this.addDetector(K4e),this.addDetector(Z4e),this.addDetector(Y4e),this.addDetector(Q4e),this.addDetector(X4e),this.addDetector(W4e)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.filter(r=>r!=null&&!B4e(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}aq.type="languageDetector";const lq=["__proto__","constructor","prototype"];function uq(e){return!(typeof e!="string"||e.length===0||e.length>128||lq.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%:&=;\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function cq(e){return!(!uq(e)||e.indexOf("/")>-1||e.indexOf("@")>-1)}function eUe(e){return!(!uq(e)||e.indexOf("//")>-1)}const tUe={lng:cq,ns:eUe};function Gg(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function nUe(e){if(typeof e!="string"||e.length===0)return e;try{const t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function dq(){return typeof XMLHttpRequest=="function"||typeof XMLHttpRequest=="object"}function rUe(e){return!!e&&typeof e.then=="function"}function oUe(e){return rUe(e)?e:Promise.resolve(e)}const sUe=/\{\{(.+?)\}\}/g,Y5=/^[/\\]{2}/;function Q5(e,t){let n=!1;const r=e.replace(sUe,(o,s)=>{const a=s.trim();if(lq.indexOf(a)>-1)return o;const u=t[a];if(u==null)return o;const c=tUe[a]||cq,f=String(u).split("+");for(const h of f)if(!c(h))return n=!0,o;return f.join("+")});return n||Y5.test(r)&&!Y5.test(e)?null:r}const Ba=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof window<"u"?window:void 0;let Mv;typeof fetch=="function"?Mv=fetch:Ba&&typeof Ba.fetch=="function"&&(Mv=Ba.fetch);const X5=dq()&&Ba?Ba.XMLHttpRequest:void 0,iUe=typeof ActiveXObject=="function"&&Ba?Ba.ActiveXObject:void 0,fq=["__proto__","constructor","prototype"],TA=(e,t)=>{if(t&&typeof t=="object"){let n="";for(const r of Object.keys(t))fq.indexOf(r)>-1||(n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]));if(!n)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+n.slice(1)}return e},J5=(e,t,n,r)=>{const o=s=>{if(!s.ok)return n(s.statusText||"Error",{status:s.status});s.text().then(a=>{n(null,{status:s.status,data:a})}).catch(n)};if(r){const s=r(e,t);if(s instanceof Promise){s.then(o).catch(n);return}}typeof fetch=="function"?fetch(e,t).then(o).catch(n):Mv(e,t).then(o).catch(n)},aUe=(e,t,n,r)=>{e.queryStringParams&&(t=TA(t,e.queryStringParams));const o={...typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders};typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(o["Content-Type"]="application/json");const s=typeof e.requestOptions=="function"?e.requestOptions(n):e.requestOptions,a={method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o,...e._omitFetchOptions?{}:s},u=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{J5(t,a,r,u)}catch(c){if(!s||Object.keys(s).length===0||!c.message||c.message.indexOf("not implemented")<0)return r(c);try{Object.keys(s).forEach(f=>{delete a[f]}),J5(t,a,r,u),e._omitFetchOptions=!0}catch(f){r(f)}}},lUe=(e,t,n,r)=>{n&&typeof n=="object"&&(n=TA("",n).slice(1)),e.queryStringParams&&(t=TA(t,e.queryStringParams));try{const o=X5?new X5:new iUe("MSXML2.XMLHTTP.3.0");o.open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");let s=e.customHeaders;if(s=typeof s=="function"?s():s,s)for(const a of Object.keys(s))fq.indexOf(a)>-1||o.setRequestHeader(a,s[a]);o.onreadystatechange=()=>{o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(o){console&&console.log(o)}},uUe=(e,t,n,r)=>{if(typeof n=="function"&&(r=n,n=void 0),r=r||(()=>{}),Mv&&t.indexOf("file:")!==0)return aUe(e,t,n,r);if(dq()||typeof ActiveXObject=="function")return lUe(e,t,n,r);r(new Error("No fetch and no xhr implementation found!"))},cUe=()=>({loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||""}),parseLoadPayload:(e,t)=>{},request:uUe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}});var hq=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...cUe(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){const r=setInterval(()=>this.reload(),this.options.reloadInterval);typeof r=="object"&&typeof r.unref=="function"&&r.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,o){let s=this.options.loadPath;typeof this.options.loadPath=="function"&&(s=this.options.loadPath(e,n)),s=oUe(s),s.then(a=>{if(!a)return o(null,{});const u=Q5(a,{lng:e.join("+"),ns:n.join("+")});if(u==null){const c=e.map(Gg).join(", "),f=n.map(Gg).join(", ");return o(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+c+"] namespaces=["+f+"]"),!1)}this.loadUrl(u,o,t,r)})}loadUrl(e,t,n,r){const o=typeof n=="string"?[n]:n,s=typeof r=="string"?[r]:r,a=this.options.parseLoadPayload(o,s),u=Gg(nUe(e));this.options.request(this.options,e,a,(c,f)=>{if(f&&(f.status>=500&&f.status<600||!f.status))return t("failed loading "+u+"; status code: "+f.status,!0);if(f&&f.status>=400&&f.status<500)return t("failed loading "+u+"; status code: "+f.status,!1);if(!f&&c&&c.message){const m=c.message.toLowerCase();if(["failed","fetch","network","load"].find(v=>m.indexOf(v)>-1))return t("failed loading "+u+": "+Gg(c.message),!0)}if(c)return t(c,!1);let h,g;try{typeof f.data=="string"?h=this.options.parse(f.data,n,r):h=f.data}catch{g="failed parsing "+u+" to json"}if(g)return t(g,!1);t(null,h)})}create(e,t,n,r,o){if(!this.options.addPath)return;typeof e=="string"&&(e=[e]);const s=this.options.parsePayload(t,n,r);let a=0;const u=[],c=[];e.forEach(f=>{let h=this.options.addPath;typeof this.options.addPath=="function"&&(h=this.options.addPath(f,t));const g=Q5(h,{lng:f,ns:t});if(g==null){a+=1,o&&a===e.length&&o(u,c);return}this.options.request(this.options,g,s,(m,v)=>{a+=1,u.push(m),c.push(v),a===e.length&&typeof o=="function"&&o(u,c)})})}reload(){const{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()==="cimode")return;const o=[],s=a=>{t.toResolveHierarchy(a).forEach(u=>{o.indexOf(u)<0&&o.push(u)})};s(r),this.allOptions.preload&&this.allOptions.preload.forEach(a=>s(a)),o.forEach(a=>{this.allOptions.ns.forEach(u=>{e.read(a,u,"read",null,null,(c,f)=>{c&&n.warn(`loading namespace ${u} for language ${a} failed`,c),!c&&f&&n.log(`loaded namespace ${u} for language ${a}`,f),e.loaded(`${a}|${u}`,c,f)})})})}};hq.type="backend";Bn.use(hq).use(aq).use(kxe).init({fallbackLng:"en",supportedLngs:["en","nl","de","fr"],ns:["common","mail"],defaultNS:"common",backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:["navigator","htmlTag"],caches:[]},interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged loaded"}});const dUe=({authProvider:e,settingsSlots:t=[],rootElementId:n="root"})=>{Rre(),Sxe(),e.configure(),Bye(e);const r=gxe();yre(r);const o=new pme({queryCache:new Y9({onError:Zye}),mutationCache:new Z9({onError:Yye}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}});yxe();const s=S4e(o,r);for(const c of t)if(Object.hasOwn(s.routesByPath,`/settings/${c.id}`))throw new Error(`Settings slot "${c.id}" collides with a built-in settings section`);r.recordPageView(window.location.pathname);const a=document.getElementById(n);if(!a)throw new Error(`Root element not found: #${n}`);const{Shell:u}=e;_ye.createRoot(a).render(O.jsx(_.StrictMode,{children:O.jsx(fB.Provider,{value:r,children:O.jsxs(gme,{client:o,children:[O.jsx(Vye,{value:e,children:O.jsx(Uke,{value:t,children:O.jsx(u,{children:O.jsx(bye,{router:s})})})}),!1]})})}))};dUe({authProvider:Vge});export{sc as $,Kv as A,Xr as B,bee as C,$te as D,NF as E,Iee as F,Cz as G,gr as H,CF as I,J8e as J,Tke as K,EF as L,Tee as M,$re as N,Az as O,GPe as P,WPe as Q,mB as R,Nee as S,Lee as T,cA as U,s8e as V,ob as W,N_ as X,NH as Y,U8e as Z,IIe as _,Xa as a,_Ie as a$,sAe as a0,nT as a1,ey as a2,pre as a3,hR as a4,pc as a5,wke as a6,Wye as a7,Fke as a8,t3e as a9,Z5e as aA,ik as aB,v3e as aC,n5e as aD,C8e as aE,y5e as aF,Qte as aG,n6e as aH,mUe as aI,t6e as aJ,V5e as aK,ZNe as aL,sre as aM,rre as aN,nre as aO,hn as aP,Yv as aQ,D6 as aR,q6e as aS,xIe as aT,H5e as aU,B5e as aV,q5e as aW,YF as aX,AH as aY,$5e as aZ,j5e as a_,i6e as aa,p3e as ab,aFe as ac,JA as ad,S8e as ae,SH as af,$ as ag,y8e as ah,b8e as ai,_Re as aj,ZPe as ak,YPe as al,t5e as am,J6e as an,bf as ao,jF as ap,SF as aq,wo as ar,mT as as,Kn as at,w8e as au,IUe as av,oh as aw,Bu as ax,rI as ay,K5e as az,yt as b,AUe as b$,mre as b0,RUe as b1,ef as b2,sl as b3,f8e as b4,fR as b5,h8e as b6,p8e as b7,g8e as b8,TUe as b9,H8e as bA,q8e as bB,fIe as bC,h5e as bD,$8e as bE,d_ as bF,oNe as bG,L8e as bH,eFe as bI,LIe as bJ,iFe as bK,Z6e as bL,X6e as bM,Q6e as bN,Y6e as bO,rFe as bP,nFe as bQ,Lke as bR,tFe as bS,oFe as bT,sFe as bU,S5e as bV,w5e as bW,Mee as bX,Y5e as bY,OIe as bZ,$Ue as b_,SUe as ba,one as bb,_Ue as bc,CUe as bd,bUe as be,bne as bf,nI as bg,a5e as bh,l5e as bi,fNe as bj,hNe as bk,xNe as bl,_Ne as bm,ine as bn,xUe as bo,wne as bp,uNe as bq,V6e as br,Jxe as bs,z8e as bt,B8e as bu,qAe as bv,j8e as bw,W6e as bx,F8e as by,V8e as bz,rT as c,Wo as c$,Ike as c0,Y8e as c1,Fee as c2,fee as c3,x5e as c4,YH as c5,O5 as c6,pFe as c7,lFe as c8,uFe as c9,_te as cA,wte as cB,Pte as cC,Gf as cD,MIe as cE,bc as cF,yn as cG,Fm as cH,j9 as cI,ume as cJ,mme as cK,bme as cL,Eme as cM,Sme as cN,wme as cO,Vn as cP,xme as cQ,x4 as cR,Cme as cS,INe as cT,rNe as cU,b5e as cV,bB as cW,LAe as cX,E8e as cY,SB as cZ,x8e as c_,cFe as ca,hr as cb,Bve as cc,vT as cd,a6e as ce,Py as cf,Kke as cg,Z8e as ch,FJ as ci,DP as cj,fUe as ck,hUe as cl,gUe as cm,MH as cn,u8e as co,c8e as cp,l8e as cq,gF as cr,i8e as cs,Re as ct,v8e as cu,DIe as cv,d8e as cw,a8e as cx,WIe as cy,Ste as cz,Zr as d,D8e as d$,G8e as d0,qH as d1,R8e as d2,MPe as d3,A8e as d4,I8e as d5,o6e as d6,r6e as d7,Ame as d8,cee as d9,X5e as dA,T8e as dB,N8e as dC,BIe as dD,O8e as dE,M8e as dF,P8e as dG,Q5e as dH,Qv as dI,PUe as dJ,MUe as dK,e8e as dL,m8e as dM,VPe as dN,r8e as dO,vIe as dP,ju as dQ,OUe as dR,X8e as dS,kUe as dT,NUe as dU,t8e as dV,K6e as dW,G6e as dX,UUe as dY,o8e as dZ,k8e as d_,LUe as da,DUe as db,Ree as dc,Cte as dd,xne as de,_ee as df,kne as dg,HF as dh,BUe as di,zUe as dj,ZUe as dk,Zne as dl,QUe as dm,HUe as dn,YUe as dp,Kne as dq,Lne as dr,Gr as ds,wUe as dt,e6e as du,XUe as dv,JUe as dw,KUe as dx,WUe as dy,WF as dz,cl as e,$De as e$,fFe as e0,FUe as e1,mke as e2,_8e as e3,W8e as e4,BAe as e5,jAe as e6,G5e as e7,wB as e8,HPe as e9,O5e as eA,M5e as eB,P5e as eC,R5e as eD,mAe as eE,ene as eF,vUe as eG,yUe as eH,p5e as eI,m5e as eJ,g5e as eK,EUe as eL,s5e as eM,dIe as eN,o5e as eO,i5e as eP,uIe as eQ,Q8e as eR,jIe as eS,bT as eT,k5e as eU,U5e as eV,D5e as eW,N5e as eX,L5e as eY,hFe as eZ,DDe as e_,qPe as ea,hke as eb,K8e as ec,jUe as ed,VUe as ee,qUe as ef,GUe as eg,J5e as eh,Dee as ei,u5e as ej,c5e as ek,hIe as el,f5e as em,d5e as en,Di as eo,dFe as ep,M5 as eq,F5e as er,E5e as es,A5e as et,_5e as eu,z5e as ev,C5e as ew,I5e as ex,n8e as ey,T5e as ez,sR as f,HDe as f0,VDe as f1,GDe as f2,wee as f3,W5e as g,r5e as h,v5e as i,O as j,yB as k,H6e as l,e5e as m,qv as n,Vv as o,rn as p,kee as q,_ as r,ty as s,See as t,dh as u,wF as v,Pee as w,XA as x,yee as y,Eee as z};
|
|
213
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const u=a[1];if(t===a[0]){s(a);continue}if(e.external){const f=e.external.registry.get(a[0])?.id;if(t!==a[0]&&f){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(u.cycle){s(a);continue}u.count>1&&e.reused==="ref"&&s(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function iH(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;iH(r);const o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;const s=r.type;for(const a of Array.isArray(s)?s:[s]){if(typeof a!="string")return;n.includes(a)||n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const aH=new Set(["type","properties","required","additionalProperties"]),u5=["oneOf","anyOf"];function c5(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function yA(e){const t=[];for(const s of e){if(typeof s!="object"||s.type!=="object")return null;for(const a in s)if(!aH.has(a))return null;t.push(s)}const n={},r=new Set;for(const s of t){for(const a in s.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const u=[];for(const f of t){const h=f.properties?.[a]??c5(f);h!=null&&(u.some(g=>JSON.stringify(g)===JSON.stringify(h))||u.push(h))}const c=u.length===1?u[0]:yA(u)??{allOf:u};Xi(n,a,c)}for(const a of s.required??[])r.add(a)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(s=>s.additionalProperties===!1))o.additionalProperties=!1;else{const s=[];for(const a of t){const u=c5(a);u&&!s.some(c=>JSON.stringify(c)===JSON.stringify(u))&&s.push(u)}s.length===1?o.additionalProperties=s[0]:s.length>1&&(o.additionalProperties={allOf:s})}return o}function k2e(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of aH)if(o in e)return;const n=t.filter(o=>u5.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=yA(t);else{const o=n[0],s=u5.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;const a=t.filter(c=>c!==o),u=o[s].map(c=>yA([...a,c]));if(u.some(c=>!c))return;r={[s]:u}}r&&(delete e.allOf,gf(e,r))}function lH(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const c=e.seen.get(u);if(c.ref===null)return;const f=c.def??c.schema,h={...f},g=c.ref;if(c.ref=null,g){r(g);const v=e.seen.get(g),w=v.schema;if(w.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(w)):gf(f,w),gf(f,h),u._zod.parent===g)for(const C in f)C==="$ref"||C==="allOf"||C in h||delete f[C];if(w.$ref&&v.def)for(const C in f)C==="$ref"||C==="allOf"||C in v.def&&JSON.stringify(f[C])===JSON.stringify(v.def[C])&&delete f[C]}const m=u._zod.parent;if(m&&m!==g){r(m);const v=e.seen.get(m);if(v?.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const w in f)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(f[w])===JSON.stringify(v.def[w])&&delete f[w]}e.override({zodSchema:u,jsonSchema:f,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const u of[...e.seen.entries()].reverse())r(u[0]);if(e.target!=="openapi-3.0")for(const u of e.seen.entries())iH(u[1].def??u[1].schema);for(const u of e.deferred)u();if(e.intersections.length){const u=new Map;for(const c of e.seen.values())for(const f of[c.schema,c.def]){const h=f?.allOf;if(!Array.isArray(h))continue;const g=u.get(h);g?g.push(f):u.set(h,[f])}for(const c of e.intersections)for(const f of u.get(c)??[])k2e(f)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}gf(o,n.defId?n.schema:n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;const a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const u of e.seen.entries()){const c=u[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Xi(a,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?o.$defs=a:o.definitions=a);try{const u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cv(t,"input",e.processors),output:Cv(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function qn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return qn(r.element,n);if(r.type==="set")return qn(r.valueType,n);if(r.type==="lazy")return qn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return qn(r.innerType,n);if(r.type==="intersection")return qn(r.left,n)||qn(r.right,n);if(r.type==="record"||r.type==="map")return qn(r.keyType,n)||qn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:qn(r.in,n)||qn(r.out,n);if(r.type==="object"){for(const o in r.shape)if(qn(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(qn(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(qn(o,n))return!0;return!!(r.rest&&qn(r.rest,n))}return!1}const D2e=(e,t={})=>n=>{const r=oH({...n,processors:t});return dn(e,r),sH(r,e),lH(r,e)},Cv=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},a=oH({...o??{},target:s,io:t,processors:n});return dn(e,a),sH(a,e),lH(a,e)},nc=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},rc=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},d5=(e,t)=>{nc(e,"minimum",t),rc(e,"maximum",t)},uH=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},cH=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},dH=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},fH=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},f5=(e,t)=>nc(e,"minimum",t.minimum),h5=(e,t)=>rc(e,"maximum",t.maximum),p5=e=>(t,n)=>{fH(t,n.format);const[r,o]=e[n.format];nc(t,"minimum",r),rc(t,"maximum",o)},L2e={greater_than:(e,t)=>nc(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>rc(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>uH(e,t.value),number_format:p5(TB),bigint_format:p5(rRe),min_length:f5,max_length:h5,length_equals:(e,t)=>d5(e,t.length),min_size:f5,max_size:h5,size_equals:(e,t)=>d5(e,t.size),string_format:(e,t)=>{fH(e,t.format),t.pattern&&cH(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>dH(e,t.mime)};function mo(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const s of r)L2e[s._zod.def.check]?.(t,s._zod.def);const o=e._zod.bag;o.minimum!==void 0&&nc(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&nc(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&rc(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&rc(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&uH(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&dH(t,o.mime);for(const s of o.patterns??[])cH(t,s);return t}const U2e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},F2e=new Map([[WB,rTe],[hT,oTe]]),hH=e=>F2e.get(e)??e,$2e=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:a,format:u,patterns:c,contentEncoding:f,laxFormat:h}=mo(e);if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),u&&(o.format=U2e[u]??u,o.format===""&&delete o.format,(u==="time"||h)&&delete o.format),f&&(o.contentEncoding=f),c&&c.size>0){const g=[...c].map(hH);g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},z2e=(e,t,n,r)=>{const o=n,{minimum:s,maximum:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:f,isInt:h}=mo(e);o.type=h?"integer":"number";const g=typeof f=="number"&&f>=(s??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(g?v?(o.minimum=f,o.exclusiveMinimum=!0):o.exclusiveMinimum=f:typeof s=="number"&&(o.minimum=s),m?v?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof a=="number"&&(o.maximum=a),u){const w=new Set;for(const E of u)Number.isFinite(E)&&E!==0?w.add(Math.abs(E)):Zi(e,t,o,r,`A multipleOf divisor of ${E} cannot be represented in JSON Schema`);const[S,...C]=w;S!==void 0&&(o.multipleOf=S),C.length&&(o.allOf=[...o.allOf??[],...C.map(E=>({multipleOf:E}))])}},j2e=(e,t,n,r)=>{n.type="boolean"},B2e=(e,t,n,r)=>{n.not={}},H2e=(e,t,n,r)=>{},q2e=(e,t,n,r)=>{const o=e._zod.def,s=fA(o.entries);if(s.length===0){n.not={};return}s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),n.enum=s},V2e=(e,t,n,r)=>{const o=e._zod.def;if(o.values.length===0){n.not={};return}const s=[];for(const a of o.values)if(a===void 0){if(Zi(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(Zi(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),s.every(a=>typeof a=="boolean")&&(n.type="boolean"),s.every(a=>a===null)&&(n.type="null"),n.enum=s},W2e=(e,t,n,r)=>{Zi(e,t,n,r,"Custom types cannot be represented in JSON Schema")},G2e=(e,t,n,r)=>{Zi(e,t,n,r,"Transforms cannot be represented in JSON Schema")},K2e=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:a,maximum:u}=mo(e);typeof a=="number"&&(o.minItems=a),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=dn(s.element,t,{...r,path:[...r.path,"items"]})};function Ev(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Ev(t.out):t.type==="catch"?Ev(t.innerType):e._zod.optin}const Z2e=(e,t,n,r)=>{const o=n,s=e._zod.def,a=s.shape;if(Object.getOwnPropertySymbols(a).length&&Zi(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const f in a)Xi(o.properties,f,dn(a[f],t,{...r,path:[...r.path,"properties",f]}));const c=[];for(const f of Object.keys(a)){const h=s.shape[f];(t.io==="input"?Ev(h)===void 0:h._zod.optout===void 0)&&c.push(f)}c.length>0&&(o.required=c),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=dn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Y2e=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((u,c)=>dn(u,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=a:n.anyOf=a},Q2e=(e,t,n,r)=>{const o=e._zod.def,s=dn(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=dn(o.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,c=[...u(s)?s.allOf:[s],...u(a)?a.allOf:[a]];n.allOf=c,t.intersections.push(c)};function bA(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const w=e.get(t)?.def;if(!w)return t;const S=bA(e,w,n);return S===w?t:S}for(const w of["anyOf","oneOf"]){const S=t[w];if(!Array.isArray(S))continue;const C=S.map(E=>bA(e,E,n));C.some((E,A)=>E!==S[A])&&(t={...t,[w]:C})}const r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(w=>w==="number"||w==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!s?.some(w=>typeof w=="number"))return t;const{minimum:a,maximum:u,exclusiveMinimum:c,exclusiveMaximum:f,multipleOf:h,format:g,id:m,...v}=t;return v.enum?v.enum=v.enum.map(w=>typeof w=="number"?String(w):w):typeof v.const=="number"&&(v.const=String(v.const)),o&&(v.type="string",s||(v.pattern=(r.includes("number")?cT:fTe).source)),v}const SA=new WeakMap;function X2e(e){const t=new Map;for(const r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);const n=new Map;for(const r of SA.get(e)??[]){const o=e.seen.get(r),s=(o?.def??o?.schema)?.propertyNames;if(!s||s===!0||n.has(s))continue;const a=bA(t,s,new Set);a!==s&&n.set(s,a)}if(n.size)for(const r of e.seen.values())for(const o of[r.schema,r.def]){const s=o&&n.get(o.propertyNames);s&&(o.propertyNames=s)}}const J2e=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const a=s.keyType,u=mo(a).patterns;if(s.mode==="loose"&&u&&u.size>0){const h=dn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const g of u)Xi(o.patternProperties,hH(g).source,h)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=dn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]});let h=SA.get(t);h||(h=[],SA.set(t,h),t.deferred.push(()=>X2e(t))),h.push(e)}o.additionalProperties=dn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const c=a._zod.values,f=t.io==="input"&&Ev(s.valueType)!==void 0;if(c&&!s.partial&&!f){const h=[...c].filter(g=>typeof g=="string"||typeof g=="number");h.length>0&&(o.required=h.map(String))}},eMe=(e,t,n,r)=>{const o=e._zod.def,s=dn(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},tMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},gT=Symbol();function pH(e,t,n,r,o){let s=!1;const a=JSON.stringify(e,(u,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Zi(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),gT):JSON.parse(a)}const nMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const a=pH(o.defaultValue,e,t,n,r);a!==gT&&(n.default=a)},rMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const a=pH(o.defaultValue,e,t,n,r);a!==gT&&(n._prefault=a)},oMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{Zi(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},sMe=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?o.out:o.in:o.out;dn(a,t,r);const u=t.seen.get(e);u.ref=a},iMe=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},gH=(e,t,n,r)=>{const o=e._zod.def;dn(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},g5=new WeakSet([Object.prototype,Error.prototype]);function Bg(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const aMe=(e,t)=>{_Re.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);g5.has(n)||(g5.add(n),Bg(n,"format",r=>o=>IRe(r,o)),Bg(n,"flatten",r=>o=>ARe(r,o)),Bg(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,hA,2)}),Bg(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,hA,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},no=te("ZodError",aMe,void 0,{Parent:Error}),lMe=eb(no),uMe=tb(no),cMe=lT(no),dMe=uT(no),fMe=NRe(no),hMe=kRe(no),pMe=DRe(no),gMe=LRe(no),mMe=URe(no),vMe=FRe(no),yMe=$Re(no),bMe=zRe(no);function SMe(){So.localeError||Vo(jOe())}function rb(){So.memoizer||Vo({memoizer:FOe()})}const Yt=te("ZodType",(e,t)=>(SMe(),Zt.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(Rr(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ji(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(pPe(e,t))},superRefine(e,t){return this.check(gPe(e,t))},overwrite(e){return this.check(Cc(e))},optional(){return y5(this)},exactOptional(){return tPe(this)},nullable(){return b5(this)},nullish(){return y5(b5(this))},nonoptional(e){return aPe(this,e)},array(){return wH(this)},or(e){return CH([this,e])},and(e){return YMe(this,e)},transform(e){return S5(this,ePe(e))},default(e){return oPe(this,e)},prefault(e){return iPe(this,e)},catch(e){return uPe(this,e)},pipe(e){return S5(this,e)},readonly(){return fPe(this)},describe(e){const t=this.clone();return Jd.add(t,{description:e}),t},meta(...e){if(e.length===0)return Jd.get(this);const t=this.clone();return Jd.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return MB(this,"~standard",{...jB(this),jsonSchema:{input:Cv(this,"input"),output:Cv(this,"output")}})},set"~standard"(e){Ki(this,"~standard",e)},parse:function e(t,n){return lMe(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await uMe(this,t,n,{callee:e})},safeParse(e,t){return cMe(this,e,t)},async safeParseAsync(e,t){return dMe(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ki(this,"spa",e)},validate(e,t){return ORe(this,e,t)},validateAsync(e,t){return PRe(this,e,t)},encode:function e(t,n){return fMe(this,t,n,{callee:e})},decode:function e(t,n){return hMe(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await pMe(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await gMe(this,t,n,{callee:e})},safeEncode(e,t){return mMe(this,e,t)},safeDecode(e,t){return vMe(this,e,t)},async safeEncodeAsync(e,t){return yMe(this,e,t)},async safeDecodeAsync(e,t){return bMe(this,e,t)},toJSONSchema(e){return D2e(this,{})(e)},get description(){return Jd.get(this)?.description},get _def(){return this._zod.def}}),mH=te("_ZodString",(e,t)=>{fT.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$2e(e,n,r)},PB({format:e=>mo(e).format??null,minLength:e=>mo(e).minimum??null,maxLength:e=>mo(e).maximum??null},{regex(...e){return this.check(b2e(...e))},includes(...e){return this.check(C2e(...e))},startsWith(...e){return this.check(E2e(...e))},endsWith(...e){return this.check(_2e(...e))},min(...e){return this.check(wv(...e))},max(...e){return this.check(nH(...e))},length(...e){return this.check(rH(...e))},nonempty(...e){return this.check(wv(1,...e))},lowercase(e){return this.check(S2e(e))},uppercase(e){return this.check(w2e(e))},trim(){return this.check(A2e())},normalize(...e){return this.check(x2e(...e))},toLowerCase(){return this.check(I2e())},toUpperCase(){return this.check(R2e())},slugify(){return this.check(T2e())}})),wMe=te("ZodString",(e,t)=>{fT.init(e,t),mH.init(e,t)},{email(e){return this.check(JB(bH,e))},url(e){return this.check(YOe(xMe,e))},jwt(e){return this.check(d2e(zMe,e))},emoji(e){return this.check(QOe(AMe,e))},guid(e){return this.check(VOe(_Me,e))},uuid(e){return this.check(WOe(Hg,e))},uuidv4(e){return this.check(GOe(Hg,e))},uuidv6(e){return this.check(KOe(Hg,e))},uuidv7(e){return this.check(ZOe(Hg,e))},nanoid(e){return this.check(XOe(IMe,e))},cuid(e){return this.check(JOe(RMe,e))},cuid2(e){return this.check(e2e(TMe,e))},ulid(e){return this.check(t2e(OMe,e))},base64(e){return this.check(l2e(UMe,e))},base64url(e){return this.check(u2e(FMe,e))},xid(e){return this.check(n2e(MMe,e))},ksuid(e){return this.check(r2e(PMe,e))},ipv4(e){return this.check(o2e(NMe,e))},ipv6(e){return this.check(s2e(kMe,e))},cidrv4(e){return this.check(i2e(DMe,e))},cidrv6(e){return this.check(a2e(LMe,e))},e164(e){return this.check(c2e($Me,e))},datetime(e){return this.check(eH(vH,e))},date(e){return this.check(tH(yH,e))},time(e){return this.check(f2e(CMe,e))},duration(e){return this.check(h2e(EMe,e))}});function Kn(e){return qOe(wMe,e)}const Qt=te("ZodStringFormat",(e,t)=>{Vt.init(e,t),mH.init(e,t)}),vH=te("ZodISODateTime",(e,t)=>{GTe.init(e,t),Qt.init(e,t)}),yH=te("ZodISODate",(e,t)=>{KTe.init(e,t),Qt.init(e,t)}),CMe=te("ZodISOTime",(e,t)=>{ZTe.init(e,t),Qt.init(e,t)}),EMe=te("ZodISODuration",(e,t)=>{YTe.init(e,t),Qt.init(e,t)}),bH=te("ZodEmail",(e,t)=>{NTe.init(e,t),Qt.init(e,t)});function w8e(e){return JB(bH,e)}const _Me=te("ZodGUID",(e,t)=>{MTe.init(e,t),Qt.init(e,t)}),Hg=te("ZodUUID",(e,t)=>{PTe.init(e,t),Qt.init(e,t)}),xMe=te("ZodURL",(e,t)=>{$Te.init(e,t),Qt.init(e,t)}),AMe=te("ZodEmoji",(e,t)=>{zTe.init(e,t),Qt.init(e,t)}),IMe=te("ZodNanoID",(e,t)=>{jTe.init(e,t),Qt.init(e,t)}),RMe=te("ZodCUID",(e,t)=>{BTe.init(e,t),Qt.init(e,t)}),TMe=te("ZodCUID2",(e,t)=>{HTe.init(e,t),Qt.init(e,t)}),OMe=te("ZodULID",(e,t)=>{qTe.init(e,t),Qt.init(e,t)}),MMe=te("ZodXID",(e,t)=>{VTe.init(e,t),Qt.init(e,t)}),PMe=te("ZodKSUID",(e,t)=>{WTe.init(e,t),Qt.init(e,t)}),NMe=te("ZodIPv4",(e,t)=>{QTe.init(e,t),Qt.init(e,t)}),kMe=te("ZodIPv6",(e,t)=>{JTe.init(e,t),Qt.init(e,t)}),DMe=te("ZodCIDRv4",(e,t)=>{eOe.init(e,t),Qt.init(e,t)}),LMe=te("ZodCIDRv6",(e,t)=>{nOe.init(e,t),Qt.init(e,t)}),UMe=te("ZodBase64",(e,t)=>{rOe.init(e,t),Qt.init(e,t)}),FMe=te("ZodBase64URL",(e,t)=>{sOe.init(e,t),Qt.init(e,t)}),$Me=te("ZodE164",(e,t)=>{iOe.init(e,t),Qt.init(e,t)}),zMe=te("ZodJWT",(e,t)=>{lOe.init(e,t),Qt.init(e,t)}),SH=te("ZodNumber",(e,t)=>{GB.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>z2e(e,n,r,o),e.isFinite=!0},PB({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=mo(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=mo(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=mo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>mo(e).format??null},{gt(e,t){return this.check(i5(e,t))},gte(e,t){return this.check(u_(e,t))},min(e,t){return this.check(u_(e,t))},lt(e,t){return this.check(s5(e,t))},lte(e,t){return this.check(l_(e,t))},max(e,t){return this.check(l_(e,t))},int(e){return this.check(m5(e))},safe(e){return this.check(m5(e))},positive(e){return this.check(i5(0,e))},nonnegative(e){return this.check(u_(0,e))},negative(e){return this.check(s5(0,e))},nonpositive(e){return this.check(l_(0,e))},multipleOf(e,t){return this.check(a5(e,t))},step(e,t){return this.check(a5(e,t))},finite(){return this}}));function wA(e){return p2e(SH,e)}const jMe=te("ZodNumberFormat",(e,t)=>{uOe.init(e,t),SH.init(e,t)});function m5(e){return g2e(jMe,e)}const BMe=te("ZodBoolean",(e,t)=>{cOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>j2e(e,n,r)});function mT(e){return m2e(BMe,e)}const HMe=te("ZodUnknown",(e,t)=>{dOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>H2e()});function _v(){return v2e(HMe)}const qMe=te("ZodNever",(e,t)=>{fOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>B2e(e,n,r)});function VMe(e){return y2e(qMe,e)}const WMe=te("ZodArray",(e,t)=>{rb(),gOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>K2e(e,n,r,o),e.element=t.element},{min(e,t){return this.check(wv(e,t))},nonempty(e){return this.check(wv(1,e))},max(e,t){return this.check(nH(e,t))},length(e,t){return this.check(rH(e,t))},unwrap(){return this.element}});function wH(e,t){return O2e(WMe,e,t)}const GMe=te("ZodObject",(e,t)=>{rb(),yOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Z2e(e,n,r,o),vRe(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return vT(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Rr(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Rr(this._zod.def,{catchall:_v()}))},loose(){return this.clone(Rr(this._zod.def,{catchall:_v()}))},strict(){return this.clone(Rr(this._zod.def,{catchall:VMe()}))},strip(){return this.clone(Rr(this._zod.def,{catchall:void 0}))},extend(e){return iRe(this,e)},safeExtend(e){return aRe(this,e)},merge(e){return lRe(this,e)},pick(e){return oRe(this,e)},omit(e){return sRe(this,e)},partial(...e){return j6(EH,this,e[0])},exactPartial(...e){return j6(_H,this,e[0],"exactPartial")},required(...e){return uRe(xH,this,e[0])}});function wo(e,t){const n={type:"object",shape:e??{},..._e(t)};return new GMe(n)}const KMe=te("ZodUnion",(e,t)=>{bOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Y2e(e,n,r,o),e.options=t.options});function CH(e,t){return new KMe({type:"union",options:e,..._e(t)})}const ZMe=te("ZodIntersection",(e,t)=>{SOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Q2e(e,n,r,o)});function YMe(e,t){return new ZMe({type:"intersection",left:e,right:t})}const v5=te("ZodRecord",(e,t)=>{rb(),wOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>J2e(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function QMe(e,t,n){return!t||!t._zod?new v5({type:"record",keyType:Kn(),valueType:e,..._e(t)}):new v5({type:"record",keyType:e,valueType:t,..._e(n)})}const CA=te("ZodEnum",(e,t)=>{COe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>q2e(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const a of r)if(n.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new CA({...t,checks:[],..._e(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new CA({...t,checks:[],..._e(o),entries:s})}});function vT(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new CA({type:"enum",entries:n,..._e(t)})}const XMe=te("ZodLiteral",(e,t)=>{EOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>V2e(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ml(e,t){return new XMe({type:"literal",values:Array.isArray(e)?e:[e],..._e(t)})}const JMe=te("ZodTransform",(e,t)=>{rb(),_Oe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>G2e(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new NB(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Wf(s,n.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Wf(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function ePe(e){return new JMe({type:"transform",transform:e})}const EH=te("ZodOptional",(e,t)=>{YB.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gH(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function y5(e){return new EH({type:"optional",innerType:e})}const _H=te("ZodExactOptional",(e,t)=>{xOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gH(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function tPe(e){return new _H({type:"optional",innerType:e})}const nPe=te("ZodNullable",(e,t)=>{AOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function b5(e){return new nPe({type:"nullable",innerType:e})}const rPe=te("ZodDefault",(e,t)=>{IOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function oPe(e,t){return new rPe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():IB(t)}})}const sPe=te("ZodPrefault",(e,t)=>{ROe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function iPe(e,t){return new sPe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():IB(t)}})}const xH=te("ZodNonOptional",(e,t)=>{TOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function aPe(e,t){return new xH({type:"nonoptional",innerType:e,..._e(t)})}const lPe=te("ZodCatch",(e,t)=>{OOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uPe(e,t){return new lPe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:bRe(t)})}const cPe=te("ZodPipe",(e,t)=>{MOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sMe(e,n,r,o),e.in=t.in,e.out=t.out});function S5(e,t){return new cPe({type:"pipe",in:e,out:t})}const dPe=te("ZodReadonly",(e,t)=>{POe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>iMe(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function fPe(e){return new dPe({type:"readonly",innerType:e})}const hPe=te("ZodCustom",(e,t)=>{NOe.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>W2e(e,n,r,o)});function pPe(e,t={}){return M2e(hPe,e,t)}function gPe(e,t){return P2e(e,t)}function mPe(e){return eH(vH,e)}function vPe(e){return tH(yH,e)}wo({kind:ml("Boolean"),value:mT()});wo({kind:ml("String"),value:Kn()});wo({kind:ml("Number"),value:wA()});wo({kind:ml("StringList"),value:wH(Kn())});wo({kind:ml("Map"),value:QMe(Kn(),Kn())});wo({kind:ml("MutedFlag"),value:wo({value:mT(),setAt:wA(),setBy:Kn().optional(),expiresAt:wA().optional(),reason:Kn().optional()})});const yPe=e=>e.hierarchyDelimiter.length===0?[e.fullPath]:e.fullPath.split(e.hierarchyDelimiter),Gf=e=>{const t=yPe(e);return t[t.length-1]||e.fullPath},bPe=(e,t)=>{switch(e.kind){case"appointed":case"flagged":return{allowed:!0,mailbox:e.mailbox};case"proposed":return t==="resolved"?{allowed:!0,mailbox:e.mailbox}:{allowed:!1,reason:"unconfirmed"};case"appointment_stale":return{allowed:!1,reason:"stale"};default:return{allowed:!1,reason:"none"}}},SPe=(e,t)=>bPe(e,t).allowed,wPe={[nu.Appointed]:{kind:"appointed",mailbox:null},[nu.Flagged]:{kind:"flagged",mailbox:null},[nu.Reserved]:{kind:"reserved",mailbox:null},[nu.Proposed]:{kind:"proposed",mailbox:null},[nu.Stale]:{kind:"appointment_stale",appointedMailboxId:"",fallback:{kind:"none"}},[nu.None]:{kind:"none"}},CPe=(e,t)=>SPe(wPe[e],t),yT=()=>typeof navigator<"u"&&(navigator.language||navigator.languages?.[0])||"en-US",Wo=(e,t)=>new Intl.NumberFormat(yT(),t).format(e),EPe=/^-?\d+$/,bT=e=>{if(e instanceof Date)return e;if(typeof e=="number")return new Date(e);if(typeof e=="string"){const t=e.trim();return EPe.test(t)?new Date(Number(t)):new Date(t)}return new Date(Number.NaN)},ST=e=>Number.isFinite(e.getTime()),ef=(e,t)=>{const n=bT(e);return ST(n)?new Intl.DateTimeFormat(yT(),t).format(n):""},AH=(e,t)=>ef(e,{short:{month:"short",day:"numeric"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"},time:{hour:"numeric",minute:"numeric"},datetime:{month:"short",day:"numeric",hour:"numeric",minute:"numeric"}}[t]),C8e=e=>{const t=bT(e);if(!ST(t))return"";const n=new Intl.RelativeTimeFormat(yT(),{numeric:"auto"}),r=Date.now(),o=t.getTime()-r,s=Math.round(o/1e3),a=Math.round(o/(1e3*60)),u=Math.round(o/(1e3*60*60)),c=Math.round(o/(1e3*60*60*24)),f=Math.round(o/(1e3*60*60*24*7));return Math.abs(s)<60?n.format(s,"second"):Math.abs(a)<60?n.format(a,"minute"):Math.abs(u)<24?n.format(u,"hour"):Math.abs(c)<7?n.format(c,"day"):Math.abs(f)<4?n.format(f,"week"):AH(t,"medium")},E8e=e=>{const t=bT(e);if(!ST(t))return"";const n=new Date,r=t.toDateString()===n.toDateString(),o=new Date(n);o.setDate(o.getDate()-1);const s=t.toDateString()===o.toDateString(),a=new Date(n);a.setDate(a.getDate()-6);const u=t>=a&&t<n,c=t.getFullYear()===n.getFullYear();return r?ef(t,{hour:"numeric",minute:"numeric"}):s?"Yesterday":u?ef(t,{weekday:"long"}):c?ef(t,{month:"short",day:"numeric"}):ef(t,{month:"short",day:"numeric",year:"numeric"})},_Pe=e=>`Move ${e===1?"1":Wo(e)} ${e===1?"message":"messages"} to Trash?`,_8e=({targets:e,trashByAccount:t,hasAppointments:n,isError:r})=>{if(r)return"unavailable";if(!n||e.length===0)return"unknown";let o=!1,s=!1;for(const a of e){if(a.accountId===void 0)return"unknown";const u=t.get(a.accountId);if(u===void 0)return"unknown";if(u.source==="Stale")return"staleTrash";if(u.mailboxId===void 0)return"noTrash";u.mailboxId===a.mailboxId&&(o=!0,CPe(u.source,"confirmed")||(s=!0))}return s?"unconfirmed":o?"permanent":"trash"},xPe=e=>e==="permanent"||e==="unconfirmed",x8e=(e,t,n={})=>{const r=e===1?"1":Wo(e),o=e===1?"message":"messages",{trashFolderLabel:s,staleFolderLabel:a}=n;if(t==="noTrash")return{title:`Can't delete ${r} ${o} yet`,description:"No folder on this account is set as Trash, so there is nowhere to move the mail. Nothing has been deleted.",confirmLabel:"Pick a Trash folder"};if(t==="staleTrash")return{title:`Can't delete ${r} ${o} yet`,description:a?`The folder you set as this account's Trash — ${a} — is gone from the mail server. Nothing has been deleted.`:"The folder you set as this account's Trash is gone from the mail server. Nothing has been deleted.",confirmLabel:"Pick another folder"};if(t==="unconfirmed"){const u=s?`reader files this account's deleted mail in ${s} because of its name — nobody confirmed it.`:"reader files this account's deleted mail in a folder it matched by name — nobody confirmed it.";return{title:"Confirm this account's Trash folder",description:e>0?`${u} Deleting ${r} ${o} there erases them from the mail server, and that cannot be restored. Nothing has been deleted.`:`${u} Emptying a folder erases everything in it from the mail server, and that cannot be restored. Nothing has been emptied.`,confirmLabel:"Confirm the folder"}}return t==="unavailable"?{title:`Can't delete ${r} ${o}`,description:"reader couldn't read this account's folder settings, so it can't say whether this would move the mail to Trash or erase it. Nothing has been deleted.",confirmLabel:"Sign in again"}:t==="unknown"?{title:`Delete ${r} ${o}?`,description:"Checking where this account files deleted mail…",confirmLabel:"Delete"}:t==="permanent"?{title:`Permanently delete ${r} ${o}?`,description:"They are erased from the mail server and cannot be restored.",confirmLabel:"Delete permanently"}:{title:_Pe(e),description:"You can restore them from Trash later.",confirmLabel:"Move to Trash"}},APe={delete:(e,t)=>`Deleting ${e} of ${t}…`,move:(e,t)=>`Moving ${e} of ${t}…`,markRead:(e,t)=>`Marking ${e} of ${t} as read…`},IPe={delete:"moved to Trash",move:"moved",markRead:"marked as read"},IH=(e,t)=>e==="delete"&&xPe(t)?"permanently deleted":IPe[e],RPe={delete:"couldn't be deleted",move:"couldn't be moved",markRead:"couldn't be marked as read"},TPe={delete:"Couldn't delete these messages",move:"Couldn't move these messages",markRead:"Couldn't mark these messages as read"},OPe={delete:"The delete didn't finish.",move:"The move didn't finish.",markRead:"The update didn't finish."},A8e=(e,t,n)=>APe[e](Wo(t),Wo(n)),MPe=(e,t,n="trash")=>`${Wo(t)} ${IH(e,n)}. Your mail server is still catching up.`,PPe=e=>`Stopped after ${Wo(e)}`,NPe=(e,t,n,r="trash")=>`${Wo(t)} of ${Wo(n)} ${IH(e,r)}. The rest were not sent, apart from the ones already on their way when you stopped — those may still have gone through.`,w5=(e,t)=>t>0?`Stopped after ${Wo(t)} — some messages ${RPe[e]}`:TPe[e],kPe=e=>OPe[e],DPe={delete:e=>`A delete of ${e} messages`,move:e=>`A move of ${e} messages`,markRead:e=>`Marking ${e} messages as read`},LPe=(e,t,n)=>`${DPe[e](Wo(t))}${n?` in ${n}`:""} is still running — stop it first.`,I8e=e=>e==="delete"?"danger":"info",R8e=(e,t,n,r)=>n.error!==void 0?null:n.cancelled?{severity:"warning",title:PPe(n.done),detail:NPe(e,n.done,t,r)}:{severity:"info",title:MPe(e,n.done,r)},RH=100,UPe=(e,t)=>e.kind==="move"?[t,e.destinationMailboxId]:[t],FPe=new AbortController().signal,EA=async e=>e.then(t=>({ok:!0,value:t}),t=>({ok:!1,error:t})),$Pe=(e,t=RH)=>{if(e.length===0)return[];const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},zPe=(e,t=RH)=>{const n=new Map;for(const r of e){const o=n.get(r.accountId);if(o){o.push(r.id);continue}n.set(r.accountId,[r.id])}return[...n.values()].flatMap(r=>$Pe(r,t))},TH=async(e,t,n,r)=>{const o=zPe(e),s=e.length;let a=0,u=0;const c=[];for(let f=0;f<o.length;f++){if(r.aborted)return c.push(...o.slice(f).flat()),{done:a,failedIds:c,refused:u,cancelled:!0};const h=o[f],g=await EA(t(h,r));if(!g.ok)return c.push(...o.slice(f).flat()),r.aborted?{done:a,failedIds:c,refused:u,cancelled:!0}:(n({done:a,total:s}),{done:a,failedIds:c,refused:u,cancelled:!1,error:g.error});u+=g.value?.failureCount??0,a+=h.length,n({done:a,total:s})}return{done:a,failedIds:c,refused:u,cancelled:!1}},T8e=async(e,t)=>{await TH(e.map(n=>({id:n,accountId:void 0})),async n=>(await t(n),{successCount:n.length,failureCount:0}),()=>{},FPe)},jPe=async(e,t,n,r,o)=>{let s=0,a=0;const u=[];let c;do{if(o.aborted)return{done:s,failedIds:u,refused:a,cancelled:!0};const f=await EA(e(c,o));if(!f.ok)return o.aborted?{done:s,failedIds:u,refused:a,cancelled:!0}:{done:s,failedIds:u,refused:a,cancelled:!1,error:f.error};const h=f.value;if(h.ids.length>0){const g=await EA(n(h.ids,o));if(!g.ok)return o.aborted?{done:s,failedIds:u,refused:a,cancelled:!0}:{done:s,failedIds:u,refused:a,cancelled:!1,error:g.error};a+=g.value?.failureCount??0,s+=h.ids.length,r({done:s,total:t})}c=h.continuationToken}while(c);return{done:s,failedIds:u,refused:a,cancelled:!1}},BPe=e=>({done:e.done,total:Math.max(e.total,e.done)}),HPe=e=>typeof e=="object"&&e!==null&&Array.isArray(e.pages),qPe=e=>typeof e=="object"&&e!==null&&Array.isArray(e.items),VPe=(e,t)=>e===void 0?e:HPe(e)?{...e,pages:e.pages.map(n=>({...n,items:t(n.items)}))}:qPe(e)?{...e,items:t(e.items)}:e,WPe=e=>{const t=[];for(const n of new Set(e))t.push(IIe({path:{mailboxId:n}})),t.push(bB({path:{mailboxId:n}}));return t.push(wB()),t},O8e=(e,t)=>Promise.all(t.map(n=>e.cancelQueries({queryKey:n}))),M8e=(e,t)=>t.flatMap(n=>e.getQueriesData({queryKey:n})).filter(n=>n[1]!==void 0).map(([n,r])=>({queryKey:n,data:r})),P8e=(e,t,n)=>{const r=o=>VPe(o,n);for(const o of t)e.setQueriesData({queryKey:o},r)},N8e=(e,t)=>{for(const n of t)e.setQueryData(n.queryKey,n.data)},GPe=(e,t)=>{for(const n of t)e.invalidateQueries({queryKey:n})},OH=_.createContext(void 0),KPe=e=>{if(e.action)return e.action;if((e.severity??"error")==="error")return{label:"Report an issue",href:oh(Bu({title:`Bug: ${e.title}`,errorMessage:e.detail?`${e.title} — ${e.detail}`:e.title,stack:e.error instanceof Error?e.error.stack:void 0}))}},ZPe=()=>{const e=_.useContext(OH);if(!e)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return e},C5=5,YPe=(e,t,n)=>({title:e,detail:MH(n)??t,error:n}),MH=e=>{if(e!=null){if(e instanceof Error)return e.message||void 0;if(typeof e=="string")return e||void 0;if(typeof e=="object"&&"message"in e&&typeof e.message=="string")return e.message||void 0}},k8e=e=>sl(e)?.code==="message_gone_from_server",D8e=e=>{const t=MH(e);return t?t.startsWith("Message not found"):!1},QPe=(e,t,n)=>e.severity===n&&e.title===t.title&&e.detail===t.detail,XPe=(e,t)=>{const r=[...e.filter(o=>!QPe(o,{title:t.title,detail:t.detail,severity:t.severity},t.severity)),t];return r.length<=C5?r:r.slice(r.length-C5)},JPe=(e,t)=>e.filter(n=>n.id!==t),eNe=(e,t,n)=>({id:t,severity:e.severity??"error",title:e.title,detail:e.detail,action:e.action,createdAt:n}),tNe=new Set(["none","stale","unconfirmed"]),nNe=new Set(Object.values(_ne)),c_=(e,t)=>{const n=e?.[t];return typeof n=="string"?n:void 0},rNe=e=>{const t=sl(e);if(t?.code!=="folder_role_unresolved")return;const{details:n}=t;if(!n)return;const r=c_(n,"reason"),o=c_(n,"role"),s=c_(n,"accountId");if(!(!r||!tNe.has(r))&&!(!o||!nNe.has(o)||!s))return{reason:r,role:o,accountId:s}},oNe=e=>sl(e)?.code==="mailbox_not_settled",sNe=3e4,iNe=1e3,aNe="The folder couldn't be created on the mail server. Please try again.",lNe="The folder was created but the mail server hasn't confirmed it yet, so nothing was attached to it. It's in your folder list — try again in a moment.",uNe=(e,t)=>new Promise((n,r)=>{if(t?.aborted){r(t.reason);return}const o=setTimeout(()=>{t?.removeEventListener("abort",s),n()},e),s=()=>{clearTimeout(o),r(t?.reason)};t?.addEventListener("abort",s,{once:!0})});async function cNe({fetchMailboxes:e,mailboxId:t,signal:n,timeoutMs:r=sNe,pollIntervalMs:o=iNe,delay:s=uNe,now:a=Date.now}){const u=a()+r;for(;;){n?.throwIfAborted();const f=(await e()).find(h=>h.mailboxId===t);if(f?.syncStatus===ak.synced)return f;if(f?.syncStatus===ak.failed)throw new Error(aNe);if(a()>=u)throw new Error(lNe);await s(o,n)}}function PH(e,t){const n=e.trim();return t?`${t.fullPath}${t.hierarchyDelimiter}${n}`:n}const E5=(e,t)=>{const n=t.length===0?[e]:e.split(t);return n[0]?.toLowerCase()==="inbox"&&(n[0]="INBOX"),n.join(t)};function dNe({name:e,delimiter:t,parent:n,existingPaths:r}){const o=e.trim();if(o==="")return"Enter a folder name.";if(t.length>0&&o.includes(t))return`A folder name can't contain "${t}".`;const s=E5(PH(o,n),t);if(r.some(u=>E5(u,t)===s))return"A folder with that name already exists."}function fNe(e){const t=cl(),{data:n}=Xa({...cA({path:{accountId:e??""}}),enabled:!!e}),r=sR({...pIe(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:nT({path:{accountId:e}})})}}),o=_.useRef(new Map),s=_.useCallback(async(u,c,f)=>{if(!e)throw new Error("No account to create the folder in. Pick messages from a single account first.");const h=n?.items??[],g=c?h.find(C=>C.fullPath===c):void 0;if(c&&!g)throw new Error(`Couldn't find the folder "${c}" to create this one inside.`);const m=g?{fullPath:g.fullPath,hierarchyDelimiter:g.hierarchyDelimiter}:void 0,v=PH(u,m);let w=o.current.get(v);if(!w){const C=m?.hierarchyDelimiter??h[0]?.hierarchyDelimiter??"/",E=dNe({name:u,delimiter:C,parent:m,existingPaths:h.map(I=>I.fullPath)});if(E)throw new Error(E);w=(await r.mutateAsync({path:{accountId:e},body:{fullPath:v,namespaceType:"personal"}})).mailboxId,o.current.set(v,w)}const S=await cNe({mailboxId:w,signal:f,fetchMailboxes:async()=>(await t.fetchQuery({...cA({path:{accountId:e}}),staleTime:0})).items??[]});return o.current.delete(v),{id:S.mailboxId,label:Gf(S),path:S.fullPath}},[r,e,n,t]);return{createFolder:_.useCallback((u,c)=>s(u,"",c),[s]),createFolderIn:s,mutation:r}}const hNe=()=>{const{t:e}=mB("mail",{useSuspense:!1});return _.useCallback((t,n)=>e(t,{defaultValue:n}),[e])},d_={Inbox:"inbox",Drafts:"drafts",Sent:"sent",Archive:"archive",Junk:"junk",Trash:"trash",All:"all",Flagged:"flagged"},L8e={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Junk",trash:"Trash",all:"All",flagged:"Flagged"},Kf=["inbox","flagged","drafts","sent","archive","all","junk","trash"];function ob(e){const t=new Map,n=[...e].sort((r,o)=>Kf.indexOf(d_[r.role])-Kf.indexOf(d_[o.role]));for(const r of n){if(!r.mailboxId||t.has(r.mailboxId))continue;const o=d_[r.role];o&&t.set(r.mailboxId,o)}return t}function NH(e,t,n){const r=e.displayNameOverride?.trim();if(r)return r;const o=Gf(e);return!t||!n?o:n(`sidebar.${t}`,o)}const pNe=new Set(["sent","drafts","trash"]),U8e=e=>e===void 0||!pNe.has(e),F8e=100,gNe=e=>e.trim().toLowerCase()==="inbox",mNe=(e,t)=>{if(e.hierarchyDelimiter.length===0)return!1;const n=`${e.fullPath}${e.hierarchyDelimiter}`;return t.some(r=>r.mailboxId!==e.mailboxId&&r.fullPath.startsWith(n))},vNe=["Appointed","Flagged","Reserved"],yNe=(e,t)=>e.mailboxId!==t.mailboxId?!1:e.source==="Stale"?t.specialUse?.includes(e.role)??!1:vNe.includes(e.source),bNe=(e,t)=>t.find(n=>yNe(n,e))?.role;function $8e(e,t,n){if(gNe(e.fullPath))return{deletable:!1,reason:"inbox",message:"The inbox can't be deleted."};const r=bNe(e,n);return r?{deletable:!1,reason:"role",message:`This folder is your ${r} folder. Reassign that role before deleting it.`}:mNe(e,t)?{deletable:!1,reason:"children",message:"This folder has subfolders. Delete them first."}:{deletable:!0}}function SNe(e,t){return e.filter(n=>n.mailboxId!==t)}function z8e(e){return{total:e,moved:0,phase:e===0?"moved":"moving"}}function j8e(e,t){if(e.phase!=="moving")return e;const n=Math.min(e.total,e.moved+Math.max(0,t));return{...e,moved:n,phase:n>=e.total?"moved":"moving"}}function B8e(e,t){return{...e,phase:"failed",error:t}}function H8e(e){return`Moved ${e.moved} of ${e.total}`}function q8e(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function V8e(e){return e>0?"choose-fate":"confirm-empty"}const wNe=new Set(["outbox","postvak uit","boîte d'envoi","postausgang","buzón de salida","posta in uscita","送信トレイ","送件匣","发件箱","skrzynka nadawcza"]),CNe=e=>{const t=Gf(e).trim().toLowerCase();return wNe.has(t)},_5=Kf.length,ENe=(e,t)=>{const n=ob(t);return[...e.filter(o=>{const s=n.get(o.mailboxId);return s==="drafts"||s==="sent"?!1:!CNe(o)})].sort((o,s)=>{const a=n.has(o.mailboxId)?Kf.indexOf(n.get(o.mailboxId)??"inbox"):_5,u=n.has(s.mailboxId)?Kf.indexOf(n.get(s.mailboxId)??"inbox"):_5;return a!==u?a-u:Gf(o).localeCompare(Gf(s),void 0,{sensitivity:"base",numeric:!0})})},_Ne=e=>e[0]?.hierarchyDelimiter??"/",xNe=({mailboxes:e,folderAppointments:t,currentMailboxId:n,excludeMailboxId:r,translator:o})=>{const s=ENe(e,t),a=ob(t);return(r?SNe(s,r):s).map(c=>({id:c.mailboxId,label:NH(c,a.get(c.mailboxId),o),path:c.fullPath,isCurrent:c.mailboxId===n,messageCount:c.messageCount}))},kH=_.createContext(void 0),x5=Symbol("appoint-failed"),ANe=({children:e})=>{const t=cl(),n=hNe(),[r,o]=_.useState(null),[s,a]=_.useState(),[u,c]=_.useState({kind:"choosing"}),f=r?.accountId,{data:h}=Xa({...rT(),staleTime:1/0,enabled:!!f}),{data:g}=Xa({...cA({path:{accountId:f??""}}),enabled:!!f}),{createFolderIn:m}=fNe(f),v=sR({...fIe(),meta:ty(409)}),w=h?.accounts.find(D=>D.accountId===f),S=_.useMemo(()=>g?.items??[],[g]),C=_.useMemo(()=>w?.folderAppointments??[],[w]),E=_.useMemo(()=>xNe({mailboxes:S,folderAppointments:C,translator:n}),[S,C,n]),A=C.find(D=>D.role===r?.role),I=r?.guessedMailboxId??A?.mailboxId,T=S.find(D=>D.mailboxId===I),N=r?.trashFolderLabel??(T?NH(T,ob(C).get(T.mailboxId),n):void 0),M=_.useRef(null),R=_.useCallback(()=>{M.current=null,o(null),a(void 0),c({kind:"choosing"})},[]),k=_.useCallback(D=>{M.current=D,o(D),c({kind:"choosing"}),a(D.reason==="unconfirmed"?D.guessedMailboxId:void 0)},[]),L=_.useCallback(D=>{M.current===D&&R()},[R]),q=_.useCallback(D=>{r&&(c({kind:"appointing"}),v.mutateAsync({path:{accountId:r.accountId,role:r.role},body:{mailboxId:D}}).catch(j=>(c({kind:"appoint-failed",cause:oNe(j)?"mailbox-pending":"generic"}),x5)).then(async j=>{j!==x5&&(await t.invalidateQueries({queryKey:yB()}),c({kind:"acting"}),await r.onAppointed(),L(r))}).catch(()=>L(r)))},[r,v,t,L]),F=_.useMemo(()=>({requestAppointment:k}),[k]);return O.jsxs(kH.Provider,{value:F,children:[e,r&&O.jsx(One,{open:!0,reason:r.reason,action:r.action,folders:E,delimiter:_Ne(S),trashFolderLabel:N,guessedMailboxId:I,staleFolderLabel:r.staleFolderLabel??A?.staleAppointmentPath,accountEmail:(h?.accounts.length??0)>1?w?.email:void 0,phase:u,selectedId:s,onSelect:a,onCreateFolder:m,onConfirm:q,onCancel:R})]})},INe=()=>{const e=_.useContext(kH);if(!e)throw new Error("useRoleAppointmentPrompt must be used within a RoleAppointmentPromptProvider");return e},DH=_.createContext(void 0),RNe=({children:e})=>{const[t,n]=_.useState(void 0),r=_.useRef(void 0),o=_.useRef(void 0),s=_.useRef(void 0),a=_.useRef(new Set),u=cl(),{pushError:c}=ZPe(),{requestAppointment:f}=INe(),h=_.useRef(async()=>({kind:"ran",outcome:{done:0,failedIds:[],refused:0,cancelled:!1}})),g=_.useCallback(S=>{GPe(u,WPe(UPe(S.action,S.mailboxId)));const C=new Set;if(S.accountId&&C.add(S.accountId),S.source.kind==="targets")for(const E of S.source.targets)E.accountId&&C.add(E.accountId);for(const E of C)u.invalidateQueries({queryKey:nT({path:{accountId:E}})})},[u]),m=_.useCallback(async S=>{const C=s.current;if(C)return{kind:"refused",reason:LPe(C.action.kind,C.matched,C.mailboxLabel)};const E=Symbol("bulk-run"),A=new AbortController;r.current=A,o.current=E,s.current=S,S.claimEnding&&(a.current.add(E),S.claimEnding(()=>a.current.delete(E))),n({action:S.action,mailboxId:S.mailboxId,progress:{done:0,total:S.matched}});const I=R=>{o.current===E&&n(k=>k&&{...k,progress:BPe(R)})},T=S.source.kind==="targets"?await TH(S.source.targets,S.applyBatch,I,A.signal):await jPe(S.source.fetchPage,S.matched,S.applyBatch,I,A.signal),N=a.current.delete(E);o.current===E&&(o.current=void 0,s.current=void 0,n(void 0));const M=T.error?rNe(T.error):void 0;return M?f({accountId:M.accountId,role:M.role,reason:M.reason,action:{kind:"delete",count:S.matched},onAppointed:async()=>{const R=await h.current({...S,claimEnding:void 0});R.kind==="refused"&&c({title:w5(S.action.kind,0),detail:R.reason})}}):T.error?c(YPe(w5(S.action.kind,T.done),kPe(S.action.kind),T.error)):T.refused>0&&c({severity:"warning",title:T.refused>1?`Couldn't delete ${T.refused} of ${S.matched} messages yet`:"Couldn't delete this message yet",detail:"Something else moved them while the delete was being prepared. They are back where they now sit — try again."}),N||S.reportEnding?.(S.action.kind,S.matched,T),T.done>0&&g(S),{kind:"ran",outcome:T}},[g,c,f]);h.current=m;const v=_.useCallback(S=>{s.current?.mailboxId===S&&r.current?.abort()},[]);_.useEffect(()=>{const S=a.current;return()=>{r.current?.abort(),r.current=void 0,o.current=void 0,s.current=void 0,S.clear()}},[]);const w=_.useMemo(()=>({run:t,start:m,stop:v}),[t,m,v]);return O.jsx(DH.Provider,{value:w,children:e})},W8e=()=>{const e=_.useContext(DH);if(!e)throw new Error("useBulkRun must be used within a BulkRunProvider");return e},TNe=600,ONe=300,LH="remit logs",MNe="https://github.com/remit-mail/reader/releases/tag/";function UH(e,t){const n=t?.check.lastCheckedAt;return n!==void 0&&n!==e.since}function PNe(e){const t=hn(e);return`The check could not be requested — ${t===void 0?"the server did not answer":`the server answered ${t}`}. Run \`remit logs backend\` to see why.`}const NNe={checking:"preparing",pulling:"preparing",snapshotting:"preparing",stopping:"restarting",starting:"restarting",verifying:"reconnecting",committing:"reconnecting",rollingBack:"reconnecting",recovering:"reconnecting"};function wT(e){return NNe[e]??"reconnecting"}function FH(e){const t=hn(e);return t===404||t===403||t===401}function _A(e,t){const n=e?.run??null;return n===null||n.outcome!==null||n.runId===t?null:n}function $H(e,t){const n=e?.check;if(n?.status==="ok"&&!(!n.updateAvailable||!n.latestVersion))return{version:n.latestVersion,releasedAt:xv(n.publishedAt)??t,releaseNotesUrl:n.releaseNotesUrl??zH(n.latestVersion),summary:n.summary??""}}function kNe(e){const t=e?.check.schemaVersion,n=e?.currentSchemaVersion;return t===void 0||n===void 0?!1:t>n}function xA(){return TNe+ONe}function AA(e,t){return Math.max(0,Math.floor((t-e)/1e3))}function xv(e){if(!e)return;const t=Date.parse(e);return Number.isNaN(t)?void 0:t}function zH(e){return`${MNe}${e}`}function Zf(e,t,n,r,o){return{status:"applying",runId:e,version:t,target:n,phase:r,elapsedSeconds:o}}function DNe(e,t,n){switch(n){case"succeeded":return{status:"succeeded",runId:t.runId,version:t.targetVersion,previousVersion:t.fromVersion,releaseNotesUrl:e.check.releaseNotesUrl??zH(t.targetVersion)};case"rolledBack":return{status:"rolledBack",runId:t.runId,version:t.fromVersion,attemptedVersion:t.targetVersion,reason:t.message,logsCommand:t.logCommand};case"rollbackFailed":return{status:"rollbackFailed",runId:t.runId,attemptedVersion:t.targetVersion,previousVersion:t.fromVersion,reason:t.message,logsCommand:t.logCommand};case"abandoned":return{status:"abandoned",runId:t.runId,version:t.fromVersion,attemptedVersion:t.targetVersion,reason:t.message,logsCommand:t.logCommand};default:return n}}function LNe(e,t,n,r){const o=e.check,s=xv(o.lastCheckedAt);if(n!==null)return{status:"checkFailed",version:e.currentVersion,reason:n,lastCheckedAt:s};if(t!==null&&!UH(t,e))return{status:"checking",version:e.currentVersion};if(o.status==="failed")return{status:"checkFailed",version:e.currentVersion,reason:o.error??"Remit could not reach the update service.",lastCheckedAt:s};if(o.status==="disabled")return{status:"neverChecked",version:e.currentVersion,lastCheckedAt:s};const a=$H(e,r);return a?{status:"available",version:e.currentVersion,release:a}:{status:"upToDate",version:e.currentVersion,checkedAt:xv(o.lastCheckedAt)??r}}function A5(e,t,n){return{surface:{status:"ready",section:e,overlay:t},releaseHeld:n}}function jH(e,t,n,r){return{status:"ready",section:Zf(e,t,n,"reconnecting",r),overlay:{kind:"applying",target:n,phase:"reconnecting",elapsedSeconds:r}}}function BH(e,t,n,r,o){return{status:"ready",section:Zf(e,t,n,"reconnecting",r),overlay:{kind:"neverCameBack",attemptedVersion:n,previousVersion:t,elapsedSeconds:r,logsCommand:o}}}function UNe(e,t){return{surface:BH(e.runId,e.previousVersion,e.attemptedVersion,t,LH),releaseHeld:!1}}function FNe(e,t,n,r,o){const s=AA(e.startedAt,o),a=t?.currentVersion??e.previousVersion,u=!r&&n!==null&&n.runId===e.runId;if(u&&n!==null&&n.outcome!==null)return null;if(u&&n!==null){const c=wT(n.phase);return A5(Zf(n.runId,a,n.targetVersion,c,s),{kind:"applying",target:n.targetVersion,phase:c,elapsedSeconds:s},!1)}return r?s>xA()?UNe(e,s):{surface:jH(e.runId,e.previousVersion,e.attemptedVersion,s),releaseHeld:!1}:t===void 0?{surface:{status:"loading"},releaseHeld:!1}:s>xA()?{surface:{status:"ready",section:{status:"unreachable",runId:e.runId,previousVersion:e.previousVersion,attemptedVersion:e.attemptedVersion,elapsedSeconds:s,logsCommand:n?.logCommand??LH},overlay:{kind:"none"}},releaseHeld:!0}:A5(Zf(e.runId,a,e.attemptedVersion,e.phase,s),{kind:"applying",target:e.attemptedVersion,phase:e.phase,elapsedSeconds:s},!1)}function I5(e){const{data:t,isError:n,dismissedRunId:r,checkPress:o,checkFailure:s,sighting:a,now:u}=e;if(n){const h=_A(t,r);if(h!==null){const g=a!==null&&a.runId===h.runId?a.observedAt:u,m=AA(g,u);return m>xA()?BH(h.runId,h.fromVersion,h.targetVersion,m,h.logCommand):jH(h.runId,h.fromVersion,h.targetVersion,m)}return{status:"ready",section:{status:"checkFailed",version:t?.currentVersion??"the current version",reason:"Remit could not reach the update service."},overlay:{kind:"none"}}}if(!t)return{status:"loading"};const c=t.run,f=c!==null&&r!==null&&c.runId===r;if(c!==null&&!f&&c.outcome!==null)return{status:"ready",section:DNe(t,c,c.outcome),overlay:{kind:"none"}};if(c!==null&&!f&&c.outcome===null){const h=AA(xv(c.startedAt)??u,u),g=wT(c.phase);return{status:"ready",section:Zf(c.runId,c.fromVersion,c.targetVersion,g,h),overlay:{kind:"applying",target:c.targetVersion,phase:g,elapsedSeconds:h}}}return{status:"ready",section:LNe(t,o,s,u),overlay:{kind:"none"}}}function $Ne(e){const{data:t,isError:n,error:r,held:o,now:s}=e,a=t?.run??null;if(FH(r)&&!o)return{surface:{status:"absent"},releaseHeld:!0};if(o){const u=FNe(o,t,a,n,s);return u||{surface:I5(e),releaseHeld:!0}}return{surface:I5(e),releaseHeld:!1}}const zNe=3e4,jNe=5e3,BNe=rI,HNe={...rI,...hre},qNe=3e4,VNe="The updater did not answer. Run `remit logs updater` to see why.";function WNe(e,t,n,r){if(FH(e)&&!n)return!1;const o=t!==null&&t.outcome===null;return n||o||r?jNe:zNe}function GNe(){const e=cl(),[t,n]=_.useState(null),[r,o]=_.useState(null),[s,a]=_.useState(null),[u,c]=_.useState(null),[f,h]=_.useState(null),g=_.useRef(t);g.current=t;const m=_.useRef(s);m.current=s;const v=e.getQueryData(dA()),w=t!==null||_A(v,r)!==null,S=Xa({...$Ie(),retry:!1,meta:w?HNe:BNe,refetchInterval:D=>WNe(D.state.error,D.state.data?.run??null,g.current!==null,m.current!==null)}),C=_.useRef(S.data);C.current=S.data;const E=$Ne({data:S.data,isError:S.isError,error:S.error,held:t,dismissedRunId:r,checkPress:s,checkFailure:u,sighting:f,now:Date.now()}),A=_A(S.data,r);_.useEffect(()=>{if(A===null){h(D=>D===null?D:null);return}h(D=>D!==null&&D.runId===A.runId?D:{runId:A.runId,observedAt:Date.now()})},[A]);const I=_.useRef(null);I.current=E.surface.status==="ready"&&"runId"in E.surface.section?E.surface.section.runId:null;const{releaseHeld:T}=E;_.useEffect(()=>{T&&n(D=>D===null?D:null)},[T]),_.useEffect(()=>{s!==null&&UH(s,S.data)&&a(null)},[s,S.data]),_.useEffect(()=>{if(s===null)return;const D=s.pressedAt+qNe-Date.now(),j=setTimeout(()=>{a(null),c(VNe)},Math.max(0,D));return()=>clearTimeout(j)},[s]);const{refetch:N}=S,M=_.useCallback(()=>{c(null),a({pressedAt:Date.now(),since:C.current?.check.lastCheckedAt}),vB({query:{refresh:!0},throwOnError:!0}).then(()=>{N()}).catch(D=>{hR(D,rI),a(null),c(PNe(D))})},[N]),R=_.useCallback(()=>{N()},[N]),k=sR({...zIe(),meta:{softError:!0},onSuccess:D=>{const j=D.run;j!==null&&(n({runId:j.runId,attemptedVersion:j.targetVersion,previousVersion:j.fromVersion,phase:wT(j.phase),startedAt:Date.now()}),o(null)),e.setQueryData(dA(),D)},onError:()=>{N()}}),{mutate:L}=k,q=_.useCallback(D=>{L({body:{targetVersion:D}})},[L]),F=_.useCallback(()=>{I.current!==null&&o(I.current),n(null),a(null),c(null)},[]);return{surface:E.surface,appliesSchemaMigration:kNe(S.data),currentVersion:S.data?.currentVersion,release:$H(S.data,Date.now()),onCheck:M,install:q,onDismissResult:F,onRetryConnection:R}}const CT=_.createContext(null);function KNe({children:e}){const t=GNe();return _.createElement(CT.Provider,{value:t},e)}function ZNe(){const e=_.useContext(CT);if(e===null)throw new Error("useSelfUpdate must be used within a SelfUpdateProvider");return e}function YNe(){return _.useContext(CT)}function QNe(){const{surface:e,onRetryConnection:t}=ZNe();if(e.status!=="ready")return null;const{overlay:n}=e;return n.kind==="applying"?O.jsx(Yne,{target:n.target,phase:n.phase,elapsedSeconds:n.elapsedSeconds}):n.kind==="neverCameBack"?O.jsx(Qne,{attemptedVersion:n.attemptedVersion,previousVersion:n.previousVersion,elapsedSeconds:n.elapsedSeconds,logsCommand:n.logsCommand,onRetryConnection:t}):null}const XNe=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,JNe=({children:e})=>{const[t,n]=_.useState([]),r=_.useCallback(u=>{if(u.error!=null&&ZF(u.error))return ju(u.error).correlationId;const c=eNe({...u,action:KPe(u)},XNe(),Date.now());return n(f=>XPe(f,c)),c.id},[]),o=_.useCallback(u=>{n(c=>JPe(c,u))},[]),s=_.useCallback(()=>{n([])},[]),a=_.useMemo(()=>({errors:t,pushError:r,dismissError:o,clearAll:s}),[t,r,o,s]);return O.jsxs(OH.Provider,{value:a,children:[e,O.jsx(Kte,{errors:t,onDismiss:o})]})},R5="mt-6 inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md bg-accent px-4 text-sm font-medium text-accent-fg hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring";function HH(){const[e,t]=_.useState(Gye),{Account:n}=Wye(),r=_.useRef(null);return _.useEffect(()=>Kye(t),[]),qv({id:"signed-out",open:e}),Vv(r,e),e?O.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-canvas/80 p-4 backdrop-blur-sm",children:O.jsxs("div",{ref:r,role:"alertdialog","aria-modal":"true","aria-labelledby":"signed-out-title","aria-describedby":"signed-out-text",tabIndex:-1,className:"w-full max-w-sm rounded-lg border border-line bg-surface p-6 shadow-xl outline-none",children:[O.jsx("h2",{id:"signed-out-title",className:"text-lg font-semibold text-fg",children:"You're signed out"}),O.jsx("p",{id:"signed-out-text",className:"mt-2 text-sm text-fg-muted",children:"The server no longer accepts this session. Sign in again to carry on here; you will come back to this screen."}),O.jsx(n,{fallback:O.jsxs("button",{type:"button",onClick:()=>{sU(),window.location.reload()},className:R5,children:[O.jsx(YN,{className:"size-4","aria-hidden":"true"}),"Sign in"]}),children:({signOut:o})=>O.jsxs("button",{type:"button",onClick:()=>{sU(),o()},className:R5,children:[O.jsx(YN,{className:"size-4","aria-hidden":"true"}),"Sign in"]})})]})}):null}const eke=({error:e,reset:t,info:n})=>{if(ey(e))return fR(),O.jsx(HH,{});const r=Qv(e),o=ju(e,{recoverable:r,componentStack:n?.componentStack});return O.jsx(r$,{fatal:o,onRetry:r?t:void 0})},ea=eye()({component:rke,errorComponent:eke}),tke=()=>{const{t:e}=mB("common",{useSuspense:!1});return O.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-canvas focus:text-fg focus:rounded-md",children:e("accessibility.skipToContent","Skip to main content")})},nke=({children:e})=>pc().updateMode==="managed"?e:O.jsxs(KNe,{children:[e,O.jsx(QNe,{})]});function rke(){return O.jsxs(JNe,{children:[O.jsx(ANe,{children:O.jsx(RNe,{children:O.jsx(nke,{children:O.jsxs(GIe,{children:[O.jsx(tke,{}),O.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:O.jsx(_.Suspense,{fallback:O.jsx(Kv,{}),children:O.jsx(Az,{})})})]})})})}),O.jsx(n$,{}),O.jsx(HH,{})]})}const oke=Ee("/")({beforeLoad:()=>{throw Sc({to:"/mail/brief"})}}),ske=pc().apiUrl;le.setConfig({baseUrl:ske,fetch:gF});le.interceptors.error.use((e,t)=>e instanceof Yv||!t?e:sre(e,t.status));const ike=()=>Re(()=>import("./calendar-DCTglXEB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),ake=Ee("/calendar")({loader:({context:{queryClient:e}})=>{e.prefetchQuery(rT())},component:Ie(ike,"component")}),lke=()=>Re(()=>import("./import-C-0_jeuq.js"),__vite__mapDeps([14,15,16,17,18,19,20,21,22])),uke=Ee("/import")({component:Ie(lke,"component")}),cke=vT(["match","properties","folder","rule","name","review","run"]),dke=ml("search"),fke=dke.optional().catch(void 0),hke=()=>Py({from:"/mail",select:e=>e.wizardFrom}),pke=cke.optional().catch(void 0),gke=(e,t)=>HF(e,t)+1,qH=()=>Py({from:"/mail",select:e=>e.wizard}),mke=()=>{const e=dh();return _.useCallback((t,n)=>{e({to:".",search:r=>({...r,wizard:t,wizardFrom:n})})},[e])},G8e=()=>{const e=qH(),t=mke(),[n,r]=_.useState("organize"),o=_.useCallback(a=>{r(a),t("match")},[t]),s=_.useCallback(()=>{t("properties","search")},[t]);return{verb:n,start:o,startFromSearch:s,isOpen:e!==void 0}},K8e=e=>{const t=gr(),n=dh(),r=qH(),o=hke(),s=_.useRef(r!==void 0),a=_.useRef(o),u=_.useRef(void 0);_.useEffect(()=>{u.current=void 0},[r]),_.useEffect(()=>{if(!s.current)return;s.current=!1;const g=a.current;(async()=>(await n({to:".",search:m=>({...m,wizard:void 0,wizardFrom:void 0}),replace:!0}),await n({to:".",search:m=>({...m,wizard:e,wizardFrom:g})})))()},[e,n]);const c=_.useCallback(g=>{g===r||u.current===g||(u.current=g,n({to:".",search:m=>({...m,wizard:g})}))},[n,r]),f=_.useCallback(()=>{t.history.back()},[t]),h=_.useCallback((g,m)=>{t.history.go(-gke(g,m))},[t]);return{step:r,goToStep:c,goBack:f,closeWizard:h}},bh=wo({q:Kn().optional()}),ET=bh.extend({}),VH=bh.extend({}),vke=bh.extend({}),WH=bh.extend({}),yke=ET,bke=bh.extend({wizard:pke,wizardFrom:fke}),f_=wo({body:Kn().optional()}),Z8e=e=>{const{body:t,...n}=e;return n},_T={brief:ET.extend(f_.shape),flagged:VH.extend(f_.shape),mailbox:WH.extend(f_.shape)},Ske=new Map;function Y8e(e){const t=new Map;for(const n of e){const r=ob(n.folderAppointments);for(const[o,s]of r)t.set(o,{role:s});for(const o of n.mailboxes){const s=r.get(o.mailboxId),a={providerPath:o.fullPath,hierarchyDelimiter:o.hierarchyDelimiter};t.set(o.mailboxId,s?{role:s,...a}:a)}}return t}function Q8e(e){const t=[];for(const[n,r]of e)r.role==="junk"&&t.push(n);return t}function X8e(e,t){const n=t[0];if(!e)return n?{mailboxId:n}:{};for(const o of t){const s=e.get(o);if(s&&Ene(s)!==void 0)return{mailboxId:o,folder:s}}if(!n)return{};const r=e.get(n);return{mailboxId:n,...r?{folder:r}:{}}}const wke=_.createContext(null),J8e=()=>_.useContext(wke)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,resultFolderIndex:Ske,searchQuery:"",searchInput:"",searchViewKey:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onRaiseIntelligence:()=>{}},Cke=()=>Re(()=>import("./mail-Bh469T8t.js"),__vite__mapDeps([23,5,4,3,1,2,6,7,8,9,10,11,24,25,26,27,28,29,30,31,32,17,13,33,34,35,36,37,38,39,40,41,42,43,44,45])),Eke=Ee("/mail")({loader:({context:{queryClient:e}})=>{e.prefetchQuery(rT()),e.prefetchQuery({...jIe(),staleTime:6e4})},component:Ie(Cke,"component"),validateSearch:bke}),_ke=()=>Re(()=>import("./onboarding-D-4ZdWHj.js"),__vite__mapDeps([46,47,15,16,17,18,19,30,10,21,45,48,22])),xke=Ee("/onboarding")({component:Ie(_ke,"component")});function Ake(){const e=YNe(),t=e?.surface.status==="ready"&&e.surface.section.status==="available";return O.jsx(NF,{label:t?"Update available":void 0,children:O.jsx(kee,{className:"size-4"})})}function Ike(){return Xa({...TIe()})}const h_={listed:"Sync warnings",unread:"Warnings could not be read",signedOut:"Session ended"};function Rke(e,t){if(ey(t))return h_.signedOut;if(t)return h_.unread;if(e&&((e.entries?.length??0)>0||(e.warnings?.length??0)>0))return h_.listed}function Tke(){const e=Ike();return Rke(e.data,e.error)}function Oke(){const e=Tke();return O.jsx(NF,{label:e,children:O.jsx(JA,{className:"size-4"})})}const Mke=ty(403,404),eFe={...ty(403,404,409,429),...pre},Pke=new Set([Pa.SignInDisabled,Pa.CallerDisabled]),GH=e=>{if(hn(e)!==403)return!1;const t=sl(e)?.code;return t!==void 0&&Pke.has(t)},Nke=e=>{if(Jv(e))return"The server could not be reached. Nothing changed. Try again.";const t=sl(e)?.code;return t===Pa.CannotDisableSelf?"You cannot disable your own account, so one account always stays on.":t===Pa.StepUpRequired?"The password check did not carry over to the action. Nothing changed. Try again.":t===Pa.ForeignOrigin?"The server refused a request from this address. Nothing changed. Open this page from the server's own address.":hn(e)===404?"That account is gone, or this server no longer has a People page. Reload the page.":"Something went wrong on the server. Nothing changed. Try again."},tFe=e=>Jv(e)?"The server could not be reached. Check your connection and try again.":"The server did not answer as expected. Try again.",nFe=e=>{if(hn(e)===401||GH(e))return{kind:"signedOut"};const t=sl(e)?.code;return t===Pa.WrongPassword?{kind:"wrongPassword"}:t===Pa.StepUpLocked?{kind:"locked"}:{kind:"failed",reason:Nke(e)}},rFe=(e,t)=>e==="Disable"?{title:`Disable ${t}?`,body:"They are signed out everywhere within 15 minutes and cannot sign in until you enable them again. Their calendar feed links stop working. Their mail stays.",confirmLabel:"Disable",failedTitle:`${t} was not disabled`,destructive:!0}:e==="Enable"?{title:`Enable ${t}?`,body:"They can sign in again with their password. Calendar feed links they shared before stay off; they make new ones in Settings.",confirmLabel:"Enable",failedTitle:`${t} was not enabled`,destructive:!1}:e==="SignOut"?{title:`Sign ${t} out everywhere?`,body:"Every session and connected app of theirs ends within 15 minutes. They can sign in again with their password.",confirmLabel:"Sign out everywhere",failedTitle:`${t} was not signed out`,destructive:!0}:{title:`Reset the password of ${t}?`,body:"Their password stops working at once and they are signed out everywhere. You get a link to give them, which works once, for 24 hours.",confirmLabel:"Make a reset link",failedTitle:`No reset link was made for ${t}`,destructive:!0},oFe=(e,t)=>{const n=hn(t),r=sl(t)?.code,o=t instanceof Error?t.message:String(t),s=[n??"no response",r,o].filter(a=>a!==void 0&&a!=="").join(" ");return oh(Bu({title:`People: ${e}`,errorMessage:`${e}. The server answered: ${s}`}))},kke=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),sFe=(e,t)=>kke(new Date(e),t)?"Today":AH(e,"medium"),iFe=(e,t)=>e.map(n=>n.userId===t.userId?t:n),Dke=()=>({...UIe(),meta:Mke,retry:!1}),Lke=()=>{const e=Xa(Dke()),t=e.isError&&GH(e.error);return _.useEffect(()=>{t&&fR()},[t]),{...e,unavailable:e.isError&&YF(e.error)}},KH=_.createContext([]),Uke=KH.Provider,Fke=()=>_.useContext(KH),$ke=()=>Re(()=>import("./settings-fP9o8EL9.js"),[]),zke=[{id:"accounts",label:"Accounts",icon:O.jsx(SF,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:O.jsx(Nee,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:O.jsx(wee,{className:"size-4"})},{id:"filters",label:"Filters",icon:O.jsx(bee,{className:"size-4"})},{id:"labels",label:"Labels",icon:O.jsx(Oee,{className:"size-4"})},{id:"classification",label:"Mail classification",icon:O.jsx(Ree,{className:"size-4"})},{id:"calendars",label:"Calendars",icon:O.jsx(pee,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:O.jsx(xee,{className:"size-4"})},{id:"warnings",label:"Warnings",icon:O.jsx(Oke,{})},{id:"advanced",label:"Advanced",icon:O.jsx(Ake,{})}],jke={id:"people",label:"People",icon:O.jsx(Pee,{className:"size-4"})},aFe=()=>{const e=Lke(),t=Fke(),n=[...zke];if(n.splice(1,0,...t.map(({id:o,label:s,icon:a})=>({id:o,label:s,icon:a}))),!e.isSuccess)return n;const r=n.findIndex(o=>o.id==="advanced");return[...n.slice(0,r),jke,...n.slice(r)]},Bke=Ee("/settings")({component:Ie($ke,"component")}),Hke=["year","month","week","day","agenda"],qke=vT(Hke),ZH="week",lFe=e=>e==="agenda";function Vke(e){const t=qke.safeParse(e);return t.success?t.data:void 0}const Wke=/^\d{4}-\d{2}-\d{2}$/;function Gke(e){if(!Wke.test(e))return;const[t,n,r]=e.split("-").map(Number),o=Date.UTC(t,n-1,r),s=new Date(o);if(s.getUTCFullYear()===t&&s.getUTCMonth()===n-1&&s.getUTCDate()===r)return e}const oc=e=>String(e).padStart(2,"0");function YH(e){return`${e.getFullYear()}-${oc(e.getMonth()+1)}-${oc(e.getDate())}`}function Kke(e,t){return{view:Vke(e.view)??ZH,date:Gke(e.date)??t}}function uFe(e,t,n){const[r,o,s]=e.split("-").map(Number);if(t==="year")return T5(r+n,o,s);if(t==="month")return T5(r,o+n,s);const a=t==="day"?1:7,u=new Date(Date.UTC(r,o-1,s+a*n));return Zke(u)}const Zke=e=>`${e.getUTCFullYear()}-${oc(e.getUTCMonth()+1)}-${oc(e.getUTCDate())}`;function T5(e,t,n){const r=e+Math.floor((t-1)/12),o=((t-1)%12+12)%12+1,s=new Date(Date.UTC(r,o,0)).getUTCDate();return`${r}-${oc(o)}-${oc(Math.min(n,s))}`}const Yke=Kn().min(1);function Qke(e){const t=e==null?[]:[e].flat(),n=new Set;for(const r of t){if(typeof r!="string"&&typeof r!="number")continue;const o=Yke.safeParse(String(r));o.success&&n.add(o.data)}return[...n].sort()}const xT=wo({calendarId:_v().transform(Qke).transform(e=>e.length===0?void 0:e).optional()});function cFe(e,t){return t?e==="week"?"day":e==="year"?"month":e:e}const Xke=Ee("/calendar/")({validateSearch:xT,beforeLoad:({search:e,location:t})=>{throw Sc({to:"/calendar/$view/$date",params:{view:ZH,date:YH(new Date)},search:e,hash:t.hash,replace:!0})}}),Jke=Ee("/mail/")({validateSearch:yke,beforeLoad:({search:e,location:t})=>{throw Sc({to:"/mail/brief",search:e,hash:t.hash,replace:!0})}}),e3e=()=>Re(()=>import("./_mailboxId-CBxHNU1m.js"),__vite__mapDeps([49,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,50,51,39,38,9,52,53,45,18,54,55,8,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,69,37,35,36,70,71,72,73,74,75,76])),t3e=Ee("/mail/$mailboxId")({component:Ie(e3e,"component"),validateSearch:WH}),n3e=()=>Re(()=>import("./brief-iq8Ra5O_.js"),__vite__mapDeps([77,13])),r3e=()=>Re(()=>import("./brief-CJySko3D.js"),__vite__mapDeps([78,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,79,52,53,45,9,39,38,18,54,55,8,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,69,70,71,35,36,37,80,76])),o3e=Ee("/mail/brief")({component:Ie(r3e,"component"),validateSearch:ET,errorComponent:Ie(n3e,"errorComponent")}),s3e=()=>Re(()=>import("./flagged-C-DEfMAa.js"),__vite__mapDeps([81,13])),i3e=()=>Re(()=>import("./flagged-D0pl5Vka.js"),__vite__mapDeps([82,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,83,52,53,45,9,39,38,18,54,55,8,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,69,51,37,80,76])),a3e=Ee("/mail/flagged")({component:Ie(i3e,"component"),validateSearch:VH,errorComponent:Ie(s3e,"errorComponent")}),l3e=()=>Re(()=>import("./outbox-DzVji2w9.js"),__vite__mapDeps([84,26,5,4,3,24,27,28,29,30,31,32,6,17,13,33,34,11,85,53,45,43,72,40,9,36,64,86,87,76])),u3e=Ee("/mail/outbox")({component:Ie(l3e,"component"),validateSearch:vke}),c3e=Ee("/reset-password/$token")({beforeLoad:()=>{throw Sc({to:"/"})}}),d3e=()=>Re(()=>import("./index-BnElevbT.js"),[]),f3e=Ee("/settings/")({component:Ie(d3e,"component")}),h3e=()=>Re(()=>import("./_slotId-BbhN8swS.js"),__vite__mapDeps([88,4,3,6,89,7,18,90,40,74])),p3e=Ee("/settings/$slotId")({component:Ie(h3e,"component")}),g3e=()=>Re(()=>import("./accounts-DwJx265B.js"),__vite__mapDeps([91,47,15,16,17,18,19,30,10,21,45,48,29,92,33,13,56,6,93,89,7,90,40,74,61,86])),m3e=wo({editAccountId:Kn().optional(),focusSmtp:mT().optional(),connected:Kn().optional(),oauthError:Kn().optional(),oauthEmail:Kn().optional(),missingServices:Kn().optional()}),v3e=Ee("/settings/accounts")({component:Ie(g3e,"component"),validateSearch:m3e}),y3e=()=>Re(()=>import("./advanced-4BQF-R7r.js"),__vite__mapDeps([94,20,4,3,5,6,19,56,18,21,87,75,95,66,64,93,45,89,7,90,40,74])),b3e=Ee("/settings/advanced")({component:Ie(y3e,"component")}),S3e=()=>Re(()=>import("./appearance-BHnbKYJT.js"),__vite__mapDeps([96,6,93,45,89,7,18,90,40,74,65])),w3e=Ee("/settings/appearance")({component:Ie(S3e,"component")}),C3e=()=>Re(()=>import("./calendars-CbchUImt.js"),__vite__mapDeps([97,59,13,38,16,17,19,61,98,31,99,100,25,74,33,18,37,101,6,89,7,90,40])),E3e=Ee("/settings/calendars")({component:Ie(C3e,"component")}),_3e=()=>Re(()=>import("./classification-DzmiHklC.js"),__vite__mapDeps([102,103,13,16,17,33,92,18,6,89,7,90,40,74])),x3e=Ee("/settings/classification")({component:Ie(_3e,"component")}),A3e=()=>Re(()=>import("./filters-Mgogmt5O.js"),__vite__mapDeps([104,13,3,71,67,32,16,17,61,69,65,75,73,18,6,89,7,90,40,74])),I3e=Ee("/settings/filters")({component:Ie(A3e,"component")}),R3e=()=>Re(()=>import("./folders-DodnBZua.js"),__vite__mapDeps([105,68,42,6,89,7,18,90,40,74,13,16,17,25])),T3e=Ee("/settings/folders")({component:Ie(R3e,"component")}),O3e=()=>Re(()=>import("./labels-BLy-VSyB.js"),__vite__mapDeps([106,69,16,17,71,6,89,7,18,90,40,74,13,33])),M3e=Ee("/settings/labels")({component:Ie(O3e,"component")}),P3e=()=>Re(()=>import("./people-DoJm1MLz.js"),__vite__mapDeps([107,103,101,55,6,89,7,18,90,40,74])),N3e=Ee("/settings/people")({component:Ie(P3e,"component")}),k3e=()=>Re(()=>import("./senders-BjvP6Oq9.js"),__vite__mapDeps([108,31,6,93,45,13,89,7,18,90,40,74])),D3e=Ee("/settings/senders")({component:Ie(k3e,"component")}),L3e=()=>Re(()=>import("./suggested-vips-DRijwoFY.js"),[]),U3e=Ee("/settings/suggested-vips")({component:Ie(L3e,"component")}),F3e=()=>Re(()=>import("./warnings-CDdQ-K5m.js"),__vite__mapDeps([109,41,38,18,75,101,95,13,6,93,45,89,7,90,40,74])),$3e=Ee("/settings/warnings")({component:Ie(F3e,"component")}),z3e=()=>Re(()=>import("./_view._date-DyseRkCh.js"),__vite__mapDeps([110,59,13,38,98,31,111,112,4,3,5,12,58,60,10,61,62,64,113,44,17,90,114,115,99,100,25,74,116,63,16,40,2,117])),j3e=Ee("/calendar/$view/$date")({validateSearch:xT,beforeLoad:({params:e,search:t,location:n})=>{const r=Kke(e,YH(new Date));if(!(r.view===e.view&&r.date===e.date))throw Sc({to:"/calendar/$view/$date",params:r,search:t,hash:n.hash,replace:!0})},component:Ie(z3e,"component")}),B3e=()=>Re(()=>import("./index-DcMLhAhx.js"),__vite__mapDeps([118,50,51,39,5,4,3,34,11,38,9,52,53,45,24,17,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,37,35,36,70,71,72,73,74,75])),H3e=Ee("/mail/$mailboxId/")({component:Ie(B3e,"component")}),q3e=()=>Re(()=>import("./_threadId-DdQZmst0.js"),[]),V3e=Ee("/mail/$mailboxId/$threadId")({component:Ie(q3e,"component")}),W3e=()=>Re(()=>import("./index-DxDWr9QM.js"),__vite__mapDeps([119,79,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,70,71,35,36,37,80])),G3e=Ee("/mail/brief/")({component:Ie(W3e,"component")}),K3e=()=>Re(()=>import("./_threadId-mITrrqLR.js"),[]),Z3e=Ee("/mail/brief/$threadId")({component:Ie(K3e,"component")}),Y3e=()=>Re(()=>import("./index-Dvms4bLC.js"),__vite__mapDeps([120,83,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,51,37,80])),Q3e=Ee("/mail/flagged/")({component:Ie(Y3e,"component")}),X3e=()=>Re(()=>import("./_threadId-9uIkuh2L.js"),[]),J3e=Ee("/mail/flagged/$threadId")({component:Ie(X3e,"component")}),eDe=()=>Re(()=>import("./index-Tl1Nlwxt.js"),__vite__mapDeps([121,85,53,45,34,11,4,3,5,24,43,72,40,9,36,64,86,87])),tDe=Ee("/mail/outbox/")({component:Ie(eDe,"component")}),nDe=()=>Re(()=>import("./index-DtqBFgK5.js"),[]),rDe=Ee("/calendar/$view/$date/")({component:Ie(nDe,"component")}),oDe=()=>Re(()=>import("./_calendarObjectId-5z-o0pQB.js"),[]),sDe=Ee("/calendar/$view/$date/$calendarObjectId")({component:Ie(oDe,"component")}),Os=e=>String(e).padStart(2,"0"),QH=e=>`${e.getUTCFullYear()}-${Os(e.getUTCMonth()+1)}-${Os(e.getUTCDate())}`,AT=e=>{const t=e<0?"-":"+",n=Math.abs(e);return`${t}${Os(Math.floor(n/60))}:${Os(n%60)}`};function XH(e,t){const n=new Date(`${e}T${t}:00`);return`${e}T${t}:00${AT(-n.getTimezoneOffset())}`}const p_=new Map;function iDe(e){if(p_.has(e))return p_.get(e);let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{t=void 0}return p_.set(e,t),t}function IA(e,t){const n=iDe(e);if(!n)return Number.NaN;const r=n.formatToParts(new Date(t)),o=u=>Number(r.find(c=>c.type===u)?.value),s=o("hour")%24;return(Date.UTC(o("year"),o("month")-1,o("day"),s,o("minute"),o("second"))-t)/6e4}function O5(e,t,n){if(n==="")return`${e}T${t}:00+00:00`;const r=Date.parse(`${e}T${t}:00Z`),o=IA(n,r);if(Number.isNaN(o))return XH(e,t);const s=IA(n,r-o*6e4);return`${e}T${t}:00${AT(Number.isNaN(s)?o:s)}`}function M5(e,t){const n=Date.parse(e),r=IA(t,n),o=Number.isNaN(r)?-new Date(n).getTimezoneOffset():r,s=new Date(n+o*6e4);return`${QH(s)}T${Os(s.getUTCHours())}:${Os(s.getUTCMinutes())}:${Os(s.getUTCSeconds())}${AT(o)}`}const Av=e=>XH(e,"00:00");function Di(e,t){const[n,r,o]=e.split("-").map(Number);return QH(new Date(Date.UTC(n,r-1,o+t)))}function g_(e){const[t,n,r]=e.split("-").map(Number),o=new Date(Date.UTC(t,n-1,r));return Di(e,-((o.getUTCDay()+6)%7))}function aDe(e,t){const[n,r]=t.split("-").map(Number);if(e==="year")return[`${n}-01-01`,`${n+1}-01-01`];if(e==="month"){const s=`${n}-${Os(r)}-01`,a=r===12?`${n+1}-01-01`:`${n}-${Os(r+1)}-01`;return[g_(s),Di(g_(Di(a,-1)),7)]}if(e==="day")return[t,Di(t,1)];const o=g_(t);return[o,Di(o,7)]}function dFe(e,t){const[n,r]=aDe(e,t);return{from:Av(n),to:Av(r)}}function fFe(e,t){return{from:Av(e),to:Av(Di(e,t))}}const lDe=mPe({offset:!0,local:!1}),JH=vPe(),P5=_v().transform(e=>{const t=CH([lDe,JH]).safeParse(e);return t.success?t.data:void 0}).optional(),uDe=xT.extend({start:P5,end:P5}),qg=e=>JH.safeParse(e).success;function Vg(e){return{date:e,endDate:e,startTime:"09:00",endTime:"10:00",allDay:!1}}function hFe(e,t,n,r){if(e===void 0||t===void 0)return Vg(n);if(qg(e)&&qg(t)){const a=Di(t,-1);return a<e?Vg(n):{date:e,endDate:a,startTime:"",endTime:"",allDay:!0}}if(qg(e)||qg(t)||Date.parse(t)<=Date.parse(e))return Vg(n);const o=M5(e,r),s=M5(t,r);return{date:o.slice(0,10),endDate:s.slice(0,10),startTime:o.slice(11,16),endTime:s.slice(11,16),allDay:!1}}function pFe(e,t){return e.allDay?{start:e.date,end:Di(e.endDate,1)}:{start:O5(e.date,e.startTime,t),end:O5(e.endDate,e.endTime,t)}}const cDe=()=>Re(()=>import("./new-D7laO9Pg.js"),__vite__mapDeps([122,123,115,60,99,100,59,13,38,25,74,112,111,98,31,62,4,3,12,5,114,116,124,16,17,33])),dDe=Ee("/calendar/$view/$date/new")({validateSearch:uDe,component:Ie(cDe,"component")}),fDe=()=>Re(()=>import("./index-DHvQcDnk.js"),__vite__mapDeps([125,50,51,39,5,4,3,34,11,38,9,52,53,45,24,17,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,37,35,36,70,71,72,73,74,75])),hDe=Ee("/mail/$mailboxId/$threadId/")({component:Ie(fDe,"component")}),pDe=()=>Re(()=>import("./_messageId-DHvQcDnk.js"),__vite__mapDeps([126,50,51,39,5,4,3,34,11,38,9,52,53,45,24,17,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,37,35,36,70,71,72,73,74,75])),gDe=Ee("/mail/$mailboxId/$threadId/$messageId")({component:Ie(pDe,"component")}),mDe=()=>Re(()=>import("./compose._-_outboxMessageId_-B7D1W3Sx.js"),__vite__mapDeps([127,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),vDe=Ee("/mail/$mailboxId/compose/{-$outboxMessageId}")({component:Ie(mDe,"component")}),yDe=()=>Re(()=>import("./index-Dk8Pv3WS.js"),__vite__mapDeps([128,79,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,70,71,35,36,37,80])),bDe=Ee("/mail/brief/$threadId/")({component:Ie(yDe,"component")}),SDe=()=>Re(()=>import("./_messageId-Dk8Pv3WS.js"),__vite__mapDeps([129,79,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,70,71,35,36,37,80])),wDe=Ee("/mail/brief/$threadId/$messageId")({component:Ie(SDe,"component")}),CDe=()=>Re(()=>import("./compose._-_outboxMessageId_-D0T64VP0.js"),__vite__mapDeps([130,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),EDe=Ee("/mail/brief/compose/{-$outboxMessageId}")({component:Ie(CDe,"component")}),_De=()=>Re(()=>import("./index-q5-pR6qn.js"),__vite__mapDeps([131,83,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,51,37,80])),xDe=Ee("/mail/flagged/$threadId/")({component:Ie(_De,"component")}),ADe=()=>Re(()=>import("./_messageId-q5-pR6qn.js"),__vite__mapDeps([132,83,52,53,45,34,11,4,3,5,24,9,17,39,38,28,29,30,31,32,6,18,54,55,8,13,10,56,7,57,58,59,60,61,62,12,63,48,64,65,66,2,40,67,16,68,33,69,51,37,80])),IDe=Ee("/mail/flagged/$threadId/$messageId")({component:Ie(ADe,"component")}),RDe=()=>Re(()=>import("./compose._-_outboxMessageId_-pcn-0-gQ.js"),__vite__mapDeps([133,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),TDe=Ee("/mail/flagged/compose/{-$outboxMessageId}")({component:Ie(RDe,"component")}),ODe=()=>Re(()=>import("./compose._-_outboxMessageId_-CO4UJXl9.js"),__vite__mapDeps([134,27,28,24,5,4,3,29,30,31,32,6,17,13,33])),MDe=Ee("/mail/outbox/compose/{-$outboxMessageId}")({component:Ie(ODe,"component")}),PDe=()=>Re(()=>import("./_outboxMessageId-Akv-3HPP.js"),__vite__mapDeps([135,85,53,45,34,11,4,3,5,24,43,72,40,9,36,64,86,87])),NDe=Ee("/mail/outbox/draft/$outboxMessageId")({component:Ie(PDe,"component")}),kDe=()=>Re(()=>import("./index-JdYKPBmV.js"),__vite__mapDeps([136,137,59,13,38,112,111,62,4,3,12,5,116,100,25,99,74,33])),DDe=Ee("/calendar/$view/$date/$calendarObjectId/")({component:Ie(kDe,"component")}),LDe=()=>Re(()=>import("./_recurrenceId-DrNRvEqM.js"),[]),UDe=Ee("/calendar/$view/$date/$calendarObjectId/$recurrenceId")({component:Ie(LDe,"component")}),FDe=()=>Re(()=>import("./edit-DCtOcxf9.js"),__vite__mapDeps([138,123,115,60,99,100,59,13,38,25,74,112,111,98,31,62,4,3,12,5,114,116,124,16,17,33])),$De=Ee("/calendar/$view/$date/$calendarObjectId/edit")({component:Ie(FDe,"component")}),zDe=()=>Re(()=>import("./suggestion._suggestionId-Ca3k8ej7.js"),__vite__mapDeps([139,59,13,38,115,60,99,100,25,74,62,116,63,57,124,16,17,4,3,12,5])),jDe=Ee("/calendar/$view/$date/suggestion/$suggestionId")({component:Ie(zDe,"component")}),BDe=()=>Re(()=>import("./task._calendarTaskId-CvuxUcFe.js"),__vite__mapDeps([140,59,13,38,111,4,3,12,5,113,100,25])),HDe=Ee("/calendar/$view/$date/task/$calendarTaskId")({component:Ie(BDe,"component")}),qDe=()=>Re(()=>import("./index-DfAafcCq.js"),__vite__mapDeps([141,137,59,13,38,112,111,62,4,3,12,5,116,100,25,99,74,33])),VDe=Ee("/calendar/$view/$date/$calendarObjectId/$recurrenceId/")({component:Ie(qDe,"component")}),WDe=()=>Re(()=>import("./edit-DbSsj2wh.js"),__vite__mapDeps([142,123,115,60,99,100,59,13,38,25,74,112,111,98,31,62,4,3,12,5,114,116,124,16,17,33])),GDe=Ee("/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit")({component:Ie(WDe,"component")}),KDe=Ee("/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}")({validateSearch:_T.mailbox}),ZDe=Ee("/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}")({validateSearch:_T.brief}),YDe=Ee("/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}")({validateSearch:_T.flagged}),QDe=oke.update({id:"/",path:"/",getParentRoute:()=>ea}),IT=ake.update({id:"/calendar",path:"/calendar",getParentRoute:()=>ea}),XDe=uke.update({id:"/import",path:"/import",getParentRoute:()=>ea}),Ec=Eke.update({id:"/mail",path:"/mail",getParentRoute:()=>ea}),JDe=xke.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>ea}),Qn=Bke.update({id:"/settings",path:"/settings",getParentRoute:()=>ea}),eLe=Xke.update({id:"/",path:"/",getParentRoute:()=>IT}),tLe=Jke.update({id:"/",path:"/",getParentRoute:()=>Ec}),sb=t3e.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>Ec}),ib=o3e.update({id:"/brief",path:"/brief",getParentRoute:()=>Ec}),ab=a3e.update({id:"/flagged",path:"/flagged",getParentRoute:()=>Ec}),lb=u3e.update({id:"/outbox",path:"/outbox",getParentRoute:()=>Ec}),nLe=c3e.update({id:"/reset-password/$token",path:"/reset-password/$token",getParentRoute:()=>ea}),rLe=f3e.update({id:"/",path:"/",getParentRoute:()=>Qn}),oLe=p3e.update({id:"/$slotId",path:"/$slotId",getParentRoute:()=>Qn}),sLe=v3e.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Qn}),iLe=b3e.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Qn}),aLe=w3e.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Qn}),lLe=E3e.update({id:"/calendars",path:"/calendars",getParentRoute:()=>Qn}),uLe=x3e.update({id:"/classification",path:"/classification",getParentRoute:()=>Qn}),cLe=I3e.update({id:"/filters",path:"/filters",getParentRoute:()=>Qn}),dLe=T3e.update({id:"/folders",path:"/folders",getParentRoute:()=>Qn}),fLe=M3e.update({id:"/labels",path:"/labels",getParentRoute:()=>Qn}),hLe=N3e.update({id:"/people",path:"/people",getParentRoute:()=>Qn}),pLe=D3e.update({id:"/senders",path:"/senders",getParentRoute:()=>Qn}),gLe=U3e.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Qn}),mLe=$3e.update({id:"/warnings",path:"/warnings",getParentRoute:()=>Qn}),_c=j3e.update({id:"/$view/$date",path:"/$view/$date",getParentRoute:()=>IT}),vLe=H3e.update({id:"/",path:"/",getParentRoute:()=>sb}),RT=V3e.update({id:"/$threadId",path:"/$threadId",getParentRoute:()=>sb}),yLe=G3e.update({id:"/",path:"/",getParentRoute:()=>ib}),TT=Z3e.update({id:"/$threadId",path:"/$threadId",getParentRoute:()=>ib}),bLe=Q3e.update({id:"/",path:"/",getParentRoute:()=>ab}),OT=J3e.update({id:"/$threadId",path:"/$threadId",getParentRoute:()=>ab}),SLe=tDe.update({id:"/",path:"/",getParentRoute:()=>lb}),wLe=rDe.update({id:"/",path:"/",getParentRoute:()=>_c}),ub=sDe.update({id:"/$calendarObjectId",path:"/$calendarObjectId",getParentRoute:()=>_c}),CLe=dDe.update({id:"/new",path:"/new",getParentRoute:()=>_c}),ELe=hDe.update({id:"/",path:"/",getParentRoute:()=>RT}),eq=gDe.update({id:"/$messageId",path:"/$messageId",getParentRoute:()=>RT}),_Le=vDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>sb}),xLe=bDe.update({id:"/",path:"/",getParentRoute:()=>TT}),tq=wDe.update({id:"/$messageId",path:"/$messageId",getParentRoute:()=>TT}),ALe=EDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>ib}),ILe=xDe.update({id:"/",path:"/",getParentRoute:()=>OT}),nq=IDe.update({id:"/$messageId",path:"/$messageId",getParentRoute:()=>OT}),RLe=TDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>ab}),TLe=MDe.update({id:"/compose/{-$outboxMessageId}",path:"/compose/{-$outboxMessageId}",getParentRoute:()=>lb}),OLe=NDe.update({id:"/draft/$outboxMessageId",path:"/draft/$outboxMessageId",getParentRoute:()=>lb}),MLe=DDe.update({id:"/",path:"/",getParentRoute:()=>ub}),MT=UDe.update({id:"/$recurrenceId",path:"/$recurrenceId",getParentRoute:()=>ub}),PLe=$De.update({id:"/edit",path:"/edit",getParentRoute:()=>ub}),NLe=jDe.update({id:"/suggestion/$suggestionId",path:"/suggestion/$suggestionId",getParentRoute:()=>_c}),kLe=HDe.update({id:"/task/$calendarTaskId",path:"/task/$calendarTaskId",getParentRoute:()=>_c}),DLe=VDe.update({id:"/",path:"/",getParentRoute:()=>MT}),LLe=GDe.update({id:"/edit",path:"/edit",getParentRoute:()=>MT}),ULe=KDe.update({id:"/$mode/{-$outboxMessageId}",path:"/$mode/{-$outboxMessageId}",getParentRoute:()=>eq}),FLe=ZDe.update({id:"/$mode/{-$outboxMessageId}",path:"/$mode/{-$outboxMessageId}",getParentRoute:()=>tq}),$Le=YDe.update({id:"/$mode/{-$outboxMessageId}",path:"/$mode/{-$outboxMessageId}",getParentRoute:()=>nq}),zLe={CalendarViewDateCalendarObjectIdRecurrenceIdEditRoute:LLe,CalendarViewDateCalendarObjectIdRecurrenceIdIndexRoute:DLe},jLe=MT._addFileChildren(zLe),BLe={CalendarViewDateCalendarObjectIdRecurrenceIdRoute:jLe,CalendarViewDateCalendarObjectIdEditRoute:PLe,CalendarViewDateCalendarObjectIdIndexRoute:MLe},HLe=ub._addFileChildren(BLe),qLe={CalendarViewDateCalendarObjectIdRoute:HLe,CalendarViewDateNewRoute:CLe,CalendarViewDateIndexRoute:wLe,CalendarViewDateSuggestionSuggestionIdRoute:NLe,CalendarViewDateTaskCalendarTaskIdRoute:kLe},VLe=_c._addFileChildren(qLe),WLe={CalendarIndexRoute:eLe,CalendarViewDateRoute:VLe},GLe=IT._addFileChildren(WLe),KLe={MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:ULe},ZLe=eq._addFileChildren(KLe),YLe={MailMailboxIdThreadIdMessageIdRoute:ZLe,MailMailboxIdThreadIdIndexRoute:ELe},QLe=RT._addFileChildren(YLe),XLe={MailMailboxIdThreadIdRoute:QLe,MailMailboxIdIndexRoute:vLe,MailMailboxIdComposeChar123OutboxMessageIdChar125Route:_Le},JLe=sb._addFileChildren(XLe),e4e={MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:FLe},t4e=tq._addFileChildren(e4e),n4e={MailBriefThreadIdMessageIdRoute:t4e,MailBriefThreadIdIndexRoute:xLe},r4e=TT._addFileChildren(n4e),o4e={MailBriefThreadIdRoute:r4e,MailBriefIndexRoute:yLe,MailBriefComposeChar123OutboxMessageIdChar125Route:ALe},s4e=ib._addFileChildren(o4e),i4e={MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:$Le},a4e=nq._addFileChildren(i4e),l4e={MailFlaggedThreadIdMessageIdRoute:a4e,MailFlaggedThreadIdIndexRoute:ILe},u4e=OT._addFileChildren(l4e),c4e={MailFlaggedThreadIdRoute:u4e,MailFlaggedIndexRoute:bLe,MailFlaggedComposeChar123OutboxMessageIdChar125Route:RLe},d4e=ab._addFileChildren(c4e),f4e={MailOutboxIndexRoute:SLe,MailOutboxComposeChar123OutboxMessageIdChar125Route:TLe,MailOutboxDraftOutboxMessageIdRoute:OLe},h4e=lb._addFileChildren(f4e),p4e={MailMailboxIdRoute:JLe,MailBriefRoute:s4e,MailFlaggedRoute:d4e,MailOutboxRoute:h4e,MailIndexRoute:tLe},g4e=Ec._addFileChildren(p4e),m4e={SettingsSlotIdRoute:oLe,SettingsAccountsRoute:sLe,SettingsAdvancedRoute:iLe,SettingsAppearanceRoute:aLe,SettingsCalendarsRoute:lLe,SettingsClassificationRoute:uLe,SettingsFiltersRoute:cLe,SettingsFoldersRoute:dLe,SettingsLabelsRoute:fLe,SettingsPeopleRoute:hLe,SettingsSendersRoute:pLe,SettingsSuggestedVipsRoute:gLe,SettingsWarningsRoute:mLe,SettingsIndexRoute:rLe},v4e=Qn._addFileChildren(m4e),y4e={IndexRoute:QDe,CalendarRoute:GLe,ImportRoute:XDe,MailRoute:g4e,OnboardingRoute:JDe,SettingsRoute:v4e,ResetPasswordTokenRoute:nLe},b4e=ea._addFileChildren(y4e)._addFileTypes(),S4e=(e,t,n)=>{const r=mye({routeTree:b4e,context:{queryClient:e},history:n,stringifySearch:Cxe,defaultPreload:"intent",defaultPendingComponent:Kv,defaultPendingMs:200,defaultPendingMinMs:300});return r.subscribe("onResolved",o=>{t.recordPageView(o.toLocation.pathname),Tre(o.toLocation.pathname)}),r},De=e=>typeof e=="string",jd=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},N5=e=>e==null?"":""+e,w4e=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},C4e=/###/g,k5=e=>e&&e.indexOf("###")>-1?e.replace(C4e,"."):e,D5=e=>!e||De(e),mf=(e,t,n)=>{const r=De(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(D5(e))return{};const s=k5(r[o]);!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++o}return D5(e)?{}:{obj:e,k:k5(r[o])}},L5=(e,t,n)=>{const{obj:r,k:o}=mf(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let s=t[t.length-1],a=t.slice(0,t.length-1),u=mf(e,a,Object);for(;u.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),u=mf(e,a,Object),u?.obj&&typeof u.obj[`${u.k}.${s}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=n},E4e=(e,t,n,r)=>{const{obj:o,k:s}=mf(e,t,Object);o[s]=o[s]||[],o[s].push(n)},Iv=(e,t)=>{const{obj:n,k:r}=mf(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},_4e=(e,t,n)=>{const r=Iv(e,n);return r!==void 0?r:Iv(t,n)},rq=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?De(e[r])||e[r]instanceof String||De(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):rq(e[r],t[r],n):e[r]=t[r]);return e},du=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var x4e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const A4e=e=>De(e)?e.replace(/[&<>"'\/]/g,t=>x4e[t]):e;class I4e{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const R4e=[" ",",","?","!",";"],T4e=new I4e(20),O4e=(e,t,n)=>{t=t||"",n=n||"";const r=R4e.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const o=T4e.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!o.test(e);if(!s){const a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(s=!0)}return s},RA=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let s=0;s<r.length;){if(!o||typeof o!="object")return;let a,u="";for(let c=s;c<r.length;++c)if(c!==s&&(u+=n),u+=r[c],a=o[u],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<r.length-1)continue;s+=c-s+1;break}o=a}return o},Rv=e=>e?.replace("_","-"),M4e={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Tv{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||M4e,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(De(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Tv(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Tv(this.logger,t)}}var Fo=new Tv;class cb{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u.apply(u,[t,...r])})}}class U5 extends cb{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,a=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;t.indexOf(".")>-1?u=t.split("."):(u=[t,n],r&&(Array.isArray(r)?u.push(...r):De(r)&&s?u.push(...r.split(s)):u.push(r)));const c=Iv(this.data,u);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=u[0],n=u[1],r=u.slice(2).join(".")),c||!a||!De(r)?c:RA(this.data?.[t]?.[n],r,s)}addResource(t,n,r,o){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=[t,n];r&&(u=u.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(u=t.split("."),o=n,n=u[1]),this.addNamespaces(n),L5(this.data,u,o),s.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(De(r[s])||Array.isArray(r[s]))&&this.addResource(t,n,s,r[s],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,s){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[t,n];t.indexOf(".")>-1&&(u=t.split("."),o=r,r=n,n=u[1]),this.addNamespaces(n);let c=Iv(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?rq(c,r,s):c={...c,...r},L5(this.data,u,c),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var oq={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(s=>{t=this.processors[s]?.process(t,n,r,o)??t}),t}};const F5={},$5=e=>!De(e)&&typeof e!="boolean"&&typeof e!="number";class Ov extends cb{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),w4e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Fo.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!O4e(t,r,o);if(a&&!u){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:De(s)?[s]:s};const f=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),t=f.join(o)}return{key:t,namespaces:De(s)?[s]:s}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(t[t.length-1],n),c=u[u.length-1],f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode"){if(h){const F=n.nsSeparator||this.options.nsSeparator;return o?{res:`${c}${F}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${F}${a}`}return o?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const g=this.resolve(t,n);let m=g?.res;const v=g?.usedKey||a,w=g?.exactUsedKey||a,S=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,A=n.count!==void 0&&!De(n.count),I=Ov.hasDefaultValue(n),T=A?this.pluralResolver.getSuffix(f,n.count,n):"",N=n.ordinal&&A?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",M=A&&!n.ordinal&&n.count===0,R=M&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${T}`]||n[`defaultValue${N}`]||n.defaultValue;let k=m;E&&!m&&I&&(k=R);const L=$5(k),q=Object.prototype.toString.apply(k);if(E&&k&&L&&S.indexOf(q)<0&&!(De(C)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,k,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(g.res=F,g.usedParams=this.getUsedParamsDetails(n),g):F}if(s){const F=Array.isArray(k),D=F?[]:{},j=F?w:v;for(const Z in k)if(Object.prototype.hasOwnProperty.call(k,Z)){const he=`${j}${s}${Z}`;I&&!m?D[Z]=this.translate(he,{...n,defaultValue:$5(R)?R[Z]:void 0,joinArrays:!1,ns:u}):D[Z]=this.translate(he,{...n,joinArrays:!1,ns:u}),D[Z]===he&&(D[Z]=k[Z])}m=D}}else if(E&&De(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,t,n,r));else{let F=!1,D=!1;!this.isValidLookup(m)&&I&&(F=!0,m=R),this.isValidLookup(m)||(D=!0,m=a);const Z=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:m,he=I&&R!==m&&this.options.updateMissing;if(D||F||he){if(this.logger.log(he?"updateKey":"missingKey",f,c,a,he?R:m),s){const ue=this.resolve(a,{...n,keySeparator:!1});ue&&ue.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const Q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Q&&Q[0])for(let ue=0;ue<Q.length;ue++)B.push(Q[ue]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(n.lng||this.language):B.push(n.lng||this.language);const ae=(ue,we,U)=>{const X=I&&U!==m?U:Z;this.options.missingKeyHandler?this.options.missingKeyHandler(ue,c,we,X,he,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ue,c,we,X,he,n),this.emit("missingKey",ue,c,we,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?B.forEach(ue=>{const we=this.pluralResolver.getSuffixes(ue,n);M&&n[`defaultValue${this.options.pluralSeparator}zero`]&&we.indexOf(`${this.options.pluralSeparator}zero`)<0&&we.push(`${this.options.pluralSeparator}zero`),we.forEach(U=>{ae([ue],a+U,n[`defaultValue${U}`]||R)})}):ae(B,a,R))}m=this.extendTranslation(m,t,n,g,r),D&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(D||F)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,F?m:void 0))}return o?(g.res=m,g.usedParams=this.getUsedParamsDetails(n),g):m}extendTranslation(t,n,r,o,s){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=De(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const m=t.match(this.interpolator.nestingRegexp);h=m&&m.length}let g=r.replace&&!De(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),t=this.interpolator.interpolate(t,g,r.lng||this.language||o.usedLng,r),f){const m=t.match(this.interpolator.nestingRegexp),v=m&&m.length;h<v&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var m=arguments.length,v=new Array(m),w=0;w<m;w++)v[w]=arguments[w];return s?.[0]===v[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):a.translate(...v,n)},r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,c=De(u)?[u]:u;return t!=null&&c?.length&&r.applyPostProcessor!==!1&&(t=oq.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,s,a,u;return De(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(c,n),h=f.key;o=h;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const m=n.count!==void 0&&!De(n.count),v=m&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(De(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(C=>{this.isValidLookup(r)||(u=C,!F5[`${S[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(F5[`${S[0]}-${C}`]=!0,this.logger.warn(`key "${o}" for languages "${S.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(E=>{if(this.isValidLookup(r))return;a=E;const A=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(A,h,E,C,n);else{let T;m&&(T=this.pluralResolver.getSuffix(E,n.count,n));const N=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(A.push(h+T),n.ordinal&&T.indexOf(M)===0&&A.push(h+T.replace(M,this.options.pluralSeparator)),v&&A.push(h+N)),w){const R=`${h}${this.options.contextSeparator}${n.context}`;A.push(R),m&&(A.push(R+T),n.ordinal&&T.indexOf(M)===0&&A.push(R+T.replace(M,this.options.pluralSeparator)),v&&A.push(R+N))}}let I;for(;I=A.pop();)this.isValidLookup(r)||(s=I,r=this.getResource(E,C,I,n))}))})}),{res:r,usedKey:o,exactUsedKey:s,usedLng:a,usedNS:u}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!De(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const s of n)delete o[s]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class z5{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fo.create("languageUtils")}getScriptPartFromCode(t){if(t=Rv(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Rv(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(De(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),De(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],s=a=>{a&&(this.isSupportedCode(a)?o.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return De(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):De(t)&&s(this.formatLanguageCode(t)),r.forEach(a=>{o.indexOf(a)<0&&s(this.formatLanguageCode(a))}),o}}const j5={zero:0,one:1,two:2,few:3,many:4,other:5},B5={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class P4e{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Fo.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Rv(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:o});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),B5;if(!t.match(/-|_/))return B5;const c=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(c,n)}return this.pluralRulesCache[s]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,s)=>j5[o]-j5[s]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const H5=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=_4e(e,t,n);return!s&&o&&De(n)&&(s=RA(e,n,r),s===void 0&&(s=RA(t,n,r))),s},m_=e=>e.replace(/\$/g,"$$$$");class N4e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fo.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:s,prefixEscaped:a,suffix:u,suffixEscaped:c,formatSeparator:f,unescapeSuffix:h,unescapePrefix:g,nestingPrefix:m,nestingPrefixEscaped:v,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:C,maxReplaces:E,alwaysFormat:A}=t.interpolation;this.escape=n!==void 0?n:A4e,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=s?du(s):a||"{{",this.suffix=u?du(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=m?du(m):v||du("$t("),this.nestingSuffix=w?du(w):S||du(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=E||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let s,a,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=v=>{if(v.indexOf(this.formatSeparator)<0){const E=H5(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,r,{...o,...n,interpolationkey:v}):E}const w=v.split(this.formatSeparator),S=w.shift().trim(),C=w.join(this.formatSeparator).trim();return this.format(H5(n,c,S,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...o,...n,interpolationkey:S})};this.resetRegExp();const h=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>m_(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?m_(this.escape(v)):m_(v)}].forEach(v=>{for(u=0;s=v.regex.exec(t);){const w=s[1].trim();if(a=f(w),a===void 0)if(typeof h=="function"){const C=h(t,s,o);a=De(C)?C:""}else if(o&&Object.prototype.hasOwnProperty.call(o,w))a="";else if(g){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),a="";else!De(a)&&!this.useRawValueToEscape&&(a=N5(a));const S=v.safeValue(a);if(t=t.replace(s[0],S),g?(v.regex.lastIndex+=a.length,v.regex.lastIndex-=s[0].length):v.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,a;const u=(c,f)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const g=c.split(new RegExp(`${h}[ ]*{`));let m=`{${g[1]}`;c=g[0],m=this.interpolate(m,a);const v=m.match(/'/g),w=m.match(/"/g);((v?.length??0)%2===0&&!w||w.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),f&&(a={...f,...a})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,S),`${c}${h}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;o=this.nestingRegexp.exec(t);){let c=[];a={...r},a=a.replace&&!De(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let f=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const h=o[1].split(this.formatSeparator).map(g=>g.trim());o[1]=h.shift(),c=h,f=!0}if(s=n(u.call(this,o[1].trim(),a),a),s&&o[0]===t&&!De(s))return s;De(s)||(s=N5(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),s=""),f&&(s=c.reduce((h,g)=>this.format(h,g,r.lng,{...r,interpolationkey:o[1].trim()}),s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}const k4e=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(a=>{if(a){const[u,...c]=a.split(":"),f=c.join(":").trim().replace(/^'+|'+$/g,""),h=u.trim();n[h]||(n[h]=f),f==="false"&&(n[h]=!1),f==="true"&&(n[h]=!0),isNaN(f)||(n[h]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},fu=e=>{const t={};return(n,r,o)=>{let s=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(s={...s,[o.interpolationkey]:void 0});const a=r+JSON.stringify(s);let u=t[a];return u||(u=e(Rv(r),o),t[a]=u),u(n)}};class D4e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Fo.create("formatter"),this.options=t,this.formats={number:fu((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return s=>o.format(s)}),currency:fu((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>o.format(s)}),datetime:fu((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return s=>o.format(s)}),relativetime:fu((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return s=>o.format(s,r.range||"day")}),list:fu((n,r)=>{const o=new Intl.ListFormat(n,{...r});return s=>o.format(s)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=fu(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(u=>u.indexOf(")")>-1)){const u=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,u)].join(this.formatSeparator)}return s.reduce((u,c)=>{const{formatName:f,formatOptions:h}=k4e(c);if(this.formats[f]){let g=u;try{const m=o?.formatParams?.[o.interpolationkey]||{},v=m.locale||m.lng||o.locale||o.lng||r;g=this.formats[f](u,v,{...h,...o,...m})}catch(m){this.logger.warn(m)}return g}else this.logger.warn(`there was no format function for ${f}`);return u},t)}}const L4e=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class U4e extends cb{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Fo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,o.backend,o)}queueLoad(t,n,r,o){const s={},a={},u={},c={};return t.forEach(f=>{let h=!0;n.forEach(g=>{const m=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,h=!1,a[m]===void 0&&(a[m]=!0),s[m]===void 0&&(s[m]=!0),c[g]===void 0&&(c[g]=!0)))}),h||(u[f]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const o=t.split("|"),s=o[0],a=o[1];n&&this.emit("failedLoading",s,a,n),!n&&r&&this.store.addResourceBundle(s,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const u={};this.queue.forEach(c=>{E4e(c.loaded,[s],a),L4e(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(f=>{u[f]||(u[f]={});const h=c.loaded[f];h.length&&h.forEach(g=>{u[f][g]===void 0&&(u[f][g]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:s,callback:a});return}this.readingCalls++;const u=(f,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&h&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,s*2,a)},s);return}a(f,h)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const f=c(t,n);f&&typeof f.then=="function"?f.then(h=>u(null,h)).catch(u):u(null,f)}catch(f){u(f)}return}return c(t,n,u)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();De(t)&&(t=this.languageUtils.toResolveHierarchy(t)),De(n)&&(n=[n]);const s=this.queueLoad(t,n,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],s=r[1];this.read(o,s,"read",void 0,void 0,(a,u)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${o} failed`,a),!a&&u&&this.logger.log(`${n}loaded namespace ${s} for language ${o}`,u),this.loaded(t,a,u)})}saveMissing(t,n,r,o,s){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const c={...a,isUpdate:s},f=this.backend.create.bind(this.backend);if(f.length<6)try{let h;f.length===5?h=f(t,n,r,o,c):h=f(t,n,r,o),h&&typeof h.then=="function"?h.then(g=>u(null,g)).catch(u):u(null,h)}catch(h){u(h)}else f(t,n,r,o,u,c)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const q5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),De(e[1])&&(t.defaultValue=e[1]),De(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),V5=e=>(De(e.ns)&&(e.ns=[e.ns]),De(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),De(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Wg=()=>{},F4e=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Yf extends cb{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=V5(t),this.services={},this.logger=Fo,this.modules={external:[]},F4e(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(De(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=q5();this.options={...o,...this.options,...V5(n)},this.options.interpolation={...o.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const s=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Fo.init(s(this.modules.logger),this.options):Fo.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=D4e;const g=new z5(this.options);this.store=new U5(this.options.resources,this.options);const m=this.services;m.logger=Fo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new P4e(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=s(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new N4e(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new U4e(s(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(v){for(var w=arguments.length,S=new Array(w>1?w-1:0),C=1;C<w;C++)S[C-1]=arguments[C];t.emit(v,...S)}),this.modules.languageDetector&&(m.languageDetector=s(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=s(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Ov(this.services,this.options),this.translator.on("*",function(v){for(var w=arguments.length,S=new Array(w>1?w-1:0),C=1;C<w;C++)S[C-1]=arguments[C];t.emit(v,...S)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Wg),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const c=jd(),f=()=>{const h=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),r(g,m)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wg;const o=De(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};o?a(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload?.forEach?.(u=>a(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const o=jd();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Wg),this.services.backendConnector.reload(t,n,s=>{o.resolve(),r(s)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&oq.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=jd();this.emit("languageChanging",t);const s=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,f)=>{f?(s(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},u=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const f=De(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,h=>{a(h,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),o}getFixedT(t,n,r){var o=this;const s=function(a,u){let c;if(typeof u!="object"){for(var f=arguments.length,h=new Array(f>2?f-2:0),g=2;g<f;g++)h[g-2]=arguments[g];c=o.options.overloadTranslationOptionHandler([a,u].concat(h))}else c={...u};c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||s.keyPrefix);const m=o.options.keySeparator||".";let v;return c.keyPrefix&&Array.isArray(a)?v=a.map(w=>`${c.keyPrefix}${m}${w}`):v=c.keyPrefix?`${c.keyPrefix}${m}${a}`:a,o.t(v,c)};return De(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(u,c)=>{const f=this.services.backendConnector.state[`${u}|${c}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,a);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!o||a(s,t)))}loadNamespaces(t,n){const r=jd();return this.options.ns?(De(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=jd();De(t)&&(t=[t]);const o=this.options.preload||[],s=t.filter(a=>o.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=o.concat(s),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new z5(q5());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Yf(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wg;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},s=new Yf(o);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(u=>{s[u]=this[u]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const u=Object.keys(this.store.data).reduce((c,f)=>(c[f]={...this.store.data[f]},Object.keys(c[f]).reduce((h,g)=>(h[g]={...c[f][g]},h),{})),{});s.store=new U5(u,o),s.services.resourceStore=s.store}return s.translator=new Ov(s.services,o),s.translator.on("*",function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),h=1;h<c;h++)f[h-1]=arguments[h];s.emit(u,...f)}),s.init(o,n),s.translator.options=o,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Bn=Yf.createInstance();Bn.createInstance=Yf.createInstance;Bn.createInstance;Bn.dir;Bn.init;Bn.loadResources;Bn.reloadResources;Bn.use;Bn.changeLanguage;Bn.getFixedT;Bn.t;Bn.exists;Bn.setDefaultNamespace;Bn.hasLoadedNamespace;Bn.loadNamespaces;Bn.loadLanguages;const{slice:$4e,forEach:z4e}=[];function j4e(e){return z4e.call($4e.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function B4e(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const W5=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,H4e=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let s=`${e}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!W5.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!W5.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},G5={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=H4e(e,t,o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var q4e={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return G5.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:s}=t;n&&typeof document<"u"&&G5.create(n,e,r,o,s)}},V4e={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const s=r.substring(1).split("&");for(let a=0;a<s.length;a++){const u=s[a].indexOf("=");u>0&&s[a].substring(0,u)===t&&(n=s[a].substring(u+1))}}return n}},W4e={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const s=o.substring(1);if(t){const a=s.split("&");for(let u=0;u<a.length;u++){const c=a[u].indexOf("=");c>0&&a[u].substring(0,c)===t&&(r=a[u].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let hu=null;const K5=()=>{if(hu!==null)return hu;try{if(hu=typeof window<"u"&&window.localStorage!==null,!hu)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{hu=!1}return hu};var G4e={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&K5())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&K5()&&window.localStorage.setItem(n,e)}};let pu=null;const Z5=()=>{if(pu!==null)return pu;try{if(pu=typeof window<"u"&&window.sessionStorage!==null,!pu)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{pu=!1}return pu};var K4e={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Z5())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Z5()&&window.sessionStorage.setItem(n,e)}},Z4e={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let s=0;s<n.length;s++)t.push(n[s]);r&&t.push(r),o&&t.push(o)}return t.length>0?t:void 0}},Y4e={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Q4e={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},X4e={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let sq=!1;try{document.cookie,sq=!0}catch{}const iq=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];sq||iq.splice(1,1);const J4e=()=>({order:iq,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class aq{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=j4e(n,this.options||{},J4e()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(q4e),this.addDetector(V4e),this.addDetector(G4e),this.addDetector(K4e),this.addDetector(Z4e),this.addDetector(Y4e),this.addDetector(Q4e),this.addDetector(X4e),this.addDetector(W4e)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.filter(r=>r!=null&&!B4e(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}aq.type="languageDetector";const lq=["__proto__","constructor","prototype"];function uq(e){return!(typeof e!="string"||e.length===0||e.length>128||lq.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%:&=;\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function cq(e){return!(!uq(e)||e.indexOf("/")>-1||e.indexOf("@")>-1)}function eUe(e){return!(!uq(e)||e.indexOf("//")>-1)}const tUe={lng:cq,ns:eUe};function Gg(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function nUe(e){if(typeof e!="string"||e.length===0)return e;try{const t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function dq(){return typeof XMLHttpRequest=="function"||typeof XMLHttpRequest=="object"}function rUe(e){return!!e&&typeof e.then=="function"}function oUe(e){return rUe(e)?e:Promise.resolve(e)}const sUe=/\{\{(.+?)\}\}/g,Y5=/^[/\\]{2}/;function Q5(e,t){let n=!1;const r=e.replace(sUe,(o,s)=>{const a=s.trim();if(lq.indexOf(a)>-1)return o;const u=t[a];if(u==null)return o;const c=tUe[a]||cq,f=String(u).split("+");for(const h of f)if(!c(h))return n=!0,o;return f.join("+")});return n||Y5.test(r)&&!Y5.test(e)?null:r}const Ba=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof window<"u"?window:void 0;let Mv;typeof fetch=="function"?Mv=fetch:Ba&&typeof Ba.fetch=="function"&&(Mv=Ba.fetch);const X5=dq()&&Ba?Ba.XMLHttpRequest:void 0,iUe=typeof ActiveXObject=="function"&&Ba?Ba.ActiveXObject:void 0,fq=["__proto__","constructor","prototype"],TA=(e,t)=>{if(t&&typeof t=="object"){let n="";for(const r of Object.keys(t))fq.indexOf(r)>-1||(n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]));if(!n)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+n.slice(1)}return e},J5=(e,t,n,r)=>{const o=s=>{if(!s.ok)return n(s.statusText||"Error",{status:s.status});s.text().then(a=>{n(null,{status:s.status,data:a})}).catch(n)};if(r){const s=r(e,t);if(s instanceof Promise){s.then(o).catch(n);return}}typeof fetch=="function"?fetch(e,t).then(o).catch(n):Mv(e,t).then(o).catch(n)},aUe=(e,t,n,r)=>{e.queryStringParams&&(t=TA(t,e.queryStringParams));const o={...typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders};typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(o["Content-Type"]="application/json");const s=typeof e.requestOptions=="function"?e.requestOptions(n):e.requestOptions,a={method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o,...e._omitFetchOptions?{}:s},u=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{J5(t,a,r,u)}catch(c){if(!s||Object.keys(s).length===0||!c.message||c.message.indexOf("not implemented")<0)return r(c);try{Object.keys(s).forEach(f=>{delete a[f]}),J5(t,a,r,u),e._omitFetchOptions=!0}catch(f){r(f)}}},lUe=(e,t,n,r)=>{n&&typeof n=="object"&&(n=TA("",n).slice(1)),e.queryStringParams&&(t=TA(t,e.queryStringParams));try{const o=X5?new X5:new iUe("MSXML2.XMLHTTP.3.0");o.open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");let s=e.customHeaders;if(s=typeof s=="function"?s():s,s)for(const a of Object.keys(s))fq.indexOf(a)>-1||o.setRequestHeader(a,s[a]);o.onreadystatechange=()=>{o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(o){console&&console.log(o)}},uUe=(e,t,n,r)=>{if(typeof n=="function"&&(r=n,n=void 0),r=r||(()=>{}),Mv&&t.indexOf("file:")!==0)return aUe(e,t,n,r);if(dq()||typeof ActiveXObject=="function")return lUe(e,t,n,r);r(new Error("No fetch and no xhr implementation found!"))},cUe=()=>({loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||""}),parseLoadPayload:(e,t)=>{},request:uUe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}});var hq=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...cUe(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){const r=setInterval(()=>this.reload(),this.options.reloadInterval);typeof r=="object"&&typeof r.unref=="function"&&r.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,o){let s=this.options.loadPath;typeof this.options.loadPath=="function"&&(s=this.options.loadPath(e,n)),s=oUe(s),s.then(a=>{if(!a)return o(null,{});const u=Q5(a,{lng:e.join("+"),ns:n.join("+")});if(u==null){const c=e.map(Gg).join(", "),f=n.map(Gg).join(", ");return o(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+c+"] namespaces=["+f+"]"),!1)}this.loadUrl(u,o,t,r)})}loadUrl(e,t,n,r){const o=typeof n=="string"?[n]:n,s=typeof r=="string"?[r]:r,a=this.options.parseLoadPayload(o,s),u=Gg(nUe(e));this.options.request(this.options,e,a,(c,f)=>{if(f&&(f.status>=500&&f.status<600||!f.status))return t("failed loading "+u+"; status code: "+f.status,!0);if(f&&f.status>=400&&f.status<500)return t("failed loading "+u+"; status code: "+f.status,!1);if(!f&&c&&c.message){const m=c.message.toLowerCase();if(["failed","fetch","network","load"].find(v=>m.indexOf(v)>-1))return t("failed loading "+u+": "+Gg(c.message),!0)}if(c)return t(c,!1);let h,g;try{typeof f.data=="string"?h=this.options.parse(f.data,n,r):h=f.data}catch{g="failed parsing "+u+" to json"}if(g)return t(g,!1);t(null,h)})}create(e,t,n,r,o){if(!this.options.addPath)return;typeof e=="string"&&(e=[e]);const s=this.options.parsePayload(t,n,r);let a=0;const u=[],c=[];e.forEach(f=>{let h=this.options.addPath;typeof this.options.addPath=="function"&&(h=this.options.addPath(f,t));const g=Q5(h,{lng:f,ns:t});if(g==null){a+=1,o&&a===e.length&&o(u,c);return}this.options.request(this.options,g,s,(m,v)=>{a+=1,u.push(m),c.push(v),a===e.length&&typeof o=="function"&&o(u,c)})})}reload(){const{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()==="cimode")return;const o=[],s=a=>{t.toResolveHierarchy(a).forEach(u=>{o.indexOf(u)<0&&o.push(u)})};s(r),this.allOptions.preload&&this.allOptions.preload.forEach(a=>s(a)),o.forEach(a=>{this.allOptions.ns.forEach(u=>{e.read(a,u,"read",null,null,(c,f)=>{c&&n.warn(`loading namespace ${u} for language ${a} failed`,c),!c&&f&&n.log(`loaded namespace ${u} for language ${a}`,f),e.loaded(`${a}|${u}`,c,f)})})})}};hq.type="backend";Bn.use(hq).use(aq).use(kxe).init({fallbackLng:"en",supportedLngs:["en","nl","de","fr"],ns:["common","mail"],defaultNS:"common",backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:["navigator","htmlTag"],caches:[]},interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged loaded"}});const dUe=({authProvider:e,settingsSlots:t=[],rootElementId:n="root"})=>{Are(),Sxe(),e.configure(),Bye(e);const r=gxe();mre(r);const o=new pme({queryCache:new Y9({onError:Zye}),mutationCache:new Z9({onError:Yye}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}});yxe();const s=S4e(o,r);for(const c of t)if(Object.hasOwn(s.routesByPath,`/settings/${c.id}`))throw new Error(`Settings slot "${c.id}" collides with a built-in settings section`);r.recordPageView(window.location.pathname);const a=document.getElementById(n);if(!a)throw new Error(`Root element not found: #${n}`);const{Shell:u}=e;_ye.createRoot(a).render(O.jsx(_.StrictMode,{children:O.jsx(fB.Provider,{value:r,children:O.jsxs(gme,{client:o,children:[O.jsx(Vye,{value:e,children:O.jsx(Uke,{value:t,children:O.jsx(u,{children:O.jsx(bye,{router:s})})})}),!1]})})}))};dUe({authProvider:Vge});export{sc as $,Kv as A,Xr as B,pee as C,Ute as D,NF as E,Cee as F,Cz as G,gr as H,SF as I,J8e as J,Tke as K,wF as L,_ee as M,Ure as N,Az as O,GPe as P,WPe as Q,mB as R,Ree as S,Mee as T,cA as U,s8e as V,ob as W,N_ as X,NH as Y,U8e as Z,IIe as _,Xa as a,_Ie as a$,sAe as a0,nT as a1,ey as a2,fre as a3,hR as a4,pc as a5,wke as a6,Wye as a7,Fke as a8,t3e as a9,Z5e as aA,ok as aB,v3e as aC,n5e as aD,C8e as aE,y5e as aF,Zte as aG,n6e as aH,mUe as aI,t6e as aJ,V5e as aK,ZNe as aL,rre as aM,tre as aN,ere as aO,hn as aP,Yv as aQ,D6 as aR,q6e as aS,xIe as aT,H5e as aU,B5e as aV,q5e as aW,YF as aX,AH as aY,$5e as aZ,j5e as a_,i6e as aa,p3e as ab,aFe as ac,JA as ad,S8e as ae,SH as af,$ as ag,y8e as ah,b8e as ai,_Re as aj,ZPe as ak,YPe as al,t5e as am,J6e as an,bf as ao,jF as ap,yF as aq,wo as ar,mT as as,Kn as at,w8e as au,IUe as av,oh as aw,Bu as ax,rI as ay,K5e as az,yt as b,AUe as b$,pre as b0,RUe as b1,ef as b2,sl as b3,f8e as b4,fR as b5,h8e as b6,p8e as b7,g8e as b8,TUe as b9,H8e as bA,q8e as bB,fIe as bC,h5e as bD,$8e as bE,d_ as bF,oNe as bG,L8e as bH,eFe as bI,LIe as bJ,iFe as bK,Z6e as bL,X6e as bM,Q6e as bN,Y6e as bO,rFe as bP,nFe as bQ,Lke as bR,tFe as bS,oFe as bT,sFe as bU,S5e as bV,w5e as bW,Aee as bX,Y5e as bY,OIe as bZ,$Ue as b_,SUe as ba,nne as bb,_Ue as bc,CUe as bd,bUe as be,vne as bf,nI as bg,a5e as bh,l5e as bi,fNe as bj,hNe as bk,xNe as bl,_Ne as bm,one as bn,xUe as bo,bne as bp,uNe as bq,V6e as br,Jxe as bs,z8e as bt,B8e as bu,qAe as bv,j8e as bw,W6e as bx,F8e as by,V8e as bz,rT as c,Wo as c$,Ike as c0,Y8e as c1,Nee as c2,gte as c3,x5e as c4,YH as c5,O5 as c6,pFe as c7,lFe as c8,uFe as c9,Cte as cA,bte as cB,Ote as cC,Gf as cD,MIe as cE,bc as cF,yn as cG,Fm as cH,j9 as cI,ume as cJ,mme as cK,bme as cL,Eme as cM,Sme as cN,wme as cO,Vn as cP,xme as cQ,x4 as cR,Cme as cS,INe as cT,rNe as cU,b5e as cV,bB as cW,LAe as cX,E8e as cY,SB as cZ,x8e as c_,cFe as ca,hr as cb,Bve as cc,vT as cd,a6e as ce,Py as cf,Kke as cg,Z8e as ch,FJ as ci,DP as cj,fUe as ck,hUe as cl,gUe as cm,MH as cn,u8e as co,c8e as cp,l8e as cq,gF as cr,i8e as cs,Re as ct,v8e as cu,DIe as cv,d8e as cw,a8e as cx,WIe as cy,yte as cz,Zr as d,fFe as d$,G8e as d0,qH as d1,R8e as d2,MPe as d3,A8e as d4,I8e as d5,o6e as d6,r6e as d7,Ame as d8,LUe as d9,T8e as dA,N8e as dB,BIe as dC,O8e as dD,M8e as dE,P8e as dF,Q5e as dG,Qv as dH,PUe as dI,MUe as dJ,e8e as dK,m8e as dL,VPe as dM,r8e as dN,vIe as dO,ju as dP,OUe as dQ,X8e as dR,kUe as dS,NUe as dT,t8e as dU,K6e as dV,G6e as dW,UUe as dX,o8e as dY,k8e as dZ,D8e as d_,DUe as da,Eee as db,Ste as dc,Ene as dd,bee as de,Pne as df,HF as dg,BUe as dh,zUe as di,ZUe as dj,Gne as dk,QUe as dl,HUe as dm,YUe as dn,Wne as dp,kne as dq,Gr as dr,wUe as ds,e6e as dt,XUe as du,JUe as dv,KUe as dw,WUe as dx,WF as dy,X5e as dz,cl as e,HDe as e$,FUe as e0,mke as e1,_8e as e2,W8e as e3,BAe as e4,jAe as e5,G5e as e6,wB as e7,HPe as e8,qPe as e9,M5e as eA,P5e as eB,R5e as eC,mAe as eD,Xte as eE,vUe as eF,yUe as eG,p5e as eH,m5e as eI,g5e as eJ,EUe as eK,s5e as eL,dIe as eM,o5e as eN,i5e as eO,uIe as eP,Q8e as eQ,jIe as eR,bT as eS,k5e as eT,U5e as eU,D5e as eV,N5e as eW,L5e as eX,hFe as eY,DDe as eZ,$De as e_,hke as ea,K8e as eb,jUe as ec,VUe as ed,qUe as ee,GUe as ef,J5e as eg,Oee as eh,u5e as ei,c5e as ej,hIe as ek,f5e as el,d5e as em,Di as en,dFe as eo,M5 as ep,F5e as eq,E5e as er,A5e as es,_5e as et,z5e as eu,C5e as ev,I5e as ew,n8e as ex,T5e as ey,O5e as ez,sR as f,VDe as f0,GDe as f1,mee as f2,W5e as g,r5e as h,v5e as i,O as j,yB as k,H6e as l,e5e as m,qv as n,Vv as o,rn as p,Tee as q,_ as r,ty as s,gee as t,dh as u,bF as v,Iee as w,XA as x,hee as y,yee as z};
|