ryco-cli 0.1.12 → 0.1.14
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/dist/{AcpNativeLogging-Ba9Nn9Re.mjs → AcpNativeLogging-D3fe64a6.mjs} +1 -1
- package/dist/{AcpNativeLogging-Be1KGJfF.cjs → AcpNativeLogging-vLtnq5f1.cjs} +1 -1
- package/dist/{AzureDevOpsSourceControlProvider-CVj-F-pW.cjs → AzureDevOpsSourceControlProvider-BtezW57t.cjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-CGlK6M0b.mjs → AzureDevOpsSourceControlProvider-WNUDtsur.mjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-CEZEd4PX.cjs → BitbucketSourceControlProvider-BWzNM0jW.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-BV6iRDi7.mjs → BitbucketSourceControlProvider-tbbUFKz3.mjs} +2 -2
- package/dist/{ClaudeDriver-lBU7EyUX.cjs → ClaudeDriver-BTvdJvam.cjs} +170 -7
- package/dist/{ClaudeDriver-rooMNrJz.mjs → ClaudeDriver-CG5ngU5z.mjs} +171 -8
- package/dist/{CodexDriver-DBz2rPXb.mjs → CodexDriver-49o7TA-C.mjs} +4 -4
- package/dist/{CodexDriver-CZCIJSLV.cjs → CodexDriver-CFxwJNXx.cjs} +3 -3
- package/dist/{CodexTextGeneration-BeG7ymPC.mjs → CodexTextGeneration-C0t4xcPO.mjs} +2 -2
- package/dist/{CodexTextGeneration-BvIcyD1P.cjs → CodexTextGeneration-CedcXf9a.cjs} +1 -1
- package/dist/{CopilotDriver-CX5zhEdZ.cjs → CopilotDriver-B8J_ovCX.cjs} +20 -16
- package/dist/{CopilotDriver-D36vbGbn.mjs → CopilotDriver-Cu1B1skB.mjs} +21 -17
- package/dist/{CursorDriver-DWuuOSkJ.mjs → CursorDriver-P_A8uQki.mjs} +4 -4
- package/dist/{CursorDriver-CPBVeesr.cjs → CursorDriver-zlKHPy1_.cjs} +3 -3
- package/dist/{ForgejoSourceControlProvider-CeN7Snfr.mjs → ForgejoSourceControlProvider-DLhJZtq9.mjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-CzmmcAZO.cjs → ForgejoSourceControlProvider-szJ-dvsD.cjs} +2 -2
- package/dist/{GitHubSourceControlProvider-DfFR9O2o.cjs → GitHubSourceControlProvider-3ofb6HsF.cjs} +2 -2
- package/dist/{GitHubSourceControlProvider-Dmz1LJct.mjs → GitHubSourceControlProvider-D5MQQPCJ.mjs} +2 -2
- package/dist/{GitLabSourceControlProvider-C21lwphV.mjs → GitLabSourceControlProvider-DLkxeob5.mjs} +2 -2
- package/dist/{GitLabSourceControlProvider-DGoelNmL.cjs → GitLabSourceControlProvider-DkupZH5G.cjs} +2 -2
- package/dist/{GrokDriver-CIXj_4ry.cjs → GrokDriver-CTUNclwp.cjs} +3 -3
- package/dist/{GrokDriver-qKX1a63G.mjs → GrokDriver-D8KoMY76.mjs} +4 -4
- package/dist/{OpenCodeDriver-CbdswhqU.mjs → OpenCodeDriver-B7htxutj.mjs} +92 -27
- package/dist/{OpenCodeDriver-DDEuwtXl.cjs → OpenCodeDriver-pXM8bSct.cjs} +91 -26
- package/dist/{SourceControlProviderDiscoveryCatalog-DJWDCoup.cjs → SourceControlProviderDiscoveryCatalog-Bj_sZfmB.cjs} +1 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-4_4yahsa.mjs → SourceControlProviderDiscoveryCatalog-C6Fn7rZE.mjs} +1 -1
- package/dist/bin.cjs +1113 -312
- package/dist/bin.mjs +1115 -315
- package/dist/client/assets/{AccountSettings-C3v2klAG.js → AccountSettings-CinnQaX-.js} +1 -1
- package/dist/client/assets/{AiFocusSettings-BquKjnWf.js → AiFocusSettings-UbXOywZg.js} +1 -1
- package/dist/client/assets/{AnimatedHeight-BIsV_Z3J.js → AnimatedHeight-DCad8EQ2.js} +1 -1
- package/dist/client/assets/AppearanceSettings-CTh8Z8nz.js +1 -0
- package/dist/client/assets/{BranchToolbar.logic-CmvD76Cw.js → BranchToolbar.logic-37EnknDD.js} +1 -1
- package/dist/client/assets/ChatRightPanel-DUwLYKbp.js +27 -0
- package/dist/client/assets/{ChatThreadRouteView-DlgAAOCp.js → ChatThreadRouteView-C43W0PEz.js} +1 -1
- package/dist/client/assets/CommandPaletteDialog-IHOe0hOG.js +1 -0
- package/dist/client/assets/{CompositeItem-F3NGn6aG.js → CompositeItem-ClLCuzeJ.js} +1 -1
- package/dist/client/assets/{CompositeRoot-CmJGfRtc.js → CompositeRoot-Bdsr9eHn.js} +1 -1
- package/dist/client/assets/{ConnectionsSettings-Ccn8q4fG.js → ConnectionsSettings-tmBjGOPj.js} +2 -2
- package/dist/client/assets/{DiagnosticsSettings-QXpjXOrH.js → DiagnosticsSettings-CbCEgaau.js} +1 -1
- package/dist/client/assets/{DialogHandle-C4uSr9wX.js → DialogHandle-CitVLvYq.js} +1 -1
- package/dist/client/assets/{DialogPopup-Dck8r8Hn.js → DialogPopup-CfaEr9jv.js} +1 -1
- package/dist/client/assets/DialogRoot-CyEOjgGH.js +1 -0
- package/dist/client/assets/{DialogTitle-CCedPAjV.js → DialogTitle-BUkU0qXf.js} +1 -1
- package/dist/client/assets/{DialogTrigger-CYJ7_YcV.js → DialogTrigger-CEjWue7M.js} +1 -1
- package/dist/client/assets/{DialogViewport-D-CrTM-P.js → DialogViewport-Cyc_ye5w.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-DFMY6O91.js → DraftChatThreadRouteView-BSA67nKa.js} +1 -1
- package/dist/client/assets/{ExternalIdentityWeb.logic-D64j70NH.js → ExternalIdentityWeb.logic-BqdBjAua.js} +1 -1
- package/dist/client/assets/GlassSurface-B3cq28tB.js +1 -0
- package/dist/client/assets/{HostedConnectionControls-BC4kVWTa.js → HostedConnectionControls-S2Wr9fiZ.js} +1 -1
- package/dist/client/assets/HostedHubRoot-DK9zP4tJ.js +1 -0
- package/dist/client/assets/{HostedNativeAuthorizationRoute-Df0oSrLR.js → HostedNativeAuthorizationRoute-CKnLbCOH.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-ffS_O2AX.js → HostedRelayTrustNotice-CbF_SOpf.js} +1 -1
- package/dist/client/assets/{Icons-CT3nd2MA.js → Icons-DZpTOLIb.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-BHyy-VM0.js → IntegrationsSettingsPanel-BdBEGIyL.js} +1 -1
- package/dist/client/assets/KeybindingsSettings-Bye1H9Sx.js +7 -0
- package/dist/client/assets/{McpServersSettings-UthT1T80.js → McpServersSettings-D0U0g2q7.js} +1 -1
- package/dist/client/assets/{MobileSheet-CkeG6_SP.js → MobileSheet-BPvuTPR6.js} +1 -1
- package/dist/client/assets/{NewWorktreeDialog-DTZnArOC.js → NewWorktreeDialog-C_xJCZWF.js} +1 -1
- package/dist/client/assets/{NoActiveThreadState-jcEAWu7N.js → NoActiveThreadState-Cfn_Wwnf.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-DPqjRphc.js → NodeSecuritySettings-DUQNZJqJ.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-BSy3F4v6.js → OpinionatedPluginsSettings-D44efcv7.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-B2mrJtgM.js → PhoneGetAppInterstitial-CzduFI4-.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-B8vfJdZd.js → PhoneGetAppInterstitialBackdrop-CJ44QRCp.js} +1 -1
- package/dist/client/assets/PhoneHome-BLEJm5TG.js +1 -0
- package/dist/client/assets/PhoneSettingsSurface-CqetLTIm.js +1 -0
- package/dist/client/assets/{ProjectFavicon-BhQnkxbx.js → ProjectFavicon-DrBXI2cH.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-COg6CGM4.js → ProviderModelPicker-CyID3P1C.js} +1 -1
- package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-BkoRegCn.js → ProviderUpdateLaunchNotification.logic-C6VoLD-w.js} +1 -1
- package/dist/client/assets/ProvidersSettingsPanel-BHmpXUIM.js +1 -0
- package/dist/client/assets/{RedactedSensitiveText-CxtaUiKH.js → RedactedSensitiveText-CZwFEoNn.js} +1 -1
- package/dist/client/assets/RootAppShell-BVXRShhe.js +6 -0
- package/dist/client/assets/{RycoLetterMark-Bk0kvGJ_.js → RycoLetterMark-C-fvI9UB.js} +1 -1
- package/dist/client/assets/SettingsDialog-CnETTu23.js +1 -0
- package/dist/client/assets/{SettingsPanels-D8Xy3pPC.js → SettingsPanels-C3HDrmQq.js} +3 -3
- package/dist/client/assets/{SettingsPanels.editor-B2x4U4rW.js → SettingsPanels.editor-DI8Z5rsl.js} +1 -1
- package/dist/client/assets/SourceControlSettings-BG4tsvql.js +1 -0
- package/dist/client/assets/{StatisticsPage-C38pI2_b.js → StatisticsPage-dy_aYqvS.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-6sINT28-.js → StatisticsPanel-CeRJBu65.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-Cx43bOeo.js → StatisticsSettingsLink-ChlwCDG0.js} +1 -1
- package/dist/client/assets/ThreadStatusIndicators-D-ioX09X.js +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-C4NJu8Qs.js → ThreadTerminalDrawer-BvGaRxBP.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-D9qlHXCA.js → ThreadWorkspacePanel-BAWm7mGl.js} +2 -2
- package/dist/client/assets/{ToolbarRootContext-BgqqXVly.js → ToolbarRootContext-k-_m5nCN.js} +1 -1
- package/dist/client/assets/{WorkItemsTab-BDAeQe4D.js → WorkItemsTab-Q2V2EuvK.js} +12 -12
- package/dist/client/assets/{alert-LqMhbdE9.js → alert-BymbRVPf.js} +1 -1
- package/dist/client/assets/{alert-dialog-DxoA6ky8.js → alert-dialog-Gym8_p4Q.js} +1 -1
- package/dist/client/assets/appearancePreferences-BhNRCg6W.js +1 -0
- package/dist/client/assets/authorization-BwQZHweJ.js +1 -0
- package/dist/client/assets/{badge-CXw6fWrB.js → badge-BQI7J3Sg.js} +1 -1
- package/dist/client/assets/{branding-DeKsIp6g.js → branding-DqHDcyzW.js} +1 -1
- package/dist/client/assets/{button-BAbJxRzt.js → button-Wf_1nfeu.js} +1 -1
- package/dist/client/assets/{capabilities-BkVqeGLQ.js → capabilities-BrllgEYz.js} +1 -1
- package/dist/client/assets/{chatThreadActions-DQ8aOQ1g.js → chatThreadActions-BGkJmj6T.js} +1 -1
- package/dist/client/assets/{collapsible-dxy6kc2k.js → collapsible-GOpRckDq.js} +1 -1
- package/dist/client/assets/{command-CGNKG_Oe.js → command-Dx5YM54H.js} +1 -1
- package/dist/client/assets/composerDraftStore-DC2r8dcu.js +11 -0
- package/dist/client/assets/{data-list-CYKBxN62.js → data-list-BSiCZBKn.js} +1 -1
- package/dist/client/assets/{desktopUpdateAtoms-B9iJXSdW.js → desktopUpdateAtoms-DkmoIGr0.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-B-cSBe8H.js → desktopWorkspace-Ddm531g5.js} +1 -1
- package/dist/client/assets/{device-DfIh5pQV.js → device-B0aqBYM1.js} +1 -1
- package/dist/client/assets/{dialog-DQsYchqu.js → dialog-CUxw5AxI.js} +1 -1
- package/dist/client/assets/{draft-input-CkzOk8BY.js → draft-input-CpfrGQ1h.js} +1 -1
- package/dist/client/assets/editorPreferences-SOMXdQpi.js +1 -0
- package/dist/client/assets/{empty-DwzqNgCP.js → empty-D420OZA9.js} +1 -1
- package/dist/client/assets/{env-B4arEvJg.js → env-Bf33qXdb.js} +1 -1
- package/dist/client/assets/{getPseudoElementBounds-X62ElHN8.js → getPseudoElementBounds-nDGTWECG.js} +1 -1
- package/dist/client/assets/{group-D9ER9giz.js → group-Cq4Llttm.js} +1 -1
- package/dist/client/assets/{index-Bntnmu6O.js → index-BL8_ra0g.js} +2 -2
- package/dist/client/assets/{input-CHEwW3oH.js → input-Dl4N9ZfE.js} +1 -1
- package/dist/client/assets/{kbd-DCGQZk18.js → kbd-CqoZVQfv.js} +1 -1
- package/dist/client/assets/{keybindings-CWJ7E9ZI.js → keybindings-DQzcPjMv.js} +1 -1
- package/dist/client/assets/{label-CVFHsLFO.js → label-x5DgpBI_.js} +1 -1
- package/dist/client/assets/{lib-qiiNMGgU.js → lib-BXIqHSZx.js} +1 -1
- package/dist/client/assets/{liquidGlass-CPsvmaF0.js → liquidGlass-yFkZrRk5.js} +1 -1
- package/dist/client/assets/{logging-M8H3z7rQ.js → logging-CZlHfeu2.js} +1 -1
- package/dist/client/assets/main-B7T7on1T.css +2 -0
- package/dist/client/assets/main-J4YlUJad.js +9 -0
- package/dist/client/assets/{menu-Dvxh8sD5.js → menu-BuDpxm_Q.js} +1 -1
- package/dist/client/assets/{popover-CuH9Yrj3.js → popover-DuprDUaB.js} +1 -1
- package/dist/client/assets/primary-CJx2nSkc.js +2 -0
- package/dist/client/assets/projectPaths-DrelgodZ.js +1 -0
- package/dist/client/assets/{providerDriverMeta-I0TSo-QI.js → providerDriverMeta-D27Koh7Q.js} +1 -1
- package/dist/client/assets/{providerIconUtils-CzSa_16f.js → providerIconUtils-CtOHwjWL.js} +1 -1
- package/dist/client/assets/providerInstances-BPwEwwpF.js +1 -0
- package/dist/client/assets/providerModels-BPwEwwpF.js +1 -0
- package/dist/client/assets/{qr-code-Bddq6K7S.js → qr-code-BVfzPOP3.js} +1 -1
- package/dist/client/assets/{radio-group-CBZFr4C8.js → radio-group-rgmJqPI7.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-CD_ugzhJ.js → resolveAriaLabelledBy-l4SuqStl.js} +1 -1
- package/dist/client/assets/{rightPanelRouteSearch-DB5gQGHK.js → rightPanelRouteSearch-DmpObL1z.js} +1 -1
- package/dist/client/assets/runtime-DYzjhL5M.js +1 -0
- package/dist/client/assets/{scroll-area-Drsa8bNB.js → scroll-area-DMs8l4bb.js} +1 -1
- package/dist/client/assets/{scrollEdges-B-cqxY4l.js → scrollEdges-DWTOweRb.js} +1 -1
- package/dist/client/assets/{select-BYbVr-yg.js → select-Djwp8HDm.js} +1 -1
- package/dist/client/assets/{separator-CdS5bi4Z.js → separator-rjtf5Q3V.js} +1 -1
- package/dist/client/assets/{session-logic-wxhvMgEN.js → session-logic-DLEAZb3K.js} +2 -2
- package/dist/client/assets/{settingsDialogStore-ygYoScKe.js → settingsDialogStore-Dbykwvfs.js} +1 -1
- package/dist/client/assets/{settingsLayout-D8glO7f1.js → settingsLayout-C7bl9Xi4.js} +1 -1
- package/dist/client/assets/{sheet-BO78gIKZ.js → sheet-CQIQYfOM.js} +1 -1
- package/dist/client/assets/{sidebar-Dm6l2GA6.js → sidebar-BdDOvXe8.js} +1 -1
- package/dist/client/assets/sidebarProjectFolders-D_Me0oJ8.js +4 -0
- package/dist/client/assets/{sidebarStatusText-D0HT0fek.js → sidebarStatusText-BF6odB03.js} +1 -1
- package/dist/client/assets/{skeleton-CvQSeJbw.js → skeleton-Mgh4Gx9x.js} +1 -1
- package/dist/client/assets/{spinner-ClF0jOcX.js → spinner-CzzUdFeE.js} +1 -1
- package/dist/client/assets/{src-Vf4LVnMX.js → src-Ca7Gag3m.js} +1 -1
- package/dist/client/assets/storeSelectors-D7HbqO4E.js +1 -0
- package/dist/client/assets/{switch-BTGo9Yip.js → switch-CntUxI1A.js} +1 -1
- package/dist/client/assets/{terminal-links-CZ3c9AbA.js → terminal-links-CUFISn8U.js} +1 -1
- package/dist/client/assets/{textarea-RFPODxWW.js → textarea-C8QxddDb.js} +1 -1
- package/dist/client/assets/threadPinning-BIV4KXZU.js +1 -0
- package/dist/client/assets/{threadPriorityRefreshRuntime-tRDgvBzr.js → threadPriorityRefreshRuntime-B-pVYK_y.js} +1 -1
- package/dist/client/assets/{toast-CcSCAm4B.js → toast-Cw7bXJzg.js} +1 -1
- package/dist/client/assets/{toggle-I6h33Cu5.js → toggle-Bi9uP4Hb.js} +1 -1
- package/dist/client/assets/{toggle-group-mLIkiJtU.js → toggle-group-LcgyMgj5.js} +1 -1
- package/dist/client/assets/{tooltip-C8sAONBj.js → tooltip-t3Nrleyq.js} +1 -1
- package/dist/client/assets/types-D7HbqO4E.js +1 -0
- package/dist/client/assets/{uiStateStore-B6pjzSjj.js → uiStateStore-BW2WnK4k.js} +1 -1
- package/dist/client/assets/useAtlassian-a-MaAd0k.js +0 -0
- package/dist/client/assets/{useButton-D__1LqCF.js → useButton-DUuWgIMw.js} +1 -1
- package/dist/client/assets/{useCompositeListItem-Cmr_nuuG.js → useCompositeListItem-CL5mJqCb.js} +1 -1
- package/dist/client/assets/{useDebouncedValue-DHjoudTq.js → useDebouncedValue-jDDWNjgt.js} +1 -1
- package/dist/client/assets/{useFloatingRootContext-D5EZmrCa.js → useFloatingRootContext-C4I8IxtL.js} +1 -1
- package/dist/client/assets/{useHandleNewThread-Bvz-DKgn.js → useHandleNewThread-820pBJCC.js} +1 -1
- package/dist/client/assets/{useLabelableId-DnQJ7amm.js → useLabelableId-KX33mhBC.js} +1 -1
- package/dist/client/assets/{useLocation-CDeYzWW6.js → useLocation-B4QlXdMt.js} +1 -1
- package/dist/client/assets/{useOpenInteractionType-CjtpACKR.js → useOpenInteractionType-DjM9MBY7.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions-CAgIq9aZ.js → usePhoneThreadActions-DxxWMYgC.js} +1 -1
- package/dist/client/assets/{usePopupViewport-BuhsNdVy.js → usePopupViewport-CAMlnyaP.js} +1 -1
- package/dist/client/assets/{useScrollLock-D3tMGsRk.js → useScrollLock-CAPfesBT.js} +1 -1
- package/dist/client/assets/{useStatistics-CiLROMJP.js → useStatistics-CWasDzsV.js} +2 -2
- package/dist/client/assets/{useSwipeDismiss-CbgDJvw1.js → useSwipeDismiss-BZsYSBgq.js} +1 -1
- package/dist/client/assets/{useTheme-DiC-5xCb.js → useTheme-By1kfyiU.js} +1 -1
- package/dist/client/assets/{useThreadActions-Vew3ScxG.js → useThreadActions-MOjDrEnS.js} +1 -1
- package/dist/client/assets/{useTriggerFocusGuards-CrugmkhX.js → useTriggerFocusGuards-D5z439rn.js} +1 -1
- package/dist/client/assets/{useValueChanged-MQtIzPIU.js → useValueChanged-D0CHQQwP.js} +1 -1
- package/dist/client/assets/{utils-BofFIn5Y.js → utils-B76_2Yk7.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-Bb52hlpd.cjs → collectUint8StreamText-B9B7bGv9.cjs} +46 -10
- package/dist/{collectUint8StreamText-EDg4F0TU.mjs → collectUint8StreamText-RzKEq2NY.mjs} +35 -11
- package/dist/{makeManagedServerProvider-itynW7xv.cjs → makeManagedServerProvider-BF1eBatf.cjs} +1 -1
- package/dist/{makeManagedServerProvider-Cf8bNWwc.mjs → makeManagedServerProvider-BuG2fLP8.mjs} +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AppearanceSettings-CYbSApl4.js +0 -1
- package/dist/client/assets/ChatRightPanel-DVxRdZWT.js +0 -27
- package/dist/client/assets/CommandPaletteDialog-BnJURcy7.js +0 -1
- package/dist/client/assets/DialogRoot-BpIvUdm7.js +0 -1
- package/dist/client/assets/GlassSurface-C3IIWMu9.js +0 -1
- package/dist/client/assets/HostedHubRoot-pBGVub10.js +0 -1
- package/dist/client/assets/KeybindingsSettings-BfkONqmZ.js +0 -7
- package/dist/client/assets/PhoneHome-C-ttaKuE.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-CJddundi.js +0 -1
- package/dist/client/assets/ProvidersSettingsPanel-C3aPyCrN.js +0 -1
- package/dist/client/assets/RootAppShell-3T2sBtpP.js +0 -6
- package/dist/client/assets/SettingsDialog-krsStFrf.js +0 -1
- package/dist/client/assets/SourceControlSettings-KIx9EfEZ.js +0 -1
- package/dist/client/assets/ThreadStatusIndicators-CL0KGLlj.js +0 -0
- package/dist/client/assets/appearancePreferences-COvj0WMT.js +0 -1
- package/dist/client/assets/authorization-mIJKV2yp.js +0 -1
- package/dist/client/assets/composerDraftStore-CdJJZe42.js +0 -11
- package/dist/client/assets/editorPreferences-0DWMgcci.js +0 -1
- package/dist/client/assets/main-BjVnVob0.js +0 -9
- package/dist/client/assets/main-DaYHZt-J.css +0 -2
- package/dist/client/assets/panel-right-BodNpkM9.js +0 -1
- package/dist/client/assets/primary-OskAInOO.js +0 -2
- package/dist/client/assets/projectPaths-SSsIvt0g.js +0 -1
- package/dist/client/assets/providerInstances-BJcfB_9E.js +0 -1
- package/dist/client/assets/providerModels-BJcfB_9E.js +0 -1
- package/dist/client/assets/runtime-DfGHeCnR.js +0 -1
- package/dist/client/assets/sidebarProjectFolders-CGVDJ0ZT.js +0 -4
- package/dist/client/assets/storeSelectors-Bpr2pdhU.js +0 -1
- package/dist/client/assets/types-Bpr2pdhU.js +0 -1
- package/dist/client/assets/useAppearancePreference-BlLlxQl7.js +0 -1
- package/dist/client/assets/useAtlassian-DC0XOw4u.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./react-SIfiwpqq.js";import{It as r}from"./composerDraftStore-CdJJZe42.js";import{a as i,c as a,d as o,o as s,s as c,t as l,u}from"./useRenderElement-DchFnsR8.js";import{t as d}from"./react-dom-x9LNwWQc.js";var f=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),p=t(((e,t)=>{t.exports=f()})),m=t((e=>{var t=n(),r=p();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),h=t(((e,t)=>{t.exports=m()})),g=e(n(),1),_=r(),v=p(),y=h(),b=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),x={"data-starting-style":``},S={"data-ending-style":``},C={transitionStatus(e){return e===`starting`?x:e===`ending`?S:null}},w=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=b.startingStyle]=`startingStyle`,e[e.endingStyle=b.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),T={"data-popup-open":``},E={"data-popup-open":``,"data-pressed":``},D={"data-open":``},O={"data-closed":``},k={"data-anchor-hidden":``},A={open(e){return e?T:null}},j={open(e){return e?E:null}},M={open(e){return e?D:O},anchorHidden(e){return e?k:null}},N={...M,...C};function P(){return typeof window<`u`}function F(e){return R(e)?(e.nodeName||``).toLowerCase():`#document`}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function L(e){return((R(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function R(e){return P()?e instanceof Node||e instanceof I(e).Node:!1}function z(e){return P()?e instanceof Element||e instanceof I(e).Element:!1}function B(e){return P()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function ee(e){return!P()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function te(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ne(e){return/^(table|td|th)$/.test(F(e))}function re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ie=/transform|translate|scale|rotate|perspective|filter/,V=/paint|layout|strict|content/,ae=e=>!!e&&e!==`none`,oe;function se(e){let t=z(e)?H(e):e;return ae(t.transform)||ae(t.translate)||ae(t.scale)||ae(t.rotate)||ae(t.perspective)||!le()&&(ae(t.backdropFilter)||ae(t.filter))||ie.test(t.willChange||``)||V.test(t.contain||``)}function ce(e){let t=fe(e);for(;B(t)&&!ue(t);){if(se(t))return t;if(re(t))return null;t=fe(t)}return null}function le(){return oe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),oe}function ue(e){return/^(html|body|#document)$/.test(F(e))}function H(e){return I(e).getComputedStyle(e)}function de(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fe(e){if(F(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ee(e)&&e.host||L(e);return ee(t)?t.host:t}function pe(e){let t=fe(e);return ue(t)?(e.ownerDocument||e).body:B(t)&&te(t)?t:pe(t)}function U(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=pe(e),i=r===e.ownerDocument?.body,a=I(r);if(i){let e=me(a);return t.concat(a,a.visualViewport||[],te(r)?r:[],e&&n?U(e):[])}return t.concat(r,U(r,[],n))}function me(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var he={...g},ge=he.useInsertionEffect,_e=ge&&ge!==he.useLayoutEffect?ge:e=>e();function W(e){let t=u(ve).current;return t.next=e,_e(t.effect),t.trampoline}function ve(){let e={next:void 0,callback:ye,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ye(){}var G=typeof document<`u`?g.useLayoutEffect:()=>{};function K(e){return e?.ownerDocument||document}var be=`none`,xe=`trigger-press`,q=`trigger-hover`,Se=`trigger-focus`,Ce=`outside-press`,we=`item-press`,Te=`close-press`,Ee=`clear-press`,De=`input-change`,Oe=`input-clear`,ke=`input-press`,Ae=`focus-out`,je=`escape-key`,Me=`close-watcher`,Ne=`list-navigation`,Pe=`keyboard`,Fe=`pointer`,Ie=`cancel-open`,Le=`sibling-open`,Re=`disabled`,ze=`imperative-action`,Be=`swipe`,Ve=`window-resize`;function J(e,t,n,r){let i=!1,a=!1,o=r??s;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function He(e,t,n){let r=n??s;return{reason:e,event:t??new Event(`base-ui`),...r}}var Ue=0;function We(e,t=`mui`){let[n,r]=g.useState(e),i=e||n;return g.useEffect(()=>{n??(Ue+=1,r(`${t}-${Ue}`))},[n,t]),i}var Ge=he.useId;function Ke(e,t){if(Ge!==void 0){let n=Ge();return e??(t?`${t}-${n}`:n)}return We(e,t)}function qe(e){return Ke(e,`base-ui`)}function Je(e){g.useEffect(e,i)}var Ye=0,Xe=class e{static create(){return new e}currentId=Ye;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ye,t()},e)}isStarted(){return this.currentId!==Ye}clear=()=>{this.currentId!==Ye&&(clearTimeout(this.currentId),this.currentId=Ye)};disposeEffect=()=>this.clear};function Ze(){let e=u(Xe.create).current;return Je(e.disposeEffect),e}function Qe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:$e,platform:et,maxTouchPoints:tt}=Qe(),nt=$e.toLowerCase(),rt=et.toLowerCase(),it=/^i(os$|p)/.test(rt)||rt===`macintel`&&tt>1,at=`android`,ot=rt===at||nt.includes(at),st=!it&&rt.startsWith(`mac`);rt.startsWith(`win`),!ot&&/^(linux|chrome os)/.test(rt);var ct=st||it,lt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),ut=!lt&&nt.includes(`firefox`);!lt&&nt.includes(`chrom`);var dt=ct,ft=/jsdom|happydom/.test(nt);function pt(e){e.preventDefault(),e.stopPropagation()}function mt(e){return`nativeEvent`in e}function ht(e){return e.pointerType===``&&e.isTrusted?!0:ot&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function gt(e){return ft?!1:!ot&&e.width===0&&e.height===0||ot&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function _t(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function vt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var yt=`data-base-ui-focusable`,bt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,xt=`ArrowLeft`,St=`ArrowRight`,Ct=`ArrowUp`,wt=`ArrowDown`;function Tt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Et(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Dt(e,t){if(!z(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ot(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function kt(e){return e.matches(`html,body`)}function At(e){return B(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function jt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${bt}`)!=null}function Mt(e){return e?e.getAttribute(`role`)===`combobox`&&At(e):!1}function Nt(e){if(!e||ft)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Pt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ft(e,t){return t!=null&&!_t(t)?0:typeof e==`function`?e():e}function It(e,t,n){let r=Ft(e,n);return typeof r==`number`?r:r?.[t]}function Lt(e){return typeof e==`function`?e():e}function Rt(e,t){return t||e===`click`||e===`mousedown`}function zt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function X(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Bt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Vt(e){let t=u(Ht,e).current;return t.next=e,G(t.effect),t}function Ht(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ut=null;globalThis.requestAnimationFrame;var Wt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Gt=class e{static create(){return new e}static request(e){return Wt.request(e)}static cancel(e){return Wt.cancel(e)}currentId=Ut;request(e){this.cancel(),this.currentId=Wt.request(()=>{this.currentId=Ut,e()})}cancel=()=>{this.currentId!==Ut&&(Wt.cancel(this.currentId),this.currentId=Ut)};disposeEffect=()=>this.cancel};function Kt(){let e=u(Gt.create).current;return Je(e.disposeEffect),e}var qt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Jt={...qt,position:`fixed`,top:0,left:0},Yt={...qt,position:`absolute`},Xt=g.forwardRef(function(e,t){let[n,r]=g.useState();G(()=>{dt&<&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,_.jsx)(`span`,{...e,ref:t,style:Jt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Zt=Math.min,Qt=Math.max,$t=Math.round,en=Math.floor,tn=e=>({x:e,y:e}),nn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function rn(e,t,n){return Qt(e,Zt(t,n))}function an(e,t){return typeof e==`function`?e(t):e}function Z(e){return e.split(`-`)[0]}function on(e){return e.split(`-`)[1]}function sn(e){return e===`x`?`y`:`x`}function cn(e){return e===`y`?`height`:`width`}function Q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ln(e){return sn(Q(e))}function un(e,t,n){n===void 0&&(n=!1);let r=on(e),i=ln(e),a=cn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yn(o)),[o,yn(o)]}function dn(e){let t=yn(e);return[fn(e),t,fn(t)]}function fn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pn=[`left`,`right`],mn=[`right`,`left`],hn=[`top`,`bottom`],gn=[`bottom`,`top`];function _n(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mn:pn:t?pn:mn;case`left`:case`right`:return t?hn:gn;default:return[]}}function vn(e,t,n,r){let i=on(e),a=_n(Z(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fn)))),a}function yn(e){let t=Z(e);return nn[t]+e.slice(t.length)}function bn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bn(e)}function Sn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Cn(e,t,n){return Math.floor(e/t)!==n}function wn(e,t){return t<0||t>=e.length}function Tn(e,t){return Dn(e.current,{disabledIndices:t})}function En(e,t){return Dn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&kn(e,a,r));return a}function On(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!kn(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=en(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!kn(e,r,s))return r}};d&&pt(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Dn(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Dn(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}wn(e,f)&&(f=u)}if(n===`both`){let n=en(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&pt(t),u%o===o-1?r&&(f=Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dn(e,{startingIndex:u,disabledIndices:s}),r&&Cn(f,o,n)&&(f=Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Cn(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&pt(t),u%o===0?r&&(f=Dn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dn(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Cn(f,o,n)&&(f=Dn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Cn(f,o,n)&&(f=u));let c=en(l/o)===n;wn(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function kn(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!jn(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function An(e){return e.visibility===`hidden`||e.visibility===`collapse`}function jn(e,t=e?H(e):null){return!e||!e.isConnected||!t||An(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Mn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Nn(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ee(n)?n.host:null}function Pn(e){for(let t of Array.from(e.children))if(F(t)===`summary`)return t;return null}function Fn(e,t){let n=Pn(t);return!!n&&(e===n||Y(n,e))}function In(e){let t=e?F(e):``;return e!=null&&e.matches(Mn)&&(t!==`summary`||e.parentElement!=null&&F(e.parentElement)===`details`&&Pn(e.parentElement)===e)&&(t!==`details`||Pn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Ln(e){if(!In(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Nn(t)){let n=t!==e,r=F(t)===`slot`;if(t.hasAttribute(`inert`)||n&&F(t)===`details`&&!t.open&&!Fn(e,t)||t.hasAttribute(`hidden`)||!r&&!Rn(t,n))return!1}return!0}function Rn(e,t){let n=H(e);return t?n.display!==`none`:jn(e,n)}function zn(e){let t=e.tabIndex;if(t<0){let t=F(e);if(t===`details`||t===`audio`||t===`video`||B(e)&&e.isContentEditable)return 0}return t}function Bn(e){if(F(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Vn(e,t){let n=Bn(e);if(!n)return!0;let r=t.find(e=>{let t=Bn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Bn(e);return t?.name===n.name&&t.form===n.form})===n}function Hn(e){if(B(e)&&F(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return B(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Un(e,t){Hn(e).forEach(e=>{In(e)&&t.push(e),Un(e,t)})}function Wn(e,t,n){Hn(e).forEach(e=>{B(e)&&e.matches(t)&&n.push(e),Wn(e,t,n)})}function Gn(e){return Ln(e)&&zn(e)>=0}function Kn(e){let t=[];return Un(e,t),t.filter(Ln)}function qn(e){let t=Kn(e);return t.filter(e=>zn(e)>=0&&Vn(e,t))}function Jn(e,t){let n=qn(e),r=n.length;if(r===0)return;let i=Tt(K(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Yn(e){return Jn(K(e).body,1)||e}function Xn(e){return Jn(K(e).body,-1)||e}function Zn(e,t){if(!e)return null;let n=qn(K(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Qn(e){return Zn(e,1)}function $n(e){return Zn(e,-1)}function er(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function tr(e){qn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function nr(e){let t=[];Wn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function rr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...rr(e,t.id,n)])}function ir(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ar(e){return`data-base-ui-${e}`}var or=e(d(),1),sr={style:{transition:`none`}},cr=`data-base-ui-click-trigger`,lr=`data-base-ui-swipe-ignore`,ur=`data-swipe-ignore`,dr=`[${lr}]`,fr=`[${ur}]`,pr={fallbackAxisSide:`none`},mr={fallbackAxisSide:`end`},hr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},gr=g.createContext(null),_r=()=>g.useContext(gr),vr=ar(`portal`);function yr(e={}){let{ref:t,container:n,componentProps:r=s,elementProps:i}=e,a=Ke(),o=_r()?.portalNode,[c,u]=g.useState(null),[d,f]=g.useState(null),p=W(e=>{e!==null&&f(e)}),m=g.useRef(null);G(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(R(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,o]);let h=l(`div`,r,{ref:[t,p],props:[{id:a,[vr]:``},i]}),_=c&&h?or.createPortal(h,c):null;return{node:d,nodeId:g.isValidElement(h)?h.props.id:void 0,subtree:_}}var br=g.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=yr({container:o,ref:t,componentProps:e,elementProps:s}),d=g.useRef(null),f=g.useRef(null),p=g.useRef(null),m=g.useRef(null),[h,v]=g.useState(null),y=g.useRef(!1),b=h?.modal,x=h?.open,S=!!h&&!h.modal&&h.open&&!!c;g.useEffect(()=>{if(!c||b)return;function e(e){c&&e.relatedTarget&&er(e)&&(e.type===`focusin`?y.current&&=(nr(c),!1):(tr(c),y.current=!0))}return Bt(X(c,`focusin`,e,!0),X(c,`focusout`,e,!0))},[c,b]),G(()=>{!c||x!==!0||!y.current||(nr(c),y.current=!1)},[x,c]);let C=g.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:v}),[c]);return(0,_.jsxs)(g.Fragment,{children:[u,(0,_.jsxs)(gr.Provider,{value:C,children:[S&&c&&(0,_.jsx)(Xt,{"data-type":`outside`,ref:d,onFocus:e=>{er(e,c)?p.current?.focus():Xn(h?h.domReference:null)?.focus()}}),S&&c&&(0,_.jsx)(`span`,{"aria-owns":l,style:hr}),c&&or.createPortal(a,c),S&&c&&(0,_.jsx)(Xt,{"data-type":`outside`,ref:f,onFocus:e=>{er(e,c)?m.current?.focus():(Yn(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});function xr(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Sr=class{nodesRef={current:[]};events=xr();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Cr=g.createContext(null),wr=g.createContext(null),Tr=()=>g.useContext(Cr)?.id||null,Er=e=>{let t=g.useContext(wr);return e??t};function Dr(e){let t=Ke(),n=Er(e),r=Tr();return G(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Or(e){let{children:t,id:n}=e,r=Tr();return(0,_.jsx)(Cr.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kr(e){let{children:t,externalTree:n}=e,r=u(()=>n??new Sr).current;return(0,_.jsx)(wr.Provider,{value:r,children:t})}function Ar(e){return e==null?e:`current`in e?e.current:e}function jr(){return!1}function Mr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Nr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=jr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=Er(c),m=W(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,_=h!==!1,v=W(()=>a),{escapeKey:y,outsidePress:b}=Mr(s),x=g.useRef(!1),S=g.useRef(!1),C=g.useRef(!1),w=g.useRef(!1),T=g.useRef(``),E=g.useRef(null),D=Ze(),O=Ze(),k=W(()=>{O.clear(),f.current.insideReactTree=!1}),A=W(e=>{let t=f.current.floatingContext?.nodeId;return(p?rr(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=W(e=>Ot(e,l.select(`floatingElement`))||Ot(e,l.select(`domReferenceElement`))),M=W(e=>{o()&&l.setOpen(!1,J(xe,e.nativeEvent))}),N=W(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=J(je,mt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=W(()=>{f.current.insideReactTree=!0,O.start(0,k)}),F=W(e=>{if(!u||!n||e.button!==0)return;let t=Et(e.nativeEvent);Y(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=W(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});g.useEffect(()=>{if(!u||!n)return k;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new Xe,t=new Xe;function i(){e.clear(),w.current=!0}function a(){e.start(lt?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function g(e){let t=f.current.floatingContext?.nodeId,n=p&&rr(p.nodesRef.current,t).some(t=>Ot(e,t.context?.elements.floating));return j(e)||n}function O(e){if(m(e)){e.type!==`click`&&!j(e)&&(t.clear(),C.current=!1),k();return}if(f.current.insideReactTree){k();return}let n=Et(e),r=`[${ar(`inert`)}]`,i=z(n)?n.getRootNode():null,a=Array.from((ee(i)?i:K(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Y(e,n))))return;let s=z(n)?n:null;for(;s&&!ue(s);){let e=fe(s);if(ue(e)||!z(e))break;s=e}if(!(a.length&&z(n)&&!kt(n)&&!Y(n,l.select(`floatingElement`))&&a.every(e=>!Y(s,e)))){if(B(n)&&!(`touches`in e)){let t=ue(n),r=H(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!g(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof h==`function`&&!h(e)||A(`__outsidePressBubbles`)||(l.setOpen(!1,J(Ce,e)),k())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||j(e)||O(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||j(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Et(e);if(!n)return;let r=X(n,e.type,()=>{t(e),r()})}function I(e){T.current=`touch`,F(e,P)}function L(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):O(e)})}function R(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!g(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),C.current=!0,k())}}}function te(e){if(c()!==`sloppy`||!E.current||j(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(O(e),D.clear(),E.current=null)}function ne(e){F(e,te)}function re(e){c()!==`sloppy`||!E.current||j(e)||(E.current.dismissOnTouchEnd&&O(e),D.clear(),E.current=null)}function ie(e){F(e,re)}let V=K(d),ae=Bt(r&&Bt(X(V,`keydown`,N),X(V,`compositionstart`,i),X(V,`compositionend`,a)),_&&Bt(X(V,`click`,L,!0),X(V,`pointerdown`,L,!0),X(V,`pointerup`,R,!0),X(V,`pointercancel`,R,!0),X(V,`mousedown`,L,!0),X(V,`mouseup`,R,!0),X(V,`touchstart`,I,!0),X(V,`touchmove`,ne,!0),X(V,`touchend`,ie,!0)));return()=>{ae(),e.clear(),t.clear(),s(),C.current=!1,k()}},[f,d,r,_,h,u,n,y,b,N,k,v,A,j,p,l,D]);let L=g.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),R=g.useMemo(()=>({onKeyDown:N,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,I]);return g.useMemo(()=>n?{reference:L,floating:R,trigger:L}:{},[n,L,R])}function Pr(e,t,n){let{reference:r,floating:i}=e,a=Q(t),o=ln(t),s=cn(o),c=Z(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=on(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Fr(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=an(t,e),p=xn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Sn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ir=50,Lr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Fr},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pr(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ir&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Pr(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Rr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=an(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Z(r),_=Q(o),v=Z(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yn(o)]:dn(o)),x=p!==`none`;!d&&x&&b.push(...vn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=un(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Q(t)||T.every(e=>Q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},zr=new Set([`left`,`top`]);async function Br(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Z(n),s=on(n),c=Q(n)===`y`,l=zr.has(o)?-1:1,u=a&&c?-1:1,d=an(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Vr=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Br(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Hr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=an(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Q(i),p=sn(f),m=u[p],h=u[f],g=(e,t)=>rn(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ur=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=an(e,t),u={x:n,y:r},d=Q(i),f=sn(d),p=u[f],m=u[d],h=an(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=zr.has(Z(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Wr=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=an(e,t),c=await i.detectOverflow(t,s),l=Z(n),u=on(n),d=Q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Zt(p-c[m],g),y=Zt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Qt(c.left,c.right):S=p-2*Qt(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Gr(e){let t=H(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$t(n)!==a||$t(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Kr(e){return z(e)?e:e.contextElement}function qr(e){let t=Kr(e);if(!B(t))return tn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gr(t),o=(a?$t(n.width):n.width)/r,s=(a?$t(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jr=tn(0);function Yr(e){let t=I(e);return!le()||!t.visualViewport?Jr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xr(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===I(e)}function Zr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Kr(e),o=tn(1);t&&(r?z(r)&&(o=qr(r)):o=qr(e));let s=Xr(a,n,r)?Yr(a):tn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=I(a),t=z(r)?I(r):r,n=e,i=me(n);for(;i&&t!==n;){let e=qr(i),t=i.getBoundingClientRect(),r=H(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=I(i),i=me(n)}}return Sn({width:u,height:d,x:c,y:l})}function Qr(e,t){let n=de(e).scrollLeft;return t?t.left+n:Zr(L(e)).left+n}function $r(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qr(e,n),y:n.top+t.scrollTop}}function ei(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=L(r),s=t?re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=tn(1),u=tn(0),d=B(r);if((d||!a)&&((F(r)!==`body`||te(o))&&(c=de(r)),d)){let e=Zr(r);l=qr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$r(o,c):tn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ti(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ni(e){let t=de(e),n=e.ownerDocument.body,r=Qt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Qr(e),o=-t.scrollTop;return H(n).direction===`rtl`&&(a+=Qt(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ri=25;function ii(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=I(e),a=L(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!le()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Qr(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ri&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ai(e,t){let n=Zr(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qr(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function oi(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ii(e,n,t);else if(t===`document`)r=ni(L(e));else if(z(t))r=ai(t,n);else{let n=Yr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Sn(r)}function si(e,t){let n=t.get(e);if(n)return n;let r=U(e,[],!1).filter(e=>z(e)&&F(e)!==`body`),i=null,a=H(e).position===`fixed`,o=a?fe(e):e;for(;z(o)&&!ue(o);){let e=H(o),t=se(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=fe(o)}return t.set(e,r),r}function ci(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?re(t)?[]:si(t,this._c):[].concat(n),r],o=oi(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=oi(t,a[e],i);s=Qt(n.top,s),c=Zt(n.right,c),l=Zt(n.bottom,l),u=Qt(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function li(e){let{width:t,height:n}=Gr(e);return{width:t,height:n}}function ui(e,t,n){let r=B(t),i=L(t),a=n===`fixed`,o=Zr(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=tn(0);if((r||!a)&&((F(t)!==`body`||te(i))&&(s=de(t)),r)){let e=Zr(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Qr(i));let l=i&&!r&&!a?$r(i,s):tn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function di(e){return H(e).position===`static`}function fi(e,t){if(!B(e)||H(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return L(e)===n&&(n=n.ownerDocument.body),n}function pi(e,t){let n=I(e);if(re(e))return n;if(!B(e)){let t=fe(e);for(;t&&!ue(t);){if(z(t)&&!di(t))return t;t=fe(t)}return n}let r=fi(e,t);for(;r&&ne(r)&&di(r);)r=fi(r,t);return r&&ue(r)&&di(r)&&!se(r)?n:r||ce(e)||n}var mi=async function(e){let t=this.getOffsetParent||pi,n=this.getDimensions,r=await n(e.floating);return{reference:ui(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hi(e){return H(e).direction===`rtl`}var gi={convertOffsetParentRelativeRectToViewportRelativeRect:ei,getDocumentElement:L,getClippingRect:ci,getOffsetParent:pi,getElementRects:mi,getClientRects:ti,getDimensions:li,getScale:qr,isElement:z,isRTL:hi};function _i(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vi(e,t,n){let r=null,i,a=L(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=en(d),h=en(a.clientWidth-(u+f)),g=en(a.clientHeight-(d+p)),_=en(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Qt(0,Zt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_i(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=I(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yi(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Kr(e),u=i||a?[...l?U(l):[],...t?U(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vi(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zr(e):null;c&&g();function g(){let t=Zr(e);h&&!_i(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bi=Vr,xi=Hr,Si=Rr,Ci=Wr,wi=Ur,Ti=(e,t,n)=>{let r=new Map,i=n??{},a={...gi,...i.platform,_c:r};return Lr(e,t,{...i,platform:a})},Ei=typeof document<`u`?g.useLayoutEffect:function(){};function Di(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Di(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Di(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Oi(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ki(e,t){let n=Oi(e);return Math.round(t*n)/n}function Ai(e){let t=g.useRef(e);return Ei(()=>{t.current=e}),t}function ji(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);Di(f,r)||p(r);let[m,h]=g.useState(null),[_,v]=g.useState(null),y=g.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=g.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||_,C=g.useRef(null),w=g.useRef(null),T=g.useRef(u),E=c!=null,D=Ai(c),O=Ai(i),k=Ai(l),A=g.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Ti(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Di(T.current,t)&&(T.current=t,or.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ei(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=g.useRef(!1);Ei(()=>(j.current=!0,()=>{j.current=!1}),[]),Ei(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=g.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=g.useMemo(()=>({reference:x,floating:S}),[x,S]),P=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ki(N.floating,u.x),r=ki(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Oi(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Mi=(e,t)=>{let n=bi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ni=(e,t)=>{let n=xi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pi=(e,t)=>({fn:wi(e).fn,options:[e,t]}),Fi=(e,t)=>{let n=Si(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ii=(e,t)=>{let n=Ci(e);return{name:n.name,fn:n.fn,options:[e,t]}},Li=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(o(99,this.componentName,e,this.componentName));t.setOpen(!0,J(ze,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,J(ze))}},Ri=[],zi=void 0;function Bi(){return zi}function Vi(e){Ri.push(e)}function Hi(e){let t=(t,n)=>{let r=u(Wi).current,i;try{zi=r;for(let e of Ri)e.before(r);i=e(t,n);for(let e of Ri)e.after(r);r.didInitialize=!0}finally{zi=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ui(e){return g.forwardRef(Hi(e))}function Wi(){return{didInitialize:!1}}var Gi=a(19)?Ji:Yi;function Ki(e,t,n,r,i){return Gi(e,t,n,r,i)}function qi(e,t,n,r,i){let a=g.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,v.useSyncExternalStore)(e.subscribe,a,a)}Vi({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,v.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ji(e,t,n,r,i){let a=Bi();if(!a)return qi(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Yi(e,t,n,r,i){return(0,y.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Xi=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Ki(this,e,t,n,r)}},Zi=class extends Xi{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){g.useDebugValue(e);let n=this;G(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;G(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;G(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){g.useDebugValue(e);let n=this,r=t!==void 0;G(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return g.useDebugValue(e),Ki(this,this.selectors[e],t,n,r)}useContextCallback(e,t){g.useDebugValue(e);let n=W(t??c);this.context[e]=n}useStateSetter(e){let t=g.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Qi={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},$i=class extends Zi{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:xr(),nested:n,triggerElements:i},Qi),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&vt(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function ea(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=g.useRef(null);r===void 0&&f.current===null&&(f.current=new $i({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),G(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};z(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function ta(e,t=!1,n=!1){let[r,i]=g.useState(e&&t?`idle`:void 0),[a,o]=g.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),G(()=>{if(!e&&a&&r!==`ending`&&n){let e=Gt.request(()=>{i(`ending`)});return()=>{Gt.cancel(e)}}},[e,a,r,n]),G(()=>{if(!e||t)return;let n=Gt.request(()=>{i(void 0)});return()=>{Gt.cancel(n)}},[t,e]),G(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Gt.request(()=>{i(`idle`)});return()=>{Gt.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function na(e,t=!1){let n=Kt();return W((r,i=null)=>{n.cancel();let a=Ar(e);if(a==null)return;let o=a,s=()=>{or.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function ra(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=W(i),o=na(r,n);g.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var ia={tabIndex:-1,[yt]:``};function aa(e){return t=>t!==`touch`||e.current}function oa(e,t=!1){let n=Ke(),r=Tr()!=null,i=u(()=>e(n,r)).current;return ea({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function sa({handle:e,store:t}){return G(()=>e.attachStore(t),[e,t]),null}function ca(e,t){let n=g.useRef(null),r=g.useRef(null);return g.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function la(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function ua(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function da(e,t,n,r={}){let i=n.reason,a=i===q,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ua(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),la(i,t,n.trigger,c()),e.update(i)};a?or.flushSync(l):l()}function fa(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ca(e,n),o=W(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=g.useCallback(e=>{a(e),e&&o(e)},[a,o]);return G(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function pa(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=g.useRef(null),i=e.useState(`open`);G(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=J(be);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function ma(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ta(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=W(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return ra({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ha(e,t){e.useSyncedValues(t),G(()=>()=>{e.update({activeTriggerProps:s,inactiveTriggerProps:s,popupProps:s})},[e])}function ga(e,t){G(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),G(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var _a=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function va(){return new $i({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new _a,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ya(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:va(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:s,inactiveTriggerProps:s,popupProps:s}}function ba(e,t,n=!1){return new $i({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var xa=e=>e.triggerIdProp??e.activeTriggerId,Sa=e=>e.openProp??e.open,Ca=e=>(e.popupElement?.id??e.floatingId)||void 0;function wa(e,t){return t!==void 0&&Sa(e)&&xa(e)===t}function Ta(e,t){return wa(e,t)?!0:t!==void 0&&Sa(e)&&xa(e)==null&&e.triggerCount===1}var Ea={open:Sa,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:xa,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ca,isTriggerActive:(e,t)=>t!==void 0&&xa(e)===t,isOpenedByTrigger:(e,t)=>wa(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&xa(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ta(e,t)?Ca(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Da(e){let t=g.useCallback(t=>e===void 0?c:e.subscribeStore(t),[e]),n=g.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,v.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Oa(e){return ka(e,e.rootContext)}function ka(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=g.useState(null),[d,f]=g.useState(void 0),[p,m]=g.useState(void 0),h=g.useRef(null),_=Er(r),v=g.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=ji({...e,elements:{...v,...l&&{reference:l}}}),b=z(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=g.useCallback(e=>{let t=z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=g.useCallback(e=>{(z(e)||e===null)&&(h.current=e,f(e)),(z(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!z(e))&&y.refs.setReference(e)},[y.refs,f]),w=g.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=g.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=g.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=g.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return G(()=>{o&&(h.current=o)},[o]),G(()=>{t.context.dataRef.current.floatingContext=D;let e=_?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),g.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var Aa=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Xe,this.restTimeout=new Xe,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ja=new WeakMap;function Ma(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ja.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ja.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Na(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ja.get(n);a&&a!==e&&Ma(a),Ma(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ja.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Pa(e){let t=e.context.dataRef.current,n=u(()=>t.hoverInteractionState??Aa.create()).current;return t.hoverInteractionState||=n,Je(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Fa(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Er(),d=Tr(),f=Pa(a),p=Ze(),m=W(()=>Rt(l.current.openEvent?.type,f.interactedInside)),h=W(()=>zt(l.current.openEvent?.type)),_=W(()=>{Ma(f)});G(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,_())},[o,f,_]),g.useEffect(()=>_,[_]),G(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&z(c)&&s){let e=c,t=s,n=K(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return Na(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{_()}}},[n,o,c,s,f,h,u,d,_]),g.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&rr(u.nodesRef.current,d).length>0)}function t(e){let t=It(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,J(q,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Et(e);if(!jt(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),_()}function g(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Dt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&z(o)&&rr(u.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}_(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,J(q,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Bt(y&&X(y,`mouseenter`,c),y&&X(y,`mouseleave`,g),y&&X(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,_,f,u,d,p])}var Ia={current:null};function La(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Ia,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:_,events:v}=h.context,y=Er(l),b=Pa(h),x=g.useRef(!1),S=Vt(i),C=Vt(r),w=Vt(o),T=Vt(n),E=Vt(p),D=Vt(f),O=W(()=>Rt(_.current.openEvent?.type,b.interactedInside)),k=W(()=>E.current?.()!==!1),A=W((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Y(e,t);if(!z(n))return!1;let i=n;return r.hasMatchingElement(e=>Y(e,i))&&(!e||!Y(e,i))}),j=W(()=>{b.handler&&=(K(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=W(()=>{Ma(b)});return u&&(b.handleCloseOptions=S.current?.__options),g.useEffect(()=>j,[j]),g.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===q,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,j]),g.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=It(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,J(q,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,J(q,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!z(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!_t(b.pointerType))return;let t=Lt(w.current),n=It(C.current,`open`,b.pointerType),r=Et(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(z(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Y(e,r)){s=e;break}}z(i)&&z(o)&&!h.context.triggerElements.hasElement(i)&&Y(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&z(s)&&z(o)&&Y(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,J(q,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,J(q,e,s))}):g&&k()&&h.setOpen(!0,J(q,e,s)))}function i(t){if(O()){M();return}j();let n=K(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=_.current.floatingContext??d?.();if(!Dt(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!Y(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Y(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?X(t,`mouseout`,o):void 0;return s?Bt(X(t,`mousemove`,r,{once:!0}),X(t,`mouseenter`,r),X(t,`mouseleave`,i),l):Bt(X(t,`mouseenter`,r),X(t,`mouseleave`,i),l)},[j,M,_,C,h,n,S,b,u,A,O,a,s,w,c,y,T,d,D,k,m]),g.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!_t(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Na(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Lt(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=h.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,J(q,t,n))}b.pointerType===`touch`?or.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var Ra=.1,za=Ra*Ra,$=.5;function Ba(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Va(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ba(e,t,n,r,i,a)&&(u=!u),Ba(e,t,i,a,o,s)&&(u=!u),Ba(e,t,o,s,c,l)&&(u=!u),Ba(e,t,c,l,n,r)&&(u=!u),u}function Ha(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ua(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Wa(e={}){let{blockPointerEvents:t=!1}=e,n=new Xe,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*za;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Et(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&z(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&rr(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Ua(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Ua(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Ua(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Ua(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Ha(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+$+1,o=C||T?S.bottom-$:S.top,s=C?T?S.bottom-$:S.top:S.bottom-$;M=Va(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-$,o=C||T?S.top+$:S.bottom,s=C?T?S.top+$:S.bottom:S.top+$;M=Va(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+$+1,o=w||E?S.right-$:S.left,s=w?E?S.right-$:S.left:S.right-$;M=Va(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-$,o=w||E?S.left+$:S.right,s=w?E?S.left+$:S.right:S.left+$;M=Va(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Ga(e){return a(19)?e:e?`true`:void 0}var Ka=class extends Zi{setState(e){}update(e){}set(e,t){}notifyAll(){}},qa=g.createContext(void 0);function Ja(){return g.useContext(qa)?.direction??`ltr`}var Ya=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=an(e,t)||{};if(l==null)return{};let f=xn(u),p={x:n,y:r},m=ln(i),h=cn(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=rn(k,j,A),N=!c.arrow&&on(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Xa=(e,t)=>({...Ya(e),options:[e,t]}),Za={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Qa={sideX:`left`,sideY:`top`},$a=`--available-width`,eo=`--available-height`;function to(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function no(e,t,n){let{rects:r,placement:i}=e;return{side:to(t,Z(i),n),align:on(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ro(e){return io(e,Oa)}function io(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=g.useState(null);!_&&w!==null&&T(null);let E=v.side||`flip`,D=v.align||`flip`,O=v.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=W(j),N=j?M:n,P=Vt(n),F=Vt(_),L=Ja()===`rtl`,R=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":L?`left`:`right`,"inline-start":L?`right`:`left`}[i],z=o===`center`?R:`${R}-${o}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),re=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},V=g.useRef(null),ae=Vt(a),oe=Vt(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(Mi(e=>{let t=no(e,i,L),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,L,i]));let ue=D===`none`&&E!==`shift`,H=!ue&&(u||k||E===`shift`),de=E===`none`?null:Fi({...ie,padding:{top:B.top+1+ee,right:B.right+1+re,bottom:B.bottom+1+te,left:B.left+1+ne},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),fe=ue?null:Ni({...ie,rootBoundary:A,mainAxis:D!==`none`,crossAxis:H,limiter:u||k?void 0:Pi(e=>{if(!V.current)return{};let{width:t,height:n}=V.current.getBoundingClientRect(),r=Q(Z(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[ie,u,k,A,B,D]);E===`shift`||D===`shift`||o===`center`?le.push(fe,de):le.push(de,fe),le.push(Ii({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty($a,`${t}px`),i.setProperty(eo,`${n}px`);let a=I(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Xa(e=>({element:V.current||K(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Z(r),l=Q(c),u=V.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(no(e,i,L)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,H&&l===`y`&&b?S:x),{}}},Za,x),G(()=>{!_&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,h]);let pe=g.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:U,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:q}=t({rootContext:h,open:m?_:void 0,placement:z,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>yi(...e,pe),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=_e.adaptiveOrigin||Qa,we=xe?r:`fixed`,Te=g.useMemo(()=>{let e;return e=xe?x?{position:we,[Se]:he,[Ce]:ge}:{...q,position:we}:{position:we,top:0,left:0},e[$a]=`100vw`,e[eo]=`100vh`,xe||(e.opacity=0),e},[x,we,Se,he,Ce,ge,q,xe]),Ee=g.useRef(null);G(()=>{if(!_)return;let e=P.current,t=typeof e==`function`?e():e,n=(ao(t)?t.current:t)||null;n!==Ee.current&&(U.setPositionReference(n),Ee.current=n)},[_,U,N,P]),g.useEffect(()=>{if(!_)return;let e=P.current;typeof e!=`function`&&ao(e)&&e.current!==Ee.current&&(U.setPositionReference(e.current),Ee.current=e.current)},[_,U,N,P]),g.useEffect(()=>{if(m&&_&&me.reference&&me.floating)return yi(me.reference,me.floating,ve,pe)},[m,_,me,ve,pe]);let De=Z(ye),Oe=to(i,De,L),ke=on(ye)||`center`,Ae=!!_e.hide?.referenceHidden;G(()=>{S&&_&&xe&&De!==R&&T(De)},[S,_,xe,De,R]);let je=g.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Me=_e.arrow?.centerOffset!==0;return g.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:V,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:U,context:be,isPositioned:xe,update:ve}),[Te,je,V,Me,Oe,ke,De,Ae,U,be,xe,ve])}function ao(e){return e!=null&&`current`in e}function oo(e){return e===`starting`?sr:s}function so(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),l(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},oo(r),i],stateAttributesMapping:M})}function co(e){let[t,n]=g.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function lo(e){let t=H(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return($t(n)!==a||$t(r)!==o)&&(n=a,r=o),{width:n,height:r}}function uo(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,onMeasureLayout:a,onMeasureLayoutComplete:o,side:s,direction:l}=e,u=na(t,!0),d=Kt(),f=g.useRef(null),p=g.useRef(!0),m=g.useRef(c),h=W(a),_=W(o),v=g.useMemo(()=>fo(s,l),[s,l]);G(()=>{if(!i){m.current=c,p.current=!0,f.current=null;return}if(!t||!n)return;m.current=mo(t,v),ho(t,`auto`);let e=po(t,`position`,`static`),r=po(t,`transform`,`none`),a=po(t,`scale`,`1`),o=mo(n,{"--available-width":`max-content`,"--available-height":`max-content`});function s(){e(),r(),o()}function l(){s(),a()}if(h?.(),p.current||f.current===null){go(n,`max-content`);let e=lo(t);return f.current=e,go(n,e),l(),_?.(null,e),p.current=!1,()=>{m.current(),m.current=c}}go(n,`max-content`);let g=f.current,y=lo(t);f.current=y,ho(t,g),l(),_?.(g,y),go(n,y);let b=new AbortController;return d.request(()=>{ho(t,y),u(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},b.signal)}),()=>{b.abort(),d.cancel(),m.current(),m.current=c}},[r,t,n,u,d,i,h,_,v])}function fo(e,t){let n=e===`top`,r=e===`left`||e===(t===`rtl`?`inline-end`:`inline-start`);return!n&&!r?s:{position:`absolute`,[n?`bottom`:`top`]:`0`,[r?`right`:`left`]:`0`}}function po(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function mo(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(po(e,r,i));return n.length?()=>{n.forEach(e=>e())}:c}function ho(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function go(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var _o={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=I(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:Qa};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=K(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Z(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Qa.sideX,g=f===`top`?`bottom`:Qa.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}},vo={activationDirection:e=>e?{"data-activation-direction":e}:null};function yo(e){let{store:t,side:n,children:r}=e,i=Ja(),a=t.useState(`activeTriggerElement`),o=t.useState(`activeTriggerId`),s=t.useState(`open`),c=t.useState(`payload`),l=t.useState(`mounted`),u=t.useState(`popupElement`),d=t.useState(`positionerElement`),f=co(s?a:null),p=Co(o,c),m=g.useRef(null),[h,v]=g.useState(null),[y,b]=g.useState(null),x=g.useRef(null),S=g.useRef(null),C=na(x,!0),w=Kt(),T=g.useRef(null),[E,D]=g.useState(null),[O,k]=g.useState(!1);G(()=>(t.set(`adaptiveOrigin`,_o),()=>{t.set(`adaptiveOrigin`,void 0)}),[t]);let A=W(()=>{x.current?.style.setProperty(`animation`,`none`),x.current?.style.setProperty(`transition`,`none`),S.current?.style.setProperty(`display`,`none`)}),j=W(e=>{x.current?.style.removeProperty(`animation`),x.current?.style.removeProperty(`transition`),S.current?.style.removeProperty(`display`),e&&D(e)}),M=W(()=>{T.current?.abort();let e=new AbortController;T.current=e,C(()=>{v(null),D(null),m.current=null},e.signal)}),N=g.useRef(null);G(()=>{(!s||!l)&&(N.current=null)},[s,l]),G(()=>{if(a&&f&&a!==f&&N.current!==a&&m.current){v(m.current),k(!0);let e=So(f,a);b(e),N.current=a}},[a,f]),G(()=>{h!=null&&(T.current?.abort(),k(!0),w.request(()=>{or.flushSync(()=>{k(!1)}),M()}))},[p,h,M,w]),G(()=>{let e=x.current;if(!e)return;let t=K(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));m.current=t});let P=h!=null,F;F=P?(0,_.jsxs)(g.Fragment,{children:[(0,_.jsx)(`div`,{"data-previous":!0,inert:Ga(!0),ref:S,style:{...E?{"--popup-width":`${E.width}px`,"--popup-height":`${E.height}px`}:null,position:`absolute`},"data-ending-style":O?void 0:``},`previous`),(0,_.jsx)(`div`,{"data-current":!0,ref:x,"data-starting-style":O?``:void 0,children:r},p)]}):(0,_.jsx)(`div`,{"data-current":!0,ref:x,children:r},p),G(()=>{let e=S.current;!e||!h||e.replaceChildren(...Array.from(h.childNodes))},[h]),uo({popupElement:u,positionerElement:d,mounted:l,content:c,onMeasureLayout:A,onMeasureLayoutComplete:j,side:n,direction:i});let I={activationDirection:bo(y),transitioning:P};return{children:F,state:I}}function bo(e){if(e)return`${xo(e.horizontal,5,`right`,`left`)} ${xo(e.vertical,5,`down`,`up`)}`}function xo(e,t,n,r){return e>t?n:e<-t?r:``}function So(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function Co(e,t){let[n,r]=g.useState(0),i=g.useRef(e),a=g.useRef(t),o=g.useRef(!1);return G(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}export{_r as $,it as $t,fa as A,Ve as An,Bt as At,Ui as B,B as Bn,Et as Bt,aa as C,Ce as Cn,Sn as Ct,ha as D,Se as Dn,Gt as Dt,ma as E,Be as En,Yt as Et,$i as F,F as Fn,Mt as Ft,Or as G,M as Gn,_t as Gt,gi as H,te as Hn,xt as Ht,Zi as I,U as In,At as It,Tr as J,A as Jn,pt as Jt,kr as K,N as Kn,ht as Kt,Xi as L,fe as Ln,Nt as Lt,na as M,G as Mn,It as Mt,ta as N,W as Nn,Pt as Nt,oa as O,q as On,Kt as Ot,ea as P,H as Pn,Dt as Pt,yr as Q,p as Qn,ot as Qt,Ki as R,I as Rn,Tt as Rt,ua as S,be as Sn,kn as St,pa as T,Le as Tn,Jt as Tt,Nr as U,ee as Un,St as Ut,Li as V,ue as Vn,wt as Vt,Ar as W,w as Wn,Ct as Wt,Sr as X,C as Xn,ut as Xt,Er as Y,b as Yn,ft as Yt,br as Z,h as Zn,lt as Zt,Ea as _,Oe as _n,On as _t,oo as a,Ke as an,ar as at,sa as b,Pe as bn,jn as bt,Ka as c,Ie as cn,Kn as ct,La as d,Me as dn,Qn as dt,st as en,dr as et,Fa as f,Re as fn,$n as ft,ba as g,De as gn,Dn as gt,ya as h,ze as hn,qn as ht,so as i,qe as in,mr as it,ra as j,K as jn,X as jt,ga as k,xe as kn,Vt as kt,Ga as l,Ee as ln,Yn as lt,Da as m,Ae as mn,Gn as mt,yo as n,Ze as nn,pr as nt,ro as o,J as on,ir as ot,Pa as p,je as pn,er as pt,Dr as q,j as qn,gt as qt,co as r,Je as rn,fr as rt,Ja as s,He as sn,rr as st,vo as t,Xe as tn,cr as tt,Wa as u,Te as un,Xn as ut,_a as v,ke as vn,En as vt,la as w,Fe as wn,Xt as wt,da as x,Ne as xn,wn as xt,ia as y,we as yn,Tn as yt,Hi as z,z as zn,Y as zt};
|
|
1
|
+
import{i as e,n as t,t as n}from"./react-SIfiwpqq.js";import{It as r}from"./composerDraftStore-DC2r8dcu.js";import{a as i,c as a,d as o,o as s,s as c,t as l,u}from"./useRenderElement-DchFnsR8.js";import{t as d}from"./react-dom-x9LNwWQc.js";var f=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),p=t(((e,t)=>{t.exports=f()})),m=t((e=>{var t=n(),r=p();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),h=t(((e,t)=>{t.exports=m()})),g=e(n(),1),_=r(),v=p(),y=h(),b=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),x={"data-starting-style":``},S={"data-ending-style":``},C={transitionStatus(e){return e===`starting`?x:e===`ending`?S:null}},w=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=b.startingStyle]=`startingStyle`,e[e.endingStyle=b.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),T={"data-popup-open":``},E={"data-popup-open":``,"data-pressed":``},D={"data-open":``},O={"data-closed":``},k={"data-anchor-hidden":``},A={open(e){return e?T:null}},j={open(e){return e?E:null}},M={open(e){return e?D:O},anchorHidden(e){return e?k:null}},N={...M,...C};function P(){return typeof window<`u`}function F(e){return R(e)?(e.nodeName||``).toLowerCase():`#document`}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function L(e){return((R(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function R(e){return P()?e instanceof Node||e instanceof I(e).Node:!1}function z(e){return P()?e instanceof Element||e instanceof I(e).Element:!1}function B(e){return P()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function ee(e){return!P()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function te(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ne(e){return/^(table|td|th)$/.test(F(e))}function re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ie=/transform|translate|scale|rotate|perspective|filter/,V=/paint|layout|strict|content/,ae=e=>!!e&&e!==`none`,oe;function se(e){let t=z(e)?H(e):e;return ae(t.transform)||ae(t.translate)||ae(t.scale)||ae(t.rotate)||ae(t.perspective)||!le()&&(ae(t.backdropFilter)||ae(t.filter))||ie.test(t.willChange||``)||V.test(t.contain||``)}function ce(e){let t=fe(e);for(;B(t)&&!ue(t);){if(se(t))return t;if(re(t))return null;t=fe(t)}return null}function le(){return oe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),oe}function ue(e){return/^(html|body|#document)$/.test(F(e))}function H(e){return I(e).getComputedStyle(e)}function de(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fe(e){if(F(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ee(e)&&e.host||L(e);return ee(t)?t.host:t}function pe(e){let t=fe(e);return ue(t)?(e.ownerDocument||e).body:B(t)&&te(t)?t:pe(t)}function U(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=pe(e),i=r===e.ownerDocument?.body,a=I(r);if(i){let e=me(a);return t.concat(a,a.visualViewport||[],te(r)?r:[],e&&n?U(e):[])}return t.concat(r,U(r,[],n))}function me(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var he={...g},ge=he.useInsertionEffect,_e=ge&&ge!==he.useLayoutEffect?ge:e=>e();function W(e){let t=u(ve).current;return t.next=e,_e(t.effect),t.trampoline}function ve(){let e={next:void 0,callback:ye,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ye(){}var G=typeof document<`u`?g.useLayoutEffect:()=>{};function K(e){return e?.ownerDocument||document}var be=`none`,xe=`trigger-press`,q=`trigger-hover`,Se=`trigger-focus`,Ce=`outside-press`,we=`item-press`,Te=`close-press`,Ee=`clear-press`,De=`input-change`,Oe=`input-clear`,ke=`input-press`,Ae=`focus-out`,je=`escape-key`,Me=`close-watcher`,Ne=`list-navigation`,Pe=`keyboard`,Fe=`pointer`,Ie=`cancel-open`,Le=`sibling-open`,Re=`disabled`,ze=`imperative-action`,Be=`swipe`,Ve=`window-resize`;function J(e,t,n,r){let i=!1,a=!1,o=r??s;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function He(e,t,n){let r=n??s;return{reason:e,event:t??new Event(`base-ui`),...r}}var Ue=0;function We(e,t=`mui`){let[n,r]=g.useState(e),i=e||n;return g.useEffect(()=>{n??(Ue+=1,r(`${t}-${Ue}`))},[n,t]),i}var Ge=he.useId;function Ke(e,t){if(Ge!==void 0){let n=Ge();return e??(t?`${t}-${n}`:n)}return We(e,t)}function qe(e){return Ke(e,`base-ui`)}function Je(e){g.useEffect(e,i)}var Ye=0,Xe=class e{static create(){return new e}currentId=Ye;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ye,t()},e)}isStarted(){return this.currentId!==Ye}clear=()=>{this.currentId!==Ye&&(clearTimeout(this.currentId),this.currentId=Ye)};disposeEffect=()=>this.clear};function Ze(){let e=u(Xe.create).current;return Je(e.disposeEffect),e}function Qe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:$e,platform:et,maxTouchPoints:tt}=Qe(),nt=$e.toLowerCase(),rt=et.toLowerCase(),it=/^i(os$|p)/.test(rt)||rt===`macintel`&&tt>1,at=`android`,ot=rt===at||nt.includes(at),st=!it&&rt.startsWith(`mac`);rt.startsWith(`win`),!ot&&/^(linux|chrome os)/.test(rt);var ct=st||it,lt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),ut=!lt&&nt.includes(`firefox`);!lt&&nt.includes(`chrom`);var dt=ct,ft=/jsdom|happydom/.test(nt);function pt(e){e.preventDefault(),e.stopPropagation()}function mt(e){return`nativeEvent`in e}function ht(e){return e.pointerType===``&&e.isTrusted?!0:ot&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function gt(e){return ft?!1:!ot&&e.width===0&&e.height===0||ot&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function _t(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function vt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var yt=`data-base-ui-focusable`,bt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,xt=`ArrowLeft`,St=`ArrowRight`,Ct=`ArrowUp`,wt=`ArrowDown`;function Tt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Et(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Dt(e,t){if(!z(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Y(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ot(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function kt(e){return e.matches(`html,body`)}function At(e){return B(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function jt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${bt}`)!=null}function Mt(e){return e?e.getAttribute(`role`)===`combobox`&&At(e):!1}function Nt(e){if(!e||ft)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Pt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ft(e,t){return t!=null&&!_t(t)?0:typeof e==`function`?e():e}function It(e,t,n){let r=Ft(e,n);return typeof r==`number`?r:r?.[t]}function Lt(e){return typeof e==`function`?e():e}function Rt(e,t){return t||e===`click`||e===`mousedown`}function zt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function X(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Bt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Vt(e){let t=u(Ht,e).current;return t.next=e,G(t.effect),t}function Ht(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ut=null;globalThis.requestAnimationFrame;var Wt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Gt=class e{static create(){return new e}static request(e){return Wt.request(e)}static cancel(e){return Wt.cancel(e)}currentId=Ut;request(e){this.cancel(),this.currentId=Wt.request(()=>{this.currentId=Ut,e()})}cancel=()=>{this.currentId!==Ut&&(Wt.cancel(this.currentId),this.currentId=Ut)};disposeEffect=()=>this.cancel};function Kt(){let e=u(Gt.create).current;return Je(e.disposeEffect),e}var qt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Jt={...qt,position:`fixed`,top:0,left:0},Yt={...qt,position:`absolute`},Xt=g.forwardRef(function(e,t){let[n,r]=g.useState();G(()=>{dt&<&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,_.jsx)(`span`,{...e,ref:t,style:Jt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Zt=Math.min,Qt=Math.max,$t=Math.round,en=Math.floor,tn=e=>({x:e,y:e}),nn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function rn(e,t,n){return Qt(e,Zt(t,n))}function an(e,t){return typeof e==`function`?e(t):e}function Z(e){return e.split(`-`)[0]}function on(e){return e.split(`-`)[1]}function sn(e){return e===`x`?`y`:`x`}function cn(e){return e===`y`?`height`:`width`}function Q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ln(e){return sn(Q(e))}function un(e,t,n){n===void 0&&(n=!1);let r=on(e),i=ln(e),a=cn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yn(o)),[o,yn(o)]}function dn(e){let t=yn(e);return[fn(e),t,fn(t)]}function fn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pn=[`left`,`right`],mn=[`right`,`left`],hn=[`top`,`bottom`],gn=[`bottom`,`top`];function _n(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mn:pn:t?pn:mn;case`left`:case`right`:return t?hn:gn;default:return[]}}function vn(e,t,n,r){let i=on(e),a=_n(Z(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fn)))),a}function yn(e){let t=Z(e);return nn[t]+e.slice(t.length)}function bn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bn(e)}function Sn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Cn(e,t,n){return Math.floor(e/t)!==n}function wn(e,t){return t<0||t>=e.length}function Tn(e,t){return Dn(e.current,{disabledIndices:t})}function En(e,t){return Dn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&kn(e,a,r));return a}function On(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!kn(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=en(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!kn(e,r,s))return r}};d&&pt(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Dn(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Dn(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}wn(e,f)&&(f=u)}if(n===`both`){let n=en(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&pt(t),u%o===o-1?r&&(f=Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dn(e,{startingIndex:u,disabledIndices:s}),r&&Cn(f,o,n)&&(f=Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Cn(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&pt(t),u%o===0?r&&(f=Dn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Dn(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Cn(f,o,n)&&(f=Dn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Cn(f,o,n)&&(f=u));let c=en(l/o)===n;wn(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Dn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function kn(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!jn(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function An(e){return e.visibility===`hidden`||e.visibility===`collapse`}function jn(e,t=e?H(e):null){return!e||!e.isConnected||!t||An(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Mn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Nn(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ee(n)?n.host:null}function Pn(e){for(let t of Array.from(e.children))if(F(t)===`summary`)return t;return null}function Fn(e,t){let n=Pn(t);return!!n&&(e===n||Y(n,e))}function In(e){let t=e?F(e):``;return e!=null&&e.matches(Mn)&&(t!==`summary`||e.parentElement!=null&&F(e.parentElement)===`details`&&Pn(e.parentElement)===e)&&(t!==`details`||Pn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Ln(e){if(!In(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Nn(t)){let n=t!==e,r=F(t)===`slot`;if(t.hasAttribute(`inert`)||n&&F(t)===`details`&&!t.open&&!Fn(e,t)||t.hasAttribute(`hidden`)||!r&&!Rn(t,n))return!1}return!0}function Rn(e,t){let n=H(e);return t?n.display!==`none`:jn(e,n)}function zn(e){let t=e.tabIndex;if(t<0){let t=F(e);if(t===`details`||t===`audio`||t===`video`||B(e)&&e.isContentEditable)return 0}return t}function Bn(e){if(F(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Vn(e,t){let n=Bn(e);if(!n)return!0;let r=t.find(e=>{let t=Bn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Bn(e);return t?.name===n.name&&t.form===n.form})===n}function Hn(e){if(B(e)&&F(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return B(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Un(e,t){Hn(e).forEach(e=>{In(e)&&t.push(e),Un(e,t)})}function Wn(e,t,n){Hn(e).forEach(e=>{B(e)&&e.matches(t)&&n.push(e),Wn(e,t,n)})}function Gn(e){return Ln(e)&&zn(e)>=0}function Kn(e){let t=[];return Un(e,t),t.filter(Ln)}function qn(e){let t=Kn(e);return t.filter(e=>zn(e)>=0&&Vn(e,t))}function Jn(e,t){let n=qn(e),r=n.length;if(r===0)return;let i=Tt(K(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Yn(e){return Jn(K(e).body,1)||e}function Xn(e){return Jn(K(e).body,-1)||e}function Zn(e,t){if(!e)return null;let n=qn(K(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Qn(e){return Zn(e,1)}function $n(e){return Zn(e,-1)}function er(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Y(n,r)}function tr(e){qn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function nr(e){let t=[];Wn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function rr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...rr(e,t.id,n)])}function ir(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ar(e){return`data-base-ui-${e}`}var or=e(d(),1),sr={style:{transition:`none`}},cr=`data-base-ui-click-trigger`,lr=`data-base-ui-swipe-ignore`,ur=`data-swipe-ignore`,dr=`[${lr}]`,fr=`[${ur}]`,pr={fallbackAxisSide:`none`},mr={fallbackAxisSide:`end`},hr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},gr=g.createContext(null),_r=()=>g.useContext(gr),vr=ar(`portal`);function yr(e={}){let{ref:t,container:n,componentProps:r=s,elementProps:i}=e,a=Ke(),o=_r()?.portalNode,[c,u]=g.useState(null),[d,f]=g.useState(null),p=W(e=>{e!==null&&f(e)}),m=g.useRef(null);G(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(R(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,o]);let h=l(`div`,r,{ref:[t,p],props:[{id:a,[vr]:``},i]}),_=c&&h?or.createPortal(h,c):null;return{node:d,nodeId:g.isValidElement(h)?h.props.id:void 0,subtree:_}}var br=g.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=yr({container:o,ref:t,componentProps:e,elementProps:s}),d=g.useRef(null),f=g.useRef(null),p=g.useRef(null),m=g.useRef(null),[h,v]=g.useState(null),y=g.useRef(!1),b=h?.modal,x=h?.open,S=!!h&&!h.modal&&h.open&&!!c;g.useEffect(()=>{if(!c||b)return;function e(e){c&&e.relatedTarget&&er(e)&&(e.type===`focusin`?y.current&&=(nr(c),!1):(tr(c),y.current=!0))}return Bt(X(c,`focusin`,e,!0),X(c,`focusout`,e,!0))},[c,b]),G(()=>{!c||x!==!0||!y.current||(nr(c),y.current=!1)},[x,c]);let C=g.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:v}),[c]);return(0,_.jsxs)(g.Fragment,{children:[u,(0,_.jsxs)(gr.Provider,{value:C,children:[S&&c&&(0,_.jsx)(Xt,{"data-type":`outside`,ref:d,onFocus:e=>{er(e,c)?p.current?.focus():Xn(h?h.domReference:null)?.focus()}}),S&&c&&(0,_.jsx)(`span`,{"aria-owns":l,style:hr}),c&&or.createPortal(a,c),S&&c&&(0,_.jsx)(Xt,{"data-type":`outside`,ref:f,onFocus:e=>{er(e,c)?m.current?.focus():(Yn(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});function xr(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Sr=class{nodesRef={current:[]};events=xr();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Cr=g.createContext(null),wr=g.createContext(null),Tr=()=>g.useContext(Cr)?.id||null,Er=e=>{let t=g.useContext(wr);return e??t};function Dr(e){let t=Ke(),n=Er(e),r=Tr();return G(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Or(e){let{children:t,id:n}=e,r=Tr();return(0,_.jsx)(Cr.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kr(e){let{children:t,externalTree:n}=e,r=u(()=>n??new Sr).current;return(0,_.jsx)(wr.Provider,{value:r,children:t})}function Ar(e){return e==null?e:`current`in e?e.current:e}function jr(){return!1}function Mr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Nr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=jr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=Er(c),m=W(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,_=h!==!1,v=W(()=>a),{escapeKey:y,outsidePress:b}=Mr(s),x=g.useRef(!1),S=g.useRef(!1),C=g.useRef(!1),w=g.useRef(!1),T=g.useRef(``),E=g.useRef(null),D=Ze(),O=Ze(),k=W(()=>{O.clear(),f.current.insideReactTree=!1}),A=W(e=>{let t=f.current.floatingContext?.nodeId;return(p?rr(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=W(e=>Ot(e,l.select(`floatingElement`))||Ot(e,l.select(`domReferenceElement`))),M=W(e=>{o()&&l.setOpen(!1,J(xe,e.nativeEvent))}),N=W(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=J(je,mt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=W(()=>{f.current.insideReactTree=!0,O.start(0,k)}),F=W(e=>{if(!u||!n||e.button!==0)return;let t=Et(e.nativeEvent);Y(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=W(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});g.useEffect(()=>{if(!u||!n)return k;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new Xe,t=new Xe;function i(){e.clear(),w.current=!0}function a(){e.start(lt?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function g(e){let t=f.current.floatingContext?.nodeId,n=p&&rr(p.nodesRef.current,t).some(t=>Ot(e,t.context?.elements.floating));return j(e)||n}function O(e){if(m(e)){e.type!==`click`&&!j(e)&&(t.clear(),C.current=!1),k();return}if(f.current.insideReactTree){k();return}let n=Et(e),r=`[${ar(`inert`)}]`,i=z(n)?n.getRootNode():null,a=Array.from((ee(i)?i:K(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Y(e,n))))return;let s=z(n)?n:null;for(;s&&!ue(s);){let e=fe(s);if(ue(e)||!z(e))break;s=e}if(!(a.length&&z(n)&&!kt(n)&&!Y(n,l.select(`floatingElement`))&&a.every(e=>!Y(s,e)))){if(B(n)&&!(`touches`in e)){let t=ue(n),r=H(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!g(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof h==`function`&&!h(e)||A(`__outsidePressBubbles`)||(l.setOpen(!1,J(Ce,e)),k())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||j(e)||O(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||j(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Et(e);if(!n)return;let r=X(n,e.type,()=>{t(e),r()})}function I(e){T.current=`touch`,F(e,P)}function L(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):O(e)})}function R(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!g(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),C.current=!0,k())}}}function te(e){if(c()!==`sloppy`||!E.current||j(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(O(e),D.clear(),E.current=null)}function ne(e){F(e,te)}function re(e){c()!==`sloppy`||!E.current||j(e)||(E.current.dismissOnTouchEnd&&O(e),D.clear(),E.current=null)}function ie(e){F(e,re)}let V=K(d),ae=Bt(r&&Bt(X(V,`keydown`,N),X(V,`compositionstart`,i),X(V,`compositionend`,a)),_&&Bt(X(V,`click`,L,!0),X(V,`pointerdown`,L,!0),X(V,`pointerup`,R,!0),X(V,`pointercancel`,R,!0),X(V,`mousedown`,L,!0),X(V,`mouseup`,R,!0),X(V,`touchstart`,I,!0),X(V,`touchmove`,ne,!0),X(V,`touchend`,ie,!0)));return()=>{ae(),e.clear(),t.clear(),s(),C.current=!1,k()}},[f,d,r,_,h,u,n,y,b,N,k,v,A,j,p,l,D]);let L=g.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),R=g.useMemo(()=>({onKeyDown:N,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,I]);return g.useMemo(()=>n?{reference:L,floating:R,trigger:L}:{},[n,L,R])}function Pr(e,t,n){let{reference:r,floating:i}=e,a=Q(t),o=ln(t),s=cn(o),c=Z(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=on(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Fr(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=an(t,e),p=xn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Sn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ir=50,Lr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Fr},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pr(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ir&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Pr(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Rr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=an(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Z(r),_=Q(o),v=Z(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yn(o)]:dn(o)),x=p!==`none`;!d&&x&&b.push(...vn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=un(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Q(t)||T.every(e=>Q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},zr=new Set([`left`,`top`]);async function Br(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Z(n),s=on(n),c=Q(n)===`y`,l=zr.has(o)?-1:1,u=a&&c?-1:1,d=an(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Vr=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Br(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Hr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=an(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Q(i),p=sn(f),m=u[p],h=u[f],g=(e,t)=>rn(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ur=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=an(e,t),u={x:n,y:r},d=Q(i),f=sn(d),p=u[f],m=u[d],h=an(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=zr.has(Z(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Wr=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=an(e,t),c=await i.detectOverflow(t,s),l=Z(n),u=on(n),d=Q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Zt(p-c[m],g),y=Zt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Qt(c.left,c.right):S=p-2*Qt(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Gr(e){let t=H(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$t(n)!==a||$t(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Kr(e){return z(e)?e:e.contextElement}function qr(e){let t=Kr(e);if(!B(t))return tn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gr(t),o=(a?$t(n.width):n.width)/r,s=(a?$t(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jr=tn(0);function Yr(e){let t=I(e);return!le()||!t.visualViewport?Jr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xr(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===I(e)}function Zr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Kr(e),o=tn(1);t&&(r?z(r)&&(o=qr(r)):o=qr(e));let s=Xr(a,n,r)?Yr(a):tn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=I(a),t=z(r)?I(r):r,n=e,i=me(n);for(;i&&t!==n;){let e=qr(i),t=i.getBoundingClientRect(),r=H(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=I(i),i=me(n)}}return Sn({width:u,height:d,x:c,y:l})}function Qr(e,t){let n=de(e).scrollLeft;return t?t.left+n:Zr(L(e)).left+n}function $r(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qr(e,n),y:n.top+t.scrollTop}}function ei(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=L(r),s=t?re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=tn(1),u=tn(0),d=B(r);if((d||!a)&&((F(r)!==`body`||te(o))&&(c=de(r)),d)){let e=Zr(r);l=qr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$r(o,c):tn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ti(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ni(e){let t=de(e),n=e.ownerDocument.body,r=Qt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Qr(e),o=-t.scrollTop;return H(n).direction===`rtl`&&(a+=Qt(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ri=25;function ii(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=I(e),a=L(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!le()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Qr(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ri&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ai(e,t){let n=Zr(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qr(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function oi(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ii(e,n,t);else if(t===`document`)r=ni(L(e));else if(z(t))r=ai(t,n);else{let n=Yr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Sn(r)}function si(e,t){let n=t.get(e);if(n)return n;let r=U(e,[],!1).filter(e=>z(e)&&F(e)!==`body`),i=null,a=H(e).position===`fixed`,o=a?fe(e):e;for(;z(o)&&!ue(o);){let e=H(o),t=se(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=fe(o)}return t.set(e,r),r}function ci(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?re(t)?[]:si(t,this._c):[].concat(n),r],o=oi(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=oi(t,a[e],i);s=Qt(n.top,s),c=Zt(n.right,c),l=Zt(n.bottom,l),u=Qt(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function li(e){let{width:t,height:n}=Gr(e);return{width:t,height:n}}function ui(e,t,n){let r=B(t),i=L(t),a=n===`fixed`,o=Zr(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=tn(0);if((r||!a)&&((F(t)!==`body`||te(i))&&(s=de(t)),r)){let e=Zr(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Qr(i));let l=i&&!r&&!a?$r(i,s):tn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function di(e){return H(e).position===`static`}function fi(e,t){if(!B(e)||H(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return L(e)===n&&(n=n.ownerDocument.body),n}function pi(e,t){let n=I(e);if(re(e))return n;if(!B(e)){let t=fe(e);for(;t&&!ue(t);){if(z(t)&&!di(t))return t;t=fe(t)}return n}let r=fi(e,t);for(;r&&ne(r)&&di(r);)r=fi(r,t);return r&&ue(r)&&di(r)&&!se(r)?n:r||ce(e)||n}var mi=async function(e){let t=this.getOffsetParent||pi,n=this.getDimensions,r=await n(e.floating);return{reference:ui(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hi(e){return H(e).direction===`rtl`}var gi={convertOffsetParentRelativeRectToViewportRelativeRect:ei,getDocumentElement:L,getClippingRect:ci,getOffsetParent:pi,getElementRects:mi,getClientRects:ti,getDimensions:li,getScale:qr,isElement:z,isRTL:hi};function _i(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vi(e,t,n){let r=null,i,a=L(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=en(d),h=en(a.clientWidth-(u+f)),g=en(a.clientHeight-(d+p)),_=en(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Qt(0,Zt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_i(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=I(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yi(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Kr(e),u=i||a?[...l?U(l):[],...t?U(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vi(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zr(e):null;c&&g();function g(){let t=Zr(e);h&&!_i(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bi=Vr,xi=Hr,Si=Rr,Ci=Wr,wi=Ur,Ti=(e,t,n)=>{let r=new Map,i=n??{},a={...gi,...i.platform,_c:r};return Lr(e,t,{...i,platform:a})},Ei=typeof document<`u`?g.useLayoutEffect:function(){};function Di(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Di(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Di(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Oi(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ki(e,t){let n=Oi(e);return Math.round(t*n)/n}function Ai(e){let t=g.useRef(e);return Ei(()=>{t.current=e}),t}function ji(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);Di(f,r)||p(r);let[m,h]=g.useState(null),[_,v]=g.useState(null),y=g.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=g.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||_,C=g.useRef(null),w=g.useRef(null),T=g.useRef(u),E=c!=null,D=Ai(c),O=Ai(i),k=Ai(l),A=g.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Ti(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Di(T.current,t)&&(T.current=t,or.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ei(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=g.useRef(!1);Ei(()=>(j.current=!0,()=>{j.current=!1}),[]),Ei(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=g.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=g.useMemo(()=>({reference:x,floating:S}),[x,S]),P=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ki(N.floating,u.x),r=ki(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Oi(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Mi=(e,t)=>{let n=bi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ni=(e,t)=>{let n=xi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pi=(e,t)=>({fn:wi(e).fn,options:[e,t]}),Fi=(e,t)=>{let n=Si(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ii=(e,t)=>{let n=Ci(e);return{name:n.name,fn:n.fn,options:[e,t]}},Li=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(o(99,this.componentName,e,this.componentName));t.setOpen(!0,J(ze,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,J(ze))}},Ri=[],zi=void 0;function Bi(){return zi}function Vi(e){Ri.push(e)}function Hi(e){let t=(t,n)=>{let r=u(Wi).current,i;try{zi=r;for(let e of Ri)e.before(r);i=e(t,n);for(let e of Ri)e.after(r);r.didInitialize=!0}finally{zi=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ui(e){return g.forwardRef(Hi(e))}function Wi(){return{didInitialize:!1}}var Gi=a(19)?Ji:Yi;function Ki(e,t,n,r,i){return Gi(e,t,n,r,i)}function qi(e,t,n,r,i){let a=g.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,v.useSyncExternalStore)(e.subscribe,a,a)}Vi({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,v.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ji(e,t,n,r,i){let a=Bi();if(!a)return qi(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Yi(e,t,n,r,i){return(0,y.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Xi=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Ki(this,e,t,n,r)}},Zi=class extends Xi{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){g.useDebugValue(e);let n=this;G(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;G(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;G(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){g.useDebugValue(e);let n=this,r=t!==void 0;G(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return g.useDebugValue(e),Ki(this,this.selectors[e],t,n,r)}useContextCallback(e,t){g.useDebugValue(e);let n=W(t??c);this.context[e]=n}useStateSetter(e){let t=g.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Qi={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},$i=class extends Zi{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:xr(),nested:n,triggerElements:i},Qi),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&vt(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function ea(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=g.useRef(null);r===void 0&&f.current===null&&(f.current=new $i({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),G(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};z(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function ta(e,t=!1,n=!1){let[r,i]=g.useState(e&&t?`idle`:void 0),[a,o]=g.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),G(()=>{if(!e&&a&&r!==`ending`&&n){let e=Gt.request(()=>{i(`ending`)});return()=>{Gt.cancel(e)}}},[e,a,r,n]),G(()=>{if(!e||t)return;let n=Gt.request(()=>{i(void 0)});return()=>{Gt.cancel(n)}},[t,e]),G(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Gt.request(()=>{i(`idle`)});return()=>{Gt.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function na(e,t=!1){let n=Kt();return W((r,i=null)=>{n.cancel();let a=Ar(e);if(a==null)return;let o=a,s=()=>{or.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function ra(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=W(i),o=na(r,n);g.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var ia={tabIndex:-1,[yt]:``};function aa(e){return t=>t!==`touch`||e.current}function oa(e,t=!1){let n=Ke(),r=Tr()!=null,i=u(()=>e(n,r)).current;return ea({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function sa({handle:e,store:t}){return G(()=>e.attachStore(t),[e,t]),null}function ca(e,t){let n=g.useRef(null),r=g.useRef(null);return g.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function la(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function ua(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function da(e,t,n,r={}){let i=n.reason,a=i===q,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ua(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),la(i,t,n.trigger,c()),e.update(i)};a?or.flushSync(l):l()}function fa(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ca(e,n),o=W(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=g.useCallback(e=>{a(e),e&&o(e)},[a,o]);return G(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function pa(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=g.useRef(null),i=e.useState(`open`);G(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=J(be);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function ma(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ta(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=W(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return ra({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ha(e,t){e.useSyncedValues(t),G(()=>()=>{e.update({activeTriggerProps:s,inactiveTriggerProps:s,popupProps:s})},[e])}function ga(e,t){G(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),G(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var _a=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function va(){return new $i({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new _a,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ya(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:va(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:s,inactiveTriggerProps:s,popupProps:s}}function ba(e,t,n=!1){return new $i({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var xa=e=>e.triggerIdProp??e.activeTriggerId,Sa=e=>e.openProp??e.open,Ca=e=>(e.popupElement?.id??e.floatingId)||void 0;function wa(e,t){return t!==void 0&&Sa(e)&&xa(e)===t}function Ta(e,t){return wa(e,t)?!0:t!==void 0&&Sa(e)&&xa(e)==null&&e.triggerCount===1}var Ea={open:Sa,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:xa,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ca,isTriggerActive:(e,t)=>t!==void 0&&xa(e)===t,isOpenedByTrigger:(e,t)=>wa(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&xa(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ta(e,t)?Ca(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Da(e){let t=g.useCallback(t=>e===void 0?c:e.subscribeStore(t),[e]),n=g.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,v.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Oa(e){return ka(e,e.rootContext)}function ka(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=g.useState(null),[d,f]=g.useState(void 0),[p,m]=g.useState(void 0),h=g.useRef(null),_=Er(r),v=g.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=ji({...e,elements:{...v,...l&&{reference:l}}}),b=z(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=g.useCallback(e=>{let t=z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=g.useCallback(e=>{(z(e)||e===null)&&(h.current=e,f(e)),(z(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!z(e))&&y.refs.setReference(e)},[y.refs,f]),w=g.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=g.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=g.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=g.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return G(()=>{o&&(h.current=o)},[o]),G(()=>{t.context.dataRef.current.floatingContext=D;let e=_?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),g.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var Aa=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Xe,this.restTimeout=new Xe,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ja=new WeakMap;function Ma(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ja.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ja.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Na(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ja.get(n);a&&a!==e&&Ma(a),Ma(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ja.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Pa(e){let t=e.context.dataRef.current,n=u(()=>t.hoverInteractionState??Aa.create()).current;return t.hoverInteractionState||=n,Je(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Fa(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Er(),d=Tr(),f=Pa(a),p=Ze(),m=W(()=>Rt(l.current.openEvent?.type,f.interactedInside)),h=W(()=>zt(l.current.openEvent?.type)),_=W(()=>{Ma(f)});G(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,_())},[o,f,_]),g.useEffect(()=>_,[_]),G(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&z(c)&&s){let e=c,t=s,n=K(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return Na(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{_()}}},[n,o,c,s,f,h,u,d,_]),g.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&rr(u.nodesRef.current,d).length>0)}function t(e){let t=It(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,J(q,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Et(e);if(!jt(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),_()}function g(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Dt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&z(o)&&rr(u.nodesRef.current,r,!1).some(e=>Y(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}_(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,J(q,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Bt(y&&X(y,`mouseenter`,c),y&&X(y,`mouseleave`,g),y&&X(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,_,f,u,d,p])}var Ia={current:null};function La(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Ia,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:_,events:v}=h.context,y=Er(l),b=Pa(h),x=g.useRef(!1),S=Vt(i),C=Vt(r),w=Vt(o),T=Vt(n),E=Vt(p),D=Vt(f),O=W(()=>Rt(_.current.openEvent?.type,b.interactedInside)),k=W(()=>E.current?.()!==!1),A=W((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Y(e,t);if(!z(n))return!1;let i=n;return r.hasMatchingElement(e=>Y(e,i))&&(!e||!Y(e,i))}),j=W(()=>{b.handler&&=(K(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=W(()=>{Ma(b)});return u&&(b.handleCloseOptions=S.current?.__options),g.useEffect(()=>j,[j]),g.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===q,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,j]),g.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=It(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,J(q,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,J(q,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!z(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!_t(b.pointerType))return;let t=Lt(w.current),n=It(C.current,`open`,b.pointerType),r=Et(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(z(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Y(e,r)){s=e;break}}z(i)&&z(o)&&!h.context.triggerElements.hasElement(i)&&Y(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&z(s)&&z(o)&&Y(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,J(q,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,J(q,e,s))}):g&&k()&&h.setOpen(!0,J(q,e,s)))}function i(t){if(O()){M();return}j();let n=K(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=_.current.floatingContext??d?.();if(!Dt(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!Y(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Y(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?X(t,`mouseout`,o):void 0;return s?Bt(X(t,`mousemove`,r,{once:!0}),X(t,`mouseenter`,r),X(t,`mouseleave`,i),l):Bt(X(t,`mouseenter`,r),X(t,`mouseleave`,i),l)},[j,M,_,C,h,n,S,b,u,A,O,a,s,w,c,y,T,d,D,k,m]),g.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!_t(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Na(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Lt(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=h.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,J(q,t,n))}b.pointerType===`touch`?or.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var Ra=.1,za=Ra*Ra,$=.5;function Ba(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Va(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ba(e,t,n,r,i,a)&&(u=!u),Ba(e,t,i,a,o,s)&&(u=!u),Ba(e,t,o,s,c,l)&&(u=!u),Ba(e,t,c,l,n,r)&&(u=!u),u}function Ha(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ua(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Wa(e={}){let{blockPointerEvents:t=!1}=e,n=new Xe,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*za;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Et(r),g=r.type===`mouseleave`,_=Y(u,h),v=Y(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&z(r.relatedTarget)&&Y(u,r.relatedTarget))return;function y(){return!!(s&&rr(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Ua(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Ua(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Ua(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Ua(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Ha(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+$+1,o=C||T?S.bottom-$:S.top,s=C?T?S.bottom-$:S.top:S.bottom-$;M=Va(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-$,o=C||T?S.top+$:S.bottom,s=C?T?S.top+$:S.bottom:S.top+$;M=Va(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+$+1,o=w||E?S.right-$:S.left,s=w?E?S.right-$:S.left:S.right-$;M=Va(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-$,o=w||E?S.left+$:S.right,s=w?E?S.left+$:S.right:S.left+$;M=Va(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Ga(e){return a(19)?e:e?`true`:void 0}var Ka=class extends Zi{setState(e){}update(e){}set(e,t){}notifyAll(){}},qa=g.createContext(void 0);function Ja(){return g.useContext(qa)?.direction??`ltr`}var Ya=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=an(e,t)||{};if(l==null)return{};let f=xn(u),p={x:n,y:r},m=ln(i),h=cn(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=rn(k,j,A),N=!c.arrow&&on(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Xa=(e,t)=>({...Ya(e),options:[e,t]}),Za={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Qa={sideX:`left`,sideY:`top`},$a=`--available-width`,eo=`--available-height`;function to(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function no(e,t,n){let{rects:r,placement:i}=e;return{side:to(t,Z(i),n),align:on(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ro(e){return io(e,Oa)}function io(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=g.useState(null);!_&&w!==null&&T(null);let E=v.side||`flip`,D=v.align||`flip`,O=v.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=W(j),N=j?M:n,P=Vt(n),F=Vt(_),L=Ja()===`rtl`,R=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":L?`left`:`right`,"inline-start":L?`right`:`left`}[i],z=o===`center`?R:`${R}-${o}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let ee=+(i===`bottom`),te=+(i===`top`),ne=+(i===`right`),re=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},V=g.useRef(null),ae=Vt(a),oe=Vt(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(Mi(e=>{let t=no(e,i,L),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,L,i]));let ue=D===`none`&&E!==`shift`,H=!ue&&(u||k||E===`shift`),de=E===`none`?null:Fi({...ie,padding:{top:B.top+1+ee,right:B.right+1+re,bottom:B.bottom+1+te,left:B.left+1+ne},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),fe=ue?null:Ni({...ie,rootBoundary:A,mainAxis:D!==`none`,crossAxis:H,limiter:u||k?void 0:Pi(e=>{if(!V.current)return{};let{width:t,height:n}=V.current.getBoundingClientRect(),r=Q(Z(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[ie,u,k,A,B,D]);E===`shift`||D===`shift`||o===`center`?le.push(fe,de):le.push(de,fe),le.push(Ii({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty($a,`${t}px`),i.setProperty(eo,`${n}px`);let a=I(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Xa(e=>({element:V.current||K(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Z(r),l=Q(c),u=V.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(no(e,i,L)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,H&&l===`y`&&b?S:x),{}}},Za,x),G(()=>{!_&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,h]);let pe=g.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:U,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:q}=t({rootContext:h,open:m?_:void 0,placement:z,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>yi(...e,pe),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=_e.adaptiveOrigin||Qa,we=xe?r:`fixed`,Te=g.useMemo(()=>{let e;return e=xe?x?{position:we,[Se]:he,[Ce]:ge}:{...q,position:we}:{position:we,top:0,left:0},e[$a]=`100vw`,e[eo]=`100vh`,xe||(e.opacity=0),e},[x,we,Se,he,Ce,ge,q,xe]),Ee=g.useRef(null);G(()=>{if(!_)return;let e=P.current,t=typeof e==`function`?e():e,n=(ao(t)?t.current:t)||null;n!==Ee.current&&(U.setPositionReference(n),Ee.current=n)},[_,U,N,P]),g.useEffect(()=>{if(!_)return;let e=P.current;typeof e!=`function`&&ao(e)&&e.current!==Ee.current&&(U.setPositionReference(e.current),Ee.current=e.current)},[_,U,N,P]),g.useEffect(()=>{if(m&&_&&me.reference&&me.floating)return yi(me.reference,me.floating,ve,pe)},[m,_,me,ve,pe]);let De=Z(ye),Oe=to(i,De,L),ke=on(ye)||`center`,Ae=!!_e.hide?.referenceHidden;G(()=>{S&&_&&xe&&De!==R&&T(De)},[S,_,xe,De,R]);let je=g.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Me=_e.arrow?.centerOffset!==0;return g.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:V,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:U,context:be,isPositioned:xe,update:ve}),[Te,je,V,Me,Oe,ke,De,Ae,U,be,xe,ve])}function ao(e){return e!=null&&`current`in e}function oo(e){return e===`starting`?sr:s}function so(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),l(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},oo(r),i],stateAttributesMapping:M})}function co(e){let[t,n]=g.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function lo(e){let t=H(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return($t(n)!==a||$t(r)!==o)&&(n=a,r=o),{width:n,height:r}}function uo(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,onMeasureLayout:a,onMeasureLayoutComplete:o,side:s,direction:l}=e,u=na(t,!0),d=Kt(),f=g.useRef(null),p=g.useRef(!0),m=g.useRef(c),h=W(a),_=W(o),v=g.useMemo(()=>fo(s,l),[s,l]);G(()=>{if(!i){m.current=c,p.current=!0,f.current=null;return}if(!t||!n)return;m.current=mo(t,v),ho(t,`auto`);let e=po(t,`position`,`static`),r=po(t,`transform`,`none`),a=po(t,`scale`,`1`),o=mo(n,{"--available-width":`max-content`,"--available-height":`max-content`});function s(){e(),r(),o()}function l(){s(),a()}if(h?.(),p.current||f.current===null){go(n,`max-content`);let e=lo(t);return f.current=e,go(n,e),l(),_?.(null,e),p.current=!1,()=>{m.current(),m.current=c}}go(n,`max-content`);let g=f.current,y=lo(t);f.current=y,ho(t,g),l(),_?.(g,y),go(n,y);let b=new AbortController;return d.request(()=>{ho(t,y),u(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},b.signal)}),()=>{b.abort(),d.cancel(),m.current(),m.current=c}},[r,t,n,u,d,i,h,_,v])}function fo(e,t){let n=e===`top`,r=e===`left`||e===(t===`rtl`?`inline-end`:`inline-start`);return!n&&!r?s:{position:`absolute`,[n?`bottom`:`top`]:`0`,[r?`right`:`left`]:`0`}}function po(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function mo(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(po(e,r,i));return n.length?()=>{n.forEach(e=>e())}:c}function ho(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function go(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var _o={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=I(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:Qa};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=K(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Z(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Qa.sideX,g=f===`top`?`bottom`:Qa.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}},vo={activationDirection:e=>e?{"data-activation-direction":e}:null};function yo(e){let{store:t,side:n,children:r}=e,i=Ja(),a=t.useState(`activeTriggerElement`),o=t.useState(`activeTriggerId`),s=t.useState(`open`),c=t.useState(`payload`),l=t.useState(`mounted`),u=t.useState(`popupElement`),d=t.useState(`positionerElement`),f=co(s?a:null),p=Co(o,c),m=g.useRef(null),[h,v]=g.useState(null),[y,b]=g.useState(null),x=g.useRef(null),S=g.useRef(null),C=na(x,!0),w=Kt(),T=g.useRef(null),[E,D]=g.useState(null),[O,k]=g.useState(!1);G(()=>(t.set(`adaptiveOrigin`,_o),()=>{t.set(`adaptiveOrigin`,void 0)}),[t]);let A=W(()=>{x.current?.style.setProperty(`animation`,`none`),x.current?.style.setProperty(`transition`,`none`),S.current?.style.setProperty(`display`,`none`)}),j=W(e=>{x.current?.style.removeProperty(`animation`),x.current?.style.removeProperty(`transition`),S.current?.style.removeProperty(`display`),e&&D(e)}),M=W(()=>{T.current?.abort();let e=new AbortController;T.current=e,C(()=>{v(null),D(null),m.current=null},e.signal)}),N=g.useRef(null);G(()=>{(!s||!l)&&(N.current=null)},[s,l]),G(()=>{if(a&&f&&a!==f&&N.current!==a&&m.current){v(m.current),k(!0);let e=So(f,a);b(e),N.current=a}},[a,f]),G(()=>{h!=null&&(T.current?.abort(),k(!0),w.request(()=>{or.flushSync(()=>{k(!1)}),M()}))},[p,h,M,w]),G(()=>{let e=x.current;if(!e)return;let t=K(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));m.current=t});let P=h!=null,F;F=P?(0,_.jsxs)(g.Fragment,{children:[(0,_.jsx)(`div`,{"data-previous":!0,inert:Ga(!0),ref:S,style:{...E?{"--popup-width":`${E.width}px`,"--popup-height":`${E.height}px`}:null,position:`absolute`},"data-ending-style":O?void 0:``},`previous`),(0,_.jsx)(`div`,{"data-current":!0,ref:x,"data-starting-style":O?``:void 0,children:r},p)]}):(0,_.jsx)(`div`,{"data-current":!0,ref:x,children:r},p),G(()=>{let e=S.current;!e||!h||e.replaceChildren(...Array.from(h.childNodes))},[h]),uo({popupElement:u,positionerElement:d,mounted:l,content:c,onMeasureLayout:A,onMeasureLayoutComplete:j,side:n,direction:i});let I={activationDirection:bo(y),transitioning:P};return{children:F,state:I}}function bo(e){if(e)return`${xo(e.horizontal,5,`right`,`left`)} ${xo(e.vertical,5,`down`,`up`)}`}function xo(e,t,n,r){return e>t?n:e<-t?r:``}function So(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function Co(e,t){let[n,r]=g.useState(0),i=g.useRef(e),a=g.useRef(t),o=g.useRef(!1);return G(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}export{_r as $,it as $t,fa as A,Ve as An,Bt as At,Ui as B,B as Bn,Et as Bt,aa as C,Ce as Cn,Sn as Ct,ha as D,Se as Dn,Gt as Dt,ma as E,Be as En,Yt as Et,$i as F,F as Fn,Mt as Ft,Or as G,M as Gn,_t as Gt,gi as H,te as Hn,xt as Ht,Zi as I,U as In,At as It,Tr as J,A as Jn,pt as Jt,kr as K,N as Kn,ht as Kt,Xi as L,fe as Ln,Nt as Lt,na as M,G as Mn,It as Mt,ta as N,W as Nn,Pt as Nt,oa as O,q as On,Kt as Ot,ea as P,H as Pn,Dt as Pt,yr as Q,p as Qn,ot as Qt,Ki as R,I as Rn,Tt as Rt,ua as S,be as Sn,kn as St,pa as T,Le as Tn,Jt as Tt,Nr as U,ee as Un,St as Ut,Li as V,ue as Vn,wt as Vt,Ar as W,w as Wn,Ct as Wt,Sr as X,C as Xn,ut as Xt,Er as Y,b as Yn,ft as Yt,br as Z,h as Zn,lt as Zt,Ea as _,Oe as _n,On as _t,oo as a,Ke as an,ar as at,sa as b,Pe as bn,jn as bt,Ka as c,Ie as cn,Kn as ct,La as d,Me as dn,Qn as dt,st as en,dr as et,Fa as f,Re as fn,$n as ft,ba as g,De as gn,Dn as gt,ya as h,ze as hn,qn as ht,so as i,qe as in,mr as it,ra as j,K as jn,X as jt,ga as k,xe as kn,Vt as kt,Ga as l,Ee as ln,Yn as lt,Da as m,Ae as mn,Gn as mt,yo as n,Ze as nn,pr as nt,ro as o,J as on,ir as ot,Pa as p,je as pn,er as pt,Dr as q,j as qn,gt as qt,co as r,Je as rn,fr as rt,Ja as s,He as sn,rr as st,vo as t,Xe as tn,cr as tt,Wa as u,Te as un,Xn as ut,_a as v,ke as vn,En as vt,la as w,Fe as wn,Xt as wt,da as x,Ne as xn,wn as xt,ia as y,we as yn,Tn as yt,Hi as z,z as zn,Y as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{It as n}from"./composerDraftStore-CdJJZe42.js";import{$ as r,$t as i,At as a,Bn as o,Bt as s,Dt as c,Fn as l,Ft as u,Hn as d,It as ee,Jt as te,Kt as ne,Mn as f,Nn as p,Nt as m,Ot as re,Rn as h,Rt as g,Un as _,W as v,Y as ie,Zt as ae,at as oe,bt as se,ct as y,ht as ce,jn as b,jt as x,kt as S,lt as le,mn as ue,mt as de,nn as fe,on as pe,ot as me,pt as he,qt as ge,st as _e,tn as ve,ut as ye,wt as be,zt as C}from"./usePopupViewport-BuhsNdVy.js";import{l as xe,s as w}from"./useRenderElement-DchFnsR8.js";var T=e(t(),1),E=0;function Se(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(E);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),w;let o=requestAnimationFrame(a);return E=o,()=>{E===o&&(cancelAnimationFrame(o),E=0)}}var D={inert:new WeakMap,"aria-hidden":new WeakMap},Ce=`data-base-ui-inert`,O={inert:new WeakSet,"aria-hidden":new WeakSet},k=new WeakMap,A=0;function j(e){return O[e]}function M(e){return e?_(e)?e.host:M(e.parentNode):null}var N=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=M(t);return e.contains(n)?n:null}).filter(e=>e!=null),P=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},F=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{l(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function we(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=N(t,e),l=i?F(t,P(c),new Set(c)):[],u=[],d=[];if(a){let e=D[a],n=j(a);s=n,o=e;let r=N(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);F(t,P(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(k.get(e)||0)+1;k.set(e,t),d.push(e),t===1&&e.setAttribute(Ce,``)}),A+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(k.get(e)||0)-1;k.set(e,t),t||e.removeAttribute(Ce)}),--A,A||(D.inert=new WeakMap,D[`aria-hidden`]=new WeakMap,O.inert=new WeakSet,O[`aria-hidden`]=new WeakSet,k=new WeakMap)}}function Te(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=b(e[0]).body;return we(e,a,n,r,{mark:i})}var I=n();function Ee(e,t){let n=h(s(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var L=20,R=[];function De(){R=R.filter(e=>e.deref()?.isConnected)}function Oe(e){De(),e&&l(e)!==`body`&&(R.push(new WeakRef(e)),R.length>L&&(R=R.slice(-20)))}function ke(){return De(),R[R.length-1]?.deref()}function Ae(e){return e?de(e)?e:ce(e)[0]||e:null}function je(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=y(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return de(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Me(e){let{context:t,children:n,disabled:i=!1,initialFocus:c=!0,returnFocus:d=!0,restoreFocus:h=!1,modal:_=!0,closeOnFocusOut:y=!0,openInteractionType:ve=``,nextFocusableElement:w,previousFocusableElement:E,beforeContentFocusGuardRef:D,externalTree:Ce,getInsideElements:O}=e,k=`rootStore`in t?t.rootStore:t,A=k.useState(`open`),j=k.useState(`domReferenceElement`),M=k.useState(`floatingElement`),{events:N,dataRef:P}=k.context,F=p(()=>P.current.floatingContext?.nodeId),we=c===!1,L=u(j)&&we,R=S(c),Me=S(d),z=S(ve),Ne=S(A),B=ie(Ce),V=r(),H=T.useRef(!1),U=T.useRef(!1),W=T.useRef(!1),Pe=T.useRef(null),Fe=T.useRef(``),G=T.useRef(``),Ie=T.useRef(null),K=T.useRef(null),q=xe(Ie,D,V?.beforeInsideRef),Le=xe(K,V?.afterInsideRef),J=fe(),Y=fe(),Re=re(),X=V!=null,Z=m(M),Q=p((e=Z)=>e?ce(e):[]),$=p(()=>O?.().filter(e=>e!=null)??[]);T.useEffect(()=>{if(i||!_)return;function e(e){e.key===`Tab`&&C(Z,g(b(Z)))&&Q().length===0&&!L&&te(e)}let t=b(Z);return x(t,`keydown`,e)},[i,Z,_,L,Q]),T.useEffect(()=>{if(i||!A)return;let e=b(Z);function t(){W.current=!1}function n(e){let t=s(e),n=$(),r=C(M,t)||C(j,t)||C(V?.portalNode,t)||n.some(e=>e===t||C(e,t));W.current=!r,G.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(U.current=!0,Y.start(0,()=>{U.current=!1}))}function r(){G.current=`keyboard`}return a(x(e,`pointerdown`,n,!0),x(e,`pointerup`,t,!0),x(e,`pointercancel`,t,!0),x(e,`keydown`,r,!0),t)},[i,M,j,Z,A,V,Y,$]),T.useEffect(()=>{if(i||!y)return;let e=b(Z);function t(){U.current=!0,Y.start(0,()=>{U.current=!1})}function n(e){let t=s(e);de(t)&&(Pe.current=t)}function r(t){let n=t.relatedTarget,r=t.currentTarget,i=s(t);_&&n==null&&i!=null&&C(M,i)&&Oe(i),queueMicrotask(()=>{let a=F(),s=k.context.triggerElements,c=$(),l=n?.hasAttribute(oe(`focus-guard`))&&[Ie.current,K.current,V?.beforeInsideRef.current,V?.afterInsideRef.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,v(E),v(w)].includes(n),u=!(C(j,n)||C(M,n)||C(n,M)||C(V?.portalNode,n)||c.some(e=>e===n||C(e,n))||s.hasMatchingElement(e=>C(e,n))||l||B&&(_e(B.nodesRef.current,a).find(e=>C(e.context?.elements.floating,n)||C(e.context?.elements.domReference,n))||me(B.nodesRef.current,a).find(e=>[e.context?.elements.floating,m(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===j&&Z&&je(Z),h&&r!==j&&!se(i)&&g(e)===e.body){if(o(Z)&&(Z.focus(),h===`popup`)){Re.request(()=>{Z.focus()});return}let e=Q(),t=Pe.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||Z;o(n)&&n.focus()}if(P.current.insideReactTree){P.current.insideReactTree=!1;return}(L||!_)&&n&&u&&!U.current&&(L||n!==ke())&&(H.current=!0,k.setOpen(!1,pe(ue,t)))})}function c(){W.current||(P.current.insideReactTree=!0,J.start(0,()=>{P.current.insideReactTree=!1}))}let l=o(j)?j:null;if(!(!M&&!l))return a(l&&x(l,`focusout`,r),l&&x(l,`pointerdown`,t),M&&x(M,`focusin`,n),M&&x(M,`focusout`,r),M&&V&&x(M,`focusout`,c,!0))},[i,j,M,Z,_,B,V,k,y,h,Q,L,F,P,J,Y,Re,w,E,$]),T.useEffect(()=>{if(i||!M||!A)return;let e=Array.from(V?.portalNode?.querySelectorAll(`[${oe(`portal`)}]`)||[]),t=(B?me(B.nodesRef.current,F()):[]).find(e=>u(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Te([M,...e,Ie.current,K.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,...$(),t,v(E),v(w),L?j:null].filter(e=>e!=null),{ariaHidden:_||L,mark:!1}),r=Te([M,...e].filter(e=>e!=null));return()=>{r(),n()}},[A,i,j,M,_,V,L,B,F,w,E,$]),f(()=>{if(!A||i||!o(Z))return;Fe.current=``,G.current=``;let e=b(Z),t=g(e);queueMicrotask(()=>{let n=R.current,r=typeof n==`function`?n(z.current||``):n;if(r===void 0||r===!1||C(Z,t))return;let i=null,a=()=>(i??=Q(Z),i[0]||Z),o;o=r===!0||r===null?a():v(r),o||=a();let s=C(Z,g(e));Se(o,{preventScroll:o===Z,shouldFocus(){if(!Ne.current)return!1;if(s)return!0;let t=g(e);return!(t!==o&&C(Z,t))}})})},[i,A,Z,Q,R,z,Ne]),f(()=>{if(i||!Z)return;let e=b(Z),t=g(e),n=z.current==null;Oe(t);function r(e){if(e.open||(Fe.current=Ee(e.nativeEvent,G.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(H.current=!0),e.reason===`outside-press`){if(e.nested)H.current=!1;else if(ne(e.nativeEvent)||ge(e.nativeEvent))H.current=!1;else{let e=!1;b(Z).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?H.current=!1:H.current=!0}}}N.on(`openchange`,r);function a(e){let r=Me.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=j?.isConnected?j:null,o=t?.isConnected&&l(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ke()||null,typeof i==`boolean`?s:v(i)||s||null}return()=>{N.off(`openchange`,r);let t=g(e),n=$(),i=C(M,t)||n.some(e=>e===t||C(e,t))||B&&_e(B.nodesRef.current,F(),!1).some(e=>C(e.context?.elements.floating,t)),s=Me.current,c=Fe.current,l=a(c);queueMicrotask(()=>{let n=Ae(l),r=typeof s!=`boolean`;if(s&&!H.current&&o(n)&&(!(!r&&n!==t&&t!==e.body)||i)){let e={preventScroll:!0};c===`keyboard`&&(e.focusVisible=!0),n.focus(e)}H.current=!1})}},[i,M,Z,Me,z,N,B,j,F,$]),f(()=>{if(!ae||A||!M)return;let e=g(b(M));!o(e)||!ee(e)||C(M,e)&&e.blur()},[A,M]),f(()=>{if(!(i||!V))return V.setFocusManagerState({modal:_,closeOnFocusOut:y,open:A,onOpenChange:k.setOpen,domReference:j}),()=>{V.setFocusManagerState(null)}},[i,V,_,A,k,y,j]),f(()=>{if(!(i||!Z))return je(Z),()=>{queueMicrotask(De)}},[i,Z]);let ze=!i&&(!_||!L)&&(X||_);return(0,I.jsxs)(T.Fragment,{children:[ze&&(0,I.jsx)(be,{"data-type":`inside`,ref:q,onFocus:e=>{if(_){let e=Q();Se(e[e.length-1])}else V?.portalNode&&(H.current=!1,he(e,V.portalNode)?le(j)?.focus():v(E??V.beforeOutsideRef)?.focus())}}),n,ze&&(0,I.jsx)(be,{"data-type":`inside`,ref:Le,onFocus:e=>{_?Se(Q()[0]):V?.portalNode&&(y&&(H.current=!0),he(e,V.portalNode)?ye(j)?.focus():v(w??V.afterOutsideRef)?.focus())}})]})}var z=`ArrowUp`,Ne=`ArrowDown`,B=`ArrowLeft`,V=`ArrowRight`,H=`Home`,U=new Set([z,Ne,B,V,H,`End`]),W=`Shift`,Pe=[W,`Control`,`Alt`,`Meta`];function Fe(e){return o(e)&&e.tagName===`INPUT`}function G(e){return!!(Fe(e)&&e.selectionStart!=null||o(e)&&e.tagName===`TEXTAREA`)}function Ie(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=K(e,t,`left`),a=q(e),o=q(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=K(e,t,`top`),r=q(e),i=q(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function K(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function q(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Le=T.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,I.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),J={},Y={},Re=``;function X(e,t){return d(e)?e:t}function Z(e,t,n){return/hidden|clip/.test(e.getComputedStyle(X(t,n)).overflowY)}function Q(e){if(typeof document>`u`)return!1;let t=b(e);return h(t).innerWidth-t.documentElement.clientWidth>0}function $(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=b(e),n=t.documentElement,r=t.body,i=X(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ze(e){let t=b(e),n=t.documentElement,r=t.body,i=X(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Be(e){let t=b(e),n=t.documentElement,r=t.body,i=h(n),a=0,o=0,s=!1,l=c.create();if(ae&&(i.visualViewport?.scale??1)!==1)return()=>{};function u(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,J={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Re=n.style.scrollBehavior,Y={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,ee=t.overflowY===`scroll`||c.overflowY===`scroll`,te=t.overflowX===`scroll`||c.overflowX===`scroll`,ne=Math.max(0,i.innerWidth-r.clientWidth),f=Math.max(0,i.innerHeight-r.clientHeight),p=parseFloat(c.marginTop)+parseFloat(c.marginBottom),m=parseFloat(c.marginLeft)+parseFloat(c.marginRight),re=X(n,r);if(s=$(e),s){n.style.scrollbarGutter=l,re.style.overflowY=`hidden`,re.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||ee)&&(n.style.overflowY=`scroll`),(d||te)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:p||f?`calc(100dvh - ${p+f}px)`:`100dvh`,width:m||ne?`calc(100vw - ${m+ne}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function d(){Object.assign(n.style,J),Object.assign(r.style,Y),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Re)}function ee(){d(),l.request(u)}u();let te=x(i,`resize`,ee);return()=>{l.cancel(),d(),typeof i.removeEventListener==`function`&&te()}}var Ve=new class{lockCount=0;restore=null;timeoutLock=ve.create();timeoutUnlock=ve.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=b(e),n=t.documentElement,r=t.body,a=h(n);if(Z(a,n,r)){let t=new a.MutationObserver(()=>{Z(a,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),i={attributes:!0};t.observe(n,i),t.observe(r,i),this.restore=()=>t.disconnect();return}let o=i||!Q(e);this.restore=o?ze(e):Be(e)}};function He(e=!0,t=null){f(()=>{if(e)return Ve.acquire(t)},[e,t])}export{V as a,H as c,G as d,Ie as f,B as i,Pe as l,Se as m,Le as n,z as o,Me as p,Ne as r,U as s,He as t,W as u};
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{It as n}from"./composerDraftStore-DC2r8dcu.js";import{$ as r,$t as i,At as a,Bn as o,Bt as s,Dt as c,Fn as l,Ft as u,Hn as d,It as ee,Jt as te,Kt as ne,Mn as f,Nn as p,Nt as m,Ot as re,Rn as h,Rt as g,Un as _,W as v,Y as ie,Zt as ae,at as oe,bt as se,ct as y,ht as ce,jn as b,jt as x,kt as S,lt as le,mn as ue,mt as de,nn as fe,on as pe,ot as me,pt as he,qt as ge,st as _e,tn as ve,ut as ye,wt as be,zt as C}from"./usePopupViewport-CAMlnyaP.js";import{l as xe,s as w}from"./useRenderElement-DchFnsR8.js";var T=e(t(),1),E=0;function Se(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(E);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),w;let o=requestAnimationFrame(a);return E=o,()=>{E===o&&(cancelAnimationFrame(o),E=0)}}var D={inert:new WeakMap,"aria-hidden":new WeakMap},Ce=`data-base-ui-inert`,O={inert:new WeakSet,"aria-hidden":new WeakSet},k=new WeakMap,A=0;function j(e){return O[e]}function M(e){return e?_(e)?e.host:M(e.parentNode):null}var N=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=M(t);return e.contains(n)?n:null}).filter(e=>e!=null),P=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},F=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{l(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function we(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=N(t,e),l=i?F(t,P(c),new Set(c)):[],u=[],d=[];if(a){let e=D[a],n=j(a);s=n,o=e;let r=N(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);F(t,P(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(k.get(e)||0)+1;k.set(e,t),d.push(e),t===1&&e.setAttribute(Ce,``)}),A+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(k.get(e)||0)-1;k.set(e,t),t||e.removeAttribute(Ce)}),--A,A||(D.inert=new WeakMap,D[`aria-hidden`]=new WeakMap,O.inert=new WeakSet,O[`aria-hidden`]=new WeakSet,k=new WeakMap)}}function Te(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=b(e[0]).body;return we(e,a,n,r,{mark:i})}var I=n();function Ee(e,t){let n=h(s(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var L=20,R=[];function De(){R=R.filter(e=>e.deref()?.isConnected)}function Oe(e){De(),e&&l(e)!==`body`&&(R.push(new WeakRef(e)),R.length>L&&(R=R.slice(-20)))}function ke(){return De(),R[R.length-1]?.deref()}function Ae(e){return e?de(e)?e:ce(e)[0]||e:null}function je(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=y(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return de(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Me(e){let{context:t,children:n,disabled:i=!1,initialFocus:c=!0,returnFocus:d=!0,restoreFocus:h=!1,modal:_=!0,closeOnFocusOut:y=!0,openInteractionType:ve=``,nextFocusableElement:w,previousFocusableElement:E,beforeContentFocusGuardRef:D,externalTree:Ce,getInsideElements:O}=e,k=`rootStore`in t?t.rootStore:t,A=k.useState(`open`),j=k.useState(`domReferenceElement`),M=k.useState(`floatingElement`),{events:N,dataRef:P}=k.context,F=p(()=>P.current.floatingContext?.nodeId),we=c===!1,L=u(j)&&we,R=S(c),Me=S(d),z=S(ve),Ne=S(A),B=ie(Ce),V=r(),H=T.useRef(!1),U=T.useRef(!1),W=T.useRef(!1),Pe=T.useRef(null),Fe=T.useRef(``),G=T.useRef(``),Ie=T.useRef(null),K=T.useRef(null),q=xe(Ie,D,V?.beforeInsideRef),Le=xe(K,V?.afterInsideRef),J=fe(),Y=fe(),Re=re(),X=V!=null,Z=m(M),Q=p((e=Z)=>e?ce(e):[]),$=p(()=>O?.().filter(e=>e!=null)??[]);T.useEffect(()=>{if(i||!_)return;function e(e){e.key===`Tab`&&C(Z,g(b(Z)))&&Q().length===0&&!L&&te(e)}let t=b(Z);return x(t,`keydown`,e)},[i,Z,_,L,Q]),T.useEffect(()=>{if(i||!A)return;let e=b(Z);function t(){W.current=!1}function n(e){let t=s(e),n=$(),r=C(M,t)||C(j,t)||C(V?.portalNode,t)||n.some(e=>e===t||C(e,t));W.current=!r,G.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(U.current=!0,Y.start(0,()=>{U.current=!1}))}function r(){G.current=`keyboard`}return a(x(e,`pointerdown`,n,!0),x(e,`pointerup`,t,!0),x(e,`pointercancel`,t,!0),x(e,`keydown`,r,!0),t)},[i,M,j,Z,A,V,Y,$]),T.useEffect(()=>{if(i||!y)return;let e=b(Z);function t(){U.current=!0,Y.start(0,()=>{U.current=!1})}function n(e){let t=s(e);de(t)&&(Pe.current=t)}function r(t){let n=t.relatedTarget,r=t.currentTarget,i=s(t);_&&n==null&&i!=null&&C(M,i)&&Oe(i),queueMicrotask(()=>{let a=F(),s=k.context.triggerElements,c=$(),l=n?.hasAttribute(oe(`focus-guard`))&&[Ie.current,K.current,V?.beforeInsideRef.current,V?.afterInsideRef.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,v(E),v(w)].includes(n),u=!(C(j,n)||C(M,n)||C(n,M)||C(V?.portalNode,n)||c.some(e=>e===n||C(e,n))||s.hasMatchingElement(e=>C(e,n))||l||B&&(_e(B.nodesRef.current,a).find(e=>C(e.context?.elements.floating,n)||C(e.context?.elements.domReference,n))||me(B.nodesRef.current,a).find(e=>[e.context?.elements.floating,m(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===j&&Z&&je(Z),h&&r!==j&&!se(i)&&g(e)===e.body){if(o(Z)&&(Z.focus(),h===`popup`)){Re.request(()=>{Z.focus()});return}let e=Q(),t=Pe.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||Z;o(n)&&n.focus()}if(P.current.insideReactTree){P.current.insideReactTree=!1;return}(L||!_)&&n&&u&&!U.current&&(L||n!==ke())&&(H.current=!0,k.setOpen(!1,pe(ue,t)))})}function c(){W.current||(P.current.insideReactTree=!0,J.start(0,()=>{P.current.insideReactTree=!1}))}let l=o(j)?j:null;if(!(!M&&!l))return a(l&&x(l,`focusout`,r),l&&x(l,`pointerdown`,t),M&&x(M,`focusin`,n),M&&x(M,`focusout`,r),M&&V&&x(M,`focusout`,c,!0))},[i,j,M,Z,_,B,V,k,y,h,Q,L,F,P,J,Y,Re,w,E,$]),T.useEffect(()=>{if(i||!M||!A)return;let e=Array.from(V?.portalNode?.querySelectorAll(`[${oe(`portal`)}]`)||[]),t=(B?me(B.nodesRef.current,F()):[]).find(e=>u(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Te([M,...e,Ie.current,K.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,...$(),t,v(E),v(w),L?j:null].filter(e=>e!=null),{ariaHidden:_||L,mark:!1}),r=Te([M,...e].filter(e=>e!=null));return()=>{r(),n()}},[A,i,j,M,_,V,L,B,F,w,E,$]),f(()=>{if(!A||i||!o(Z))return;Fe.current=``,G.current=``;let e=b(Z),t=g(e);queueMicrotask(()=>{let n=R.current,r=typeof n==`function`?n(z.current||``):n;if(r===void 0||r===!1||C(Z,t))return;let i=null,a=()=>(i??=Q(Z),i[0]||Z),o;o=r===!0||r===null?a():v(r),o||=a();let s=C(Z,g(e));Se(o,{preventScroll:o===Z,shouldFocus(){if(!Ne.current)return!1;if(s)return!0;let t=g(e);return!(t!==o&&C(Z,t))}})})},[i,A,Z,Q,R,z,Ne]),f(()=>{if(i||!Z)return;let e=b(Z),t=g(e),n=z.current==null;Oe(t);function r(e){if(e.open||(Fe.current=Ee(e.nativeEvent,G.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(H.current=!0),e.reason===`outside-press`){if(e.nested)H.current=!1;else if(ne(e.nativeEvent)||ge(e.nativeEvent))H.current=!1;else{let e=!1;b(Z).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?H.current=!1:H.current=!0}}}N.on(`openchange`,r);function a(e){let r=Me.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=j?.isConnected?j:null,o=t?.isConnected&&l(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ke()||null,typeof i==`boolean`?s:v(i)||s||null}return()=>{N.off(`openchange`,r);let t=g(e),n=$(),i=C(M,t)||n.some(e=>e===t||C(e,t))||B&&_e(B.nodesRef.current,F(),!1).some(e=>C(e.context?.elements.floating,t)),s=Me.current,c=Fe.current,l=a(c);queueMicrotask(()=>{let n=Ae(l),r=typeof s!=`boolean`;if(s&&!H.current&&o(n)&&(!(!r&&n!==t&&t!==e.body)||i)){let e={preventScroll:!0};c===`keyboard`&&(e.focusVisible=!0),n.focus(e)}H.current=!1})}},[i,M,Z,Me,z,N,B,j,F,$]),f(()=>{if(!ae||A||!M)return;let e=g(b(M));!o(e)||!ee(e)||C(M,e)&&e.blur()},[A,M]),f(()=>{if(!(i||!V))return V.setFocusManagerState({modal:_,closeOnFocusOut:y,open:A,onOpenChange:k.setOpen,domReference:j}),()=>{V.setFocusManagerState(null)}},[i,V,_,A,k,y,j]),f(()=>{if(!(i||!Z))return je(Z),()=>{queueMicrotask(De)}},[i,Z]);let ze=!i&&(!_||!L)&&(X||_);return(0,I.jsxs)(T.Fragment,{children:[ze&&(0,I.jsx)(be,{"data-type":`inside`,ref:q,onFocus:e=>{if(_){let e=Q();Se(e[e.length-1])}else V?.portalNode&&(H.current=!1,he(e,V.portalNode)?le(j)?.focus():v(E??V.beforeOutsideRef)?.focus())}}),n,ze&&(0,I.jsx)(be,{"data-type":`inside`,ref:Le,onFocus:e=>{_?Se(Q()[0]):V?.portalNode&&(y&&(H.current=!0),he(e,V.portalNode)?ye(j)?.focus():v(w??V.afterOutsideRef)?.focus())}})]})}var z=`ArrowUp`,Ne=`ArrowDown`,B=`ArrowLeft`,V=`ArrowRight`,H=`Home`,U=new Set([z,Ne,B,V,H,`End`]),W=`Shift`,Pe=[W,`Control`,`Alt`,`Meta`];function Fe(e){return o(e)&&e.tagName===`INPUT`}function G(e){return!!(Fe(e)&&e.selectionStart!=null||o(e)&&e.tagName===`TEXTAREA`)}function Ie(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=K(e,t,`left`),a=q(e),o=q(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=K(e,t,`top`),r=q(e),i=q(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function K(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function q(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Le=T.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,I.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),J={},Y={},Re=``;function X(e,t){return d(e)?e:t}function Z(e,t,n){return/hidden|clip/.test(e.getComputedStyle(X(t,n)).overflowY)}function Q(e){if(typeof document>`u`)return!1;let t=b(e);return h(t).innerWidth-t.documentElement.clientWidth>0}function $(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=b(e),n=t.documentElement,r=t.body,i=X(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ze(e){let t=b(e),n=t.documentElement,r=t.body,i=X(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Be(e){let t=b(e),n=t.documentElement,r=t.body,i=h(n),a=0,o=0,s=!1,l=c.create();if(ae&&(i.visualViewport?.scale??1)!==1)return()=>{};function u(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,J={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Re=n.style.scrollBehavior,Y={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,ee=t.overflowY===`scroll`||c.overflowY===`scroll`,te=t.overflowX===`scroll`||c.overflowX===`scroll`,ne=Math.max(0,i.innerWidth-r.clientWidth),f=Math.max(0,i.innerHeight-r.clientHeight),p=parseFloat(c.marginTop)+parseFloat(c.marginBottom),m=parseFloat(c.marginLeft)+parseFloat(c.marginRight),re=X(n,r);if(s=$(e),s){n.style.scrollbarGutter=l,re.style.overflowY=`hidden`,re.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||ee)&&(n.style.overflowY=`scroll`),(d||te)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:p||f?`calc(100dvh - ${p+f}px)`:`100dvh`,width:m||ne?`calc(100vw - ${m+ne}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function d(){Object.assign(n.style,J),Object.assign(r.style,Y),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Re)}function ee(){d(),l.request(u)}u();let te=x(i,`resize`,ee);return()=>{l.cancel(),d(),typeof i.removeEventListener==`function`&&te()}}var Ve=new class{lockCount=0;restore=null;timeoutLock=ve.create();timeoutUnlock=ve.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=b(e),n=t.documentElement,r=t.body,a=h(n);if(Z(a,n,r)){let t=new a.MutationObserver(()=>{Z(a,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),i={attributes:!0};t.observe(n,i),t.observe(r,i),this.restore=()=>t.disconnect();return}let o=i||!Q(e);this.restore=o?ze(e):Be(e)}};function He(e=!0,t=null){f(()=>{if(e)return Ve.acquire(t)},[e,t])}export{V as a,H as c,G as d,Ie as f,B as i,Pe as l,Se as m,Le as n,z as o,Me as p,Ne as r,U as s,He as t,W as u};
|