@aeolus-fleet/gateway 0.32.0 → 0.32.1
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/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +3 -3
- package/web/.next/diagnostics/route-bundle-stats.json +29 -29
- package/web/.next/fallback-build-manifest.json +3 -3
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/server/app/(console)/gateway-off/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/(console)/gateway-off/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/gateway-off/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/meetings/[meetingId]/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/meetings/[meetingId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/page/server-reference-manifest.json +4 -4
- package/web/.next/server/app/(console)/outside-parties/[name]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/(console)/outside-parties/add/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/add/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/outside-parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/overview/page/server-reference-manifest.json +7 -7
- package/web/.next/server/app/(console)/overview/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0-og0bl8lr2xq._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0-og0bl8lr2xq._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0n2us07jk-78w._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1-c9wugbbwsp3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1dtyycvqa6uht._.js +1 -1
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js +1 -1
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0_kakdt7lb6z-._.js +1 -1
- package/web/.next/server/chunks/ssr/_0_kakdt7lb6z-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0bhvvyz0q_0ja._.js +1 -1
- package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js +1 -1
- package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_12fsn_33ga-n0._.js +1 -1
- package/web/.next/server/chunks/ssr/_1_wav28san6dm._.js +1 -1
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1y1ovmdhl9_ml._.js +1 -1
- package/web/.next/server/chunks/ssr/_1y1ovmdhl9_ml._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js +1 -1
- package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_0xnlgtw8bfqaa._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_1_2m6l73qk7qw._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_hooks_overview-actions_ts_0-wrat07d1y5g._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
- package/web/.next/server/middleware-build-manifest.js +3 -3
- package/web/.next/server/pages/500.html +1 -1
- package/web/.next/server/preview-props.json +3 -3
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +28 -28
- package/web/.next/static/chunks/{2jvq5fses35mf.js → 0coxy5zad812a.js} +1 -1
- package/web/.next/static/chunks/{3f3s544ovqebz.js → 0u_4xjk1j74g3.js} +1 -1
- package/web/.next/static/chunks/{202avng4-d5jq.js → 0v9r_hyyubykq.js} +1 -1
- package/web/.next/static/chunks/0zesq1ng-v3s6.js +1 -0
- package/web/.next/static/chunks/{26kio8jl2dc6u.js → 12c3qjvto3m0f.js} +1 -1
- package/web/.next/static/chunks/1ahn4kx4ld-rc.js +1 -0
- package/web/.next/static/chunks/{1ffk4chq_kmie.js → 1xrn7oqwd48vi.js} +1 -1
- package/web/.next/static/chunks/{2sx1mxv2u71xx.js → 20n2z_lok8v0f.js} +1 -1
- package/web/.next/static/chunks/{3yunex2p9do7t.js → 2ew9kpu2kohk4.js} +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- package/web/.next/static/chunks/1nyfzf-d7kj96.js +0 -1
- package/web/.next/static/chunks/40sj32h7okqjq.js +0 -1
- /package/web/.next/static/{JmnMsO8U6uK0nukLKdccI → wnr2MrrQvcto8MOm16D8r}/_buildManifest.js +0 -0
- /package/web/.next/static/{JmnMsO8U6uK0nukLKdccI → wnr2MrrQvcto8MOm16D8r}/_clientMiddlewareManifest.js +0 -0
- /package/web/.next/static/{JmnMsO8U6uK0nukLKdccI → wnr2MrrQvcto8MOm16D8r}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../node_modules/%40base-ui/react/toast/provider/ToastProvider.mjs","../../../../../node_modules/%40base-ui/react/toast/provider/ToastProviderContext.mjs","../../../../../node_modules/%40base-ui/react/toast/store.mjs","../../../../../node_modules/%40base-ui/utils/generateId.mjs","../../../../../node_modules/%40base-ui/react/toast/utils/resolvePromiseOptions.mjs","../../../../../node_modules/%40base-ui/react/toast/viewport/ToastViewport.mjs","../../../../../node_modules/%40base-ui/react/toast/viewport/ToastViewportCssVars.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRoot.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRootContext.mjs","../../../../../node_modules/%40base-ui/utils/clamp.mjs","../../../../../node_modules/%40base-ui/react/utils/scrollable.mjs","../../../../../node_modules/%40base-ui/react/utils/getElementAtPoint.mjs","../../../../../node_modules/%40base-ui/react/utils/getElementTransform.mjs","../../../../../node_modules/%40base-ui/react/utils/useSwipeDismiss.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRootCssVars.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRootDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/toast/content/ToastContent.mjs","../../../../../node_modules/%40base-ui/react/toast/utils/useToastLabelPart.mjs","../../../../../node_modules/%40base-ui/react/toast/utils/isRenderableNode.mjs","../../../../../node_modules/%40base-ui/react/toast/title/ToastTitle.mjs","../../../../../node_modules/%40base-ui/react/toast/close/ToastClose.mjs","../../../../../node_modules/%40base-ui/react/toast/portal/ToastPortal.mjs","../../../../../node_modules/%40base-ui/react/toast/useToastManager.mjs","../../../../../web/features/outside-party/data%3Aa495d8%20%3Ctext/javascript%3E","../../../../../web/features/outside-party/tools-table/table-messages.ts","../../../../../web/features/outside-party/tools-table/ui/needs-chips.tsx","../../../../../node_modules/%40base-ui/react/combobox/root/AriaCombobox.mjs","../../../../../node_modules/%40base-ui/utils/useOnFirstRender.mjs","../../../../../node_modules/%40base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs","../../../../../node_modules/%40base-ui/react/floating-ui-react/hooks/gridNavigation.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/ComboboxRootContext.mjs","../../../../../node_modules/%40base-ui/utils/areArraysEqual.mjs","../../../../../node_modules/%40base-ui/react/internals/itemEquality.mjs","../../../../../node_modules/%40base-ui/react/internals/serializeValue.mjs","../../../../../node_modules/%40base-ui/react/internals/resolveValueLabel.mjs","../../../../../node_modules/%40base-ui/react/combobox/store.mjs","../../../../../node_modules/%40base-ui/react/field/control/FieldControlDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/internals/field-constants/constants.mjs","../../../../../node_modules/%40base-ui/react/internals/field-root-context/FieldRootContext.mjs","../../../../../node_modules/%40base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs","../../../../../node_modules/%40base-ui/react/internals/form-context/FormContext.mjs","../../../../../node_modules/%40base-ui/react/internals/labelable-provider/useLabelableId.mjs","../../../../../node_modules/%40base-ui/react/internals/labelable-provider/LabelableContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/utils/index.mjs","../../../../../node_modules/%40base-ui/utils/stringifyLocale.mjs","../../../../../node_modules/%40base-ui/react/internals/filter.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/utils/useFilter.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/utils/constants.mjs","../../../../../node_modules/%40base-ui/react/combobox/items/itemCollection.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/ComboboxRoot.mjs","../../../../../node_modules/%40base-ui/react/utils/useRegisteredLabelId.mjs","../../../../../node_modules/%40base-ui/react/internals/labelable-provider/useLabel.mjs","../../../../../node_modules/%40base-ui/react/utils/resolveAriaLabelledBy.mjs","../../../../../node_modules/%40base-ui/react/combobox/label/ComboboxLabel.mjs","../../../../../node_modules/%40base-ui/react/combobox/input/ComboboxInput.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/stateAttributesMapping.mjs","../../../../../node_modules/%40base-ui/react/combobox/input/ComboboxInputDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/internals/field-root-context/useSetFieldFocused.mjs","../../../../../node_modules/%40base-ui/react/combobox/chips/ComboboxChipsContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/positioner/ComboboxPositionerContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/ComboboxInternalDismissButton.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/parts.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/handleInputPress.mjs","../../../../../node_modules/%40base-ui/react/combobox/input-group/ComboboxInputGroup.mjs","../../../../../node_modules/%40base-ui/react/combobox/collection/GroupCollectionContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/collection/ComboboxCollection.mjs","../../../../../node_modules/%40base-ui/react/combobox/list/ComboboxList.mjs","../../../../../node_modules/%40base-ui/react/combobox/portal/ComboboxPortal.mjs","../../../../../node_modules/%40base-ui/react/combobox/portal/ComboboxPortalContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/positioner/ComboboxPositioner.mjs","../../../../../node_modules/%40base-ui/react/combobox/popup/ComboboxPopup.mjs","../../../../../node_modules/%40base-ui/react/combobox/item/ComboboxItem.mjs","../../../../../node_modules/%40base-ui/react/combobox/item/ComboboxItemContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/row/ComboboxRowContext.mjs","../../../../../node_modules/%40base-ui/react/utils/ItemIndicator.mjs","../../../../../node_modules/%40base-ui/react/combobox/item-indicator/ComboboxItemIndicator.mjs","../../../../../node_modules/%40base-ui/react/combobox/chips/ComboboxChips.mjs","../../../../../node_modules/%40base-ui/react/combobox/chip/ComboboxChipContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/chip/ComboboxChip.mjs","../../../../../node_modules/%40base-ui/react/combobox/chip-remove/ComboboxChipRemove.mjs","../../../../../node_modules/%40base-ui/react/internals/useInitialLiveRegionTextMutation.mjs","../../../../../node_modules/%40base-ui/react/combobox/empty/ComboboxEmpty.mjs","../../../../../web/features/outside-party/tools-table/ui/scope-picker.tsx","../../../../../web/features/outside-party/tools-table/ui/table-dialog.tsx","../../../../../web/features/outside-party/tools-table/ui/table-toasts.tsx","../../../../../web/features/forms/ui/switch.tsx","../../../../../web/features/outside-party/tools-table/ui/agent-needs.tsx","../../../../../node_modules/%40base-ui/react/drawer/backdrop/DrawerBackdrop.mjs","../../../../../node_modules/%40base-ui/react/drawer/popup/DrawerPopupCssVars.mjs","../../../../../node_modules/%40base-ui/react/drawer/backdrop/DrawerBackdropCssVars.mjs","../../../../../node_modules/%40base-ui/react/drawer/close/DrawerClose.mjs","../../../../../node_modules/%40base-ui/react/drawer/content/drawerContentAttribute.mjs","../../../../../node_modules/%40base-ui/react/drawer/content/DrawerContent.mjs","../../../../../node_modules/%40base-ui/react/drawer/popup/DrawerPopup.mjs","../../../../../node_modules/%40base-ui/react/drawer/popup/DrawerPopupDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/drawer/root/DrawerRootContext.mjs","../../../../../node_modules/%40base-ui/react/drawer/root/useDrawerSnapPoints.mjs","../../../../../node_modules/%40base-ui/react/drawer/viewport/DrawerViewportContext.mjs","../../../../../node_modules/%40base-ui/react/drawer/portal/DrawerPortal.mjs","../../../../../node_modules/%40base-ui/react/drawer/root/DrawerRoot.mjs","../../../../../node_modules/%40base-ui/react/drawer/provider/DrawerProviderContext.mjs","../../../../../node_modules/%40base-ui/react/drawer/title/DrawerTitle.mjs","../../../../../node_modules/%40base-ui/react/drawer/trigger/DrawerTrigger.mjs","../../../../../node_modules/%40base-ui/react/drawer/viewport/DrawerViewport.mjs","../../../../../node_modules/%40base-ui/react/dialog/viewport/DialogViewport.mjs","../../../../../node_modules/%40base-ui/react/dialog/viewport/DialogViewportDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs","../../../../../web/features/outside-party/tools-table/ui/tools-table.tsx","../../../../../web/features/outside-party/data%3A548cbf%20%3Ctext/javascript%3E","../../../../../web/features/outside-party/switched-message.ts","../../../../../web/features/outside-party/tools-table/hint-suggestions.ts","../../../../../web/features/outside-party/tools-table/scope-change.ts","../../../../../web/features/outside-party/tools-table/table-tools.ts","../../../../../web/features/outside-party/ui/repeatable-switch.tsx","../../../../../web/features/outside-party/data%3Aa8113e%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ToastContext } from \"./ToastProviderContext.mjs\";\nimport { ToastStore } from \"../store.mjs\";\n\n/**\n * Provides a context for creating and managing toasts.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ToastProvider = function ToastProvider(props) {\n const {\n children,\n timeout = 5000,\n limit = 3,\n toastManager\n } = props;\n const store = useRefWithInit(() => new ToastStore({\n timeout,\n limit,\n viewport: null,\n toasts: [],\n hovering: false,\n focused: false,\n isWindowFocused: true,\n prevFocusElement: null\n })).current;\n useOnMount(store.disposeEffect);\n React.useEffect(function subscribeToToastManager() {\n if (!toastManager) {\n return undefined;\n }\n const unsubscribe = toastManager[' subscribe'](({\n action,\n options\n }) => {\n const id = options.id;\n if (action === 'promise' && options.promise) {\n store.promiseToast(options.promise, options);\n } else if (action === 'update' && id) {\n store.updateToast(id, options.updates);\n } else if (action === 'close') {\n store.closeToast(id);\n } else {\n store.addToast(options);\n }\n });\n return unsubscribe;\n }, [store, toastManager]);\n return /*#__PURE__*/_jsxs(ToastContext.Provider, {\n value: store,\n children: [/*#__PURE__*/_jsx(ToastProviderPropsSynchronizer, {\n store: store,\n timeout: timeout,\n limit: limit\n }), children]\n });\n};\nif (process.env.NODE_ENV !== \"production\") ToastProvider.displayName = \"ToastProvider\";\nfunction ToastProviderPropsSynchronizer(props) {\n const {\n store,\n timeout,\n limit\n } = props;\n\n // `limit` needs custom syncing because changing it must also recompute each\n // toast's `limited` flag; `useSyncedValues` would only update the raw value.\n useIsoLayoutEffect(() => {\n store.syncProviderProps(timeout, limit);\n }, [store, timeout, limit]);\n return null;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastContext.displayName = \"ToastContext\";\nexport function useToastProviderContext() {\n const context = React.useContext(ToastContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: useToastManager must be used within <Toast.Provider>.' : _formatErrorMessage(73));\n }\n return context;\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { generateId } from '@base-ui/utils/generateId';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { resolvePromiseOptions } from \"./utils/resolvePromiseOptions.mjs\";\nimport { activeElement, contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { isFocusVisible } from \"./utils/focusVisible.mjs\";\n\n/**\n * A toast once it lives in the store. `addToast` is the only way in and it always\n * assigns `updateKey`, so unlike the public `ToastObject` it is never missing.\n */\n\nfunction createToastMetadata(toasts) {\n const metadata = new Map();\n let visibleIndex = 0;\n let offsetY = 0;\n toasts.forEach((toast, toastIndex) => {\n const isEnding = toast.transitionStatus === 'ending';\n metadata.set(toast.id, {\n value: toast,\n domIndex: toastIndex,\n visibleIndex: isEnding ? -1 : visibleIndex,\n offsetY\n });\n offsetY += toast.height || 0;\n if (!isEnding) {\n visibleIndex += 1;\n }\n });\n return metadata;\n}\n\n// Marks the active (non-ending) toasts beyond `limit` as limited. Callers pass\n// toasts in newest-first order, so the newest `limit` toasts stay visible and\n// the rest are flagged. Returns the same toast reference when its `limited`\n// flag is unchanged to avoid unnecessary re-renders.\nfunction applyLimited(toasts, limit) {\n let activeIndex = 0;\n return toasts.map(toast => {\n if (toast.transitionStatus === 'ending') {\n return toast;\n }\n const limited = activeIndex >= limit;\n activeIndex += 1;\n return toast.limited === limited ? toast : {\n ...toast,\n limited\n };\n });\n}\nexport const selectors = {\n toasts: state => state.toasts,\n isEmpty: state => state.toasts.length === 0,\n toast: (state, id) => state.toastMetadata.get(id)?.value,\n toastIndex: (state, id) => state.toastMetadata.get(id)?.domIndex ?? -1,\n toastOffsetY: (state, id) => state.toastMetadata.get(id)?.offsetY ?? 0,\n toastVisibleIndex: (state, id) => state.toastMetadata.get(id)?.visibleIndex ?? -1,\n focused: state => state.focused,\n expanded: state => state.hovering || state.focused,\n expandedOrOutOfFocus: state => state.hovering || state.focused || !state.isWindowFocused,\n prevFocusElement: state => state.prevFocusElement\n};\nexport class ToastStore extends ReactStore {\n timers = new Map();\n areTimersPaused = false;\n constructor(initialState) {\n super({\n ...initialState,\n toastMetadata: createToastMetadata(initialState.toasts)\n }, {}, selectors);\n }\n setViewport = viewport => {\n this.set('viewport', viewport);\n };\n syncProviderProps(timeout, limit) {\n const limitChanged = this.state.limit !== limit;\n if (this.state.timeout === timeout && !limitChanged) {\n return;\n }\n const updates = {\n timeout,\n limit\n };\n if (limitChanged) {\n const newToasts = applyLimited(this.state.toasts, limit);\n updates.toasts = newToasts;\n updates.toastMetadata = createToastMetadata(newToasts);\n }\n this.update(updates);\n }\n disposeEffect = () => {\n return () => {\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n };\n };\n removeToast(toastId, skipOnRemove = false) {\n const index = selectors.toastIndex(this.state, toastId);\n if (index === -1) {\n return;\n }\n const toast = this.state.toasts[index];\n if (!skipOnRemove) {\n toast?.onRemove?.();\n }\n const newToasts = [...this.state.toasts];\n newToasts.splice(index, 1);\n this.setToasts(newToasts);\n }\n addToast = toast => {\n const {\n timeout,\n limit\n } = this.state;\n const id = toast.id || generateId('toast');\n if (toast.id) {\n const existingToast = selectors.toast(this.state, toast.id);\n if (existingToast) {\n if (existingToast.transitionStatus === 'ending') {\n this.removeToast(toast.id, true);\n } else {\n const {\n id: ignoredId,\n transitionStatus: ignoredTransitionStatus,\n ...updates\n } = toast;\n this.updateToastInternal(toast.id, updates, true, true);\n return toast.id;\n }\n }\n }\n const toastToAdd = {\n ...toast,\n id,\n updateKey: 0,\n transitionStatus: 'starting'\n };\n const updatedToasts = [toastToAdd, ...this.state.toasts];\n this.setToasts(applyLimited(updatedToasts, limit));\n const duration = toastToAdd.timeout ?? timeout;\n if (toastToAdd.type !== 'loading' && duration > 0) {\n this.scheduleTimer(id, duration, () => this.closeToast(id));\n }\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n return id;\n };\n updateToast = (id, updates) => {\n const prevToast = selectors.toast(this.state, id);\n // Never run the updater for an update the store is going to ignore.\n if (!prevToast || prevToast.transitionStatus === 'ending') {\n return;\n }\n\n // The updater may have called back into the store, so the internal update\n // reads the current state again.\n this.updateToastInternal(id, typeof updates === 'function' ? updates(prevToast) : updates, false, true);\n };\n updateToastInternal = (id, updates, resetTimer = false, markUpdated = false) => {\n const {\n timeout,\n toasts\n } = this.state;\n const prevToast = selectors.toast(this.state, id);\n if (!prevToast) {\n return;\n }\n\n // Ignore updates for toasts that are already closing.\n // This prevents races where async updates (e.g. promise success/error)\n // can block a dismissal from completing.\n if (prevToast.transitionStatus === 'ending') {\n return;\n }\n const nextToast = {\n ...prevToast,\n ...updates,\n ...(markUpdated && {\n updateKey: prevToast.updateKey + 1\n })\n };\n this.setToasts(toasts.map(toast => toast.id === id ? nextToast : toast));\n const nextTimeout = nextToast.timeout ?? timeout;\n const prevTimeout = prevToast.timeout ?? timeout;\n const timeoutUpdated = Object.hasOwn(updates, 'timeout');\n const shouldHaveTimer = nextToast.transitionStatus !== 'ending' && nextToast.type !== 'loading' && nextTimeout > 0;\n const hasTimer = this.timers.has(id);\n const timeoutChanged = prevTimeout !== nextTimeout;\n const wasLoading = prevToast.type === 'loading';\n if (!shouldHaveTimer && hasTimer) {\n this.clearTimer(id);\n return;\n }\n\n // Schedule or reschedule timer if needed\n if (shouldHaveTimer && (!hasTimer || timeoutChanged || timeoutUpdated || wasLoading || resetTimer)) {\n this.clearTimer(id);\n this.scheduleTimer(id, nextTimeout, () => this.closeToast(id));\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n }\n };\n closeToast = toastId => {\n const closeAll = toastId === undefined;\n const {\n limit,\n toasts\n } = this.state;\n let toastsToClose;\n if (closeAll) {\n toastsToClose = toasts;\n this.clearTimers();\n } else {\n const toast = selectors.toast(this.state, toastId);\n if (!toast) {\n return;\n }\n toastsToClose = [toast];\n this.clearTimer(toastId);\n }\n const endingToasts = toasts.map(item => closeAll || item.id === toastId ? {\n ...item,\n transitionStatus: 'ending',\n height: 0\n } : item);\n const newToasts = applyLimited(endingToasts, limit);\n this.setToasts(newToasts, !newToasts.some(toast => toast.transitionStatus !== 'ending'));\n toastsToClose.forEach(toast => {\n if (toast.transitionStatus !== 'ending') {\n toast.onClose?.();\n }\n });\n this.handleFocusManagement(toastId);\n };\n promiseToast = (promiseValue, options) => {\n // Create a loading toast (which does not auto-dismiss).\n const loadingOptions = resolvePromiseOptions(options.loading);\n const id = this.addToast({\n ...loadingOptions,\n type: 'loading'\n });\n const handledPromise = promiseValue.then(result => {\n const successOptions = resolvePromiseOptions(options.success, result);\n this.updateToast(id, {\n ...successOptions,\n type: 'success',\n timeout: successOptions.timeout\n });\n return result;\n }).catch(error => {\n const errorOptions = resolvePromiseOptions(options.error, error);\n this.updateToast(id, {\n ...errorOptions,\n type: 'error',\n timeout: errorOptions.timeout\n });\n return Promise.reject(error);\n });\n\n // Private API used exclusively by `Manager` to handoff the promise\n // back to the manager after it's handled here.\n if ({}.hasOwnProperty.call(options, 'setPromise')) {\n options.setPromise(handledPromise);\n }\n return handledPromise;\n };\n pauseTimers() {\n if (this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = true;\n this.timers.forEach(timer => {\n // Timers added while already paused have no running timeout, so their\n // `remaining` is still the full delay and must be left alone.\n if (timer.timeout) {\n timer.timeout.clear();\n // `start` is stamped on every resume, so subtracting from `remaining`\n // (rather than from the original delay) keeps repeated pause/resume\n // cycles from handing the toast extra time.\n timer.remaining = Math.max(timer.remaining - (Date.now() - timer.start), 0);\n }\n });\n }\n resumeTimers() {\n if (!this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = false;\n this.timers.forEach((timer, id) => {\n timer.remaining = timer.remaining > 0 ? timer.remaining : timer.delay;\n timer.timeout ??= Timeout.create();\n timer.timeout.start(timer.remaining, () => {\n this.handleTimerFired(id);\n timer.callback();\n });\n timer.start = Date.now();\n });\n }\n restoreFocusToPrevElement() {\n this.state.prevFocusElement?.focus({\n preventScroll: true\n });\n }\n handleDocumentPointerDown = event => {\n if (event.pointerType !== 'touch') {\n return;\n }\n const target = getTarget(event);\n if (contains(this.state.viewport, target)) {\n return;\n }\n\n // This is explicit touch activity outside the viewport, so the paused\n // interaction state should end even if the window focus state is unchanged.\n this.resumeTimers();\n this.update({\n hovering: false,\n focused: false\n });\n };\n scheduleTimer(id, delay, callback) {\n const start = Date.now();\n const shouldStartActive = !selectors.expandedOrOutOfFocus(this.state);\n const currentTimeout = shouldStartActive ? Timeout.create() : undefined;\n currentTimeout?.start(delay, () => {\n this.handleTimerFired(id);\n callback();\n });\n this.timers.set(id, {\n timeout: currentTimeout,\n start,\n delay,\n remaining: delay,\n callback\n });\n }\n clearTimers() {\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n this.areTimersPaused = false;\n }\n clearTimer(id) {\n const timer = this.timers.get(id);\n timer?.timeout?.clear();\n this.timers.delete(id);\n this.resetPausedStateIfNoTimersRemain();\n }\n handleTimerFired(id) {\n this.timers.delete(id);\n this.resetPausedStateIfNoTimersRemain();\n }\n resetPausedStateIfNoTimersRemain() {\n if (this.timers.size === 0) {\n // No timers remain to keep paused; clear the flag so a fresh toast's\n // running timer can be paused again on hover/focus.\n this.areTimersPaused = false;\n }\n }\n setToasts(newToasts, clearInteraction = newToasts.length === 0) {\n const updates = {\n toasts: newToasts,\n toastMetadata: createToastMetadata(newToasts)\n };\n if (clearInteraction) {\n updates.hovering = false;\n updates.focused = false;\n }\n this.update(updates);\n }\n handleFocusManagement(toastId) {\n const activeEl = activeElement(ownerDocument(this.state.viewport));\n if (!this.state.viewport || !contains(this.state.viewport, activeEl) || !isFocusVisible(activeEl)) {\n return;\n }\n if (toastId === undefined) {\n this.restoreFocusToPrevElement();\n return;\n }\n const toasts = selectors.toasts(this.state);\n const currentIndex = selectors.toastIndex(this.state, toastId);\n const scan = (from, step) => {\n for (let index = from; index >= 0 && index < toasts.length; index += step) {\n if (toasts[index].transitionStatus !== 'ending') {\n return toasts[index];\n }\n }\n return null;\n };\n\n // Try to find the next toast that isn't animating out, then fall back to the previous one.\n const nextToast = scan(currentIndex + 1, 1) ?? scan(currentIndex - 1, -1);\n if (nextToast) {\n nextToast.ref?.current?.focus();\n } else {\n this.restoreFocusToPrevElement();\n }\n }\n}","let counter = 0;\nexport function generateId(prefix) {\n counter += 1;\n return `${prefix}-${Math.random().toString(36).slice(2, 6)}-${counter}`;\n}","export function resolvePromiseOptions(options, result) {\n if (typeof options === 'string') {\n return {\n description: options\n };\n }\n if (typeof options === 'function') {\n const resolvedOptions = options(result);\n return typeof resolvedOptions === 'string' ? {\n description: resolvedOptions\n } : resolvedOptions;\n }\n return options;\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { activeElement, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { isFocusVisible } from \"../utils/focusVisible.mjs\";\nimport * as ToastViewportCssVars from \"./ToastViewportCssVars.mjs\";\n\n/**\n * A container viewport for toasts.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ToastViewport = /*#__PURE__*/React.forwardRef(function ToastViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const windowFocusTimeout = useTimeout();\n const handlingFocusGuardRef = React.useRef(false);\n const markedReadyForMouseLeaveRef = React.useRef(false);\n const touchActiveRef = React.useRef(false);\n const isEmpty = store.useState('isEmpty');\n const toasts = store.useState('toasts');\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n const prevFocusElement = store.useState('prevFocusElement');\n const frontmostHeight = toasts[0]?.height;\n const hasTransitioningToasts = toasts.some(toast => toast.transitionStatus === 'ending');\n const highPriorityToasts = toasts.filter(toast => toast.priority === 'high');\n React.useEffect(() => {\n // `store.state.viewport` isn't available on the first render, since the portal node hasn't yet\n // been created. Depending on `isEmpty` ensures the listeners are attached once toasts exist and\n // the viewport ref is available.\n const viewport = store.state.viewport;\n if (!viewport || isEmpty) {\n return undefined;\n }\n const win = ownerWindow(viewport);\n const doc = ownerDocument(viewport);\n\n // Listen globally for F6 so we can force-focus the viewport.\n function handleGlobalKeyDown(event) {\n if (event.key === 'F6' && getTarget(event) !== viewport) {\n event.preventDefault();\n store.set('prevFocusElement', activeElement(doc));\n viewport?.focus({\n preventScroll: true\n });\n store.pauseTimers();\n store.set('focused', true);\n }\n }\n function handleWindowBlur(event) {\n if (getTarget(event) !== win) {\n return;\n }\n store.set('isWindowFocused', false);\n store.pauseTimers();\n }\n function handleWindowFocus(event) {\n if (event.relatedTarget) {\n return;\n }\n const target = getTarget(event);\n const activeEl = activeElement(ownerDocument(viewport));\n if (target === win || !contains(viewport, target) || !isFocusVisible(activeEl)) {\n store.resumeTimers();\n }\n\n // Wait for the `handleFocus` event to fire.\n windowFocusTimeout.start(0, () => store.set('isWindowFocused', true));\n }\n return mergeCleanups(addEventListener(win, 'keydown', handleGlobalKeyDown), addEventListener(win, 'blur', handleWindowBlur, true), addEventListener(win, 'focus', handleWindowFocus, true), addEventListener(doc, 'pointerdown', store.handleDocumentPointerDown, true));\n }, [store, windowFocusTimeout, isEmpty]);\n function handleFocusGuard(event) {\n handlingFocusGuardRef.current = true;\n\n // If we're coming off the container, move to the first toast that can hold\n // focus, skipping toasts that are animating out or inert because they're limited.\n const firstFocusableToast = event.relatedTarget === store.state.viewport ? toasts.find(toast => toast.transitionStatus !== 'ending' && !toast.limited) : undefined;\n if (firstFocusableToast) {\n firstFocusableToast.ref?.current?.focus();\n } else {\n store.restoreFocusToPrevElement();\n }\n }\n function handleKeyDown(event) {\n if (event.key === 'Tab' && event.shiftKey && getTarget(event.nativeEvent) === store.state.viewport) {\n event.preventDefault();\n // Restoring focus blurs the viewport, and `handleBlur` resumes the timers\n // from there. Resuming here as well would also fire when the previously\n // focused element lives inside the viewport, letting toasts dismiss out\n // from under the keyboard.\n store.restoreFocusToPrevElement();\n }\n }\n function flushMouseLeave() {\n const hasEndingToasts = store.state.toasts.some(toast => toast.transitionStatus === 'ending');\n if (hasEndingToasts || touchActiveRef.current || !markedReadyForMouseLeaveRef.current) {\n return;\n }\n\n // Apply any mouseleave that was deferred until transitions finished.\n store.set('hovering', false);\n if (!store.select('expandedOrOutOfFocus')) {\n store.resumeTimers();\n }\n markedReadyForMouseLeaveRef.current = false;\n }\n React.useEffect(flushMouseLeave, [hasTransitioningToasts, store]);\n function handleMouseEnter() {\n store.pauseTimers();\n store.set('hovering', true);\n markedReadyForMouseLeaveRef.current = false;\n }\n function handleMouseLeave() {\n // Defer to `flushMouseLeave`: while toasts are transitioning out or a touch gesture is active it\n // records the intent and collapses later; otherwise it collapses immediately.\n markedReadyForMouseLeaveRef.current = true;\n flushMouseLeave();\n }\n function handlePointerDown(event) {\n if (event.pointerType === 'touch') {\n touchActiveRef.current = true;\n }\n }\n function handlePointerEnd(event) {\n if (event.pointerType !== 'touch') {\n return;\n }\n touchActiveRef.current = false;\n flushMouseLeave();\n }\n function handleFocus() {\n if (handlingFocusGuardRef.current) {\n handlingFocusGuardRef.current = false;\n return;\n }\n if (focused) {\n return;\n }\n\n // Only set focused when the active element is focus-visible.\n // This prevents the viewport from staying expanded when clicking inside without\n // keyboard navigation.\n if (isFocusVisible(activeElement(ownerDocument(store.state.viewport)))) {\n store.set('focused', true);\n store.pauseTimers();\n }\n }\n function handleBlur(event) {\n if (!focused || contains(store.state.viewport, event.relatedTarget)) {\n return;\n }\n store.set('focused', false);\n if (!store.select('expandedOrOutOfFocus')) {\n store.resumeTimers();\n }\n }\n const defaultProps = {\n tabIndex: -1,\n role: 'region',\n 'aria-live': 'polite',\n 'aria-atomic': false,\n 'aria-relevant': 'additions text',\n 'aria-label': 'Notifications',\n onMouseEnter: handleMouseEnter,\n onMouseMove: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onClick: handleFocus,\n onPointerDown: handlePointerDown,\n onPointerUp: handlePointerEnd,\n onPointerCancel: handlePointerEnd,\n style: {\n [ToastViewportCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined\n }\n };\n const state = {\n expanded\n };\n const focusGuard = !isEmpty && prevFocusElement && /*#__PURE__*/_jsx(FocusGuard, {\n onFocus: handleFocusGuard\n });\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.setViewport],\n state,\n props: [defaultProps, elementProps, {\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [focusGuard, children, focusGuard]\n })\n }]\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [focusGuard, element, !focused && highPriorityToasts.length > 0 && /*#__PURE__*/_jsx(\"div\", {\n style: visuallyHidden,\n children: highPriorityToasts.map(toast => /*#__PURE__*/_jsxs(\"div\", {\n role: \"alert\",\n \"aria-atomic\": true,\n children: [/*#__PURE__*/_jsx(\"div\", {\n children: toast.title\n }), /*#__PURE__*/_jsx(\"div\", {\n children: toast.description\n })]\n }, toast.id))\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastViewport.displayName = \"ToastViewport\";","/**\n * Indicates the height of the frontmost toast.\n * @type {number}\n */\nexport const frontmostHeight = '--toast-frontmost-height';","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { ToastRootContext } from \"./ToastRootContext.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { BASE_UI_SWIPE_IGNORE_SELECTOR, LEGACY_SWIPE_IGNORE_SELECTOR } from \"../../internals/constants.mjs\";\nimport { getDisplacement } from \"../../utils/useSwipeDismiss.mjs\";\nimport { getElementTransform } from \"../../utils/getElementTransform.mjs\";\nimport * as ToastRootCssVars from \"./ToastRootCssVars.mjs\";\nimport * as ToastRootDataAttributes from \"./ToastRootDataAttributes.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const toastRootStateAttributesMapping = {\n ...transitionStatusMapping,\n swipeDirection(value) {\n return value ? {\n [ToastRootDataAttributes.swipeDirection]: value\n } : null;\n }\n};\nconst SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst OPPOSITE_DIRECTION_DAMPING_FACTOR = 0.5;\nconst MIN_DRAG_THRESHOLD = 1;\nconst TOAST_SWIPE_IGNORE_SELECTOR = `${BASE_UI_SWIPE_IGNORE_SELECTOR},${LEGACY_SWIPE_IGNORE_SELECTOR}`;\n\n/**\n * Groups all parts of an individual toast.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastRoot = /*#__PURE__*/React.forwardRef(function ToastRoot(componentProps, forwardedRef) {\n const {\n toast,\n render,\n className,\n swipeDirection = ['down', 'right'],\n style,\n ...elementProps\n } = componentProps;\n const isAnchored = toast.positionerProps?.anchor !== undefined;\n let swipeDirections = [];\n if (!isAnchored) {\n swipeDirections = Array.isArray(swipeDirection) ? swipeDirection : [swipeDirection];\n }\n const swipeEnabled = swipeDirections.length > 0;\n const store = useToastProviderContext();\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [isRealSwipe, setIsRealSwipe] = React.useState(false);\n const [dragOffset, setDragOffset] = React.useState({\n x: 0,\n y: 0\n });\n const [initialTransform, setInitialTransform] = React.useState({\n x: 0,\n y: 0,\n scale: 1\n });\n const [titleId, setTitleId] = React.useState();\n const [descriptionId, setDescriptionId] = React.useState();\n const [lockedDirection, setLockedDirection] = React.useState(null);\n const rootRef = React.useRef(null);\n const lastToastIdRef = React.useRef(undefined);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const activePointerIdRef = React.useRef(null);\n const dragAbortControllerRef = React.useRef(null);\n const domIndex = store.useState('toastIndex', toast.id);\n const visibleIndex = store.useState('toastVisibleIndex', toast.id);\n const offsetY = store.useState('toastOffsetY', toast.id);\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n useOpenChangeComplete({\n open: toast.transitionStatus !== 'ending',\n ref: rootRef,\n onComplete() {\n if (toast.transitionStatus === 'ending') {\n store.removeToast(toast.id);\n }\n }\n });\n\n // Recalculates the natural height of the toast and updates it in the toast manager.\n // `flushSync` avoids visual flickers when called from observer callbacks.\n // The store ignores this write while the toast is transitioning out.\n const recalculateHeight = useStableCallback((flushSync = false) => {\n const element = rootRef.current;\n if (!element) {\n return;\n }\n const previousHeight = element.style.height;\n element.style.height = 'auto';\n const height = element.offsetHeight;\n element.style.height = previousHeight;\n function update() {\n store.updateToastInternal(toast.id, {\n ref: rootRef,\n height,\n transitionStatus: undefined\n });\n }\n if (flushSync) {\n ReactDOM.flushSync(update);\n } else {\n update();\n }\n });\n\n // Initialize the toast on mount, and reinitialize when it begins a new lifecycle:\n // re-adding an ending toast retains the same root instance (`key={toast.id}`), and\n // index-keyed lists can hand an existing instance a different toast.\n useIsoLayoutEffect(() => {\n const previousToastId = lastToastIdRef.current;\n // `recalculateHeight` clears the `starting` status itself, so bail out on the\n // resulting re-run and on the later `ending` one, which the store discards anyway.\n if (toast.transitionStatus !== 'starting' && previousToastId === toast.id) {\n return;\n }\n if (previousToastId !== undefined) {\n // A retained root keeps component-local swipe state from its previous lifecycle;\n // clear it so the toast doesn't stay offset or exit in the swiped direction.\n setCurrentSwipeDirection(undefined);\n setInitialTransform({\n x: 0,\n y: 0,\n scale: 1\n });\n setResolvedDragOffset({\n x: 0,\n y: 0\n });\n }\n lastToastIdRef.current = toast.id;\n recalculateHeight();\n }, [recalculateHeight, toast.id, toast.transitionStatus]);\n function setResolvedDragOffset(nextDragOffset) {\n dragOffsetRef.current = nextDragOffset;\n setDragOffset(nextDragOffset);\n }\n useIsoLayoutEffect(() => {\n return () => {\n dragAbortControllerRef.current?.abort();\n };\n }, []);\n function applyDirectionalDamping(deltaX, deltaY) {\n const damp = delta => delta > 0 ? delta ** OPPOSITE_DIRECTION_DAMPING_FACTOR : -(Math.abs(delta) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);\n const dampX = deltaX > 0 && !swipeDirections.includes('right') || deltaX < 0 && !swipeDirections.includes('left');\n const dampY = deltaY > 0 && !swipeDirections.includes('down') || deltaY < 0 && !swipeDirections.includes('up');\n return {\n x: dampX ? damp(deltaX) : deltaX,\n y: dampY ? damp(deltaY) : deltaY\n };\n }\n const handleSwipeEnd = useStableCallback(event => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n activePointerIdRef.current = null;\n dragAbortControllerRef.current?.abort();\n dragAbortControllerRef.current = null;\n setIsSwiping(false);\n setIsRealSwipe(false);\n setLockedDirection(null);\n const resolvedInitialTransform = initialTransformRef.current;\n if (event.type === 'pointercancel' || cancelledSwipeRef.current) {\n setResolvedDragOffset({\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const deltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const deltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n let dismissDirection;\n for (const direction of swipeDirections) {\n if (getDisplacement(direction, deltaX, deltaY) > SWIPE_THRESHOLD) {\n dismissDirection = direction;\n break;\n }\n }\n if (dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n store.closeToast(toast.id);\n } else {\n setResolvedDragOffset({\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n }\n });\n function handlePointerDown(event) {\n if (event.button !== 0) {\n return;\n }\n if (event.pointerType === 'touch') {\n store.pauseTimers();\n }\n const target = getTarget(event.nativeEvent);\n const isInteractiveElement = closest(target, `button,a,input,textarea,[role=\"button\"],${TOAST_SWIPE_IGNORE_SELECTOR}`);\n if (isInteractiveElement) {\n return;\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n activePointerIdRef.current = event.pointerId;\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n swipeCancelBaselineRef.current = dragStartPosRef.current;\n const element = event.currentTarget;\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n setInitialTransform(transform);\n setResolvedDragOffset({\n x: transform.x,\n y: transform.y\n });\n store.set('hovering', true);\n setIsSwiping(true);\n setIsRealSwipe(false);\n setLockedDirection(null);\n isFirstPointerMoveRef.current = true;\n dragAbortControllerRef.current?.abort();\n const dragAbortController = new AbortController();\n dragAbortControllerRef.current = dragAbortController;\n const doc = ownerDocument(element);\n doc.addEventListener('pointerup', handleSwipeEnd, {\n signal: dragAbortController.signal\n });\n doc.addEventListener('pointercancel', handleSwipeEnd, {\n signal: dragAbortController.signal\n });\n element.setPointerCapture?.(event.pointerId);\n }\n function handlePointerMove(event) {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n\n // Prevent text selection on Safari\n event.preventDefault();\n if (isFirstPointerMoveRef.current) {\n // Adjust the starting position to the current position on the first move\n // to account for the delay between pointerdown and the first pointermove on iOS.\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n isFirstPointerMoveRef.current = false;\n }\n const {\n clientY,\n clientX,\n movementX,\n movementY\n } = event;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let resolvedLockedDirection = lockedDirection;\n if (!isRealSwipe) {\n const movementDistance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (movementDistance >= MIN_DRAG_THRESHOLD) {\n setIsRealSwipe(true);\n // `lockedDirection` is always reset alongside `isRealSwipe`, so it is\n // still `null` here. Locking is only meaningful when both axes are\n // swipeable; otherwise the single axis already constrains the gesture.\n const hasHorizontal = swipeDirections.includes('left') || swipeDirections.includes('right');\n const hasVertical = swipeDirections.includes('up') || swipeDirections.includes('down');\n if (hasHorizontal && hasVertical) {\n const absX = Math.abs(deltaX);\n const absY = Math.abs(deltaY);\n resolvedLockedDirection = absX > absY ? 'horizontal' : 'vertical';\n setLockedDirection(resolvedLockedDirection);\n }\n }\n }\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (resolvedLockedDirection === 'vertical') {\n if (deltaY > 0) {\n candidate = 'down';\n } else if (deltaY < 0) {\n candidate = 'up';\n }\n } else if (resolvedLockedDirection === 'horizontal') {\n if (deltaX > 0) {\n candidate = 'right';\n } else if (deltaX < 0) {\n candidate = 'left';\n }\n } else if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate && swipeDirections.includes(candidate)) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > SWIPE_THRESHOLD) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(swipeDirections.includes('left') && swipeDirections.includes('right')) && !(swipeDirections.includes('up') && swipeDirections.includes('down')) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n const hasHorizontalDir = swipeDirections.includes('left') || swipeDirections.includes('right');\n const hasVerticalDir = swipeDirections.includes('up') || swipeDirections.includes('down');\n if (resolvedLockedDirection !== 'vertical' && hasHorizontalDir) {\n newOffsetX += dampedDelta.x;\n }\n if (resolvedLockedDirection !== 'horizontal' && hasVerticalDir) {\n newOffsetY += dampedDelta.y;\n }\n setResolvedDragOffset({\n x: newOffsetX,\n y: newOffsetY\n });\n }\n function handleKeyDown(event) {\n if (event.key === 'Escape') {\n if (!rootRef.current || !contains(rootRef.current, activeElement(ownerDocument(rootRef.current)))) {\n return;\n }\n store.closeToast(toast.id);\n }\n }\n React.useEffect(() => {\n const element = rootRef.current;\n if (!swipeEnabled || !element) {\n return undefined;\n }\n function preventDefaultTouchStart(event) {\n if (activePointerIdRef.current === null || !contains(element, getTarget(event))) {\n return;\n }\n\n // React's pointermove preventDefault is not enough on iOS; this\n // non-passive touchmove listener blocks native scrolling while dragging.\n event.preventDefault();\n }\n return addEventListener(element, 'touchmove', preventDefaultTouchStart, {\n passive: false\n });\n }, [swipeEnabled]);\n function getDragStyles() {\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n return {\n transition: isSwiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: isSwiping ? `translateX(${dragOffset.x}px) translateY(${dragOffset.y}px) scale(${initialTransform.scale})` : undefined,\n [ToastRootCssVars.swipeMovementX]: `${deltaX}px`,\n [ToastRootCssVars.swipeMovementY]: `${deltaY}px`\n };\n }\n const isHighPriority = toast.priority === 'high';\n const defaultProps = {\n role: isHighPriority ? 'alertdialog' : 'dialog',\n tabIndex: 0,\n 'aria-modal': false,\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n 'aria-hidden': isHighPriority && !focused ? true : undefined,\n onPointerDown: swipeEnabled ? handlePointerDown : undefined,\n onPointerMove: swipeEnabled ? handlePointerMove : undefined,\n onPointerUp: swipeEnabled ? handleSwipeEnd : undefined,\n onPointerCancel: swipeEnabled ? handleSwipeEnd : undefined,\n onKeyDown: handleKeyDown,\n inert: inertValue(toast.limited),\n style: {\n ...getDragStyles(),\n [ToastRootCssVars.index]: toast.transitionStatus === 'ending' ? domIndex : visibleIndex,\n [ToastRootCssVars.offsetY]: `${offsetY}px`,\n [ToastRootCssVars.height]: toast.height ? `${toast.height}px` : undefined\n }\n };\n const toastRoot = React.useMemo(() => ({\n toast,\n setTitleId,\n setDescriptionId,\n recalculateHeight,\n visibleIndex,\n expanded\n }), [toast, setTitleId, setDescriptionId, recalculateHeight, visibleIndex, expanded]);\n const state = {\n transitionStatus: toast.transitionStatus,\n expanded,\n limited: toast.limited || false,\n type: toast.type,\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, rootRef],\n state,\n stateAttributesMapping: toastRootStateAttributesMapping,\n props: [defaultProps, elementProps]\n });\n return /*#__PURE__*/_jsx(ToastRootContext.Provider, {\n value: toastRoot,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastRoot.displayName = \"ToastRoot\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastRootContext.displayName = \"ToastRootContext\";\nexport function useToastRootContext() {\n const context = React.useContext(ToastRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.' : _formatErrorMessage(66));\n }\n return context;\n}","export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}","import { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode } from '@floating-ui/utils/dom';\nexport function isScrollableY(element, allowOverflowIntent = false) {\n const {\n overflowY\n } = getComputedStyle(element);\n if (overflowY !== 'auto' && overflowY !== 'scroll') {\n return false;\n }\n // When `allowOverflowIntent` is true, a container that overflows only once extra space is\n // added (e.g. drawer keyboard scroll slack) still counts, as long as it has layout size on\n // the axis.\n return allowOverflowIntent ? element.clientHeight > 0 : element.scrollHeight > element.clientHeight;\n}\nexport function isScrollableX(element, allowOverflowIntent = false) {\n const {\n overflowX\n } = getComputedStyle(element);\n if (overflowX !== 'auto' && overflowX !== 'scroll') {\n return false;\n }\n return allowOverflowIntent ? element.clientWidth > 0 : element.scrollWidth > element.clientWidth;\n}\nexport function isScrollable(element, axis, allowOverflowIntent = false) {\n return axis === 'vertical' ? isScrollableY(element, allowOverflowIntent) : isScrollableX(element, allowOverflowIntent);\n}\nexport function findScrollableAncestor(target, root, axis, allowOverflowIntent = false) {\n // `getParentNode` crosses shadow boundaries (and slots), so a target inside a shadow root\n // still walks up to scrollable ancestors in the light DOM. Non-HTML targets (SVG, MathML)\n // can't scroll, but their HTML ancestors can.\n let node = target;\n while (isElement(node) && node !== root && !isLastTraversableNode(node)) {\n if (isHTMLElement(node) && isScrollable(node, axis, allowOverflowIntent)) {\n return node;\n }\n node = getParentNode(node);\n }\n return null;\n}\nexport function findScrollableTouchTarget(target, root, axis = 'vertical', allowOverflowIntent = false) {\n return findScrollableAncestor(target, root, axis, allowOverflowIntent) ?? (isScrollable(root, axis, allowOverflowIntent) ? root : null);\n}","// `Document.elementFromPoint` retargets shadow content to the shadow host, which then fails\n// `contains()` checks against a popup inside that shadow root, so callers pass `getRootNode()`\n// (a document or a shadow root) rather than `ownerDocument()`.\nexport function getElementAtPoint(root, x, y) {\n return typeof root?.elementFromPoint === 'function' ? root.elementFromPoint(x, y) : null;\n}","import { ownerWindow } from '@base-ui/utils/owner';\n\n/**\n * Extracts the 2D translation and scale from the element's computed `transform` matrix.\n * Note that the `translate`, `rotate`, and `scale` longhands are separate properties and\n * are not reflected in the computed `transform` value.\n *\n * Pass `computedStyle` when the caller has already resolved it to avoid a second lookup.\n */\nexport function getElementTransform(element, computedStyle) {\n const transform = (computedStyle ?? ownerWindow(element).getComputedStyle(element)).transform;\n let translateX = 0;\n let translateY = 0;\n let scale = 1;\n if (transform && transform !== 'none') {\n const matrix = transform.match(/matrix(?:3d)?\\(([^)]+)\\)/);\n if (matrix) {\n const values = matrix[1].split(', ').map(parseFloat);\n if (values.length === 6) {\n translateX = values[4];\n translateY = values[5];\n scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);\n } else if (values.length === 16) {\n translateX = values[12];\n translateY = values[13];\n scale = values[0];\n }\n }\n }\n return {\n x: translateX,\n y: translateY,\n scale\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { closest, contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { findScrollableAncestor, findScrollableTouchTarget } from \"./scrollable.mjs\";\nimport { getElementAtPoint } from \"./getElementAtPoint.mjs\";\nimport { getElementTransform } from \"./getElementTransform.mjs\";\nconst DEFAULT_SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst MIN_VELOCITY_DURATION_MS = 50;\n// Under one frame at 240 Hz, so it only damps near-simultaneous samples.\nconst MIN_RELEASE_VELOCITY_DURATION_MS = 4;\nconst MAX_RELEASE_VELOCITY_AGE_MS = 80;\nconst MIN_VELOCITY_SAMPLE_DISTANCE = 1;\nconst DEFAULT_IGNORE_SELECTOR = 'button,a,input,select,textarea,label,[role=\"button\"]';\nexport function getDisplacement(direction, deltaX, deltaY) {\n switch (direction) {\n case 'up':\n return -deltaY;\n case 'down':\n return deltaY;\n case 'left':\n return -deltaX;\n case 'right':\n return deltaX;\n default:\n return 0;\n }\n}\nfunction getValidTimeStamp(timeStamp) {\n return Number.isFinite(timeStamp) && timeStamp > 0 ? timeStamp : null;\n}\nfunction getDragTransform(dragOffset, scale) {\n return `translate3d(${dragOffset.x}px,${dragOffset.y}px,0) scale(${scale})`;\n}\nfunction hasPrimaryMouseButton(buttons) {\n return buttons % 2 === 1;\n}\nfunction safelyChangePointerCapture(element, pointerId, method) {\n const pointerCaptureMethod = element[method];\n if (typeof pointerCaptureMethod !== 'function') {\n return;\n }\n try {\n pointerCaptureMethod.call(element, pointerId);\n } catch (error) {\n if (error && typeof error === 'object' && 'name' in error && error.name === 'NotFoundError') {\n return;\n }\n throw error;\n }\n}\nexport function useSwipeDismiss(options) {\n const {\n enabled,\n directions,\n elementRef,\n movementCssVars,\n canStart,\n ignoreSelectorWhenTouch = true,\n ignoreScrollableAncestors = false,\n swipeThreshold: swipeThresholdProp,\n onDismiss,\n onProgress,\n onCancel,\n onSwipeStart,\n onRelease,\n onSwipingChange,\n trackDrag = true\n } = options;\n const ignoreSelector = DEFAULT_IGNORE_SELECTOR;\n const primaryDirection = directions.length === 1 ? directions[0] : undefined;\n const swipeThresholdDefault = Math.max(0, typeof swipeThresholdProp === 'number' ? swipeThresholdProp : DEFAULT_SWIPE_THRESHOLD);\n const allowLeft = directions.includes('left');\n const allowRight = directions.includes('right');\n const allowUp = directions.includes('up');\n const allowDown = directions.includes('down');\n const hasHorizontal = allowLeft || allowRight;\n const hasVertical = allowUp || allowDown;\n\n // Consumers only pass directions on a single axis.\n const scrollAxis = hasHorizontal ? 'horizontal' : 'vertical';\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [dragDismissed, setDragDismissed] = React.useState(false);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastMovePosRef = React.useRef(null);\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const pendingSwipeRef = React.useRef(false);\n const pendingSwipeStartPosRef = React.useRef(null);\n const swipeFromScrollableRef = React.useRef(false);\n const sawPrimaryButtonsOnMoveRef = React.useRef(false);\n const elementSizeRef = React.useRef({\n width: 0,\n height: 0\n });\n const swipeProgressRef = React.useRef(0);\n const swipeThresholdRef = React.useRef(swipeThresholdDefault);\n const swipeThresholdFunctionRef = React.useRef(null);\n const swipeStartTimeRef = React.useRef(null);\n const lastDragSampleRef = React.useRef(null);\n const hasStationarySampleRef = React.useRef(false);\n const lastDragVelocityRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastProgressDetailsRef = React.useRef(null);\n const isSwipingRef = React.useRef(false);\n const dragStyleSnapshotRef = React.useRef(null);\n const setSwiping = useStableCallback(nextSwiping => {\n if (isSwipingRef.current === nextSwiping) {\n return;\n }\n isSwipingRef.current = nextSwiping;\n setIsSwiping(nextSwiping);\n onSwipingChange?.(nextSwiping);\n });\n function resolveSwipeThreshold(direction) {\n if (!direction) {\n return;\n }\n const element = elementRef.current;\n const thresholdFunction = swipeThresholdFunctionRef.current;\n if (!element || !thresholdFunction) {\n return;\n }\n const value = thresholdFunction({\n element,\n direction\n });\n swipeThresholdRef.current = Math.max(0, value);\n }\n const updateSwipeProgress = useStableCallback((progress, details) => {\n const nextProgress = Number.isFinite(progress) ? clamp(progress, 0, 1) : 0;\n const progressChanged = nextProgress !== swipeProgressRef.current;\n let detailsChanged = false;\n if (details) {\n const lastDetails = lastProgressDetailsRef.current;\n detailsChanged = !lastDetails || lastDetails.deltaX !== details.deltaX || lastDetails.deltaY !== details.deltaY || lastDetails.direction !== details.direction;\n }\n if (!progressChanged && !detailsChanged) {\n return;\n }\n swipeProgressRef.current = nextProgress;\n if (details) {\n lastProgressDetailsRef.current = details;\n } else if (progressChanged) {\n lastProgressDetailsRef.current = null;\n }\n onProgress?.(nextProgress, details);\n });\n const syncDragStyles = useStableCallback(swiping => {\n const element = elementRef.current;\n if (!trackDrag || !element) {\n if (!swiping) {\n dragStyleSnapshotRef.current = null;\n }\n return;\n }\n const style = element.style;\n const dragStyleSnapshot = dragStyleSnapshotRef.current;\n if (swiping) {\n if (!dragStyleSnapshot) {\n dragStyleSnapshotRef.current = [style.transition, style.transform];\n }\n style.transition = 'none';\n } else if (dragStyleSnapshot) {\n [style.transition, style.transform] = dragStyleSnapshot;\n dragStyleSnapshotRef.current = null;\n }\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (swiping) {\n style.transform = getDragTransform(dragOffset, initialTransform.scale);\n }\n style.setProperty(movementCssVars.x, `${deltaX}px`);\n style.setProperty(movementCssVars.y, `${deltaY}px`);\n });\n function recordDragSample(offset, timeStamp) {\n if (timeStamp === null) {\n return;\n }\n const lastSample = lastDragSampleRef.current;\n if (lastSample && timeStamp > lastSample.time) {\n // Some Android devices emit one effectively stationary move immediately before release.\n // Keep the last moving sample and its timestamp. Repeated stationary moves still clear\n // the velocity, and a release after a hold still expires the last moving sample.\n const stationary = Math.abs(offset.x - lastSample.x) < MIN_VELOCITY_SAMPLE_DISTANCE && Math.abs(offset.y - lastSample.y) < MIN_VELOCITY_SAMPLE_DISTANCE;\n const skipSample = stationary && !hasStationarySampleRef.current;\n hasStationarySampleRef.current = stationary;\n if (skipSample) {\n return;\n }\n const durationMs = Math.max(timeStamp - lastSample.time, MIN_RELEASE_VELOCITY_DURATION_MS);\n lastDragVelocityRef.current = {\n x: (offset.x - lastSample.x) / durationMs,\n y: (offset.y - lastSample.y) / durationMs\n };\n }\n lastDragSampleRef.current = {\n x: offset.x,\n y: offset.y,\n time: timeStamp\n };\n }\n const reset = React.useCallback(() => {\n setCurrentSwipeDirection(undefined);\n setSwiping(false);\n setDragDismissed(false);\n updateSwipeProgress(0);\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = null;\n dragStartPosRef.current = {\n x: 0,\n y: 0\n };\n dragOffsetRef.current = {\n x: 0,\n y: 0\n };\n initialTransformRef.current = {\n x: 0,\n y: 0,\n scale: 1\n };\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n cancelledSwipeRef.current = false;\n swipeCancelBaselineRef.current = {\n x: 0,\n y: 0\n };\n isFirstPointerMoveRef.current = false;\n lastMovePosRef.current = null;\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = false;\n elementSizeRef.current = {\n width: 0,\n height: 0\n };\n swipeStartTimeRef.current = null;\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n lastProgressDetailsRef.current = null;\n syncDragStyles(false);\n }, [setSwiping, swipeThresholdDefault, syncDragStyles, updateSwipeProgress]);\n function getPrimaryPointerPosition(event) {\n if ('touches' in event) {\n const touch = event.touches[0];\n return touch ? {\n x: touch.clientX,\n y: touch.clientY\n } : null;\n }\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n function isTouchLikeEvent(event) {\n if ('touches' in event) {\n return true;\n }\n return event.pointerType === 'touch';\n }\n function getTargetAtPoint(position, nativeEvent) {\n const root = elementRef.current?.getRootNode();\n const elementAtPoint = getElementAtPoint(root, position.x, position.y);\n const target = elementAtPoint ?? getTarget(nativeEvent);\n return target;\n }\n function findGestureScrollableTouchTarget(target, root) {\n // The swiped element is positioned relative to the viewport, so the page scroller must not\n // gate the gesture (a reset like `html, body { height: 100%; overflow: auto }` makes `body`\n // a real scroll container). The drawer viewport's native touchmove handler already ignores it.\n const find = axis => {\n const scrollTarget = findScrollableTouchTarget(target, root, axis);\n const doc = ownerDocument(scrollTarget);\n return scrollTarget === doc.body || scrollTarget === doc.documentElement ? null : scrollTarget;\n };\n return find(scrollAxis);\n }\n function startSwipeAtPosition(event, position, startOptions) {\n swipeFromScrollableRef.current = false;\n const touchLike = isTouchLikeEvent(event);\n const target = getTargetAtPoint(position, event.nativeEvent);\n const doc = ownerDocument(elementRef.current);\n const body = doc.body;\n const scrollableTarget = touchLike && body ? findGestureScrollableTouchTarget(target, body) : null;\n const ignoreScrollableTarget = startOptions?.ignoreScrollableTarget ?? false;\n if (scrollableTarget && !ignoreScrollableTarget) {\n return false;\n }\n swipeFromScrollableRef.current = Boolean(scrollableTarget && ignoreScrollableTarget);\n const isInteractiveElement = closest(target, ignoreSelector);\n if (isInteractiveElement && (!touchLike || ignoreSelectorWhenTouch)) {\n return false;\n }\n const element = elementRef.current;\n if (ignoreScrollableAncestors && element && target) {\n const ignoreAncestors = startOptions?.ignoreScrollableAncestors ?? false;\n if (!ignoreAncestors && findScrollableAncestor(target, element, scrollAxis) != null) {\n return false;\n }\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n dragStartPosRef.current = position;\n swipeStartTimeRef.current = getValidTimeStamp(event.timeStamp);\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n swipeCancelBaselineRef.current = position;\n lastMovePosRef.current = position;\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = typeof swipeThresholdProp === 'function' ? swipeThresholdProp : null;\n if (element) {\n elementSizeRef.current = {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n resolveSwipeThreshold(primaryDirection);\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n dragOffsetRef.current = {\n x: transform.x,\n y: transform.y\n };\n recordDragSample({\n x: transform.x,\n y: transform.y\n }, swipeStartTimeRef.current);\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'setPointerCapture');\n }\n }\n onSwipeStart?.(event.nativeEvent);\n setSwiping(true);\n isFirstPointerMoveRef.current = true;\n updateSwipeProgress(0);\n syncDragStyles(true);\n return true;\n }\n function resetPendingSwipeState() {\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n lastMovePosRef.current = null;\n }\n function clearPendingSwipeStartState() {\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n }\n function cancelSwipeInteraction(event) {\n resetPendingSwipeState();\n if (!isSwipingRef.current) {\n return;\n }\n setSwiping(false);\n const resolvedInitialTransform = initialTransformRef.current;\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n sawPrimaryButtonsOnMoveRef.current = false;\n syncDragStyles(false);\n const element = elementRef.current;\n if (element) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n updateSwipeProgress(0, {\n deltaX: 0,\n deltaY: 0,\n direction: undefined\n });\n onCancel?.(event.nativeEvent);\n }\n function applyDirectionalDamping(deltaX, deltaY) {\n const exponent = value => Math.sign(value) * Math.abs(value) ** 0.5;\n const dampAxis = (delta, allowNegative, allowPositive) => {\n if (!allowNegative && delta < 0 || !allowPositive && delta > 0) {\n return exponent(delta);\n }\n return delta;\n };\n const newDeltaX = hasHorizontal ? dampAxis(deltaX, allowLeft, allowRight) : exponent(deltaX);\n const newDeltaY = hasVertical ? dampAxis(deltaY, allowUp, allowDown) : exponent(deltaY);\n return {\n x: newDeltaX,\n y: newDeltaY\n };\n }\n function canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY) {\n // Swiping toward the axis start edge (down/right) is allowed when scrolled to the start;\n // toward the end edge (up/left) when scrolled to the end.\n const canSwipeOnAxis = (delta, scrollOffset, maxScrollOffset, allowTowardStart, allowTowardEnd) => delta > 0 && scrollOffset <= 0 && allowTowardStart || delta < 0 && scrollOffset >= Math.max(0, maxScrollOffset) && allowTowardEnd;\n if (hasVertical && deltaY !== 0) {\n return canSwipeOnAxis(deltaY, scrollTarget.scrollTop, scrollTarget.scrollHeight - scrollTarget.clientHeight, allowDown, allowUp);\n }\n if (hasHorizontal && deltaX !== 0) {\n return canSwipeOnAxis(deltaX, scrollTarget.scrollLeft, scrollTarget.scrollWidth - scrollTarget.clientWidth, allowRight, allowLeft);\n }\n return null;\n }\n const handleStart = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n if (event.defaultPrevented || event.nativeEvent.defaultPrevented) {\n return;\n }\n if (!('touches' in event) && event.button !== 0) {\n return;\n }\n const startPos = getPrimaryPointerPosition(event);\n if (!startPos) {\n return;\n }\n pendingSwipeRef.current = true;\n pendingSwipeStartPosRef.current = startPos;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = !('touches' in event);\n const allowedToStart = canStart ? canStart(startPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (!allowedToStart) {\n return;\n }\n if (startSwipeAtPosition(event, startPos)) {\n clearPendingSwipeStartState();\n }\n });\n function handleMoveCore(event, position, movement) {\n if (!enabled || !isSwipingRef.current) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n if (isTouchLikeEvent(event) && !swipeFromScrollableRef.current) {\n const boundaryElement = event.currentTarget;\n if (findGestureScrollableTouchTarget(target, boundaryElement)) {\n return;\n }\n }\n if (!('touches' in event)) {\n // Prevent text selection on Safari\n event.preventDefault();\n }\n if (isFirstPointerMoveRef.current) {\n isFirstPointerMoveRef.current = false;\n // Reset the drag origin to the first move's position to absorb the gap between the press and\n // the first move event — notably on iOS touch, where the first `touchmove` arrives already\n // offset from the `touchstart` — which would otherwise make the dragged element jump. This\n // only matters when an element follows the pointer; when `trackDrag` is false (e.g. the\n // swipe-area, which only opens the drawer) keep the original press position so a quick flick\n // still registers: on a low-refresh-rate display the whole travel can land in this single\n // first move, and discarding it would drop the gesture.\n if (trackDrag) {\n dragStartPosRef.current = position;\n const moveTime = getValidTimeStamp(event.timeStamp);\n if (moveTime !== null) {\n swipeStartTimeRef.current = moveTime;\n }\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n }\n }\n const clientX = position.x;\n const clientY = position.y;\n const movementX = movement.x;\n const movementY = movement.y;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate) {\n const isAllowed = candidate === 'left' && allowLeft || candidate === 'right' && allowRight || candidate === 'up' && allowUp || candidate === 'down' && allowDown;\n if (isAllowed) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n resolveSwipeThreshold(candidate);\n }\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > swipeThresholdRef.current) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(allowLeft && allowRight) && !(allowUp && allowDown) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n if (hasHorizontal) {\n newOffsetX += dampedDelta.x;\n }\n if (hasVertical) {\n newOffsetY += dampedDelta.y;\n }\n\n // Only rewrite drag styles when the drag offset actually changed. `syncDragStyles` writes the\n // raw (undamped) frozen transform and movement vars, relying on the consumer's `onProgress`\n // to overwrite them with damped styles — but `updateSwipeProgress` dedupes unchanged\n // deltas and skips `onProgress`. A move that doesn't change the offset (e.g. the cursor\n // pinned at a screen edge during an off-screen drag, jittering only on the ignored axis)\n // would otherwise reinstate the raw styles with no correction, jumping the element to the\n // undamped position.\n const previousOffset = dragOffsetRef.current;\n const offsetChanged = newOffsetX !== previousOffset.x || newOffsetY !== previousOffset.y;\n dragOffsetRef.current = {\n x: newOffsetX,\n y: newOffsetY\n };\n if (offsetChanged) {\n syncDragStyles(true);\n }\n recordDragSample({\n x: newOffsetX,\n y: newOffsetY\n }, getValidTimeStamp(event.timeStamp));\n const dragDeltaX = newOffsetX - initialTransformRef.current.x;\n const dragDeltaY = newOffsetY - initialTransformRef.current.y;\n const progressDetails = {\n deltaX: dragDeltaX,\n deltaY: dragDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n let progress = 0;\n const progressDirection = primaryDirection ?? intendedSwipeDirectionRef.current;\n if (progressDirection) {\n const size = progressDirection === 'left' || progressDirection === 'right' ? elementSizeRef.current.width : elementSizeRef.current.height;\n const scale = initialTransformRef.current.scale || 1;\n const progressDisplacement = getDisplacement(progressDirection, dragDeltaX, dragDeltaY);\n if (size > 0 && scale > 0 && progressDisplacement > 0) {\n progress = progressDisplacement / (size * scale);\n }\n }\n updateSwipeProgress(progress, progressDetails);\n }\n const handleEnd = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const resolvedInitialTransform = initialTransformRef.current;\n const releaseDeltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const releaseDeltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n const progressDetails = {\n deltaX: releaseDeltaX,\n deltaY: releaseDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n if (!isSwipingRef.current) {\n resetPendingSwipeState();\n updateSwipeProgress(0, progressDetails);\n return;\n }\n setSwiping(false);\n resetPendingSwipeState();\n sawPrimaryButtonsOnMoveRef.current = false;\n const element = elementRef.current;\n if (element) {\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n }\n const deltaX = releaseDeltaX;\n const deltaY = releaseDeltaY;\n const startTime = swipeStartTimeRef.current;\n const endTime = getValidTimeStamp(event.timeStamp);\n const durationMs = startTime !== null && endTime !== null && endTime > startTime ? endTime - startTime : 0;\n const velocityDurationMs = durationMs > 0 ? Math.max(durationMs, MIN_VELOCITY_DURATION_MS) : 0;\n const velocityX = velocityDurationMs > 0 ? deltaX / velocityDurationMs : 0;\n const velocityY = velocityDurationMs > 0 ? deltaY / velocityDurationMs : 0;\n let releaseVelocityX = lastDragVelocityRef.current.x;\n let releaseVelocityY = lastDragVelocityRef.current.y;\n const lastSample = lastDragSampleRef.current;\n if (lastSample && endTime !== null && endTime >= lastSample.time) {\n const ageMs = endTime - lastSample.time;\n if (ageMs <= MAX_RELEASE_VELOCITY_AGE_MS) {\n const sampleDurationMs = Math.max(ageMs, MIN_RELEASE_VELOCITY_DURATION_MS);\n const deltaFromLastSampleX = resolvedDragOffset.x - lastSample.x;\n const deltaFromLastSampleY = resolvedDragOffset.y - lastSample.y;\n const sampleVelocityX = deltaFromLastSampleX / sampleDurationMs;\n const sampleVelocityY = deltaFromLastSampleY / sampleDurationMs;\n if (Math.abs(deltaFromLastSampleX) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityX = sampleVelocityX;\n }\n if (Math.abs(deltaFromLastSampleY) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityY = sampleVelocityY;\n }\n } else {\n releaseVelocityX = 0;\n releaseVelocityY = 0;\n }\n }\n const releaseDecision = onRelease?.({\n event: event.nativeEvent,\n direction: intendedSwipeDirectionRef.current,\n deltaX,\n deltaY,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n });\n const hasReleaseDecision = typeof releaseDecision === 'boolean';\n if (cancelledSwipeRef.current && !hasReleaseDecision) {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n return;\n }\n let shouldClose = false;\n let dismissDirection;\n if (hasReleaseDecision) {\n shouldClose = releaseDecision;\n dismissDirection = intendedSwipeDirectionRef.current ?? primaryDirection;\n } else {\n for (const direction of directions) {\n if (getDisplacement(direction, deltaX, deltaY) > swipeThresholdRef.current) {\n shouldClose = true;\n dismissDirection = direction;\n break;\n }\n }\n }\n if (shouldClose && dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n setDragDismissed(true);\n syncDragStyles(false);\n onDismiss?.(event.nativeEvent, {\n direction: dismissDirection\n });\n } else {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n }\n });\n const handleMove = useStableCallback(event => {\n const currentPos = getPrimaryPointerPosition(event);\n if (!currentPos) {\n return;\n }\n let endAfterMove = false;\n if (!('touches' in event)) {\n const hasPrimaryButton = hasPrimaryMouseButton(event.buttons);\n if (hasPrimaryButton) {\n sawPrimaryButtonsOnMoveRef.current = true;\n }\n\n // Cancel the swipe if a non-primary button takes over the interaction.\n // This handles cases where a right-click interrupts dragging.\n if (event.buttons !== 0 && !hasPrimaryButton) {\n cancelSwipeInteraction(event);\n return;\n }\n\n // A `buttons: 0` pointermove means the primary button was already released, so the gesture is\n // over even if no pointerup reached us. On fast trackpad flicks this trailing move is\n // dispatched just before pointerup; treat it as the release (mirroring touchend) instead of\n // cancelling and snapping the element back.\n if (event.buttons === 0 && sawPrimaryButtonsOnMoveRef.current) {\n if (!isSwipingRef.current) {\n // The gesture never activated — discard it.\n handleEnd(event);\n return;\n }\n // This release move can itself carry the threshold-crossing displacement (and the peak\n // release velocity), so let it flow through `handleMoveCore` below to update the drag\n // offset / velocity sample, then commit the release afterwards.\n endAfterMove = true;\n }\n }\n if (!isSwiping && pendingSwipeRef.current) {\n if (!isTouchLikeEvent(event) && (event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n resetPendingSwipeState();\n return;\n }\n const allowedToStart = canStart ? canStart(currentPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (allowedToStart) {\n const pendingStartPos = pendingSwipeStartPosRef.current;\n let ignoreScrollableOnStart = false;\n if (isTouchLikeEvent(event)) {\n const element = elementRef.current;\n if (pendingStartPos && element) {\n const target = getTargetAtPoint(currentPos, event.nativeEvent);\n const doc = ownerDocument(element);\n const body = doc.body;\n const scrollTarget = body ? findGestureScrollableTouchTarget(target, body) : null;\n if (scrollTarget && (contains(element, scrollTarget) || contains(scrollTarget, element))) {\n const deltaX = currentPos.x - pendingStartPos.x;\n const deltaY = currentPos.y - pendingStartPos.y;\n const canSwipeFromEdge = canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY);\n if (canSwipeFromEdge === false) {\n return;\n }\n if (canSwipeFromEdge === true) {\n ignoreScrollableOnStart = true;\n }\n }\n }\n }\n const started = startSwipeAtPosition(event, currentPos, {\n ignoreScrollableTarget: ignoreScrollableOnStart,\n ignoreScrollableAncestors: ignoreScrollableOnStart\n });\n if (started) {\n if (pendingStartPos && ignoreScrollableOnStart) {\n // Preserve displacement between touchstart and the move that activates swipe from\n // a scroll-edge so quick flicks can dismiss.\n clearPendingSwipeStartState();\n dragStartPosRef.current = pendingStartPos;\n swipeCancelBaselineRef.current = pendingStartPos;\n lastMovePosRef.current = pendingStartPos;\n isFirstPointerMoveRef.current = false;\n } else {\n // Start from the current in-bounds position without dropping follow-up move\n // displacement; this avoids jumps when entering from outside the element while\n // keeping swipe tracking responsive on the next move.\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n }\n }\n }\n }\n const previousPos = lastMovePosRef.current;\n const movement = previousPos === null ? {\n x: 0,\n y: 0\n } : {\n x: currentPos.x - previousPos.x,\n y: currentPos.y - previousPos.y\n };\n lastMovePosRef.current = currentPos;\n handleMoveCore(event, currentPos, movement);\n\n // `endAfterMove` is only set in the non-touch branch above; the `'touches'` guard re-narrows the\n // event type for `handleEnd` after the shared move handling has run.\n if (endAfterMove && !('touches' in event)) {\n handleEnd(event);\n }\n });\n\n // Feeds a native touchmove into the swipe pipeline. Used by consumers that claim the gesture\n // in a capture-phase listener and stop it from reaching React's delegated touch handlers.\n const moveNative = useStableCallback((nativeEvent, currentTarget) => {\n handleMove({\n touches: nativeEvent.touches,\n currentTarget,\n nativeEvent,\n defaultPrevented: nativeEvent.defaultPrevented,\n timeStamp: nativeEvent.timeStamp\n });\n });\n const getDragStyles = React.useCallback(() => {\n // Read `isSwipingRef`, not the lagging `isSwiping` state, to match the imperative writer\n // `syncDragStyles`. Otherwise a render that commits before `setSwiping(true)` flushes strips the\n // transform it just wrote, flashing the popup to its resting position for a frame.\n const swiping = isSwipingRef.current;\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (!swiping && deltaX === 0 && deltaY === 0 && !dragDismissed) {\n return {\n [movementCssVars.x]: '0px',\n [movementCssVars.y]: '0px'\n };\n }\n return {\n transition: swiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: swiping ? getDragTransform(dragOffset, initialTransform.scale) : undefined,\n [movementCssVars.x]: `${deltaX}px`,\n [movementCssVars.y]: `${deltaY}px`\n };\n }, [dragDismissed, movementCssVars]);\n const getPointerProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onPointerDown: handleStart,\n onPointerMove: handleMove,\n onPointerUp: handleEnd,\n onPointerCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n const getTouchProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onTouchStart: handleStart,\n onTouchMove: handleMove,\n onTouchEnd: handleEnd,\n onTouchCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n return {\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection,\n dragDismissed,\n getPointerProps,\n getTouchProps,\n moveNative,\n getDragStyles,\n reset\n };\n}","/**\n * Indicates the index of the toast in the list.\n * @type {number}\n */\nexport const index = '--toast-index';\n/**\n * Indicates the vertical pixels offset of the toast in the list when expanded.\n * @type {number}\n */\nexport const offsetY = '--toast-offset-y';\n/**\n * Indicates the measured natural height of the toast in pixels.\n * @type {number}\n */\nexport const height = '--toast-height';\n/**\n * Indicates the horizontal swipe movement of the toast.\n * @type {number}\n */\nexport const swipeMovementX = '--toast-swipe-movement-x';\n/**\n * Indicates the vertical swipe movement of the toast.\n * @type {number}\n */\nexport const swipeMovementY = '--toast-swipe-movement-y';","import { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Present when the toast is expanded in the viewport.\n * @type {boolean}\n */\nexport const expanded = 'data-expanded';\n/**\n * Present when the toast was limited because the toast limit was exceeded.\n * @type {boolean}\n */\nexport const limited = 'data-limited';\n/**\n * The type of the toast.\n * @type {string}\n */\nexport const type = 'data-type';\n/**\n * Present when the toast is being swiped.\n * @type {boolean}\n */\nexport const swiping = 'data-swiping';\n/**\n * The direction the toast was swiped.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\nexport const swipeDirection = 'data-swipe-direction';\n/**\n * Present when the toast begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n/**\n * Present when the toast is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * A container for the contents of a toast.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastContent = /*#__PURE__*/React.forwardRef(function ToastContent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n visibleIndex,\n expanded,\n recalculateHeight\n } = useToastRootContext();\n const contentRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n recalculateHeight();\n const node = contentRef.current;\n if (!node || typeof ResizeObserver !== 'function' || typeof MutationObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(() => recalculateHeight(true));\n const mutationObserver = new MutationObserver(() => recalculateHeight(true));\n resizeObserver.observe(node);\n mutationObserver.observe(node, {\n childList: true,\n subtree: true,\n characterData: true\n });\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n };\n }, [recalculateHeight]);\n const behind = visibleIndex > 0;\n const state = {\n expanded,\n behind\n };\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, contentRef],\n state,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastContent.displayName = \"ToastContent\";","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { hasRenderableChildren } from \"./isRenderableNode.mjs\";\n\n/**\n * Shared logic for `Toast.Title` and `Toast.Description`, which only differ by the rendered tag,\n * the fallback content, and which id setter they register with. Resolves the content and returns\n * the pieces each part passes to `useRenderElement` and `useToastLabelElement`.\n */\nexport function useToastLabelPart(idProp, childrenProp, part) {\n const {\n toast,\n setTitleId,\n setDescriptionId\n } = useToastRootContext();\n const setId = part === 'title' ? setTitleId : setDescriptionId;\n const children = childrenProp ?? (part === 'title' ? toast.title : toast.description);\n const id = useId(idProp);\n return {\n id,\n children,\n type: toast.type,\n setId\n };\n}\n\n/**\n * Mounts the evaluated label element only when it carries renderable content (so a `render` prop's\n * own children count, while a childless styling-only `render` stays conditional), registering the\n * generated id with the root while the part renders.\n */\nexport function useToastLabelElement(element, id, setId) {\n const shouldRender = hasRenderableChildren(element);\n useIsoLayoutEffect(() => {\n if (!shouldRender) {\n return undefined;\n }\n setId(id);\n return () => {\n setId(currentId => currentId === id ? undefined : currentId);\n };\n }, [shouldRender, id, setId]);\n return shouldRender ? element : null;\n}","import * as React from 'react';\nexport function isRenderableNode(node) {\n if (node == null || typeof node === 'boolean' || node === '') {\n return false;\n }\n if (Array.isArray(node)) {\n return node.some(isRenderableNode);\n }\n return true;\n}\nexport function hasRenderableChildren(element) {\n return /*#__PURE__*/React.isValidElement(element) && isRenderableNode(element.props.children);\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useToastLabelElement, useToastLabelPart } from \"../utils/useToastLabelPart.mjs\";\n\n/**\n * A title that labels the toast.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastTitle = /*#__PURE__*/React.forwardRef(function ToastTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n id,\n children,\n type,\n setId\n } = useToastLabelPart(idProp, childrenProp, 'title');\n const state = {\n type\n };\n const element = useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n state,\n props: {\n ...elementProps,\n id,\n children\n }\n });\n return useToastLabelElement(element, id, setId);\n});\nif (process.env.NODE_ENV !== \"production\") ToastTitle.displayName = \"ToastTitle\";","'use client';\n\nimport * as React from 'react';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * Closes the toast when clicked.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastClose = /*#__PURE__*/React.forwardRef(function ToastClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const {\n toast,\n expanded\n } = useToastRootContext();\n const [hasFocus, setHasFocus] = React.useState(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n type: toast.type\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n 'aria-hidden': !expanded && !hasFocus,\n onClick() {\n store.closeToast(toast.id);\n },\n onFocus() {\n setHasFocus(true);\n },\n onBlur() {\n setHasFocus(false);\n }\n }, elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastClose.displayName = \"ToastClose\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortalLite } from \"../../utils/FloatingPortalLite.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A portal element that moves the viewport to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastPortal = /*#__PURE__*/React.forwardRef(function ToastPortal(props, forwardedRef) {\n return /*#__PURE__*/_jsx(FloatingPortalLite, {\n ref: forwardedRef,\n ...props\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastPortal.displayName = \"ToastPortal\";","'use client';\n\nimport * as React from 'react';\nimport { useToastProviderContext } from \"./provider/ToastProviderContext.mjs\";\n/**\n * Returns the array of toasts and methods to manage them.\n */\nexport function useToastManager() {\n const store = useToastProviderContext();\n const toasts = store.useState('toasts');\n return React.useMemo(() => ({\n toasts,\n add: store.addToast,\n close: store.closeToast,\n update: store.updateToast,\n promise: store.promiseToast\n }), [toasts, store]);\n}","/* __next_internal_action_entry_do_not_use__ [{\"401796a2b6f48cc59cc275e9fde4500326e4b698bb\":{\"name\":\"setPartyScopes\"}},\"web/features/outside-party/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"401796a2b6f48cc59cc275e9fde4500326e4b698bb\",callServer,void 0,findSourceMapURL,\"setPartyScopes\");export{$$RSC_SERVER_ACTION_1 as setPartyScopes};","/** What the tools table says once a change is kept (gateway scopes 4.3), in a Toast. */\nimport type { ScopeChange } from './scope-change';\n\nfunction listOf(scopes: readonly string[]): string {\n return scopes.length <= 1 ? scopes.join('') : `${scopes.slice(0, -1).join(', ')} and ${scopes.at(-1) ?? ''}`;\n}\n\nfunction toolsOf(count: number): string {\n return `${String(count)} ${count === 1 ? 'tool' : 'tools'}`;\n}\n\n/** The change, and why the fleet sees it only at the proxy ship's next statement when it does. */\nexport function statedMessage(message: string, statementRefusal: string | null): string {\n return statementRefusal === null ? message : `${message}; the fleet sees it at the proxy ship's next statement: ${statementRefusal}`;\n}\n\nexport function scopesSetMessage({ scopes, how, count }: { scopes: readonly string[]; how: ScopeChange; count: number }): string {\n if (how === 'remove') {\n return `${listOf(scopes)} removed from ${toolsOf(count)}`;\n }\n if (scopes.length === 0) {\n return `${toolsOf(count)} need${count === 1 ? 's' : ''} nothing of ${count === 1 ? 'its' : 'their'} own`;\n }\n return `${listOf(scopes)} set on ${toolsOf(count)}`;\n}\n\nexport function partyScopesSetMessage({ party, scopes }: { party: string; scopes: readonly string[] }): string {\n return scopes.length === 0 ? `Every tool of ${party} needs nothing beyond reaching it` : `Every tool of ${party} needs ${listOf(scopes)}`;\n}\n\nexport function suggestionsSetMessage(groups: readonly { scopes: readonly string[]; count: number }[]): string {\n return groups.map(({ scopes, count }) => `${listOf(scopes)} set on ${toolsOf(count)}`).join('; ');\n}\n\nexport function toolsSwitchedMessage({ count, isOn, statementRefusal }: { count: number; isOn: boolean; statementRefusal: string | null }): string {\n return statedMessage(`${toolsOf(count)} switched ${isOn ? 'on' : 'off'}`, statementRefusal);\n}\n\nexport function agentScopesSetMessage({ party, scopes }: { party: string; scopes: readonly string[] }): string {\n return scopes.length === 0 ? `Every message to ${party} needs nothing beyond reaching it` : `Every message to ${party} needs ${listOf(scopes)}`;\n}\n","/** A scope the fleet lists, with its one-line description, as an approver picks it. */\nexport interface ListedScope {\n scope: string;\n description: string;\n}\n\nconst CHIP = 'inline-flex items-center rounded-md border px-2 font-mono text-caption';\n\n/**\n * What a call needs, as chips (gateway scopes 4.3): the party's set muted, a\n * tool's own plain. A scope the fleet no longer lists is marked so: no ship\n * holds it, so every call needing it is refused until it is changed.\n */\nexport function NeedsChips({ party = [], own, listed }: { party?: readonly string[]; own: readonly string[]; listed: ReadonlySet<string> | null }) {\n if (party.length === 0 && own.length === 0) {\n return <span className=\"text-muted-foreground\">Nothing</span>;\n }\n const chip = (scope: string, isParty: boolean) => {\n const isGone = listed !== null && !listed.has(scope);\n const look = isGone ? 'border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg' : isParty ? 'border-transparent bg-muted text-muted-foreground' : 'border-border';\n return (\n <span key={`${isParty ? 'party' : 'own'}-${scope}`} className={`${CHIP} ${look}`} data-testid={isParty ? 'tools-table-party-scope' : 'tools-table-scope'} title={isGone ? 'No longer defined in the fleet' : isParty ? 'Every tool needs it' : undefined}>\n {scope}\n {isGone ? <span className=\"ml-1 font-sans\">(no longer defined)</span> : null}\n </span>\n );\n };\n return (\n <span className=\"flex flex-wrap gap-1\">\n {party.map((scope) => chip(scope, true))}\n {own.filter((scope) => !party.includes(scope)).map((scope) => chip(scope, false))}\n </span>\n );\n}\n","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { getOverflowAncestors, useDismiss, useFloatingRootContext, useListNavigation, useClick } from \"../../floating-ui-react/index.mjs\";\nimport { gridNavigation } from \"../../floating-ui-react/hooks/gridNavigation.mjs\";\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails, createGenericEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getHighlightReason } from \"../../utils/getHighlightReason.mjs\";\nimport { ComboboxFloatingContext, ComboboxDerivedItemsContext, ComboboxHasItemsContext, ComboboxRootContext, ComboboxInputValueContext } from \"./ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { attachPreventUnmountOnClose } from \"../../utils/popups/popupStoreUtils.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { createCollatorItemFilter } from \"./utils/index.mjs\";\nimport { useCoreFilter } from \"./utils/useFilter.mjs\";\nimport { useUnmountAfterClose } from \"../../internals/useUnmountAfterClose.mjs\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.mjs\";\nimport { isScrollableY } from \"../../utils/scrollable.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\nimport { NOOP } from \"../../internals/noop.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { stringifyAsLabel, stringifyAsValue, flattenLeafItems, isGroupedItems } from \"../../internals/resolveValueLabel.mjs\";\nimport { compareItemEquality, defaultItemEquality, findItemIndex, findSelectionIndex, isSelectedValueDirty, removeItem, selectedValueIncludes } from \"../../internals/itemEquality.mjs\";\nimport { INITIAL_LAST_HIGHLIGHT, NO_ACTIVE_VALUE } from \"./utils/constants.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { findCollectionItem } from \"../items/itemCollection.mjs\";\n\n/**\n * @internal\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function AriaCombobox(props) {\n const {\n id: idProp,\n onOpenChangeComplete: onOpenChangeCompleteProp,\n defaultSelectedValue = null,\n selectedValue: selectedValueProp,\n onSelectedValueChange,\n defaultInputValue,\n inputValue: inputValueProp,\n open: openProp,\n defaultOpen = false,\n selectionMode,\n onItemHighlighted: onItemHighlightedProp,\n name: nameProp,\n form,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n inputRef: inputRefProp,\n grid = false,\n items: itemsProp,\n filteredItems: filteredItemsProp,\n filter: filterProp,\n filterQuery: filterQueryProp,\n openOnInputClick = true,\n autoHighlight = false,\n keepHighlight = false,\n highlightItemOnHover = true,\n loopFocus = true,\n itemToStringLabel: itemToStringLabelProp,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n virtualized = false,\n inline: inlineProp = false,\n fillInputOnItemPress = true,\n modal = false,\n limit = -1,\n autoComplete = 'list',\n formAutoComplete,\n locale,\n submitOnItemClick = false\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n validityData,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const direction = useDirection();\n const id = useLabelableId({\n id: idProp\n });\n const collatorFilter = useCoreFilter({\n locale\n });\n\n // Plain items are arrays; normalized `createItems()` collections are objects.\n const collection = Array.isArray(itemsProp) ? null : itemsProp;\n if (collection && typeof collection.label !== 'function') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: the `items` prop received an object that is not a collection, ' + 'so its items cannot be read. Pass an array of items, an array of groups with items, ' + 'or the result of `createItems()`. ' + 'See https://base-ui.com/react/components/combobox#createitems' : _formatErrorMessage(100));\n }\n const items = collection ? collection.data : itemsProp;\n const itemToValue = collection?.value;\n\n // A projected collection's items live in the source domain, not the selection-value domain the\n // store matches against, so they are withheld from the store.\n const storeItems = itemToValue ? undefined : items;\n\n // The externally filtered items projected to their selection values, with a lookup back to the\n // source items. Declared before `itemToStringLabel`, which resolves labels from it on the\n // first render (initial input value).\n const externalWindow = React.useMemo(() => {\n if (!filteredItemsProp || !itemToValue) {\n return undefined;\n }\n const flat = flattenLeafItems(filteredItemsProp);\n const values = flat.map(itemToValue);\n let valueToItem;\n return {\n values,\n findItem(itemValue, isEqual) {\n if (!valueToItem) {\n valueToItem = new Map();\n for (let i = 0; i < values.length; i += 1) {\n if (!valueToItem.has(values[i])) {\n valueToItem.set(values[i], flat[i]);\n }\n }\n }\n return findCollectionItem(valueToItem, itemValue, isEqual);\n }\n };\n }, [filteredItemsProp, itemToValue]);\n\n // Labels selection values from current props only: collection data first, then the current\n // external window, then the prop. Nothing from a past window is remembered — keeping a value\n // resolvable over time means keeping its item in the collection's data.\n const itemToStringLabel = React.useMemo(() => {\n if (!collection) {\n return itemToStringLabelProp;\n }\n return itemValue => {\n return collection.label(itemValue, isItemEqualToValue, unresolvedValue => {\n const externalItem = externalWindow?.findItem(unresolvedValue, isItemEqualToValue);\n if (externalItem != null) {\n return collection.itemLabel(externalItem);\n }\n return stringifyAsLabel(unresolvedValue, itemToStringLabelProp);\n });\n };\n }, [collection, itemToStringLabelProp, externalWindow, isItemEqualToValue]);\n const filterItemToString = React.useMemo(() => {\n if (!collection) {\n return itemToStringLabelProp;\n }\n return Object.assign(item => collection.itemLabel(item), {\n selected: value => stringifyAsLabel(value, itemToStringLabel)\n });\n }, [collection, itemToStringLabel, itemToStringLabelProp]);\n function stringifyValueLabel(item) {\n return stringifyAsLabel(item, itemToStringLabel);\n }\n const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React.useState(false);\n const [closeQuery, setCloseQuery] = React.useState(null);\n const previousCloseQueryRef = React.useRef(closeQuery);\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const inputRef = React.useRef(null);\n const startDismissRef = React.useRef(null);\n const endDismissRef = React.useRef(null);\n const emptyRef = React.useRef(null);\n const hadInputClearRef = React.useRef(false);\n const chipsContainerRef = React.useRef(null);\n const clearRef = React.useRef(null);\n const selectionEventRef = React.useRef(null);\n const lastHighlightRef = React.useRef(INITIAL_LAST_HIGHLIGHT);\n const pendingQueryHighlightRef = React.useRef(null);\n\n /**\n * Contains the currently visible list of item values post-filtering.\n */\n const valuesRef = React.useRef([]);\n /**\n * The item element that received the last `pointerdown`, used to detect whether a\n * `mouseup` on an item belongs to a drag-select gesture that started elsewhere.\n */\n const pointerDownItemRef = React.useRef(null);\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const multiple = selectionMode === 'multiple';\n const single = selectionMode === 'single';\n const hasInputValue = inputValueProp !== undefined || defaultInputValue !== undefined;\n const hasItems = items !== undefined;\n const hasFilteredItemsProp = filteredItemsProp !== undefined;\n let autoHighlightMode;\n if (autoHighlight === 'always') {\n autoHighlightMode = 'always';\n } else {\n autoHighlightMode = autoHighlight ? 'input-change' : false;\n }\n const [selectedValue, setSelectedValueUnwrapped] = useControlled({\n controlled: selectedValueProp,\n default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue,\n name: 'Combobox',\n state: 'selectedValue'\n });\n const filter = React.useMemo(() => {\n if (filterProp === null) {\n return () => true;\n }\n if (filterProp !== undefined) {\n return filterProp;\n }\n // `shouldBypassFiltering` already empties the query whenever a single selection's label\n // matches it exactly, so the filter never needs a selection-aware variant here.\n return createCollatorItemFilter(collatorFilter, filterItemToString);\n }, [filterProp, collatorFilter, filterItemToString]);\n\n // If neither inputValue nor defaultInputValue are provided, derive it from the\n // selected value for single mode so the input reflects the selection on mount.\n const initialDefaultInputValue = useRefWithInit(() => {\n if (hasInputValue) {\n return defaultInputValue ?? '';\n }\n if (single) {\n return stringifyValueLabel(selectedValue);\n }\n return '';\n }).current;\n const [inputValue, setInputValueUnwrapped] = useControlled({\n controlled: inputValueProp,\n default: initialDefaultInputValue,\n name: 'Combobox',\n state: 'inputValue'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Combobox',\n state: 'open'\n });\n const isGrouped = isGroupedItems(items);\n const query = !open && closeQuery !== null ? closeQuery : String(inputValue).trim();\n const selectedLabelString = single ? stringifyValueLabel(selectedValue) : '';\n const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== '' && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);\n const filterQuery = shouldBypassFiltering ? '' : filterQueryProp ?? query;\n const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering && (!collection || collection.hasValue(selectedValue, isItemEqualToValue));\n const flatItems = React.useMemo(() => items ? flattenLeafItems(items) : EMPTY_ARRAY, [items]);\n const filteredItems = React.useMemo(() => {\n if (filteredItemsProp && !shouldIgnoreExternalFiltering) {\n return filteredItemsProp;\n }\n if (!items) {\n return EMPTY_ARRAY;\n }\n if (isGrouped) {\n const groupedItems = items;\n const resultingGroups = [];\n let currentCount = 0;\n for (const group of groupedItems) {\n if (limit > -1 && currentCount >= limit) {\n break;\n }\n const remainingLimit = limit > -1 ? limit - currentCount : Infinity;\n const itemsToTake = filterQuery === '' ? group.items.slice(0, remainingLimit) : [];\n if (filterQuery !== '') {\n for (const item of group.items) {\n if (itemsToTake.length >= remainingLimit) {\n break;\n }\n if (filter(item, filterQuery, filterItemToString)) {\n itemsToTake.push(item);\n }\n }\n }\n if (itemsToTake.length > 0) {\n const newGroup = {\n ...group,\n items: itemsToTake\n };\n resultingGroups.push(newGroup);\n currentCount += itemsToTake.length;\n }\n }\n return resultingGroups;\n }\n if (filterQuery === '') {\n return limit > -1 ? flatItems.slice(0, limit) :\n // The cast here is done as `flatItems` is readonly.\n // valuesRef.current, a mutable ref, can be set to `flatFilteredValues`, which may\n // reference this exact readonly value, creating a mutation risk.\n // However, <Combobox.Item> can never mutate this value as the mutating effect\n // bails early when `items` is provided, and this is only ever returned\n // when `items` is provided due to the early return at the top of this hook.\n flatItems;\n }\n const limitedItems = [];\n for (const item of flatItems) {\n if (limit > -1 && limitedItems.length >= limit) {\n break;\n }\n if (filter(item, filterQuery, filterItemToString)) {\n limitedItems.push(item);\n }\n }\n return limitedItems;\n }, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter, filterItemToString, flatItems]);\n\n /**\n * The filtered items flattened across groups and projected to their selection values.\n */\n const flatFilteredValues = React.useMemo(() => {\n if (externalWindow && filteredItems === filteredItemsProp) {\n return externalWindow.values;\n }\n // Explicit type argument: inferring it from a union of both shapes resolves `Item` to\n // `Group<Item>`, which tsc rejects and tsgo does not.\n const flat = flattenLeafItems(filteredItems);\n return itemToValue ? flat.map(item => itemToValue(item)) : flat;\n }, [filteredItems, filteredItemsProp, externalWindow, itemToValue]);\n const store = useRefWithInit(() => {\n // An inline list open on the first render never gets a closed pass of the closed-state\n // sync effect below, and `items`-prop lists don't self-register their index the way\n // individually rendered `<Combobox.Item>`s do, so the selected item was never highlighted.\n // Seeding the index here lets list navigation highlight and scroll to the selection on\n // mount. Computed once by construction, so a selection or list that resolves after mount\n // doesn't move an existing highlight or scroll the list away.\n let initialSelectedIndex = null;\n if (inlineProp && open && hasItems && selectionMode !== 'none') {\n initialSelectedIndex = findSelectionIndex(flatFilteredValues, selectedValue, isItemEqualToValue, multiple);\n }\n return new ReactStore({\n id,\n labelId: undefined,\n selectedValue,\n open,\n items: storeItems,\n selectionMode,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n virtualized,\n openOnInputClick,\n itemToStringLabel,\n isItemEqualToValue,\n modal,\n autoHighlight: autoHighlightMode,\n submitOnItemClick,\n hasInputValue,\n mounted: false,\n forceMounted: false,\n transitionStatus: 'idle',\n inline: inlineProp,\n activeIndex: null,\n selectedIndex: initialSelectedIndex,\n popupProps: {},\n listProps: {},\n inputProps: {},\n triggerProps: {},\n itemRoot: {\n props: EMPTY_OBJECT,\n id,\n selectionMode,\n disabled,\n readOnly,\n isItemEqualToValue\n },\n positionerElement: null,\n listElement: null,\n popupId: undefined,\n triggerElement: null,\n inputElement: null,\n inputGroupElement: null,\n popupSide: null,\n openMethod: null,\n inputInsidePopup: true,\n // Avoid duplicate names in the server HTML. Popup inputs aren't rendered\n // until after hydration, so the hidden input takes over then if needed.\n inputOwnsFormValue: selectionMode === 'none'\n }, {\n // Placeholder callbacks replaced on first render\n onOpenChangeComplete: NOOP,\n setOpen: NOOP,\n setInputValue: NOOP,\n setSelectedValue: NOOP,\n setIndices: NOOP,\n handleSelection: NOOP,\n forceMount: NOOP,\n requestSubmit: NOOP,\n listRef,\n labelsRef,\n popupRef,\n emptyRef,\n inputRef,\n startDismissRef,\n endDismissRef,\n chipsContainerRef,\n clearRef,\n valuesRef,\n pointerDownItemRef,\n selectionEventRef\n }, selectors);\n }).current;\n const fieldRawValue = selectionMode === 'none' ? inputValue : selectedValue;\n const fieldStringValue = React.useMemo(() => {\n if (selectionMode === 'none') {\n return fieldRawValue;\n }\n if (Array.isArray(selectedValue)) {\n return selectedValue.map(value => stringifyAsValue(value, itemToStringValue));\n }\n return stringifyAsValue(selectedValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue, selectionMode, selectedValue]);\n const onItemHighlighted = useStableCallback(onItemHighlightedProp);\n const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);\n const activeIndex = store.useState('activeIndex');\n const selectedIndex = store.useState('selectedIndex');\n const positionerElement = store.useState('positionerElement');\n const listElement = store.useState('listElement');\n const triggerElement = store.useState('triggerElement');\n const inputElement = store.useState('inputElement');\n const inputGroupElement = store.useState('inputGroupElement');\n const inline = store.useState('inline');\n const inputInsidePopup = store.useState('inputInsidePopup');\n const inputOwnsFormValue = store.useState('inputOwnsFormValue');\n const inputMatchesSelectedValue = single && !inputInsidePopup && inputValue === selectedLabelString;\n const triggerRef = useValueAsRef(triggerElement);\n const {\n openMethod,\n triggerProps\n } = useOpenInteractionType(open);\n const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled, nameProp);\n const forceMount = useStableCallback(() => {\n if (items) {\n // Ensure typeahead works on a closed list.\n labelsRef.current = flatFilteredValues.map(stringifyValueLabel);\n } else {\n store.set('forceMounted', true);\n }\n });\n\n /**\n * Emits `onItemHighlighted` for the item at `index`, or clears the highlight when `index` is `-1`\n * (a no-op if nothing was highlighted). Keeps `lastHighlightRef` in sync with what was emitted.\n */\n const emitHighlight = useStableCallback((value, index, type, event) => {\n if (index === -1) {\n if (lastHighlightRef.current === INITIAL_LAST_HIGHLIGHT) {\n return;\n }\n lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;\n } else {\n lastHighlightRef.current = {\n value,\n index\n };\n }\n onItemHighlighted(value, createGenericEventDetails(type, event, {\n index\n }));\n });\n const setIndices = useStableCallback(options => {\n const update = {};\n if (options.activeIndex !== undefined) {\n update.activeIndex = options.activeIndex;\n }\n if (options.selectedIndex !== undefined) {\n update.selectedIndex = options.selectedIndex;\n }\n store.update(update);\n const activeIndexOption = options.activeIndex;\n if (activeIndexOption === undefined) {\n return;\n }\n const type = options.type || REASONS.none;\n if (activeIndexOption === null) {\n emitHighlight(undefined, -1, type, options.event);\n } else {\n emitHighlight(valuesRef.current[activeIndexOption], activeIndexOption, type, options.event);\n }\n });\n const setInputValue = useStableCallback((next, eventDetails) => {\n props.onInputValueChange?.(next, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n\n // A canceled selection clear must not suppress close-completion cleanup.\n hadInputClearRef.current = eventDetails.reason === REASONS.inputClear;\n\n // If user is typing, ensure we don't auto-highlight on open due to a race\n // with the post-open effect that sets this flag.\n if (eventDetails.reason === REASONS.inputChange) {\n // A controlled popup may ignore a close request. Resuming input proves the popup\n // is remaining open, so release the query captured for an exit animation.\n if (open && closeQuery !== null) {\n setCloseQuery(null);\n }\n const event = eventDetails.event;\n const inputType = event.inputType;\n // Treat composition commits as typed input; autofill may omit `inputType` or\n // report `insertReplacementText`.\n const isTypedInput = event.type === 'compositionend' || inputType != null && inputType !== '' && inputType !== 'insertReplacementText';\n if (isTypedInput) {\n const hasQuery = next.trim() !== '';\n if (hasQuery) {\n setQueryChangedAfterOpen(true);\n }\n // Defer index updates until after the filtered items have been derived to ensure\n // `onItemHighlighted` receives the latest item.\n pendingQueryHighlightRef.current = {\n hasQuery\n };\n\n // Virtualized lists own their scroller. Reset regular lists directly so a stale\n // composite registry cannot select a reordered item and scrolling cannot escape\n // the popup.\n const list = store.state.listElement;\n if (!store.state.virtualized && list) {\n const popup = popupRef.current;\n for (const ancestor of getOverflowAncestors(list.firstElementChild ?? list)) {\n if (!isHTMLElement(ancestor) || (popup ? !contains(popup, ancestor) : ancestor.getAttribute('role') === 'dialog')) {\n break;\n }\n if (isScrollableY(ancestor)) {\n ancestor.scrollTop = 0;\n break;\n }\n }\n }\n if (hasQuery && autoHighlightMode && store.state.activeIndex == null && (open || inline)) {\n store.set('activeIndex', 0);\n }\n }\n } else if (eventDetails.reason === REASONS.inputClear && next === '' && store.state.inputInsidePopup) {\n // A programmatic clear of an active query (e.g. after selecting an item with the\n // input inside the popup): restore the highlight to the selected item.\n pendingQueryHighlightRef.current = {\n hasQuery: false,\n selection: true\n };\n }\n setInputValueUnwrapped(next);\n });\n const handleInterruptedReopen = useStableCallback(isInputChange => {\n // Preserve values supplied with the reopen rather than owned by the interrupted close.\n const clearsPendingInput = !isInputChange && inputInsidePopup && !inline && inputValue !== '' && (String(inputValue).trim() === closeQuery || inputValue === selectedLabelString);\n\n // Keep the flag while a visible filter survives so the `items` sync cannot overwrite it.\n if (!isInputChange && (clearsPendingInput || inputValue === '' || inputMatchesSelectedValue)) {\n setQueryChangedAfterOpen(false);\n }\n setCloseQuery(null);\n if (clearsPendingInput) {\n // Cleanup clears omit the selection flag and reopening gesture.\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n });\n const [preventUnmountOnClose, setPreventUnmountOnClose] = React.useState(false);\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n if (open === nextOpen) {\n return;\n }\n\n // If the `Empty` component is not used, the positioner or popup should be hidden\n // with CSS. In this case, allow the Escape key to bubble to close a parent popup\n // if there are no items to show.\n if (eventDetails.reason === REASONS.escapeKey && hasItems && flatFilteredValues.length === 0 && !emptyRef.current) {\n eventDetails.allowPropagation();\n }\n const openEventDetails = eventDetails;\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(openEventDetails);\n props.onOpenChange?.(nextOpen, openEventDetails);\n\n // A typed request must not highlight a later open: discard it when its own open is\n // rejected, or when any other open change goes through.\n if (pendingQueryHighlightRef.current?.hasQuery && eventDetails.reason === REASONS.inputChange === eventDetails.isCanceled) {\n pendingQueryHighlightRef.current = null;\n }\n if (eventDetails.isCanceled) {\n return;\n }\n if (nextOpen && closeQuery !== null) {\n // `ComboboxInput` calls `setInputValue` before `setOpen`, so on an input-change reopen\n // `inputValue` is still the pre-keystroke value and the typed filter always survives.\n handleInterruptedReopen(eventDetails.reason === REASONS.inputChange);\n }\n if (!nextOpen && queryChangedAfterOpen) {\n if (single) {\n if (!inline) {\n setCloseQuery(query);\n }\n // Avoid a flicker when closing the popup with an empty query.\n if (query === '') {\n setQueryChangedAfterOpen(false);\n }\n } else if (multiple) {\n if (!inline) {\n // Freeze the current query so filtering remains stable while exiting.\n setCloseQuery(query);\n }\n if (inputInsidePopup) {\n setIndices({\n activeIndex: null\n });\n }\n\n // Clear the input immediately on close while retaining filtering via closeQuery for exit animations\n // if the input is outside the popup. When the input is inside the popup, defer the clear until\n // unmount so the filtered list doesn't flash to unfiltered during the exit animation.\n if (!inputInsidePopup || inline) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event, undefined, {\n isItemPress: eventDetails.reason === REASONS.itemPress\n }));\n }\n }\n }\n if (!nextOpen) {\n setPreventUnmountOnClose(shouldPreventUnmountOnClose());\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && inputInsidePopup && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n }\n });\n const setSelectedValue = useStableCallback((nextValue, eventDetails) => {\n // Cast to `any` due to conditional value type (single vs. multiple).\n // The runtime implementation already ensures the correct value shape.\n onSelectedValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setSelectedValueUnwrapped(nextValue);\n const shouldFillInput = selectionMode === 'none' && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup;\n if (shouldFillInput) {\n setInputValue(stringifyValueLabel(nextValue), createChangeEventDetails(eventDetails.reason, eventDetails.event));\n }\n });\n const handleSelection = useStableCallback((event, itemValue) => {\n const targetEl = getTarget(event);\n const overrideEvent = selectionEventRef.current ?? event;\n selectionEventRef.current = null;\n const eventDetails = createChangeEventDetails(REASONS.itemPress, overrideEvent);\n\n // Let the link handle the click.\n const href = closest(targetEl, 'a')?.getAttribute('href');\n if (href) {\n if (href.startsWith('#')) {\n setOpen(false, eventDetails);\n }\n return;\n }\n if (multiple) {\n const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];\n const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, isItemEqualToValue);\n const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, isItemEqualToValue) : [...currentSelectedValue, itemValue];\n setSelectedValue(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n const wasFiltering = inputRef.current ? inputRef.current.value.trim() !== '' : false;\n if (!wasFiltering) {\n return;\n }\n if (store.state.inputInsidePopup) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event, undefined, {\n isItemPress: true\n }));\n // A newly selected item stays highlighted through the clear; a deselection\n // falls back to the standard selection anchor.\n const pendingHighlight = pendingQueryHighlightRef.current;\n if (pendingHighlight && !isCurrentlySelected) {\n pendingHighlight.toggledValue = itemValue;\n }\n } else {\n setOpen(false, eventDetails);\n }\n } else {\n setSelectedValue(itemValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpen(false, eventDetails);\n }\n });\n const requestSubmit = useStableCallback(() => {\n const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;\n if (formElement && typeof formElement.requestSubmit === 'function') {\n formElement.requestSubmit();\n }\n });\n const handleUnmountCleanup = useStableCallback(() => {\n onOpenChangeComplete?.(false);\n setQueryChangedAfterOpen(false);\n setCloseQuery(null);\n if (selectionMode === 'none') {\n setIndices({\n activeIndex: null,\n selectedIndex: null\n });\n } else {\n setIndices({\n activeIndex: null\n });\n }\n\n // Multiple selection mode:\n // If the user typed a filter and didn't select in multiple mode, clear the input\n // after close completes to avoid mid-exit flicker and start fresh on next open.\n if (multiple && inputRef.current && inputRef.current.value !== '' && !hadInputClearRef.current) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n\n // Single selection mode:\n // - If input is rendered inside the popup, clear it so the next open is blank\n // - If input is outside the popup, sync it to the selected value\n if (single) {\n if (store.state.inputInsidePopup) {\n if (inputRef.current && inputRef.current.value !== '') {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n } else {\n const stringVal = stringifyValueLabel(selectedValue);\n if (inputRef.current && inputRef.current.value !== stringVal) {\n // If no selection was made, treat this as clearing the typed filter.\n const reason = stringVal === '' ? REASONS.inputClear : REASONS.none;\n setInputValue(stringVal, createChangeEventDetails(reason));\n }\n }\n }\n });\n\n // Support composing the Dialog component around an inline combobox.\n // `[role=\"dialog\"]` is more interoperable than using a context, e.g. it can work\n // with third-party modal libraries, though the limitation is that the closest\n // `role=dialog` part must be the animated element.\n const resolvedPopupRef = React.useMemo(() => {\n if (inline && positionerElement) {\n return {\n current: closest(positionerElement, '[role=\"dialog\"]')\n };\n }\n return popupRef;\n }, [inline, positionerElement]);\n const {\n mounted,\n transitionStatus,\n forceUnmount: handleUnmount\n } = useUnmountAfterClose({\n open,\n ref: resolvedPopupRef,\n preventUnmountOnClose,\n setPreventUnmountOnClose,\n onUnmount: handleUnmountCleanup\n });\n React.useImperativeHandle(props.actionsRef, () => ({\n unmount: handleUnmount,\n close: () => setOpen(false, createChangeEventDetails(REASONS.imperativeAction))\n }), [handleUnmount, setOpen]);\n useIsoLayoutEffect(function syncSelectedIndex() {\n const closeQueryReleased = previousCloseQueryRef.current !== null && closeQuery === null;\n previousCloseQueryRef.current = closeQuery;\n\n // Closing indexes against the frozen filtered list. Reopening releases that query, so its\n // rendered coordinates must be synchronized again even though the popup is already open.\n if (open && (!closeQueryReleased || !hasItems)) {\n return;\n }\n\n // State-driven (not tied to the internal event path) so controlled closes\n // also clear a pointerdown that never received a matching item mouseup.\n if (!open) {\n pointerDownItemRef.current = null;\n }\n if (selectionMode === 'none') {\n return;\n }\n\n // Without `items`, look the selection up in the live registry of mounted item\n // values (the list stays mounted while closed when closed-state features need\n // it — trigger interaction and rendered-label autofill force-mount it). Mounted\n // items re-assert the index themselves when their registration moves; when\n // nothing is mounted the lookup resolves to `null` and each item re-registers\n // the index on the next open.\n // Keep the selected index in the coordinates of the list that is actually rendered.\n const registry = hasItems ? flatFilteredValues : valuesRef.current;\n setIndices({\n selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple)\n });\n }, [open, closeQuery, selectedValue, selectionMode, multiple, hasItems, flatFilteredValues, isItemEqualToValue, setIndices]);\n useIsoLayoutEffect(() => {\n if (items) {\n valuesRef.current = flatFilteredValues;\n listRef.current.length = flatFilteredValues.length;\n }\n }, [items, flatFilteredValues]);\n useIsoLayoutEffect(() => {\n // Controlled closes can bypass `setOpen`, and their exit animation may be interrupted.\n if (!open && pendingQueryHighlightRef.current?.hasQuery) {\n pendingQueryHighlightRef.current = null;\n }\n }, [open]);\n useIsoLayoutEffect(() => {\n // A kept-mounted dialog hides its inline list on close. Discard query-clear restoration\n // before it can overwrite the cleared highlight or report an item from the unfiltered list.\n if (!open && inline && resolvedPopupRef.current) {\n pendingQueryHighlightRef.current = null;\n return;\n }\n const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;\n const pendingHighlight = pendingQueryHighlightRef.current;\n if (pendingHighlight) {\n // A directly rendered list remains visible when the popup state is closed, while a\n // kept-mounted Positioner is hidden and should stay inert.\n const listIsNavigable = open || inline || store.state.positionerElement?.hidden === false;\n if (pendingHighlight.hasQuery) {\n const input = inputRef.current;\n // Keep the request while results or a controlled popup opening are pending,\n // but do not restore an inline highlight after focus has left the input.\n if (!autoHighlightMode || String(inputValue).trim() === '' || inline && autoHighlightMode !== 'always' && (!input || activeElement(input.ownerDocument) !== input)) {\n pendingQueryHighlightRef.current = null;\n } else if (listIsNavigable && (\n // Individually rendered items register without re-running this effect, and their\n // registry has holes mid-reindex, so resolve their request immediately.\n candidateItems[0] !== undefined || !hasItems && !hasFilteredItemsProp)) {\n store.set('activeIndex', 0);\n pendingQueryHighlightRef.current = null;\n }\n } else if (String(inputValue).trim() === '') {\n // Only handle the clear once it has committed (a controlled input may reject it),\n // so a restore cannot fire while a query is still active.\n pendingQueryHighlightRef.current = null;\n if (listIsNavigable) {\n const clearedBySelection = pendingHighlight.selection;\n if (autoHighlightMode === 'always' && !clearedBySelection && store.state.selectionMode === 'none') {\n // There is no selection to restore in Autocomplete. Keep the first-item reset\n // synchronous so list navigation sees it before a directly rendered list closes.\n store.set('activeIndex', 0);\n }\n\n // Items re-mounted by the clear publish their composite indices in a follow-up\n // commit, so the item registries are mid-update here. Defer past React's cascade.\n queueMicrotask(() => {\n if (!store.state.open && (!store.state.inline || resolvedPopupRef.current) || inputRef.current && inputRef.current.value.trim() !== '') {\n return;\n }\n\n // Return the highlight to the selected item, the same anchor the popup uses\n // when it first opens. Read the selection through the store so consumers can\n // pass an inline `isItemEqualToValue` or a fresh `selectedValue` array without\n // re-running this effect on every render.\n const currentSelectedValue = store.state.selectedValue;\n const isMultiple = store.state.selectionMode === 'multiple';\n const hasSelection = isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue.length > 0 : store.state.selectionMode !== 'none' && currentSelectedValue != null;\n if (hasSelection) {\n const registry = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;\n // A selection-driven clear keeps the just-selected item highlighted;\n // otherwise return to the open anchor. A selection that is no longer in\n // the list drops the highlight rather than leaving it on whichever item\n // now occupies that index.\n // `findItemIndex` resolves to -1 when no value was toggled.\n const toggledIndex = findItemIndex(registry, pendingHighlight.toggledValue, store.state.isItemEqualToValue);\n store.set('activeIndex', toggledIndex !== -1 ? toggledIndex : findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple));\n } else if (clearedBySelection) {\n store.set('activeIndex', null);\n } else if (autoHighlightMode === 'always') {\n store.set('activeIndex', 0);\n }\n });\n }\n }\n }\n if (!open && !inline) {\n return;\n }\n const storeActiveIndex = store.state.activeIndex;\n if (storeActiveIndex == null) {\n if (autoHighlightMode === 'always' && candidateItems.length > 0) {\n store.set('activeIndex', 0);\n return;\n }\n emitHighlight(undefined, -1, REASONS.none);\n return;\n }\n if (storeActiveIndex >= candidateItems.length) {\n emitHighlight(undefined, -1, REASONS.none);\n store.set('activeIndex', null);\n return;\n }\n const itemValue = candidateItems[storeActiveIndex];\n const previouslyHighlightedItemValue = lastHighlightRef.current.value;\n const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);\n if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {\n emitHighlight(itemValue, storeActiveIndex, REASONS.none);\n }\n }, [activeIndex, autoHighlightMode, emitHighlight, hasFilteredItemsProp, hasItems, flatFilteredValues, inline, open, resolvedPopupRef, store,\n // Reruns the effect when the query changes without affecting the deps above, such as\n // clearing the input when no items are filtered out (individually rendered items).\n inputValue]);\n useIsoLayoutEffect(() => {\n if (selectionMode === 'none') {\n setFilled(String(inputValue) !== '');\n return;\n }\n setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);\n }, [setFilled, selectionMode, inputValue, selectedValue, multiple]);\n\n // Ensures that the active index is not set to 0 when the list is empty.\n // This avoids needing to press ArrowDown twice under certain conditions.\n React.useEffect(() => {\n if (hasItems && autoHighlightMode && flatFilteredValues.length === 0) {\n setIndices({\n activeIndex: null\n });\n }\n }, [hasItems, autoHighlightMode, flatFilteredValues.length, setIndices]);\n function handleQueryChanged() {\n if (open && query !== '' && query !== String(initialDefaultInputValue) && !inputMatchesSelectedValue) {\n setQueryChangedAfterOpen(true);\n }\n }\n function handleOpenChanged() {\n // A controlled `open` prop can interrupt the close without calling `setOpen`.\n if (open && closeQuery !== null) {\n handleInterruptedReopen(false);\n }\n }\n\n // These sync triggers can run in the same commit while still seeing the pre-commit `inputValue`.\n // This render-scoped flag prevents duplicate callbacks and resets so canceled writes can retry.\n let syncedSelectedLabel = false;\n function syncInputToSelectedLabel() {\n if (!syncedSelectedLabel && inputValue !== selectedLabelString) {\n syncedSelectedLabel = true;\n setInputValue(selectedLabelString, createChangeEventDetails(REASONS.none));\n }\n }\n function handleSelectedValueChanged() {\n if (selectionMode === 'none') {\n return;\n }\n clearErrors(name);\n setDirty(isSelectedValueDirty(selectedValue, validityData.initialValue, isItemEqualToValue));\n validation.change(selectedValue);\n if (single && !hasInputValue && !inputInsidePopup) {\n syncInputToSelectedLabel();\n }\n }\n\n // The label catches accessor changes while the items identity restores the selected label after\n // a one-step input clear followed by a data reload. The shared sync prevents duplicate writes\n // when both change in the same commit.\n function syncInputAfterItemsOrLabelChange() {\n if (single && !hasInputValue && !inputInsidePopup && !queryChangedAfterOpen) {\n syncInputToSelectedLabel();\n }\n }\n function handleInputValueChanged() {\n if (selectionMode !== 'none') {\n return;\n }\n clearErrors(name);\n setDirty(inputValue !== validityData.initialValue);\n validation.change(inputValue);\n }\n useValueChanged(query, handleQueryChanged);\n useValueChanged(open, handleOpenChanged);\n useValueChanged(selectedValue, handleSelectedValueChanged);\n useValueChanged(selectedLabelString, syncInputAfterItemsOrLabelChange);\n useValueChanged(items, syncInputAfterItemsOrLabelChange);\n useValueChanged(inputValue, handleInputValueChanged);\n const floatingRootContext = useFloatingRootContext({\n open: inline ? true : open,\n onOpenChange: setOpen,\n elements: {\n reference: inputInsidePopup ? triggerElement : inputElement,\n floating: positionerElement\n }\n });\n const ariaHasPopup = grid ? 'grid' : 'listbox';\n // An inline list isn't gated on `open`: it renders for as long as it's in the tree, so the\n // combobox is permanently expanded even while the internal open state is `false`.\n const expanded = open || inline;\n const ariaExpanded = expanded ? 'true' : 'false';\n const role = React.useMemo(() => {\n const isPlainInput = inputElement?.tagName === 'INPUT';\n // During SSR and initial hydration, the input ref is not available yet.\n // Assume an input-like control so combobox ARIA attributes are present.\n const shouldTreatAsInput = inputElement == null || isPlainInput;\n // A non-input control only takes on combobox semantics while the list is exposed, which for\n // an inline list is the whole time.\n const shouldApplyAria = shouldTreatAsInput || expanded;\n const reference = shouldTreatAsInput ? {\n autoComplete: 'off',\n spellCheck: 'false',\n autoCorrect: 'off',\n autoCapitalize: 'none'\n } : {};\n if (shouldApplyAria) {\n reference.role = 'combobox';\n reference['aria-expanded'] = ariaExpanded;\n reference['aria-haspopup'] = ariaHasPopup;\n reference['aria-controls'] = expanded ? listElement?.id : undefined;\n // `readOnly` accepts no input, so no completion of any kind is offered.\n reference['aria-autocomplete'] = readOnly ? 'none' : autoComplete;\n }\n return {\n reference,\n floating: {\n role: 'presentation'\n }\n };\n }, [inputElement, expanded, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete, readOnly]);\n\n // `readOnly` locks the value, not the interaction: the popup opens and can be browsed.\n // Value changes stay blocked in `ComboboxItem`, `ComboboxInput`'s keydown, `ComboboxTrigger`'s\n // typeahead, the clear/remove parts, and the hidden input's autofill handler.\n const click = useClick(floatingRootContext, {\n enabled: !disabled && openOnInputClick,\n event: 'mousedown-only',\n toggle: false,\n // Apply a small delay for touch to let mobile viewport/keyboard positioning settle.\n // This avoids top-bottom flip flickers if the preferred position is \"top\" when first tapping.\n touchOpenDelay: inputInsidePopup ? 0 : 100,\n reason: REASONS.inputPress\n });\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !disabled && !inline,\n outsidePressEvent: {\n mouse: 'sloppy',\n // The visual viewport (affected by the mobile software keyboard) can be\n // somewhat small. The user may want to scroll the screen to see more of\n // the popup.\n touch: 'intentional'\n },\n // Without a popup, let the Escape key bubble the event up to other popups' handlers.\n bubbles: inline ? true : undefined,\n outsidePress(event) {\n const target = getTarget(event);\n return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);\n }\n });\n const listNavigation = useListNavigation(floatingRootContext, {\n enabled: !disabled,\n id,\n listRef,\n activeIndex,\n selectedIndex,\n virtual: true,\n loopFocus,\n allowEscape: loopFocus && !autoHighlightMode,\n focusItemOnOpen: queryChangedAfterOpen || selectionMode === 'none' && !autoHighlightMode ? false : 'auto',\n focusItemOnHover: highlightItemOnHover,\n resetOnPointerLeave: !keepHighlight,\n orientation: grid ? 'horizontal' : undefined,\n rtl: direction === 'rtl',\n disabledIndices: EMPTY_ARRAY,\n grid: grid ? gridNavigation : undefined,\n onNavigate(nextActiveIndex, event) {\n // Ignore automatic navigation while closed, including selected-index sync for inline lists.\n // Inline lists remain navigable while `open` is false, so still allow resets (clearing the\n // highlight when an unbound inline list unmounts, e.g. in a closed dialog).\n if (!event && !open && !(inline && nextActiveIndex === null) || transitionStatus === 'ending') {\n return;\n }\n setIndices({\n activeIndex: nextActiveIndex,\n type: getHighlightReason(event),\n event: event?.nativeEvent\n });\n }\n });\n const inputProps = React.useMemo(() => mergeProps(listNavigation.reference, {\n onKeyDown(event) {\n // In grid mode the navigation hook treats ArrowLeft/ArrowRight as horizontal\n // grid movement. When the input has focus and no item is highlighted the user\n // is still editing the query, so let the input keep its native caret behavior.\n if (grid && store.state.activeIndex == null && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {\n event.preventBaseUIHandler();\n }\n }\n }, dismiss.reference, click.reference, role.reference), [listNavigation.reference, dismiss.reference, click.reference, role.reference, grid, store]);\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);\n const listProps = React.useMemo(() => mergeProps(listNavigation.floating, role.floating), [listNavigation.floating, role.floating]);\n const itemRoot = React.useMemo(() => {\n const listNavigationItemProps = listNavigation.item;\n return {\n // Combobox keeps focus on the input; item focus would incorrectly sync\n // list navigation state from DOM focus.\n props: listNavigationItemProps ? {\n ...listNavigationItemProps,\n onFocus: undefined\n } : EMPTY_OBJECT,\n id,\n selectionMode,\n disabled,\n readOnly,\n isItemEqualToValue\n };\n }, [listNavigation.item, id, selectionMode, disabled, readOnly, isItemEqualToValue]);\n store.useContextCallback('setOpen', setOpen);\n store.useContextCallback('setInputValue', setInputValue);\n store.useContextCallback('setSelectedValue', setSelectedValue);\n store.useContextCallback('setIndices', setIndices);\n store.useContextCallback('handleSelection', handleSelection);\n store.useContextCallback('forceMount', forceMount);\n store.useContextCallback('requestSubmit', requestSubmit);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeCompleteProp);\n\n // The prop bags must be in the store before the parts render: they read them with `useStore`\n // during render, and a layout effect commits only after all children have rendered.\n useOnFirstRender(() => {\n store.update({\n inline: inlineProp,\n popupProps,\n listProps,\n inputProps,\n triggerProps,\n itemRoot\n });\n });\n const syncedValues = {\n id,\n selectedValue,\n open,\n mounted,\n transitionStatus,\n items: storeItems,\n inline: inlineProp,\n popupProps,\n listProps,\n inputProps,\n triggerProps,\n itemRoot,\n openMethod,\n selectionMode,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n virtualized,\n openOnInputClick,\n itemToStringLabel,\n modal,\n autoHighlight: autoHighlightMode,\n isItemEqualToValue,\n submitOnItemClick,\n hasInputValue\n };\n useIsoLayoutEffect(() => {\n // `inputOwnsFormValue` is derived here rather than during render because `ComboboxInput`\n // writes it from a ref callback earlier in the same commit, and it has to land in this same\n // `update` so subscribers never observe an intermediate snapshot. That is also why\n // `store.useSyncedValues` can't be used yet: it would need a second write. The dependencies\n // are derived from `syncedValues` so a newly synchronized field can't be forgotten here.\n store.update({\n ...syncedValues,\n inputOwnsFormValue: selectionMode === 'none' && (inlineProp || !store.state.inputInsidePopup)\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...Object.values(syncedValues)]);\n const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);\n const itemsContextValue = React.useMemo(() => ({\n query,\n hasItems,\n filteredItems,\n flatFilteredValues\n }), [query, hasItems, filteredItems, flatFilteredValues]);\n const serializedValue = React.useMemo(() => {\n if (Array.isArray(fieldRawValue)) {\n return '';\n }\n return stringifyAsValue(fieldRawValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue]);\n const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;\n const hiddenInputName = multiple || selectionMode === 'none' && inputOwnsFormValue ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(selectedValue) || !name) {\n return null;\n }\n return selectedValue.map(value => {\n const currentSerializedValue = stringifyAsValue(value, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue,\n disabled: disabled\n }, currentSerializedValue);\n });\n }, [multiple, selectedValue, form, name, itemToStringValue, disabled]);\n const children = /*#__PURE__*/_jsxs(React.Fragment, {\n children: [props.children, /*#__PURE__*/_jsx(\"input\", {\n ...validation.getValidationProps(disabled, {\n // Move focus when the hidden input is focused.\n onFocus() {\n if (inputInsidePopup) {\n triggerElement?.focus();\n return;\n }\n (inputRef.current || triggerElement)?.focus();\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented || disabled || readOnly) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const nextValueLower = nextValue.toLowerCase();\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n const findSerializedMatchIndex = () => valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyValueLabel(candidate).toLowerCase() === nextValueLower);\n function handleChange() {\n // Browser autofill only writes a single scalar value.\n if (multiple) {\n return;\n }\n if (selectionMode === 'none') {\n setInputValue(nextValue, details);\n return;\n }\n\n // Preserve the original serialized matching, then fall back to rendered text,\n // which browsers can autofill for primitive values like `value=\"US\">United States`.\n let matchingIndex = findSerializedMatchIndex();\n if (matchingIndex === -1) {\n matchingIndex = valuesRef.current.findIndex((_, index) => {\n const renderedLabel = labelsRef.current[index];\n return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;\n });\n }\n const matchingValue = matchingIndex === -1 ? undefined : valuesRef.current[matchingIndex];\n if (matchingValue != null) {\n // `setSelectedValue` may be canceled by `onValueChange`; rely on\n // `useValueChanged` to mark the field dirty and run validation only\n // when the value actually changes.\n setSelectedValue?.(matchingValue, details);\n }\n }\n\n // Only single-selection autofill matches against the registered values/labels.\n // `multiple` ignores autofill and `none` just writes the input value, so avoid the\n // sticky `forceMounted` mount (which never resets) for those modes.\n if (single) {\n forceMount();\n if (items && findSerializedMatchIndex() === -1) {\n // `forceMount` only refreshes the derived labels for the `items` prop. When\n // serialized matching misses, also mount the list so rendered labels (which can\n // differ from the serialized values) are registered for autofill matching.\n store.set('forceMounted', true);\n }\n }\n queueMicrotask(handleChange);\n }\n }),\n id: id && hiddenInputName == null ? `${id}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: formAutoComplete,\n disabled: disabled,\n required: required && !hasMultipleSelection,\n readOnly: readOnly,\n value: serializedValue,\n ref: hiddenInputRef,\n style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n });\n return /*#__PURE__*/_jsx(ComboboxRootContext.Provider, {\n value: store,\n children: /*#__PURE__*/_jsx(ComboboxFloatingContext.Provider, {\n value: floatingRootContext,\n children: /*#__PURE__*/_jsx(ComboboxHasItemsContext.Provider, {\n value: hasItems,\n children: /*#__PURE__*/_jsx(ComboboxDerivedItemsContext.Provider, {\n value: itemsContextValue,\n children: /*#__PURE__*/_jsx(ComboboxInputValueContext.Provider, {\n value: inputValue,\n children: children\n })\n })\n })\n })\n });\n}","'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}","'use client';\n\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.mjs\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.mjs\";\nexport function useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange,\n elements = {}\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== 'production') {\n const optionDomReference = elements.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n console.error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `context.setPositionReference()`', 'instead.');\n }\n }\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n onOpenChange,\n referenceElement: elements.reference ?? null,\n floatingElement: elements.floating ?? null,\n triggerElements: new PopupTriggerMap(),\n floatingId,\n syncOnly: false,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId\n };\n if (elements.reference !== undefined) {\n valuesToSync.referenceElement = elements.reference;\n valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;\n }\n if (elements.floating !== undefined) {\n valuesToSync.floatingElement = elements.floating;\n }\n store.update(valuesToSync);\n }, [open, floatingId, elements.reference, elements.floating, store]);\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}","import { getGridNavigatedIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\n/**\n * Positional arguments are deliberate: property names of an options object\n * don't minify, and the signature is locked to the caller via `typeof` on the\n * `grid` option of `useListNavigation`.\n *\n * The injected grid navigator only ever operates on a uniform 1x1 grid (sizes are\n * always `1x1` and packing is never dense), so the cell-map machinery that supports\n * multi-cell items collapses to an identity transform over the item list. Calling\n * `getGridNavigatedIndex` directly keeps the cell-map helpers\n * (`createGridCellMap`/`getGridCellIndexOfCorner`/`getGridCellIndices`) out of\n * grid-combobox bundles.\n */\nexport function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex, cols = 2) {\n const nextIndex = getGridNavigatedIndex(listRef.current, {\n event,\n orientation,\n loopFocus,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n // An out-of-range previous index falls back to the first enabled item.\n prevIndex: prevIndex > maxIndex ? minIndex : prevIndex,\n stopEvent: true\n });\n\n // `getGridNavigatedIndex` can return an out-of-bounds sentinel (e.g. `-1` when there is no\n // previous item to move from); surface that as `undefined` so the caller treats it as\n // \"no navigation\" rather than highlighting index `-1`.\n return isIndexOutOfListBounds(listRef.current, nextIndex) ? undefined : nextIndex;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxRootContext.displayName = \"ComboboxRootContext\";\nexport const ComboboxFloatingContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxFloatingContext.displayName = \"ComboboxFloatingContext\";\nexport const ComboboxDerivedItemsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxDerivedItemsContext.displayName = \"ComboboxDerivedItemsContext\";\nexport const ComboboxHasItemsContext = /*#__PURE__*/React.createContext(false);\n// `inputValue` can't be placed in the store.\n// https://github.com/mui/base-ui/issues/2703\nif (process.env.NODE_ENV !== \"production\") ComboboxHasItemsContext.displayName = \"ComboboxHasItemsContext\";\nexport const ComboboxInputValueContext = /*#__PURE__*/React.createContext('');\nif (process.env.NODE_ENV !== \"production\") ComboboxInputValueContext.displayName = \"ComboboxInputValueContext\";\nexport function useComboboxRootContext() {\n const context = React.useContext(ComboboxRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(22));\n }\n return context;\n}\nexport function useComboboxFloatingContext() {\n const context = React.useContext(ComboboxFloatingContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(23));\n }\n return context;\n}\nexport function useComboboxDerivedItemsContext() {\n const context = React.useContext(ComboboxDerivedItemsContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(24));\n }\n return context;\n}\nexport function useComboboxInputValueContext() {\n return React.useContext(ComboboxInputValueContext);\n}\nexport function useComboboxHasItemsContext() {\n return React.useContext(ComboboxHasItemsContext);\n}","// https://github.com/mui/mui-x/blob/master/packages/x-internals/src/fastArrayCompare/fastArrayCompare.ts\n\n/**\n * Compares two arrays element-wise.\n *\n * The default comparison is `Object.is`, so `NaN` equals `NaN` and `0` does not equal `-0`.\n */\nexport function areArraysEqual(array1, array2, itemComparer = Object.is) {\n const {\n length\n } = array1;\n if (length !== array2.length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (!itemComparer(array1[i], array2[i])) {\n return false;\n }\n }\n return true;\n}","import { areArraysEqual } from '@base-ui/utils/areArraysEqual';\n// Compared by identity in `findSelectionIndex`; don't wrap it.\nexport const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function isSelectedValueDirty(currentValue, initialValue, comparer) {\n if (Array.isArray(currentValue) && Array.isArray(initialValue)) {\n return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, comparer));\n }\n return currentValue !== initialValue;\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\n\n// The default comparer is `Object.is`, so the values can be indexed instead of rescanned\n// for every item. A custom comparer may match values that don't hash alike.\nfunction createSelectionMatcher(selectedValues, comparer) {\n if (comparer !== defaultItemEquality) {\n return itemValue => selectedValueIncludes(selectedValues, itemValue, comparer);\n }\n const index = new Set(selectedValues);\n index.delete(undefined);\n // `Set` treats +0 and -0 as equal; `Object.is` does not.\n return itemValue => index.has(itemValue) && (itemValue !== 0 || selectedValues.some(v => Object.is(itemValue, v)));\n}\nexport function findSelectionIndex(itemValues, selectedValue, comparer, multiple) {\n // Only treat the value as a list in multiple mode: an array can itself be a valid\n // single-select value.\n const index = multiple && Array.isArray(selectedValue) ?\n // Anchor to the first selected item in rendered order so the index does not depend\n // on the order in which the values were added to the array.\n itemValues.findIndex(createSelectionMatcher(selectedValue, comparer)) : findItemIndex(itemValues, selectedValue, comparer);\n return index === -1 ? null : index;\n}\n\n/** Resolves the first selected index as items register or change. */\nexport function resolveSelectedIndex(index, itemValue, registry, selectedValues, comparer, currentIndex) {\n if (selectedValueIncludes(selectedValues, itemValue, comparer)) {\n // A later item only takes over once the current anchor stops being selected.\n return currentIndex != null && index > currentIndex && selectedValueIncludes(selectedValues, registry[currentIndex], comparer) ? currentIndex : index;\n }\n // The holder re-elects the anchor once it stops being selected.\n return index === currentIndex ? findSelectionIndex(registry, selectedValues, comparer, true) : currentIndex;\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}","export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { serializeValue } from \"./serializeValue.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isGroup(item) {\n return typeof item === 'object' && item != null && Array.isArray(item.items);\n}\nexport function isGroupedItems(items) {\n // A group must carry an actual `items` array: key presence alone would misclassify an item\n // with an unrelated or optional `items` field.\n return isGroup(items?.[0]);\n}\nexport function flattenLeafItems(items) {\n return isGroupedItems(items) ? items.flatMap(group => group.items) : items;\n}\n\n/**\n * Checks if the items array contains an item with a null value that has a non-null label.\n */\nexport function hasNullItemLabel(items) {\n if (!Array.isArray(items)) {\n return items != null && 'null' in items;\n }\n const arrayItems = items;\n if (isGroupedItems(arrayItems)) {\n for (const group of arrayItems) {\n for (const item of group.items) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n }\n return false;\n }\n for (const item of arrayItems) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n return false;\n}\nexport function stringifyAsLabel(item, itemToStringLabel) {\n if (itemToStringLabel && item != null) {\n return itemToStringLabel(item) ?? '';\n }\n if (item && typeof item === 'object') {\n if ('label' in item && item.label != null) {\n return String(item.label);\n }\n if ('value' in item) {\n return String(item.value);\n }\n }\n return serializeValue(item);\n}\nexport function stringifyAsValue(item, itemToStringValue) {\n if (itemToStringValue && item != null) {\n return itemToStringValue(item) ?? '';\n }\n if (item && typeof item === 'object' && 'value' in item && 'label' in item) {\n return serializeValue(item.value);\n }\n return serializeValue(item);\n}\nexport function resolveSelectedLabel(value, items, itemToStringLabel) {\n function fallback() {\n return stringifyAsLabel(value, itemToStringLabel);\n }\n if (itemToStringLabel && value != null) {\n return itemToStringLabel(value);\n }\n\n // Custom object with explicit label takes precedence\n if (value && typeof value === 'object' && 'label' in value && value.label != null) {\n return value.label;\n }\n\n // Items provided as plain record map\n if (items && !Array.isArray(items)) {\n const label = Object.hasOwn(items, value) ? items[value] : undefined;\n return label ?? fallback();\n }\n\n // Items provided as array (flat or grouped)\n if (Array.isArray(items)) {\n const arrayItems = items;\n const flatItems = flattenLeafItems(arrayItems);\n if (value == null || typeof value !== 'object') {\n const match = flatItems.find(item => item.value === value);\n if (match && match.label != null) {\n return match.label;\n }\n return fallback();\n }\n\n // Object without explicit label: try matching by its `value` property\n if ('value' in value) {\n const match = flatItems.find(item => item && item.value === value.value);\n if (match && match.label != null) {\n return match.label;\n }\n }\n }\n return fallback();\n}\nexport function resolveMultipleLabels(values, items, itemToStringLabel) {\n return values.reduce((acc, value, index) => {\n if (index > 0) {\n acc.push(', ');\n }\n acc.push(/*#__PURE__*/_jsx(React.Fragment, {\n children: resolveSelectedLabel(value, items, itemToStringLabel)\n }, index));\n return acc;\n }, []);\n}","import { compareItemEquality } from \"../internals/itemEquality.mjs\";\nimport { hasNullItemLabel } from \"../internals/resolveValueLabel.mjs\";\n\n/**\n * Non-reactive values shared with the combobox parts. Nothing here is observable through\n * `selectors`, so writing to a ref never notifies subscribers.\n */\n\nexport const selectors = {\n id: state => state.id,\n labelId: state => state.labelId,\n items: state => state.items,\n selectedValue: state => state.selectedValue,\n hasSelectionChips: state => {\n const selectedValue = state.selectedValue;\n return Array.isArray(selectedValue) && selectedValue.length > 0;\n },\n hasSelectedValue: state => {\n const {\n selectedValue,\n selectionMode\n } = state;\n if (selectedValue == null) {\n return false;\n }\n if (selectionMode === 'multiple' && Array.isArray(selectedValue)) {\n return selectedValue.length > 0;\n }\n return true;\n },\n hasNullItemLabel: (state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n },\n open: state => state.open,\n mounted: state => state.mounted,\n forceMounted: state => state.forceMounted,\n inline: state => state.inline,\n activeIndex: state => state.activeIndex,\n selectedIndex: state => state.selectedIndex,\n isActive: (state, index) => state.activeIndex === index,\n isSelected: (state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const selectedValue = state.selectedValue;\n if (Array.isArray(selectedValue)) {\n return selectedValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n },\n transitionStatus: state => state.transitionStatus,\n popupProps: state => state.popupProps,\n listProps: state => state.listProps,\n inputProps: state => state.inputProps,\n triggerProps: state => state.triggerProps,\n itemRoot: state => state.itemRoot,\n positionerElement: state => state.positionerElement,\n listElement: state => state.listElement,\n popupId: state => state.popupId,\n triggerElement: state => state.triggerElement,\n inputElement: state => state.inputElement,\n inputGroupElement: state => state.inputGroupElement,\n popupSide: state => state.popupSide,\n openMethod: state => state.openMethod,\n inputInsidePopup: state => state.inputInsidePopup,\n inputOwnsFormValue: state => state.inputOwnsFormValue,\n selectionMode: state => state.selectionMode,\n name: state => state.name,\n form: state => state.form,\n disabled: state => state.disabled,\n readOnly: state => state.readOnly,\n required: state => state.required,\n grid: state => state.grid,\n virtualized: state => state.virtualized,\n itemToStringLabel: state => state.itemToStringLabel,\n isItemEqualToValue: state => state.isItemEqualToValue,\n modal: state => state.modal,\n autoHighlight: state => state.autoHighlight\n};","/**\n * Present when the field is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the field is in a valid state.\n */\nexport const valid = 'data-valid';\n/**\n * Present when the field is in an invalid state.\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the field has been touched.\n */\nexport const touched = 'data-touched';\n/**\n * Present when the field's value has changed.\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the field is filled.\n */\nexport const filled = 'data-filled';\n/**\n * Present when the field control is focused.\n */\nexport const focused = 'data-focused';","import * as FieldControlDataAttributes from \"../../field/control/FieldControlDataAttributes.mjs\";\nexport const DEFAULT_VALIDITY_STATE = {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: null,\n valueMissing: false\n};\nexport const DEFAULT_FIELD_STATE_ATTRIBUTES = {\n valid: null,\n touched: false,\n dirty: false,\n filled: false,\n focused: false\n};\nexport const DEFAULT_FIELD_ROOT_STATE = {\n disabled: false,\n ...DEFAULT_FIELD_STATE_ATTRIBUTES\n};\nexport const fieldValidityMapping = {\n valid(value) {\n if (value === null) {\n return null;\n }\n if (value) {\n return {\n [FieldControlDataAttributes.valid]: ''\n };\n }\n return {\n [FieldControlDataAttributes.invalid]: ''\n };\n }\n};","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { NOOP } from \"../noop.mjs\";\nimport { DEFAULT_FIELD_ROOT_STATE, DEFAULT_VALIDITY_STATE } from \"../field-constants/constants.mjs\";\nexport const DEFAULT_FIELD_ROOT_CONTEXT = {\n invalid: undefined,\n name: undefined,\n validityData: {\n state: DEFAULT_VALIDITY_STATE,\n errors: [],\n error: '',\n value: '',\n initialValue: null\n },\n setValidityData: NOOP,\n disabled: undefined,\n setTouched: NOOP,\n setDirty: NOOP,\n setFilled: NOOP,\n setFocused: NOOP,\n focusOwnerRef: {\n current: undefined\n },\n validationMode: 'onSubmit',\n shouldValidateOnChange: () => false,\n state: DEFAULT_FIELD_ROOT_STATE,\n registerFieldControl: NOOP,\n validation: {\n getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,\n inputRef: {\n current: null\n },\n registeredInputs: new Map(),\n registerInput: NOOP,\n getInputControl: () => null,\n commit: async () => {},\n change: NOOP\n }\n};\nexport const FieldRootContext = /*#__PURE__*/React.createContext(DEFAULT_FIELD_ROOT_CONTEXT);\nif (process.env.NODE_ENV !== \"production\") FieldRootContext.displayName = \"FieldRootContext\";\nexport function useFieldRootContext(optional = true) {\n const context = React.useContext(FieldRootContext);\n if (context.setValidityData === NOOP && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : _formatErrorMessage(28));\n }\n return context;\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useFieldRootContext } from \"../field-root-context/FieldRootContext.mjs\";\nexport function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {\n const {\n registerFieldControl\n } = useFieldRootContext();\n const sourceRef = useRefWithInit(() => Symbol());\n\n // Re-register without unregistering first: re-registration with the same id updates the\n // form's fields Map entry in place, while a delete + re-add would move the field to the\n // end of the Map every time its value changes.\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n if (!enabled) {\n registerFieldControl(source, undefined);\n return;\n }\n const registration = {\n controlRef,\n getValue: getFormValueOverride,\n id,\n name,\n value\n };\n registerFieldControl(source, registration);\n }, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, sourceRef, value]);\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n return () => {\n registerFieldControl(source, undefined);\n };\n }, [registerFieldControl, sourceRef]);\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\nexport const FormContext = /*#__PURE__*/React.createContext({\n elementRef: {\n current: null\n },\n formRef: {\n current: {\n fields: new Map()\n }\n },\n errors: {},\n clearErrors: NOOP,\n validationMode: 'onSubmit',\n submitCountRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") FormContext.displayName = \"FormContext\";\nexport function useFormContext() {\n return React.useContext(FormContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { NOOP } from \"../noop.mjs\";\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabelableId(params = {}) {\n const {\n id,\n enabled = true\n } = params;\n const {\n controlId,\n registerControlId,\n resetControlId\n } = useLabelableContext();\n\n // Deliberately not seeded with `id`: on React 17 the seed would stick around after the\n // `id` prop is removed, leaving the control on a stale id forever.\n const defaultId = useBaseUiId();\n const controlSourceRef = useRefWithInit(() => Symbol());\n const hasRegisteredRef = React.useRef(false);\n const hadExplicitIdRef = React.useRef(false);\n const unregisterControlId = useStableCallback(() => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSourceRef.current, undefined);\n });\n useIsoLayoutEffect(() => {\n if (!enabled || registerControlId === NOOP) {\n unregisterControlId();\n return undefined;\n }\n let nextId;\n if (id !== undefined) {\n hadExplicitIdRef.current = true;\n nextId = id;\n } else if (hadExplicitIdRef.current) {\n nextId = defaultId;\n } else {\n // An id-less replacement must claim the provider's fallback so a previously registered\n // explicit id is not retained after its control unmounts.\n resetControlId();\n return undefined;\n }\n\n // Either the control never had an explicit `id`, or React 17 has not assigned the\n // fallback id yet. Neither is worth registering.\n if (nextId === undefined) {\n unregisterControlId();\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, nextId);\n return undefined;\n }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);\n\n // Unregistering in the layout phase, not a passive effect: a replacement control's layout\n // effect would otherwise run first and still see the outgoing control's registration.\n useIsoLayoutEffect(() => {\n return unregisterControlId;\n }, [unregisterControlId]);\n\n // The provider's id wins until registration runs: the label renders `htmlFor` from the\n // provider's pre-registration state, so preempting it with an explicit `id` here would\n // leave the pair unassociated in server-rendered markup.\n return (enabled ? controlId : undefined) ?? id ?? defaultId;\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\n/**\n * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\\\n * with an accessible name (label) and description.\n */\nexport const LabelableContext = /*#__PURE__*/React.createContext({\n controlId: undefined,\n registerControlId: NOOP,\n resetControlId: NOOP,\n labelId: undefined,\n setLabelId: NOOP,\n messageIds: [],\n setMessageIds: NOOP,\n getDescriptionProps: externalProps => externalProps\n});\nif (process.env.NODE_ENV !== \"production\") LabelableContext.displayName = \"LabelableContext\";\nexport function useLabelableContext() {\n return React.useContext(LabelableContext);\n}","import { stringifyAsLabel } from \"../../../internals/resolveValueLabel.mjs\";\n/**\n * Derives the default id assigned to `Combobox.Popup` when the input is rendered inside it.\n * Shared by the popup (which applies it) and the trigger (which references it via `aria-controls`)\n * so the convention only lives in one place.\n */\nexport function getComboboxPopupId(rootId) {\n return rootId == null ? undefined : `${rootId}-popup`;\n}\n\n/**\n * Enhanced filter using Intl.Collator for more robust string matching.\n * Uses the provided `itemToStringLabel` function if available, otherwise falls back to:\n * • When `item` is an object with a `value` property, that property is used.\n * • When `item` is a primitive (e.g. `string`), it is used directly.\n */\nexport function createCollatorItemFilter(collatorFilter, itemToStringLabel) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n return collatorFilter.contains(item, query, itemToStringLabel);\n };\n}\n\n/**\n * Enhanced filter for single selection mode using Intl.Collator that shows all items\n * when query is empty or matches the current selection, making it easier to browse options.\n */\nexport function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n if (!query) {\n return true;\n }\n const selectedValueToString = itemToStringLabel?.selected ?? itemToStringLabel;\n const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, selectedValueToString) : '';\n\n // Handle case-insensitive matching consistently\n if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) {\n return true;\n }\n return collatorFilter.contains(item, query, itemToStringLabel);\n };\n}","export function stringifyLocale(locale) {\n if (Array.isArray(locale)) {\n return locale.map(value => stringifyLocale(value)).join(',');\n }\n if (locale == null) {\n return '';\n }\n return String(locale);\n}","import { stringifyLocale } from '@base-ui/utils/stringifyLocale';\nimport { stringifyAsLabel } from \"./resolveValueLabel.mjs\";\nconst filterCache = new Map();\nexport function getFilter(options = {}) {\n const {\n locale,\n ...restOptions\n } = options;\n const collatorOptions = {\n usage: 'search',\n sensitivity: 'base',\n ignorePunctuation: true,\n ...restOptions\n };\n const cacheKey = `${stringifyLocale(locale)}|${JSON.stringify(collatorOptions)}`;\n const cachedFilter = filterCache.get(cacheKey);\n if (cachedFilter) {\n return cachedFilter;\n }\n const collator = new Intl.Collator(locale, collatorOptions);\n const filter = {\n contains(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n for (let i = 0; i <= itemString.length - query.length; i += 1) {\n if (collator.compare(itemString.slice(i, i + query.length), query) === 0) {\n return true;\n }\n }\n return false;\n },\n startsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n return collator.compare(itemString.slice(0, query.length), query) === 0;\n },\n endsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n const queryLength = query.length;\n return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;\n }\n };\n filterCache.set(cacheKey, filter);\n return filter;\n}","'use client';\n\nimport * as React from 'react';\nimport { createCollatorItemFilter, createSingleSelectionCollatorFilter } from \"./index.mjs\";\nimport { getFilter } from \"../../../internals/filter.mjs\";\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport const useCoreFilter = getFilter;\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport function useComboboxFilter(options = {}) {\n const {\n multiple = false,\n value,\n ...collatorOptions\n } = options;\n const coreFilter = getFilter(collatorOptions);\n const contains = React.useCallback((item, query, itemToString) => {\n if (multiple) {\n return createCollatorItemFilter(coreFilter, itemToString)(item, query);\n }\n return createSingleSelectionCollatorFilter(coreFilter, itemToString, value)(item, query);\n }, [coreFilter, value, multiple]);\n return React.useMemo(() => ({\n ...coreFilter,\n contains\n }), [contains, coreFilter]);\n}","export const NO_ACTIVE_VALUE = Symbol('none');\nexport const INITIAL_LAST_HIGHLIGHT = {\n value: NO_ACTIVE_VALUE,\n index: -1\n};","import { compareItemEquality, defaultItemEquality } from \"../../internals/itemEquality.mjs\";\nexport function findCollectionItem(valueToItem, itemValue, isEqual) {\n const exactItem = valueToItem.get(itemValue);\n if (exactItem !== undefined || isEqual === defaultItemEquality) {\n return exactItem;\n }\n for (const [derivedValue, item] of valueToItem) {\n if (compareItemEquality(derivedValue, itemValue, isEqual)) {\n return item;\n }\n }\n return undefined;\n}\n\n/**\n * An opaque collection created by `createItems()`.\n *\n * It carries the source item and derived value types so the root can infer the list item and\n * selection value types.\n *\n * Pass it directly to the root's `items` prop; it has no public members.\n */\n\n/**\n * Internal shape of a collection. The extra members let the root project items to\n * their values and resolve a selected value back to its label while items are unmounted.\n */","'use client';\n\nimport * as React from 'react';\nimport { AriaCombobox } from \"./AriaCombobox.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the combobox.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport function ComboboxRoot(props) {\n const {\n multiple = false,\n defaultValue,\n value,\n onValueChange,\n autoComplete,\n ...other\n } = props;\n return /*#__PURE__*/_jsx(AriaCombobox, {\n ...other,\n selectionMode: multiple ? 'multiple' : 'single',\n selectedValue: value,\n defaultSelectedValue: defaultValue,\n onSelectedValueChange: onValueChange,\n formAutoComplete: autoComplete\n });\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../internals/useBaseUiId.mjs\";\nexport function useRegisteredLabelId(idProp, setLabelId) {\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(currentId => currentId === id ? undefined : currentId);\n };\n }, [id, setLabelId]);\n return id;\n}","'use client';\n\nimport { isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { closest, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { useRegisteredLabelId } from \"../../utils/useRegisteredLabelId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabel(params = {}) {\n const {\n id: idProp,\n fallbackControlId,\n native = false,\n setLabelId: setLabelIdProp,\n focusControl: focusControlProp\n } = params;\n const {\n controlId: contextControlId,\n setLabelId: setContextLabelId\n } = useLabelableContext();\n const syncLabelId = useStableCallback(nextLabelId => {\n setContextLabelId(nextLabelId);\n setLabelIdProp?.(nextLabelId);\n });\n const id = useRegisteredLabelId(idProp, syncLabelId);\n const resolvedControlId = contextControlId ?? fallbackControlId;\n function focusControl(event) {\n if (focusControlProp) {\n focusControlProp(event, resolvedControlId);\n return;\n }\n if (!resolvedControlId) {\n return;\n }\n const controlElement = getControlById(event.currentTarget, resolvedControlId);\n if (isHTMLElement(controlElement)) {\n focusElementWithVisible(controlElement);\n }\n }\n function handleInteraction(event) {\n const target = getTarget(event.nativeEvent);\n if (closest(target, 'button,input,select,textarea')) {\n return;\n }\n\n // Prevent text selection when double clicking label.\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n if (native) {\n return;\n }\n focusControl(event);\n }\n return native ? {\n id,\n htmlFor: resolvedControlId,\n onMouseDown: handleInteraction\n } : {\n id,\n onClick: handleInteraction,\n onPointerDown(event) {\n event.preventDefault();\n }\n };\n}\nexport function getControlById(label, id) {\n let root = label.getRootNode();\n while (isShadowRoot(root)) {\n const element = root.getElementById(id);\n if (element) {\n return element;\n }\n root = root.host.getRootNode();\n }\n return ownerDocument(label).getElementById(id);\n}\nexport function focusElementWithVisible(element) {\n element.focus({\n // Available from Chrome 144+ (January 2026).\n // Safari and Firefox already support it.\n focusVisible: true\n });\n}","'use client';\n\nexport function getDefaultLabelId(id) {\n return id == null ? undefined : `${id}-label`;\n}\nexport function resolveAriaLabelledBy(fieldLabelId, localLabelId) {\n return fieldLabelId ?? localLabelId;\n}","'use client';\n\nimport * as React from 'react';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabel } from \"../../internals/labelable-provider/useLabel.mjs\";\nimport { getDefaultLabelId } from \"../../utils/resolveAriaLabelledBy.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\n\n/**\n * An accessible label that is automatically associated with the combobox trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxLabel = /*#__PURE__*/React.forwardRef(function ComboboxLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n // Keep label id derived from the root and ignore runtime `id` overrides from untyped consumers.\n const elementPropsWithoutId = elementProps;\n delete elementPropsWithoutId.id;\n const fieldRootContext = useFieldRootContext();\n const store = useComboboxRootContext();\n const inputInsidePopup = store.useState('inputInsidePopup');\n const triggerElement = store.useState('triggerElement');\n const inputElement = store.useState('inputElement');\n const rootId = store.useState('id');\n const defaultLabelId = getDefaultLabelId(rootId);\n const localControlId = triggerElement?.id ?? (inputInsidePopup ? rootId : undefined);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!inputElement || inputInsidePopup) {\n return;\n }\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '<Combobox.Label> labels <Combobox.Trigger> only. ' + 'When <Combobox.Input> is the form control, use a native <label> or <Field.Label> instead.';\n error(`${message}${ownerStackMessage}`);\n }, [inputElement, inputInsidePopup]);\n }\n const labelProps = useLabel({\n id: defaultLabelId,\n fallbackControlId: localControlId,\n setLabelId(nextLabelId) {\n const resolvedLabelId = typeof nextLabelId === 'function' ? nextLabelId(store.state.labelId) : nextLabelId;\n store.set('labelId', resolvedLabelId);\n }\n });\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n state: fieldRootContext.state,\n props: [labelProps, elementProps],\n stateAttributesMapping: fieldValidityMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxLabel.displayName = \"ComboboxLabel\";","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { DEFAULT_FIELD_ROOT_CONTEXT, FieldRootContext, useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useSetFieldFocused } from \"../../internals/field-root-context/useSetFieldFocused.mjs\";\nimport { DEFAULT_FIELD_STATE_ATTRIBUTES } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getHighlightReason } from \"../../utils/getHighlightReason.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.mjs\";\nimport { clickHighlightedItem, getChipNavigationKeys, useListEmpty, usePopupSide } from \"../utils/parts.mjs\";\n\n/**\n * A text input to search for items in the list.\n * Renders an `<input>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInput(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n disabled: fieldDisabled,\n setTouched,\n validationMode,\n validation\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const comboboxChipsContext = useComboboxChipsContext();\n const positioning = useComboboxPositionerContext(true);\n const hasPositionerParent = Boolean(positioning);\n const store = useComboboxRootContext();\n // `inputValue` can't be placed in the store.\n // https://github.com/mui/base-ui/issues/2703\n const inputValue = useComboboxInputValueContext();\n const direction = useDirection();\n const required = store.useState('required');\n const comboboxDisabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const name = store.useState('name');\n const form = store.useState('form');\n const selectionMode = store.useState('selectionMode');\n const autoHighlightMode = store.useState('autoHighlight');\n const inputProps = store.useState('inputProps');\n const triggerProps = store.useState('triggerProps');\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const selectedValue = store.useState('selectedValue');\n const rootId = store.useState('id');\n const inline = store.useState('inline');\n const modal = store.useState('modal');\n const autoHighlightEnabled = Boolean(autoHighlightMode);\n const popupSide = usePopupSide(store);\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const listEmpty = useListEmpty();\n const setFocused = useSetFieldFocused(disabled, store.context.inputRef);\n const isInsidePopup = hasPositionerParent || inline;\n const focusManagerModal = !isInsidePopup || modal;\n const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : undefined));\n const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;\n const [composingValue, setComposingValue] = React.useState(null);\n const isComposingRef = React.useRef(false);\n const lastActiveIndexRef = React.useRef(null);\n\n // Restore the saved highlight on refocus only within the same open cycle.\n useIsoLayoutEffect(() => {\n if (!open) {\n lastActiveIndexRef.current = null;\n }\n }, [open]);\n const inputOwnsFormValue = selectionMode === 'none' && !hasPositionerParent;\n const setInputElement = useStableCallback(element => {\n const nextIsInsidePopup = hasPositionerParent || store.state.inline;\n if (nextIsInsidePopup && !store.state.hasInputValue) {\n store.context.setInputValue('', createChangeEventDetails(REASONS.none));\n }\n store.update({\n inputElement: element,\n inputInsidePopup: nextIsInsidePopup,\n inputOwnsFormValue\n });\n });\n const validationProps = hasPositionerParent ? elementProps : validation.getValidationProps(disabled, elementProps);\n function clearHighlight(event) {\n store.context.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: getHighlightReason(event),\n event\n });\n }\n const state = {\n ...fieldStateForInput,\n open,\n disabled,\n readOnly,\n popupSide,\n listEmpty\n };\n function handleKeyDown(event) {\n if (!comboboxChipsContext) {\n return undefined;\n }\n let nextIndex;\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n const [previousChipKey] = getChipNavigationKeys(direction);\n if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {\n event.preventDefault();\n nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : undefined;\n }\n return nextIndex;\n }\n const element = useRenderElement('input', componentProps, {\n state,\n ref: [forwardedRef, store.context.inputRef, setInputElement],\n props: [inputProps, triggerProps, {\n value: composingValue ?? inputValue,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': fieldLabelId,\n disabled,\n readOnly,\n required: selectionMode === 'none' ? required : undefined,\n form,\n ...(inputOwnsFormValue && name && {\n name\n }),\n id,\n onFocus() {\n setFocused(true);\n if (!inline) {\n return;\n }\n const nextActiveIndex = lastActiveIndexRef.current;\n lastActiveIndexRef.current = null;\n if (nextActiveIndex == null ||\n // `valuesRef` can be sparse, so guard against restoring a removed slot.\n !Object.hasOwn(store.context.valuesRef.current, nextActiveIndex)) {\n return;\n }\n store.context.setIndices({\n activeIndex: nextActiveIndex\n });\n },\n onBlur() {\n setTouched(true);\n setFocused(false);\n const activeIndex = store.state.activeIndex;\n if (inline && activeIndex !== null && autoHighlightMode !== 'always') {\n lastActiveIndexRef.current = activeIndex;\n store.context.setIndices({\n activeIndex: null\n });\n }\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n },\n onCompositionStart(event) {\n if (platform.os.android) {\n return;\n }\n isComposingRef.current = true;\n setComposingValue(event.currentTarget.value);\n },\n onCompositionEnd(event) {\n isComposingRef.current = false;\n const next = event.currentTarget.value;\n setComposingValue(null);\n store.context.setInputValue(next, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));\n },\n onChange(event) {\n const nativeEvent = event.nativeEvent;\n // Autofill may not provide `inputType` (Chrome) or may report\n // `insertReplacementText` (Firefox).\n const inputType = nativeEvent.inputType;\n const autofillLikeInput = !inputType || inputType === 'insertReplacementText';\n // During composition the input is always considered typed into.\n const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;\n function maybeOpenOnInput(trimmed) {\n if (readOnly || disabled || !trimmed || !shouldOpenOnInput) {\n return;\n }\n store.context.setOpen(true, createChangeEventDetails(REASONS.inputChange, nativeEvent));\n // When autoHighlight is enabled, keep the highlight (will be set to 0 in root).\n if (!autoHighlightEnabled) {\n clearHighlight(nativeEvent);\n }\n }\n\n // During IME composition, avoid propagating controlled updates to prevent\n // filtering the options prematurely so `Empty` won't show incorrectly.\n // We can't rely on this check for Android due to how it handles composition\n // events with some keyboards (e.g. Samsung keyboard with predictive text on\n // treats all text as always-composing).\n // https://github.com/mui/base-ui/issues/2942\n if (isComposingRef.current) {\n const nextVal = event.currentTarget.value;\n setComposingValue(nextVal);\n if (nextVal === '' && !store.state.openOnInputClick && !store.state.inputInsidePopup) {\n store.context.setOpen(false, createChangeEventDetails(REASONS.inputClear, nativeEvent));\n }\n const trimmed = nextVal.trim();\n const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== '';\n maybeOpenOnInput(trimmed);\n if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) {\n clearHighlight(nativeEvent);\n }\n return;\n }\n const inputChangeDetails = createChangeEventDetails(REASONS.inputChange, nativeEvent);\n store.context.setInputValue(event.currentTarget.value, inputChangeDetails);\n if (inputChangeDetails.isCanceled) {\n return;\n }\n const empty = event.currentTarget.value === '';\n const clearDetails = createChangeEventDetails(REASONS.inputClear, nativeEvent);\n if (empty && !store.state.inputInsidePopup) {\n if (selectionMode === 'single') {\n store.context.setSelectedValue(null, clearDetails);\n }\n if (!store.state.openOnInputClick) {\n store.context.setOpen(false, clearDetails);\n }\n }\n maybeOpenOnInput(event.currentTarget.value.trim());\n\n // When the user types, ensure the list resets its highlight so that\n // virtual focus returns to the input (aria-activedescendant is\n // cleared).\n if (open && store.state.activeIndex !== null && !autoHighlightEnabled) {\n clearHighlight(nativeEvent);\n }\n },\n onKeyDown(event) {\n if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {\n return;\n }\n if (disabled || readOnly) {\n // Browsing can highlight an item, and Enter there must not submit the form.\n if (readOnly && event.key === 'Enter' && open && store.state.activeIndex !== null) {\n stopEvent(event);\n }\n return;\n }\n const input = event.currentTarget;\n const scrollAmount = input.scrollWidth - input.clientWidth;\n const isRTL = direction === 'rtl';\n if (event.key === 'Home') {\n stopEvent(event);\n const cursor = platform.engine.gecko && isRTL ? input.value.length : 0;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = 0;\n return;\n }\n if (event.key === 'End') {\n stopEvent(event);\n const cursor = platform.engine.gecko && isRTL ? 0 : input.value.length;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = isRTL ? -scrollAmount : scrollAmount;\n return;\n }\n if (!mounted && event.key === 'Escape') {\n const isClear = selectionMode === 'multiple' && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;\n const details = createChangeEventDetails(REASONS.escapeKey, event.nativeEvent);\n const value = selectionMode === 'multiple' ? [] : null;\n store.context.setInputValue('', details);\n store.context.setSelectedValue(value, details);\n if (!isClear && !store.state.inline && !details.isPropagationAllowed) {\n event.stopPropagation();\n }\n return;\n }\n\n // Handle deletion when the input is empty.\n if (comboboxChipsContext && event.key === 'Backspace' && input.value === '' && Array.isArray(selectedValue) && selectedValue.length > 0) {\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;\n const newValue = selectedValue.filter((_, index) => index !== removalIndex);\n // If the removed item was also the active (highlighted) item, clear highlight\n clearHighlight(event.nativeEvent);\n store.context.setSelectedValue(newValue, createChangeEventDetails(REASONS.none, event.nativeEvent));\n return;\n }\n const nextIndex = handleKeyDown(event);\n if (nextIndex !== undefined) {\n comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();\n }\n\n // event.isComposing\n if (event.which === 229) {\n return;\n }\n if (event.key === 'Enter' && open) {\n const activeIndex = store.state.activeIndex;\n const nativeEvent = event.nativeEvent;\n if (activeIndex === null) {\n if (inline) {\n return;\n }\n\n // Allow form submission when no item is highlighted.\n store.context.setOpen(false, createChangeEventDetails(REASONS.none, nativeEvent));\n return;\n }\n stopEvent(event);\n clickHighlightedItem(store, activeIndex, nativeEvent);\n }\n }\n }, validationProps],\n stateAttributesMapping: triggerStateAttributesMapping\n });\n const renderedInput = hasPositionerParent ? /*#__PURE__*/_jsx(FieldRootContext.Provider, {\n value: DEFAULT_FIELD_ROOT_CONTEXT,\n children: element\n }) : element;\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [open && focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.context.startDismissRef\n }), renderedInput]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInput.displayName = \"ComboboxInput\";","import { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport * as ComboboxInputDataAttributes from \"../input/ComboboxInputDataAttributes.mjs\";\nexport const triggerStateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n [ComboboxInputDataAttributes.popupSide]: side\n } : null,\n listEmpty: empty => empty ? {\n [ComboboxInputDataAttributes.listEmpty]: ''\n } : null\n};","import { CommonTriggerDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the corresponding popup is open.\n */\nexport const popupOpen = CommonTriggerDataAttributes.popupOpen;\n/**\n * Present when the input is pressed.\n */\nexport const pressed = CommonTriggerDataAttributes.pressed;\n/**\n * Present when the component is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the component is readonly.\n */\nexport const readonly = 'data-readonly';\n/**\n * Indicates which side the corresponding popup is positioned relative to its anchor.\n * @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}\n */\nexport const popupSide = 'data-popup-side';\n/**\n * Present when the component is required.\n */\nexport const required = 'data-required';\n/**\n * Present when the component is in a valid state (when wrapped in Field.Root).\n */\nexport const valid = 'data-valid';\n/**\n * Present when the component is in an invalid state (when wrapped in Field.Root).\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the component has been touched (when wrapped in Field.Root).\n */\nexport const touched = 'data-touched';\n/**\n * Present when the component's value has changed (when wrapped in Field.Root).\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the component has a value (when wrapped in Field.Root).\n */\nexport const filled = 'data-filled';\n/**\n * Present when the input is focused (when wrapped in Field.Root).\n */\nexport const focused = 'data-focused';\n/**\n * Present when the corresponding items list is empty.\n */\nexport const listEmpty = 'data-list-empty';","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useFieldRootContext } from \"./FieldRootContext.mjs\";\n\n/**\n * Returns the field's `setFocused`, recording which control the focused state belongs to.\n *\n * Disabling or unmounting a focused control moves focus away without firing `blur`, so the focused\n * state would otherwise stay latched. A field can have several focus targets, so a control only\n * clears the shared state when focus last landed on itself. The stable callback doubles as that\n * identity.\n */\nexport function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {\n const {\n setFocused,\n focusOwnerRef\n } = useFieldRootContext();\n const setFieldFocused = useStableCallback(focused => {\n // A disabled target can still be focused (`aria-disabled` elements stay programmatically\n // focusable), but must not publish the field's focused styling.\n if (focused ? !disabled : focusOwnerRef.current === setFieldFocused) {\n focusOwnerRef.current = focused && setFieldFocused;\n onFocusedChange?.(focused);\n setFocused(focused);\n }\n });\n\n // Re-run when `disabled` changes so a focused control releases the field even when the browser\n // does not fire `blur`. The setup reclaims focus that no focus event reported: StrictMode\n // re-running effects after a mount-time focus, a control focused before hydration, or an\n // `aria-disabled` control re-enabled while it kept focus.\n useIsoLayoutEffect(() => {\n const el = focusTargetRef.current;\n const root = el?.getRootNode();\n if (root?.activeElement === el) {\n setFieldFocused(true);\n }\n return () => setFieldFocused(false);\n }, [disabled, focusTargetRef, setFieldFocused]);\n return setFieldFocused;\n}","'use client';\n\nimport * as React from 'react';\nexport const ComboboxChipsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipsContext.displayName = \"ComboboxChipsContext\";\nexport function useComboboxChipsContext() {\n return React.useContext(ComboboxChipsContext);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPositionerContext.displayName = \"ComboboxPositionerContext\";\nexport function useComboboxPositionerContext(optional) {\n const context = React.useContext(ComboboxPositionerContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component' : _formatErrorMessage(21));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * @internal\n */\nexport const ComboboxInternalDismissButton = /*#__PURE__*/React.forwardRef(function ComboboxInternalDismissButton(_, forwardedRef) {\n const store = useComboboxRootContext();\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: false\n });\n const mergedRef = useMergedRefs(forwardedRef, buttonRef);\n function handleDismiss(event) {\n store.context.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent, event.currentTarget));\n }\n const dismissProps = getButtonProps({\n onClick: handleDismiss\n });\n return /*#__PURE__*/_jsx(\"span\", {\n ref: mergedRef,\n ...dismissProps,\n \"aria-label\": \"Dismiss\",\n tabIndex: undefined,\n style: visuallyHiddenInput\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInternalDismissButton.displayName = \"ComboboxInternalDismissButton\";","'use client';\n\nimport { useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\n/**\n * The popup side is only meaningful while the positioner is mounted, as the store retains the\n * last resolved side after the popup unmounts.\n */\nexport function usePopupSide(store) {\n const mounted = store.useState('mounted');\n const popupSide = store.useState('popupSide');\n const positionerElement = store.useState('positionerElement');\n return mounted && positionerElement ? popupSide : null;\n}\n\n/**\n * Whether the filtered list has no items to show.\n */\nexport function useListEmpty() {\n return useComboboxDerivedItemsContext().filteredItems.length === 0;\n}\n\n/**\n * The arrow keys that move the chip highlight backwards and forwards, in that order.\n */\nexport function getChipNavigationKeys(direction) {\n return direction === 'rtl' ? ['ArrowRight', 'ArrowLeft'] : ['ArrowLeft', 'ArrowRight'];\n}\n\n/**\n * Where the highlight lands once the chip at `index` is removed, or `undefined` for no highlight.\n */\nexport function getIndexAfterChipRemoval(index, chipCount) {\n const nextIndex = index >= chipCount - 1 ? chipCount - 2 : index;\n return nextIndex >= 0 ? nextIndex : undefined;\n}\n\n/**\n * Commits the highlighted item by clicking it, tagging the originating event so the item's\n * handler can attribute the selection to it.\n */\nexport function clickHighlightedItem(store, activeIndex, nativeEvent) {\n const listItem = store.context.listRef.current[activeIndex];\n if (listItem) {\n store.context.selectionEventRef.current = nativeEvent;\n listItem.click();\n store.context.selectionEventRef.current = null;\n }\n}","import { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getTarget, isInteractiveElement } from \"../../floating-ui-react/utils/element.mjs\";\nexport function handleInputPress(event, store, disabled, shouldIgnoreTarget) {\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n const targetElement = isElement(target) ? target : null;\n if (targetElement !== event.currentTarget && (shouldIgnoreTarget?.(targetElement) || isInteractiveElement(targetElement))) {\n return;\n }\n event.preventDefault();\n if (disabled) {\n return;\n }\n store.context.inputRef.current?.focus();\n if (store.state.openOnInputClick) {\n store.context.setOpen(true, createChangeEventDetails(REASONS.inputPress, event.nativeEvent));\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { handleInputPress } from \"../utils/handleInputPress.mjs\";\nimport { useListEmpty, usePopupSide } from \"../utils/parts.mjs\";\nimport { contains } from \"../../floating-ui-react/utils/element.mjs\";\n\n/**\n * A wrapper for the input and its associated controls.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxInputGroup = /*#__PURE__*/React.forwardRef(function ComboboxInputGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState\n } = useFieldRootContext();\n const store = useComboboxRootContext();\n const open = store.useState('open');\n const comboboxDisabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const hasSelectedValue = store.useState('hasSelectedValue');\n const selectionMode = store.useState('selectionMode');\n const popupSide = usePopupSide(store);\n const disabled = comboboxDisabled;\n const listEmpty = useListEmpty();\n const placeholder = selectionMode === 'none' ? false : !hasSelectedValue;\n const state = {\n ...fieldState,\n open,\n disabled,\n readOnly,\n popupSide,\n listEmpty,\n placeholder\n };\n const setInputGroupElement = useStableCallback(element => {\n store.set('inputGroupElement', element);\n });\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setInputGroupElement],\n props: [{\n role: 'group',\n onMouseDown(event) {\n handleInputPress(event, store, disabled, target => {\n return contains(store.context.chipsContainerRef.current, target);\n });\n }\n }, elementProps],\n state,\n stateAttributesMapping: triggerStateAttributesMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInputGroup.displayName = \"ComboboxInputGroup\";","'use client';\n\nimport * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GroupCollectionContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") GroupCollectionContext.displayName = \"GroupCollectionContext\";\nexport function useGroupCollectionContext() {\n return React.useContext(GroupCollectionContext);\n}\nexport function GroupCollectionProvider(props) {\n const {\n children,\n items\n } = props;\n const contextValue = React.useMemo(() => ({\n items\n }), [items]);\n return /*#__PURE__*/_jsx(GroupCollectionContext.Provider, {\n value: contextValue,\n children: children\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useGroupCollectionContext } from \"./GroupCollectionContext.mjs\";\n\n/**\n * Renders filtered list items.\n * Doesn't render its own HTML element.\n *\n * If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ComboboxCollection(props) {\n const {\n children\n } = props;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const groupContext = useGroupCollectionContext();\n const itemsToRender = groupContext ? groupContext.items : filteredItems;\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: itemsToRender.map(children)\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxDerivedItemsContext, useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { ComboboxCollection } from \"../collection/ComboboxCollection.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { clickHighlightedItem } from \"../utils/parts.mjs\";\n\n/**\n * A list container for the items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxList = /*#__PURE__*/React.forwardRef(function ComboboxList(componentProps, forwardedRef) {\n var _ComboboxCollection;\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const floatingRootContext = useComboboxFloatingContext();\n const hasPositionerContext = Boolean(useComboboxPositionerContext(true));\n const {\n filteredItems,\n hasItems\n } = useComboboxDerivedItemsContext();\n const selectionMode = store.useState('selectionMode');\n const grid = store.useState('grid');\n const readOnly = store.useState('readOnly');\n const listProps = store.useState('listProps');\n const virtualized = store.useState('virtualized');\n const forceMounted = store.useState('forceMounted');\n const multiple = selectionMode === 'multiple';\n const empty = filteredItems.length === 0;\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n\n // Support \"closed template\" API: if children is a function, implicitly wrap it\n // with a Combobox.Collection that reads items from context/root.\n // Ensures this component's `listProps` subscription does not cause <Combobox.Item>\n // to re-render on every active index change.\n const resolvedChildren = React.useMemo(() => {\n if (typeof children === 'function') {\n return _ComboboxCollection || (_ComboboxCollection = /*#__PURE__*/_jsx(ComboboxCollection, {\n children: children\n }));\n }\n return children;\n }, [children]);\n const state = {\n empty\n };\n const floatingId = floatingRootContext.useState('floatingId');\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, setListElement, hasPositionerContext ? null : setPositionerElement],\n props: [listProps, {\n children: resolvedChildren,\n tabIndex: -1,\n id: floatingId,\n role: grid ? 'grid' : 'listbox',\n 'aria-multiselectable': multiple ? 'true' : undefined,\n // On a grid the attribute describes cell editability, not selection, so it's left to the\n // combobox element in that mode.\n 'aria-readonly': !grid && readOnly ? true : undefined,\n onKeyDown(event) {\n if (store.state.disabled || store.state.readOnly) {\n return;\n }\n if (event.key === 'Enter') {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n // Allow form submission when no item is highlighted.\n return;\n }\n stopEvent(event);\n clickHighlightedItem(store, activeIndex, event.nativeEvent);\n }\n }\n }, elementProps]\n });\n if (virtualized) {\n return element;\n }\n\n // With the `items` prop, typeahead labels are derived from the items so they survive the list\n // unmounting (unmounting clears the registered labels). Rendered labels only need to be\n // registered when the list is force-mounted to match browser autofill against rendered text.\n const labelsRef = hasItems && !forceMounted ? undefined : store.context.labelsRef;\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: store.context.listRef,\n labelsRef: labelsRef,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxList.displayName = \"ComboboxList\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { ComboboxPortalContext } from \"./ComboboxPortalContext.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxPortal = /*#__PURE__*/React.forwardRef(function ComboboxPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useComboboxRootContext();\n const mounted = store.useState('mounted');\n const forceMounted = store.useState('forceMounted');\n const shouldRender = mounted || keepMounted || forceMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ComboboxPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPortal.displayName = \"ComboboxPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPortalContext.displayName = \"ComboboxPortalContext\";\nexport function useComboboxPortalContext() {\n const context = React.useContext(ComboboxPortalContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Portal> is missing.' : _formatErrorMessage(20));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { ComboboxPositionerContext } from \"./ComboboxPositionerContext.mjs\";\nimport { useListEmpty } from \"../utils/parts.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { useComboboxPortalContext } from \"../portal/ComboboxPortalContext.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\n\n/**\n * Positions the popup against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxPositioner = /*#__PURE__*/React.forwardRef(function ComboboxPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n // `useAnchorPositioning` applies the same defaults to the undefined values; the names\n // remain destructured to exclude the props from `elementProps`.\n positionMethod,\n side,\n align,\n sideOffset,\n alignOffset,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding,\n sticky,\n disableAnchorTracking = false,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style: styleProp,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const floatingRootContext = useComboboxFloatingContext();\n const keepMounted = useComboboxPortalContext();\n const modal = store.useState('modal');\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const openMethod = store.useState('openMethod');\n const positionerElement = store.useState('positionerElement');\n const triggerElement = store.useState('triggerElement');\n const inputElement = store.useState('inputElement');\n const inputGroupElement = store.useState('inputGroupElement');\n const inputInsidePopup = store.useState('inputInsidePopup');\n const transitionStatus = store.useState('transitionStatus');\n const empty = useListEmpty();\n const resolvedAnchor = anchor ?? (inputInsidePopup ? triggerElement : inputGroupElement ?? inputElement);\n const positioning = useAnchorPositioning({\n anchor: resolvedAnchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking,\n keepMounted,\n collisionAvoidance,\n lazyFlip: true\n });\n useAnchoredPopupScrollLock(open && modal, openMethod === 'touch', positionerElement, triggerElement);\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n empty\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n return /*#__PURE__*/_jsxs(ComboboxPositionerContext.Provider, {\n value: positioning,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: inputGroupElement ?? inputElement ?? triggerElement\n }), element]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPositioner.displayName = \"ComboboxPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.mjs\";\nimport { getComboboxPopupId } from \"../root/utils/index.mjs\";\nimport { useListEmpty } from \"../utils/parts.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxPopup = /*#__PURE__*/React.forwardRef(function ComboboxPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n initialFocus,\n finalFocus,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const positioning = useComboboxPositionerContext();\n const floatingRootContext = useComboboxFloatingContext();\n const mounted = store.useState('mounted');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const popupProps = store.useState('popupProps');\n const transitionStatus = store.useState('transitionStatus');\n const inputInsidePopup = store.useState('inputInsidePopup');\n const inputElement = store.useState('inputElement');\n const modal = store.useState('modal');\n const rootId = store.useState('id');\n const empty = useListEmpty();\n const popupId = elementProps.id ?? (inputInsidePopup ? getComboboxPopupId(rootId) : undefined);\n useIsoLayoutEffect(() => {\n // Prefer the rendered DOM id, which a `render` prop element or function may override.\n store.set('popupId', store.context.popupRef.current?.id || popupId);\n return () => {\n store.set('popupId', undefined);\n };\n }, [store, popupId]);\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete(true);\n }\n }\n });\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n transitionStatus,\n empty\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef],\n props: [popupProps, {\n id: popupId,\n role: inputInsidePopup ? 'dialog' : 'presentation',\n onFocus(event) {\n const target = getTarget(event.nativeEvent);\n if (openMethod !== 'touch' && (contains(store.state.listElement, target) || target === event.currentTarget)) {\n store.context.inputRef.current?.focus();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping\n });\n\n // Default initial focus logic:\n // If opened by touch, focus the popup element to prevent the virtual keyboard from opening\n // (this is required for Android specifically as iOS handles this automatically).\n const computedDefaultInitialFocus = inputInsidePopup ? interactionType => interactionType === 'touch' ? store.context.popupRef.current : inputElement : false;\n const resolvedInitialFocus = initialFocus === undefined ? computedDefaultInitialFocus : initialFocus;\n let resolvedFinalFocus;\n if (finalFocus != null) {\n resolvedFinalFocus = finalFocus;\n } else {\n resolvedFinalFocus = inputInsidePopup ? undefined : false;\n }\n const focusManagerModal = !inputInsidePopup || modal;\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n disabled: !mounted,\n modal: focusManagerModal,\n openInteractionType: openMethod,\n initialFocus: resolvedInitialFocus,\n returnFocus: resolvedFinalFocus,\n getInsideElements: () => [store.context.startDismissRef.current, store.context.endDismissRef.current],\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [element, focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.context.endDismissRef\n })]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPopup.displayName = \"ComboboxPopup\";","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useComboboxRootContext, useComboboxHasItemsContext, useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxItemContext } from \"./ComboboxItemContext.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useComboboxRowContext } from \"../row/ComboboxRowContext.mjs\";\nimport { compareItemEquality, findItemIndex, resolveSelectedIndex } from \"../../internals/itemEquality.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction ComboboxItemInner(props) {\n const {\n componentProps,\n forwardedRef,\n virtualized,\n indexFromFilter\n } = props;\n const {\n render,\n className,\n style,\n value: itemValue = null,\n index: indexProp,\n disabled: disabledProp = false,\n nativeButton = false,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n guess: true,\n index: indexProp,\n textRef\n });\n const store = useComboboxRootContext();\n const isRow = useComboboxRowContext();\n const hasItems = useComboboxHasItemsContext();\n const {\n props: itemProps,\n id: rootId,\n selectionMode,\n disabled: rootDisabled,\n readOnly,\n isItemEqualToValue\n } = store.useState('itemRoot');\n const disabled = rootDisabled || disabledProp;\n const selectable = selectionMode !== 'none';\n const index = indexProp ?? indexFromFilter ?? listItem.index;\n const hasRegistered = index !== -1;\n const highlighted = store.useState('isActive', index);\n const matchesSelectedValue = store.useState('isSelected', itemValue);\n const itemRef = React.useRef(null);\n const id = rootId != null && hasRegistered ? `${rootId}-${index}` : undefined;\n const selected = matchesSelectedValue && selectable;\n useIsoLayoutEffect(() => {\n const shouldRun = hasRegistered && (virtualized || indexProp != null);\n if (!shouldRun) {\n return undefined;\n }\n const list = store.context.listRef.current;\n list[index] = itemRef.current;\n return () => {\n delete list[index];\n };\n }, [hasRegistered, virtualized, index, indexProp, store]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered || hasItems) {\n return undefined;\n }\n const visibleValues = store.context.valuesRef.current;\n visibleValues[index] = itemValue;\n return () => {\n delete visibleValues[index];\n };\n }, [hasRegistered, hasItems, index, itemValue, store]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered || hasItems) {\n return;\n }\n\n // Runs while closed as well (the list can stay mounted via `keepMounted` or a\n // force-mount) so the index tracks the item's composite position, keeping features\n // like closed-trigger typeahead in sync when the rendered order changes.\n const selectedValue = store.state.selectedValue;\n let nextIndex = store.state.selectedIndex;\n if (store.state.selectionMode === 'multiple' && Array.isArray(selectedValue)) {\n nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, nextIndex);\n } else if (compareItemEquality(itemValue, selectedValue, isItemEqualToValue)) {\n nextIndex = index;\n }\n store.set('selectedIndex', nextIndex);\n }, [hasRegistered, hasItems, store, index, itemValue, isItemEqualToValue]);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const state = {\n disabled,\n selected,\n highlighted\n };\n function commitSelection(nativeEvent) {\n function selectItem() {\n store.context.handleSelection(nativeEvent, itemValue);\n }\n if (store.state.submitOnItemClick) {\n ReactDOM.flushSync(selectItem);\n store.context.requestSubmit();\n } else {\n selectItem();\n }\n }\n const defaultProps = {\n id,\n role: isRow ? 'gridcell' : 'option',\n 'aria-selected': selectable ? selected : undefined,\n // Focusable items steal focus from the input upon mouseup.\n // Warn if the user renders a natively focusable element like `<button>`,\n // as it should be a `<div>` instead.\n tabIndex: undefined,\n onPointerDownCapture(event) {\n // The compat `mouseup` only fires for the primary pointer, so a non-primary\n // touch must not overwrite the shared ref — a mismatch would make the primary\n // pointer's release read as a drag-select and commit a second time after `click`.\n if (event.isPrimary) {\n store.context.pointerDownItemRef.current = event.currentTarget;\n }\n event.preventDefault();\n },\n onMouseDown(event) {\n // iOS Safari can emit a synthetic mousedown for touch taps without a preceding\n // pointerdown. Prevent default here too so tapping an item does not blur the input.\n event.preventDefault();\n },\n onClick(event) {\n if (disabled || readOnly) {\n return;\n }\n commitSelection(event.nativeEvent);\n },\n onMouseUp(event) {\n const pointerStartedOnItem = store.context.pointerDownItemRef.current === event.currentTarget;\n store.context.pointerDownItemRef.current = null;\n if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) {\n return;\n }\n commitSelection(event.nativeEvent);\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [itemProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n textRef\n }), [selected, textRef]);\n return /*#__PURE__*/_jsx(ComboboxItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}\n\n/**\n * Resolves the index from the filtered items for the virtualized fallback (no `index` prop).\n * Isolated here so that this per-keystroke subscription to the derived-items context is only\n * paid by virtualized items. Those re-render on every input change anyway — the parent\n * virtualizer re-windows the list as the filtered set changes — so the extra subscription costs\n * them nothing, while it keeps every non-virtualized item off that context.\n */\nfunction ComboboxItemVirtualizedIndex(props) {\n const {\n componentProps,\n forwardedRef\n } = props;\n const store = useComboboxRootContext();\n const isItemEqualToValue = store.useState('isItemEqualToValue');\n const {\n flatFilteredValues\n } = useComboboxDerivedItemsContext();\n const lookupValue = componentProps.value ?? null;\n const indexFromFilter = findItemIndex(flatFilteredValues, lookupValue, isItemEqualToValue);\n\n // Only reached when `virtualized` is true (see the wrapper below).\n return /*#__PURE__*/_jsx(ComboboxItemInner, {\n componentProps: componentProps,\n forwardedRef: forwardedRef,\n virtualized: true,\n indexFromFilter: indexFromFilter\n });\n}\n\n/**\n * An individual item in the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ComboboxItem(componentProps, forwardedRef) {\n const store = useComboboxRootContext();\n const virtualized = store.useState('virtualized');\n\n // `virtualized` (and whether an item provides an explicit `index`) must be stable for an\n // item's lifetime: the two branches return different component types, so flipping it at\n // runtime remounts the item and resets its refs and effects.\n if (virtualized && componentProps.index == null) {\n return /*#__PURE__*/_jsx(ComboboxItemVirtualizedIndex, {\n componentProps: componentProps,\n forwardedRef: forwardedRef\n });\n }\n return /*#__PURE__*/_jsx(ComboboxItemInner, {\n componentProps: componentProps,\n forwardedRef: forwardedRef,\n virtualized: virtualized,\n indexFromFilter: undefined\n });\n}));\nif (process.env.NODE_ENV !== \"production\") ComboboxItem.displayName = \"ComboboxItem\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxItemContext.displayName = \"ComboboxItemContext\";\nexport function useComboboxItemContext() {\n const context = React.useContext(ComboboxItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.' : _formatErrorMessage(19));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport const ComboboxRowContext = /*#__PURE__*/React.createContext(false);\nif (process.env.NODE_ENV !== \"production\") ComboboxRowContext.displayName = \"ComboboxRowContext\";\nexport function useComboboxRowContext() {\n return React.useContext(ComboboxRowContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useTransitionStatus } from \"../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\nimport { transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\n\n// The public wrappers mount this component only when selected or kept mounted, avoiding the\n// hook costs for unselected items. Pass selection as a prop so memoization observes changes.\nexport const ItemIndicator = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ItemIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted,\n selected,\n ...elementProps\n } = componentProps;\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n batch: true,\n enabled: !selected,\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") ItemIndicator.displayName = \"ItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useComboboxItemContext } from \"../item/ComboboxItemContext.mjs\";\nimport { ItemIndicator } from \"../../utils/ItemIndicator.mjs\";\n\n/**\n * Indicates whether the item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxItemIndicator = /*#__PURE__*/React.forwardRef(function ComboboxItemIndicator(componentProps, forwardedRef) {\n const {\n selected\n } = useComboboxItemContext();\n const shouldRender = componentProps.keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ItemIndicator, {\n ...componentProps,\n selected: selected,\n ref: forwardedRef\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxItemIndicator.displayName = \"ComboboxItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxChipsContext } from \"./ComboboxChipsContext.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { handleInputPress } from \"../utils/handleInputPress.mjs\";\n\n/**\n * A container for the chips in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChips = /*#__PURE__*/React.forwardRef(function ComboboxChips(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const hasSelectionChips = store.useState('hasSelectionChips');\n const chipsRef = React.useRef([]);\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.context.chipsContainerRef],\n // NVDA enters browse mode instead of staying in focus mode when navigating with\n // arrow keys inside a container unless it has a toolbar role.\n props: [hasSelectionChips ? {\n role: 'toolbar'\n } : EMPTY_OBJECT, {\n onMouseDown(event) {\n handleInputPress(event, store, store.state.disabled);\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n chipsRef\n }), []);\n return /*#__PURE__*/_jsx(ComboboxChipsContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: chipsRef,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChips.displayName = \"ComboboxChips\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxChipContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipContext.displayName = \"ComboboxChipContext\";\nexport function useComboboxChipContext() {\n const context = React.useContext(ComboboxChipContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxChipContext is missing. ComboboxChip parts must be placed within <Combobox.Chip>.' : _formatErrorMessage(17));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { ComboboxChipContext } from \"./ComboboxChipContext.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { getChipNavigationKeys, getIndexAfterChipRemoval } from \"../utils/parts.mjs\";\n\n/**\n * An individual chip that represents a value in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChip = /*#__PURE__*/React.forwardRef(function ComboboxChip(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n chipsRef\n } = useComboboxChipsContext();\n const direction = useDirection();\n const disabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const selectedValue = store.useState('selectedValue');\n const {\n ref,\n index\n } = useCompositeListItem();\n function handleKeyDown(event) {\n let nextIndex = index;\n const [previousChipKey, nextChipKey] = getChipNavigationKeys(direction);\n if (event.key === previousChipKey) {\n event.preventDefault();\n if (index > 0) {\n nextIndex = index - 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === nextChipKey) {\n event.preventDefault();\n if (index < chipsRef.current.length - 1) {\n nextIndex = index + 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n nextIndex = getIndexAfterChipRemoval(index, selectedValue.length);\n stopEvent(event);\n\n // Commit the removal before focusing so `chipsRef` reflects the remaining chips.\n ReactDOM.flushSync(() => {\n store.context.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: REASONS.keyboard,\n event: event.nativeEvent\n });\n store.context.setSelectedValue(selectedValue.filter((_, i) => i !== index), createChangeEventDetails(REASONS.none, event.nativeEvent));\n });\n } else if (event.key === 'Enter' || event.key === ' ') {\n stopEvent(event);\n nextIndex = undefined;\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n stopEvent(event);\n // The input may mount when opening.\n ReactDOM.flushSync(() => {\n store.context.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n });\n nextIndex = undefined;\n } else if (\n // Check for printable characters (letters, numbers, symbols)\n event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n nextIndex = undefined;\n }\n return nextIndex;\n }\n const state = {\n disabled\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, ref],\n state,\n props: [{\n tabIndex: -1,\n 'aria-disabled': disabled || undefined,\n 'aria-readonly': readOnly || undefined,\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n const nextIndex = handleKeyDown(event);\n if (nextIndex === undefined) {\n store.context.inputRef.current?.focus();\n } else {\n chipsRef.current[nextIndex]?.focus();\n }\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n index\n }), [index]);\n return /*#__PURE__*/_jsx(ComboboxChipContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChip.displayName = \"ComboboxChip\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useComboboxChipContext } from \"../chip/ComboboxChipContext.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getHighlightReason } from \"../../utils/getHighlightReason.mjs\";\nimport { findItemIndex } from \"../../internals/itemEquality.mjs\";\n\n/**\n * A button to remove a chip.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxChipRemove = /*#__PURE__*/React.forwardRef(function ComboboxChipRemove(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n index\n } = useComboboxChipContext();\n const comboboxDisabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const selectedValue = store.useState('selectedValue');\n const isItemEqualToValue = store.useState('isItemEqualToValue');\n const disabled = comboboxDisabled || disabledProp;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled: disabled || readOnly,\n focusableWhenDisabled: true\n });\n const state = {\n disabled\n };\n function clearActiveIndexForRemovedItem(removedItem, event) {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n return;\n }\n\n // Try current visible list first; if not found, it's filtered out.\n // No need to clear highlight in that case since it can't equal activeIndex.\n const removedIndex = findItemIndex(store.context.valuesRef.current, removedItem, isItemEqualToValue);\n if (removedIndex !== -1 && activeIndex === removedIndex) {\n store.context.setIndices({\n activeIndex: null,\n type: getHighlightReason(event),\n event\n });\n }\n }\n function removeChip(event) {\n const eventDetails = createChangeEventDetails(REASONS.chipRemovePress, event.nativeEvent);\n const removedItem = selectedValue[index];\n clearActiveIndexForRemovedItem(removedItem, event.nativeEvent);\n store.context.setSelectedValue(selectedValue.filter((_, i) => i !== index), eventDetails);\n store.context.inputRef.current?.focus();\n return eventDetails;\n }\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n tabIndex: -1,\n onMouseDown(event) {\n event.preventDefault();\n },\n onClick(event) {\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n },\n onKeyDown(event) {\n if (event.key === 'Enter' || event.key === ' ') {\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n stopEvent(event);\n }\n }\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChipRemove.displayName = \"ComboboxChipRemove\";","'use client';\n\nimport * as React from 'react';\nimport { platform } from '@base-ui/utils/platform';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\n\n// Word Joiner is invisible and zero-width, so it forces a text mutation without shifting layout.\nconst LIVE_REGION_MARKER = '\\u2060';\n// Safari VoiceOver needed roughly 200ms to reliably notice the initial polite live-region change.\nexport const INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY = 200;\nfunction findLastTextNode(root) {\n const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);\n let lastTextNode = null;\n while (walker.nextNode()) {\n const textNode = walker.currentNode;\n if (textNode.nodeValue !== '') {\n lastTextNode = textNode;\n }\n }\n return lastTextNode;\n}\n\n/**\n * @param present Whether the live region element is currently rendered. Lets a conditionally\n * rendered region re-run the marker each time its element (re)appears with text.\n */\nexport function useInitialLiveRegionTextMutation(present = true) {\n const timeout = useTimeout();\n const rootRef = React.useRef(null);\n\n // Only the initial mounted announcement needs the marker; later text updates announce naturally.\n React.useEffect(() => {\n if (!present || platform.os.ios) {\n return undefined;\n }\n const root = rootRef.current;\n if (root == null) {\n return undefined;\n }\n const textNode = findLastTextNode(root);\n if (textNode == null) {\n return undefined;\n }\n const originalValue = textNode.data;\n const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;\n textNode.nodeValue = markedValue;\n timeout.start(INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY, () => {\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n });\n return () => {\n timeout.clear();\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n };\n }, [present, rootRef, timeout]);\n return rootRef;\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxDerivedItemsContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useInitialLiveRegionTextMutation } from \"../../internals/useInitialLiveRegionTextMutation.mjs\";\n\n/**\n * Renders its children only when the list is empty.\n * Requires the `items` prop on the root component.\n * Announces changes politely to screen readers.\n * This component's root element must remain mounted in the DOM to announce\n * changes consistently across screen readers. Avoid hiding or removing the\n * component itself with `display: none`, `hidden`, `aria-hidden`, or conditional\n * rendering. Prefer updating or conditionally rendering its children instead.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxEmpty = /*#__PURE__*/React.forwardRef(function ComboboxEmpty(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const store = useComboboxRootContext();\n const emptyRef = useInitialLiveRegionTextMutation();\n const children = filteredItems.length === 0 ? childrenProp : null;\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.context.emptyRef, emptyRef],\n props: [{\n children,\n role: 'status',\n 'aria-live': 'polite',\n 'aria-atomic': true\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxEmpty.displayName = \"ComboboxEmpty\";","'use client';\n\nimport { Combobox } from '@base-ui/react/combobox';\n\nimport type { ListedScope } from './needs-chips';\n\ninterface ScopeItem {\n value: string;\n label: string;\n description: string;\n}\n\nconst itemOf = ({ scope, description }: ListedScope): ScopeItem => ({ value: scope, label: scope, description });\n\n/**\n * Picks several of the fleet's listed scopes (gateway scopes 4.3), searched\n * by name or description. A scope picked before that the fleet no longer\n * lists stays picked, so it can be seen and removed.\n */\nexport function ScopePicker({ label, listed, picked, onPick, isDisabled = false, testId }: { label: string; listed: readonly ListedScope[]; picked: readonly string[]; onPick: (scopes: string[]) => void; isDisabled?: boolean; testId?: string }) {\n const { contains } = Combobox.useFilter();\n const items = [...listed.map(itemOf), ...picked.filter((scope) => !listed.some((each) => each.scope === scope)).map((scope) => ({ value: scope, label: scope, description: 'No longer defined in the fleet' }))];\n const value = items.filter((item) => picked.includes(item.value));\n return (\n <Combobox.Root\n multiple\n items={items}\n value={value}\n disabled={isDisabled}\n isItemEqualToValue={(item, chosen) => item.value === chosen.value}\n onValueChange={(next: ScopeItem[], details) => {\n // Escape closes the list; it never takes back what was picked.\n if (details.reason === 'escape-key') {\n details.cancel();\n return;\n }\n onPick(next.map((item) => item.value));\n }}\n filter={(item: ScopeItem, query) => contains(item.label, query) || contains(item.description, query)}\n >\n <div className=\"grid gap-1\" data-testid={testId}>\n <Combobox.Label className=\"font-medium\">{label}</Combobox.Label>\n <Combobox.InputGroup className=\"flex min-h-9 flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1\">\n <Combobox.Chips className=\"contents\">\n {value.map((item) => (\n <Combobox.Chip key={item.value} className=\"inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 font-mono text-caption\" aria-label={item.value}>\n {item.value}\n <Combobox.ChipRemove className=\"text-muted-foreground hover:text-foreground\" aria-label={`Remove ${item.value}`}>\n ×\n </Combobox.ChipRemove>\n </Combobox.Chip>\n ))}\n <Combobox.Input placeholder={value.length === 0 ? 'Search the fleet\\'s scopes' : ''} className=\"h-7 min-w-32 flex-1 bg-transparent outline-none\" />\n </Combobox.Chips>\n </Combobox.InputGroup>\n </div>\n <Combobox.Portal>\n <Combobox.Positioner sideOffset={4} className=\"z-50\">\n <Combobox.Popup className=\"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\">\n <Combobox.Empty className=\"px-2 py-1 text-muted-foreground\">No scope listed matches.</Combobox.Empty>\n <Combobox.List>\n {(item: ScopeItem) => (\n <Combobox.Item key={item.value} value={item} className=\"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded px-2 py-1 data-highlighted:bg-accent\">\n <Combobox.ItemIndicator className=\"row-span-2\">✓</Combobox.ItemIndicator>\n <span className=\"col-start-2 font-mono text-code\">{item.value}</span>\n <span className=\"col-start-2 text-caption text-muted-foreground\">{item.description}</span>\n </Combobox.Item>\n )}\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n );\n}\n","'use client';\n\nimport { Dialog } from '@base-ui/react/dialog';\nimport type { ReactNode } from 'react';\n\nimport { BUTTONS } from '../../../forms/ui/look';\nimport { ActionButton } from '../../../overview/ui/action-button';\n\n/** Why the API refused a change in a dialog: said inline, CONFLICT with Reload, at the requirements' version the change was made on. */\nexport interface DialogRefusal {\n message: string;\n isConflict: boolean;\n version: number;\n}\n\n/** The refusal still to say: a CONFLICT is answered once the page read newer requirements. */\nexport function standingRefusal(refusal: DialogRefusal | null, version: number): DialogRefusal | null {\n return refusal?.isConflict === true && version > refusal.version ? null : refusal;\n}\n\n/**\n * A dialog of the tools table (gateway scopes 4.3): its fields, a footer\n * saying what it applies to, and its action. While the action is on its\n * way the action shows its spinner and the dialog takes no input and does\n * not close; a refusal stays inline, with Reload when the requirements\n * changed since the page was read, which shows its spinner until the page\n * read them again.\n */\nexport function TableDialog({\n isOpen,\n onClose,\n title,\n description,\n children,\n appliesTo,\n action,\n isSaving,\n refusal,\n onReload,\n isReloading,\n testId,\n}: {\n isOpen: boolean;\n onClose: () => void;\n title: string;\n description: string;\n children: ReactNode;\n appliesTo: string;\n action: { label: string; pending: string; isDisabled: boolean; onPress: () => void };\n isSaving: boolean;\n refusal: DialogRefusal | null;\n onReload: () => void;\n isReloading: boolean;\n testId: string;\n}) {\n return (\n <Dialog.Root\n open={isOpen}\n onOpenChange={(open) => {\n if (!open && !isSaving) {\n onClose();\n }\n }}\n >\n <Dialog.Portal>\n <Dialog.Backdrop className=\"fixed inset-0 z-40 bg-(--overlay)\" />\n <Dialog.Popup className=\"fixed top-1/2 left-1/2 z-50 grid max-h-[90vh] w-[min(36rem,calc(100vw-2rem))] -translate-1/2 gap-4 overflow-auto rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-lg\" data-testid={testId}>\n <div className=\"grid gap-1\">\n <Dialog.Title className=\"text-heading font-semibold\">{title}</Dialog.Title>\n <Dialog.Description className=\"text-muted-foreground\">{description}</Dialog.Description>\n </div>\n <fieldset disabled={isSaving} className=\"grid gap-4\">\n {children}\n </fieldset>\n {refusal === null ? null : (\n <div role=\"alert\" className=\"flex flex-wrap items-center justify-between gap-2 rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg\" data-testid=\"tools-table-dialog-refusal\">\n <span>{refusal.message}</span>\n {refusal.isConflict ? (\n <ActionButton isPending={isReloading} pendingLabel=\"Reloading…\" onClick={onReload} data-testid=\"tools-table-reload\">\n Reload\n </ActionButton>\n ) : null}\n </div>\n )}\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <span className=\"text-muted-foreground\" data-testid=\"tools-table-applies-to\">\n {appliesTo}\n </span>\n <div className=\"flex gap-2\">\n <button type=\"button\" className={BUTTONS.secondary} disabled={isSaving} onClick={onClose}>\n Cancel\n </button>\n <ActionButton variant=\"primary\" isPending={isSaving} pendingLabel={action.pending} disabled={action.isDisabled || isReloading} onClick={action.onPress} data-testid=\"tools-table-dialog-action\">\n {action.label}\n </ActionButton>\n </div>\n </div>\n </Dialog.Popup>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n","'use client';\n\nimport { Toast } from '@base-ui/react/toast';\n\n/** The toasts a party's page raised, each saying what was kept (gateway scopes 4.3). */\nexport function TableToasts() {\n const { toasts } = Toast.useToastManager();\n return (\n <Toast.Portal>\n <Toast.Viewport className=\"fixed right-4 bottom-4 z-50 grid w-[min(24rem,calc(100vw-2rem))] gap-2\">\n {toasts.map((toast) => (\n <Toast.Root key={toast.id} toast={toast} className=\"rounded-md border border-tone-ok-border bg-tone-ok-bg px-4 py-3 text-tone-ok-fg shadow-md\" data-testid=\"tools-table-toast\">\n <Toast.Content className=\"flex items-start justify-between gap-3\">\n <Toast.Title />\n <Toast.Close aria-label=\"Dismiss\">×</Toast.Close>\n </Toast.Content>\n </Toast.Root>\n ))}\n </Toast.Viewport>\n </Toast.Portal>\n );\n}\n","/** A switch: on or off, said by its look and to a screen reader, busy while its change is on its way. */\nexport function Switch({ isOn, label, isPending = false, type = 'button', onClick, testId }: { isOn: boolean; label: string; isPending?: boolean; type?: 'button' | 'submit'; onClick?: () => void; testId?: string }) {\n return (\n <button\n type={type}\n role=\"switch\"\n aria-checked={isOn}\n aria-label={label}\n aria-busy={isPending}\n disabled={isPending}\n onClick={onClick}\n data-testid={testId}\n className={`inline-flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition-colors disabled:opacity-60 ${isOn ? 'border-primary bg-primary' : 'border-input bg-muted'}`}\n >\n <span className={`size-3.5 rounded-full bg-background shadow-sm transition-transform ${isOn ? 'translate-x-4' : 'translate-x-0'} ${isPending ? 'animate-pulse' : ''}`} />\n </button>\n );\n}\n","'use client';\n\nimport { Toast } from '@base-ui/react/toast';\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport { setPartyScopes } from '../../actions';\nimport { agentScopesSetMessage, statedMessage } from '../table-messages';\nimport { NeedsChips, type ListedScope } from './needs-chips';\nimport { ScopePicker } from './scope-picker';\nimport { standingRefusal, TableDialog, type DialogRefusal } from './table-dialog';\nimport { TableToasts } from './table-toasts';\n\n/**\n * An outside A2A agent's one Needs line (gateway scopes 4.3): its messages\n * name no skill, so one set of scopes guards the agent as a whole, changed\n * in a dialog on the version the page read.\n */\nexport function AgentNeeds(props: { fleetId: string; party: string; version: number; scopes: readonly string[]; listed: readonly ListedScope[] | null; canChange: boolean }) {\n return (\n <Toast.Provider>\n <AgentNeedsLine {...props} />\n <TableToasts />\n </Toast.Provider>\n );\n}\n\nfunction AgentNeedsLine({ fleetId, party, version, scopes, listed, canChange }: { fleetId: string; party: string; version: number; scopes: readonly string[]; listed: readonly ListedScope[] | null; canChange: boolean }) {\n const router = useRouter();\n const toasts = Toast.useToastManager();\n const [, startTransition] = useTransition();\n const [isReloading, startReload] = useTransition();\n const [isOpen, setIsOpen] = useState(false);\n const [picked, setPicked] = useState<string[]>([]);\n const [isSaving, setIsSaving] = useState(false);\n const [refusal, setRefusal] = useState<DialogRefusal | null>(null);\n const [keptVersion, setKeptVersion] = useState<number | null>(null);\n const [round, setRound] = useState(0);\n const [kept, setKept] = useState<{ basis: readonly string[]; scopes: readonly string[] } | null>(null);\n // What was kept shows at once; once the page read itself again, its scopes are the truth.\n const shown = kept?.basis === scopes ? kept.scopes : scopes;\n\n const save = () => {\n setIsSaving(true);\n setRefusal(null);\n const madeOn = Math.max(version, keptVersion ?? 0);\n startTransition(async () => {\n const outcome = await setPartyScopes({ fleetId, name: party, version: madeOn, party: picked, tools: [] });\n setIsSaving(false);\n if (!outcome.isOk) {\n setRefusal({ message: outcome.message, isConflict: outcome.isConflict, version: madeOn });\n return;\n }\n setKeptVersion(outcome.version);\n setKept({ basis: scopes, scopes: picked });\n setIsOpen(false);\n setRound((previous) => previous + 1);\n toasts.add({ title: statedMessage(agentScopesSetMessage({ party, scopes: picked }), outcome.statementRefusal) });\n router.refresh();\n });\n };\n\n return (\n <div key={round} className={`flex flex-wrap items-center gap-2 rounded-md ${round > 0 ? 'animate-highlight' : ''}`} data-testid=\"agent-needs\">\n <NeedsChips own={shown} listed={listed === null ? null : new Set(listed.map(({ scope }) => scope))} />\n {canChange && listed !== null ? (\n <>\n <button\n type=\"button\"\n className=\"text-primary hover:underline\"\n onClick={() => {\n setPicked([...shown]);\n setRefusal(null);\n setIsOpen(true);\n }}\n data-testid=\"agent-needs-change\"\n >\n Change…\n </button>\n <TableDialog\n isOpen={isOpen}\n onClose={() => { setIsOpen(false); }}\n title=\"Every message needs\"\n description={`The scopes a calling ship must hold to message ${party}.`}\n appliesTo={`Applies to every message to ${party}`}\n action={{ label: 'Save', pending: 'Saving…', isDisabled: false, onPress: save }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, Math.max(version, keptVersion ?? 0))}\n isReloading={isReloading}\n onReload={() => {\n startReload(() => {\n router.refresh();\n });\n }}\n testId=\"agent-needs-dialog\"\n >\n <ScopePicker label=\"Scopes\" listed={listed} picked={picked} onPick={setPicked} isDisabled={isSaving} testId=\"agent-needs-picker\" />\n </TableDialog>\n </>\n ) : null}\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DrawerPopupCssVars from \"../popup/DrawerPopupCssVars.mjs\";\nimport * as DrawerBackdropCssVars from \"./DrawerBackdropCssVars.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerBackdrop = /*#__PURE__*/React.forwardRef(function DrawerBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.swipeStrength]: '1'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerBackdrop.displayName = \"DrawerBackdrop\";","/**\n * The number of nested drawers that are currently open.\n * @type {number}\n */\nexport const nestedDrawers = '--nested-drawers';\n/**\n * The height of the drawer popup.\n * @type {CSS length}\n */\nexport const height = '--drawer-height';\n/**\n * The height of the frontmost open drawer in the current nested drawer stack.\n * @type {CSS length}\n */\nexport const frontmostHeight = '--drawer-frontmost-height';\n/**\n * The swipe movement on the X axis.\n * @type {CSS length}\n */\nexport const swipeMovementX = '--drawer-swipe-movement-x';\n/**\n * The swipe movement on the Y axis.\n * @type {CSS length}\n */\nexport const swipeMovementY = '--drawer-swipe-movement-y';\n/**\n * The snap point offset used for translating the drawer.\n * @type {CSS length}\n */\nexport const snapPointOffset = '--drawer-snap-point-offset';\n/**\n * A scalar (0.1-1) used to scale the swipe release transition duration in CSS.\n * @type {number}\n */\nexport const swipeStrength = '--drawer-swipe-strength';","/**\n * The swipe progress of the drawer gesture.\n * @type {number}\n */\nexport const swipeProgress = '--drawer-swipe-progress';","'use client';\n\nimport { DialogClose } from \"../../dialog/close/DialogClose.mjs\";\n/**\n * A button that closes the drawer.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerClose = DialogClose;","export const DRAWER_CONTENT_ATTRIBUTE = 'data-drawer-content';","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { DRAWER_CONTENT_ATTRIBUTE } from \"./drawerContentAttribute.mjs\";\n\n/**\n * A container for the drawer contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerContent = /*#__PURE__*/React.forwardRef(function DrawerContent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n useDialogRootContext();\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n [DRAWER_CONTENT_ATTRIBUTE]: ''\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerContent.displayName = \"DrawerContent\";","'use client';\n\nimport * as React from 'react';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DrawerBackdropCssVars from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport * as DrawerPopupCssVars from \"./DrawerPopupCssVars.mjs\";\nimport * as DrawerPopupDataAttributes from \"./DrawerPopupDataAttributes.mjs\";\nimport { useDialogPortalContext } from \"../../dialog/portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerViewportContext } from \"../viewport/DrawerViewportContext.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\n\n// Module-level flag to ensure we only register the CSS properties once,\n// regardless of how many Drawer components are mounted.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet drawerSwipeVarsRegistered = false;\n\n/**\n * Removes inheritance of high-frequency drawer swipe CSS variables, which\n * reduces style recalculation cost in complex drawers with deep subtrees.\n * See https://motion.dev/blog/web-animation-performance-tier-list\n * under the \"Improving CSS variable performance\" section.\n */\nfunction removeCSSVariableInheritance() {\n if (drawerSwipeVarsRegistered) {\n return;\n }\n\n // Intentionally keep inheritance disabled on WebKit as well. Safari doesn't support\n // opting descendants back in via `--var: inherit` for custom properties registered\n // with `inherits: false`, but Drawer does not rely on descendant access to these vars\n // (unlike ScrollArea), so we keep the performance optimization enabled.\n if (typeof CSS !== 'undefined' && 'registerProperty' in CSS) {\n [DrawerPopupCssVars.swipeMovementX, DrawerPopupCssVars.swipeMovementY, DrawerPopupCssVars.snapPointOffset].forEach(name => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<length>',\n inherits: false,\n initialValue: '0px'\n });\n } catch {\n /* ignore already-registered */\n }\n });\n [{\n name: DrawerBackdropCssVars.swipeProgress,\n initialValue: '0'\n }, {\n name: DrawerPopupCssVars.swipeStrength,\n initialValue: '1'\n }].forEach(({\n name,\n initialValue\n }) => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<number>',\n inherits: false,\n initialValue\n });\n } catch {\n /* ignore already-registered */\n }\n });\n }\n drawerSwipeVarsRegistered = true;\n}\nconst stateAttributesMapping = {\n ...popupTransitionStateMapping,\n expanded(value) {\n return value ? {\n [DrawerPopupDataAttributes.expanded]: ''\n } : null;\n },\n nestedDrawerOpen(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerOpen]: ''\n } : null;\n },\n nestedDrawerSwiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerSwiping]: ''\n } : null;\n },\n swipeDirection(value) {\n return {\n [DrawerPopupDataAttributes.swipeDirection]: value\n };\n },\n swiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.swiping]: ''\n } : null;\n }\n};\n\n/**\n * A container for the drawer contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPopup = /*#__PURE__*/React.forwardRef(function DrawerPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const {\n swipeDirection,\n frontmostHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onPopupHeightChange,\n notifyParentFrontmostHeight,\n notifyParentHasNestedDrawer\n } = useDrawerRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const transitionStatus = store.useState('transitionStatus');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n const popupId = elementProps.id ?? floatingId;\n const swipe = useDrawerViewportContext();\n useDialogPortalContext();\n const {\n snapPoints,\n activeSnapPoint,\n activeSnapPointOffset\n } = useDrawerSnapPoints();\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const swiping = swipe?.swiping ?? false;\n const swipeStrength = swipe?.swipeStrength ?? null;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const popupHeightRef = React.useRef(0);\n\n /* istanbul ignore else -- process.env.NODE_ENV is a build-time constant. */\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (swipe) {\n return;\n }\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the ' + 'viewport disables drawer swipe handling and touch scroll locking. Wrap ' + '<Drawer.Popup> in <Drawer.Viewport>.';\n error(`${message}${ownerStackMessage}`);\n }, [swipe]);\n }\n const measureHeight = useStableCallback(() => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const offsetHeight = popupElement.offsetHeight;\n\n // Only skip while the element is still actually stretched beyond its last measured height.\n if (popupHeightRef.current > 0 && frontmostHeight > popupHeightRef.current && offsetHeight > popupHeightRef.current) {\n return;\n }\n const keepHeightWhileNested = popupHeightRef.current > 0 && hasNestedDrawer;\n if (keepHeightWhileNested) {\n const oldHeight = popupHeightRef.current;\n setPopupHeight(oldHeight);\n onPopupHeightChange(oldHeight);\n return;\n }\n const nextHeight = offsetHeight;\n if (nextHeight === popupHeightRef.current) {\n return;\n }\n popupHeightRef.current = nextHeight;\n setPopupHeight(nextHeight);\n onPopupHeightChange(nextHeight);\n });\n useIsoLayoutEffect(() => {\n if (!mounted) {\n popupHeightRef.current = 0;\n setPopupHeight(0);\n onPopupHeightChange(0);\n return undefined;\n }\n const popupElement = popupRef.current;\n if (!popupElement) {\n return undefined;\n }\n removeCSSVariableInheritance();\n measureHeight();\n if (typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureHeight);\n resizeObserver.observe(popupElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureHeight, mounted, nestedDrawerOpen, onPopupHeightChange, popupRef]);\n useIsoLayoutEffect(() => {\n const syncNestedSwipeProgress = () => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const progress = nestedSwipeProgressStore.getSnapshot();\n if (progress > 0) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${progress}`);\n } else {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n syncNestedSwipeProgress();\n const unsubscribe = nestedSwipeProgressStore.subscribe(syncNestedSwipeProgress);\n const popupElement = popupRef.current;\n return () => {\n unsubscribe();\n if (popupElement) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n }, [nestedSwipeProgressStore, popupRef]);\n useIsoLayoutEffect(() => {\n if (!open) {\n return undefined;\n }\n notifyParentFrontmostHeight?.(frontmostHeight);\n return () => {\n notifyParentFrontmostHeight?.(0);\n };\n }, [frontmostHeight, open, notifyParentFrontmostHeight]);\n useIsoLayoutEffect(() => {\n if (!notifyParentHasNestedDrawer) {\n return undefined;\n }\n const present = open || transitionStatus === 'ending';\n notifyParentHasNestedDrawer(present);\n return () => {\n notifyParentHasNestedDrawer(false);\n };\n }, [notifyParentHasNestedDrawer, open, transitionStatus]);\n useOpenChangeComplete({\n open,\n ref: popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? popupRef : initialFocus;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n expanded: activeSnapPoint === 1,\n nestedDrawerOpen,\n nestedDrawerSwiping: nestedSwiping,\n swipeDirection,\n swiping\n };\n let popupHeightCssVarValue;\n const shouldUseAutoHeight = !hasNestedDrawer && transitionStatus !== 'ending';\n if (popupHeight && !shouldUseAutoHeight) {\n popupHeightCssVarValue = `${popupHeight}px`;\n }\n const shouldApplySnapPoints = snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up');\n let snapPointOffsetValue = null;\n if (shouldApplySnapPoints && activeSnapPointOffset !== null) {\n snapPointOffsetValue = swipeDirection === 'up' ? -activeSnapPointOffset : activeSnapPointOffset;\n }\n let dragStyles = swipe ? swipe.getDragStyles() : EMPTY_OBJECT;\n if (shouldApplySnapPoints && swipeDirection === 'down') {\n const baseOffset = activeSnapPointOffset ?? 0;\n const movementValue = Number.parseFloat(String(dragStyles[DrawerPopupCssVars.swipeMovementY]));\n if (swiping && Number.isFinite(movementValue)) {\n dragStyles = {\n ...dragStyles,\n transform: undefined,\n [DrawerPopupCssVars.swipeMovementY]: `${getSnapPointSwipeMovement(baseOffset, movementValue)}px`\n };\n } else {\n dragStyles = {\n ...dragStyles,\n transform: undefined\n };\n }\n }\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: popupId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n ...dragStyles,\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.nestedDrawers]: nestedOpenDrawerCount,\n [DrawerPopupCssVars.height]: popupHeightCssVarValue,\n [DrawerPopupCssVars.snapPointOffset]: typeof snapPointOffsetValue === 'number' ? `${snapPointOffsetValue}px` : '0px',\n [DrawerPopupCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined,\n [DrawerPopupCssVars.swipeStrength]: typeof swipeStrength === 'number' && Number.isFinite(swipeStrength) && swipeStrength > 0 ? `${swipeStrength}` : '1'\n }\n }, elementProps],\n ref: [forwardedRef, popupRef, setPopupElement],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerPopup.displayName = \"DrawerPopup\";","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the drawer is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the drawer is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the drawer begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the drawer is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the drawer is at the expanded (full-height) snap point.\n */\nexport const expanded = 'data-expanded';\n/**\n * Present when a nested drawer is open.\n */\nexport const nestedDrawerOpen = 'data-nested-drawer-open';\n/**\n * Present when a nested drawer is being swiped.\n */\nexport const nestedDrawerSwiping = 'data-nested-drawer-swiping';\n/**\n * Present when the drawer is dismissed by swiping.\n */\nexport const swipeDismiss = 'data-swipe-dismiss';\n/**\n * Indicates the swipe direction.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\nexport const swipeDirection = 'data-swipe-direction';\n/**\n * Present when the drawer is being swiped.\n */\nexport const swiping = 'data-swiping';","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DrawerRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerRootContext.displayName = \"DrawerRootContext\";\nexport function useDrawerRootContext(optional) {\n const drawerRootContext = React.useContext(DrawerRootContext);\n if (optional !== true && drawerRootContext === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.' : _formatErrorMessage(90));\n }\n return drawerRootContext;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useDrawerRootContext } from \"./DrawerRootContext.mjs\";\n/**\n * Resolves the vertical swipe movement for a snap point, applying square-root damping once the drag\n * overshoots the fully-open edge (`nextOffset < 0`) so the popup resists travelling past it.\n */\nexport function getSnapPointSwipeMovement(baseOffset, movementValue) {\n const nextOffset = baseOffset + movementValue;\n if (nextOffset >= 0) {\n return movementValue;\n }\n return -Math.sqrt(-nextOffset) - baseOffset;\n}\nfunction resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {\n if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {\n return null;\n }\n if (typeof snapPoint === 'number') {\n if (!Number.isFinite(snapPoint)) {\n return null;\n }\n if (snapPoint <= 1) {\n return clamp(snapPoint, 0, 1) * viewportHeight;\n }\n return snapPoint;\n }\n const trimmed = snapPoint.trim();\n if (trimmed.endsWith('px')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value : null;\n }\n if (trimmed.endsWith('rem')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value * rootFontSize : null;\n }\n return null;\n}\n\n/**\n * Returns the index of the value closest to `target`, or `-1` if `values` is empty.\n */\nexport function closestSnapPointIndex(values, target) {\n let closestIndex = -1;\n let closestDistance = Infinity;\n for (let index = 0; index < values.length; index += 1) {\n const distance = Math.abs(values[index] - target);\n if (distance < closestDistance) {\n closestDistance = distance;\n closestIndex = index;\n }\n }\n return closestIndex;\n}\nexport function useDrawerSnapPoints() {\n const store = useDialogRootContext();\n const {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerRootContext();\n const viewportElement = store.useState('viewportElement');\n const [viewportHeight, setViewportHeight] = React.useState(0);\n const [rootFontSize, setRootFontSize] = React.useState(16);\n const measureViewportHeight = useStableCallback(() => {\n const doc = ownerDocument(viewportElement);\n const html = doc.documentElement;\n setViewportHeight(viewportElement ? viewportElement.offsetHeight : html.clientHeight);\n const fontSize = parseFloat(getComputedStyle(html).fontSize);\n if (Number.isFinite(fontSize)) {\n setRootFontSize(fontSize);\n }\n });\n useIsoLayoutEffect(() => {\n measureViewportHeight();\n if (!viewportElement || typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureViewportHeight);\n resizeObserver.observe(viewportElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureViewportHeight, viewportElement]);\n const resolvedSnapPoints = React.useMemo(() => {\n if (!snapPoints || snapPoints.length === 0 || viewportHeight <= 0 || popupHeight <= 0) {\n return [];\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolved = snapPoints.map(value => {\n const resolvedHeight = resolveSnapPointValue(value, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return null;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return {\n value,\n height: clampedHeight,\n offset: Math.max(0, popupHeight - clampedHeight)\n };\n }).filter(point => Boolean(point));\n if (resolved.length <= 1) {\n return resolved;\n }\n const deduped = [];\n const seenHeights = [];\n for (let index = resolved.length - 1; index >= 0; index -= 1) {\n const point = resolved[index];\n const isDuplicate = seenHeights.some(height => Math.abs(height - point.height) <= 1);\n if (isDuplicate) {\n continue;\n }\n seenHeights.push(point.height);\n deduped.push(point);\n }\n deduped.reverse();\n return deduped;\n }, [popupHeight, rootFontSize, snapPoints, viewportHeight]);\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (activeSnapPoint === null) {\n return undefined;\n }\n const exactMatch = resolvedSnapPoints.find(point => Object.is(point.value, activeSnapPoint));\n if (exactMatch) {\n return exactMatch;\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolvedHeight = resolveSnapPointValue(activeSnapPoint, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return undefined;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.height), clampedHeight)];\n }, [activeSnapPoint, popupHeight, resolvedSnapPoints, rootFontSize, viewportHeight]);\n return {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight,\n viewportHeight,\n resolvedSnapPoints,\n activeSnapPointOffset: resolvedActiveSnapPoint?.offset ?? null\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const DrawerViewportContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") DrawerViewportContext.displayName = \"DrawerViewportContext\";\nexport function useDrawerViewportContext() {\n return React.useContext(DrawerViewportContext);\n}","'use client';\n\nimport { DialogPortal } from \"../../dialog/portal/DialogPortal.mjs\";\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPortal = DialogPortal;","'use client';\n\nvar _DrawerProviderReport, _DrawerProviderReport2;\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { platform } from '@base-ui/utils/platform';\nimport { DrawerRootContext, useDrawerRootContext } from \"./DrawerRootContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderDialogRoot } from \"../../dialog/root/useRenderDialogRoot.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the drawer.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport function DrawerRoot(props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal = false,\n modal = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n swipeDirection = 'down',\n snapToSequentialPoints = false,\n snapPoints,\n snapPoint: snapPointProp,\n defaultSnapPoint,\n onSnapPointChange\n } = props;\n const parentDrawerRootContext = useDrawerRootContext(true);\n const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;\n const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;\n const notifyParentSwipingChange = parentDrawerRootContext?.onNestedSwipingChange;\n const notifyParentHasNestedDrawer = parentDrawerRootContext?.onNestedDrawerPresenceChange;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const [frontmostHeight, setFrontmostHeight] = React.useState(0);\n const [hasNestedDrawer, setHasNestedDrawer] = React.useState(false);\n const [nestedSwiping, setNestedSwiping] = React.useState(false);\n const [nestedSwipeProgressStore] = React.useState(createNestedSwipeProgressStore);\n const resolvedDefaultSnapPoint = defaultSnapPoint !== undefined ? defaultSnapPoint : snapPoints?.[0] ?? null;\n const isSnapPointControlled = snapPointProp !== undefined;\n const [activeSnapPoint, setActiveSnapPointUnwrapped] = useControlled({\n controlled: snapPointProp,\n default: resolvedDefaultSnapPoint,\n name: 'Drawer',\n state: 'snapPoint'\n });\n const isNestedDrawerOpenRef = React.useRef(false);\n const swipeAreaActiveRef = React.useRef(false);\n const setActiveSnapPoint = useStableCallback((nextSnapPoint, eventDetails) => {\n const resolvedEventDetails = eventDetails ?? createChangeEventDetails(REASONS.none);\n onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);\n if (resolvedEventDetails.isCanceled) {\n return;\n }\n setActiveSnapPointUnwrapped(nextSnapPoint);\n });\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (isSnapPointControlled) {\n return activeSnapPoint;\n }\n if (!snapPoints || snapPoints.length === 0) {\n return activeSnapPoint;\n }\n if (activeSnapPoint === null || !snapPoints.some(snapPoint => Object.is(snapPoint, activeSnapPoint))) {\n return resolvedDefaultSnapPoint;\n }\n return activeSnapPoint;\n }, [activeSnapPoint, isSnapPointControlled, resolvedDefaultSnapPoint, snapPoints]);\n const onPopupHeightChange = useStableCallback(height => {\n setPopupHeight(height);\n if (!isNestedDrawerOpenRef.current && height > 0) {\n setFrontmostHeight(height);\n }\n });\n const onNestedFrontmostHeightChange = useStableCallback(height => {\n if (height > 0) {\n isNestedDrawerOpenRef.current = true;\n setFrontmostHeight(height);\n return;\n }\n isNestedDrawerOpenRef.current = false;\n if (popupHeight > 0) {\n setFrontmostHeight(popupHeight);\n }\n });\n const onNestedDrawerPresenceChange = useStableCallback(present => {\n setHasNestedDrawer(present);\n });\n const onNestedSwipeProgressChange = useStableCallback(progress => {\n nestedSwipeProgressStore.set(progress);\n notifyParentSwipeProgressChange?.(progress);\n });\n const onNestedSwipingChange = useStableCallback(swiping => {\n setNestedSwiping(swiping);\n notifyParentSwipingChange?.(swiping);\n });\n const handleOpenChange = useStableCallback((nextOpen, eventDetails) => {\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n if (!nextOpen && snapPoints && snapPoints.length > 0) {\n setActiveSnapPoint(resolvedDefaultSnapPoint, createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));\n }\n });\n const contextValue = React.useMemo(() => ({\n swipeDirection,\n swipeAreaActiveRef,\n snapToSequentialPoints,\n snapPoints,\n activeSnapPoint: resolvedActiveSnapPoint,\n setActiveSnapPoint,\n frontmostHeight,\n popupHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onNestedDrawerPresenceChange,\n onPopupHeightChange,\n onNestedFrontmostHeightChange,\n onNestedSwipingChange,\n onNestedSwipeProgressChange,\n notifyParentFrontmostHeight,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n notifyParentHasNestedDrawer\n }), [resolvedActiveSnapPoint, frontmostHeight, hasNestedDrawer, nestedSwiping, nestedSwipeProgressStore, notifyParentHasNestedDrawer, notifyParentSwipeProgressChange, notifyParentSwipingChange, notifyParentFrontmostHeight, onNestedDrawerPresenceChange, onNestedFrontmostHeightChange, onNestedSwipeProgressChange, onNestedSwipingChange, onPopupHeightChange, popupHeight, setActiveSnapPoint, snapPoints, snapToSequentialPoints, swipeAreaActiveRef, swipeDirection]);\n const resolvedChildren = typeof children === 'function' ? payload => /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport || (_DrawerProviderReport = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children(payload)]\n }) : /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport2 || (_DrawerProviderReport2 = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children]\n });\n const dialog = useRenderDialogRoot('drawer', {\n open: openProp,\n defaultOpen,\n onOpenChange: handleOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal,\n modal,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp,\n children: resolvedChildren\n });\n return /*#__PURE__*/_jsx(DrawerRootContext.Provider, {\n value: contextValue,\n children: dialog\n });\n}\nfunction createNestedSwipeProgressStore() {\n let progress = 0;\n const listeners = new Set();\n return {\n getSnapshot: () => progress,\n set(nextProgress) {\n const resolved = Number.isFinite(nextProgress) ? nextProgress : 0;\n if (resolved === progress) {\n return;\n }\n progress = resolved;\n listeners.forEach(listener => {\n listener();\n });\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n }\n };\n}\nfunction DrawerProviderReporter() {\n const providerContext = useDrawerProviderContext();\n const store = useDialogRootContext(false);\n const setDrawerOpen = providerContext?.setDrawerOpen;\n const removeDrawer = providerContext?.removeDrawer;\n const open = store.useState('open');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const popupElement = store.useState('popupElement');\n const isTopmost = nestedOpenDialogCount === 0;\n useIsoLayoutEffect(() => {\n if (!removeDrawer) {\n return undefined;\n }\n return () => {\n removeDrawer(store);\n };\n }, [removeDrawer, store]);\n useIsoLayoutEffect(() => {\n setDrawerOpen?.(store, open);\n }, [open, setDrawerOpen, store]);\n React.useEffect(() => {\n // CloseWatcher enables the Android back gesture (Chromium-only).\n // Keep this Android-only for now to avoid interfering with Escape/nesting semantics on desktop due to `useDismiss`.\n if (!open || !isTopmost || !platform.os.android) {\n return undefined;\n }\n const win = ownerWindow(popupElement);\n const CloseWatcherCtor = win.CloseWatcher;\n if (!CloseWatcherCtor) {\n return undefined;\n }\n function handleCancel(event) {\n if (!store.select('open')) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.closeWatcher, event);\n if (!event.cancelable) {\n // The browser lets only one close request per user activation be prevented; any further\n // request closes the drawer regardless, like a native `<dialog>`.\n eventDetails.cancel = NOOP;\n }\n store.setOpen(false, eventDetails);\n if (eventDetails.isCanceled) {\n // Keeps this watcher active for the next close request.\n event.preventDefault();\n }\n }\n const closeWatcher = new CloseWatcherCtor();\n // The browser destroys the watcher before `close` fires, so the request is handled from\n // `cancel`, where it can still be prevented.\n const unsubscribe = addEventListener(closeWatcher, 'cancel', handleCancel);\n return () => {\n unsubscribe();\n closeWatcher.destroy();\n };\n }, [store, isTopmost, open, popupElement]);\n return null;\n}","'use client';\n\nimport * as React from 'react';\nexport const DrawerProviderContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerProviderContext.displayName = \"DrawerProviderContext\";\nexport function useDrawerProviderContext() {\n return React.useContext(DrawerProviderContext);\n}","'use client';\n\nimport { DialogTitle } from \"../../dialog/title/DialogTitle.mjs\";\n/**\n * A heading that labels the drawer.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerTitle = DialogTitle;","'use client';\n\nimport { DialogTrigger } from \"../../dialog/trigger/DialogTrigger.mjs\";\n/**\n * A button that opens the drawer.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerTrigger = DialogTrigger;","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { DialogViewport } from \"../../dialog/viewport/DialogViewport.mjs\";\nimport * as DialogViewportDataAttributes from \"../../dialog/viewport/DialogViewportDataAttributes.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { closestSnapPointIndex, getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { getDisplacement, useSwipeDismiss } from \"../../utils/useSwipeDismiss.mjs\";\nimport * as DrawerPopupCssVars from \"../popup/DrawerPopupCssVars.mjs\";\nimport * as DrawerPopupDataAttributes from \"../popup/DrawerPopupDataAttributes.mjs\";\nimport * as DrawerBackdropCssVars from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport { DRAWER_CONTENT_ATTRIBUTE } from \"../content/drawerContentAttribute.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { DrawerViewportContext } from \"./DrawerViewportContext.mjs\";\nimport { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\nimport { findScrollableTouchTarget } from \"../../utils/scrollable.mjs\";\nimport { BASE_UI_SWIPE_IGNORE_ATTRIBUTE, BASE_UI_SWIPE_IGNORE_SELECTOR } from \"../../internals/constants.mjs\";\nimport { getElementAtPoint } from \"../../utils/getElementAtPoint.mjs\";\nimport { useDrawerVirtualKeyboardContext } from \"../virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst MIN_SWIPE_THRESHOLD = 10;\nconst FAST_SWIPE_VELOCITY = 0.5;\nconst SNAP_VELOCITY_THRESHOLD = 0.5;\nconst SNAP_VELOCITY_MULTIPLIER = 300;\nconst MAX_SNAP_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_VELOCITY = 0.2;\nconst MAX_SWIPE_RELEASE_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_DURATION_MS = 80;\nconst MAX_SWIPE_RELEASE_DURATION_MS = 360;\nconst MIN_SWIPE_RELEASE_SCALAR = 0.1;\nconst MAX_SWIPE_RELEASE_SCALAR = 1;\nconst AXIS_LOCK_SLOP = 6;\nconst AXIS_LOCK_BIAS = 2;\nconst DRAWER_CONTENT_SELECTOR = `[${DRAWER_CONTENT_ATTRIBUTE}]`;\nconst AXIS_SWIPE_IGNORE_SELECTORS = {\n horizontal: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}=\"x\"]`,\n vertical: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}=\"y\"]`\n};\n/**\n * A positioning container for the drawer popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerViewport = /*#__PURE__*/React.forwardRef(function DrawerViewport(props, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = props;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const backdropRef = store.context.backdropRef;\n const {\n swipeDirection,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n frontmostHeight,\n snapToSequentialPoints,\n swipeAreaActiveRef\n } = useDrawerRootContext();\n const providerContext = useDrawerProviderContext();\n const {\n snapPoints,\n resolvedSnapPoints,\n activeSnapPoint,\n activeSnapPointOffset,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerSnapPoints();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const viewportElement = store.useState('viewportElement');\n const popupElementState = store.useState('popupElement');\n const visualStateStore = providerContext?.visualStateStore;\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const scrollAxis = swipeDirection === 'left' || swipeDirection === 'right' ? 'horizontal' : 'vertical';\n const isVerticalScrollAxis = scrollAxis === 'vertical';\n const crossScrollAxis = isVerticalScrollAxis ? 'horizontal' : 'vertical';\n const [swipeRelease, setSwipeRelease] = React.useState(null);\n const pendingSwipeCloseSnapPointRef = React.useRef(undefined);\n const resetSwipeRef = React.useRef(null);\n const controlledDismissFrame = useAnimationFrame();\n const swipingRef = React.useRef(false);\n const nestedSwipeActiveRef = React.useRef(false);\n const lastPointerTypeRef = React.useRef('');\n const ignoreNextTouchStartFromPenRef = React.useRef(false);\n const ignoreTouchSwipeRef = React.useRef(false);\n const touchScrollStateRef = React.useRef(null);\n const virtualKeyboard = useDrawerVirtualKeyboardContext();\n const snapPointRange = React.useMemo(() => {\n if (!snapPoints || snapPoints.length < 2 || resolvedSnapPoints.length < 2 || swipeDirection !== 'down' && swipeDirection !== 'up') {\n return null;\n }\n const offsets = resolvedSnapPoints.map(point => point.offset).sort((a, b) => a - b);\n const minOffset = offsets[0];\n const nextOffset = offsets[1];\n const range = nextOffset - minOffset;\n return {\n minOffset,\n range\n };\n }, [resolvedSnapPoints, snapPoints, swipeDirection]);\n const snapPointProgress = React.useMemo(() => {\n if (!snapPointRange || activeSnapPointOffset === null) {\n return null;\n }\n return clamp((activeSnapPointOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n }, [activeSnapPointOffset, snapPointRange]);\n const swipeDirections = React.useMemo(() => {\n if (snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up')) {\n return swipeDirection === 'down' ? ['down', 'up'] : ['up', 'down'];\n }\n return [swipeDirection];\n }, [snapPoints, swipeDirection]);\n const setSwipeDismissed = useStableCallback(dismissed => {\n popupRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n backdropRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n });\n const clearSwipeRelease = useStableCallback(() => {\n setSwipeDismissed(false);\n popupRef.current?.removeAttribute(TransitionStatusDataAttributes.endingStyle);\n setSwipeRelease(null);\n });\n const finishNestedSwipe = useStableCallback(() => {\n if (!nestedSwipeActiveRef.current) {\n return;\n }\n nestedSwipeActiveRef.current = false;\n notifyParentSwipingChange?.(false);\n });\n const applySwipeProgress = useStableCallback((resolvedProgress, shouldTrackProgress, notifyParent) => {\n const isActive = open && !nested && shouldTrackProgress;\n const swipeProgress = isActive ? resolvedProgress : 0;\n const nestedSwipeProgress = open && shouldTrackProgress ? resolvedProgress : 0;\n if (notifyParent && notifyParentSwipeProgressChange) {\n notifyParentSwipeProgressChange(nestedSwipeProgress);\n if (nestedSwipeProgress <= 0) {\n finishNestedSwipe();\n }\n }\n visualStateStore?.set({\n swipeProgress,\n frontmostHeight: swipeProgress > 0 ? frontmostHeight : 0\n });\n const backdropElement = backdropRef.current;\n if (!backdropElement) {\n return;\n }\n const showProgress = isActive && swipeProgress > 0;\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, showProgress ? `${swipeProgress}` : '0');\n if (showProgress && frontmostHeight > 0) {\n backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);\n } else {\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n });\n function resolveSwipeRelease(popupElement, direction, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY) {\n const size = getBaseSwipeSize(popupElement, direction);\n if (size <= 0) {\n return null;\n }\n\n // The snap point base offset shifts the popup along the dismiss direction for both\n // `down` (+offset) and `up` (-offset), so it always adds to the directional translation.\n const snapPointBaseOffset = (direction === 'down' || direction === 'up') && snapPoints && snapPoints.length > 0 ? activeSnapPointOffset ?? 0 : 0;\n const translationAlongDirection = snapPointBaseOffset + getDisplacement(direction, deltaX, deltaY);\n const remainingDistance = Math.max(0, size - translationAlongDirection);\n if (remainingDistance <= 0) {\n return null;\n }\n const releaseVelocity = getDisplacement(direction, releaseVelocityX, releaseVelocityY);\n const directionalVelocity = Math.abs(releaseVelocity) > 0 ? releaseVelocity : getDisplacement(direction, velocityX, velocityY);\n if (directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) {\n return null;\n }\n const clampedVelocity = clamp(directionalVelocity, MIN_SWIPE_RELEASE_VELOCITY, MAX_SWIPE_RELEASE_VELOCITY);\n // The gesture hook supplies finite deltas and velocities. The guards above keep the remaining\n // distance and divisor positive, so the duration stays within [MIN, MAX] and the resulting\n // scalar within (0, 1].\n const durationMs = clamp(remainingDistance / clampedVelocity, MIN_SWIPE_RELEASE_DURATION_MS, MAX_SWIPE_RELEASE_DURATION_MS);\n const normalizedDuration = (durationMs - MIN_SWIPE_RELEASE_DURATION_MS) / (MAX_SWIPE_RELEASE_DURATION_MS - MIN_SWIPE_RELEASE_DURATION_MS);\n return MIN_SWIPE_RELEASE_SCALAR + normalizedDuration * (MAX_SWIPE_RELEASE_SCALAR - MIN_SWIPE_RELEASE_SCALAR);\n }\n function updateNestedSwipeActive(details) {\n if (nestedSwipeActiveRef.current || !details) {\n return;\n }\n const direction = details.direction ?? swipeDirection;\n const delta = getDisplacement(direction, details.deltaX, details.deltaY);\n if (Math.abs(delta) < MIN_SWIPE_THRESHOLD) {\n return;\n }\n nestedSwipeActiveRef.current = true;\n notifyParentSwipingChange?.(true);\n }\n const swipe = useSwipeDismiss({\n enabled: mounted && !nestedDrawerOpen,\n directions: swipeDirections,\n elementRef: store.context.popupRef,\n ignoreSelectorWhenTouch: false,\n ignoreScrollableAncestors: true,\n movementCssVars: {\n x: DrawerPopupCssVars.swipeMovementX,\n y: DrawerPopupCssVars.swipeMovementY\n },\n onSwipeStart(event) {\n if ('touches' in event || event.pointerType === 'touch') {\n return;\n }\n const popupElement = popupRef.current;\n const doc = ownerDocument(popupElement);\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n if (!contains(popupElement, anchorElement) && !contains(popupElement, focusElement)) {\n return;\n }\n selection.removeAllRanges();\n },\n onSwipingChange(swiping) {\n swipingRef.current = swiping;\n setBackdropSwipingAttribute(store.context.backdropRef.current, swiping);\n if (!swiping && !notifyParentSwipeProgressChange) {\n finishNestedSwipe();\n }\n },\n swipeThreshold({\n element,\n direction\n }) {\n return getBaseSwipeThreshold(element, direction);\n },\n canStart(position, details) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n return false;\n }\n const nativeEvent = details.nativeEvent;\n const touchLike = 'touches' in nativeEvent || nativeEvent.pointerType === 'touch';\n const touchState = touchLike ? touchScrollStateRef.current : null;\n const doc = popupElement.ownerDocument;\n const elementAtPoint = getElementAtPoint(popupElement.getRootNode(), position.x, position.y);\n // Activation can be deferred until after a touch that started inside has left the popup.\n if (!touchState?.startedInPopup && !contains(popupElement, elementAtPoint)) {\n return false;\n }\n if (touchLike && shouldIgnoreSwipeForTextSelection(doc, popupElement)) {\n return false;\n }\n\n // Over a cross-axis gesture target, stay pending until the drawer axis wins the gesture.\n // Starting on touchstart would leave the drawer swiping (and settling on release) while the\n // cross-axis target handles the drag.\n if (touchState?.hasCrossAxisGestureTarget && !touchState.drawerAxisAttributed && touchState.allowSwipe !== true) {\n return false;\n }\n return true;\n },\n onProgress(progress, details) {\n const swiping = swipingRef.current;\n if (swiping) {\n updateNestedSwipeActive(details);\n }\n const hasSnapPoints = Boolean(snapPoints && snapPoints.length > 0);\n if (swiping && swipeDirection === 'down' && hasSnapPoints && details) {\n const popupElement = store.context.popupRef.current;\n if (popupElement) {\n popupElement.style.removeProperty('transform');\n popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementY, `${getSnapPointSwipeMovement(activeSnapPointOffset ?? 0, details.deltaY)}px`);\n }\n }\n let resolvedProgress = progress;\n if (snapPointRange && popupHeight > 0) {\n const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;\n const offsetToProgress = nextOffset => clamp((nextOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n\n // Outside a drag the hook still reports the last drag deltas, both after a release and\n // on a gesture that never started (e.g. a press inside `Drawer.Content`). Recomputing\n // from them would re-apply drag progress to a drawer that rests on its snap point.\n if (swiping && details && Number.isFinite(details.deltaY)) {\n resolvedProgress = offsetToProgress(clamp(baseOffset + details.deltaY, 0, popupHeight));\n } else if (snapPointProgress !== null) {\n resolvedProgress = snapPointProgress;\n }\n }\n\n // A parent drawer follows an active drag only, so drop it back to zero once the drag ends.\n if (!swiping) {\n notifyParentSwipeProgressChange?.(0);\n finishNestedSwipe();\n }\n applySwipeProgress(resolvedProgress, true, swiping);\n },\n onRelease({\n event,\n deltaX,\n deltaY,\n direction,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n }) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n clearSwipeRelease();\n return undefined;\n }\n const releasePopupElement = popupElement;\n function startSwipeRelease(resolvedDirection) {\n // Start ending transition styles earlier and synchronously to prevent a period where\n // the popup appears stuck on release before the actual closing animation starts.\n finishNestedSwipe();\n setSwipeDismissed(true);\n releasePopupElement.style.removeProperty('transition');\n releasePopupElement.setAttribute(TransitionStatusDataAttributes.endingStyle, '');\n ReactDOM.flushSync(() => {\n setSwipeRelease(resolveSwipeRelease(releasePopupElement, resolvedDirection, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY));\n });\n }\n if (!snapPoints || snapPoints.length === 0) {\n if (!direction) {\n clearSwipeRelease();\n return undefined;\n }\n const directionalDelta = getDisplacement(direction, deltaX, deltaY);\n if (directionalDelta <= 0) {\n clearSwipeRelease();\n return false;\n }\n if (getDisplacement(direction, velocityX, velocityY) >= FAST_SWIPE_VELOCITY) {\n startSwipeRelease(direction);\n return true;\n }\n const shouldClose = directionalDelta > getBaseSwipeThreshold(releasePopupElement, direction);\n if (shouldClose) {\n startSwipeRelease(direction);\n } else {\n clearSwipeRelease();\n }\n return shouldClose;\n }\n if (swipeDirection !== 'down' && swipeDirection !== 'up') {\n clearSwipeRelease();\n return undefined;\n }\n if (!popupHeight) {\n clearSwipeRelease();\n return false;\n }\n if (resolvedSnapPoints.length === 0) {\n clearSwipeRelease();\n return undefined;\n }\n const dragDelta = swipeDirection === 'down' ? deltaY : -deltaY;\n const dragDirection = Math.sign(dragDelta);\n const releaseDirectionalVelocity = swipeDirection === 'down' ? releaseVelocityY : -releaseVelocityY;\n const fallbackDirectionalVelocity = swipeDirection === 'down' ? velocityY : -velocityY;\n let resolvedDirectionalVelocity = releaseDirectionalVelocity;\n if (dragDirection !== 0 && Math.abs(dragDelta) >= MIN_SWIPE_THRESHOLD) {\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n if (velocityDirection !== 0 && velocityDirection !== dragDirection) {\n // Ignore touch reversals that would otherwise flip the snap decision.\n resolvedDirectionalVelocity = fallbackDirectionalVelocity;\n }\n }\n const currentOffset = activeSnapPointOffset ?? 0;\n const dragTargetOffset = clamp(currentOffset + dragDelta, 0, popupHeight);\n const velocityOffset = Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD ? clamp(resolvedDirectionalVelocity, -MAX_SNAP_VELOCITY, MAX_SNAP_VELOCITY) * SNAP_VELOCITY_MULTIPLIER : 0;\n const targetOffset = snapToSequentialPoints ? dragTargetOffset : clamp(dragTargetOffset + velocityOffset, 0, popupHeight);\n const snapPointEventDetails = createChangeEventDetails(REASONS.swipe, event);\n const settleInPlace = () => {\n // Reset nested swipe state now: the hook's trailing progress update is deduped\n // when the drag never produced dismissal progress, so it may not fire.\n applySwipeProgress(0, true, true);\n clearSwipeRelease();\n return false;\n };\n const settleOnSnapPoint = snapPoint => {\n setActiveSnapPoint(snapPoint.value, snapPointEventDetails);\n return settleInPlace();\n };\n const closeFromSnapPoints = fallbackSnapPoint => {\n // An unattributed gesture (e.g. a mostly horizontal flick) may settle on a snap\n // point but must not dismiss: `useSwipeDismiss` drops a directionless dismissal,\n // stranding the popup visually closed while `open` stays `true`.\n if (!direction) {\n return settleOnSnapPoint(fallbackSnapPoint);\n }\n setActiveSnapPoint(null, snapPointEventDetails);\n if (snapPointEventDetails.isCanceled) {\n // A canceled null snap point rejects dismissal before exit styles start.\n return settleInPlace();\n }\n pendingSwipeCloseSnapPointRef.current = activeSnapPoint;\n startSwipeRelease(swipeDirection);\n return true;\n };\n if (snapToSequentialPoints) {\n const orderedSnapPoints = [...resolvedSnapPoints].sort((first, second) => first.offset - second.offset);\n const orderedOffsets = orderedSnapPoints.map(point => point.offset);\n const currentIndex = closestSnapPointIndex(orderedOffsets, currentOffset);\n let targetSnapPoint = orderedSnapPoints[closestSnapPointIndex(orderedOffsets, targetOffset)];\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n const shouldAdvance = dragDirection !== 0 && velocityDirection !== 0 && velocityDirection === dragDirection && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD;\n let effectiveTargetOffset = targetOffset;\n if (shouldAdvance) {\n const adjacentIndex = clamp(currentIndex + dragDirection, 0, orderedSnapPoints.length - 1);\n if (adjacentIndex !== currentIndex) {\n const adjacentPoint = orderedSnapPoints[adjacentIndex];\n const shouldForceAdjacent = dragDirection > 0 ? targetOffset < adjacentPoint.offset : targetOffset > adjacentPoint.offset;\n if (shouldForceAdjacent) {\n targetSnapPoint = adjacentPoint;\n effectiveTargetOffset = adjacentPoint.offset;\n }\n } else if (dragDirection > 0) {\n return closeFromSnapPoints(targetSnapPoint);\n }\n }\n const closeDistance = Math.abs(effectiveTargetOffset - popupHeight);\n const snapDistance = Math.abs(effectiveTargetOffset - targetSnapPoint.offset);\n if (closeDistance < snapDistance) {\n return closeFromSnapPoints(targetSnapPoint);\n }\n return settleOnSnapPoint(targetSnapPoint);\n }\n const closestSnapPoint = resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.offset), targetOffset)];\n if (resolvedDirectionalVelocity >= FAST_SWIPE_VELOCITY && dragDelta > 0) {\n return closeFromSnapPoints(closestSnapPoint);\n }\n const closeDistance = Math.abs(targetOffset - popupHeight);\n if (closeDistance < Math.abs(targetOffset - closestSnapPoint.offset)) {\n return closeFromSnapPoints(closestSnapPoint);\n }\n return settleOnSnapPoint(closestSnapPoint);\n },\n onDismiss(event) {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n const backdropElement = store.context.backdropRef.current;\n if (backdropElement) {\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n const dismissEventDetails = createChangeEventDetails(REASONS.swipe, event);\n store.setOpen(false, dismissEventDetails);\n if (dismissEventDetails.isCanceled) {\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, event));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n resetSwipeRef.current?.();\n clearSwipeRelease();\n return;\n }\n\n // In controlled mode, the effective open state may not have changed yet\n // (openProp takes precedence over state.open). Proceed optimistically with the\n // dismiss animation — React's Scheduler flushes before the next rAF, so we can\n // reliably check whether the parent accepted or rejected the close.\n // Note: if onOpenChange is asynchronous (e.g., closes the drawer after a network\n // call), the rAF check will see open === true, revert the animation, and the\n // drawer will close without animation when the parent eventually sets open={false}.\n if (store.select('open')) {\n const savedEvent = event;\n controlledDismissFrame.request(() => {\n if (store.select('open')) {\n // Parent rejected: revert animation and restore snap point.\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, savedEvent));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n clearSwipeRelease();\n resetSwipeRef.current?.();\n } else {\n // Parent accepted: clean up the ref.\n pendingSwipeCloseSnapPointRef.current = undefined;\n }\n });\n return;\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n setSwipeDismissed(true);\n }\n });\n const swipePointerProps = swipe.getPointerProps();\n const swipeTouchProps = swipe.getTouchProps();\n const {\n moveNative: moveSwipeNative,\n reset: resetSwipe\n } = swipe;\n resetSwipeRef.current = resetSwipe;\n React.useEffect(() => {\n const rootElement = viewportElement ?? popupElementState;\n // A non-passive document listener makes all touch scrolling wait on the main thread.\n if (!rootElement || !open || !mounted) {\n return undefined;\n }\n const resolvedRootElement = rootElement;\n const doc = ownerDocument(resolvedRootElement);\n function processTouchMove(event, touchState, touch) {\n const drawerAxisDelta = isVerticalScrollAxis ? touch.clientY - touchState.lastY : touch.clientX - touchState.lastX;\n\n // Avoid blocking pinch zoom or text selection adjustments on iOS Safari.\n if (event.touches.length === 2) {\n return;\n }\n const allowTouchMove = shouldIgnoreSwipeForTextSelection(doc, resolvedRootElement);\n if (allowTouchMove || nestedDrawerOpen) {\n return;\n }\n if (shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis)) {\n return;\n }\n const scrollTarget = touchState.scrollTarget;\n if (!scrollTarget || scrollTarget === doc.documentElement || scrollTarget === doc.body) {\n if (event.cancelable) {\n event.preventDefault();\n }\n // Claim the gesture before React's delegated touch handlers see it; dispatching the\n // move through React re-rasterizes the popup content on every frame.\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n return;\n }\n if (!hasScrollableContentOnAxis(scrollTarget, scrollAxis)) {\n // If the scroll container doesn't overflow on the drawer axis, prevent the window from\n // scrolling instead.\n if (event.cancelable) {\n event.preventDefault();\n }\n event.stopPropagation();\n return;\n }\n if (drawerAxisDelta !== 0) {\n const canSwipeFromScrollEdge = canSwipeFromScrollEdgeOnMove(scrollTarget, scrollAxis, swipeDirection, drawerAxisDelta);\n if (!touchState.allowSwipe) {\n if (event.cancelable && canSwipeFromScrollEdge) {\n touchState.allowSwipe = true;\n event.preventDefault();\n } else {\n touchState.allowSwipe = false;\n }\n } else if (event.cancelable) {\n event.preventDefault();\n }\n }\n if (touchState.allowSwipe === true) {\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n }\n }\n function handleNativeTouchMove(event) {\n // The virtual keyboard provider observes the move to tell a tap apart from a drag.\n // It must run even when the swipe gesture below claims the event with\n // `stopPropagation()`, which would otherwise prevent React's delegated handlers\n // (and the provider) from ever seeing the move.\n virtualKeyboard?.onTouchMove(event);\n if (ignoreTouchSwipeRef.current) {\n return;\n }\n const touchState = touchScrollStateRef.current;\n const touch = event.touches[0];\n if (!touch || !touchState) {\n return;\n }\n processTouchMove(event, touchState, touch);\n updateTouchScrollPosition(touchState, touch);\n }\n return addEventListener(doc, 'touchmove', handleNativeTouchMove, {\n passive: false,\n capture: true\n });\n }, [mounted, nestedDrawerOpen, open, popupElementState, isVerticalScrollAxis, scrollAxis, swipeDirection, moveSwipeNative, viewportElement, virtualKeyboard]);\n useIsoLayoutEffect(() => {\n if (!snapPointRange || swipe.swiping) {\n return;\n }\n applySwipeProgress(!open || nested ? 0 : snapPointProgress ?? 0, true, false);\n }, [applySwipeProgress, frontmostHeight, nested, notifyParentSwipeProgressChange, open, snapPointProgress, snapPointRange, swipe.swiping, store, visualStateStore]);\n useIsoLayoutEffect(() => {\n if (!notifyParentSwipeProgressChange) {\n return undefined;\n }\n if (!open) {\n notifyParentSwipeProgressChange(0);\n }\n return () => {\n notifyParentSwipeProgressChange(0);\n };\n }, [notifyParentSwipeProgressChange, open]);\n useIsoLayoutEffect(() => {\n if (open) {\n // Skip `resetSwipe` while `Drawer.SwipeArea` is driving the open: it zeroes the popup's\n // `--swipe-movement-*` (via `syncDragStyles(false)`), flashing it fully open for a frame.\n // `clearSwipeRelease` doesn't touch those vars, so always run it to clear any leftover\n // release state from a prior dismiss (e.g. when the popup is kept mounted).\n if (!swipeAreaActiveRef.current) {\n resetSwipe();\n }\n clearSwipeRelease();\n }\n }, [clearSwipeRelease, open, resetSwipe, swipeAreaActiveRef]);\n useIsoLayoutEffect(() => {\n const backdropElement = backdropRef.current;\n return () => {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n setBackdropSwipingAttribute(backdropElement, false);\n // `data-swiping` is set on whichever backdrop is current when a swipe starts, which can\n // differ from the captured element if the backdrop mounted late or changed identity.\n // Reading the live ref here is intentional so the current backdrop is cleared too.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const currentBackdrop = backdropRef.current;\n if (currentBackdrop !== backdropElement) {\n setBackdropSwipingAttribute(currentBackdrop, false);\n }\n finishNestedSwipe();\n };\n }, [backdropRef, finishNestedSwipe, visualStateStore]);\n const swipeProviderValue = React.useMemo(() => ({\n swiping: swipe.swiping,\n getDragStyles: swipe.getDragStyles,\n swipeStrength: swipeRelease ?? null,\n setSwipeDismissed\n }), [setSwipeDismissed, swipe.getDragStyles, swipe.swiping, swipeRelease]);\n function resetTouchSwipeState(ignoreSwipe) {\n ignoreTouchSwipeRef.current = ignoreSwipe;\n touchScrollStateRef.current = null;\n }\n function resetTouchTrackingState() {\n resetTouchSwipeState(false);\n lastPointerTypeRef.current = '';\n ignoreNextTouchStartFromPenRef.current = false;\n }\n function handlePointerEnd(event) {\n lastPointerTypeRef.current = '';\n return event.pointerType !== 'touch';\n }\n return /*#__PURE__*/_jsx(DialogViewport, {\n ref: forwardedRef,\n className: className,\n style: style,\n render: render,\n ...mergeProps(elementProps, {\n onPointerDown(event) {\n lastPointerTypeRef.current = event.pointerType;\n ignoreNextTouchStartFromPenRef.current = event.pointerType === 'pen';\n if (!open || !mounted || nestedDrawerOpen) {\n return;\n }\n const elementAtPoint = getElementAtPoint(event.currentTarget.getRootNode(), event.clientX, event.clientY);\n // Pointer drags capture the pointer on press, so they can't wait to see which axis the\n // gesture takes; any `data-base-ui-swipe-ignore` value ignores them.\n if (isSwipeIgnoredTarget(elementAtPoint) || isDrawerContentTarget(elementAtPoint)) {\n return;\n }\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerDown?.(event);\n },\n onPointerMove(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerMove?.(event);\n },\n onPointerUp(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerUp?.(event);\n }\n },\n onPointerCancel(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerCancel?.(event);\n }\n },\n onTouchStart(event) {\n const startedFromPenPointerDown = lastPointerTypeRef.current === 'pen' && ignoreNextTouchStartFromPenRef.current;\n if (startedFromPenPointerDown) {\n ignoreNextTouchStartFromPenRef.current = false;\n resetTouchSwipeState(false);\n return;\n }\n if (!open || !mounted || nestedDrawerOpen) {\n resetTouchSwipeState(false);\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n if (isReactTouchEventOnRangeInput(event)) {\n resetTouchSwipeState(false);\n return;\n }\n const rootElement = event.currentTarget;\n const elementAtPoint = getElementAtPoint(rootElement.getRootNode(), touch.clientX, touch.clientY);\n const eventTarget = getTarget(event.nativeEvent);\n const target = isElement(eventTarget) ? eventTarget : rootElement;\n if (!contains(rootElement, target)) {\n resetTouchSwipeState(true);\n return;\n }\n virtualKeyboard?.onTouchStart(event);\n\n // `x`/`y` hand touch drags along that axis to the element. Any value other than the\n // cross-axis one ignores the swipe outright; a cross-axis element is arbitrated like a\n // native cross-axis scroller below.\n if (closest(elementAtPoint, `${BASE_UI_SWIPE_IGNORE_SELECTOR}:not(${AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]})`)) {\n resetTouchSwipeState(true);\n return;\n }\n ignoreTouchSwipeRef.current = false;\n const scrollTarget = findScrollableTouchTarget(target, rootElement, scrollAxis);\n const hasCrossAxisGestureTarget = findScrollableTouchTarget(target, rootElement, crossScrollAxis) != null || closest(elementAtPoint, AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]) != null;\n let allowSwipe = null;\n if (scrollTarget) {\n const canSwipeFromEdge = isAtSwipeStartEdge(scrollTarget, scrollAxis, swipeDirection);\n allowSwipe = canSwipeFromEdge ? null : false;\n }\n touchScrollStateRef.current = {\n startX: touch.clientX,\n startY: touch.clientY,\n lastX: touch.clientX,\n lastY: touch.clientY,\n startedInPopup: contains(popupRef.current, elementAtPoint),\n scrollTarget,\n hasCrossAxisGestureTarget,\n allowSwipe,\n preserveNativeCrossAxisScroll: false,\n drawerAxisAttributed: false\n };\n swipeTouchProps.onTouchStart?.(event);\n },\n onTouchEnd(event) {\n virtualKeyboard?.onTouchEnd(event);\n resetTouchTrackingState();\n swipeTouchProps.onTouchEnd?.(event);\n },\n onTouchCancel(event) {\n virtualKeyboard?.onTouchCancel();\n resetTouchTrackingState();\n swipeTouchProps.onTouchCancel?.(event);\n },\n // Drawer popups use drawer-specific nested state attributes.\n // Suppress DialogViewport's generic nested dialog attribute.\n [DialogViewportDataAttributes.nestedDialogOpen]: undefined\n }),\n children: /*#__PURE__*/_jsx(DrawerViewportContext.Provider, {\n value: swipeProviderValue,\n children: children\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerViewport.displayName = \"DrawerViewport\";\nfunction setBackdropSwipingAttribute(backdropElement, swiping) {\n backdropElement?.toggleAttribute(DrawerPopupDataAttributes.swiping, swiping);\n}\nfunction isSwipeIgnoredTarget(target) {\n return Boolean(closest(target, BASE_UI_SWIPE_IGNORE_SELECTOR));\n}\nfunction isDrawerContentTarget(target) {\n return Boolean(closest(target, DRAWER_CONTENT_SELECTOR));\n}\nfunction getBaseSwipeSize(element, direction) {\n return direction === 'left' || direction === 'right' ? element.offsetWidth : element.offsetHeight;\n}\nfunction getBaseSwipeThreshold(element, direction) {\n return Math.max(getBaseSwipeSize(element, direction) * 0.5, MIN_SWIPE_THRESHOLD);\n}\nfunction isRangeInput(target, win) {\n return target instanceof win.HTMLInputElement && target.type === 'range';\n}\nfunction isTextSelectionControl(target) {\n return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA';\n}\nfunction hasExpandedSelectionWithinTarget(selection, target) {\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n return selection.containsNode(target, true) || contains(target, anchorElement) || contains(target, focusElement);\n}\nfunction shouldIgnoreSwipeForTextSelection(doc, rootElement) {\n const activeEl = activeElement(doc);\n if (activeEl && contains(rootElement, activeEl) && isTextSelectionControl(activeEl)) {\n const {\n selectionStart,\n selectionEnd\n } = activeEl;\n if (selectionStart != null && selectionEnd != null && selectionStart < selectionEnd) {\n return true;\n }\n }\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n return hasExpandedSelectionWithinTarget(selection, rootElement);\n}\nfunction isEventOnRangeInput(event, win) {\n return event.composedPath().some(pathTarget => isRangeInput(pathTarget, win));\n}\nfunction isReactTouchEventOnRangeInput(event) {\n return isEventOnRangeInput(event.nativeEvent, ownerWindow(event.currentTarget));\n}\nfunction updateTouchScrollPosition(touchState, touch) {\n touchState.lastX = touch.clientX;\n touchState.lastY = touch.clientY;\n}\n\n/**\n * Arbitrates a touchmove between the drawer swipe and a cross-axis gesture: a native scroll, or an\n * element marked with the cross-axis `data-base-ui-swipe-ignore` value.\n * Returns `true` when the move must be left alone — either because the cross axis already won the\n * gesture, or because neither axis has passed the slop yet and the gesture cannot be attributed.\n */\nfunction shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis) {\n if (touchState.preserveNativeCrossAxisScroll) {\n return true;\n }\n\n // Attribution happens once per gesture. Re-arbitrating after the drawer axis has won would let\n // the pre-attribution branches below fire mid-drag (the slop is measured from the touch origin,\n // which is never re-baselined), freezing the popup and dropping `preventDefault()`.\n if (touchState.drawerAxisAttributed || touchState.allowSwipe === true || !touchState.hasCrossAxisGestureTarget) {\n return false;\n }\n\n // A non-cancelable touchmove means the browser has already committed the gesture to a native\n // scroll; claiming it for the swipe would drag the popup alongside the scrolling content.\n if (!event.cancelable) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n const drawerAxisGestureDelta = isVerticalScrollAxis ? touch.clientY - touchState.startY : touch.clientX - touchState.startX;\n const crossAxisGestureDelta = isVerticalScrollAxis ? touch.clientX - touchState.startX : touch.clientY - touchState.startY;\n const absDrawerAxisGestureDelta = Math.abs(drawerAxisGestureDelta);\n const absCrossAxisGestureDelta = Math.abs(crossAxisGestureDelta);\n if (absCrossAxisGestureDelta >= AXIS_LOCK_SLOP && absCrossAxisGestureDelta > absDrawerAxisGestureDelta + AXIS_LOCK_BIAS) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n if (absDrawerAxisGestureDelta >= AXIS_LOCK_SLOP) {\n touchState.drawerAxisAttributed = true;\n return false;\n }\n\n // Neither axis has traveled past the slop yet, so the gesture cannot be attributed. Leave the\n // event alone: on iOS, `preventDefault()` on the first cancelable touchmove cancels native\n // scrolling for the entire gesture, which would lock a cross-axis scroll that only passes the\n // slop on a later move.\n return true;\n}\nfunction hasScrollableContentOnAxis(scrollTarget, axis) {\n return getScrollMetrics(scrollTarget, axis).max > 0;\n}\nfunction getScrollMetrics(scrollTarget, axis) {\n if (axis === 'vertical') {\n const max = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);\n return {\n offset: scrollTarget.scrollTop,\n max\n };\n }\n const max = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);\n return {\n offset: scrollTarget.scrollLeft,\n max\n };\n}\nfunction isAtSwipeStartEdge(scrollTarget, axis, direction) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const {\n offset,\n max\n } = getScrollMetrics(scrollTarget, axis);\n return dismissFromStartEdge ? offset <= 0 : offset >= max;\n}\nfunction canSwipeFromScrollEdgeOnMove(scrollTarget, axis, direction, delta) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const movingTowardDismiss = dismissFromStartEdge ? delta > 0 : delta < 0;\n if (!movingTowardDismiss) {\n return false;\n }\n return isAtSwipeStartEdge(scrollTarget, axis, direction);\n}\nfunction shouldDismissFromStartEdge(direction, axis) {\n return axis === 'vertical' ? direction === 'down' : direction === 'right';\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A positioning container for the dialog popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogViewport = /*#__PURE__*/React.forwardRef(function DialogViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const keepMounted = useDialogPortalContext();\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const transitionStatus = store.useState('transitionStatus');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const mounted = store.useState('mounted');\n const setViewportElement = store.useStateSetter('viewportElement');\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const shouldRender = keepMounted || mounted;\n return useRenderElement('div', componentProps, {\n enabled: shouldRender,\n state,\n ref: [forwardedRef, setViewportElement],\n stateAttributesMapping: dialogStateAttributesMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined\n },\n children\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogViewport.displayName = \"DialogViewport\";","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the dialog is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the dialog is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the dialog begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the dialog is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the dialog is nested within another dialog.\n */\nexport const nested = 'data-nested';\n/**\n * Present when the dialog has other open dialogs nested within it.\n */\nexport const nestedDialogOpen = 'data-nested-dialog-open';","'use client';\n\nimport * as React from 'react';\nexport const DrawerVirtualKeyboardContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerVirtualKeyboardContext.displayName = \"DrawerVirtualKeyboardContext\";\nexport function useDrawerVirtualKeyboardContext() {\n return React.useContext(DrawerVirtualKeyboardContext);\n}","'use client';\n\nimport { Drawer } from '@base-ui/react/drawer';\nimport { Toast } from '@base-ui/react/toast';\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport { BUTTONS, INPUT } from '../../../forms/ui/look';\nimport { Switch } from '../../../forms/ui/switch';\nimport { ActionButton } from '../../../overview/ui/action-button';\nimport { StatusBadge, Tag } from '../../../outside-parties/ui/status-badge';\nimport { setPartyScopes, switchPartyTools, type TableOutcome } from '../../actions';\nimport { switchedMessageOf } from '../../switched-message';\nimport { hintSuggestionsOf, suggestedScopesOf } from '../hint-suggestions';\nimport { changedScopesOf, SCOPE_CHANGES, type ScopeChange } from '../scope-change';\nimport { partyScopesSetMessage, scopesSetMessage, statedMessage, suggestionsSetMessage, toolsSwitchedMessage } from '../table-messages';\nimport { keptToolsOf, shownTools, STATE_FILTERS, type KeptChanges, type StateFilter, type TableTool } from '../table-tools';\nimport { NeedsChips, type ListedScope } from './needs-chips';\nimport { ScopePicker } from './scope-picker';\nimport { standingRefusal, TableDialog, type DialogRefusal } from './table-dialog';\nimport { TableToasts } from './table-toasts';\n\n/** What the table shows of one outside MCP server, as its page read it. */\nexport interface ToolsTableProps {\n fleetId: string;\n party: string;\n tools: readonly TableTool[];\n /** The requirements' version the page read, which every change is made on. */\n version: number;\n partyScopes: readonly string[];\n /** The scopes the fleet lists, for an approver; none for anyone else. */\n listed: readonly ListedScope[] | null;\n /** Whether the actor approves the party: gateway:approve within manage reach. Others see the table read-only. */\n canChange: boolean;\n /** Why the server's tools could not be read: the table then shows the requirements kept per tool name. */\n serverRefusal: string | null;\n}\n\ntype OpenDialog = 'scopes' | 'party' | 'suggest' | null;\n\nconst ALL_SELECTED = 'Select all shown';\n\nfunction firstLineOf(description: string | undefined): string {\n return description?.split('\\n').find((line) => line.trim() !== '')?.trim() ?? '';\n}\n\n/**\n * An outside MCP server's tools as a table (gateway scopes 4.3, A6): filter\n * by name and state, select many, and set the scopes they need or switch them\n * in one change; set what every tool needs; or suggest scopes from the\n * server's hints. Each change is one transaction on the requirements' version\n * the page read: on success the dialog closes, the changed rows highlight and\n * a Toast says what was kept; a refusal stays inline. Only an approver within\n * manage reach sees the controls; anyone else, the same table read-only.\n */\nexport function ToolsTable(props: ToolsTableProps) {\n return (\n <Toast.Provider>\n <TableBody {...props} />\n <TableToasts />\n </Toast.Provider>\n );\n}\n\n/** What was kept since the page read the rows it was kept on; a fresh read replaces it. */\ninterface Kept extends KeptChanges {\n basis: readonly TableTool[];\n party: readonly string[] | null;\n}\n\nfunction TableBody({ fleetId, party, tools: readTools, version, partyScopes: readPartyScopes, listed, canChange, serverRefusal }: ToolsTableProps) {\n const router = useRouter();\n const toasts = Toast.useToastManager();\n const [, startTransition] = useTransition();\n const [isReloading, startReload] = useTransition();\n const [nameFilter, setNameFilter] = useState('');\n const [stateFilter, setStateFilter] = useState<StateFilter>('all');\n const [selected, setSelected] = useState<ReadonlySet<string>>(new Set());\n const [dialog, setDialog] = useState<OpenDialog>(null);\n const [picked, setPicked] = useState<string[]>([]);\n const [how, setHow] = useState<ScopeChange>('add');\n const [suggestPicks, setSuggestPicks] = useState<{ readOnly: string[]; other: string[] }>({ readOnly: [], other: [] });\n const [isSaving, setIsSaving] = useState(false);\n const [refusal, setRefusal] = useState<DialogRefusal | null>(null);\n const [switching, setSwitching] = useState<string | null>(null);\n const [switchRefusal, setSwitchRefusal] = useState<string | null>(null);\n const [highlighted, setHighlighted] = useState<{ names: ReadonlySet<string>; round: number }>({ names: new Set(), round: 0 });\n const [keptVersion, setKeptVersion] = useState<number | null>(null);\n const [isSheetOpen, setIsSheetOpen] = useState(false);\n const [keptChanges, setKeptChanges] = useState<Kept | null>(null);\n\n // A change kept here shows at once; once the page read itself again, its rows are the truth.\n const live = keptChanges?.basis === readTools ? keptChanges : null;\n const tools = live === null ? readTools : keptToolsOf(readTools, live);\n const partyScopes = live?.party ?? readPartyScopes;\n\n // A change kept here moves the version on before the page reads itself again.\n const currentVersion = Math.max(version, keptVersion ?? 0);\n const listedNames = listed === null ? null : new Set(listed.map(({ scope }) => scope));\n const shown = shownTools(tools, { name: nameFilter, state: stateFilter, partyScopes });\n const selectedTools = tools.filter(({ name }) => selected.has(name));\n const isServerAnswering = serverRefusal === null;\n const isEveryShownSelected = shown.length > 0 && shown.every(({ name }) => selected.has(name));\n const suggestions = hintSuggestionsOf(tools);\n const suggested = suggestedScopesOf(suggestions, suggestPicks);\n\n const kept = ({ outcome, changed, message, change }: { outcome: Extract<TableOutcome, { isOk: true }>; changed: readonly string[]; message: string; change: { party?: readonly string[]; scopes?: readonly { tool: string; scopes: readonly string[] }[]; switches?: ReadonlyMap<string, boolean> } }) => {\n setKeptChanges({\n basis: readTools,\n party: change.party ?? live?.party ?? null,\n scopes: new Map([...(live?.scopes ?? []), ...(change.scopes ?? []).map(({ tool, scopes }) => [tool, scopes] as const)]),\n switches: new Map([...(live?.switches ?? []), ...(change.switches ?? [])]),\n });\n if (outcome.version !== null) {\n setKeptVersion(outcome.version);\n }\n setHighlighted((previous) => ({ names: new Set(changed), round: previous.round + 1 }));\n toasts.add({ title: statedMessage(message, outcome.statementRefusal) });\n router.refresh();\n };\n\n const openDialog = (opened: Exclude<OpenDialog, null>) => {\n setRefusal(null);\n setIsSheetOpen(false);\n setPicked(opened === 'party' ? [...partyScopes] : []);\n setHow('add');\n setSuggestPicks({ readOnly: [], other: [] });\n setDialog(opened);\n };\n\n const closeDialog = () => {\n setDialog(null);\n setRefusal(null);\n };\n\n const save = ({ change, changed, message }: { change: { party?: string[]; tools: { tool: string; scopes: string[] }[] }; changed: readonly string[]; message: string }) => {\n setIsSaving(true);\n setRefusal(null);\n const madeOn = currentVersion;\n startTransition(async () => {\n const outcome = await setPartyScopes({ fleetId, name: party, version: madeOn, ...change });\n setIsSaving(false);\n if (!outcome.isOk) {\n setRefusal({ message: outcome.message, isConflict: outcome.isConflict, version: madeOn });\n return;\n }\n setDialog(null);\n setSelected(new Set());\n kept({ outcome, changed, message, change: { ...(change.party === undefined ? {} : { party: change.party }), scopes: change.tools } });\n });\n };\n\n const switchTools = ({ names, isOn, working }: { names: readonly string[]; isOn: boolean; working: string }) => {\n setSwitching(working);\n setSwitchRefusal(null);\n setIsSheetOpen(false);\n startTransition(async () => {\n const outcome = await switchPartyTools({ fleetId, name: party, tools: [...names], isOn });\n setSwitching(null);\n if (!outcome.isOk) {\n setSwitchRefusal(outcome.message);\n return;\n }\n const [only] = names;\n kept({ outcome, changed: names, change: { switches: new Map(names.map((name) => [name, isOn])) }, message: names.length === 1 && only !== undefined ? switchedMessageOf({ tool: only, isOn, statementRefusal: null }) : toolsSwitchedMessage({ count: names.length, isOn, statementRefusal: null }) });\n });\n };\n\n const reload = () => {\n startReload(() => {\n router.refresh();\n });\n };\n\n const toggle = (name: string) => {\n setSelected((previous) => {\n const next = new Set(previous);\n if (next.has(name)) {\n next.delete(name);\n } else {\n next.add(name);\n }\n return next;\n });\n };\n\n const toggleShown = () => {\n setSelected((previous) => {\n const next = new Set(previous);\n for (const { name } of shown) {\n if (isEveryShownSelected) {\n next.delete(name);\n } else {\n next.add(name);\n }\n }\n return next;\n });\n };\n\n const isBusy = switching !== null || isSaving;\n const toolbar = (\n <div className=\"grid gap-3 sm:flex sm:flex-wrap sm:items-center\" data-testid=\"tools-table-toolbar\">\n <label className=\"grid gap-1 sm:w-56\">\n <span className=\"sr-only\">Filter by name</span>\n <input className={INPUT} type=\"search\" placeholder=\"Filter by name\" value={nameFilter} onChange={(event) => { setNameFilter(event.target.value); }} data-testid=\"tools-table-name-filter\" />\n </label>\n <div role=\"group\" aria-label=\"Filter by state\" className=\"flex flex-wrap gap-1\">\n {STATE_FILTERS.map(({ state, label }) => (\n <button\n key={state}\n type=\"button\"\n aria-pressed={stateFilter === state}\n onClick={() => { setStateFilter(state); }}\n className={`h-8 rounded-md border px-3 ${stateFilter === state ? 'border-primary bg-primary text-primary-foreground' : 'border-border bg-card hover:bg-accent'}`}\n data-testid={`tools-table-state-${state}`}\n >\n {label}\n </button>\n ))}\n </div>\n {canChange ? (\n <>\n <label className=\"flex items-center gap-2\">\n <input type=\"checkbox\" checked={isEveryShownSelected} onChange={toggleShown} disabled={shown.length === 0} data-testid=\"tools-table-select-shown\" />\n {ALL_SELECTED}\n </label>\n <span className=\"text-muted-foreground\" data-testid=\"tools-table-selected\">\n {selected.size} selected\n </span>\n <div className=\"flex flex-wrap gap-2 sm:ml-auto\">\n <button type=\"button\" className={BUTTONS.secondary} disabled={selected.size === 0 || isBusy || listed === null} onClick={() => { openDialog('scopes'); }} data-testid=\"tools-table-set-scopes\">\n Set scopes…\n </button>\n <ActionButton isPending={switching === 'on'} pendingLabel=\"Switching on…\" disabled={selected.size === 0 || isBusy || !isServerAnswering} onClick={() => { switchTools({ names: [...selected], isOn: true, working: 'on' }); }} data-testid=\"tools-table-switch-on\">\n Switch on\n </ActionButton>\n <ActionButton isPending={switching === 'off'} pendingLabel=\"Switching off…\" disabled={selected.size === 0 || isBusy || !isServerAnswering} onClick={() => { switchTools({ names: [...selected], isOn: false, working: 'off' }); }} data-testid=\"tools-table-switch-off\">\n Switch off\n </ActionButton>\n <button type=\"button\" className={BUTTONS.secondary} disabled={isBusy || !isServerAnswering || listed === null} onClick={() => { openDialog('suggest'); }} data-testid=\"tools-table-suggest\">\n Suggest from hints…\n </button>\n </div>\n </>\n ) : null}\n </div>\n );\n\n return (\n <div className=\"grid gap-3\">\n <div className=\"flex flex-wrap items-center gap-2\" data-testid=\"tools-table-party-needs\">\n <span className=\"font-medium\">Every tool needs</span>\n <NeedsChips party={partyScopes} own={[]} listed={listedNames} />\n {canChange ? (\n <button type=\"button\" className=\"text-primary hover:underline disabled:opacity-60\" disabled={isBusy || listed === null} onClick={() => { openDialog('party'); }} data-testid=\"tools-table-party-change\">\n Change…\n </button>\n ) : null}\n </div>\n {serverRefusal === null ? null : (\n <p role=\"status\" className=\"rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-tone-waiting-fg\" data-testid=\"tools-table-server-down\">\n The server did not answer, so this shows the scopes kept per tool name; they can still be changed. {serverRefusal}\n </p>\n )}\n <div className=\"hidden sm:block\">{toolbar}</div>\n <div className=\"sm:hidden\">\n <Drawer.Root open={isSheetOpen} onOpenChange={setIsSheetOpen}>\n <Drawer.Trigger className={BUTTONS.secondary} data-testid=\"tools-table-sheet-open\">\n Filters and actions{canChange ? ` (${String(selected.size)} selected)` : ''}\n </Drawer.Trigger>\n <Drawer.Portal>\n <Drawer.Backdrop className=\"fixed inset-0 z-40 bg-(--overlay)\" />\n <Drawer.Viewport className=\"fixed inset-0 z-50 flex items-end\">\n <Drawer.Popup className=\"w-full rounded-t-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg\">\n <Drawer.Content className=\"grid gap-3\">\n <Drawer.Title className=\"text-heading font-semibold\">Filters and actions</Drawer.Title>\n {toolbar}\n <Drawer.Close className={BUTTONS.secondary}>Done</Drawer.Close>\n </Drawer.Content>\n </Drawer.Popup>\n </Drawer.Viewport>\n </Drawer.Portal>\n </Drawer.Root>\n </div>\n {switchRefusal === null ? null : (\n <p role=\"alert\" className=\"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg\" data-testid=\"tools-table-switch-refusal\">\n {switchRefusal}\n </p>\n )}\n <table className=\"w-full border-collapse max-sm:block\" data-testid=\"tools-table\">\n <thead className=\"max-sm:hidden\">\n <tr className=\"border-b border-border text-left text-muted-foreground\">\n {canChange ? <th className=\"w-8 py-2\"><span className=\"sr-only\">Selected</span></th> : null}\n <th className=\"py-2 font-medium\">Tool</th>\n <th className=\"py-2 font-medium\">Hints</th>\n <th className=\"py-2 font-medium\">On</th>\n <th className=\"py-2 font-medium\">Needs</th>\n </tr>\n </thead>\n <tbody className=\"max-sm:grid max-sm:gap-2\">\n {shown.map((tool) => {\n const isHighlighted = highlighted.names.has(tool.name);\n return (\n <tr\n key={isHighlighted ? `${tool.name}-${String(highlighted.round)}` : tool.name}\n className={`border-b border-border align-top last:border-b-0 max-sm:grid max-sm:grid-cols-[auto_1fr] max-sm:gap-x-2 max-sm:rounded-md max-sm:border max-sm:p-2 ${isHighlighted ? 'animate-highlight' : ''}`}\n data-testid=\"tools-table-row\"\n data-tool={tool.name}\n >\n {canChange ? (\n <td className=\"py-2 pr-2 max-sm:row-span-4\">\n <input type=\"checkbox\" aria-label={`Select ${tool.name}`} checked={selected.has(tool.name)} onChange={() => { toggle(tool.name); }} data-testid=\"tools-table-select\" />\n </td>\n ) : null}\n <td className=\"py-2 pr-3 max-sm:col-start-2\">\n <span className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-mono\">{tool.name}</span>\n {tool.isNew ? <StatusBadge tone=\"attention\" label=\"New\" /> : null}\n </span>\n {firstLineOf(tool.description) === '' ? null : <span className=\"block text-muted-foreground\">{firstLineOf(tool.description)}</span>}\n </td>\n <td className=\"py-2 pr-3 max-sm:col-start-2\">\n <span className=\"flex flex-wrap gap-1\">\n {tool.isReadOnly === true ? <Tag>Read only</Tag> : null}\n {tool.isDestructive === true ? <Tag>Destructive</Tag> : null}\n </span>\n </td>\n <td className=\"py-2 pr-3 max-sm:col-start-2\">\n {tool.isOn === null ? (\n <span className=\"text-muted-foreground\">Not known</span>\n ) : canChange ? (\n <Switch isOn={tool.isOn} label={tool.name} isPending={switching === tool.name} onClick={() => { switchTools({ names: [tool.name], isOn: tool.isOn !== true, working: tool.name }); }} testId=\"tools-table-switch\" />\n ) : (\n <Tag>{tool.isOn ? 'On' : 'Off'}</Tag>\n )}\n </td>\n <td className=\"py-2 max-sm:col-start-2\">\n <NeedsChips party={partyScopes} own={tool.scopes} listed={listedNames} />\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n {shown.length === 0 ? (\n <p className=\"text-muted-foreground\" data-testid=\"tools-table-empty\">\n {tools.length === 0 ? (isServerAnswering ? `${party} lists no tools.` : 'No tool needs a scope of its own yet.') : 'No tool matches the filters.'}\n </p>\n ) : null}\n {listed === null ? null : (\n <>\n <TableDialog\n isOpen={dialog === 'scopes'}\n onClose={closeDialog}\n title=\"Set scopes\"\n description=\"The scopes a calling ship must hold for each selected tool, beside what every tool needs.\"\n appliesTo={`Applies to ${String(selectedTools.length)} ${selectedTools.length === 1 ? 'tool' : 'tools'}`}\n action={{\n label: 'Set scopes',\n pending: 'Setting…',\n isDisabled: picked.length === 0 && how !== 'replace',\n onPress: () => {\n save({ change: { tools: changedScopesOf(selectedTools, { scopes: picked, how }) }, changed: selectedTools.map(({ name }) => name), message: scopesSetMessage({ scopes: picked, how, count: selectedTools.length }) });\n },\n }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, currentVersion)}\n isReloading={isReloading}\n onReload={reload}\n testId=\"tools-table-scopes-dialog\"\n >\n <ScopePicker label=\"Scopes\" listed={listed} picked={picked} onPick={setPicked} isDisabled={isSaving} testId=\"tools-table-scopes-picker\" />\n <fieldset className=\"grid gap-1\">\n <legend className=\"font-medium\">On each selected tool</legend>\n {SCOPE_CHANGES.map((change) => (\n <label key={change.how} className=\"flex items-center gap-2\">\n <input type=\"radio\" name=\"how\" value={change.how} checked={how === change.how} onChange={() => { setHow(change.how); }} data-testid={`tools-table-how-${change.how}`} />\n {change.label}\n </label>\n ))}\n </fieldset>\n </TableDialog>\n <TableDialog\n isOpen={dialog === 'party'}\n onClose={closeDialog}\n title=\"Every tool needs\"\n description={`The scopes a calling ship must hold for every tool of ${party}, beside each tool's own.`}\n appliesTo={`Applies to every tool of ${party}`}\n action={{\n label: 'Save',\n pending: 'Saving…',\n isDisabled: false,\n onPress: () => {\n save({ change: { party: picked, tools: [] }, changed: tools.map(({ name }) => name), message: partyScopesSetMessage({ party, scopes: picked }) });\n },\n }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, currentVersion)}\n isReloading={isReloading}\n onReload={reload}\n testId=\"tools-table-party-dialog\"\n >\n <ScopePicker label=\"Scopes\" listed={listed} picked={picked} onPick={setPicked} isDisabled={isSaving} testId=\"tools-table-party-picker\" />\n </TableDialog>\n <TableDialog\n isOpen={dialog === 'suggest'}\n onClose={closeDialog}\n title=\"Suggest from hints\"\n description=\"Scopes for each tool with no scope of its own, by what the server says of it. Hints are the server's claim: nothing applies until you confirm.\"\n appliesTo={`Applies to ${String(suggested.length)} ${suggested.length === 1 ? 'tool' : 'tools'}`}\n action={{\n label: 'Apply',\n pending: 'Applying…',\n isDisabled: suggested.length === 0,\n onPress: () => {\n const groups = [\n { scopes: suggestPicks.readOnly, count: suggestPicks.readOnly.length === 0 ? 0 : suggestions.readOnly.length },\n { scopes: suggestPicks.other, count: suggestPicks.other.length === 0 ? 0 : suggestions.other.length },\n ].filter(({ count }) => count > 0);\n save({ change: { tools: suggested }, changed: suggested.map(({ tool }) => tool), message: suggestionsSetMessage(groups) });\n },\n }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, currentVersion)}\n isReloading={isReloading}\n onReload={reload}\n testId=\"tools-table-suggest-dialog\"\n >\n <ScopePicker label=\"Scopes for read-only tools\" listed={listed} picked={suggestPicks.readOnly} onPick={(readOnly) => { setSuggestPicks((previous) => ({ ...previous, readOnly })); }} isDisabled={isSaving} testId=\"tools-table-suggest-read-only\" />\n <ScopePicker label=\"Scopes for the other tools\" listed={listed} picked={suggestPicks.other} onPick={(other) => { setSuggestPicks((previous) => ({ ...previous, other })); }} isDisabled={isSaving} testId=\"tools-table-suggest-other\" />\n <SuggestedList title=\"Read-only tools\" names={suggestions.readOnly} testId=\"tools-table-suggest-read-only-tools\" />\n <SuggestedList title=\"Other tools\" names={suggestions.other} testId=\"tools-table-suggest-other-tools\" />\n <SuggestedList title=\"Without hints, left as they are\" names={suggestions.withoutHints} testId=\"tools-table-suggest-without-hints\" />\n </TableDialog>\n </>\n )}\n </div>\n );\n}\n\n/** One group of the tools a suggestion would change, by name. */\nfunction SuggestedList({ title, names, testId }: { title: string; names: readonly string[]; testId: string }) {\n return (\n <details className=\"rounded-md border border-border px-3 py-2\" data-testid={testId}>\n <summary className=\"cursor-pointer\">\n {title} ({names.length})\n </summary>\n {names.length === 0 ? <p className=\"text-muted-foreground\">None</p> : <p className=\"font-mono text-code break-words\">{names.join(', ')}</p>}\n </details>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"40313bb6a73ff4c6cf9db1dc6010fd9dd332869a43\":{\"name\":\"switchPartyTools\"}},\"web/features/outside-party/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_2=/*#__PURE__*/createServerReference(\"40313bb6a73ff4c6cf9db1dc6010fd9dd332869a43\",callServer,void 0,findSourceMapURL,\"switchPartyTools\");export{$$RSC_SERVER_ACTION_2 as switchPartyTools};","/** What a tool's switch says once the API kept it: what the fleet sees now, or that the proxy ship shows it at its next statement, and why. */\nexport function switchedMessageOf({ tool, isOn, statementRefusal }: { tool: string; isOn: boolean; statementRefusal: string | null }): string {\n const state = `${tool} is ${isOn ? 'on' : 'off'}`;\n if (statementRefusal !== null) {\n return `${state}; the fleet sees it at the proxy ship's next statement: ${statementRefusal}`;\n }\n return isOn ? `${state}: the fleet may call it.` : `${state}: the fleet sees it no more, and a call to it is refused.`;\n}\n","/**\n * Suggest from hints (gateway scopes 4.3): the tools with no scope of their\n * own, split by what the server says of them. Hints are the server's claim,\n * never trusted on their own, so nothing applies until the approver confirms.\n */\n\ninterface HintedTool {\n name: string;\n isReadOnly?: boolean | undefined;\n isDestructive?: boolean | undefined;\n scopes: readonly string[];\n}\n\n/** The tools each picker would change, by name, and the ones without hints, left untouched. */\nexport interface HintSuggestions {\n readOnly: string[];\n other: string[];\n withoutHints: string[];\n}\n\nexport function hintSuggestionsOf(tools: readonly HintedTool[]): HintSuggestions {\n const suggestions: HintSuggestions = { readOnly: [], other: [], withoutHints: [] };\n for (const tool of tools.filter(({ scopes }) => scopes.length === 0)) {\n if (tool.isDestructive === true || tool.isReadOnly === false) {\n suggestions.other.push(tool.name);\n } else if (tool.isReadOnly === true) {\n suggestions.readOnly.push(tool.name);\n } else {\n suggestions.withoutHints.push(tool.name);\n }\n }\n return suggestions;\n}\n\n/** The change the suggestions make with the scopes picked: a group whose picker is empty changes nothing. */\nexport function suggestedScopesOf(suggestions: HintSuggestions, picked: { readOnly: readonly string[]; other: readonly string[] }): { tool: string; scopes: string[] }[] {\n const group = (tools: readonly string[], scopes: readonly string[]) => (scopes.length === 0 ? [] : tools.map((tool) => ({ tool, scopes: [...scopes] })));\n return [...group(suggestions.readOnly, picked.readOnly), ...group(suggestions.other, picked.other)];\n}\n","/** How a bulk change treats the picked scopes on each selected tool (gateway scopes 4.3). */\nexport const SCOPE_CHANGES = [\n { how: 'add', label: 'Add to each' },\n { how: 'remove', label: 'Remove from each' },\n { how: 'replace', label: 'Replace with these' },\n] as const;\n\nexport type ScopeChange = (typeof SCOPE_CHANGES)[number]['how'];\n\n/** What each selected tool needs of its own after the change, each scope once; none needs nothing beyond the party's. */\nexport function changedScopesOf(selected: readonly { name: string; scopes: readonly string[] }[], change: { scopes: readonly string[]; how: ScopeChange }): { tool: string; scopes: string[] }[] {\n return selected.map(({ name, scopes }) => {\n switch (change.how) {\n case 'add':\n return { tool: name, scopes: [...new Set([...scopes, ...change.scopes])] };\n case 'remove':\n return { tool: name, scopes: scopes.filter((scope) => !change.scopes.includes(scope)) };\n case 'replace':\n return { tool: name, scopes: [...new Set(change.scopes)] };\n }\n });\n}\n","/**\n * The rows of an outside MCP server's tools table (gateway scopes 4.3):\n * each tool the server lists now, with its switch, the hints it gives and\n * the scopes it needs of its own; and the filters an approver narrows them by.\n */\nimport type { Read } from '../../../lib/gateway-api/page-api';\n\n/** A tool as the server lists it now, with its switch, as the API answers it. */\nexport interface ListedTool {\n name: string;\n description?: string | undefined;\n isReadOnly?: boolean | undefined;\n isDestructive?: boolean | undefined;\n isOn: boolean;\n isNew: boolean;\n}\n\n/** A party's required scopes as the API answers them. */\nexport interface PartyRequirements {\n version: number;\n party: string[];\n tools: { tool: string; scopes: string[] }[];\n}\n\n/** One row: the tool, its switch (unknown while the server does not answer), and the scopes it needs of its own. */\nexport interface TableTool {\n name: string;\n description?: string | undefined;\n isReadOnly?: boolean | undefined;\n isDestructive?: boolean | undefined;\n isOn: boolean | null;\n isNew: boolean;\n scopes: readonly string[];\n}\n\n/**\n * The rows: every tool the server lists with what it needs; while the server\n * does not answer, the requirements kept per tool name, so they can still be\n * read and changed.\n */\nexport function tableToolsOf({ read, requirements }: { read: Read<{ tools: ListedTool[] }>; requirements: PartyRequirements }): TableTool[] {\n const own = new Map(requirements.tools.map(({ tool, scopes }) => [tool, scopes]));\n if (!read.isOk) {\n return requirements.tools.map(({ tool, scopes }) => ({ name: tool, isOn: null, isNew: false, scopes }));\n }\n return read.value.tools.map((tool) => ({ ...tool, scopes: own.get(tool.name) ?? [] }));\n}\n\n/** The table's state filter. */\nexport const STATE_FILTERS = [\n { state: 'all', label: 'All' },\n { state: 'on', label: 'On' },\n { state: 'off', label: 'Off' },\n { state: 'new', label: 'New' },\n { state: 'needsNothing', label: 'Needs nothing' },\n] as const;\n\nexport type StateFilter = (typeof STATE_FILTERS)[number]['state'];\n\nfunction isInState(tool: TableTool, { state, partyScopes }: { state: StateFilter; partyScopes: readonly string[] }): boolean {\n switch (state) {\n case 'all':\n return true;\n case 'on':\n return tool.isOn === true;\n case 'off':\n return tool.isOn === false;\n case 'new':\n return tool.isNew;\n case 'needsNothing':\n return partyScopes.length === 0 && tool.scopes.length === 0;\n }\n}\n\n/** The tools whose name holds the text, in any case, and that are in the state picked. */\nexport function shownTools(tools: readonly TableTool[], filter: { name: string; state: StateFilter; partyScopes: readonly string[] }): TableTool[] {\n const name = filter.name.trim().toLowerCase();\n return tools.filter((tool) => tool.name.toLowerCase().includes(name) && isInState(tool, filter));\n}\n\n/** What the page kept since it read the rows: each changed tool's own scopes, and each switched tool's switch. */\nexport interface KeptChanges {\n scopes: ReadonlyMap<string, readonly string[]>;\n switches: ReadonlyMap<string, boolean>;\n}\n\n/** The rows with what was kept since they were read, so a change shows at once rather than when the page reads the server again. */\nexport function keptToolsOf(tools: readonly TableTool[], kept: KeptChanges): TableTool[] {\n return tools.map((tool) => ({ ...tool, scopes: kept.scopes.get(tool.name) ?? tool.scopes, isOn: tool.isOn === null ? null : (kept.switches.get(tool.name) ?? tool.isOn) }));\n}\n","'use client';\n\nimport { useActionState } from 'react';\nimport { useFormStatus } from 'react-dom';\n\nimport { FLEET_FIELD } from '../../forms/form-state';\nimport { Switch } from '../../forms/ui/switch';\nimport { markA2aAgent, type MarkState } from '../actions';\n\nconst IDLE: MarkState = { kind: 'idle' };\n\nfunction SubmitSwitch({ isRepeatable }: { isRepeatable: boolean }) {\n const status = useFormStatus();\n return <Switch type=\"submit\" isOn={isRepeatable} label=\"Repeatable\" isPending={status.pending} testId=\"outside-party-repeatable-switch\" />;\n}\n\n/**\n * An A2A agent's repeatable mark on its page, for an approver (A9): a press\n * sends the change at once, the switch says it is on its way, then the row\n * says what it means now, or why the API refused it.\n */\nexport function RepeatableSwitch({ fleetId, party, isRepeatable }: { fleetId: string; party: string; isRepeatable: boolean }) {\n const [state, action] = useActionState(markA2aAgent, IDLE);\n const shown = state.kind === 'marked' ? state.isRepeatable : isRepeatable;\n return (\n <>\n <form action={action} className=\"contents\">\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"name\" value={party} />\n <input type=\"hidden\" name=\"isRepeatable\" value={String(!shown)} />\n <SubmitSwitch isRepeatable={shown} />\n </form>\n {state.kind === 'idle' ? null : (\n <span role={state.kind === 'refused' ? 'alert' : 'status'} className={`basis-full text-caption ${state.kind === 'refused' ? 'text-tone-attention-fg' : 'text-tone-ok-fg'}`} data-testid=\"outside-party-repeatable-outcome\">\n {state.message}\n </span>\n )}\n </>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"60d56d8b2d1a1bab18d5726426f7a6b24ec307b83c\":{\"name\":\"markA2aAgent\"}},\"web/features/outside-party/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_3=/*#__PURE__*/createServerReference(\"60d56d8b2d1a1bab18d5726426f7a6b24ec307b83c\",callServer,void 0,findSourceMapURL,\"markA2aAgent\");export{$$RSC_SERVER_ACTION_3 as markA2aAgent};"],"names":["ToastContext","undefined","useToastProviderContext","context","Error","Switch","isOn","label","isPending","type","onClick","testId","role","disabled","className","AgentNeeds","props","Provider","AgentNeedsLine","fleetId","party","version","scopes","listed","canChange","router","toasts","useToastManager","startTransition","isReloading","startReload","isOpen","setIsOpen","picked","setPicked","isSaving","setIsSaving","refusal","setRefusal","keptVersion","setKeptVersion","round","setRound","kept","setKept","shown","basis","save","madeOn","Math","max","outcome","name","tools","isOk","message","isConflict","previous","add","title","statementRefusal","refresh","own","Set","map","scope","onClose","description","appliesTo","action","pending","isDisabled","onPress","onReload","onPick","nestedDrawers","height","frontmostHeight","swipeMovementX","swipeMovementY","snapPointOffset","swipeStrength","$$RSC_SERVER_ACTION_3"],"mappings":"mHAEA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCHA,EAAA,EAAA,CAAA,CAAA,OAEO,IAAMA,EAA4B,EAAA,WAAb,EAAgC,MAACC,GAAtB,AAEhC,SAASC,IACd,IAAMC,EAAU,EAAA,UAAgB,CAACH,GACjC,GAAI,CAACG,EACH,MAAM,AAAIC,CADE,KAC+G,AAA3G,AAA2G,CAAA,EAAA,EAAA,CAAA,AAA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AEd,SAAf,EAAM,IAAI,CAAc,KACvB,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,KAAqB,YAAf,EAAM,IAAI,CAAiB,QAAU,SAAU,UAAW,CAAC,wBAAwB,EAAiB,YAAf,EAAM,IAAI,CAAiB,yBAA2B,kBAAA,CAAmB,CAAE,cAAY,4CACrL,EAAM,OAAO,KAKxB","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106]}
|
|
1
|
+
{"version":3,"sources":["../../../../../node_modules/%40base-ui/react/toast/provider/ToastProvider.mjs","../../../../../node_modules/%40base-ui/react/toast/provider/ToastProviderContext.mjs","../../../../../node_modules/%40base-ui/react/toast/store.mjs","../../../../../node_modules/%40base-ui/utils/generateId.mjs","../../../../../node_modules/%40base-ui/react/toast/utils/resolvePromiseOptions.mjs","../../../../../node_modules/%40base-ui/react/toast/viewport/ToastViewport.mjs","../../../../../node_modules/%40base-ui/react/toast/viewport/ToastViewportCssVars.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRoot.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRootContext.mjs","../../../../../node_modules/%40base-ui/utils/clamp.mjs","../../../../../node_modules/%40base-ui/react/utils/scrollable.mjs","../../../../../node_modules/%40base-ui/react/utils/getElementAtPoint.mjs","../../../../../node_modules/%40base-ui/react/utils/getElementTransform.mjs","../../../../../node_modules/%40base-ui/react/utils/useSwipeDismiss.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRootCssVars.mjs","../../../../../node_modules/%40base-ui/react/toast/root/ToastRootDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/toast/content/ToastContent.mjs","../../../../../node_modules/%40base-ui/react/toast/utils/useToastLabelPart.mjs","../../../../../node_modules/%40base-ui/react/toast/utils/isRenderableNode.mjs","../../../../../node_modules/%40base-ui/react/toast/title/ToastTitle.mjs","../../../../../node_modules/%40base-ui/react/toast/close/ToastClose.mjs","../../../../../node_modules/%40base-ui/react/toast/portal/ToastPortal.mjs","../../../../../node_modules/%40base-ui/react/toast/useToastManager.mjs","../../../../../web/features/outside-party/data%3A758ef4%20%3Ctext/javascript%3E","../../../../../web/features/outside-party/tools-table/table-messages.ts","../../../../../web/features/outside-party/tools-table/ui/needs-chips.tsx","../../../../../node_modules/%40base-ui/react/combobox/root/AriaCombobox.mjs","../../../../../node_modules/%40base-ui/utils/useOnFirstRender.mjs","../../../../../node_modules/%40base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs","../../../../../node_modules/%40base-ui/react/floating-ui-react/hooks/gridNavigation.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/ComboboxRootContext.mjs","../../../../../node_modules/%40base-ui/utils/areArraysEqual.mjs","../../../../../node_modules/%40base-ui/react/internals/itemEquality.mjs","../../../../../node_modules/%40base-ui/react/internals/serializeValue.mjs","../../../../../node_modules/%40base-ui/react/internals/resolveValueLabel.mjs","../../../../../node_modules/%40base-ui/react/combobox/store.mjs","../../../../../node_modules/%40base-ui/react/field/control/FieldControlDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/internals/field-constants/constants.mjs","../../../../../node_modules/%40base-ui/react/internals/field-root-context/FieldRootContext.mjs","../../../../../node_modules/%40base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs","../../../../../node_modules/%40base-ui/react/internals/form-context/FormContext.mjs","../../../../../node_modules/%40base-ui/react/internals/labelable-provider/useLabelableId.mjs","../../../../../node_modules/%40base-ui/react/internals/labelable-provider/LabelableContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/utils/index.mjs","../../../../../node_modules/%40base-ui/utils/stringifyLocale.mjs","../../../../../node_modules/%40base-ui/react/internals/filter.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/utils/useFilter.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/utils/constants.mjs","../../../../../node_modules/%40base-ui/react/combobox/items/itemCollection.mjs","../../../../../node_modules/%40base-ui/react/combobox/root/ComboboxRoot.mjs","../../../../../node_modules/%40base-ui/react/utils/useRegisteredLabelId.mjs","../../../../../node_modules/%40base-ui/react/internals/labelable-provider/useLabel.mjs","../../../../../node_modules/%40base-ui/react/utils/resolveAriaLabelledBy.mjs","../../../../../node_modules/%40base-ui/react/combobox/label/ComboboxLabel.mjs","../../../../../node_modules/%40base-ui/react/combobox/input/ComboboxInput.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/stateAttributesMapping.mjs","../../../../../node_modules/%40base-ui/react/combobox/input/ComboboxInputDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/internals/field-root-context/useSetFieldFocused.mjs","../../../../../node_modules/%40base-ui/react/combobox/chips/ComboboxChipsContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/positioner/ComboboxPositionerContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/ComboboxInternalDismissButton.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/parts.mjs","../../../../../node_modules/%40base-ui/react/combobox/utils/handleInputPress.mjs","../../../../../node_modules/%40base-ui/react/combobox/input-group/ComboboxInputGroup.mjs","../../../../../node_modules/%40base-ui/react/combobox/collection/GroupCollectionContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/collection/ComboboxCollection.mjs","../../../../../node_modules/%40base-ui/react/combobox/list/ComboboxList.mjs","../../../../../node_modules/%40base-ui/react/combobox/portal/ComboboxPortal.mjs","../../../../../node_modules/%40base-ui/react/combobox/portal/ComboboxPortalContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/positioner/ComboboxPositioner.mjs","../../../../../node_modules/%40base-ui/react/combobox/popup/ComboboxPopup.mjs","../../../../../node_modules/%40base-ui/react/combobox/item/ComboboxItem.mjs","../../../../../node_modules/%40base-ui/react/combobox/item/ComboboxItemContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/row/ComboboxRowContext.mjs","../../../../../node_modules/%40base-ui/react/utils/ItemIndicator.mjs","../../../../../node_modules/%40base-ui/react/combobox/item-indicator/ComboboxItemIndicator.mjs","../../../../../node_modules/%40base-ui/react/combobox/chips/ComboboxChips.mjs","../../../../../node_modules/%40base-ui/react/combobox/chip/ComboboxChipContext.mjs","../../../../../node_modules/%40base-ui/react/combobox/chip/ComboboxChip.mjs","../../../../../node_modules/%40base-ui/react/combobox/chip-remove/ComboboxChipRemove.mjs","../../../../../node_modules/%40base-ui/react/internals/useInitialLiveRegionTextMutation.mjs","../../../../../node_modules/%40base-ui/react/combobox/empty/ComboboxEmpty.mjs","../../../../../web/features/outside-party/tools-table/ui/scope-picker.tsx","../../../../../web/features/outside-party/tools-table/ui/table-dialog.tsx","../../../../../web/features/outside-party/tools-table/ui/table-toasts.tsx","../../../../../web/features/forms/ui/switch.tsx","../../../../../web/features/outside-party/tools-table/ui/agent-needs.tsx","../../../../../node_modules/%40base-ui/react/drawer/backdrop/DrawerBackdrop.mjs","../../../../../node_modules/%40base-ui/react/drawer/popup/DrawerPopupCssVars.mjs","../../../../../node_modules/%40base-ui/react/drawer/backdrop/DrawerBackdropCssVars.mjs","../../../../../node_modules/%40base-ui/react/drawer/close/DrawerClose.mjs","../../../../../node_modules/%40base-ui/react/drawer/content/drawerContentAttribute.mjs","../../../../../node_modules/%40base-ui/react/drawer/content/DrawerContent.mjs","../../../../../node_modules/%40base-ui/react/drawer/popup/DrawerPopup.mjs","../../../../../node_modules/%40base-ui/react/drawer/popup/DrawerPopupDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/drawer/root/DrawerRootContext.mjs","../../../../../node_modules/%40base-ui/react/drawer/root/useDrawerSnapPoints.mjs","../../../../../node_modules/%40base-ui/react/drawer/viewport/DrawerViewportContext.mjs","../../../../../node_modules/%40base-ui/react/drawer/portal/DrawerPortal.mjs","../../../../../node_modules/%40base-ui/react/drawer/root/DrawerRoot.mjs","../../../../../node_modules/%40base-ui/react/drawer/provider/DrawerProviderContext.mjs","../../../../../node_modules/%40base-ui/react/drawer/title/DrawerTitle.mjs","../../../../../node_modules/%40base-ui/react/drawer/trigger/DrawerTrigger.mjs","../../../../../node_modules/%40base-ui/react/drawer/viewport/DrawerViewport.mjs","../../../../../node_modules/%40base-ui/react/dialog/viewport/DialogViewport.mjs","../../../../../node_modules/%40base-ui/react/dialog/viewport/DialogViewportDataAttributes.mjs","../../../../../node_modules/%40base-ui/react/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs","../../../../../web/features/outside-party/tools-table/ui/tools-table.tsx","../../../../../web/features/outside-party/data%3A52250a%20%3Ctext/javascript%3E","../../../../../web/features/outside-party/switched-message.ts","../../../../../web/features/outside-party/tools-table/hint-suggestions.ts","../../../../../web/features/outside-party/tools-table/scope-change.ts","../../../../../web/features/outside-party/tools-table/table-tools.ts","../../../../../web/features/outside-party/ui/repeatable-switch.tsx","../../../../../web/features/outside-party/data%3Afb2c44%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ToastContext } from \"./ToastProviderContext.mjs\";\nimport { ToastStore } from \"../store.mjs\";\n\n/**\n * Provides a context for creating and managing toasts.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ToastProvider = function ToastProvider(props) {\n const {\n children,\n timeout = 5000,\n limit = 3,\n toastManager\n } = props;\n const store = useRefWithInit(() => new ToastStore({\n timeout,\n limit,\n viewport: null,\n toasts: [],\n hovering: false,\n focused: false,\n isWindowFocused: true,\n prevFocusElement: null\n })).current;\n useOnMount(store.disposeEffect);\n React.useEffect(function subscribeToToastManager() {\n if (!toastManager) {\n return undefined;\n }\n const unsubscribe = toastManager[' subscribe'](({\n action,\n options\n }) => {\n const id = options.id;\n if (action === 'promise' && options.promise) {\n store.promiseToast(options.promise, options);\n } else if (action === 'update' && id) {\n store.updateToast(id, options.updates);\n } else if (action === 'close') {\n store.closeToast(id);\n } else {\n store.addToast(options);\n }\n });\n return unsubscribe;\n }, [store, toastManager]);\n return /*#__PURE__*/_jsxs(ToastContext.Provider, {\n value: store,\n children: [/*#__PURE__*/_jsx(ToastProviderPropsSynchronizer, {\n store: store,\n timeout: timeout,\n limit: limit\n }), children]\n });\n};\nif (process.env.NODE_ENV !== \"production\") ToastProvider.displayName = \"ToastProvider\";\nfunction ToastProviderPropsSynchronizer(props) {\n const {\n store,\n timeout,\n limit\n } = props;\n\n // `limit` needs custom syncing because changing it must also recompute each\n // toast's `limited` flag; `useSyncedValues` would only update the raw value.\n useIsoLayoutEffect(() => {\n store.syncProviderProps(timeout, limit);\n }, [store, timeout, limit]);\n return null;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastContext.displayName = \"ToastContext\";\nexport function useToastProviderContext() {\n const context = React.useContext(ToastContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: useToastManager must be used within <Toast.Provider>.' : _formatErrorMessage(73));\n }\n return context;\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { generateId } from '@base-ui/utils/generateId';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { resolvePromiseOptions } from \"./utils/resolvePromiseOptions.mjs\";\nimport { activeElement, contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { isFocusVisible } from \"./utils/focusVisible.mjs\";\n\n/**\n * A toast once it lives in the store. `addToast` is the only way in and it always\n * assigns `updateKey`, so unlike the public `ToastObject` it is never missing.\n */\n\nfunction createToastMetadata(toasts) {\n const metadata = new Map();\n let visibleIndex = 0;\n let offsetY = 0;\n toasts.forEach((toast, toastIndex) => {\n const isEnding = toast.transitionStatus === 'ending';\n metadata.set(toast.id, {\n value: toast,\n domIndex: toastIndex,\n visibleIndex: isEnding ? -1 : visibleIndex,\n offsetY\n });\n offsetY += toast.height || 0;\n if (!isEnding) {\n visibleIndex += 1;\n }\n });\n return metadata;\n}\n\n// Marks the active (non-ending) toasts beyond `limit` as limited. Callers pass\n// toasts in newest-first order, so the newest `limit` toasts stay visible and\n// the rest are flagged. Returns the same toast reference when its `limited`\n// flag is unchanged to avoid unnecessary re-renders.\nfunction applyLimited(toasts, limit) {\n let activeIndex = 0;\n return toasts.map(toast => {\n if (toast.transitionStatus === 'ending') {\n return toast;\n }\n const limited = activeIndex >= limit;\n activeIndex += 1;\n return toast.limited === limited ? toast : {\n ...toast,\n limited\n };\n });\n}\nexport const selectors = {\n toasts: state => state.toasts,\n isEmpty: state => state.toasts.length === 0,\n toast: (state, id) => state.toastMetadata.get(id)?.value,\n toastIndex: (state, id) => state.toastMetadata.get(id)?.domIndex ?? -1,\n toastOffsetY: (state, id) => state.toastMetadata.get(id)?.offsetY ?? 0,\n toastVisibleIndex: (state, id) => state.toastMetadata.get(id)?.visibleIndex ?? -1,\n focused: state => state.focused,\n expanded: state => state.hovering || state.focused,\n expandedOrOutOfFocus: state => state.hovering || state.focused || !state.isWindowFocused,\n prevFocusElement: state => state.prevFocusElement\n};\nexport class ToastStore extends ReactStore {\n timers = new Map();\n areTimersPaused = false;\n constructor(initialState) {\n super({\n ...initialState,\n toastMetadata: createToastMetadata(initialState.toasts)\n }, {}, selectors);\n }\n setViewport = viewport => {\n this.set('viewport', viewport);\n };\n syncProviderProps(timeout, limit) {\n const limitChanged = this.state.limit !== limit;\n if (this.state.timeout === timeout && !limitChanged) {\n return;\n }\n const updates = {\n timeout,\n limit\n };\n if (limitChanged) {\n const newToasts = applyLimited(this.state.toasts, limit);\n updates.toasts = newToasts;\n updates.toastMetadata = createToastMetadata(newToasts);\n }\n this.update(updates);\n }\n disposeEffect = () => {\n return () => {\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n };\n };\n removeToast(toastId, skipOnRemove = false) {\n const index = selectors.toastIndex(this.state, toastId);\n if (index === -1) {\n return;\n }\n const toast = this.state.toasts[index];\n if (!skipOnRemove) {\n toast?.onRemove?.();\n }\n const newToasts = [...this.state.toasts];\n newToasts.splice(index, 1);\n this.setToasts(newToasts);\n }\n addToast = toast => {\n const {\n timeout,\n limit\n } = this.state;\n const id = toast.id || generateId('toast');\n if (toast.id) {\n const existingToast = selectors.toast(this.state, toast.id);\n if (existingToast) {\n if (existingToast.transitionStatus === 'ending') {\n this.removeToast(toast.id, true);\n } else {\n const {\n id: ignoredId,\n transitionStatus: ignoredTransitionStatus,\n ...updates\n } = toast;\n this.updateToastInternal(toast.id, updates, true, true);\n return toast.id;\n }\n }\n }\n const toastToAdd = {\n ...toast,\n id,\n updateKey: 0,\n transitionStatus: 'starting'\n };\n const updatedToasts = [toastToAdd, ...this.state.toasts];\n this.setToasts(applyLimited(updatedToasts, limit));\n const duration = toastToAdd.timeout ?? timeout;\n if (toastToAdd.type !== 'loading' && duration > 0) {\n this.scheduleTimer(id, duration, () => this.closeToast(id));\n }\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n return id;\n };\n updateToast = (id, updates) => {\n const prevToast = selectors.toast(this.state, id);\n // Never run the updater for an update the store is going to ignore.\n if (!prevToast || prevToast.transitionStatus === 'ending') {\n return;\n }\n\n // The updater may have called back into the store, so the internal update\n // reads the current state again.\n this.updateToastInternal(id, typeof updates === 'function' ? updates(prevToast) : updates, false, true);\n };\n updateToastInternal = (id, updates, resetTimer = false, markUpdated = false) => {\n const {\n timeout,\n toasts\n } = this.state;\n const prevToast = selectors.toast(this.state, id);\n if (!prevToast) {\n return;\n }\n\n // Ignore updates for toasts that are already closing.\n // This prevents races where async updates (e.g. promise success/error)\n // can block a dismissal from completing.\n if (prevToast.transitionStatus === 'ending') {\n return;\n }\n const nextToast = {\n ...prevToast,\n ...updates,\n ...(markUpdated && {\n updateKey: prevToast.updateKey + 1\n })\n };\n this.setToasts(toasts.map(toast => toast.id === id ? nextToast : toast));\n const nextTimeout = nextToast.timeout ?? timeout;\n const prevTimeout = prevToast.timeout ?? timeout;\n const timeoutUpdated = Object.hasOwn(updates, 'timeout');\n const shouldHaveTimer = nextToast.transitionStatus !== 'ending' && nextToast.type !== 'loading' && nextTimeout > 0;\n const hasTimer = this.timers.has(id);\n const timeoutChanged = prevTimeout !== nextTimeout;\n const wasLoading = prevToast.type === 'loading';\n if (!shouldHaveTimer && hasTimer) {\n this.clearTimer(id);\n return;\n }\n\n // Schedule or reschedule timer if needed\n if (shouldHaveTimer && (!hasTimer || timeoutChanged || timeoutUpdated || wasLoading || resetTimer)) {\n this.clearTimer(id);\n this.scheduleTimer(id, nextTimeout, () => this.closeToast(id));\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n }\n };\n closeToast = toastId => {\n const closeAll = toastId === undefined;\n const {\n limit,\n toasts\n } = this.state;\n let toastsToClose;\n if (closeAll) {\n toastsToClose = toasts;\n this.clearTimers();\n } else {\n const toast = selectors.toast(this.state, toastId);\n if (!toast) {\n return;\n }\n toastsToClose = [toast];\n this.clearTimer(toastId);\n }\n const endingToasts = toasts.map(item => closeAll || item.id === toastId ? {\n ...item,\n transitionStatus: 'ending',\n height: 0\n } : item);\n const newToasts = applyLimited(endingToasts, limit);\n this.setToasts(newToasts, !newToasts.some(toast => toast.transitionStatus !== 'ending'));\n toastsToClose.forEach(toast => {\n if (toast.transitionStatus !== 'ending') {\n toast.onClose?.();\n }\n });\n this.handleFocusManagement(toastId);\n };\n promiseToast = (promiseValue, options) => {\n // Create a loading toast (which does not auto-dismiss).\n const loadingOptions = resolvePromiseOptions(options.loading);\n const id = this.addToast({\n ...loadingOptions,\n type: 'loading'\n });\n const handledPromise = promiseValue.then(result => {\n const successOptions = resolvePromiseOptions(options.success, result);\n this.updateToast(id, {\n ...successOptions,\n type: 'success',\n timeout: successOptions.timeout\n });\n return result;\n }).catch(error => {\n const errorOptions = resolvePromiseOptions(options.error, error);\n this.updateToast(id, {\n ...errorOptions,\n type: 'error',\n timeout: errorOptions.timeout\n });\n return Promise.reject(error);\n });\n\n // Private API used exclusively by `Manager` to handoff the promise\n // back to the manager after it's handled here.\n if ({}.hasOwnProperty.call(options, 'setPromise')) {\n options.setPromise(handledPromise);\n }\n return handledPromise;\n };\n pauseTimers() {\n if (this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = true;\n this.timers.forEach(timer => {\n // Timers added while already paused have no running timeout, so their\n // `remaining` is still the full delay and must be left alone.\n if (timer.timeout) {\n timer.timeout.clear();\n // `start` is stamped on every resume, so subtracting from `remaining`\n // (rather than from the original delay) keeps repeated pause/resume\n // cycles from handing the toast extra time.\n timer.remaining = Math.max(timer.remaining - (Date.now() - timer.start), 0);\n }\n });\n }\n resumeTimers() {\n if (!this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = false;\n this.timers.forEach((timer, id) => {\n timer.remaining = timer.remaining > 0 ? timer.remaining : timer.delay;\n timer.timeout ??= Timeout.create();\n timer.timeout.start(timer.remaining, () => {\n this.handleTimerFired(id);\n timer.callback();\n });\n timer.start = Date.now();\n });\n }\n restoreFocusToPrevElement() {\n this.state.prevFocusElement?.focus({\n preventScroll: true\n });\n }\n handleDocumentPointerDown = event => {\n if (event.pointerType !== 'touch') {\n return;\n }\n const target = getTarget(event);\n if (contains(this.state.viewport, target)) {\n return;\n }\n\n // This is explicit touch activity outside the viewport, so the paused\n // interaction state should end even if the window focus state is unchanged.\n this.resumeTimers();\n this.update({\n hovering: false,\n focused: false\n });\n };\n scheduleTimer(id, delay, callback) {\n const start = Date.now();\n const shouldStartActive = !selectors.expandedOrOutOfFocus(this.state);\n const currentTimeout = shouldStartActive ? Timeout.create() : undefined;\n currentTimeout?.start(delay, () => {\n this.handleTimerFired(id);\n callback();\n });\n this.timers.set(id, {\n timeout: currentTimeout,\n start,\n delay,\n remaining: delay,\n callback\n });\n }\n clearTimers() {\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n this.areTimersPaused = false;\n }\n clearTimer(id) {\n const timer = this.timers.get(id);\n timer?.timeout?.clear();\n this.timers.delete(id);\n this.resetPausedStateIfNoTimersRemain();\n }\n handleTimerFired(id) {\n this.timers.delete(id);\n this.resetPausedStateIfNoTimersRemain();\n }\n resetPausedStateIfNoTimersRemain() {\n if (this.timers.size === 0) {\n // No timers remain to keep paused; clear the flag so a fresh toast's\n // running timer can be paused again on hover/focus.\n this.areTimersPaused = false;\n }\n }\n setToasts(newToasts, clearInteraction = newToasts.length === 0) {\n const updates = {\n toasts: newToasts,\n toastMetadata: createToastMetadata(newToasts)\n };\n if (clearInteraction) {\n updates.hovering = false;\n updates.focused = false;\n }\n this.update(updates);\n }\n handleFocusManagement(toastId) {\n const activeEl = activeElement(ownerDocument(this.state.viewport));\n if (!this.state.viewport || !contains(this.state.viewport, activeEl) || !isFocusVisible(activeEl)) {\n return;\n }\n if (toastId === undefined) {\n this.restoreFocusToPrevElement();\n return;\n }\n const toasts = selectors.toasts(this.state);\n const currentIndex = selectors.toastIndex(this.state, toastId);\n const scan = (from, step) => {\n for (let index = from; index >= 0 && index < toasts.length; index += step) {\n if (toasts[index].transitionStatus !== 'ending') {\n return toasts[index];\n }\n }\n return null;\n };\n\n // Try to find the next toast that isn't animating out, then fall back to the previous one.\n const nextToast = scan(currentIndex + 1, 1) ?? scan(currentIndex - 1, -1);\n if (nextToast) {\n nextToast.ref?.current?.focus();\n } else {\n this.restoreFocusToPrevElement();\n }\n }\n}","let counter = 0;\nexport function generateId(prefix) {\n counter += 1;\n return `${prefix}-${Math.random().toString(36).slice(2, 6)}-${counter}`;\n}","export function resolvePromiseOptions(options, result) {\n if (typeof options === 'string') {\n return {\n description: options\n };\n }\n if (typeof options === 'function') {\n const resolvedOptions = options(result);\n return typeof resolvedOptions === 'string' ? {\n description: resolvedOptions\n } : resolvedOptions;\n }\n return options;\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { activeElement, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { isFocusVisible } from \"../utils/focusVisible.mjs\";\nimport * as ToastViewportCssVars from \"./ToastViewportCssVars.mjs\";\n\n/**\n * A container viewport for toasts.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ToastViewport = /*#__PURE__*/React.forwardRef(function ToastViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const windowFocusTimeout = useTimeout();\n const handlingFocusGuardRef = React.useRef(false);\n const markedReadyForMouseLeaveRef = React.useRef(false);\n const touchActiveRef = React.useRef(false);\n const isEmpty = store.useState('isEmpty');\n const toasts = store.useState('toasts');\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n const prevFocusElement = store.useState('prevFocusElement');\n const frontmostHeight = toasts[0]?.height;\n const hasTransitioningToasts = toasts.some(toast => toast.transitionStatus === 'ending');\n const highPriorityToasts = toasts.filter(toast => toast.priority === 'high');\n React.useEffect(() => {\n // `store.state.viewport` isn't available on the first render, since the portal node hasn't yet\n // been created. Depending on `isEmpty` ensures the listeners are attached once toasts exist and\n // the viewport ref is available.\n const viewport = store.state.viewport;\n if (!viewport || isEmpty) {\n return undefined;\n }\n const win = ownerWindow(viewport);\n const doc = ownerDocument(viewport);\n\n // Listen globally for F6 so we can force-focus the viewport.\n function handleGlobalKeyDown(event) {\n if (event.key === 'F6' && getTarget(event) !== viewport) {\n event.preventDefault();\n store.set('prevFocusElement', activeElement(doc));\n viewport?.focus({\n preventScroll: true\n });\n store.pauseTimers();\n store.set('focused', true);\n }\n }\n function handleWindowBlur(event) {\n if (getTarget(event) !== win) {\n return;\n }\n store.set('isWindowFocused', false);\n store.pauseTimers();\n }\n function handleWindowFocus(event) {\n if (event.relatedTarget) {\n return;\n }\n const target = getTarget(event);\n const activeEl = activeElement(ownerDocument(viewport));\n if (target === win || !contains(viewport, target) || !isFocusVisible(activeEl)) {\n store.resumeTimers();\n }\n\n // Wait for the `handleFocus` event to fire.\n windowFocusTimeout.start(0, () => store.set('isWindowFocused', true));\n }\n return mergeCleanups(addEventListener(win, 'keydown', handleGlobalKeyDown), addEventListener(win, 'blur', handleWindowBlur, true), addEventListener(win, 'focus', handleWindowFocus, true), addEventListener(doc, 'pointerdown', store.handleDocumentPointerDown, true));\n }, [store, windowFocusTimeout, isEmpty]);\n function handleFocusGuard(event) {\n handlingFocusGuardRef.current = true;\n\n // If we're coming off the container, move to the first toast that can hold\n // focus, skipping toasts that are animating out or inert because they're limited.\n const firstFocusableToast = event.relatedTarget === store.state.viewport ? toasts.find(toast => toast.transitionStatus !== 'ending' && !toast.limited) : undefined;\n if (firstFocusableToast) {\n firstFocusableToast.ref?.current?.focus();\n } else {\n store.restoreFocusToPrevElement();\n }\n }\n function handleKeyDown(event) {\n if (event.key === 'Tab' && event.shiftKey && getTarget(event.nativeEvent) === store.state.viewport) {\n event.preventDefault();\n // Restoring focus blurs the viewport, and `handleBlur` resumes the timers\n // from there. Resuming here as well would also fire when the previously\n // focused element lives inside the viewport, letting toasts dismiss out\n // from under the keyboard.\n store.restoreFocusToPrevElement();\n }\n }\n function flushMouseLeave() {\n const hasEndingToasts = store.state.toasts.some(toast => toast.transitionStatus === 'ending');\n if (hasEndingToasts || touchActiveRef.current || !markedReadyForMouseLeaveRef.current) {\n return;\n }\n\n // Apply any mouseleave that was deferred until transitions finished.\n store.set('hovering', false);\n if (!store.select('expandedOrOutOfFocus')) {\n store.resumeTimers();\n }\n markedReadyForMouseLeaveRef.current = false;\n }\n React.useEffect(flushMouseLeave, [hasTransitioningToasts, store]);\n function handleMouseEnter() {\n store.pauseTimers();\n store.set('hovering', true);\n markedReadyForMouseLeaveRef.current = false;\n }\n function handleMouseLeave() {\n // Defer to `flushMouseLeave`: while toasts are transitioning out or a touch gesture is active it\n // records the intent and collapses later; otherwise it collapses immediately.\n markedReadyForMouseLeaveRef.current = true;\n flushMouseLeave();\n }\n function handlePointerDown(event) {\n if (event.pointerType === 'touch') {\n touchActiveRef.current = true;\n }\n }\n function handlePointerEnd(event) {\n if (event.pointerType !== 'touch') {\n return;\n }\n touchActiveRef.current = false;\n flushMouseLeave();\n }\n function handleFocus() {\n if (handlingFocusGuardRef.current) {\n handlingFocusGuardRef.current = false;\n return;\n }\n if (focused) {\n return;\n }\n\n // Only set focused when the active element is focus-visible.\n // This prevents the viewport from staying expanded when clicking inside without\n // keyboard navigation.\n if (isFocusVisible(activeElement(ownerDocument(store.state.viewport)))) {\n store.set('focused', true);\n store.pauseTimers();\n }\n }\n function handleBlur(event) {\n if (!focused || contains(store.state.viewport, event.relatedTarget)) {\n return;\n }\n store.set('focused', false);\n if (!store.select('expandedOrOutOfFocus')) {\n store.resumeTimers();\n }\n }\n const defaultProps = {\n tabIndex: -1,\n role: 'region',\n 'aria-live': 'polite',\n 'aria-atomic': false,\n 'aria-relevant': 'additions text',\n 'aria-label': 'Notifications',\n onMouseEnter: handleMouseEnter,\n onMouseMove: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onClick: handleFocus,\n onPointerDown: handlePointerDown,\n onPointerUp: handlePointerEnd,\n onPointerCancel: handlePointerEnd,\n style: {\n [ToastViewportCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined\n }\n };\n const state = {\n expanded\n };\n const focusGuard = !isEmpty && prevFocusElement && /*#__PURE__*/_jsx(FocusGuard, {\n onFocus: handleFocusGuard\n });\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.setViewport],\n state,\n props: [defaultProps, elementProps, {\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [focusGuard, children, focusGuard]\n })\n }]\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [focusGuard, element, !focused && highPriorityToasts.length > 0 && /*#__PURE__*/_jsx(\"div\", {\n style: visuallyHidden,\n children: highPriorityToasts.map(toast => /*#__PURE__*/_jsxs(\"div\", {\n role: \"alert\",\n \"aria-atomic\": true,\n children: [/*#__PURE__*/_jsx(\"div\", {\n children: toast.title\n }), /*#__PURE__*/_jsx(\"div\", {\n children: toast.description\n })]\n }, toast.id))\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastViewport.displayName = \"ToastViewport\";","/**\n * Indicates the height of the frontmost toast.\n * @type {number}\n */\nexport const frontmostHeight = '--toast-frontmost-height';","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { ToastRootContext } from \"./ToastRootContext.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { BASE_UI_SWIPE_IGNORE_SELECTOR, LEGACY_SWIPE_IGNORE_SELECTOR } from \"../../internals/constants.mjs\";\nimport { getDisplacement } from \"../../utils/useSwipeDismiss.mjs\";\nimport { getElementTransform } from \"../../utils/getElementTransform.mjs\";\nimport * as ToastRootCssVars from \"./ToastRootCssVars.mjs\";\nimport * as ToastRootDataAttributes from \"./ToastRootDataAttributes.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const toastRootStateAttributesMapping = {\n ...transitionStatusMapping,\n swipeDirection(value) {\n return value ? {\n [ToastRootDataAttributes.swipeDirection]: value\n } : null;\n }\n};\nconst SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst OPPOSITE_DIRECTION_DAMPING_FACTOR = 0.5;\nconst MIN_DRAG_THRESHOLD = 1;\nconst TOAST_SWIPE_IGNORE_SELECTOR = `${BASE_UI_SWIPE_IGNORE_SELECTOR},${LEGACY_SWIPE_IGNORE_SELECTOR}`;\n\n/**\n * Groups all parts of an individual toast.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastRoot = /*#__PURE__*/React.forwardRef(function ToastRoot(componentProps, forwardedRef) {\n const {\n toast,\n render,\n className,\n swipeDirection = ['down', 'right'],\n style,\n ...elementProps\n } = componentProps;\n const isAnchored = toast.positionerProps?.anchor !== undefined;\n let swipeDirections = [];\n if (!isAnchored) {\n swipeDirections = Array.isArray(swipeDirection) ? swipeDirection : [swipeDirection];\n }\n const swipeEnabled = swipeDirections.length > 0;\n const store = useToastProviderContext();\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [isRealSwipe, setIsRealSwipe] = React.useState(false);\n const [dragOffset, setDragOffset] = React.useState({\n x: 0,\n y: 0\n });\n const [initialTransform, setInitialTransform] = React.useState({\n x: 0,\n y: 0,\n scale: 1\n });\n const [titleId, setTitleId] = React.useState();\n const [descriptionId, setDescriptionId] = React.useState();\n const [lockedDirection, setLockedDirection] = React.useState(null);\n const rootRef = React.useRef(null);\n const lastToastIdRef = React.useRef(undefined);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const activePointerIdRef = React.useRef(null);\n const dragAbortControllerRef = React.useRef(null);\n const domIndex = store.useState('toastIndex', toast.id);\n const visibleIndex = store.useState('toastVisibleIndex', toast.id);\n const offsetY = store.useState('toastOffsetY', toast.id);\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n useOpenChangeComplete({\n open: toast.transitionStatus !== 'ending',\n ref: rootRef,\n onComplete() {\n if (toast.transitionStatus === 'ending') {\n store.removeToast(toast.id);\n }\n }\n });\n\n // Recalculates the natural height of the toast and updates it in the toast manager.\n // `flushSync` avoids visual flickers when called from observer callbacks.\n // The store ignores this write while the toast is transitioning out.\n const recalculateHeight = useStableCallback((flushSync = false) => {\n const element = rootRef.current;\n if (!element) {\n return;\n }\n const previousHeight = element.style.height;\n element.style.height = 'auto';\n const height = element.offsetHeight;\n element.style.height = previousHeight;\n function update() {\n store.updateToastInternal(toast.id, {\n ref: rootRef,\n height,\n transitionStatus: undefined\n });\n }\n if (flushSync) {\n ReactDOM.flushSync(update);\n } else {\n update();\n }\n });\n\n // Initialize the toast on mount, and reinitialize when it begins a new lifecycle:\n // re-adding an ending toast retains the same root instance (`key={toast.id}`), and\n // index-keyed lists can hand an existing instance a different toast.\n useIsoLayoutEffect(() => {\n const previousToastId = lastToastIdRef.current;\n // `recalculateHeight` clears the `starting` status itself, so bail out on the\n // resulting re-run and on the later `ending` one, which the store discards anyway.\n if (toast.transitionStatus !== 'starting' && previousToastId === toast.id) {\n return;\n }\n if (previousToastId !== undefined) {\n // A retained root keeps component-local swipe state from its previous lifecycle;\n // clear it so the toast doesn't stay offset or exit in the swiped direction.\n setCurrentSwipeDirection(undefined);\n setInitialTransform({\n x: 0,\n y: 0,\n scale: 1\n });\n setResolvedDragOffset({\n x: 0,\n y: 0\n });\n }\n lastToastIdRef.current = toast.id;\n recalculateHeight();\n }, [recalculateHeight, toast.id, toast.transitionStatus]);\n function setResolvedDragOffset(nextDragOffset) {\n dragOffsetRef.current = nextDragOffset;\n setDragOffset(nextDragOffset);\n }\n useIsoLayoutEffect(() => {\n return () => {\n dragAbortControllerRef.current?.abort();\n };\n }, []);\n function applyDirectionalDamping(deltaX, deltaY) {\n const damp = delta => delta > 0 ? delta ** OPPOSITE_DIRECTION_DAMPING_FACTOR : -(Math.abs(delta) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);\n const dampX = deltaX > 0 && !swipeDirections.includes('right') || deltaX < 0 && !swipeDirections.includes('left');\n const dampY = deltaY > 0 && !swipeDirections.includes('down') || deltaY < 0 && !swipeDirections.includes('up');\n return {\n x: dampX ? damp(deltaX) : deltaX,\n y: dampY ? damp(deltaY) : deltaY\n };\n }\n const handleSwipeEnd = useStableCallback(event => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n activePointerIdRef.current = null;\n dragAbortControllerRef.current?.abort();\n dragAbortControllerRef.current = null;\n setIsSwiping(false);\n setIsRealSwipe(false);\n setLockedDirection(null);\n const resolvedInitialTransform = initialTransformRef.current;\n if (event.type === 'pointercancel' || cancelledSwipeRef.current) {\n setResolvedDragOffset({\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const deltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const deltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n let dismissDirection;\n for (const direction of swipeDirections) {\n if (getDisplacement(direction, deltaX, deltaY) > SWIPE_THRESHOLD) {\n dismissDirection = direction;\n break;\n }\n }\n if (dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n store.closeToast(toast.id);\n } else {\n setResolvedDragOffset({\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n }\n });\n function handlePointerDown(event) {\n if (event.button !== 0) {\n return;\n }\n if (event.pointerType === 'touch') {\n store.pauseTimers();\n }\n const target = getTarget(event.nativeEvent);\n const isInteractiveElement = closest(target, `button,a,input,textarea,[role=\"button\"],${TOAST_SWIPE_IGNORE_SELECTOR}`);\n if (isInteractiveElement) {\n return;\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n activePointerIdRef.current = event.pointerId;\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n swipeCancelBaselineRef.current = dragStartPosRef.current;\n const element = event.currentTarget;\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n setInitialTransform(transform);\n setResolvedDragOffset({\n x: transform.x,\n y: transform.y\n });\n store.set('hovering', true);\n setIsSwiping(true);\n setIsRealSwipe(false);\n setLockedDirection(null);\n isFirstPointerMoveRef.current = true;\n dragAbortControllerRef.current?.abort();\n const dragAbortController = new AbortController();\n dragAbortControllerRef.current = dragAbortController;\n const doc = ownerDocument(element);\n doc.addEventListener('pointerup', handleSwipeEnd, {\n signal: dragAbortController.signal\n });\n doc.addEventListener('pointercancel', handleSwipeEnd, {\n signal: dragAbortController.signal\n });\n element.setPointerCapture?.(event.pointerId);\n }\n function handlePointerMove(event) {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n\n // Prevent text selection on Safari\n event.preventDefault();\n if (isFirstPointerMoveRef.current) {\n // Adjust the starting position to the current position on the first move\n // to account for the delay between pointerdown and the first pointermove on iOS.\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n isFirstPointerMoveRef.current = false;\n }\n const {\n clientY,\n clientX,\n movementX,\n movementY\n } = event;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let resolvedLockedDirection = lockedDirection;\n if (!isRealSwipe) {\n const movementDistance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (movementDistance >= MIN_DRAG_THRESHOLD) {\n setIsRealSwipe(true);\n // `lockedDirection` is always reset alongside `isRealSwipe`, so it is\n // still `null` here. Locking is only meaningful when both axes are\n // swipeable; otherwise the single axis already constrains the gesture.\n const hasHorizontal = swipeDirections.includes('left') || swipeDirections.includes('right');\n const hasVertical = swipeDirections.includes('up') || swipeDirections.includes('down');\n if (hasHorizontal && hasVertical) {\n const absX = Math.abs(deltaX);\n const absY = Math.abs(deltaY);\n resolvedLockedDirection = absX > absY ? 'horizontal' : 'vertical';\n setLockedDirection(resolvedLockedDirection);\n }\n }\n }\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (resolvedLockedDirection === 'vertical') {\n if (deltaY > 0) {\n candidate = 'down';\n } else if (deltaY < 0) {\n candidate = 'up';\n }\n } else if (resolvedLockedDirection === 'horizontal') {\n if (deltaX > 0) {\n candidate = 'right';\n } else if (deltaX < 0) {\n candidate = 'left';\n }\n } else if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate && swipeDirections.includes(candidate)) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > SWIPE_THRESHOLD) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(swipeDirections.includes('left') && swipeDirections.includes('right')) && !(swipeDirections.includes('up') && swipeDirections.includes('down')) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n const hasHorizontalDir = swipeDirections.includes('left') || swipeDirections.includes('right');\n const hasVerticalDir = swipeDirections.includes('up') || swipeDirections.includes('down');\n if (resolvedLockedDirection !== 'vertical' && hasHorizontalDir) {\n newOffsetX += dampedDelta.x;\n }\n if (resolvedLockedDirection !== 'horizontal' && hasVerticalDir) {\n newOffsetY += dampedDelta.y;\n }\n setResolvedDragOffset({\n x: newOffsetX,\n y: newOffsetY\n });\n }\n function handleKeyDown(event) {\n if (event.key === 'Escape') {\n if (!rootRef.current || !contains(rootRef.current, activeElement(ownerDocument(rootRef.current)))) {\n return;\n }\n store.closeToast(toast.id);\n }\n }\n React.useEffect(() => {\n const element = rootRef.current;\n if (!swipeEnabled || !element) {\n return undefined;\n }\n function preventDefaultTouchStart(event) {\n if (activePointerIdRef.current === null || !contains(element, getTarget(event))) {\n return;\n }\n\n // React's pointermove preventDefault is not enough on iOS; this\n // non-passive touchmove listener blocks native scrolling while dragging.\n event.preventDefault();\n }\n return addEventListener(element, 'touchmove', preventDefaultTouchStart, {\n passive: false\n });\n }, [swipeEnabled]);\n function getDragStyles() {\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n return {\n transition: isSwiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: isSwiping ? `translateX(${dragOffset.x}px) translateY(${dragOffset.y}px) scale(${initialTransform.scale})` : undefined,\n [ToastRootCssVars.swipeMovementX]: `${deltaX}px`,\n [ToastRootCssVars.swipeMovementY]: `${deltaY}px`\n };\n }\n const isHighPriority = toast.priority === 'high';\n const defaultProps = {\n role: isHighPriority ? 'alertdialog' : 'dialog',\n tabIndex: 0,\n 'aria-modal': false,\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n 'aria-hidden': isHighPriority && !focused ? true : undefined,\n onPointerDown: swipeEnabled ? handlePointerDown : undefined,\n onPointerMove: swipeEnabled ? handlePointerMove : undefined,\n onPointerUp: swipeEnabled ? handleSwipeEnd : undefined,\n onPointerCancel: swipeEnabled ? handleSwipeEnd : undefined,\n onKeyDown: handleKeyDown,\n inert: inertValue(toast.limited),\n style: {\n ...getDragStyles(),\n [ToastRootCssVars.index]: toast.transitionStatus === 'ending' ? domIndex : visibleIndex,\n [ToastRootCssVars.offsetY]: `${offsetY}px`,\n [ToastRootCssVars.height]: toast.height ? `${toast.height}px` : undefined\n }\n };\n const toastRoot = React.useMemo(() => ({\n toast,\n setTitleId,\n setDescriptionId,\n recalculateHeight,\n visibleIndex,\n expanded\n }), [toast, setTitleId, setDescriptionId, recalculateHeight, visibleIndex, expanded]);\n const state = {\n transitionStatus: toast.transitionStatus,\n expanded,\n limited: toast.limited || false,\n type: toast.type,\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, rootRef],\n state,\n stateAttributesMapping: toastRootStateAttributesMapping,\n props: [defaultProps, elementProps]\n });\n return /*#__PURE__*/_jsx(ToastRootContext.Provider, {\n value: toastRoot,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastRoot.displayName = \"ToastRoot\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastRootContext.displayName = \"ToastRootContext\";\nexport function useToastRootContext() {\n const context = React.useContext(ToastRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.' : _formatErrorMessage(66));\n }\n return context;\n}","export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}","import { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode } from '@floating-ui/utils/dom';\nexport function isScrollableY(element, allowOverflowIntent = false) {\n const {\n overflowY\n } = getComputedStyle(element);\n if (overflowY !== 'auto' && overflowY !== 'scroll') {\n return false;\n }\n // When `allowOverflowIntent` is true, a container that overflows only once extra space is\n // added (e.g. drawer keyboard scroll slack) still counts, as long as it has layout size on\n // the axis.\n return allowOverflowIntent ? element.clientHeight > 0 : element.scrollHeight > element.clientHeight;\n}\nexport function isScrollableX(element, allowOverflowIntent = false) {\n const {\n overflowX\n } = getComputedStyle(element);\n if (overflowX !== 'auto' && overflowX !== 'scroll') {\n return false;\n }\n return allowOverflowIntent ? element.clientWidth > 0 : element.scrollWidth > element.clientWidth;\n}\nexport function isScrollable(element, axis, allowOverflowIntent = false) {\n return axis === 'vertical' ? isScrollableY(element, allowOverflowIntent) : isScrollableX(element, allowOverflowIntent);\n}\nexport function findScrollableAncestor(target, root, axis, allowOverflowIntent = false) {\n // `getParentNode` crosses shadow boundaries (and slots), so a target inside a shadow root\n // still walks up to scrollable ancestors in the light DOM. Non-HTML targets (SVG, MathML)\n // can't scroll, but their HTML ancestors can.\n let node = target;\n while (isElement(node) && node !== root && !isLastTraversableNode(node)) {\n if (isHTMLElement(node) && isScrollable(node, axis, allowOverflowIntent)) {\n return node;\n }\n node = getParentNode(node);\n }\n return null;\n}\nexport function findScrollableTouchTarget(target, root, axis = 'vertical', allowOverflowIntent = false) {\n return findScrollableAncestor(target, root, axis, allowOverflowIntent) ?? (isScrollable(root, axis, allowOverflowIntent) ? root : null);\n}","// `Document.elementFromPoint` retargets shadow content to the shadow host, which then fails\n// `contains()` checks against a popup inside that shadow root, so callers pass `getRootNode()`\n// (a document or a shadow root) rather than `ownerDocument()`.\nexport function getElementAtPoint(root, x, y) {\n return typeof root?.elementFromPoint === 'function' ? root.elementFromPoint(x, y) : null;\n}","import { ownerWindow } from '@base-ui/utils/owner';\n\n/**\n * Extracts the 2D translation and scale from the element's computed `transform` matrix.\n * Note that the `translate`, `rotate`, and `scale` longhands are separate properties and\n * are not reflected in the computed `transform` value.\n *\n * Pass `computedStyle` when the caller has already resolved it to avoid a second lookup.\n */\nexport function getElementTransform(element, computedStyle) {\n const transform = (computedStyle ?? ownerWindow(element).getComputedStyle(element)).transform;\n let translateX = 0;\n let translateY = 0;\n let scale = 1;\n if (transform && transform !== 'none') {\n const matrix = transform.match(/matrix(?:3d)?\\(([^)]+)\\)/);\n if (matrix) {\n const values = matrix[1].split(', ').map(parseFloat);\n if (values.length === 6) {\n translateX = values[4];\n translateY = values[5];\n scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);\n } else if (values.length === 16) {\n translateX = values[12];\n translateY = values[13];\n scale = values[0];\n }\n }\n }\n return {\n x: translateX,\n y: translateY,\n scale\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { closest, contains, getTarget } from \"../floating-ui-react/utils.mjs\";\nimport { findScrollableAncestor, findScrollableTouchTarget } from \"./scrollable.mjs\";\nimport { getElementAtPoint } from \"./getElementAtPoint.mjs\";\nimport { getElementTransform } from \"./getElementTransform.mjs\";\nconst DEFAULT_SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst MIN_VELOCITY_DURATION_MS = 50;\n// Under one frame at 240 Hz, so it only damps near-simultaneous samples.\nconst MIN_RELEASE_VELOCITY_DURATION_MS = 4;\nconst MAX_RELEASE_VELOCITY_AGE_MS = 80;\nconst MIN_VELOCITY_SAMPLE_DISTANCE = 1;\nconst DEFAULT_IGNORE_SELECTOR = 'button,a,input,select,textarea,label,[role=\"button\"]';\nexport function getDisplacement(direction, deltaX, deltaY) {\n switch (direction) {\n case 'up':\n return -deltaY;\n case 'down':\n return deltaY;\n case 'left':\n return -deltaX;\n case 'right':\n return deltaX;\n default:\n return 0;\n }\n}\nfunction getValidTimeStamp(timeStamp) {\n return Number.isFinite(timeStamp) && timeStamp > 0 ? timeStamp : null;\n}\nfunction getDragTransform(dragOffset, scale) {\n return `translate3d(${dragOffset.x}px,${dragOffset.y}px,0) scale(${scale})`;\n}\nfunction hasPrimaryMouseButton(buttons) {\n return buttons % 2 === 1;\n}\nfunction safelyChangePointerCapture(element, pointerId, method) {\n const pointerCaptureMethod = element[method];\n if (typeof pointerCaptureMethod !== 'function') {\n return;\n }\n try {\n pointerCaptureMethod.call(element, pointerId);\n } catch (error) {\n if (error && typeof error === 'object' && 'name' in error && error.name === 'NotFoundError') {\n return;\n }\n throw error;\n }\n}\nexport function useSwipeDismiss(options) {\n const {\n enabled,\n directions,\n elementRef,\n movementCssVars,\n canStart,\n ignoreSelectorWhenTouch = true,\n ignoreScrollableAncestors = false,\n swipeThreshold: swipeThresholdProp,\n onDismiss,\n onProgress,\n onCancel,\n onSwipeStart,\n onRelease,\n onSwipingChange,\n trackDrag = true\n } = options;\n const ignoreSelector = DEFAULT_IGNORE_SELECTOR;\n const primaryDirection = directions.length === 1 ? directions[0] : undefined;\n const swipeThresholdDefault = Math.max(0, typeof swipeThresholdProp === 'number' ? swipeThresholdProp : DEFAULT_SWIPE_THRESHOLD);\n const allowLeft = directions.includes('left');\n const allowRight = directions.includes('right');\n const allowUp = directions.includes('up');\n const allowDown = directions.includes('down');\n const hasHorizontal = allowLeft || allowRight;\n const hasVertical = allowUp || allowDown;\n\n // Consumers only pass directions on a single axis.\n const scrollAxis = hasHorizontal ? 'horizontal' : 'vertical';\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [dragDismissed, setDragDismissed] = React.useState(false);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const dragOffsetRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastMovePosRef = React.useRef(null);\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const pendingSwipeRef = React.useRef(false);\n const pendingSwipeStartPosRef = React.useRef(null);\n const swipeFromScrollableRef = React.useRef(false);\n const sawPrimaryButtonsOnMoveRef = React.useRef(false);\n const elementSizeRef = React.useRef({\n width: 0,\n height: 0\n });\n const swipeProgressRef = React.useRef(0);\n const swipeThresholdRef = React.useRef(swipeThresholdDefault);\n const swipeThresholdFunctionRef = React.useRef(null);\n const swipeStartTimeRef = React.useRef(null);\n const lastDragSampleRef = React.useRef(null);\n const hasStationarySampleRef = React.useRef(false);\n const lastDragVelocityRef = React.useRef({\n x: 0,\n y: 0\n });\n const lastProgressDetailsRef = React.useRef(null);\n const isSwipingRef = React.useRef(false);\n const dragStyleSnapshotRef = React.useRef(null);\n const setSwiping = useStableCallback(nextSwiping => {\n if (isSwipingRef.current === nextSwiping) {\n return;\n }\n isSwipingRef.current = nextSwiping;\n setIsSwiping(nextSwiping);\n onSwipingChange?.(nextSwiping);\n });\n function resolveSwipeThreshold(direction) {\n if (!direction) {\n return;\n }\n const element = elementRef.current;\n const thresholdFunction = swipeThresholdFunctionRef.current;\n if (!element || !thresholdFunction) {\n return;\n }\n const value = thresholdFunction({\n element,\n direction\n });\n swipeThresholdRef.current = Math.max(0, value);\n }\n const updateSwipeProgress = useStableCallback((progress, details) => {\n const nextProgress = Number.isFinite(progress) ? clamp(progress, 0, 1) : 0;\n const progressChanged = nextProgress !== swipeProgressRef.current;\n let detailsChanged = false;\n if (details) {\n const lastDetails = lastProgressDetailsRef.current;\n detailsChanged = !lastDetails || lastDetails.deltaX !== details.deltaX || lastDetails.deltaY !== details.deltaY || lastDetails.direction !== details.direction;\n }\n if (!progressChanged && !detailsChanged) {\n return;\n }\n swipeProgressRef.current = nextProgress;\n if (details) {\n lastProgressDetailsRef.current = details;\n } else if (progressChanged) {\n lastProgressDetailsRef.current = null;\n }\n onProgress?.(nextProgress, details);\n });\n const syncDragStyles = useStableCallback(swiping => {\n const element = elementRef.current;\n if (!trackDrag || !element) {\n if (!swiping) {\n dragStyleSnapshotRef.current = null;\n }\n return;\n }\n const style = element.style;\n const dragStyleSnapshot = dragStyleSnapshotRef.current;\n if (swiping) {\n if (!dragStyleSnapshot) {\n dragStyleSnapshotRef.current = [style.transition, style.transform];\n }\n style.transition = 'none';\n } else if (dragStyleSnapshot) {\n [style.transition, style.transform] = dragStyleSnapshot;\n dragStyleSnapshotRef.current = null;\n }\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (swiping) {\n style.transform = getDragTransform(dragOffset, initialTransform.scale);\n }\n style.setProperty(movementCssVars.x, `${deltaX}px`);\n style.setProperty(movementCssVars.y, `${deltaY}px`);\n });\n function recordDragSample(offset, timeStamp) {\n if (timeStamp === null) {\n return;\n }\n const lastSample = lastDragSampleRef.current;\n if (lastSample && timeStamp > lastSample.time) {\n // Some Android devices emit one effectively stationary move immediately before release.\n // Keep the last moving sample and its timestamp. Repeated stationary moves still clear\n // the velocity, and a release after a hold still expires the last moving sample.\n const stationary = Math.abs(offset.x - lastSample.x) < MIN_VELOCITY_SAMPLE_DISTANCE && Math.abs(offset.y - lastSample.y) < MIN_VELOCITY_SAMPLE_DISTANCE;\n const skipSample = stationary && !hasStationarySampleRef.current;\n hasStationarySampleRef.current = stationary;\n if (skipSample) {\n return;\n }\n const durationMs = Math.max(timeStamp - lastSample.time, MIN_RELEASE_VELOCITY_DURATION_MS);\n lastDragVelocityRef.current = {\n x: (offset.x - lastSample.x) / durationMs,\n y: (offset.y - lastSample.y) / durationMs\n };\n }\n lastDragSampleRef.current = {\n x: offset.x,\n y: offset.y,\n time: timeStamp\n };\n }\n const reset = React.useCallback(() => {\n setCurrentSwipeDirection(undefined);\n setSwiping(false);\n setDragDismissed(false);\n updateSwipeProgress(0);\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = null;\n dragStartPosRef.current = {\n x: 0,\n y: 0\n };\n dragOffsetRef.current = {\n x: 0,\n y: 0\n };\n initialTransformRef.current = {\n x: 0,\n y: 0,\n scale: 1\n };\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n cancelledSwipeRef.current = false;\n swipeCancelBaselineRef.current = {\n x: 0,\n y: 0\n };\n isFirstPointerMoveRef.current = false;\n lastMovePosRef.current = null;\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = false;\n elementSizeRef.current = {\n width: 0,\n height: 0\n };\n swipeStartTimeRef.current = null;\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n lastProgressDetailsRef.current = null;\n syncDragStyles(false);\n }, [setSwiping, swipeThresholdDefault, syncDragStyles, updateSwipeProgress]);\n function getPrimaryPointerPosition(event) {\n if ('touches' in event) {\n const touch = event.touches[0];\n return touch ? {\n x: touch.clientX,\n y: touch.clientY\n } : null;\n }\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n function isTouchLikeEvent(event) {\n if ('touches' in event) {\n return true;\n }\n return event.pointerType === 'touch';\n }\n function getTargetAtPoint(position, nativeEvent) {\n const root = elementRef.current?.getRootNode();\n const elementAtPoint = getElementAtPoint(root, position.x, position.y);\n const target = elementAtPoint ?? getTarget(nativeEvent);\n return target;\n }\n function findGestureScrollableTouchTarget(target, root) {\n // The swiped element is positioned relative to the viewport, so the page scroller must not\n // gate the gesture (a reset like `html, body { height: 100%; overflow: auto }` makes `body`\n // a real scroll container). The drawer viewport's native touchmove handler already ignores it.\n const find = axis => {\n const scrollTarget = findScrollableTouchTarget(target, root, axis);\n const doc = ownerDocument(scrollTarget);\n return scrollTarget === doc.body || scrollTarget === doc.documentElement ? null : scrollTarget;\n };\n return find(scrollAxis);\n }\n function startSwipeAtPosition(event, position, startOptions) {\n swipeFromScrollableRef.current = false;\n const touchLike = isTouchLikeEvent(event);\n const target = getTargetAtPoint(position, event.nativeEvent);\n const doc = ownerDocument(elementRef.current);\n const body = doc.body;\n const scrollableTarget = touchLike && body ? findGestureScrollableTouchTarget(target, body) : null;\n const ignoreScrollableTarget = startOptions?.ignoreScrollableTarget ?? false;\n if (scrollableTarget && !ignoreScrollableTarget) {\n return false;\n }\n swipeFromScrollableRef.current = Boolean(scrollableTarget && ignoreScrollableTarget);\n const isInteractiveElement = closest(target, ignoreSelector);\n if (isInteractiveElement && (!touchLike || ignoreSelectorWhenTouch)) {\n return false;\n }\n const element = elementRef.current;\n if (ignoreScrollableAncestors && element && target) {\n const ignoreAncestors = startOptions?.ignoreScrollableAncestors ?? false;\n if (!ignoreAncestors && findScrollableAncestor(target, element, scrollAxis) != null) {\n return false;\n }\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n dragStartPosRef.current = position;\n swipeStartTimeRef.current = getValidTimeStamp(event.timeStamp);\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n lastDragVelocityRef.current = {\n x: 0,\n y: 0\n };\n swipeCancelBaselineRef.current = position;\n lastMovePosRef.current = position;\n swipeThresholdRef.current = swipeThresholdDefault;\n swipeThresholdFunctionRef.current = typeof swipeThresholdProp === 'function' ? swipeThresholdProp : null;\n if (element) {\n elementSizeRef.current = {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n resolveSwipeThreshold(primaryDirection);\n const transform = getElementTransform(element);\n initialTransformRef.current = transform;\n dragOffsetRef.current = {\n x: transform.x,\n y: transform.y\n };\n recordDragSample({\n x: transform.x,\n y: transform.y\n }, swipeStartTimeRef.current);\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'setPointerCapture');\n }\n }\n onSwipeStart?.(event.nativeEvent);\n setSwiping(true);\n isFirstPointerMoveRef.current = true;\n updateSwipeProgress(0);\n syncDragStyles(true);\n return true;\n }\n function resetPendingSwipeState() {\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n lastMovePosRef.current = null;\n }\n function clearPendingSwipeStartState() {\n pendingSwipeRef.current = false;\n pendingSwipeStartPosRef.current = null;\n }\n function cancelSwipeInteraction(event) {\n resetPendingSwipeState();\n if (!isSwipingRef.current) {\n return;\n }\n setSwiping(false);\n const resolvedInitialTransform = initialTransformRef.current;\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n sawPrimaryButtonsOnMoveRef.current = false;\n syncDragStyles(false);\n const element = elementRef.current;\n if (element) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n updateSwipeProgress(0, {\n deltaX: 0,\n deltaY: 0,\n direction: undefined\n });\n onCancel?.(event.nativeEvent);\n }\n function applyDirectionalDamping(deltaX, deltaY) {\n const exponent = value => Math.sign(value) * Math.abs(value) ** 0.5;\n const dampAxis = (delta, allowNegative, allowPositive) => {\n if (!allowNegative && delta < 0 || !allowPositive && delta > 0) {\n return exponent(delta);\n }\n return delta;\n };\n const newDeltaX = hasHorizontal ? dampAxis(deltaX, allowLeft, allowRight) : exponent(deltaX);\n const newDeltaY = hasVertical ? dampAxis(deltaY, allowUp, allowDown) : exponent(deltaY);\n return {\n x: newDeltaX,\n y: newDeltaY\n };\n }\n function canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY) {\n // Swiping toward the axis start edge (down/right) is allowed when scrolled to the start;\n // toward the end edge (up/left) when scrolled to the end.\n const canSwipeOnAxis = (delta, scrollOffset, maxScrollOffset, allowTowardStart, allowTowardEnd) => delta > 0 && scrollOffset <= 0 && allowTowardStart || delta < 0 && scrollOffset >= Math.max(0, maxScrollOffset) && allowTowardEnd;\n if (hasVertical && deltaY !== 0) {\n return canSwipeOnAxis(deltaY, scrollTarget.scrollTop, scrollTarget.scrollHeight - scrollTarget.clientHeight, allowDown, allowUp);\n }\n if (hasHorizontal && deltaX !== 0) {\n return canSwipeOnAxis(deltaX, scrollTarget.scrollLeft, scrollTarget.scrollWidth - scrollTarget.clientWidth, allowRight, allowLeft);\n }\n return null;\n }\n const handleStart = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n if (event.defaultPrevented || event.nativeEvent.defaultPrevented) {\n return;\n }\n if (!('touches' in event) && event.button !== 0) {\n return;\n }\n const startPos = getPrimaryPointerPosition(event);\n if (!startPos) {\n return;\n }\n pendingSwipeRef.current = true;\n pendingSwipeStartPosRef.current = startPos;\n swipeFromScrollableRef.current = false;\n sawPrimaryButtonsOnMoveRef.current = !('touches' in event);\n const allowedToStart = canStart ? canStart(startPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (!allowedToStart) {\n return;\n }\n if (startSwipeAtPosition(event, startPos)) {\n clearPendingSwipeStartState();\n }\n });\n function handleMoveCore(event, position, movement) {\n if (!enabled || !isSwipingRef.current) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n if (isTouchLikeEvent(event) && !swipeFromScrollableRef.current) {\n const boundaryElement = event.currentTarget;\n if (findGestureScrollableTouchTarget(target, boundaryElement)) {\n return;\n }\n }\n if (!('touches' in event)) {\n // Prevent text selection on Safari\n event.preventDefault();\n }\n if (isFirstPointerMoveRef.current) {\n isFirstPointerMoveRef.current = false;\n // Reset the drag origin to the first move's position to absorb the gap between the press and\n // the first move event — notably on iOS touch, where the first `touchmove` arrives already\n // offset from the `touchstart` — which would otherwise make the dragged element jump. This\n // only matters when an element follows the pointer; when `trackDrag` is false (e.g. the\n // swipe-area, which only opens the drawer) keep the original press position so a quick flick\n // still registers: on a low-refresh-rate display the whole travel can land in this single\n // first move, and discarding it would drop the gesture.\n if (trackDrag) {\n dragStartPosRef.current = position;\n const moveTime = getValidTimeStamp(event.timeStamp);\n if (moveTime !== null) {\n swipeStartTimeRef.current = moveTime;\n }\n lastDragSampleRef.current = null;\n hasStationarySampleRef.current = false;\n }\n }\n const clientX = position.x;\n const clientY = position.y;\n const movementX = movement.x;\n const movementY = movement.y;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate) {\n const isAllowed = candidate === 'left' && allowLeft || candidate === 'right' && allowRight || candidate === 'up' && allowUp || candidate === 'down' && allowDown;\n if (isAllowed) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n resolveSwipeThreshold(candidate);\n }\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > swipeThresholdRef.current) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(allowLeft && allowRight) && !(allowUp && allowDown) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n if (hasHorizontal) {\n newOffsetX += dampedDelta.x;\n }\n if (hasVertical) {\n newOffsetY += dampedDelta.y;\n }\n\n // Only rewrite drag styles when the drag offset actually changed. `syncDragStyles` writes the\n // raw (undamped) frozen transform and movement vars, relying on the consumer's `onProgress`\n // to overwrite them with damped styles — but `updateSwipeProgress` dedupes unchanged\n // deltas and skips `onProgress`. A move that doesn't change the offset (e.g. the cursor\n // pinned at a screen edge during an off-screen drag, jittering only on the ignored axis)\n // would otherwise reinstate the raw styles with no correction, jumping the element to the\n // undamped position.\n const previousOffset = dragOffsetRef.current;\n const offsetChanged = newOffsetX !== previousOffset.x || newOffsetY !== previousOffset.y;\n dragOffsetRef.current = {\n x: newOffsetX,\n y: newOffsetY\n };\n if (offsetChanged) {\n syncDragStyles(true);\n }\n recordDragSample({\n x: newOffsetX,\n y: newOffsetY\n }, getValidTimeStamp(event.timeStamp));\n const dragDeltaX = newOffsetX - initialTransformRef.current.x;\n const dragDeltaY = newOffsetY - initialTransformRef.current.y;\n const progressDetails = {\n deltaX: dragDeltaX,\n deltaY: dragDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n let progress = 0;\n const progressDirection = primaryDirection ?? intendedSwipeDirectionRef.current;\n if (progressDirection) {\n const size = progressDirection === 'left' || progressDirection === 'right' ? elementSizeRef.current.width : elementSizeRef.current.height;\n const scale = initialTransformRef.current.scale || 1;\n const progressDisplacement = getDisplacement(progressDirection, dragDeltaX, dragDeltaY);\n if (size > 0 && scale > 0 && progressDisplacement > 0) {\n progress = progressDisplacement / (size * scale);\n }\n }\n updateSwipeProgress(progress, progressDetails);\n }\n const handleEnd = useStableCallback(event => {\n if (!enabled) {\n return;\n }\n const resolvedDragOffset = dragOffsetRef.current;\n const resolvedInitialTransform = initialTransformRef.current;\n const releaseDeltaX = resolvedDragOffset.x - resolvedInitialTransform.x;\n const releaseDeltaY = resolvedDragOffset.y - resolvedInitialTransform.y;\n const progressDetails = {\n deltaX: releaseDeltaX,\n deltaY: releaseDeltaY,\n direction: intendedSwipeDirectionRef.current\n };\n if (!isSwipingRef.current) {\n resetPendingSwipeState();\n updateSwipeProgress(0, progressDetails);\n return;\n }\n setSwiping(false);\n resetPendingSwipeState();\n sawPrimaryButtonsOnMoveRef.current = false;\n const element = elementRef.current;\n if (element) {\n if (!('touches' in event)) {\n safelyChangePointerCapture(element, event.pointerId, 'releasePointerCapture');\n }\n }\n const deltaX = releaseDeltaX;\n const deltaY = releaseDeltaY;\n const startTime = swipeStartTimeRef.current;\n const endTime = getValidTimeStamp(event.timeStamp);\n const durationMs = startTime !== null && endTime !== null && endTime > startTime ? endTime - startTime : 0;\n const velocityDurationMs = durationMs > 0 ? Math.max(durationMs, MIN_VELOCITY_DURATION_MS) : 0;\n const velocityX = velocityDurationMs > 0 ? deltaX / velocityDurationMs : 0;\n const velocityY = velocityDurationMs > 0 ? deltaY / velocityDurationMs : 0;\n let releaseVelocityX = lastDragVelocityRef.current.x;\n let releaseVelocityY = lastDragVelocityRef.current.y;\n const lastSample = lastDragSampleRef.current;\n if (lastSample && endTime !== null && endTime >= lastSample.time) {\n const ageMs = endTime - lastSample.time;\n if (ageMs <= MAX_RELEASE_VELOCITY_AGE_MS) {\n const sampleDurationMs = Math.max(ageMs, MIN_RELEASE_VELOCITY_DURATION_MS);\n const deltaFromLastSampleX = resolvedDragOffset.x - lastSample.x;\n const deltaFromLastSampleY = resolvedDragOffset.y - lastSample.y;\n const sampleVelocityX = deltaFromLastSampleX / sampleDurationMs;\n const sampleVelocityY = deltaFromLastSampleY / sampleDurationMs;\n if (Math.abs(deltaFromLastSampleX) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityX = sampleVelocityX;\n }\n if (Math.abs(deltaFromLastSampleY) >= MIN_VELOCITY_SAMPLE_DISTANCE) {\n releaseVelocityY = sampleVelocityY;\n }\n } else {\n releaseVelocityX = 0;\n releaseVelocityY = 0;\n }\n }\n const releaseDecision = onRelease?.({\n event: event.nativeEvent,\n direction: intendedSwipeDirectionRef.current,\n deltaX,\n deltaY,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n });\n const hasReleaseDecision = typeof releaseDecision === 'boolean';\n if (cancelledSwipeRef.current && !hasReleaseDecision) {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n return;\n }\n let shouldClose = false;\n let dismissDirection;\n if (hasReleaseDecision) {\n shouldClose = releaseDecision;\n dismissDirection = intendedSwipeDirectionRef.current ?? primaryDirection;\n } else {\n for (const direction of directions) {\n if (getDisplacement(direction, deltaX, deltaY) > swipeThresholdRef.current) {\n shouldClose = true;\n dismissDirection = direction;\n break;\n }\n }\n }\n if (shouldClose && dismissDirection) {\n setCurrentSwipeDirection(dismissDirection);\n setDragDismissed(true);\n syncDragStyles(false);\n onDismiss?.(event.nativeEvent, {\n direction: dismissDirection\n });\n } else {\n dragOffsetRef.current = {\n x: resolvedInitialTransform.x,\n y: resolvedInitialTransform.y\n };\n setCurrentSwipeDirection(undefined);\n syncDragStyles(false);\n updateSwipeProgress(0, progressDetails);\n }\n });\n const handleMove = useStableCallback(event => {\n const currentPos = getPrimaryPointerPosition(event);\n if (!currentPos) {\n return;\n }\n let endAfterMove = false;\n if (!('touches' in event)) {\n const hasPrimaryButton = hasPrimaryMouseButton(event.buttons);\n if (hasPrimaryButton) {\n sawPrimaryButtonsOnMoveRef.current = true;\n }\n\n // Cancel the swipe if a non-primary button takes over the interaction.\n // This handles cases where a right-click interrupts dragging.\n if (event.buttons !== 0 && !hasPrimaryButton) {\n cancelSwipeInteraction(event);\n return;\n }\n\n // A `buttons: 0` pointermove means the primary button was already released, so the gesture is\n // over even if no pointerup reached us. On fast trackpad flicks this trailing move is\n // dispatched just before pointerup; treat it as the release (mirroring touchend) instead of\n // cancelling and snapping the element back.\n if (event.buttons === 0 && sawPrimaryButtonsOnMoveRef.current) {\n if (!isSwipingRef.current) {\n // The gesture never activated — discard it.\n handleEnd(event);\n return;\n }\n // This release move can itself carry the threshold-crossing displacement (and the peak\n // release velocity), so let it flow through `handleMoveCore` below to update the drag\n // offset / velocity sample, then commit the release afterwards.\n endAfterMove = true;\n }\n }\n if (!isSwiping && pendingSwipeRef.current) {\n if (!isTouchLikeEvent(event) && (event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n resetPendingSwipeState();\n return;\n }\n const allowedToStart = canStart ? canStart(currentPos, {\n nativeEvent: event.nativeEvent,\n direction: primaryDirection\n }) : true;\n if (allowedToStart) {\n const pendingStartPos = pendingSwipeStartPosRef.current;\n let ignoreScrollableOnStart = false;\n if (isTouchLikeEvent(event)) {\n const element = elementRef.current;\n if (pendingStartPos && element) {\n const target = getTargetAtPoint(currentPos, event.nativeEvent);\n const doc = ownerDocument(element);\n const body = doc.body;\n const scrollTarget = body ? findGestureScrollableTouchTarget(target, body) : null;\n if (scrollTarget && (contains(element, scrollTarget) || contains(scrollTarget, element))) {\n const deltaX = currentPos.x - pendingStartPos.x;\n const deltaY = currentPos.y - pendingStartPos.y;\n const canSwipeFromEdge = canSwipeFromScrollEdgeOnPendingMove(scrollTarget, deltaX, deltaY);\n if (canSwipeFromEdge === false) {\n return;\n }\n if (canSwipeFromEdge === true) {\n ignoreScrollableOnStart = true;\n }\n }\n }\n }\n const started = startSwipeAtPosition(event, currentPos, {\n ignoreScrollableTarget: ignoreScrollableOnStart,\n ignoreScrollableAncestors: ignoreScrollableOnStart\n });\n if (started) {\n if (pendingStartPos && ignoreScrollableOnStart) {\n // Preserve displacement between touchstart and the move that activates swipe from\n // a scroll-edge so quick flicks can dismiss.\n clearPendingSwipeStartState();\n dragStartPosRef.current = pendingStartPos;\n swipeCancelBaselineRef.current = pendingStartPos;\n lastMovePosRef.current = pendingStartPos;\n isFirstPointerMoveRef.current = false;\n } else {\n // Start from the current in-bounds position without dropping follow-up move\n // displacement; this avoids jumps when entering from outside the element while\n // keeping swipe tracking responsive on the next move.\n clearPendingSwipeStartState();\n swipeFromScrollableRef.current = false;\n }\n }\n }\n }\n const previousPos = lastMovePosRef.current;\n const movement = previousPos === null ? {\n x: 0,\n y: 0\n } : {\n x: currentPos.x - previousPos.x,\n y: currentPos.y - previousPos.y\n };\n lastMovePosRef.current = currentPos;\n handleMoveCore(event, currentPos, movement);\n\n // `endAfterMove` is only set in the non-touch branch above; the `'touches'` guard re-narrows the\n // event type for `handleEnd` after the shared move handling has run.\n if (endAfterMove && !('touches' in event)) {\n handleEnd(event);\n }\n });\n\n // Feeds a native touchmove into the swipe pipeline. Used by consumers that claim the gesture\n // in a capture-phase listener and stop it from reaching React's delegated touch handlers.\n const moveNative = useStableCallback((nativeEvent, currentTarget) => {\n handleMove({\n touches: nativeEvent.touches,\n currentTarget,\n nativeEvent,\n defaultPrevented: nativeEvent.defaultPrevented,\n timeStamp: nativeEvent.timeStamp\n });\n });\n const getDragStyles = React.useCallback(() => {\n // Read `isSwipingRef`, not the lagging `isSwiping` state, to match the imperative writer\n // `syncDragStyles`. Otherwise a render that commits before `setSwiping(true)` flushes strips the\n // transform it just wrote, flashing the popup to its resting position for a frame.\n const swiping = isSwipingRef.current;\n const dragOffset = dragOffsetRef.current;\n const initialTransform = initialTransformRef.current;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n if (!swiping && deltaX === 0 && deltaY === 0 && !dragDismissed) {\n return {\n [movementCssVars.x]: '0px',\n [movementCssVars.y]: '0px'\n };\n }\n return {\n transition: swiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: swiping ? getDragTransform(dragOffset, initialTransform.scale) : undefined,\n [movementCssVars.x]: `${deltaX}px`,\n [movementCssVars.y]: `${deltaY}px`\n };\n }, [dragDismissed, movementCssVars]);\n const getPointerProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onPointerDown: handleStart,\n onPointerMove: handleMove,\n onPointerUp: handleEnd,\n onPointerCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n const getTouchProps = React.useCallback(() => {\n if (!enabled) {\n return {};\n }\n return {\n onTouchStart: handleStart,\n onTouchMove: handleMove,\n onTouchEnd: handleEnd,\n onTouchCancel: handleEnd\n };\n }, [enabled, handleEnd, handleMove, handleStart]);\n return {\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection,\n dragDismissed,\n getPointerProps,\n getTouchProps,\n moveNative,\n getDragStyles,\n reset\n };\n}","/**\n * Indicates the index of the toast in the list.\n * @type {number}\n */\nexport const index = '--toast-index';\n/**\n * Indicates the vertical pixels offset of the toast in the list when expanded.\n * @type {number}\n */\nexport const offsetY = '--toast-offset-y';\n/**\n * Indicates the measured natural height of the toast in pixels.\n * @type {number}\n */\nexport const height = '--toast-height';\n/**\n * Indicates the horizontal swipe movement of the toast.\n * @type {number}\n */\nexport const swipeMovementX = '--toast-swipe-movement-x';\n/**\n * Indicates the vertical swipe movement of the toast.\n * @type {number}\n */\nexport const swipeMovementY = '--toast-swipe-movement-y';","import { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\n\n/**\n * Present when the toast is expanded in the viewport.\n * @type {boolean}\n */\nexport const expanded = 'data-expanded';\n/**\n * Present when the toast was limited because the toast limit was exceeded.\n * @type {boolean}\n */\nexport const limited = 'data-limited';\n/**\n * The type of the toast.\n * @type {string}\n */\nexport const type = 'data-type';\n/**\n * Present when the toast is being swiped.\n * @type {boolean}\n */\nexport const swiping = 'data-swiping';\n/**\n * The direction the toast was swiped.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\nexport const swipeDirection = 'data-swipe-direction';\n/**\n * Present when the toast begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n/**\n * Present when the toast is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * A container for the contents of a toast.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastContent = /*#__PURE__*/React.forwardRef(function ToastContent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n visibleIndex,\n expanded,\n recalculateHeight\n } = useToastRootContext();\n const contentRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n recalculateHeight();\n const node = contentRef.current;\n if (!node || typeof ResizeObserver !== 'function' || typeof MutationObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(() => recalculateHeight(true));\n const mutationObserver = new MutationObserver(() => recalculateHeight(true));\n resizeObserver.observe(node);\n mutationObserver.observe(node, {\n childList: true,\n subtree: true,\n characterData: true\n });\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n };\n }, [recalculateHeight]);\n const behind = visibleIndex > 0;\n const state = {\n expanded,\n behind\n };\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, contentRef],\n state,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastContent.displayName = \"ToastContent\";","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { hasRenderableChildren } from \"./isRenderableNode.mjs\";\n\n/**\n * Shared logic for `Toast.Title` and `Toast.Description`, which only differ by the rendered tag,\n * the fallback content, and which id setter they register with. Resolves the content and returns\n * the pieces each part passes to `useRenderElement` and `useToastLabelElement`.\n */\nexport function useToastLabelPart(idProp, childrenProp, part) {\n const {\n toast,\n setTitleId,\n setDescriptionId\n } = useToastRootContext();\n const setId = part === 'title' ? setTitleId : setDescriptionId;\n const children = childrenProp ?? (part === 'title' ? toast.title : toast.description);\n const id = useId(idProp);\n return {\n id,\n children,\n type: toast.type,\n setId\n };\n}\n\n/**\n * Mounts the evaluated label element only when it carries renderable content (so a `render` prop's\n * own children count, while a childless styling-only `render` stays conditional), registering the\n * generated id with the root while the part renders.\n */\nexport function useToastLabelElement(element, id, setId) {\n const shouldRender = hasRenderableChildren(element);\n useIsoLayoutEffect(() => {\n if (!shouldRender) {\n return undefined;\n }\n setId(id);\n return () => {\n setId(currentId => currentId === id ? undefined : currentId);\n };\n }, [shouldRender, id, setId]);\n return shouldRender ? element : null;\n}","import * as React from 'react';\nexport function isRenderableNode(node) {\n if (node == null || typeof node === 'boolean' || node === '') {\n return false;\n }\n if (Array.isArray(node)) {\n return node.some(isRenderableNode);\n }\n return true;\n}\nexport function hasRenderableChildren(element) {\n return /*#__PURE__*/React.isValidElement(element) && isRenderableNode(element.props.children);\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useToastLabelElement, useToastLabelPart } from \"../utils/useToastLabelPart.mjs\";\n\n/**\n * A title that labels the toast.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastTitle = /*#__PURE__*/React.forwardRef(function ToastTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n id,\n children,\n type,\n setId\n } = useToastLabelPart(idProp, childrenProp, 'title');\n const state = {\n type\n };\n const element = useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n state,\n props: {\n ...elementProps,\n id,\n children\n }\n });\n return useToastLabelElement(element, id, setId);\n});\nif (process.env.NODE_ENV !== \"production\") ToastTitle.displayName = \"ToastTitle\";","'use client';\n\nimport * as React from 'react';\nimport { useToastRootContext } from \"../root/ToastRootContext.mjs\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.mjs\";\nimport { useButton } from \"../../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * Closes the toast when clicked.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastClose = /*#__PURE__*/React.forwardRef(function ToastClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const {\n toast,\n expanded\n } = useToastRootContext();\n const [hasFocus, setHasFocus] = React.useState(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n type: toast.type\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n 'aria-hidden': !expanded && !hasFocus,\n onClick() {\n store.closeToast(toast.id);\n },\n onFocus() {\n setHasFocus(true);\n },\n onBlur() {\n setHasFocus(false);\n }\n }, elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastClose.displayName = \"ToastClose\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortalLite } from \"../../utils/FloatingPortalLite.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A portal element that moves the viewport to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastPortal = /*#__PURE__*/React.forwardRef(function ToastPortal(props, forwardedRef) {\n return /*#__PURE__*/_jsx(FloatingPortalLite, {\n ref: forwardedRef,\n ...props\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastPortal.displayName = \"ToastPortal\";","'use client';\n\nimport * as React from 'react';\nimport { useToastProviderContext } from \"./provider/ToastProviderContext.mjs\";\n/**\n * Returns the array of toasts and methods to manage them.\n */\nexport function useToastManager() {\n const store = useToastProviderContext();\n const toasts = store.useState('toasts');\n return React.useMemo(() => ({\n toasts,\n add: store.addToast,\n close: store.closeToast,\n update: store.updateToast,\n promise: store.promiseToast\n }), [toasts, store]);\n}","/* __next_internal_action_entry_do_not_use__ [{\"40dad6e23692304530c149129641a4a94433905443\":{\"name\":\"setPartyScopes\"}},\"web/features/outside-party/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"40dad6e23692304530c149129641a4a94433905443\",callServer,void 0,findSourceMapURL,\"setPartyScopes\");export{$$RSC_SERVER_ACTION_1 as setPartyScopes};","/** What the tools table says once a change is kept (gateway scopes 4.3), in a Toast. */\nimport type { ScopeChange } from './scope-change';\n\nfunction listOf(scopes: readonly string[]): string {\n return scopes.length <= 1 ? scopes.join('') : `${scopes.slice(0, -1).join(', ')} and ${scopes.at(-1) ?? ''}`;\n}\n\nfunction toolsOf(count: number): string {\n return `${String(count)} ${count === 1 ? 'tool' : 'tools'}`;\n}\n\n/** The change, and why the fleet sees it only at the proxy ship's next statement when it does. */\nexport function statedMessage(message: string, statementRefusal: string | null): string {\n return statementRefusal === null ? message : `${message}; the fleet sees it at the proxy ship's next statement: ${statementRefusal}`;\n}\n\nexport function scopesSetMessage({ scopes, how, count }: { scopes: readonly string[]; how: ScopeChange; count: number }): string {\n if (how === 'remove') {\n return `${listOf(scopes)} removed from ${toolsOf(count)}`;\n }\n if (scopes.length === 0) {\n return `${toolsOf(count)} need${count === 1 ? 's' : ''} nothing of ${count === 1 ? 'its' : 'their'} own`;\n }\n return `${listOf(scopes)} set on ${toolsOf(count)}`;\n}\n\nexport function partyScopesSetMessage({ party, scopes }: { party: string; scopes: readonly string[] }): string {\n return scopes.length === 0 ? `Every tool of ${party} needs nothing beyond reaching it` : `Every tool of ${party} needs ${listOf(scopes)}`;\n}\n\nexport function suggestionsSetMessage(groups: readonly { scopes: readonly string[]; count: number }[]): string {\n return groups.map(({ scopes, count }) => `${listOf(scopes)} set on ${toolsOf(count)}`).join('; ');\n}\n\nexport function toolsSwitchedMessage({ count, isOn, statementRefusal }: { count: number; isOn: boolean; statementRefusal: string | null }): string {\n return statedMessage(`${toolsOf(count)} switched ${isOn ? 'on' : 'off'}`, statementRefusal);\n}\n\nexport function agentScopesSetMessage({ party, scopes }: { party: string; scopes: readonly string[] }): string {\n return scopes.length === 0 ? `Every message to ${party} needs nothing beyond reaching it` : `Every message to ${party} needs ${listOf(scopes)}`;\n}\n","/** A scope the fleet lists, with its one-line description, as an approver picks it. */\nexport interface ListedScope {\n scope: string;\n description: string;\n}\n\nconst CHIP = 'inline-flex items-center rounded-md border px-2 font-mono text-caption';\n\n/**\n * What a call needs, as chips (gateway scopes 4.3): the party's set muted, a\n * tool's own plain. A scope the fleet no longer lists is marked so: no ship\n * holds it, so every call needing it is refused until it is changed.\n */\nexport function NeedsChips({ party = [], own, listed }: { party?: readonly string[]; own: readonly string[]; listed: ReadonlySet<string> | null }) {\n if (party.length === 0 && own.length === 0) {\n return <span className=\"text-muted-foreground\">Nothing</span>;\n }\n const chip = (scope: string, isParty: boolean) => {\n const isGone = listed !== null && !listed.has(scope);\n const look = isGone ? 'border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg' : isParty ? 'border-transparent bg-muted text-muted-foreground' : 'border-border';\n return (\n <span key={`${isParty ? 'party' : 'own'}-${scope}`} className={`${CHIP} ${look}`} data-testid={isParty ? 'tools-table-party-scope' : 'tools-table-scope'} title={isGone ? 'No longer defined in the fleet' : isParty ? 'Every tool needs it' : undefined}>\n {scope}\n {isGone ? <span className=\"ml-1 font-sans\">(no longer defined)</span> : null}\n </span>\n );\n };\n return (\n <span className=\"flex flex-wrap gap-1\">\n {party.map((scope) => chip(scope, true))}\n {own.filter((scope) => !party.includes(scope)).map((scope) => chip(scope, false))}\n </span>\n );\n}\n","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { getOverflowAncestors, useDismiss, useFloatingRootContext, useListNavigation, useClick } from \"../../floating-ui-react/index.mjs\";\nimport { gridNavigation } from \"../../floating-ui-react/hooks/gridNavigation.mjs\";\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails, createGenericEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getHighlightReason } from \"../../utils/getHighlightReason.mjs\";\nimport { ComboboxFloatingContext, ComboboxDerivedItemsContext, ComboboxHasItemsContext, ComboboxRootContext, ComboboxInputValueContext } from \"./ComboboxRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { attachPreventUnmountOnClose } from \"../../utils/popups/popupStoreUtils.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { createCollatorItemFilter } from \"./utils/index.mjs\";\nimport { useCoreFilter } from \"./utils/useFilter.mjs\";\nimport { useUnmountAfterClose } from \"../../internals/useUnmountAfterClose.mjs\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.mjs\";\nimport { isScrollableY } from \"../../utils/scrollable.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\nimport { NOOP } from \"../../internals/noop.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { stringifyAsLabel, stringifyAsValue, flattenLeafItems, isGroupedItems } from \"../../internals/resolveValueLabel.mjs\";\nimport { compareItemEquality, defaultItemEquality, findItemIndex, findSelectionIndex, isSelectedValueDirty, removeItem, selectedValueIncludes } from \"../../internals/itemEquality.mjs\";\nimport { INITIAL_LAST_HIGHLIGHT, NO_ACTIVE_VALUE } from \"./utils/constants.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { findCollectionItem } from \"../items/itemCollection.mjs\";\n\n/**\n * @internal\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function AriaCombobox(props) {\n const {\n id: idProp,\n onOpenChangeComplete: onOpenChangeCompleteProp,\n defaultSelectedValue = null,\n selectedValue: selectedValueProp,\n onSelectedValueChange,\n defaultInputValue,\n inputValue: inputValueProp,\n open: openProp,\n defaultOpen = false,\n selectionMode,\n onItemHighlighted: onItemHighlightedProp,\n name: nameProp,\n form,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n inputRef: inputRefProp,\n grid = false,\n items: itemsProp,\n filteredItems: filteredItemsProp,\n filter: filterProp,\n filterQuery: filterQueryProp,\n openOnInputClick = true,\n autoHighlight = false,\n keepHighlight = false,\n highlightItemOnHover = true,\n loopFocus = true,\n itemToStringLabel: itemToStringLabelProp,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n virtualized = false,\n inline: inlineProp = false,\n fillInputOnItemPress = true,\n modal = false,\n limit = -1,\n autoComplete = 'list',\n formAutoComplete,\n locale,\n submitOnItemClick = false\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n validityData,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const direction = useDirection();\n const id = useLabelableId({\n id: idProp\n });\n const collatorFilter = useCoreFilter({\n locale\n });\n\n // Plain items are arrays; normalized `createItems()` collections are objects.\n const collection = Array.isArray(itemsProp) ? null : itemsProp;\n if (collection && typeof collection.label !== 'function') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: the `items` prop received an object that is not a collection, ' + 'so its items cannot be read. Pass an array of items, an array of groups with items, ' + 'or the result of `createItems()`. ' + 'See https://base-ui.com/react/components/combobox#createitems' : _formatErrorMessage(100));\n }\n const items = collection ? collection.data : itemsProp;\n const itemToValue = collection?.value;\n\n // A projected collection's items live in the source domain, not the selection-value domain the\n // store matches against, so they are withheld from the store.\n const storeItems = itemToValue ? undefined : items;\n\n // The externally filtered items projected to their selection values, with a lookup back to the\n // source items. Declared before `itemToStringLabel`, which resolves labels from it on the\n // first render (initial input value).\n const externalWindow = React.useMemo(() => {\n if (!filteredItemsProp || !itemToValue) {\n return undefined;\n }\n const flat = flattenLeafItems(filteredItemsProp);\n const values = flat.map(itemToValue);\n let valueToItem;\n return {\n values,\n findItem(itemValue, isEqual) {\n if (!valueToItem) {\n valueToItem = new Map();\n for (let i = 0; i < values.length; i += 1) {\n if (!valueToItem.has(values[i])) {\n valueToItem.set(values[i], flat[i]);\n }\n }\n }\n return findCollectionItem(valueToItem, itemValue, isEqual);\n }\n };\n }, [filteredItemsProp, itemToValue]);\n\n // Labels selection values from current props only: collection data first, then the current\n // external window, then the prop. Nothing from a past window is remembered — keeping a value\n // resolvable over time means keeping its item in the collection's data.\n const itemToStringLabel = React.useMemo(() => {\n if (!collection) {\n return itemToStringLabelProp;\n }\n return itemValue => {\n return collection.label(itemValue, isItemEqualToValue, unresolvedValue => {\n const externalItem = externalWindow?.findItem(unresolvedValue, isItemEqualToValue);\n if (externalItem != null) {\n return collection.itemLabel(externalItem);\n }\n return stringifyAsLabel(unresolvedValue, itemToStringLabelProp);\n });\n };\n }, [collection, itemToStringLabelProp, externalWindow, isItemEqualToValue]);\n const filterItemToString = React.useMemo(() => {\n if (!collection) {\n return itemToStringLabelProp;\n }\n return Object.assign(item => collection.itemLabel(item), {\n selected: value => stringifyAsLabel(value, itemToStringLabel)\n });\n }, [collection, itemToStringLabel, itemToStringLabelProp]);\n function stringifyValueLabel(item) {\n return stringifyAsLabel(item, itemToStringLabel);\n }\n const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React.useState(false);\n const [closeQuery, setCloseQuery] = React.useState(null);\n const previousCloseQueryRef = React.useRef(closeQuery);\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const inputRef = React.useRef(null);\n const startDismissRef = React.useRef(null);\n const endDismissRef = React.useRef(null);\n const emptyRef = React.useRef(null);\n const hadInputClearRef = React.useRef(false);\n const chipsContainerRef = React.useRef(null);\n const clearRef = React.useRef(null);\n const selectionEventRef = React.useRef(null);\n const lastHighlightRef = React.useRef(INITIAL_LAST_HIGHLIGHT);\n const pendingQueryHighlightRef = React.useRef(null);\n\n /**\n * Contains the currently visible list of item values post-filtering.\n */\n const valuesRef = React.useRef([]);\n /**\n * The item element that received the last `pointerdown`, used to detect whether a\n * `mouseup` on an item belongs to a drag-select gesture that started elsewhere.\n */\n const pointerDownItemRef = React.useRef(null);\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const multiple = selectionMode === 'multiple';\n const single = selectionMode === 'single';\n const hasInputValue = inputValueProp !== undefined || defaultInputValue !== undefined;\n const hasItems = items !== undefined;\n const hasFilteredItemsProp = filteredItemsProp !== undefined;\n let autoHighlightMode;\n if (autoHighlight === 'always') {\n autoHighlightMode = 'always';\n } else {\n autoHighlightMode = autoHighlight ? 'input-change' : false;\n }\n const [selectedValue, setSelectedValueUnwrapped] = useControlled({\n controlled: selectedValueProp,\n default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue,\n name: 'Combobox',\n state: 'selectedValue'\n });\n const filter = React.useMemo(() => {\n if (filterProp === null) {\n return () => true;\n }\n if (filterProp !== undefined) {\n return filterProp;\n }\n // `shouldBypassFiltering` already empties the query whenever a single selection's label\n // matches it exactly, so the filter never needs a selection-aware variant here.\n return createCollatorItemFilter(collatorFilter, filterItemToString);\n }, [filterProp, collatorFilter, filterItemToString]);\n\n // If neither inputValue nor defaultInputValue are provided, derive it from the\n // selected value for single mode so the input reflects the selection on mount.\n const initialDefaultInputValue = useRefWithInit(() => {\n if (hasInputValue) {\n return defaultInputValue ?? '';\n }\n if (single) {\n return stringifyValueLabel(selectedValue);\n }\n return '';\n }).current;\n const [inputValue, setInputValueUnwrapped] = useControlled({\n controlled: inputValueProp,\n default: initialDefaultInputValue,\n name: 'Combobox',\n state: 'inputValue'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Combobox',\n state: 'open'\n });\n const isGrouped = isGroupedItems(items);\n const query = !open && closeQuery !== null ? closeQuery : String(inputValue).trim();\n const selectedLabelString = single ? stringifyValueLabel(selectedValue) : '';\n const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== '' && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);\n const filterQuery = shouldBypassFiltering ? '' : filterQueryProp ?? query;\n const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering && (!collection || collection.hasValue(selectedValue, isItemEqualToValue));\n const flatItems = React.useMemo(() => items ? flattenLeafItems(items) : EMPTY_ARRAY, [items]);\n const filteredItems = React.useMemo(() => {\n if (filteredItemsProp && !shouldIgnoreExternalFiltering) {\n return filteredItemsProp;\n }\n if (!items) {\n return EMPTY_ARRAY;\n }\n if (isGrouped) {\n const groupedItems = items;\n const resultingGroups = [];\n let currentCount = 0;\n for (const group of groupedItems) {\n if (limit > -1 && currentCount >= limit) {\n break;\n }\n const remainingLimit = limit > -1 ? limit - currentCount : Infinity;\n const itemsToTake = filterQuery === '' ? group.items.slice(0, remainingLimit) : [];\n if (filterQuery !== '') {\n for (const item of group.items) {\n if (itemsToTake.length >= remainingLimit) {\n break;\n }\n if (filter(item, filterQuery, filterItemToString)) {\n itemsToTake.push(item);\n }\n }\n }\n if (itemsToTake.length > 0) {\n const newGroup = {\n ...group,\n items: itemsToTake\n };\n resultingGroups.push(newGroup);\n currentCount += itemsToTake.length;\n }\n }\n return resultingGroups;\n }\n if (filterQuery === '') {\n return limit > -1 ? flatItems.slice(0, limit) :\n // The cast here is done as `flatItems` is readonly.\n // valuesRef.current, a mutable ref, can be set to `flatFilteredValues`, which may\n // reference this exact readonly value, creating a mutation risk.\n // However, <Combobox.Item> can never mutate this value as the mutating effect\n // bails early when `items` is provided, and this is only ever returned\n // when `items` is provided due to the early return at the top of this hook.\n flatItems;\n }\n const limitedItems = [];\n for (const item of flatItems) {\n if (limit > -1 && limitedItems.length >= limit) {\n break;\n }\n if (filter(item, filterQuery, filterItemToString)) {\n limitedItems.push(item);\n }\n }\n return limitedItems;\n }, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter, filterItemToString, flatItems]);\n\n /**\n * The filtered items flattened across groups and projected to their selection values.\n */\n const flatFilteredValues = React.useMemo(() => {\n if (externalWindow && filteredItems === filteredItemsProp) {\n return externalWindow.values;\n }\n // Explicit type argument: inferring it from a union of both shapes resolves `Item` to\n // `Group<Item>`, which tsc rejects and tsgo does not.\n const flat = flattenLeafItems(filteredItems);\n return itemToValue ? flat.map(item => itemToValue(item)) : flat;\n }, [filteredItems, filteredItemsProp, externalWindow, itemToValue]);\n const store = useRefWithInit(() => {\n // An inline list open on the first render never gets a closed pass of the closed-state\n // sync effect below, and `items`-prop lists don't self-register their index the way\n // individually rendered `<Combobox.Item>`s do, so the selected item was never highlighted.\n // Seeding the index here lets list navigation highlight and scroll to the selection on\n // mount. Computed once by construction, so a selection or list that resolves after mount\n // doesn't move an existing highlight or scroll the list away.\n let initialSelectedIndex = null;\n if (inlineProp && open && hasItems && selectionMode !== 'none') {\n initialSelectedIndex = findSelectionIndex(flatFilteredValues, selectedValue, isItemEqualToValue, multiple);\n }\n return new ReactStore({\n id,\n labelId: undefined,\n selectedValue,\n open,\n items: storeItems,\n selectionMode,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n virtualized,\n openOnInputClick,\n itemToStringLabel,\n isItemEqualToValue,\n modal,\n autoHighlight: autoHighlightMode,\n submitOnItemClick,\n hasInputValue,\n mounted: false,\n forceMounted: false,\n transitionStatus: 'idle',\n inline: inlineProp,\n activeIndex: null,\n selectedIndex: initialSelectedIndex,\n popupProps: {},\n listProps: {},\n inputProps: {},\n triggerProps: {},\n itemRoot: {\n props: EMPTY_OBJECT,\n id,\n selectionMode,\n disabled,\n readOnly,\n isItemEqualToValue\n },\n positionerElement: null,\n listElement: null,\n popupId: undefined,\n triggerElement: null,\n inputElement: null,\n inputGroupElement: null,\n popupSide: null,\n openMethod: null,\n inputInsidePopup: true,\n // Avoid duplicate names in the server HTML. Popup inputs aren't rendered\n // until after hydration, so the hidden input takes over then if needed.\n inputOwnsFormValue: selectionMode === 'none'\n }, {\n // Placeholder callbacks replaced on first render\n onOpenChangeComplete: NOOP,\n setOpen: NOOP,\n setInputValue: NOOP,\n setSelectedValue: NOOP,\n setIndices: NOOP,\n handleSelection: NOOP,\n forceMount: NOOP,\n requestSubmit: NOOP,\n listRef,\n labelsRef,\n popupRef,\n emptyRef,\n inputRef,\n startDismissRef,\n endDismissRef,\n chipsContainerRef,\n clearRef,\n valuesRef,\n pointerDownItemRef,\n selectionEventRef\n }, selectors);\n }).current;\n const fieldRawValue = selectionMode === 'none' ? inputValue : selectedValue;\n const fieldStringValue = React.useMemo(() => {\n if (selectionMode === 'none') {\n return fieldRawValue;\n }\n if (Array.isArray(selectedValue)) {\n return selectedValue.map(value => stringifyAsValue(value, itemToStringValue));\n }\n return stringifyAsValue(selectedValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue, selectionMode, selectedValue]);\n const onItemHighlighted = useStableCallback(onItemHighlightedProp);\n const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);\n const activeIndex = store.useState('activeIndex');\n const selectedIndex = store.useState('selectedIndex');\n const positionerElement = store.useState('positionerElement');\n const listElement = store.useState('listElement');\n const triggerElement = store.useState('triggerElement');\n const inputElement = store.useState('inputElement');\n const inputGroupElement = store.useState('inputGroupElement');\n const inline = store.useState('inline');\n const inputInsidePopup = store.useState('inputInsidePopup');\n const inputOwnsFormValue = store.useState('inputOwnsFormValue');\n const inputMatchesSelectedValue = single && !inputInsidePopup && inputValue === selectedLabelString;\n const triggerRef = useValueAsRef(triggerElement);\n const {\n openMethod,\n triggerProps\n } = useOpenInteractionType(open);\n const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled, nameProp);\n const forceMount = useStableCallback(() => {\n if (items) {\n // Ensure typeahead works on a closed list.\n labelsRef.current = flatFilteredValues.map(stringifyValueLabel);\n } else {\n store.set('forceMounted', true);\n }\n });\n\n /**\n * Emits `onItemHighlighted` for the item at `index`, or clears the highlight when `index` is `-1`\n * (a no-op if nothing was highlighted). Keeps `lastHighlightRef` in sync with what was emitted.\n */\n const emitHighlight = useStableCallback((value, index, type, event) => {\n if (index === -1) {\n if (lastHighlightRef.current === INITIAL_LAST_HIGHLIGHT) {\n return;\n }\n lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;\n } else {\n lastHighlightRef.current = {\n value,\n index\n };\n }\n onItemHighlighted(value, createGenericEventDetails(type, event, {\n index\n }));\n });\n const setIndices = useStableCallback(options => {\n const update = {};\n if (options.activeIndex !== undefined) {\n update.activeIndex = options.activeIndex;\n }\n if (options.selectedIndex !== undefined) {\n update.selectedIndex = options.selectedIndex;\n }\n store.update(update);\n const activeIndexOption = options.activeIndex;\n if (activeIndexOption === undefined) {\n return;\n }\n const type = options.type || REASONS.none;\n if (activeIndexOption === null) {\n emitHighlight(undefined, -1, type, options.event);\n } else {\n emitHighlight(valuesRef.current[activeIndexOption], activeIndexOption, type, options.event);\n }\n });\n const setInputValue = useStableCallback((next, eventDetails) => {\n props.onInputValueChange?.(next, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n\n // A canceled selection clear must not suppress close-completion cleanup.\n hadInputClearRef.current = eventDetails.reason === REASONS.inputClear;\n\n // If user is typing, ensure we don't auto-highlight on open due to a race\n // with the post-open effect that sets this flag.\n if (eventDetails.reason === REASONS.inputChange) {\n // A controlled popup may ignore a close request. Resuming input proves the popup\n // is remaining open, so release the query captured for an exit animation.\n if (open && closeQuery !== null) {\n setCloseQuery(null);\n }\n const event = eventDetails.event;\n const inputType = event.inputType;\n // Treat composition commits as typed input; autofill may omit `inputType` or\n // report `insertReplacementText`.\n const isTypedInput = event.type === 'compositionend' || inputType != null && inputType !== '' && inputType !== 'insertReplacementText';\n if (isTypedInput) {\n const hasQuery = next.trim() !== '';\n if (hasQuery) {\n setQueryChangedAfterOpen(true);\n }\n // Defer index updates until after the filtered items have been derived to ensure\n // `onItemHighlighted` receives the latest item.\n pendingQueryHighlightRef.current = {\n hasQuery\n };\n\n // Virtualized lists own their scroller. Reset regular lists directly so a stale\n // composite registry cannot select a reordered item and scrolling cannot escape\n // the popup.\n const list = store.state.listElement;\n if (!store.state.virtualized && list) {\n const popup = popupRef.current;\n for (const ancestor of getOverflowAncestors(list.firstElementChild ?? list)) {\n if (!isHTMLElement(ancestor) || (popup ? !contains(popup, ancestor) : ancestor.getAttribute('role') === 'dialog')) {\n break;\n }\n if (isScrollableY(ancestor)) {\n ancestor.scrollTop = 0;\n break;\n }\n }\n }\n if (hasQuery && autoHighlightMode && store.state.activeIndex == null && (open || inline)) {\n store.set('activeIndex', 0);\n }\n }\n } else if (eventDetails.reason === REASONS.inputClear && next === '' && store.state.inputInsidePopup) {\n // A programmatic clear of an active query (e.g. after selecting an item with the\n // input inside the popup): restore the highlight to the selected item.\n pendingQueryHighlightRef.current = {\n hasQuery: false,\n selection: true\n };\n }\n setInputValueUnwrapped(next);\n });\n const handleInterruptedReopen = useStableCallback(isInputChange => {\n // Preserve values supplied with the reopen rather than owned by the interrupted close.\n const clearsPendingInput = !isInputChange && inputInsidePopup && !inline && inputValue !== '' && (String(inputValue).trim() === closeQuery || inputValue === selectedLabelString);\n\n // Keep the flag while a visible filter survives so the `items` sync cannot overwrite it.\n if (!isInputChange && (clearsPendingInput || inputValue === '' || inputMatchesSelectedValue)) {\n setQueryChangedAfterOpen(false);\n }\n setCloseQuery(null);\n if (clearsPendingInput) {\n // Cleanup clears omit the selection flag and reopening gesture.\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n });\n const [preventUnmountOnClose, setPreventUnmountOnClose] = React.useState(false);\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n if (open === nextOpen) {\n return;\n }\n\n // If the `Empty` component is not used, the positioner or popup should be hidden\n // with CSS. In this case, allow the Escape key to bubble to close a parent popup\n // if there are no items to show.\n if (eventDetails.reason === REASONS.escapeKey && hasItems && flatFilteredValues.length === 0 && !emptyRef.current) {\n eventDetails.allowPropagation();\n }\n const openEventDetails = eventDetails;\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(openEventDetails);\n props.onOpenChange?.(nextOpen, openEventDetails);\n\n // A typed request must not highlight a later open: discard it when its own open is\n // rejected, or when any other open change goes through.\n if (pendingQueryHighlightRef.current?.hasQuery && eventDetails.reason === REASONS.inputChange === eventDetails.isCanceled) {\n pendingQueryHighlightRef.current = null;\n }\n if (eventDetails.isCanceled) {\n return;\n }\n if (nextOpen && closeQuery !== null) {\n // `ComboboxInput` calls `setInputValue` before `setOpen`, so on an input-change reopen\n // `inputValue` is still the pre-keystroke value and the typed filter always survives.\n handleInterruptedReopen(eventDetails.reason === REASONS.inputChange);\n }\n if (!nextOpen && queryChangedAfterOpen) {\n if (single) {\n if (!inline) {\n setCloseQuery(query);\n }\n // Avoid a flicker when closing the popup with an empty query.\n if (query === '') {\n setQueryChangedAfterOpen(false);\n }\n } else if (multiple) {\n if (!inline) {\n // Freeze the current query so filtering remains stable while exiting.\n setCloseQuery(query);\n }\n if (inputInsidePopup) {\n setIndices({\n activeIndex: null\n });\n }\n\n // Clear the input immediately on close while retaining filtering via closeQuery for exit animations\n // if the input is outside the popup. When the input is inside the popup, defer the clear until\n // unmount so the filtered list doesn't flash to unfiltered during the exit animation.\n if (!inputInsidePopup || inline) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event, undefined, {\n isItemPress: eventDetails.reason === REASONS.itemPress\n }));\n }\n }\n }\n if (!nextOpen) {\n setPreventUnmountOnClose(shouldPreventUnmountOnClose());\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && inputInsidePopup && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n }\n });\n const setSelectedValue = useStableCallback((nextValue, eventDetails) => {\n // Cast to `any` due to conditional value type (single vs. multiple).\n // The runtime implementation already ensures the correct value shape.\n onSelectedValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setSelectedValueUnwrapped(nextValue);\n const shouldFillInput = selectionMode === 'none' && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup;\n if (shouldFillInput) {\n setInputValue(stringifyValueLabel(nextValue), createChangeEventDetails(eventDetails.reason, eventDetails.event));\n }\n });\n const handleSelection = useStableCallback((event, itemValue) => {\n const targetEl = getTarget(event);\n const overrideEvent = selectionEventRef.current ?? event;\n selectionEventRef.current = null;\n const eventDetails = createChangeEventDetails(REASONS.itemPress, overrideEvent);\n\n // Let the link handle the click.\n const href = closest(targetEl, 'a')?.getAttribute('href');\n if (href) {\n if (href.startsWith('#')) {\n setOpen(false, eventDetails);\n }\n return;\n }\n if (multiple) {\n const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];\n const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, isItemEqualToValue);\n const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, isItemEqualToValue) : [...currentSelectedValue, itemValue];\n setSelectedValue(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n const wasFiltering = inputRef.current ? inputRef.current.value.trim() !== '' : false;\n if (!wasFiltering) {\n return;\n }\n if (store.state.inputInsidePopup) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event, undefined, {\n isItemPress: true\n }));\n // A newly selected item stays highlighted through the clear; a deselection\n // falls back to the standard selection anchor.\n const pendingHighlight = pendingQueryHighlightRef.current;\n if (pendingHighlight && !isCurrentlySelected) {\n pendingHighlight.toggledValue = itemValue;\n }\n } else {\n setOpen(false, eventDetails);\n }\n } else {\n setSelectedValue(itemValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpen(false, eventDetails);\n }\n });\n const requestSubmit = useStableCallback(() => {\n const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;\n if (formElement && typeof formElement.requestSubmit === 'function') {\n formElement.requestSubmit();\n }\n });\n const handleUnmountCleanup = useStableCallback(() => {\n onOpenChangeComplete?.(false);\n setQueryChangedAfterOpen(false);\n setCloseQuery(null);\n if (selectionMode === 'none') {\n setIndices({\n activeIndex: null,\n selectedIndex: null\n });\n } else {\n setIndices({\n activeIndex: null\n });\n }\n\n // Multiple selection mode:\n // If the user typed a filter and didn't select in multiple mode, clear the input\n // after close completes to avoid mid-exit flicker and start fresh on next open.\n if (multiple && inputRef.current && inputRef.current.value !== '' && !hadInputClearRef.current) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n\n // Single selection mode:\n // - If input is rendered inside the popup, clear it so the next open is blank\n // - If input is outside the popup, sync it to the selected value\n if (single) {\n if (store.state.inputInsidePopup) {\n if (inputRef.current && inputRef.current.value !== '') {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n } else {\n const stringVal = stringifyValueLabel(selectedValue);\n if (inputRef.current && inputRef.current.value !== stringVal) {\n // If no selection was made, treat this as clearing the typed filter.\n const reason = stringVal === '' ? REASONS.inputClear : REASONS.none;\n setInputValue(stringVal, createChangeEventDetails(reason));\n }\n }\n }\n });\n\n // Support composing the Dialog component around an inline combobox.\n // `[role=\"dialog\"]` is more interoperable than using a context, e.g. it can work\n // with third-party modal libraries, though the limitation is that the closest\n // `role=dialog` part must be the animated element.\n const resolvedPopupRef = React.useMemo(() => {\n if (inline && positionerElement) {\n return {\n current: closest(positionerElement, '[role=\"dialog\"]')\n };\n }\n return popupRef;\n }, [inline, positionerElement]);\n const {\n mounted,\n transitionStatus,\n forceUnmount: handleUnmount\n } = useUnmountAfterClose({\n open,\n ref: resolvedPopupRef,\n preventUnmountOnClose,\n setPreventUnmountOnClose,\n onUnmount: handleUnmountCleanup\n });\n React.useImperativeHandle(props.actionsRef, () => ({\n unmount: handleUnmount,\n close: () => setOpen(false, createChangeEventDetails(REASONS.imperativeAction))\n }), [handleUnmount, setOpen]);\n useIsoLayoutEffect(function syncSelectedIndex() {\n const closeQueryReleased = previousCloseQueryRef.current !== null && closeQuery === null;\n previousCloseQueryRef.current = closeQuery;\n\n // Closing indexes against the frozen filtered list. Reopening releases that query, so its\n // rendered coordinates must be synchronized again even though the popup is already open.\n if (open && (!closeQueryReleased || !hasItems)) {\n return;\n }\n\n // State-driven (not tied to the internal event path) so controlled closes\n // also clear a pointerdown that never received a matching item mouseup.\n if (!open) {\n pointerDownItemRef.current = null;\n }\n if (selectionMode === 'none') {\n return;\n }\n\n // Without `items`, look the selection up in the live registry of mounted item\n // values (the list stays mounted while closed when closed-state features need\n // it — trigger interaction and rendered-label autofill force-mount it). Mounted\n // items re-assert the index themselves when their registration moves; when\n // nothing is mounted the lookup resolves to `null` and each item re-registers\n // the index on the next open.\n // Keep the selected index in the coordinates of the list that is actually rendered.\n const registry = hasItems ? flatFilteredValues : valuesRef.current;\n setIndices({\n selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple)\n });\n }, [open, closeQuery, selectedValue, selectionMode, multiple, hasItems, flatFilteredValues, isItemEqualToValue, setIndices]);\n useIsoLayoutEffect(() => {\n if (items) {\n valuesRef.current = flatFilteredValues;\n listRef.current.length = flatFilteredValues.length;\n }\n }, [items, flatFilteredValues]);\n useIsoLayoutEffect(() => {\n // Controlled closes can bypass `setOpen`, and their exit animation may be interrupted.\n if (!open && pendingQueryHighlightRef.current?.hasQuery) {\n pendingQueryHighlightRef.current = null;\n }\n }, [open]);\n useIsoLayoutEffect(() => {\n // A kept-mounted dialog hides its inline list on close. Discard query-clear restoration\n // before it can overwrite the cleared highlight or report an item from the unfiltered list.\n if (!open && inline && resolvedPopupRef.current) {\n pendingQueryHighlightRef.current = null;\n return;\n }\n const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;\n const pendingHighlight = pendingQueryHighlightRef.current;\n if (pendingHighlight) {\n // A directly rendered list remains visible when the popup state is closed, while a\n // kept-mounted Positioner is hidden and should stay inert.\n const listIsNavigable = open || inline || store.state.positionerElement?.hidden === false;\n if (pendingHighlight.hasQuery) {\n const input = inputRef.current;\n // Keep the request while results or a controlled popup opening are pending,\n // but do not restore an inline highlight after focus has left the input.\n if (!autoHighlightMode || String(inputValue).trim() === '' || inline && autoHighlightMode !== 'always' && (!input || activeElement(input.ownerDocument) !== input)) {\n pendingQueryHighlightRef.current = null;\n } else if (listIsNavigable && (\n // Individually rendered items register without re-running this effect, and their\n // registry has holes mid-reindex, so resolve their request immediately.\n candidateItems[0] !== undefined || !hasItems && !hasFilteredItemsProp)) {\n store.set('activeIndex', 0);\n pendingQueryHighlightRef.current = null;\n }\n } else if (String(inputValue).trim() === '') {\n // Only handle the clear once it has committed (a controlled input may reject it),\n // so a restore cannot fire while a query is still active.\n pendingQueryHighlightRef.current = null;\n if (listIsNavigable) {\n const clearedBySelection = pendingHighlight.selection;\n if (autoHighlightMode === 'always' && !clearedBySelection && store.state.selectionMode === 'none') {\n // There is no selection to restore in Autocomplete. Keep the first-item reset\n // synchronous so list navigation sees it before a directly rendered list closes.\n store.set('activeIndex', 0);\n }\n\n // Items re-mounted by the clear publish their composite indices in a follow-up\n // commit, so the item registries are mid-update here. Defer past React's cascade.\n queueMicrotask(() => {\n if (!store.state.open && (!store.state.inline || resolvedPopupRef.current) || inputRef.current && inputRef.current.value.trim() !== '') {\n return;\n }\n\n // Return the highlight to the selected item, the same anchor the popup uses\n // when it first opens. Read the selection through the store so consumers can\n // pass an inline `isItemEqualToValue` or a fresh `selectedValue` array without\n // re-running this effect on every render.\n const currentSelectedValue = store.state.selectedValue;\n const isMultiple = store.state.selectionMode === 'multiple';\n const hasSelection = isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue.length > 0 : store.state.selectionMode !== 'none' && currentSelectedValue != null;\n if (hasSelection) {\n const registry = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;\n // A selection-driven clear keeps the just-selected item highlighted;\n // otherwise return to the open anchor. A selection that is no longer in\n // the list drops the highlight rather than leaving it on whichever item\n // now occupies that index.\n // `findItemIndex` resolves to -1 when no value was toggled.\n const toggledIndex = findItemIndex(registry, pendingHighlight.toggledValue, store.state.isItemEqualToValue);\n store.set('activeIndex', toggledIndex !== -1 ? toggledIndex : findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple));\n } else if (clearedBySelection) {\n store.set('activeIndex', null);\n } else if (autoHighlightMode === 'always') {\n store.set('activeIndex', 0);\n }\n });\n }\n }\n }\n if (!open && !inline) {\n return;\n }\n const storeActiveIndex = store.state.activeIndex;\n if (storeActiveIndex == null) {\n if (autoHighlightMode === 'always' && candidateItems.length > 0) {\n store.set('activeIndex', 0);\n return;\n }\n emitHighlight(undefined, -1, REASONS.none);\n return;\n }\n if (storeActiveIndex >= candidateItems.length) {\n emitHighlight(undefined, -1, REASONS.none);\n store.set('activeIndex', null);\n return;\n }\n const itemValue = candidateItems[storeActiveIndex];\n const previouslyHighlightedItemValue = lastHighlightRef.current.value;\n const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);\n if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {\n emitHighlight(itemValue, storeActiveIndex, REASONS.none);\n }\n }, [activeIndex, autoHighlightMode, emitHighlight, hasFilteredItemsProp, hasItems, flatFilteredValues, inline, open, resolvedPopupRef, store,\n // Reruns the effect when the query changes without affecting the deps above, such as\n // clearing the input when no items are filtered out (individually rendered items).\n inputValue]);\n useIsoLayoutEffect(() => {\n if (selectionMode === 'none') {\n setFilled(String(inputValue) !== '');\n return;\n }\n setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);\n }, [setFilled, selectionMode, inputValue, selectedValue, multiple]);\n\n // Ensures that the active index is not set to 0 when the list is empty.\n // This avoids needing to press ArrowDown twice under certain conditions.\n React.useEffect(() => {\n if (hasItems && autoHighlightMode && flatFilteredValues.length === 0) {\n setIndices({\n activeIndex: null\n });\n }\n }, [hasItems, autoHighlightMode, flatFilteredValues.length, setIndices]);\n function handleQueryChanged() {\n if (open && query !== '' && query !== String(initialDefaultInputValue) && !inputMatchesSelectedValue) {\n setQueryChangedAfterOpen(true);\n }\n }\n function handleOpenChanged() {\n // A controlled `open` prop can interrupt the close without calling `setOpen`.\n if (open && closeQuery !== null) {\n handleInterruptedReopen(false);\n }\n }\n\n // These sync triggers can run in the same commit while still seeing the pre-commit `inputValue`.\n // This render-scoped flag prevents duplicate callbacks and resets so canceled writes can retry.\n let syncedSelectedLabel = false;\n function syncInputToSelectedLabel() {\n if (!syncedSelectedLabel && inputValue !== selectedLabelString) {\n syncedSelectedLabel = true;\n setInputValue(selectedLabelString, createChangeEventDetails(REASONS.none));\n }\n }\n function handleSelectedValueChanged() {\n if (selectionMode === 'none') {\n return;\n }\n clearErrors(name);\n setDirty(isSelectedValueDirty(selectedValue, validityData.initialValue, isItemEqualToValue));\n validation.change(selectedValue);\n if (single && !hasInputValue && !inputInsidePopup) {\n syncInputToSelectedLabel();\n }\n }\n\n // The label catches accessor changes while the items identity restores the selected label after\n // a one-step input clear followed by a data reload. The shared sync prevents duplicate writes\n // when both change in the same commit.\n function syncInputAfterItemsOrLabelChange() {\n if (single && !hasInputValue && !inputInsidePopup && !queryChangedAfterOpen) {\n syncInputToSelectedLabel();\n }\n }\n function handleInputValueChanged() {\n if (selectionMode !== 'none') {\n return;\n }\n clearErrors(name);\n setDirty(inputValue !== validityData.initialValue);\n validation.change(inputValue);\n }\n useValueChanged(query, handleQueryChanged);\n useValueChanged(open, handleOpenChanged);\n useValueChanged(selectedValue, handleSelectedValueChanged);\n useValueChanged(selectedLabelString, syncInputAfterItemsOrLabelChange);\n useValueChanged(items, syncInputAfterItemsOrLabelChange);\n useValueChanged(inputValue, handleInputValueChanged);\n const floatingRootContext = useFloatingRootContext({\n open: inline ? true : open,\n onOpenChange: setOpen,\n elements: {\n reference: inputInsidePopup ? triggerElement : inputElement,\n floating: positionerElement\n }\n });\n const ariaHasPopup = grid ? 'grid' : 'listbox';\n // An inline list isn't gated on `open`: it renders for as long as it's in the tree, so the\n // combobox is permanently expanded even while the internal open state is `false`.\n const expanded = open || inline;\n const ariaExpanded = expanded ? 'true' : 'false';\n const role = React.useMemo(() => {\n const isPlainInput = inputElement?.tagName === 'INPUT';\n // During SSR and initial hydration, the input ref is not available yet.\n // Assume an input-like control so combobox ARIA attributes are present.\n const shouldTreatAsInput = inputElement == null || isPlainInput;\n // A non-input control only takes on combobox semantics while the list is exposed, which for\n // an inline list is the whole time.\n const shouldApplyAria = shouldTreatAsInput || expanded;\n const reference = shouldTreatAsInput ? {\n autoComplete: 'off',\n spellCheck: 'false',\n autoCorrect: 'off',\n autoCapitalize: 'none'\n } : {};\n if (shouldApplyAria) {\n reference.role = 'combobox';\n reference['aria-expanded'] = ariaExpanded;\n reference['aria-haspopup'] = ariaHasPopup;\n reference['aria-controls'] = expanded ? listElement?.id : undefined;\n // `readOnly` accepts no input, so no completion of any kind is offered.\n reference['aria-autocomplete'] = readOnly ? 'none' : autoComplete;\n }\n return {\n reference,\n floating: {\n role: 'presentation'\n }\n };\n }, [inputElement, expanded, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete, readOnly]);\n\n // `readOnly` locks the value, not the interaction: the popup opens and can be browsed.\n // Value changes stay blocked in `ComboboxItem`, `ComboboxInput`'s keydown, `ComboboxTrigger`'s\n // typeahead, the clear/remove parts, and the hidden input's autofill handler.\n const click = useClick(floatingRootContext, {\n enabled: !disabled && openOnInputClick,\n event: 'mousedown-only',\n toggle: false,\n // Apply a small delay for touch to let mobile viewport/keyboard positioning settle.\n // This avoids top-bottom flip flickers if the preferred position is \"top\" when first tapping.\n touchOpenDelay: inputInsidePopup ? 0 : 100,\n reason: REASONS.inputPress\n });\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !disabled && !inline,\n outsidePressEvent: {\n mouse: 'sloppy',\n // The visual viewport (affected by the mobile software keyboard) can be\n // somewhat small. The user may want to scroll the screen to see more of\n // the popup.\n touch: 'intentional'\n },\n // Without a popup, let the Escape key bubble the event up to other popups' handlers.\n bubbles: inline ? true : undefined,\n outsidePress(event) {\n const target = getTarget(event);\n return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);\n }\n });\n const listNavigation = useListNavigation(floatingRootContext, {\n enabled: !disabled,\n id,\n listRef,\n activeIndex,\n selectedIndex,\n virtual: true,\n loopFocus,\n allowEscape: loopFocus && !autoHighlightMode,\n focusItemOnOpen: queryChangedAfterOpen || selectionMode === 'none' && !autoHighlightMode ? false : 'auto',\n focusItemOnHover: highlightItemOnHover,\n resetOnPointerLeave: !keepHighlight,\n orientation: grid ? 'horizontal' : undefined,\n rtl: direction === 'rtl',\n disabledIndices: EMPTY_ARRAY,\n grid: grid ? gridNavigation : undefined,\n onNavigate(nextActiveIndex, event) {\n // Ignore automatic navigation while closed, including selected-index sync for inline lists.\n // Inline lists remain navigable while `open` is false, so still allow resets (clearing the\n // highlight when an unbound inline list unmounts, e.g. in a closed dialog).\n if (!event && !open && !(inline && nextActiveIndex === null) || transitionStatus === 'ending') {\n return;\n }\n setIndices({\n activeIndex: nextActiveIndex,\n type: getHighlightReason(event),\n event: event?.nativeEvent\n });\n }\n });\n const inputProps = React.useMemo(() => mergeProps(listNavigation.reference, {\n onKeyDown(event) {\n // In grid mode the navigation hook treats ArrowLeft/ArrowRight as horizontal\n // grid movement. When the input has focus and no item is highlighted the user\n // is still editing the query, so let the input keep its native caret behavior.\n if (grid && store.state.activeIndex == null && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {\n event.preventBaseUIHandler();\n }\n }\n }, dismiss.reference, click.reference, role.reference), [listNavigation.reference, dismiss.reference, click.reference, role.reference, grid, store]);\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);\n const listProps = React.useMemo(() => mergeProps(listNavigation.floating, role.floating), [listNavigation.floating, role.floating]);\n const itemRoot = React.useMemo(() => {\n const listNavigationItemProps = listNavigation.item;\n return {\n // Combobox keeps focus on the input; item focus would incorrectly sync\n // list navigation state from DOM focus.\n props: listNavigationItemProps ? {\n ...listNavigationItemProps,\n onFocus: undefined\n } : EMPTY_OBJECT,\n id,\n selectionMode,\n disabled,\n readOnly,\n isItemEqualToValue\n };\n }, [listNavigation.item, id, selectionMode, disabled, readOnly, isItemEqualToValue]);\n store.useContextCallback('setOpen', setOpen);\n store.useContextCallback('setInputValue', setInputValue);\n store.useContextCallback('setSelectedValue', setSelectedValue);\n store.useContextCallback('setIndices', setIndices);\n store.useContextCallback('handleSelection', handleSelection);\n store.useContextCallback('forceMount', forceMount);\n store.useContextCallback('requestSubmit', requestSubmit);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeCompleteProp);\n\n // The prop bags must be in the store before the parts render: they read them with `useStore`\n // during render, and a layout effect commits only after all children have rendered.\n useOnFirstRender(() => {\n store.update({\n inline: inlineProp,\n popupProps,\n listProps,\n inputProps,\n triggerProps,\n itemRoot\n });\n });\n const syncedValues = {\n id,\n selectedValue,\n open,\n mounted,\n transitionStatus,\n items: storeItems,\n inline: inlineProp,\n popupProps,\n listProps,\n inputProps,\n triggerProps,\n itemRoot,\n openMethod,\n selectionMode,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n virtualized,\n openOnInputClick,\n itemToStringLabel,\n modal,\n autoHighlight: autoHighlightMode,\n isItemEqualToValue,\n submitOnItemClick,\n hasInputValue\n };\n useIsoLayoutEffect(() => {\n // `inputOwnsFormValue` is derived here rather than during render because `ComboboxInput`\n // writes it from a ref callback earlier in the same commit, and it has to land in this same\n // `update` so subscribers never observe an intermediate snapshot. That is also why\n // `store.useSyncedValues` can't be used yet: it would need a second write. The dependencies\n // are derived from `syncedValues` so a newly synchronized field can't be forgotten here.\n store.update({\n ...syncedValues,\n inputOwnsFormValue: selectionMode === 'none' && (inlineProp || !store.state.inputInsidePopup)\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...Object.values(syncedValues)]);\n const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);\n const itemsContextValue = React.useMemo(() => ({\n query,\n hasItems,\n filteredItems,\n flatFilteredValues\n }), [query, hasItems, filteredItems, flatFilteredValues]);\n const serializedValue = React.useMemo(() => {\n if (Array.isArray(fieldRawValue)) {\n return '';\n }\n return stringifyAsValue(fieldRawValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue]);\n const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;\n const hiddenInputName = multiple || selectionMode === 'none' && inputOwnsFormValue ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(selectedValue) || !name) {\n return null;\n }\n return selectedValue.map(value => {\n const currentSerializedValue = stringifyAsValue(value, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue,\n disabled: disabled\n }, currentSerializedValue);\n });\n }, [multiple, selectedValue, form, name, itemToStringValue, disabled]);\n const children = /*#__PURE__*/_jsxs(React.Fragment, {\n children: [props.children, /*#__PURE__*/_jsx(\"input\", {\n ...validation.getValidationProps(disabled, {\n // Move focus when the hidden input is focused.\n onFocus() {\n if (inputInsidePopup) {\n triggerElement?.focus();\n return;\n }\n (inputRef.current || triggerElement)?.focus();\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented || disabled || readOnly) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const nextValueLower = nextValue.toLowerCase();\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n const findSerializedMatchIndex = () => valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyValueLabel(candidate).toLowerCase() === nextValueLower);\n function handleChange() {\n // Browser autofill only writes a single scalar value.\n if (multiple) {\n return;\n }\n if (selectionMode === 'none') {\n setInputValue(nextValue, details);\n return;\n }\n\n // Preserve the original serialized matching, then fall back to rendered text,\n // which browsers can autofill for primitive values like `value=\"US\">United States`.\n let matchingIndex = findSerializedMatchIndex();\n if (matchingIndex === -1) {\n matchingIndex = valuesRef.current.findIndex((_, index) => {\n const renderedLabel = labelsRef.current[index];\n return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;\n });\n }\n const matchingValue = matchingIndex === -1 ? undefined : valuesRef.current[matchingIndex];\n if (matchingValue != null) {\n // `setSelectedValue` may be canceled by `onValueChange`; rely on\n // `useValueChanged` to mark the field dirty and run validation only\n // when the value actually changes.\n setSelectedValue?.(matchingValue, details);\n }\n }\n\n // Only single-selection autofill matches against the registered values/labels.\n // `multiple` ignores autofill and `none` just writes the input value, so avoid the\n // sticky `forceMounted` mount (which never resets) for those modes.\n if (single) {\n forceMount();\n if (items && findSerializedMatchIndex() === -1) {\n // `forceMount` only refreshes the derived labels for the `items` prop. When\n // serialized matching misses, also mount the list so rendered labels (which can\n // differ from the serialized values) are registered for autofill matching.\n store.set('forceMounted', true);\n }\n }\n queueMicrotask(handleChange);\n }\n }),\n id: id && hiddenInputName == null ? `${id}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: formAutoComplete,\n disabled: disabled,\n required: required && !hasMultipleSelection,\n readOnly: readOnly,\n value: serializedValue,\n ref: hiddenInputRef,\n style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n });\n return /*#__PURE__*/_jsx(ComboboxRootContext.Provider, {\n value: store,\n children: /*#__PURE__*/_jsx(ComboboxFloatingContext.Provider, {\n value: floatingRootContext,\n children: /*#__PURE__*/_jsx(ComboboxHasItemsContext.Provider, {\n value: hasItems,\n children: /*#__PURE__*/_jsx(ComboboxDerivedItemsContext.Provider, {\n value: itemsContextValue,\n children: /*#__PURE__*/_jsx(ComboboxInputValueContext.Provider, {\n value: inputValue,\n children: children\n })\n })\n })\n })\n });\n}","'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}","'use client';\n\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.mjs\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.mjs\";\nexport function useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange,\n elements = {}\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== 'production') {\n const optionDomReference = elements.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n console.error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `context.setPositionReference()`', 'instead.');\n }\n }\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n onOpenChange,\n referenceElement: elements.reference ?? null,\n floatingElement: elements.floating ?? null,\n triggerElements: new PopupTriggerMap(),\n floatingId,\n syncOnly: false,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId\n };\n if (elements.reference !== undefined) {\n valuesToSync.referenceElement = elements.reference;\n valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;\n }\n if (elements.floating !== undefined) {\n valuesToSync.floatingElement = elements.floating;\n }\n store.update(valuesToSync);\n }, [open, floatingId, elements.reference, elements.floating, store]);\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}","import { getGridNavigatedIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\n/**\n * Positional arguments are deliberate: property names of an options object\n * don't minify, and the signature is locked to the caller via `typeof` on the\n * `grid` option of `useListNavigation`.\n *\n * The injected grid navigator only ever operates on a uniform 1x1 grid (sizes are\n * always `1x1` and packing is never dense), so the cell-map machinery that supports\n * multi-cell items collapses to an identity transform over the item list. Calling\n * `getGridNavigatedIndex` directly keeps the cell-map helpers\n * (`createGridCellMap`/`getGridCellIndexOfCorner`/`getGridCellIndices`) out of\n * grid-combobox bundles.\n */\nexport function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex, cols = 2) {\n const nextIndex = getGridNavigatedIndex(listRef.current, {\n event,\n orientation,\n loopFocus,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n // An out-of-range previous index falls back to the first enabled item.\n prevIndex: prevIndex > maxIndex ? minIndex : prevIndex,\n stopEvent: true\n });\n\n // `getGridNavigatedIndex` can return an out-of-bounds sentinel (e.g. `-1` when there is no\n // previous item to move from); surface that as `undefined` so the caller treats it as\n // \"no navigation\" rather than highlighting index `-1`.\n return isIndexOutOfListBounds(listRef.current, nextIndex) ? undefined : nextIndex;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxRootContext.displayName = \"ComboboxRootContext\";\nexport const ComboboxFloatingContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxFloatingContext.displayName = \"ComboboxFloatingContext\";\nexport const ComboboxDerivedItemsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxDerivedItemsContext.displayName = \"ComboboxDerivedItemsContext\";\nexport const ComboboxHasItemsContext = /*#__PURE__*/React.createContext(false);\n// `inputValue` can't be placed in the store.\n// https://github.com/mui/base-ui/issues/2703\nif (process.env.NODE_ENV !== \"production\") ComboboxHasItemsContext.displayName = \"ComboboxHasItemsContext\";\nexport const ComboboxInputValueContext = /*#__PURE__*/React.createContext('');\nif (process.env.NODE_ENV !== \"production\") ComboboxInputValueContext.displayName = \"ComboboxInputValueContext\";\nexport function useComboboxRootContext() {\n const context = React.useContext(ComboboxRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(22));\n }\n return context;\n}\nexport function useComboboxFloatingContext() {\n const context = React.useContext(ComboboxFloatingContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(23));\n }\n return context;\n}\nexport function useComboboxDerivedItemsContext() {\n const context = React.useContext(ComboboxDerivedItemsContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(24));\n }\n return context;\n}\nexport function useComboboxInputValueContext() {\n return React.useContext(ComboboxInputValueContext);\n}\nexport function useComboboxHasItemsContext() {\n return React.useContext(ComboboxHasItemsContext);\n}","// https://github.com/mui/mui-x/blob/master/packages/x-internals/src/fastArrayCompare/fastArrayCompare.ts\n\n/**\n * Compares two arrays element-wise.\n *\n * The default comparison is `Object.is`, so `NaN` equals `NaN` and `0` does not equal `-0`.\n */\nexport function areArraysEqual(array1, array2, itemComparer = Object.is) {\n const {\n length\n } = array1;\n if (length !== array2.length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (!itemComparer(array1[i], array2[i])) {\n return false;\n }\n }\n return true;\n}","import { areArraysEqual } from '@base-ui/utils/areArraysEqual';\n// Compared by identity in `findSelectionIndex`; don't wrap it.\nexport const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function isSelectedValueDirty(currentValue, initialValue, comparer) {\n if (Array.isArray(currentValue) && Array.isArray(initialValue)) {\n return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, comparer));\n }\n return currentValue !== initialValue;\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\n\n// The default comparer is `Object.is`, so the values can be indexed instead of rescanned\n// for every item. A custom comparer may match values that don't hash alike.\nfunction createSelectionMatcher(selectedValues, comparer) {\n if (comparer !== defaultItemEquality) {\n return itemValue => selectedValueIncludes(selectedValues, itemValue, comparer);\n }\n const index = new Set(selectedValues);\n index.delete(undefined);\n // `Set` treats +0 and -0 as equal; `Object.is` does not.\n return itemValue => index.has(itemValue) && (itemValue !== 0 || selectedValues.some(v => Object.is(itemValue, v)));\n}\nexport function findSelectionIndex(itemValues, selectedValue, comparer, multiple) {\n // Only treat the value as a list in multiple mode: an array can itself be a valid\n // single-select value.\n const index = multiple && Array.isArray(selectedValue) ?\n // Anchor to the first selected item in rendered order so the index does not depend\n // on the order in which the values were added to the array.\n itemValues.findIndex(createSelectionMatcher(selectedValue, comparer)) : findItemIndex(itemValues, selectedValue, comparer);\n return index === -1 ? null : index;\n}\n\n/** Resolves the first selected index as items register or change. */\nexport function resolveSelectedIndex(index, itemValue, registry, selectedValues, comparer, currentIndex) {\n if (selectedValueIncludes(selectedValues, itemValue, comparer)) {\n // A later item only takes over once the current anchor stops being selected.\n return currentIndex != null && index > currentIndex && selectedValueIncludes(selectedValues, registry[currentIndex], comparer) ? currentIndex : index;\n }\n // The holder re-elects the anchor once it stops being selected.\n return index === currentIndex ? findSelectionIndex(registry, selectedValues, comparer, true) : currentIndex;\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}","export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { serializeValue } from \"./serializeValue.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isGroup(item) {\n return typeof item === 'object' && item != null && Array.isArray(item.items);\n}\nexport function isGroupedItems(items) {\n // A group must carry an actual `items` array: key presence alone would misclassify an item\n // with an unrelated or optional `items` field.\n return isGroup(items?.[0]);\n}\nexport function flattenLeafItems(items) {\n return isGroupedItems(items) ? items.flatMap(group => group.items) : items;\n}\n\n/**\n * Checks if the items array contains an item with a null value that has a non-null label.\n */\nexport function hasNullItemLabel(items) {\n if (!Array.isArray(items)) {\n return items != null && 'null' in items;\n }\n const arrayItems = items;\n if (isGroupedItems(arrayItems)) {\n for (const group of arrayItems) {\n for (const item of group.items) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n }\n return false;\n }\n for (const item of arrayItems) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n return false;\n}\nexport function stringifyAsLabel(item, itemToStringLabel) {\n if (itemToStringLabel && item != null) {\n return itemToStringLabel(item) ?? '';\n }\n if (item && typeof item === 'object') {\n if ('label' in item && item.label != null) {\n return String(item.label);\n }\n if ('value' in item) {\n return String(item.value);\n }\n }\n return serializeValue(item);\n}\nexport function stringifyAsValue(item, itemToStringValue) {\n if (itemToStringValue && item != null) {\n return itemToStringValue(item) ?? '';\n }\n if (item && typeof item === 'object' && 'value' in item && 'label' in item) {\n return serializeValue(item.value);\n }\n return serializeValue(item);\n}\nexport function resolveSelectedLabel(value, items, itemToStringLabel) {\n function fallback() {\n return stringifyAsLabel(value, itemToStringLabel);\n }\n if (itemToStringLabel && value != null) {\n return itemToStringLabel(value);\n }\n\n // Custom object with explicit label takes precedence\n if (value && typeof value === 'object' && 'label' in value && value.label != null) {\n return value.label;\n }\n\n // Items provided as plain record map\n if (items && !Array.isArray(items)) {\n const label = Object.hasOwn(items, value) ? items[value] : undefined;\n return label ?? fallback();\n }\n\n // Items provided as array (flat or grouped)\n if (Array.isArray(items)) {\n const arrayItems = items;\n const flatItems = flattenLeafItems(arrayItems);\n if (value == null || typeof value !== 'object') {\n const match = flatItems.find(item => item.value === value);\n if (match && match.label != null) {\n return match.label;\n }\n return fallback();\n }\n\n // Object without explicit label: try matching by its `value` property\n if ('value' in value) {\n const match = flatItems.find(item => item && item.value === value.value);\n if (match && match.label != null) {\n return match.label;\n }\n }\n }\n return fallback();\n}\nexport function resolveMultipleLabels(values, items, itemToStringLabel) {\n return values.reduce((acc, value, index) => {\n if (index > 0) {\n acc.push(', ');\n }\n acc.push(/*#__PURE__*/_jsx(React.Fragment, {\n children: resolveSelectedLabel(value, items, itemToStringLabel)\n }, index));\n return acc;\n }, []);\n}","import { compareItemEquality } from \"../internals/itemEquality.mjs\";\nimport { hasNullItemLabel } from \"../internals/resolveValueLabel.mjs\";\n\n/**\n * Non-reactive values shared with the combobox parts. Nothing here is observable through\n * `selectors`, so writing to a ref never notifies subscribers.\n */\n\nexport const selectors = {\n id: state => state.id,\n labelId: state => state.labelId,\n items: state => state.items,\n selectedValue: state => state.selectedValue,\n hasSelectionChips: state => {\n const selectedValue = state.selectedValue;\n return Array.isArray(selectedValue) && selectedValue.length > 0;\n },\n hasSelectedValue: state => {\n const {\n selectedValue,\n selectionMode\n } = state;\n if (selectedValue == null) {\n return false;\n }\n if (selectionMode === 'multiple' && Array.isArray(selectedValue)) {\n return selectedValue.length > 0;\n }\n return true;\n },\n hasNullItemLabel: (state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n },\n open: state => state.open,\n mounted: state => state.mounted,\n forceMounted: state => state.forceMounted,\n inline: state => state.inline,\n activeIndex: state => state.activeIndex,\n selectedIndex: state => state.selectedIndex,\n isActive: (state, index) => state.activeIndex === index,\n isSelected: (state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const selectedValue = state.selectedValue;\n if (Array.isArray(selectedValue)) {\n return selectedValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n },\n transitionStatus: state => state.transitionStatus,\n popupProps: state => state.popupProps,\n listProps: state => state.listProps,\n inputProps: state => state.inputProps,\n triggerProps: state => state.triggerProps,\n itemRoot: state => state.itemRoot,\n positionerElement: state => state.positionerElement,\n listElement: state => state.listElement,\n popupId: state => state.popupId,\n triggerElement: state => state.triggerElement,\n inputElement: state => state.inputElement,\n inputGroupElement: state => state.inputGroupElement,\n popupSide: state => state.popupSide,\n openMethod: state => state.openMethod,\n inputInsidePopup: state => state.inputInsidePopup,\n inputOwnsFormValue: state => state.inputOwnsFormValue,\n selectionMode: state => state.selectionMode,\n name: state => state.name,\n form: state => state.form,\n disabled: state => state.disabled,\n readOnly: state => state.readOnly,\n required: state => state.required,\n grid: state => state.grid,\n virtualized: state => state.virtualized,\n itemToStringLabel: state => state.itemToStringLabel,\n isItemEqualToValue: state => state.isItemEqualToValue,\n modal: state => state.modal,\n autoHighlight: state => state.autoHighlight\n};","/**\n * Present when the field is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the field is in a valid state.\n */\nexport const valid = 'data-valid';\n/**\n * Present when the field is in an invalid state.\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the field has been touched.\n */\nexport const touched = 'data-touched';\n/**\n * Present when the field's value has changed.\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the field is filled.\n */\nexport const filled = 'data-filled';\n/**\n * Present when the field control is focused.\n */\nexport const focused = 'data-focused';","import * as FieldControlDataAttributes from \"../../field/control/FieldControlDataAttributes.mjs\";\nexport const DEFAULT_VALIDITY_STATE = {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: null,\n valueMissing: false\n};\nexport const DEFAULT_FIELD_STATE_ATTRIBUTES = {\n valid: null,\n touched: false,\n dirty: false,\n filled: false,\n focused: false\n};\nexport const DEFAULT_FIELD_ROOT_STATE = {\n disabled: false,\n ...DEFAULT_FIELD_STATE_ATTRIBUTES\n};\nexport const fieldValidityMapping = {\n valid(value) {\n if (value === null) {\n return null;\n }\n if (value) {\n return {\n [FieldControlDataAttributes.valid]: ''\n };\n }\n return {\n [FieldControlDataAttributes.invalid]: ''\n };\n }\n};","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { NOOP } from \"../noop.mjs\";\nimport { DEFAULT_FIELD_ROOT_STATE, DEFAULT_VALIDITY_STATE } from \"../field-constants/constants.mjs\";\nexport const DEFAULT_FIELD_ROOT_CONTEXT = {\n invalid: undefined,\n name: undefined,\n validityData: {\n state: DEFAULT_VALIDITY_STATE,\n errors: [],\n error: '',\n value: '',\n initialValue: null\n },\n setValidityData: NOOP,\n disabled: undefined,\n setTouched: NOOP,\n setDirty: NOOP,\n setFilled: NOOP,\n setFocused: NOOP,\n focusOwnerRef: {\n current: undefined\n },\n validationMode: 'onSubmit',\n shouldValidateOnChange: () => false,\n state: DEFAULT_FIELD_ROOT_STATE,\n registerFieldControl: NOOP,\n validation: {\n getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,\n inputRef: {\n current: null\n },\n registeredInputs: new Map(),\n registerInput: NOOP,\n getInputControl: () => null,\n commit: async () => {},\n change: NOOP\n }\n};\nexport const FieldRootContext = /*#__PURE__*/React.createContext(DEFAULT_FIELD_ROOT_CONTEXT);\nif (process.env.NODE_ENV !== \"production\") FieldRootContext.displayName = \"FieldRootContext\";\nexport function useFieldRootContext(optional = true) {\n const context = React.useContext(FieldRootContext);\n if (context.setValidityData === NOOP && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : _formatErrorMessage(28));\n }\n return context;\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useFieldRootContext } from \"../field-root-context/FieldRootContext.mjs\";\nexport function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {\n const {\n registerFieldControl\n } = useFieldRootContext();\n const sourceRef = useRefWithInit(() => Symbol());\n\n // Re-register without unregistering first: re-registration with the same id updates the\n // form's fields Map entry in place, while a delete + re-add would move the field to the\n // end of the Map every time its value changes.\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n if (!enabled) {\n registerFieldControl(source, undefined);\n return;\n }\n const registration = {\n controlRef,\n getValue: getFormValueOverride,\n id,\n name,\n value\n };\n registerFieldControl(source, registration);\n }, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, sourceRef, value]);\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n return () => {\n registerFieldControl(source, undefined);\n };\n }, [registerFieldControl, sourceRef]);\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\nexport const FormContext = /*#__PURE__*/React.createContext({\n elementRef: {\n current: null\n },\n formRef: {\n current: {\n fields: new Map()\n }\n },\n errors: {},\n clearErrors: NOOP,\n validationMode: 'onSubmit',\n submitCountRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") FormContext.displayName = \"FormContext\";\nexport function useFormContext() {\n return React.useContext(FormContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { NOOP } from \"../noop.mjs\";\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabelableId(params = {}) {\n const {\n id,\n enabled = true\n } = params;\n const {\n controlId,\n registerControlId,\n resetControlId\n } = useLabelableContext();\n\n // Deliberately not seeded with `id`: on React 17 the seed would stick around after the\n // `id` prop is removed, leaving the control on a stale id forever.\n const defaultId = useBaseUiId();\n const controlSourceRef = useRefWithInit(() => Symbol());\n const hasRegisteredRef = React.useRef(false);\n const hadExplicitIdRef = React.useRef(false);\n const unregisterControlId = useStableCallback(() => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSourceRef.current, undefined);\n });\n useIsoLayoutEffect(() => {\n if (!enabled || registerControlId === NOOP) {\n unregisterControlId();\n return undefined;\n }\n let nextId;\n if (id !== undefined) {\n hadExplicitIdRef.current = true;\n nextId = id;\n } else if (hadExplicitIdRef.current) {\n nextId = defaultId;\n } else {\n // An id-less replacement must claim the provider's fallback so a previously registered\n // explicit id is not retained after its control unmounts.\n resetControlId();\n return undefined;\n }\n\n // Either the control never had an explicit `id`, or React 17 has not assigned the\n // fallback id yet. Neither is worth registering.\n if (nextId === undefined) {\n unregisterControlId();\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, nextId);\n return undefined;\n }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);\n\n // Unregistering in the layout phase, not a passive effect: a replacement control's layout\n // effect would otherwise run first and still see the outgoing control's registration.\n useIsoLayoutEffect(() => {\n return unregisterControlId;\n }, [unregisterControlId]);\n\n // The provider's id wins until registration runs: the label renders `htmlFor` from the\n // provider's pre-registration state, so preempting it with an explicit `id` here would\n // leave the pair unassociated in server-rendered markup.\n return (enabled ? controlId : undefined) ?? id ?? defaultId;\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\n/**\n * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\\\n * with an accessible name (label) and description.\n */\nexport const LabelableContext = /*#__PURE__*/React.createContext({\n controlId: undefined,\n registerControlId: NOOP,\n resetControlId: NOOP,\n labelId: undefined,\n setLabelId: NOOP,\n messageIds: [],\n setMessageIds: NOOP,\n getDescriptionProps: externalProps => externalProps\n});\nif (process.env.NODE_ENV !== \"production\") LabelableContext.displayName = \"LabelableContext\";\nexport function useLabelableContext() {\n return React.useContext(LabelableContext);\n}","import { stringifyAsLabel } from \"../../../internals/resolveValueLabel.mjs\";\n/**\n * Derives the default id assigned to `Combobox.Popup` when the input is rendered inside it.\n * Shared by the popup (which applies it) and the trigger (which references it via `aria-controls`)\n * so the convention only lives in one place.\n */\nexport function getComboboxPopupId(rootId) {\n return rootId == null ? undefined : `${rootId}-popup`;\n}\n\n/**\n * Enhanced filter using Intl.Collator for more robust string matching.\n * Uses the provided `itemToStringLabel` function if available, otherwise falls back to:\n * • When `item` is an object with a `value` property, that property is used.\n * • When `item` is a primitive (e.g. `string`), it is used directly.\n */\nexport function createCollatorItemFilter(collatorFilter, itemToStringLabel) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n return collatorFilter.contains(item, query, itemToStringLabel);\n };\n}\n\n/**\n * Enhanced filter for single selection mode using Intl.Collator that shows all items\n * when query is empty or matches the current selection, making it easier to browse options.\n */\nexport function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n if (!query) {\n return true;\n }\n const selectedValueToString = itemToStringLabel?.selected ?? itemToStringLabel;\n const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, selectedValueToString) : '';\n\n // Handle case-insensitive matching consistently\n if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) {\n return true;\n }\n return collatorFilter.contains(item, query, itemToStringLabel);\n };\n}","export function stringifyLocale(locale) {\n if (Array.isArray(locale)) {\n return locale.map(value => stringifyLocale(value)).join(',');\n }\n if (locale == null) {\n return '';\n }\n return String(locale);\n}","import { stringifyLocale } from '@base-ui/utils/stringifyLocale';\nimport { stringifyAsLabel } from \"./resolveValueLabel.mjs\";\nconst filterCache = new Map();\nexport function getFilter(options = {}) {\n const {\n locale,\n ...restOptions\n } = options;\n const collatorOptions = {\n usage: 'search',\n sensitivity: 'base',\n ignorePunctuation: true,\n ...restOptions\n };\n const cacheKey = `${stringifyLocale(locale)}|${JSON.stringify(collatorOptions)}`;\n const cachedFilter = filterCache.get(cacheKey);\n if (cachedFilter) {\n return cachedFilter;\n }\n const collator = new Intl.Collator(locale, collatorOptions);\n const filter = {\n contains(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n for (let i = 0; i <= itemString.length - query.length; i += 1) {\n if (collator.compare(itemString.slice(i, i + query.length), query) === 0) {\n return true;\n }\n }\n return false;\n },\n startsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n return collator.compare(itemString.slice(0, query.length), query) === 0;\n },\n endsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n const queryLength = query.length;\n return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;\n }\n };\n filterCache.set(cacheKey, filter);\n return filter;\n}","'use client';\n\nimport * as React from 'react';\nimport { createCollatorItemFilter, createSingleSelectionCollatorFilter } from \"./index.mjs\";\nimport { getFilter } from \"../../../internals/filter.mjs\";\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport const useCoreFilter = getFilter;\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport function useComboboxFilter(options = {}) {\n const {\n multiple = false,\n value,\n ...collatorOptions\n } = options;\n const coreFilter = getFilter(collatorOptions);\n const contains = React.useCallback((item, query, itemToString) => {\n if (multiple) {\n return createCollatorItemFilter(coreFilter, itemToString)(item, query);\n }\n return createSingleSelectionCollatorFilter(coreFilter, itemToString, value)(item, query);\n }, [coreFilter, value, multiple]);\n return React.useMemo(() => ({\n ...coreFilter,\n contains\n }), [contains, coreFilter]);\n}","export const NO_ACTIVE_VALUE = Symbol('none');\nexport const INITIAL_LAST_HIGHLIGHT = {\n value: NO_ACTIVE_VALUE,\n index: -1\n};","import { compareItemEquality, defaultItemEquality } from \"../../internals/itemEquality.mjs\";\nexport function findCollectionItem(valueToItem, itemValue, isEqual) {\n const exactItem = valueToItem.get(itemValue);\n if (exactItem !== undefined || isEqual === defaultItemEquality) {\n return exactItem;\n }\n for (const [derivedValue, item] of valueToItem) {\n if (compareItemEquality(derivedValue, itemValue, isEqual)) {\n return item;\n }\n }\n return undefined;\n}\n\n/**\n * An opaque collection created by `createItems()`.\n *\n * It carries the source item and derived value types so the root can infer the list item and\n * selection value types.\n *\n * Pass it directly to the root's `items` prop; it has no public members.\n */\n\n/**\n * Internal shape of a collection. The extra members let the root project items to\n * their values and resolve a selected value back to its label while items are unmounted.\n */","'use client';\n\nimport * as React from 'react';\nimport { AriaCombobox } from \"./AriaCombobox.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the combobox.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport function ComboboxRoot(props) {\n const {\n multiple = false,\n defaultValue,\n value,\n onValueChange,\n autoComplete,\n ...other\n } = props;\n return /*#__PURE__*/_jsx(AriaCombobox, {\n ...other,\n selectionMode: multiple ? 'multiple' : 'single',\n selectedValue: value,\n defaultSelectedValue: defaultValue,\n onSelectedValueChange: onValueChange,\n formAutoComplete: autoComplete\n });\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../internals/useBaseUiId.mjs\";\nexport function useRegisteredLabelId(idProp, setLabelId) {\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(currentId => currentId === id ? undefined : currentId);\n };\n }, [id, setLabelId]);\n return id;\n}","'use client';\n\nimport { isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { closest, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { useRegisteredLabelId } from \"../../utils/useRegisteredLabelId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabel(params = {}) {\n const {\n id: idProp,\n fallbackControlId,\n native = false,\n setLabelId: setLabelIdProp,\n focusControl: focusControlProp\n } = params;\n const {\n controlId: contextControlId,\n setLabelId: setContextLabelId\n } = useLabelableContext();\n const syncLabelId = useStableCallback(nextLabelId => {\n setContextLabelId(nextLabelId);\n setLabelIdProp?.(nextLabelId);\n });\n const id = useRegisteredLabelId(idProp, syncLabelId);\n const resolvedControlId = contextControlId ?? fallbackControlId;\n function focusControl(event) {\n if (focusControlProp) {\n focusControlProp(event, resolvedControlId);\n return;\n }\n if (!resolvedControlId) {\n return;\n }\n const controlElement = getControlById(event.currentTarget, resolvedControlId);\n if (isHTMLElement(controlElement)) {\n focusElementWithVisible(controlElement);\n }\n }\n function handleInteraction(event) {\n const target = getTarget(event.nativeEvent);\n if (closest(target, 'button,input,select,textarea')) {\n return;\n }\n\n // Prevent text selection when double clicking label.\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n if (native) {\n return;\n }\n focusControl(event);\n }\n return native ? {\n id,\n htmlFor: resolvedControlId,\n onMouseDown: handleInteraction\n } : {\n id,\n onClick: handleInteraction,\n onPointerDown(event) {\n event.preventDefault();\n }\n };\n}\nexport function getControlById(label, id) {\n let root = label.getRootNode();\n while (isShadowRoot(root)) {\n const element = root.getElementById(id);\n if (element) {\n return element;\n }\n root = root.host.getRootNode();\n }\n return ownerDocument(label).getElementById(id);\n}\nexport function focusElementWithVisible(element) {\n element.focus({\n // Available from Chrome 144+ (January 2026).\n // Safari and Firefox already support it.\n focusVisible: true\n });\n}","'use client';\n\nexport function getDefaultLabelId(id) {\n return id == null ? undefined : `${id}-label`;\n}\nexport function resolveAriaLabelledBy(fieldLabelId, localLabelId) {\n return fieldLabelId ?? localLabelId;\n}","'use client';\n\nimport * as React from 'react';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabel } from \"../../internals/labelable-provider/useLabel.mjs\";\nimport { getDefaultLabelId } from \"../../utils/resolveAriaLabelledBy.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\n\n/**\n * An accessible label that is automatically associated with the combobox trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxLabel = /*#__PURE__*/React.forwardRef(function ComboboxLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n // Keep label id derived from the root and ignore runtime `id` overrides from untyped consumers.\n const elementPropsWithoutId = elementProps;\n delete elementPropsWithoutId.id;\n const fieldRootContext = useFieldRootContext();\n const store = useComboboxRootContext();\n const inputInsidePopup = store.useState('inputInsidePopup');\n const triggerElement = store.useState('triggerElement');\n const inputElement = store.useState('inputElement');\n const rootId = store.useState('id');\n const defaultLabelId = getDefaultLabelId(rootId);\n const localControlId = triggerElement?.id ?? (inputInsidePopup ? rootId : undefined);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!inputElement || inputInsidePopup) {\n return;\n }\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '<Combobox.Label> labels <Combobox.Trigger> only. ' + 'When <Combobox.Input> is the form control, use a native <label> or <Field.Label> instead.';\n error(`${message}${ownerStackMessage}`);\n }, [inputElement, inputInsidePopup]);\n }\n const labelProps = useLabel({\n id: defaultLabelId,\n fallbackControlId: localControlId,\n setLabelId(nextLabelId) {\n const resolvedLabelId = typeof nextLabelId === 'function' ? nextLabelId(store.state.labelId) : nextLabelId;\n store.set('labelId', resolvedLabelId);\n }\n });\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n state: fieldRootContext.state,\n props: [labelProps, elementProps],\n stateAttributesMapping: fieldValidityMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxLabel.displayName = \"ComboboxLabel\";","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { DEFAULT_FIELD_ROOT_CONTEXT, FieldRootContext, useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useSetFieldFocused } from \"../../internals/field-root-context/useSetFieldFocused.mjs\";\nimport { DEFAULT_FIELD_STATE_ATTRIBUTES } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getHighlightReason } from \"../../utils/getHighlightReason.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.mjs\";\nimport { clickHighlightedItem, getChipNavigationKeys, useListEmpty, usePopupSide } from \"../utils/parts.mjs\";\n\n/**\n * A text input to search for items in the list.\n * Renders an `<input>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInput(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n disabled: fieldDisabled,\n setTouched,\n validationMode,\n validation\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const comboboxChipsContext = useComboboxChipsContext();\n const positioning = useComboboxPositionerContext(true);\n const hasPositionerParent = Boolean(positioning);\n const store = useComboboxRootContext();\n // `inputValue` can't be placed in the store.\n // https://github.com/mui/base-ui/issues/2703\n const inputValue = useComboboxInputValueContext();\n const direction = useDirection();\n const required = store.useState('required');\n const comboboxDisabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const name = store.useState('name');\n const form = store.useState('form');\n const selectionMode = store.useState('selectionMode');\n const autoHighlightMode = store.useState('autoHighlight');\n const inputProps = store.useState('inputProps');\n const triggerProps = store.useState('triggerProps');\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const selectedValue = store.useState('selectedValue');\n const rootId = store.useState('id');\n const inline = store.useState('inline');\n const modal = store.useState('modal');\n const autoHighlightEnabled = Boolean(autoHighlightMode);\n const popupSide = usePopupSide(store);\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const listEmpty = useListEmpty();\n const setFocused = useSetFieldFocused(disabled, store.context.inputRef);\n const isInsidePopup = hasPositionerParent || inline;\n const focusManagerModal = !isInsidePopup || modal;\n const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : undefined));\n const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;\n const [composingValue, setComposingValue] = React.useState(null);\n const isComposingRef = React.useRef(false);\n const lastActiveIndexRef = React.useRef(null);\n\n // Restore the saved highlight on refocus only within the same open cycle.\n useIsoLayoutEffect(() => {\n if (!open) {\n lastActiveIndexRef.current = null;\n }\n }, [open]);\n const inputOwnsFormValue = selectionMode === 'none' && !hasPositionerParent;\n const setInputElement = useStableCallback(element => {\n const nextIsInsidePopup = hasPositionerParent || store.state.inline;\n if (nextIsInsidePopup && !store.state.hasInputValue) {\n store.context.setInputValue('', createChangeEventDetails(REASONS.none));\n }\n store.update({\n inputElement: element,\n inputInsidePopup: nextIsInsidePopup,\n inputOwnsFormValue\n });\n });\n const validationProps = hasPositionerParent ? elementProps : validation.getValidationProps(disabled, elementProps);\n function clearHighlight(event) {\n store.context.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: getHighlightReason(event),\n event\n });\n }\n const state = {\n ...fieldStateForInput,\n open,\n disabled,\n readOnly,\n popupSide,\n listEmpty\n };\n function handleKeyDown(event) {\n if (!comboboxChipsContext) {\n return undefined;\n }\n let nextIndex;\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n const [previousChipKey] = getChipNavigationKeys(direction);\n if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {\n event.preventDefault();\n nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : undefined;\n }\n return nextIndex;\n }\n const element = useRenderElement('input', componentProps, {\n state,\n ref: [forwardedRef, store.context.inputRef, setInputElement],\n props: [inputProps, triggerProps, {\n value: composingValue ?? inputValue,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': fieldLabelId,\n disabled,\n readOnly,\n required: selectionMode === 'none' ? required : undefined,\n form,\n ...(inputOwnsFormValue && name && {\n name\n }),\n id,\n onFocus() {\n setFocused(true);\n if (!inline) {\n return;\n }\n const nextActiveIndex = lastActiveIndexRef.current;\n lastActiveIndexRef.current = null;\n if (nextActiveIndex == null ||\n // `valuesRef` can be sparse, so guard against restoring a removed slot.\n !Object.hasOwn(store.context.valuesRef.current, nextActiveIndex)) {\n return;\n }\n store.context.setIndices({\n activeIndex: nextActiveIndex\n });\n },\n onBlur() {\n setTouched(true);\n setFocused(false);\n const activeIndex = store.state.activeIndex;\n if (inline && activeIndex !== null && autoHighlightMode !== 'always') {\n lastActiveIndexRef.current = activeIndex;\n store.context.setIndices({\n activeIndex: null\n });\n }\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n },\n onCompositionStart(event) {\n if (platform.os.android) {\n return;\n }\n isComposingRef.current = true;\n setComposingValue(event.currentTarget.value);\n },\n onCompositionEnd(event) {\n isComposingRef.current = false;\n const next = event.currentTarget.value;\n setComposingValue(null);\n store.context.setInputValue(next, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));\n },\n onChange(event) {\n const nativeEvent = event.nativeEvent;\n // Autofill may not provide `inputType` (Chrome) or may report\n // `insertReplacementText` (Firefox).\n const inputType = nativeEvent.inputType;\n const autofillLikeInput = !inputType || inputType === 'insertReplacementText';\n // During composition the input is always considered typed into.\n const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;\n function maybeOpenOnInput(trimmed) {\n if (readOnly || disabled || !trimmed || !shouldOpenOnInput) {\n return;\n }\n store.context.setOpen(true, createChangeEventDetails(REASONS.inputChange, nativeEvent));\n // When autoHighlight is enabled, keep the highlight (will be set to 0 in root).\n if (!autoHighlightEnabled) {\n clearHighlight(nativeEvent);\n }\n }\n\n // During IME composition, avoid propagating controlled updates to prevent\n // filtering the options prematurely so `Empty` won't show incorrectly.\n // We can't rely on this check for Android due to how it handles composition\n // events with some keyboards (e.g. Samsung keyboard with predictive text on\n // treats all text as always-composing).\n // https://github.com/mui/base-ui/issues/2942\n if (isComposingRef.current) {\n const nextVal = event.currentTarget.value;\n setComposingValue(nextVal);\n if (nextVal === '' && !store.state.openOnInputClick && !store.state.inputInsidePopup) {\n store.context.setOpen(false, createChangeEventDetails(REASONS.inputClear, nativeEvent));\n }\n const trimmed = nextVal.trim();\n const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== '';\n maybeOpenOnInput(trimmed);\n if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) {\n clearHighlight(nativeEvent);\n }\n return;\n }\n const inputChangeDetails = createChangeEventDetails(REASONS.inputChange, nativeEvent);\n store.context.setInputValue(event.currentTarget.value, inputChangeDetails);\n if (inputChangeDetails.isCanceled) {\n return;\n }\n const empty = event.currentTarget.value === '';\n const clearDetails = createChangeEventDetails(REASONS.inputClear, nativeEvent);\n if (empty && !store.state.inputInsidePopup) {\n if (selectionMode === 'single') {\n store.context.setSelectedValue(null, clearDetails);\n }\n if (!store.state.openOnInputClick) {\n store.context.setOpen(false, clearDetails);\n }\n }\n maybeOpenOnInput(event.currentTarget.value.trim());\n\n // When the user types, ensure the list resets its highlight so that\n // virtual focus returns to the input (aria-activedescendant is\n // cleared).\n if (open && store.state.activeIndex !== null && !autoHighlightEnabled) {\n clearHighlight(nativeEvent);\n }\n },\n onKeyDown(event) {\n if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {\n return;\n }\n if (disabled || readOnly) {\n // Browsing can highlight an item, and Enter there must not submit the form.\n if (readOnly && event.key === 'Enter' && open && store.state.activeIndex !== null) {\n stopEvent(event);\n }\n return;\n }\n const input = event.currentTarget;\n const scrollAmount = input.scrollWidth - input.clientWidth;\n const isRTL = direction === 'rtl';\n if (event.key === 'Home') {\n stopEvent(event);\n const cursor = platform.engine.gecko && isRTL ? input.value.length : 0;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = 0;\n return;\n }\n if (event.key === 'End') {\n stopEvent(event);\n const cursor = platform.engine.gecko && isRTL ? 0 : input.value.length;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = isRTL ? -scrollAmount : scrollAmount;\n return;\n }\n if (!mounted && event.key === 'Escape') {\n const isClear = selectionMode === 'multiple' && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;\n const details = createChangeEventDetails(REASONS.escapeKey, event.nativeEvent);\n const value = selectionMode === 'multiple' ? [] : null;\n store.context.setInputValue('', details);\n store.context.setSelectedValue(value, details);\n if (!isClear && !store.state.inline && !details.isPropagationAllowed) {\n event.stopPropagation();\n }\n return;\n }\n\n // Handle deletion when the input is empty.\n if (comboboxChipsContext && event.key === 'Backspace' && input.value === '' && Array.isArray(selectedValue) && selectedValue.length > 0) {\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;\n const newValue = selectedValue.filter((_, index) => index !== removalIndex);\n // If the removed item was also the active (highlighted) item, clear highlight\n clearHighlight(event.nativeEvent);\n store.context.setSelectedValue(newValue, createChangeEventDetails(REASONS.none, event.nativeEvent));\n return;\n }\n const nextIndex = handleKeyDown(event);\n if (nextIndex !== undefined) {\n comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();\n }\n\n // event.isComposing\n if (event.which === 229) {\n return;\n }\n if (event.key === 'Enter' && open) {\n const activeIndex = store.state.activeIndex;\n const nativeEvent = event.nativeEvent;\n if (activeIndex === null) {\n if (inline) {\n return;\n }\n\n // Allow form submission when no item is highlighted.\n store.context.setOpen(false, createChangeEventDetails(REASONS.none, nativeEvent));\n return;\n }\n stopEvent(event);\n clickHighlightedItem(store, activeIndex, nativeEvent);\n }\n }\n }, validationProps],\n stateAttributesMapping: triggerStateAttributesMapping\n });\n const renderedInput = hasPositionerParent ? /*#__PURE__*/_jsx(FieldRootContext.Provider, {\n value: DEFAULT_FIELD_ROOT_CONTEXT,\n children: element\n }) : element;\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [open && focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.context.startDismissRef\n }), renderedInput]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInput.displayName = \"ComboboxInput\";","import { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport * as ComboboxInputDataAttributes from \"../input/ComboboxInputDataAttributes.mjs\";\nexport const triggerStateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n [ComboboxInputDataAttributes.popupSide]: side\n } : null,\n listEmpty: empty => empty ? {\n [ComboboxInputDataAttributes.listEmpty]: ''\n } : null\n};","import { CommonTriggerDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the corresponding popup is open.\n */\nexport const popupOpen = CommonTriggerDataAttributes.popupOpen;\n/**\n * Present when the input is pressed.\n */\nexport const pressed = CommonTriggerDataAttributes.pressed;\n/**\n * Present when the component is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the component is readonly.\n */\nexport const readonly = 'data-readonly';\n/**\n * Indicates which side the corresponding popup is positioned relative to its anchor.\n * @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}\n */\nexport const popupSide = 'data-popup-side';\n/**\n * Present when the component is required.\n */\nexport const required = 'data-required';\n/**\n * Present when the component is in a valid state (when wrapped in Field.Root).\n */\nexport const valid = 'data-valid';\n/**\n * Present when the component is in an invalid state (when wrapped in Field.Root).\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the component has been touched (when wrapped in Field.Root).\n */\nexport const touched = 'data-touched';\n/**\n * Present when the component's value has changed (when wrapped in Field.Root).\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the component has a value (when wrapped in Field.Root).\n */\nexport const filled = 'data-filled';\n/**\n * Present when the input is focused (when wrapped in Field.Root).\n */\nexport const focused = 'data-focused';\n/**\n * Present when the corresponding items list is empty.\n */\nexport const listEmpty = 'data-list-empty';","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useFieldRootContext } from \"./FieldRootContext.mjs\";\n\n/**\n * Returns the field's `setFocused`, recording which control the focused state belongs to.\n *\n * Disabling or unmounting a focused control moves focus away without firing `blur`, so the focused\n * state would otherwise stay latched. A field can have several focus targets, so a control only\n * clears the shared state when focus last landed on itself. The stable callback doubles as that\n * identity.\n */\nexport function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {\n const {\n setFocused,\n focusOwnerRef\n } = useFieldRootContext();\n const setFieldFocused = useStableCallback(focused => {\n // A disabled target can still be focused (`aria-disabled` elements stay programmatically\n // focusable), but must not publish the field's focused styling.\n if (focused ? !disabled : focusOwnerRef.current === setFieldFocused) {\n focusOwnerRef.current = focused && setFieldFocused;\n onFocusedChange?.(focused);\n setFocused(focused);\n }\n });\n\n // Re-run when `disabled` changes so a focused control releases the field even when the browser\n // does not fire `blur`. The setup reclaims focus that no focus event reported: StrictMode\n // re-running effects after a mount-time focus, a control focused before hydration, or an\n // `aria-disabled` control re-enabled while it kept focus.\n useIsoLayoutEffect(() => {\n const el = focusTargetRef.current;\n const root = el?.getRootNode();\n if (root?.activeElement === el) {\n setFieldFocused(true);\n }\n return () => setFieldFocused(false);\n }, [disabled, focusTargetRef, setFieldFocused]);\n return setFieldFocused;\n}","'use client';\n\nimport * as React from 'react';\nexport const ComboboxChipsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipsContext.displayName = \"ComboboxChipsContext\";\nexport function useComboboxChipsContext() {\n return React.useContext(ComboboxChipsContext);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPositionerContext.displayName = \"ComboboxPositionerContext\";\nexport function useComboboxPositionerContext(optional) {\n const context = React.useContext(ComboboxPositionerContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component' : _formatErrorMessage(21));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * @internal\n */\nexport const ComboboxInternalDismissButton = /*#__PURE__*/React.forwardRef(function ComboboxInternalDismissButton(_, forwardedRef) {\n const store = useComboboxRootContext();\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: false\n });\n const mergedRef = useMergedRefs(forwardedRef, buttonRef);\n function handleDismiss(event) {\n store.context.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent, event.currentTarget));\n }\n const dismissProps = getButtonProps({\n onClick: handleDismiss\n });\n return /*#__PURE__*/_jsx(\"span\", {\n ref: mergedRef,\n ...dismissProps,\n \"aria-label\": \"Dismiss\",\n tabIndex: undefined,\n style: visuallyHiddenInput\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInternalDismissButton.displayName = \"ComboboxInternalDismissButton\";","'use client';\n\nimport { useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\n/**\n * The popup side is only meaningful while the positioner is mounted, as the store retains the\n * last resolved side after the popup unmounts.\n */\nexport function usePopupSide(store) {\n const mounted = store.useState('mounted');\n const popupSide = store.useState('popupSide');\n const positionerElement = store.useState('positionerElement');\n return mounted && positionerElement ? popupSide : null;\n}\n\n/**\n * Whether the filtered list has no items to show.\n */\nexport function useListEmpty() {\n return useComboboxDerivedItemsContext().filteredItems.length === 0;\n}\n\n/**\n * The arrow keys that move the chip highlight backwards and forwards, in that order.\n */\nexport function getChipNavigationKeys(direction) {\n return direction === 'rtl' ? ['ArrowRight', 'ArrowLeft'] : ['ArrowLeft', 'ArrowRight'];\n}\n\n/**\n * Where the highlight lands once the chip at `index` is removed, or `undefined` for no highlight.\n */\nexport function getIndexAfterChipRemoval(index, chipCount) {\n const nextIndex = index >= chipCount - 1 ? chipCount - 2 : index;\n return nextIndex >= 0 ? nextIndex : undefined;\n}\n\n/**\n * Commits the highlighted item by clicking it, tagging the originating event so the item's\n * handler can attribute the selection to it.\n */\nexport function clickHighlightedItem(store, activeIndex, nativeEvent) {\n const listItem = store.context.listRef.current[activeIndex];\n if (listItem) {\n store.context.selectionEventRef.current = nativeEvent;\n listItem.click();\n store.context.selectionEventRef.current = null;\n }\n}","import { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getTarget, isInteractiveElement } from \"../../floating-ui-react/utils/element.mjs\";\nexport function handleInputPress(event, store, disabled, shouldIgnoreTarget) {\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n const targetElement = isElement(target) ? target : null;\n if (targetElement !== event.currentTarget && (shouldIgnoreTarget?.(targetElement) || isInteractiveElement(targetElement))) {\n return;\n }\n event.preventDefault();\n if (disabled) {\n return;\n }\n store.context.inputRef.current?.focus();\n if (store.state.openOnInputClick) {\n store.context.setOpen(true, createChangeEventDetails(REASONS.inputPress, event.nativeEvent));\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\nimport { handleInputPress } from \"../utils/handleInputPress.mjs\";\nimport { useListEmpty, usePopupSide } from \"../utils/parts.mjs\";\nimport { contains } from \"../../floating-ui-react/utils/element.mjs\";\n\n/**\n * A wrapper for the input and its associated controls.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxInputGroup = /*#__PURE__*/React.forwardRef(function ComboboxInputGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState\n } = useFieldRootContext();\n const store = useComboboxRootContext();\n const open = store.useState('open');\n const comboboxDisabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const hasSelectedValue = store.useState('hasSelectedValue');\n const selectionMode = store.useState('selectionMode');\n const popupSide = usePopupSide(store);\n const disabled = comboboxDisabled;\n const listEmpty = useListEmpty();\n const placeholder = selectionMode === 'none' ? false : !hasSelectedValue;\n const state = {\n ...fieldState,\n open,\n disabled,\n readOnly,\n popupSide,\n listEmpty,\n placeholder\n };\n const setInputGroupElement = useStableCallback(element => {\n store.set('inputGroupElement', element);\n });\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setInputGroupElement],\n props: [{\n role: 'group',\n onMouseDown(event) {\n handleInputPress(event, store, disabled, target => {\n return contains(store.context.chipsContainerRef.current, target);\n });\n }\n }, elementProps],\n state,\n stateAttributesMapping: triggerStateAttributesMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInputGroup.displayName = \"ComboboxInputGroup\";","'use client';\n\nimport * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GroupCollectionContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") GroupCollectionContext.displayName = \"GroupCollectionContext\";\nexport function useGroupCollectionContext() {\n return React.useContext(GroupCollectionContext);\n}\nexport function GroupCollectionProvider(props) {\n const {\n children,\n items\n } = props;\n const contextValue = React.useMemo(() => ({\n items\n }), [items]);\n return /*#__PURE__*/_jsx(GroupCollectionContext.Provider, {\n value: contextValue,\n children: children\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useGroupCollectionContext } from \"./GroupCollectionContext.mjs\";\n\n/**\n * Renders filtered list items.\n * Doesn't render its own HTML element.\n *\n * If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ComboboxCollection(props) {\n const {\n children\n } = props;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const groupContext = useGroupCollectionContext();\n const itemsToRender = groupContext ? groupContext.items : filteredItems;\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: itemsToRender.map(children)\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxDerivedItemsContext, useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { ComboboxCollection } from \"../collection/ComboboxCollection.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { clickHighlightedItem } from \"../utils/parts.mjs\";\n\n/**\n * A list container for the items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxList = /*#__PURE__*/React.forwardRef(function ComboboxList(componentProps, forwardedRef) {\n var _ComboboxCollection;\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const floatingRootContext = useComboboxFloatingContext();\n const hasPositionerContext = Boolean(useComboboxPositionerContext(true));\n const {\n filteredItems,\n hasItems\n } = useComboboxDerivedItemsContext();\n const selectionMode = store.useState('selectionMode');\n const grid = store.useState('grid');\n const readOnly = store.useState('readOnly');\n const listProps = store.useState('listProps');\n const virtualized = store.useState('virtualized');\n const forceMounted = store.useState('forceMounted');\n const multiple = selectionMode === 'multiple';\n const empty = filteredItems.length === 0;\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n\n // Support \"closed template\" API: if children is a function, implicitly wrap it\n // with a Combobox.Collection that reads items from context/root.\n // Ensures this component's `listProps` subscription does not cause <Combobox.Item>\n // to re-render on every active index change.\n const resolvedChildren = React.useMemo(() => {\n if (typeof children === 'function') {\n return _ComboboxCollection || (_ComboboxCollection = /*#__PURE__*/_jsx(ComboboxCollection, {\n children: children\n }));\n }\n return children;\n }, [children]);\n const state = {\n empty\n };\n const floatingId = floatingRootContext.useState('floatingId');\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, setListElement, hasPositionerContext ? null : setPositionerElement],\n props: [listProps, {\n children: resolvedChildren,\n tabIndex: -1,\n id: floatingId,\n role: grid ? 'grid' : 'listbox',\n 'aria-multiselectable': multiple ? 'true' : undefined,\n // On a grid the attribute describes cell editability, not selection, so it's left to the\n // combobox element in that mode.\n 'aria-readonly': !grid && readOnly ? true : undefined,\n onKeyDown(event) {\n if (store.state.disabled || store.state.readOnly) {\n return;\n }\n if (event.key === 'Enter') {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n // Allow form submission when no item is highlighted.\n return;\n }\n stopEvent(event);\n clickHighlightedItem(store, activeIndex, event.nativeEvent);\n }\n }\n }, elementProps]\n });\n if (virtualized) {\n return element;\n }\n\n // With the `items` prop, typeahead labels are derived from the items so they survive the list\n // unmounting (unmounting clears the registered labels). Rendered labels only need to be\n // registered when the list is force-mounted to match browser autofill against rendered text.\n const labelsRef = hasItems && !forceMounted ? undefined : store.context.labelsRef;\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: store.context.listRef,\n labelsRef: labelsRef,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxList.displayName = \"ComboboxList\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { ComboboxPortalContext } from \"./ComboboxPortalContext.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxPortal = /*#__PURE__*/React.forwardRef(function ComboboxPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useComboboxRootContext();\n const mounted = store.useState('mounted');\n const forceMounted = store.useState('forceMounted');\n const shouldRender = mounted || keepMounted || forceMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ComboboxPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPortal.displayName = \"ComboboxPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPortalContext.displayName = \"ComboboxPortalContext\";\nexport function useComboboxPortalContext() {\n const context = React.useContext(ComboboxPortalContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Portal> is missing.' : _formatErrorMessage(20));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { ComboboxPositionerContext } from \"./ComboboxPositionerContext.mjs\";\nimport { useListEmpty } from \"../utils/parts.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { useComboboxPortalContext } from \"../portal/ComboboxPortalContext.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\n\n/**\n * Positions the popup against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxPositioner = /*#__PURE__*/React.forwardRef(function ComboboxPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n // `useAnchorPositioning` applies the same defaults to the undefined values; the names\n // remain destructured to exclude the props from `elementProps`.\n positionMethod,\n side,\n align,\n sideOffset,\n alignOffset,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding,\n sticky,\n disableAnchorTracking = false,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style: styleProp,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const floatingRootContext = useComboboxFloatingContext();\n const keepMounted = useComboboxPortalContext();\n const modal = store.useState('modal');\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const openMethod = store.useState('openMethod');\n const positionerElement = store.useState('positionerElement');\n const triggerElement = store.useState('triggerElement');\n const inputElement = store.useState('inputElement');\n const inputGroupElement = store.useState('inputGroupElement');\n const inputInsidePopup = store.useState('inputInsidePopup');\n const transitionStatus = store.useState('transitionStatus');\n const empty = useListEmpty();\n const resolvedAnchor = anchor ?? (inputInsidePopup ? triggerElement : inputGroupElement ?? inputElement);\n const positioning = useAnchorPositioning({\n anchor: resolvedAnchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking,\n keepMounted,\n collisionAvoidance,\n lazyFlip: true\n });\n useAnchoredPopupScrollLock(open && modal, openMethod === 'touch', positionerElement, triggerElement);\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n empty\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n return /*#__PURE__*/_jsxs(ComboboxPositionerContext.Provider, {\n value: positioning,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: inputGroupElement ?? inputElement ?? triggerElement\n }), element]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPositioner.displayName = \"ComboboxPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.mjs\";\nimport { getComboboxPopupId } from \"../root/utils/index.mjs\";\nimport { useListEmpty } from \"../utils/parts.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxPopup = /*#__PURE__*/React.forwardRef(function ComboboxPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n initialFocus,\n finalFocus,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const positioning = useComboboxPositionerContext();\n const floatingRootContext = useComboboxFloatingContext();\n const mounted = store.useState('mounted');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const popupProps = store.useState('popupProps');\n const transitionStatus = store.useState('transitionStatus');\n const inputInsidePopup = store.useState('inputInsidePopup');\n const inputElement = store.useState('inputElement');\n const modal = store.useState('modal');\n const rootId = store.useState('id');\n const empty = useListEmpty();\n const popupId = elementProps.id ?? (inputInsidePopup ? getComboboxPopupId(rootId) : undefined);\n useIsoLayoutEffect(() => {\n // Prefer the rendered DOM id, which a `render` prop element or function may override.\n store.set('popupId', store.context.popupRef.current?.id || popupId);\n return () => {\n store.set('popupId', undefined);\n };\n }, [store, popupId]);\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete(true);\n }\n }\n });\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n transitionStatus,\n empty\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef],\n props: [popupProps, {\n id: popupId,\n role: inputInsidePopup ? 'dialog' : 'presentation',\n onFocus(event) {\n const target = getTarget(event.nativeEvent);\n if (openMethod !== 'touch' && (contains(store.state.listElement, target) || target === event.currentTarget)) {\n store.context.inputRef.current?.focus();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping\n });\n\n // Default initial focus logic:\n // If opened by touch, focus the popup element to prevent the virtual keyboard from opening\n // (this is required for Android specifically as iOS handles this automatically).\n const computedDefaultInitialFocus = inputInsidePopup ? interactionType => interactionType === 'touch' ? store.context.popupRef.current : inputElement : false;\n const resolvedInitialFocus = initialFocus === undefined ? computedDefaultInitialFocus : initialFocus;\n let resolvedFinalFocus;\n if (finalFocus != null) {\n resolvedFinalFocus = finalFocus;\n } else {\n resolvedFinalFocus = inputInsidePopup ? undefined : false;\n }\n const focusManagerModal = !inputInsidePopup || modal;\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n disabled: !mounted,\n modal: focusManagerModal,\n openInteractionType: openMethod,\n initialFocus: resolvedInitialFocus,\n returnFocus: resolvedFinalFocus,\n getInsideElements: () => [store.context.startDismissRef.current, store.context.endDismissRef.current],\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [element, focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.context.endDismissRef\n })]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPopup.displayName = \"ComboboxPopup\";","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useComboboxRootContext, useComboboxHasItemsContext, useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxItemContext } from \"./ComboboxItemContext.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { useComboboxRowContext } from \"../row/ComboboxRowContext.mjs\";\nimport { compareItemEquality, findItemIndex, resolveSelectedIndex } from \"../../internals/itemEquality.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction ComboboxItemInner(props) {\n const {\n componentProps,\n forwardedRef,\n virtualized,\n indexFromFilter\n } = props;\n const {\n render,\n className,\n style,\n value: itemValue = null,\n index: indexProp,\n disabled: disabledProp = false,\n nativeButton = false,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n guess: true,\n index: indexProp,\n textRef\n });\n const store = useComboboxRootContext();\n const isRow = useComboboxRowContext();\n const hasItems = useComboboxHasItemsContext();\n const {\n props: itemProps,\n id: rootId,\n selectionMode,\n disabled: rootDisabled,\n readOnly,\n isItemEqualToValue\n } = store.useState('itemRoot');\n const disabled = rootDisabled || disabledProp;\n const selectable = selectionMode !== 'none';\n const index = indexProp ?? indexFromFilter ?? listItem.index;\n const hasRegistered = index !== -1;\n const highlighted = store.useState('isActive', index);\n const matchesSelectedValue = store.useState('isSelected', itemValue);\n const itemRef = React.useRef(null);\n const id = rootId != null && hasRegistered ? `${rootId}-${index}` : undefined;\n const selected = matchesSelectedValue && selectable;\n useIsoLayoutEffect(() => {\n const shouldRun = hasRegistered && (virtualized || indexProp != null);\n if (!shouldRun) {\n return undefined;\n }\n const list = store.context.listRef.current;\n list[index] = itemRef.current;\n return () => {\n delete list[index];\n };\n }, [hasRegistered, virtualized, index, indexProp, store]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered || hasItems) {\n return undefined;\n }\n const visibleValues = store.context.valuesRef.current;\n visibleValues[index] = itemValue;\n return () => {\n delete visibleValues[index];\n };\n }, [hasRegistered, hasItems, index, itemValue, store]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered || hasItems) {\n return;\n }\n\n // Runs while closed as well (the list can stay mounted via `keepMounted` or a\n // force-mount) so the index tracks the item's composite position, keeping features\n // like closed-trigger typeahead in sync when the rendered order changes.\n const selectedValue = store.state.selectedValue;\n let nextIndex = store.state.selectedIndex;\n if (store.state.selectionMode === 'multiple' && Array.isArray(selectedValue)) {\n nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, nextIndex);\n } else if (compareItemEquality(itemValue, selectedValue, isItemEqualToValue)) {\n nextIndex = index;\n }\n store.set('selectedIndex', nextIndex);\n }, [hasRegistered, hasItems, store, index, itemValue, isItemEqualToValue]);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const state = {\n disabled,\n selected,\n highlighted\n };\n function commitSelection(nativeEvent) {\n function selectItem() {\n store.context.handleSelection(nativeEvent, itemValue);\n }\n if (store.state.submitOnItemClick) {\n ReactDOM.flushSync(selectItem);\n store.context.requestSubmit();\n } else {\n selectItem();\n }\n }\n const defaultProps = {\n id,\n role: isRow ? 'gridcell' : 'option',\n 'aria-selected': selectable ? selected : undefined,\n // Focusable items steal focus from the input upon mouseup.\n // Warn if the user renders a natively focusable element like `<button>`,\n // as it should be a `<div>` instead.\n tabIndex: undefined,\n onPointerDownCapture(event) {\n // The compat `mouseup` only fires for the primary pointer, so a non-primary\n // touch must not overwrite the shared ref — a mismatch would make the primary\n // pointer's release read as a drag-select and commit a second time after `click`.\n if (event.isPrimary) {\n store.context.pointerDownItemRef.current = event.currentTarget;\n }\n event.preventDefault();\n },\n onMouseDown(event) {\n // iOS Safari can emit a synthetic mousedown for touch taps without a preceding\n // pointerdown. Prevent default here too so tapping an item does not blur the input.\n event.preventDefault();\n },\n onClick(event) {\n if (disabled || readOnly) {\n return;\n }\n commitSelection(event.nativeEvent);\n },\n onMouseUp(event) {\n const pointerStartedOnItem = store.context.pointerDownItemRef.current === event.currentTarget;\n store.context.pointerDownItemRef.current = null;\n if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) {\n return;\n }\n commitSelection(event.nativeEvent);\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [itemProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n textRef\n }), [selected, textRef]);\n return /*#__PURE__*/_jsx(ComboboxItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}\n\n/**\n * Resolves the index from the filtered items for the virtualized fallback (no `index` prop).\n * Isolated here so that this per-keystroke subscription to the derived-items context is only\n * paid by virtualized items. Those re-render on every input change anyway — the parent\n * virtualizer re-windows the list as the filtered set changes — so the extra subscription costs\n * them nothing, while it keeps every non-virtualized item off that context.\n */\nfunction ComboboxItemVirtualizedIndex(props) {\n const {\n componentProps,\n forwardedRef\n } = props;\n const store = useComboboxRootContext();\n const isItemEqualToValue = store.useState('isItemEqualToValue');\n const {\n flatFilteredValues\n } = useComboboxDerivedItemsContext();\n const lookupValue = componentProps.value ?? null;\n const indexFromFilter = findItemIndex(flatFilteredValues, lookupValue, isItemEqualToValue);\n\n // Only reached when `virtualized` is true (see the wrapper below).\n return /*#__PURE__*/_jsx(ComboboxItemInner, {\n componentProps: componentProps,\n forwardedRef: forwardedRef,\n virtualized: true,\n indexFromFilter: indexFromFilter\n });\n}\n\n/**\n * An individual item in the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ComboboxItem(componentProps, forwardedRef) {\n const store = useComboboxRootContext();\n const virtualized = store.useState('virtualized');\n\n // `virtualized` (and whether an item provides an explicit `index`) must be stable for an\n // item's lifetime: the two branches return different component types, so flipping it at\n // runtime remounts the item and resets its refs and effects.\n if (virtualized && componentProps.index == null) {\n return /*#__PURE__*/_jsx(ComboboxItemVirtualizedIndex, {\n componentProps: componentProps,\n forwardedRef: forwardedRef\n });\n }\n return /*#__PURE__*/_jsx(ComboboxItemInner, {\n componentProps: componentProps,\n forwardedRef: forwardedRef,\n virtualized: virtualized,\n indexFromFilter: undefined\n });\n}));\nif (process.env.NODE_ENV !== \"production\") ComboboxItem.displayName = \"ComboboxItem\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxItemContext.displayName = \"ComboboxItemContext\";\nexport function useComboboxItemContext() {\n const context = React.useContext(ComboboxItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.' : _formatErrorMessage(19));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport const ComboboxRowContext = /*#__PURE__*/React.createContext(false);\nif (process.env.NODE_ENV !== \"production\") ComboboxRowContext.displayName = \"ComboboxRowContext\";\nexport function useComboboxRowContext() {\n return React.useContext(ComboboxRowContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useTransitionStatus } from \"../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\nimport { transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\n\n// The public wrappers mount this component only when selected or kept mounted, avoiding the\n// hook costs for unselected items. Pass selection as a prop so memoization observes changes.\nexport const ItemIndicator = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ItemIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted,\n selected,\n ...elementProps\n } = componentProps;\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n batch: true,\n enabled: !selected,\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") ItemIndicator.displayName = \"ItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useComboboxItemContext } from \"../item/ComboboxItemContext.mjs\";\nimport { ItemIndicator } from \"../../utils/ItemIndicator.mjs\";\n\n/**\n * Indicates whether the item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxItemIndicator = /*#__PURE__*/React.forwardRef(function ComboboxItemIndicator(componentProps, forwardedRef) {\n const {\n selected\n } = useComboboxItemContext();\n const shouldRender = componentProps.keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ItemIndicator, {\n ...componentProps,\n selected: selected,\n ref: forwardedRef\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxItemIndicator.displayName = \"ComboboxItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ComboboxChipsContext } from \"./ComboboxChipsContext.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { handleInputPress } from \"../utils/handleInputPress.mjs\";\n\n/**\n * A container for the chips in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChips = /*#__PURE__*/React.forwardRef(function ComboboxChips(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const hasSelectionChips = store.useState('hasSelectionChips');\n const chipsRef = React.useRef([]);\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.context.chipsContainerRef],\n // NVDA enters browse mode instead of staying in focus mode when navigating with\n // arrow keys inside a container unless it has a toolbar role.\n props: [hasSelectionChips ? {\n role: 'toolbar'\n } : EMPTY_OBJECT, {\n onMouseDown(event) {\n handleInputPress(event, store, store.state.disabled);\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n chipsRef\n }), []);\n return /*#__PURE__*/_jsx(ComboboxChipsContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: chipsRef,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChips.displayName = \"ComboboxChips\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxChipContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipContext.displayName = \"ComboboxChipContext\";\nexport function useComboboxChipContext() {\n const context = React.useContext(ComboboxChipContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxChipContext is missing. ComboboxChip parts must be placed within <Combobox.Chip>.' : _formatErrorMessage(17));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { ComboboxChipContext } from \"./ComboboxChipContext.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport { getChipNavigationKeys, getIndexAfterChipRemoval } from \"../utils/parts.mjs\";\n\n/**\n * An individual chip that represents a value in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChip = /*#__PURE__*/React.forwardRef(function ComboboxChip(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n chipsRef\n } = useComboboxChipsContext();\n const direction = useDirection();\n const disabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const selectedValue = store.useState('selectedValue');\n const {\n ref,\n index\n } = useCompositeListItem();\n function handleKeyDown(event) {\n let nextIndex = index;\n const [previousChipKey, nextChipKey] = getChipNavigationKeys(direction);\n if (event.key === previousChipKey) {\n event.preventDefault();\n if (index > 0) {\n nextIndex = index - 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === nextChipKey) {\n event.preventDefault();\n if (index < chipsRef.current.length - 1) {\n nextIndex = index + 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n nextIndex = getIndexAfterChipRemoval(index, selectedValue.length);\n stopEvent(event);\n\n // Commit the removal before focusing so `chipsRef` reflects the remaining chips.\n ReactDOM.flushSync(() => {\n store.context.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: REASONS.keyboard,\n event: event.nativeEvent\n });\n store.context.setSelectedValue(selectedValue.filter((_, i) => i !== index), createChangeEventDetails(REASONS.none, event.nativeEvent));\n });\n } else if (event.key === 'Enter' || event.key === ' ') {\n stopEvent(event);\n nextIndex = undefined;\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n stopEvent(event);\n // The input may mount when opening.\n ReactDOM.flushSync(() => {\n store.context.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n });\n nextIndex = undefined;\n } else if (\n // Check for printable characters (letters, numbers, symbols)\n event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n nextIndex = undefined;\n }\n return nextIndex;\n }\n const state = {\n disabled\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, ref],\n state,\n props: [{\n tabIndex: -1,\n 'aria-disabled': disabled || undefined,\n 'aria-readonly': readOnly || undefined,\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n const nextIndex = handleKeyDown(event);\n if (nextIndex === undefined) {\n store.context.inputRef.current?.focus();\n } else {\n chipsRef.current[nextIndex]?.focus();\n }\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n index\n }), [index]);\n return /*#__PURE__*/_jsx(ComboboxChipContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChip.displayName = \"ComboboxChip\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useComboboxChipContext } from \"../chip/ComboboxChipContext.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { getHighlightReason } from \"../../utils/getHighlightReason.mjs\";\nimport { findItemIndex } from \"../../internals/itemEquality.mjs\";\n\n/**\n * A button to remove a chip.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxChipRemove = /*#__PURE__*/React.forwardRef(function ComboboxChipRemove(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n index\n } = useComboboxChipContext();\n const comboboxDisabled = store.useState('disabled');\n const readOnly = store.useState('readOnly');\n const selectedValue = store.useState('selectedValue');\n const isItemEqualToValue = store.useState('isItemEqualToValue');\n const disabled = comboboxDisabled || disabledProp;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled: disabled || readOnly,\n focusableWhenDisabled: true\n });\n const state = {\n disabled\n };\n function clearActiveIndexForRemovedItem(removedItem, event) {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n return;\n }\n\n // Try current visible list first; if not found, it's filtered out.\n // No need to clear highlight in that case since it can't equal activeIndex.\n const removedIndex = findItemIndex(store.context.valuesRef.current, removedItem, isItemEqualToValue);\n if (removedIndex !== -1 && activeIndex === removedIndex) {\n store.context.setIndices({\n activeIndex: null,\n type: getHighlightReason(event),\n event\n });\n }\n }\n function removeChip(event) {\n const eventDetails = createChangeEventDetails(REASONS.chipRemovePress, event.nativeEvent);\n const removedItem = selectedValue[index];\n clearActiveIndexForRemovedItem(removedItem, event.nativeEvent);\n store.context.setSelectedValue(selectedValue.filter((_, i) => i !== index), eventDetails);\n store.context.inputRef.current?.focus();\n return eventDetails;\n }\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n tabIndex: -1,\n onMouseDown(event) {\n event.preventDefault();\n },\n onClick(event) {\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n },\n onKeyDown(event) {\n if (event.key === 'Enter' || event.key === ' ') {\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n stopEvent(event);\n }\n }\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChipRemove.displayName = \"ComboboxChipRemove\";","'use client';\n\nimport * as React from 'react';\nimport { platform } from '@base-ui/utils/platform';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\n\n// Word Joiner is invisible and zero-width, so it forces a text mutation without shifting layout.\nconst LIVE_REGION_MARKER = '\\u2060';\n// Safari VoiceOver needed roughly 200ms to reliably notice the initial polite live-region change.\nexport const INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY = 200;\nfunction findLastTextNode(root) {\n const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);\n let lastTextNode = null;\n while (walker.nextNode()) {\n const textNode = walker.currentNode;\n if (textNode.nodeValue !== '') {\n lastTextNode = textNode;\n }\n }\n return lastTextNode;\n}\n\n/**\n * @param present Whether the live region element is currently rendered. Lets a conditionally\n * rendered region re-run the marker each time its element (re)appears with text.\n */\nexport function useInitialLiveRegionTextMutation(present = true) {\n const timeout = useTimeout();\n const rootRef = React.useRef(null);\n\n // Only the initial mounted announcement needs the marker; later text updates announce naturally.\n React.useEffect(() => {\n if (!present || platform.os.ios) {\n return undefined;\n }\n const root = rootRef.current;\n if (root == null) {\n return undefined;\n }\n const textNode = findLastTextNode(root);\n if (textNode == null) {\n return undefined;\n }\n const originalValue = textNode.data;\n const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;\n textNode.nodeValue = markedValue;\n timeout.start(INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY, () => {\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n });\n return () => {\n timeout.clear();\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n };\n }, [present, rootRef, timeout]);\n return rootRef;\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useComboboxDerivedItemsContext, useComboboxRootContext } from \"../root/ComboboxRootContext.mjs\";\nimport { useInitialLiveRegionTextMutation } from \"../../internals/useInitialLiveRegionTextMutation.mjs\";\n\n/**\n * Renders its children only when the list is empty.\n * Requires the `items` prop on the root component.\n * Announces changes politely to screen readers.\n * This component's root element must remain mounted in the DOM to announce\n * changes consistently across screen readers. Avoid hiding or removing the\n * component itself with `display: none`, `hidden`, `aria-hidden`, or conditional\n * rendering. Prefer updating or conditionally rendering its children instead.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxEmpty = /*#__PURE__*/React.forwardRef(function ComboboxEmpty(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const store = useComboboxRootContext();\n const emptyRef = useInitialLiveRegionTextMutation();\n const children = filteredItems.length === 0 ? childrenProp : null;\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.context.emptyRef, emptyRef],\n props: [{\n children,\n role: 'status',\n 'aria-live': 'polite',\n 'aria-atomic': true\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxEmpty.displayName = \"ComboboxEmpty\";","'use client';\n\nimport { Combobox } from '@base-ui/react/combobox';\n\nimport type { ListedScope } from './needs-chips';\n\ninterface ScopeItem {\n value: string;\n label: string;\n description: string;\n}\n\nconst itemOf = ({ scope, description }: ListedScope): ScopeItem => ({ value: scope, label: scope, description });\n\n/**\n * Picks several of the fleet's listed scopes (gateway scopes 4.3), searched\n * by name or description. A scope picked before that the fleet no longer\n * lists stays picked, so it can be seen and removed.\n */\nexport function ScopePicker({ label, listed, picked, onPick, isDisabled = false, testId }: { label: string; listed: readonly ListedScope[]; picked: readonly string[]; onPick: (scopes: string[]) => void; isDisabled?: boolean; testId?: string }) {\n const { contains } = Combobox.useFilter();\n const items = [...listed.map(itemOf), ...picked.filter((scope) => !listed.some((each) => each.scope === scope)).map((scope) => ({ value: scope, label: scope, description: 'No longer defined in the fleet' }))];\n const value = items.filter((item) => picked.includes(item.value));\n return (\n <Combobox.Root\n multiple\n items={items}\n value={value}\n disabled={isDisabled}\n isItemEqualToValue={(item, chosen) => item.value === chosen.value}\n onValueChange={(next: ScopeItem[], details) => {\n // Escape closes the list; it never takes back what was picked.\n if (details.reason === 'escape-key') {\n details.cancel();\n return;\n }\n onPick(next.map((item) => item.value));\n }}\n filter={(item: ScopeItem, query) => contains(item.label, query) || contains(item.description, query)}\n >\n <div className=\"grid gap-1\" data-testid={testId}>\n <Combobox.Label className=\"font-medium\">{label}</Combobox.Label>\n <Combobox.InputGroup className=\"flex min-h-9 flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1\">\n <Combobox.Chips className=\"contents\">\n {value.map((item) => (\n <Combobox.Chip key={item.value} className=\"inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 font-mono text-caption\" aria-label={item.value}>\n {item.value}\n <Combobox.ChipRemove className=\"text-muted-foreground hover:text-foreground\" aria-label={`Remove ${item.value}`}>\n ×\n </Combobox.ChipRemove>\n </Combobox.Chip>\n ))}\n <Combobox.Input placeholder={value.length === 0 ? 'Search the fleet\\'s scopes' : ''} className=\"h-7 min-w-32 flex-1 bg-transparent outline-none\" />\n </Combobox.Chips>\n </Combobox.InputGroup>\n </div>\n <Combobox.Portal>\n <Combobox.Positioner sideOffset={4} className=\"z-50\">\n <Combobox.Popup className=\"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\">\n <Combobox.Empty className=\"px-2 py-1 text-muted-foreground\">No scope listed matches.</Combobox.Empty>\n <Combobox.List>\n {(item: ScopeItem) => (\n <Combobox.Item key={item.value} value={item} className=\"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded px-2 py-1 data-highlighted:bg-accent\">\n <Combobox.ItemIndicator className=\"row-span-2\">✓</Combobox.ItemIndicator>\n <span className=\"col-start-2 font-mono text-code\">{item.value}</span>\n <span className=\"col-start-2 text-caption text-muted-foreground\">{item.description}</span>\n </Combobox.Item>\n )}\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n );\n}\n","'use client';\n\nimport { Dialog } from '@base-ui/react/dialog';\nimport type { ReactNode } from 'react';\n\nimport { BUTTONS } from '../../../forms/ui/look';\nimport { ActionButton } from '../../../overview/ui/action-button';\n\n/** Why the API refused a change in a dialog: said inline, CONFLICT with Reload, at the requirements' version the change was made on. */\nexport interface DialogRefusal {\n message: string;\n isConflict: boolean;\n version: number;\n}\n\n/** The refusal still to say: a CONFLICT is answered once the page read newer requirements. */\nexport function standingRefusal(refusal: DialogRefusal | null, version: number): DialogRefusal | null {\n return refusal?.isConflict === true && version > refusal.version ? null : refusal;\n}\n\n/**\n * A dialog of the tools table (gateway scopes 4.3): its fields, a footer\n * saying what it applies to, and its action. While the action is on its\n * way the action shows its spinner and the dialog takes no input and does\n * not close; a refusal stays inline, with Reload when the requirements\n * changed since the page was read, which shows its spinner until the page\n * read them again.\n */\nexport function TableDialog({\n isOpen,\n onClose,\n title,\n description,\n children,\n appliesTo,\n action,\n isSaving,\n refusal,\n onReload,\n isReloading,\n testId,\n}: {\n isOpen: boolean;\n onClose: () => void;\n title: string;\n description: string;\n children: ReactNode;\n appliesTo: string;\n action: { label: string; pending: string; isDisabled: boolean; onPress: () => void };\n isSaving: boolean;\n refusal: DialogRefusal | null;\n onReload: () => void;\n isReloading: boolean;\n testId: string;\n}) {\n return (\n <Dialog.Root\n open={isOpen}\n onOpenChange={(open) => {\n if (!open && !isSaving) {\n onClose();\n }\n }}\n >\n <Dialog.Portal>\n <Dialog.Backdrop className=\"fixed inset-0 z-40 bg-(--overlay)\" />\n <Dialog.Popup className=\"fixed top-1/2 left-1/2 z-50 grid max-h-[90vh] w-[min(36rem,calc(100vw-2rem))] -translate-1/2 gap-4 overflow-auto rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-lg\" data-testid={testId}>\n <div className=\"grid gap-1\">\n <Dialog.Title className=\"text-heading font-semibold\">{title}</Dialog.Title>\n <Dialog.Description className=\"text-muted-foreground\">{description}</Dialog.Description>\n </div>\n <fieldset disabled={isSaving} className=\"grid gap-4\">\n {children}\n </fieldset>\n {refusal === null ? null : (\n <div role=\"alert\" className=\"flex flex-wrap items-center justify-between gap-2 rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg\" data-testid=\"tools-table-dialog-refusal\">\n <span>{refusal.message}</span>\n {refusal.isConflict ? (\n <ActionButton isPending={isReloading} pendingLabel=\"Reloading…\" onClick={onReload} data-testid=\"tools-table-reload\">\n Reload\n </ActionButton>\n ) : null}\n </div>\n )}\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <span className=\"text-muted-foreground\" data-testid=\"tools-table-applies-to\">\n {appliesTo}\n </span>\n <div className=\"flex gap-2\">\n <button type=\"button\" className={BUTTONS.secondary} disabled={isSaving} onClick={onClose}>\n Cancel\n </button>\n <ActionButton variant=\"primary\" isPending={isSaving} pendingLabel={action.pending} disabled={action.isDisabled || isReloading} onClick={action.onPress} data-testid=\"tools-table-dialog-action\">\n {action.label}\n </ActionButton>\n </div>\n </div>\n </Dialog.Popup>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n","'use client';\n\nimport { Toast } from '@base-ui/react/toast';\n\n/** The toasts a party's page raised, each saying what was kept (gateway scopes 4.3). */\nexport function TableToasts() {\n const { toasts } = Toast.useToastManager();\n return (\n <Toast.Portal>\n <Toast.Viewport className=\"fixed right-4 bottom-4 z-50 grid w-[min(24rem,calc(100vw-2rem))] gap-2\">\n {toasts.map((toast) => (\n <Toast.Root key={toast.id} toast={toast} className=\"rounded-md border border-tone-ok-border bg-tone-ok-bg px-4 py-3 text-tone-ok-fg shadow-md\" data-testid=\"tools-table-toast\">\n <Toast.Content className=\"flex items-start justify-between gap-3\">\n <Toast.Title />\n <Toast.Close aria-label=\"Dismiss\">×</Toast.Close>\n </Toast.Content>\n </Toast.Root>\n ))}\n </Toast.Viewport>\n </Toast.Portal>\n );\n}\n","/** A switch: on or off, said by its look and to a screen reader, busy while its change is on its way. */\nexport function Switch({ isOn, label, isPending = false, type = 'button', onClick, testId }: { isOn: boolean; label: string; isPending?: boolean; type?: 'button' | 'submit'; onClick?: () => void; testId?: string }) {\n return (\n <button\n type={type}\n role=\"switch\"\n aria-checked={isOn}\n aria-label={label}\n aria-busy={isPending}\n disabled={isPending}\n onClick={onClick}\n data-testid={testId}\n className={`inline-flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition-colors disabled:opacity-60 ${isOn ? 'border-primary bg-primary' : 'border-input bg-muted'}`}\n >\n <span className={`size-3.5 rounded-full bg-background shadow-sm transition-transform ${isOn ? 'translate-x-4' : 'translate-x-0'} ${isPending ? 'animate-pulse' : ''}`} />\n </button>\n );\n}\n","'use client';\n\nimport { Toast } from '@base-ui/react/toast';\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport { setPartyScopes } from '../../actions';\nimport { agentScopesSetMessage, statedMessage } from '../table-messages';\nimport { NeedsChips, type ListedScope } from './needs-chips';\nimport { ScopePicker } from './scope-picker';\nimport { standingRefusal, TableDialog, type DialogRefusal } from './table-dialog';\nimport { TableToasts } from './table-toasts';\n\n/**\n * An outside A2A agent's one Needs line (gateway scopes 4.3): its messages\n * name no skill, so one set of scopes guards the agent as a whole, changed\n * in a dialog on the version the page read.\n */\nexport function AgentNeeds(props: { fleetId: string; party: string; version: number; scopes: readonly string[]; listed: readonly ListedScope[] | null; canChange: boolean }) {\n return (\n <Toast.Provider>\n <AgentNeedsLine {...props} />\n <TableToasts />\n </Toast.Provider>\n );\n}\n\nfunction AgentNeedsLine({ fleetId, party, version, scopes, listed, canChange }: { fleetId: string; party: string; version: number; scopes: readonly string[]; listed: readonly ListedScope[] | null; canChange: boolean }) {\n const router = useRouter();\n const toasts = Toast.useToastManager();\n const [, startTransition] = useTransition();\n const [isReloading, startReload] = useTransition();\n const [isOpen, setIsOpen] = useState(false);\n const [picked, setPicked] = useState<string[]>([]);\n const [isSaving, setIsSaving] = useState(false);\n const [refusal, setRefusal] = useState<DialogRefusal | null>(null);\n const [keptVersion, setKeptVersion] = useState<number | null>(null);\n const [round, setRound] = useState(0);\n const [kept, setKept] = useState<{ basis: readonly string[]; scopes: readonly string[] } | null>(null);\n // What was kept shows at once; once the page read itself again, its scopes are the truth.\n const shown = kept?.basis === scopes ? kept.scopes : scopes;\n\n const save = () => {\n setIsSaving(true);\n setRefusal(null);\n const madeOn = Math.max(version, keptVersion ?? 0);\n startTransition(async () => {\n const outcome = await setPartyScopes({ fleetId, name: party, version: madeOn, party: picked, tools: [] });\n setIsSaving(false);\n if (!outcome.isOk) {\n setRefusal({ message: outcome.message, isConflict: outcome.isConflict, version: madeOn });\n return;\n }\n setKeptVersion(outcome.version);\n setKept({ basis: scopes, scopes: picked });\n setIsOpen(false);\n setRound((previous) => previous + 1);\n toasts.add({ title: statedMessage(agentScopesSetMessage({ party, scopes: picked }), outcome.statementRefusal) });\n router.refresh();\n });\n };\n\n return (\n <div key={round} className={`flex flex-wrap items-center gap-2 rounded-md ${round > 0 ? 'animate-highlight' : ''}`} data-testid=\"agent-needs\">\n <NeedsChips own={shown} listed={listed === null ? null : new Set(listed.map(({ scope }) => scope))} />\n {canChange && listed !== null ? (\n <>\n <button\n type=\"button\"\n className=\"text-primary hover:underline\"\n onClick={() => {\n setPicked([...shown]);\n setRefusal(null);\n setIsOpen(true);\n }}\n data-testid=\"agent-needs-change\"\n >\n Change…\n </button>\n <TableDialog\n isOpen={isOpen}\n onClose={() => { setIsOpen(false); }}\n title=\"Every message needs\"\n description={`The scopes a calling ship must hold to message ${party}.`}\n appliesTo={`Applies to every message to ${party}`}\n action={{ label: 'Save', pending: 'Saving…', isDisabled: false, onPress: save }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, Math.max(version, keptVersion ?? 0))}\n isReloading={isReloading}\n onReload={() => {\n startReload(() => {\n router.refresh();\n });\n }}\n testId=\"agent-needs-dialog\"\n >\n <ScopePicker label=\"Scopes\" listed={listed} picked={picked} onPick={setPicked} isDisabled={isSaving} testId=\"agent-needs-picker\" />\n </TableDialog>\n </>\n ) : null}\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DrawerPopupCssVars from \"../popup/DrawerPopupCssVars.mjs\";\nimport * as DrawerBackdropCssVars from \"./DrawerBackdropCssVars.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerBackdrop = /*#__PURE__*/React.forwardRef(function DrawerBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.swipeStrength]: '1'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerBackdrop.displayName = \"DrawerBackdrop\";","/**\n * The number of nested drawers that are currently open.\n * @type {number}\n */\nexport const nestedDrawers = '--nested-drawers';\n/**\n * The height of the drawer popup.\n * @type {CSS length}\n */\nexport const height = '--drawer-height';\n/**\n * The height of the frontmost open drawer in the current nested drawer stack.\n * @type {CSS length}\n */\nexport const frontmostHeight = '--drawer-frontmost-height';\n/**\n * The swipe movement on the X axis.\n * @type {CSS length}\n */\nexport const swipeMovementX = '--drawer-swipe-movement-x';\n/**\n * The swipe movement on the Y axis.\n * @type {CSS length}\n */\nexport const swipeMovementY = '--drawer-swipe-movement-y';\n/**\n * The snap point offset used for translating the drawer.\n * @type {CSS length}\n */\nexport const snapPointOffset = '--drawer-snap-point-offset';\n/**\n * A scalar (0.1-1) used to scale the swipe release transition duration in CSS.\n * @type {number}\n */\nexport const swipeStrength = '--drawer-swipe-strength';","/**\n * The swipe progress of the drawer gesture.\n * @type {number}\n */\nexport const swipeProgress = '--drawer-swipe-progress';","'use client';\n\nimport { DialogClose } from \"../../dialog/close/DialogClose.mjs\";\n/**\n * A button that closes the drawer.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerClose = DialogClose;","export const DRAWER_CONTENT_ATTRIBUTE = 'data-drawer-content';","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { DRAWER_CONTENT_ATTRIBUTE } from \"./drawerContentAttribute.mjs\";\n\n/**\n * A container for the drawer contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerContent = /*#__PURE__*/React.forwardRef(function DrawerContent(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n useDialogRootContext();\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n [DRAWER_CONTENT_ATTRIBUTE]: ''\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerContent.displayName = \"DrawerContent\";","'use client';\n\nimport * as React from 'react';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport * as DrawerBackdropCssVars from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport * as DrawerPopupCssVars from \"./DrawerPopupCssVars.mjs\";\nimport * as DrawerPopupDataAttributes from \"./DrawerPopupDataAttributes.mjs\";\nimport { useDialogPortalContext } from \"../../dialog/portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerViewportContext } from \"../viewport/DrawerViewportContext.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\n\n// Module-level flag to ensure we only register the CSS properties once,\n// regardless of how many Drawer components are mounted.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet drawerSwipeVarsRegistered = false;\n\n/**\n * Removes inheritance of high-frequency drawer swipe CSS variables, which\n * reduces style recalculation cost in complex drawers with deep subtrees.\n * See https://motion.dev/blog/web-animation-performance-tier-list\n * under the \"Improving CSS variable performance\" section.\n */\nfunction removeCSSVariableInheritance() {\n if (drawerSwipeVarsRegistered) {\n return;\n }\n\n // Intentionally keep inheritance disabled on WebKit as well. Safari doesn't support\n // opting descendants back in via `--var: inherit` for custom properties registered\n // with `inherits: false`, but Drawer does not rely on descendant access to these vars\n // (unlike ScrollArea), so we keep the performance optimization enabled.\n if (typeof CSS !== 'undefined' && 'registerProperty' in CSS) {\n [DrawerPopupCssVars.swipeMovementX, DrawerPopupCssVars.swipeMovementY, DrawerPopupCssVars.snapPointOffset].forEach(name => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<length>',\n inherits: false,\n initialValue: '0px'\n });\n } catch {\n /* ignore already-registered */\n }\n });\n [{\n name: DrawerBackdropCssVars.swipeProgress,\n initialValue: '0'\n }, {\n name: DrawerPopupCssVars.swipeStrength,\n initialValue: '1'\n }].forEach(({\n name,\n initialValue\n }) => {\n try {\n CSS.registerProperty({\n name,\n syntax: '<number>',\n inherits: false,\n initialValue\n });\n } catch {\n /* ignore already-registered */\n }\n });\n }\n drawerSwipeVarsRegistered = true;\n}\nconst stateAttributesMapping = {\n ...popupTransitionStateMapping,\n expanded(value) {\n return value ? {\n [DrawerPopupDataAttributes.expanded]: ''\n } : null;\n },\n nestedDrawerOpen(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerOpen]: ''\n } : null;\n },\n nestedDrawerSwiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.nestedDrawerSwiping]: ''\n } : null;\n },\n swipeDirection(value) {\n return {\n [DrawerPopupDataAttributes.swipeDirection]: value\n };\n },\n swiping(value) {\n return value ? {\n [DrawerPopupDataAttributes.swiping]: ''\n } : null;\n }\n};\n\n/**\n * A container for the drawer contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPopup = /*#__PURE__*/React.forwardRef(function DrawerPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const {\n swipeDirection,\n frontmostHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onPopupHeightChange,\n notifyParentFrontmostHeight,\n notifyParentHasNestedDrawer\n } = useDrawerRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const transitionStatus = store.useState('transitionStatus');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n const popupId = elementProps.id ?? floatingId;\n const swipe = useDrawerViewportContext();\n useDialogPortalContext();\n const {\n snapPoints,\n activeSnapPoint,\n activeSnapPointOffset\n } = useDrawerSnapPoints();\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const swiping = swipe?.swiping ?? false;\n const swipeStrength = swipe?.swipeStrength ?? null;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const popupHeightRef = React.useRef(0);\n\n /* istanbul ignore else -- process.env.NODE_ENV is a build-time constant. */\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (swipe) {\n return;\n }\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the ' + 'viewport disables drawer swipe handling and touch scroll locking. Wrap ' + '<Drawer.Popup> in <Drawer.Viewport>.';\n error(`${message}${ownerStackMessage}`);\n }, [swipe]);\n }\n const measureHeight = useStableCallback(() => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const offsetHeight = popupElement.offsetHeight;\n\n // Only skip while the element is still actually stretched beyond its last measured height.\n if (popupHeightRef.current > 0 && frontmostHeight > popupHeightRef.current && offsetHeight > popupHeightRef.current) {\n return;\n }\n const keepHeightWhileNested = popupHeightRef.current > 0 && hasNestedDrawer;\n if (keepHeightWhileNested) {\n const oldHeight = popupHeightRef.current;\n setPopupHeight(oldHeight);\n onPopupHeightChange(oldHeight);\n return;\n }\n const nextHeight = offsetHeight;\n if (nextHeight === popupHeightRef.current) {\n return;\n }\n popupHeightRef.current = nextHeight;\n setPopupHeight(nextHeight);\n onPopupHeightChange(nextHeight);\n });\n useIsoLayoutEffect(() => {\n if (!mounted) {\n popupHeightRef.current = 0;\n setPopupHeight(0);\n onPopupHeightChange(0);\n return undefined;\n }\n const popupElement = popupRef.current;\n if (!popupElement) {\n return undefined;\n }\n removeCSSVariableInheritance();\n measureHeight();\n if (typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureHeight);\n resizeObserver.observe(popupElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureHeight, mounted, nestedDrawerOpen, onPopupHeightChange, popupRef]);\n useIsoLayoutEffect(() => {\n const syncNestedSwipeProgress = () => {\n const popupElement = popupRef.current;\n if (!popupElement) {\n return;\n }\n const progress = nestedSwipeProgressStore.getSnapshot();\n if (progress > 0) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${progress}`);\n } else {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n syncNestedSwipeProgress();\n const unsubscribe = nestedSwipeProgressStore.subscribe(syncNestedSwipeProgress);\n const popupElement = popupRef.current;\n return () => {\n unsubscribe();\n if (popupElement) {\n popupElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n }\n };\n }, [nestedSwipeProgressStore, popupRef]);\n useIsoLayoutEffect(() => {\n if (!open) {\n return undefined;\n }\n notifyParentFrontmostHeight?.(frontmostHeight);\n return () => {\n notifyParentFrontmostHeight?.(0);\n };\n }, [frontmostHeight, open, notifyParentFrontmostHeight]);\n useIsoLayoutEffect(() => {\n if (!notifyParentHasNestedDrawer) {\n return undefined;\n }\n const present = open || transitionStatus === 'ending';\n notifyParentHasNestedDrawer(present);\n return () => {\n notifyParentHasNestedDrawer(false);\n };\n }, [notifyParentHasNestedDrawer, open, transitionStatus]);\n useOpenChangeComplete({\n open,\n ref: popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? popupRef : initialFocus;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n expanded: activeSnapPoint === 1,\n nestedDrawerOpen,\n nestedDrawerSwiping: nestedSwiping,\n swipeDirection,\n swiping\n };\n let popupHeightCssVarValue;\n const shouldUseAutoHeight = !hasNestedDrawer && transitionStatus !== 'ending';\n if (popupHeight && !shouldUseAutoHeight) {\n popupHeightCssVarValue = `${popupHeight}px`;\n }\n const shouldApplySnapPoints = snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up');\n let snapPointOffsetValue = null;\n if (shouldApplySnapPoints && activeSnapPointOffset !== null) {\n snapPointOffsetValue = swipeDirection === 'up' ? -activeSnapPointOffset : activeSnapPointOffset;\n }\n let dragStyles = swipe ? swipe.getDragStyles() : EMPTY_OBJECT;\n if (shouldApplySnapPoints && swipeDirection === 'down') {\n const baseOffset = activeSnapPointOffset ?? 0;\n const movementValue = Number.parseFloat(String(dragStyles[DrawerPopupCssVars.swipeMovementY]));\n if (swiping && Number.isFinite(movementValue)) {\n dragStyles = {\n ...dragStyles,\n transform: undefined,\n [DrawerPopupCssVars.swipeMovementY]: `${getSnapPointSwipeMovement(baseOffset, movementValue)}px`\n };\n } else {\n dragStyles = {\n ...dragStyles,\n transform: undefined\n };\n }\n }\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: popupId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n ...dragStyles,\n [DrawerBackdropCssVars.swipeProgress]: '0',\n [DrawerPopupCssVars.nestedDrawers]: nestedOpenDrawerCount,\n [DrawerPopupCssVars.height]: popupHeightCssVarValue,\n [DrawerPopupCssVars.snapPointOffset]: typeof snapPointOffsetValue === 'number' ? `${snapPointOffsetValue}px` : '0px',\n [DrawerPopupCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined,\n [DrawerPopupCssVars.swipeStrength]: typeof swipeStrength === 'number' && Number.isFinite(swipeStrength) && swipeStrength > 0 ? `${swipeStrength}` : '1'\n }\n }, elementProps],\n ref: [forwardedRef, popupRef, setPopupElement],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerPopup.displayName = \"DrawerPopup\";","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the drawer is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the drawer is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the drawer begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the drawer is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the drawer is at the expanded (full-height) snap point.\n */\nexport const expanded = 'data-expanded';\n/**\n * Present when a nested drawer is open.\n */\nexport const nestedDrawerOpen = 'data-nested-drawer-open';\n/**\n * Present when a nested drawer is being swiped.\n */\nexport const nestedDrawerSwiping = 'data-nested-drawer-swiping';\n/**\n * Present when the drawer is dismissed by swiping.\n */\nexport const swipeDismiss = 'data-swipe-dismiss';\n/**\n * Indicates the swipe direction.\n * @type {'up' | 'down' | 'left' | 'right'}\n */\nexport const swipeDirection = 'data-swipe-direction';\n/**\n * Present when the drawer is being swiped.\n */\nexport const swiping = 'data-swiping';","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DrawerRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerRootContext.displayName = \"DrawerRootContext\";\nexport function useDrawerRootContext(optional) {\n const drawerRootContext = React.useContext(DrawerRootContext);\n if (optional !== true && drawerRootContext === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.' : _formatErrorMessage(90));\n }\n return drawerRootContext;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useDrawerRootContext } from \"./DrawerRootContext.mjs\";\n/**\n * Resolves the vertical swipe movement for a snap point, applying square-root damping once the drag\n * overshoots the fully-open edge (`nextOffset < 0`) so the popup resists travelling past it.\n */\nexport function getSnapPointSwipeMovement(baseOffset, movementValue) {\n const nextOffset = baseOffset + movementValue;\n if (nextOffset >= 0) {\n return movementValue;\n }\n return -Math.sqrt(-nextOffset) - baseOffset;\n}\nfunction resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {\n if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {\n return null;\n }\n if (typeof snapPoint === 'number') {\n if (!Number.isFinite(snapPoint)) {\n return null;\n }\n if (snapPoint <= 1) {\n return clamp(snapPoint, 0, 1) * viewportHeight;\n }\n return snapPoint;\n }\n const trimmed = snapPoint.trim();\n if (trimmed.endsWith('px')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value : null;\n }\n if (trimmed.endsWith('rem')) {\n const value = Number.parseFloat(trimmed);\n return Number.isFinite(value) ? value * rootFontSize : null;\n }\n return null;\n}\n\n/**\n * Returns the index of the value closest to `target`, or `-1` if `values` is empty.\n */\nexport function closestSnapPointIndex(values, target) {\n let closestIndex = -1;\n let closestDistance = Infinity;\n for (let index = 0; index < values.length; index += 1) {\n const distance = Math.abs(values[index] - target);\n if (distance < closestDistance) {\n closestDistance = distance;\n closestIndex = index;\n }\n }\n return closestIndex;\n}\nexport function useDrawerSnapPoints() {\n const store = useDialogRootContext();\n const {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerRootContext();\n const viewportElement = store.useState('viewportElement');\n const [viewportHeight, setViewportHeight] = React.useState(0);\n const [rootFontSize, setRootFontSize] = React.useState(16);\n const measureViewportHeight = useStableCallback(() => {\n const doc = ownerDocument(viewportElement);\n const html = doc.documentElement;\n setViewportHeight(viewportElement ? viewportElement.offsetHeight : html.clientHeight);\n const fontSize = parseFloat(getComputedStyle(html).fontSize);\n if (Number.isFinite(fontSize)) {\n setRootFontSize(fontSize);\n }\n });\n useIsoLayoutEffect(() => {\n measureViewportHeight();\n if (!viewportElement || typeof ResizeObserver !== 'function') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(measureViewportHeight);\n resizeObserver.observe(viewportElement);\n return () => {\n resizeObserver.disconnect();\n };\n }, [measureViewportHeight, viewportElement]);\n const resolvedSnapPoints = React.useMemo(() => {\n if (!snapPoints || snapPoints.length === 0 || viewportHeight <= 0 || popupHeight <= 0) {\n return [];\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolved = snapPoints.map(value => {\n const resolvedHeight = resolveSnapPointValue(value, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return null;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return {\n value,\n height: clampedHeight,\n offset: Math.max(0, popupHeight - clampedHeight)\n };\n }).filter(point => Boolean(point));\n if (resolved.length <= 1) {\n return resolved;\n }\n const deduped = [];\n const seenHeights = [];\n for (let index = resolved.length - 1; index >= 0; index -= 1) {\n const point = resolved[index];\n const isDuplicate = seenHeights.some(height => Math.abs(height - point.height) <= 1);\n if (isDuplicate) {\n continue;\n }\n seenHeights.push(point.height);\n deduped.push(point);\n }\n deduped.reverse();\n return deduped;\n }, [popupHeight, rootFontSize, snapPoints, viewportHeight]);\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (activeSnapPoint === null) {\n return undefined;\n }\n const exactMatch = resolvedSnapPoints.find(point => Object.is(point.value, activeSnapPoint));\n if (exactMatch) {\n return exactMatch;\n }\n const maxHeight = Math.min(popupHeight, viewportHeight);\n const resolvedHeight = resolveSnapPointValue(activeSnapPoint, viewportHeight, rootFontSize);\n if (resolvedHeight === null) {\n return undefined;\n }\n const clampedHeight = clamp(resolvedHeight, 0, maxHeight);\n return resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.height), clampedHeight)];\n }, [activeSnapPoint, popupHeight, resolvedSnapPoints, rootFontSize, viewportHeight]);\n return {\n snapPoints,\n activeSnapPoint,\n setActiveSnapPoint,\n popupHeight,\n viewportHeight,\n resolvedSnapPoints,\n activeSnapPointOffset: resolvedActiveSnapPoint?.offset ?? null\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const DrawerViewportContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") DrawerViewportContext.displayName = \"DrawerViewportContext\";\nexport function useDrawerViewportContext() {\n return React.useContext(DrawerViewportContext);\n}","'use client';\n\nimport { DialogPortal } from \"../../dialog/portal/DialogPortal.mjs\";\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerPortal = DialogPortal;","'use client';\n\nvar _DrawerProviderReport, _DrawerProviderReport2;\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { platform } from '@base-ui/utils/platform';\nimport { DrawerRootContext, useDrawerRootContext } from \"./DrawerRootContext.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { useRenderDialogRoot } from \"../../dialog/root/useRenderDialogRoot.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Groups all parts of the drawer.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport function DrawerRoot(props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal = false,\n modal = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n swipeDirection = 'down',\n snapToSequentialPoints = false,\n snapPoints,\n snapPoint: snapPointProp,\n defaultSnapPoint,\n onSnapPointChange\n } = props;\n const parentDrawerRootContext = useDrawerRootContext(true);\n const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;\n const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;\n const notifyParentSwipingChange = parentDrawerRootContext?.onNestedSwipingChange;\n const notifyParentHasNestedDrawer = parentDrawerRootContext?.onNestedDrawerPresenceChange;\n const [popupHeight, setPopupHeight] = React.useState(0);\n const [frontmostHeight, setFrontmostHeight] = React.useState(0);\n const [hasNestedDrawer, setHasNestedDrawer] = React.useState(false);\n const [nestedSwiping, setNestedSwiping] = React.useState(false);\n const [nestedSwipeProgressStore] = React.useState(createNestedSwipeProgressStore);\n const resolvedDefaultSnapPoint = defaultSnapPoint !== undefined ? defaultSnapPoint : snapPoints?.[0] ?? null;\n const isSnapPointControlled = snapPointProp !== undefined;\n const [activeSnapPoint, setActiveSnapPointUnwrapped] = useControlled({\n controlled: snapPointProp,\n default: resolvedDefaultSnapPoint,\n name: 'Drawer',\n state: 'snapPoint'\n });\n const isNestedDrawerOpenRef = React.useRef(false);\n const swipeAreaActiveRef = React.useRef(false);\n const setActiveSnapPoint = useStableCallback((nextSnapPoint, eventDetails) => {\n const resolvedEventDetails = eventDetails ?? createChangeEventDetails(REASONS.none);\n onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);\n if (resolvedEventDetails.isCanceled) {\n return;\n }\n setActiveSnapPointUnwrapped(nextSnapPoint);\n });\n const resolvedActiveSnapPoint = React.useMemo(() => {\n if (isSnapPointControlled) {\n return activeSnapPoint;\n }\n if (!snapPoints || snapPoints.length === 0) {\n return activeSnapPoint;\n }\n if (activeSnapPoint === null || !snapPoints.some(snapPoint => Object.is(snapPoint, activeSnapPoint))) {\n return resolvedDefaultSnapPoint;\n }\n return activeSnapPoint;\n }, [activeSnapPoint, isSnapPointControlled, resolvedDefaultSnapPoint, snapPoints]);\n const onPopupHeightChange = useStableCallback(height => {\n setPopupHeight(height);\n if (!isNestedDrawerOpenRef.current && height > 0) {\n setFrontmostHeight(height);\n }\n });\n const onNestedFrontmostHeightChange = useStableCallback(height => {\n if (height > 0) {\n isNestedDrawerOpenRef.current = true;\n setFrontmostHeight(height);\n return;\n }\n isNestedDrawerOpenRef.current = false;\n if (popupHeight > 0) {\n setFrontmostHeight(popupHeight);\n }\n });\n const onNestedDrawerPresenceChange = useStableCallback(present => {\n setHasNestedDrawer(present);\n });\n const onNestedSwipeProgressChange = useStableCallback(progress => {\n nestedSwipeProgressStore.set(progress);\n notifyParentSwipeProgressChange?.(progress);\n });\n const onNestedSwipingChange = useStableCallback(swiping => {\n setNestedSwiping(swiping);\n notifyParentSwipingChange?.(swiping);\n });\n const handleOpenChange = useStableCallback((nextOpen, eventDetails) => {\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n if (!nextOpen && snapPoints && snapPoints.length > 0) {\n setActiveSnapPoint(resolvedDefaultSnapPoint, createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));\n }\n });\n const contextValue = React.useMemo(() => ({\n swipeDirection,\n swipeAreaActiveRef,\n snapToSequentialPoints,\n snapPoints,\n activeSnapPoint: resolvedActiveSnapPoint,\n setActiveSnapPoint,\n frontmostHeight,\n popupHeight,\n hasNestedDrawer,\n nestedSwiping,\n nestedSwipeProgressStore,\n onNestedDrawerPresenceChange,\n onPopupHeightChange,\n onNestedFrontmostHeightChange,\n onNestedSwipingChange,\n onNestedSwipeProgressChange,\n notifyParentFrontmostHeight,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n notifyParentHasNestedDrawer\n }), [resolvedActiveSnapPoint, frontmostHeight, hasNestedDrawer, nestedSwiping, nestedSwipeProgressStore, notifyParentHasNestedDrawer, notifyParentSwipeProgressChange, notifyParentSwipingChange, notifyParentFrontmostHeight, onNestedDrawerPresenceChange, onNestedFrontmostHeightChange, onNestedSwipeProgressChange, onNestedSwipingChange, onPopupHeightChange, popupHeight, setActiveSnapPoint, snapPoints, snapToSequentialPoints, swipeAreaActiveRef, swipeDirection]);\n const resolvedChildren = typeof children === 'function' ? payload => /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport || (_DrawerProviderReport = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children(payload)]\n }) : /*#__PURE__*/_jsxs(React.Fragment, {\n children: [_DrawerProviderReport2 || (_DrawerProviderReport2 = /*#__PURE__*/_jsx(DrawerProviderReporter, {})), children]\n });\n const dialog = useRenderDialogRoot('drawer', {\n open: openProp,\n defaultOpen,\n onOpenChange: handleOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal,\n modal,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp,\n children: resolvedChildren\n });\n return /*#__PURE__*/_jsx(DrawerRootContext.Provider, {\n value: contextValue,\n children: dialog\n });\n}\nfunction createNestedSwipeProgressStore() {\n let progress = 0;\n const listeners = new Set();\n return {\n getSnapshot: () => progress,\n set(nextProgress) {\n const resolved = Number.isFinite(nextProgress) ? nextProgress : 0;\n if (resolved === progress) {\n return;\n }\n progress = resolved;\n listeners.forEach(listener => {\n listener();\n });\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n }\n };\n}\nfunction DrawerProviderReporter() {\n const providerContext = useDrawerProviderContext();\n const store = useDialogRootContext(false);\n const setDrawerOpen = providerContext?.setDrawerOpen;\n const removeDrawer = providerContext?.removeDrawer;\n const open = store.useState('open');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const popupElement = store.useState('popupElement');\n const isTopmost = nestedOpenDialogCount === 0;\n useIsoLayoutEffect(() => {\n if (!removeDrawer) {\n return undefined;\n }\n return () => {\n removeDrawer(store);\n };\n }, [removeDrawer, store]);\n useIsoLayoutEffect(() => {\n setDrawerOpen?.(store, open);\n }, [open, setDrawerOpen, store]);\n React.useEffect(() => {\n // CloseWatcher enables the Android back gesture (Chromium-only).\n // Keep this Android-only for now to avoid interfering with Escape/nesting semantics on desktop due to `useDismiss`.\n if (!open || !isTopmost || !platform.os.android) {\n return undefined;\n }\n const win = ownerWindow(popupElement);\n const CloseWatcherCtor = win.CloseWatcher;\n if (!CloseWatcherCtor) {\n return undefined;\n }\n function handleCancel(event) {\n if (!store.select('open')) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.closeWatcher, event);\n if (!event.cancelable) {\n // The browser lets only one close request per user activation be prevented; any further\n // request closes the drawer regardless, like a native `<dialog>`.\n eventDetails.cancel = NOOP;\n }\n store.setOpen(false, eventDetails);\n if (eventDetails.isCanceled) {\n // Keeps this watcher active for the next close request.\n event.preventDefault();\n }\n }\n const closeWatcher = new CloseWatcherCtor();\n // The browser destroys the watcher before `close` fires, so the request is handled from\n // `cancel`, where it can still be prevented.\n const unsubscribe = addEventListener(closeWatcher, 'cancel', handleCancel);\n return () => {\n unsubscribe();\n closeWatcher.destroy();\n };\n }, [store, isTopmost, open, popupElement]);\n return null;\n}","'use client';\n\nimport * as React from 'react';\nexport const DrawerProviderContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerProviderContext.displayName = \"DrawerProviderContext\";\nexport function useDrawerProviderContext() {\n return React.useContext(DrawerProviderContext);\n}","'use client';\n\nimport { DialogTitle } from \"../../dialog/title/DialogTitle.mjs\";\n/**\n * A heading that labels the drawer.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerTitle = DialogTitle;","'use client';\n\nimport { DialogTrigger } from \"../../dialog/trigger/DialogTrigger.mjs\";\n/**\n * A button that opens the drawer.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerTrigger = DialogTrigger;","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { useDialogRootContext } from \"../../dialog/root/DialogRootContext.mjs\";\nimport { DialogViewport } from \"../../dialog/viewport/DialogViewport.mjs\";\nimport * as DialogViewportDataAttributes from \"../../dialog/viewport/DialogViewportDataAttributes.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useDrawerRootContext } from \"../root/DrawerRootContext.mjs\";\nimport { closestSnapPointIndex, getSnapPointSwipeMovement, useDrawerSnapPoints } from \"../root/useDrawerSnapPoints.mjs\";\nimport { useDrawerProviderContext } from \"../provider/DrawerProviderContext.mjs\";\nimport { getDisplacement, useSwipeDismiss } from \"../../utils/useSwipeDismiss.mjs\";\nimport * as DrawerPopupCssVars from \"../popup/DrawerPopupCssVars.mjs\";\nimport * as DrawerPopupDataAttributes from \"../popup/DrawerPopupDataAttributes.mjs\";\nimport * as DrawerBackdropCssVars from \"../backdrop/DrawerBackdropCssVars.mjs\";\nimport { DRAWER_CONTENT_ATTRIBUTE } from \"../content/drawerContentAttribute.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { activeElement, closest, contains, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { DrawerViewportContext } from \"./DrawerViewportContext.mjs\";\nimport { TransitionStatusDataAttributes } from \"../../internals/stateAttributesMapping.mjs\";\nimport { findScrollableTouchTarget } from \"../../utils/scrollable.mjs\";\nimport { BASE_UI_SWIPE_IGNORE_ATTRIBUTE, BASE_UI_SWIPE_IGNORE_SELECTOR } from \"../../internals/constants.mjs\";\nimport { getElementAtPoint } from \"../../utils/getElementAtPoint.mjs\";\nimport { useDrawerVirtualKeyboardContext } from \"../virtual-keyboard-provider/DrawerVirtualKeyboardContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst MIN_SWIPE_THRESHOLD = 10;\nconst FAST_SWIPE_VELOCITY = 0.5;\nconst SNAP_VELOCITY_THRESHOLD = 0.5;\nconst SNAP_VELOCITY_MULTIPLIER = 300;\nconst MAX_SNAP_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_VELOCITY = 0.2;\nconst MAX_SWIPE_RELEASE_VELOCITY = 4;\nconst MIN_SWIPE_RELEASE_DURATION_MS = 80;\nconst MAX_SWIPE_RELEASE_DURATION_MS = 360;\nconst MIN_SWIPE_RELEASE_SCALAR = 0.1;\nconst MAX_SWIPE_RELEASE_SCALAR = 1;\nconst AXIS_LOCK_SLOP = 6;\nconst AXIS_LOCK_BIAS = 2;\nconst DRAWER_CONTENT_SELECTOR = `[${DRAWER_CONTENT_ATTRIBUTE}]`;\nconst AXIS_SWIPE_IGNORE_SELECTORS = {\n horizontal: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}=\"x\"]`,\n vertical: `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}=\"y\"]`\n};\n/**\n * A positioning container for the drawer popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)\n */\nexport const DrawerViewport = /*#__PURE__*/React.forwardRef(function DrawerViewport(props, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = props;\n const store = useDialogRootContext();\n const popupRef = store.context.popupRef;\n const backdropRef = store.context.backdropRef;\n const {\n swipeDirection,\n notifyParentSwipingChange,\n notifyParentSwipeProgressChange,\n frontmostHeight,\n snapToSequentialPoints,\n swipeAreaActiveRef\n } = useDrawerRootContext();\n const providerContext = useDrawerProviderContext();\n const {\n snapPoints,\n resolvedSnapPoints,\n activeSnapPoint,\n activeSnapPointOffset,\n setActiveSnapPoint,\n popupHeight\n } = useDrawerSnapPoints();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDrawerCount = store.useState('nestedOpenDrawerCount');\n const viewportElement = store.useState('viewportElement');\n const popupElementState = store.useState('popupElement');\n const visualStateStore = providerContext?.visualStateStore;\n const nestedDrawerOpen = nestedOpenDrawerCount > 0;\n const scrollAxis = swipeDirection === 'left' || swipeDirection === 'right' ? 'horizontal' : 'vertical';\n const isVerticalScrollAxis = scrollAxis === 'vertical';\n const crossScrollAxis = isVerticalScrollAxis ? 'horizontal' : 'vertical';\n const [swipeRelease, setSwipeRelease] = React.useState(null);\n const pendingSwipeCloseSnapPointRef = React.useRef(undefined);\n const resetSwipeRef = React.useRef(null);\n const controlledDismissFrame = useAnimationFrame();\n const swipingRef = React.useRef(false);\n const nestedSwipeActiveRef = React.useRef(false);\n const lastPointerTypeRef = React.useRef('');\n const ignoreNextTouchStartFromPenRef = React.useRef(false);\n const ignoreTouchSwipeRef = React.useRef(false);\n const touchScrollStateRef = React.useRef(null);\n const virtualKeyboard = useDrawerVirtualKeyboardContext();\n const snapPointRange = React.useMemo(() => {\n if (!snapPoints || snapPoints.length < 2 || resolvedSnapPoints.length < 2 || swipeDirection !== 'down' && swipeDirection !== 'up') {\n return null;\n }\n const offsets = resolvedSnapPoints.map(point => point.offset).sort((a, b) => a - b);\n const minOffset = offsets[0];\n const nextOffset = offsets[1];\n const range = nextOffset - minOffset;\n return {\n minOffset,\n range\n };\n }, [resolvedSnapPoints, snapPoints, swipeDirection]);\n const snapPointProgress = React.useMemo(() => {\n if (!snapPointRange || activeSnapPointOffset === null) {\n return null;\n }\n return clamp((activeSnapPointOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n }, [activeSnapPointOffset, snapPointRange]);\n const swipeDirections = React.useMemo(() => {\n if (snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up')) {\n return swipeDirection === 'down' ? ['down', 'up'] : ['up', 'down'];\n }\n return [swipeDirection];\n }, [snapPoints, swipeDirection]);\n const setSwipeDismissed = useStableCallback(dismissed => {\n popupRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n backdropRef.current?.toggleAttribute(DrawerPopupDataAttributes.swipeDismiss, dismissed);\n });\n const clearSwipeRelease = useStableCallback(() => {\n setSwipeDismissed(false);\n popupRef.current?.removeAttribute(TransitionStatusDataAttributes.endingStyle);\n setSwipeRelease(null);\n });\n const finishNestedSwipe = useStableCallback(() => {\n if (!nestedSwipeActiveRef.current) {\n return;\n }\n nestedSwipeActiveRef.current = false;\n notifyParentSwipingChange?.(false);\n });\n const applySwipeProgress = useStableCallback((resolvedProgress, shouldTrackProgress, notifyParent) => {\n const isActive = open && !nested && shouldTrackProgress;\n const swipeProgress = isActive ? resolvedProgress : 0;\n const nestedSwipeProgress = open && shouldTrackProgress ? resolvedProgress : 0;\n if (notifyParent && notifyParentSwipeProgressChange) {\n notifyParentSwipeProgressChange(nestedSwipeProgress);\n if (nestedSwipeProgress <= 0) {\n finishNestedSwipe();\n }\n }\n visualStateStore?.set({\n swipeProgress,\n frontmostHeight: swipeProgress > 0 ? frontmostHeight : 0\n });\n const backdropElement = backdropRef.current;\n if (!backdropElement) {\n return;\n }\n const showProgress = isActive && swipeProgress > 0;\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, showProgress ? `${swipeProgress}` : '0');\n if (showProgress && frontmostHeight > 0) {\n backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);\n } else {\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n });\n function resolveSwipeRelease(popupElement, direction, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY) {\n const size = getBaseSwipeSize(popupElement, direction);\n if (size <= 0) {\n return null;\n }\n\n // The snap point base offset shifts the popup along the dismiss direction for both\n // `down` (+offset) and `up` (-offset), so it always adds to the directional translation.\n const snapPointBaseOffset = (direction === 'down' || direction === 'up') && snapPoints && snapPoints.length > 0 ? activeSnapPointOffset ?? 0 : 0;\n const translationAlongDirection = snapPointBaseOffset + getDisplacement(direction, deltaX, deltaY);\n const remainingDistance = Math.max(0, size - translationAlongDirection);\n if (remainingDistance <= 0) {\n return null;\n }\n const releaseVelocity = getDisplacement(direction, releaseVelocityX, releaseVelocityY);\n const directionalVelocity = Math.abs(releaseVelocity) > 0 ? releaseVelocity : getDisplacement(direction, velocityX, velocityY);\n if (directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) {\n return null;\n }\n const clampedVelocity = clamp(directionalVelocity, MIN_SWIPE_RELEASE_VELOCITY, MAX_SWIPE_RELEASE_VELOCITY);\n // The gesture hook supplies finite deltas and velocities. The guards above keep the remaining\n // distance and divisor positive, so the duration stays within [MIN, MAX] and the resulting\n // scalar within (0, 1].\n const durationMs = clamp(remainingDistance / clampedVelocity, MIN_SWIPE_RELEASE_DURATION_MS, MAX_SWIPE_RELEASE_DURATION_MS);\n const normalizedDuration = (durationMs - MIN_SWIPE_RELEASE_DURATION_MS) / (MAX_SWIPE_RELEASE_DURATION_MS - MIN_SWIPE_RELEASE_DURATION_MS);\n return MIN_SWIPE_RELEASE_SCALAR + normalizedDuration * (MAX_SWIPE_RELEASE_SCALAR - MIN_SWIPE_RELEASE_SCALAR);\n }\n function updateNestedSwipeActive(details) {\n if (nestedSwipeActiveRef.current || !details) {\n return;\n }\n const direction = details.direction ?? swipeDirection;\n const delta = getDisplacement(direction, details.deltaX, details.deltaY);\n if (Math.abs(delta) < MIN_SWIPE_THRESHOLD) {\n return;\n }\n nestedSwipeActiveRef.current = true;\n notifyParentSwipingChange?.(true);\n }\n const swipe = useSwipeDismiss({\n enabled: mounted && !nestedDrawerOpen,\n directions: swipeDirections,\n elementRef: store.context.popupRef,\n ignoreSelectorWhenTouch: false,\n ignoreScrollableAncestors: true,\n movementCssVars: {\n x: DrawerPopupCssVars.swipeMovementX,\n y: DrawerPopupCssVars.swipeMovementY\n },\n onSwipeStart(event) {\n if ('touches' in event || event.pointerType === 'touch') {\n return;\n }\n const popupElement = popupRef.current;\n const doc = ownerDocument(popupElement);\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return;\n }\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n if (!contains(popupElement, anchorElement) && !contains(popupElement, focusElement)) {\n return;\n }\n selection.removeAllRanges();\n },\n onSwipingChange(swiping) {\n swipingRef.current = swiping;\n setBackdropSwipingAttribute(store.context.backdropRef.current, swiping);\n if (!swiping && !notifyParentSwipeProgressChange) {\n finishNestedSwipe();\n }\n },\n swipeThreshold({\n element,\n direction\n }) {\n return getBaseSwipeThreshold(element, direction);\n },\n canStart(position, details) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n return false;\n }\n const nativeEvent = details.nativeEvent;\n const touchLike = 'touches' in nativeEvent || nativeEvent.pointerType === 'touch';\n const touchState = touchLike ? touchScrollStateRef.current : null;\n const doc = popupElement.ownerDocument;\n const elementAtPoint = getElementAtPoint(popupElement.getRootNode(), position.x, position.y);\n // Activation can be deferred until after a touch that started inside has left the popup.\n if (!touchState?.startedInPopup && !contains(popupElement, elementAtPoint)) {\n return false;\n }\n if (touchLike && shouldIgnoreSwipeForTextSelection(doc, popupElement)) {\n return false;\n }\n\n // Over a cross-axis gesture target, stay pending until the drawer axis wins the gesture.\n // Starting on touchstart would leave the drawer swiping (and settling on release) while the\n // cross-axis target handles the drag.\n if (touchState?.hasCrossAxisGestureTarget && !touchState.drawerAxisAttributed && touchState.allowSwipe !== true) {\n return false;\n }\n return true;\n },\n onProgress(progress, details) {\n const swiping = swipingRef.current;\n if (swiping) {\n updateNestedSwipeActive(details);\n }\n const hasSnapPoints = Boolean(snapPoints && snapPoints.length > 0);\n if (swiping && swipeDirection === 'down' && hasSnapPoints && details) {\n const popupElement = store.context.popupRef.current;\n if (popupElement) {\n popupElement.style.removeProperty('transform');\n popupElement.style.setProperty(DrawerPopupCssVars.swipeMovementY, `${getSnapPointSwipeMovement(activeSnapPointOffset ?? 0, details.deltaY)}px`);\n }\n }\n let resolvedProgress = progress;\n if (snapPointRange && popupHeight > 0) {\n const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;\n const offsetToProgress = nextOffset => clamp((nextOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);\n\n // Outside a drag the hook still reports the last drag deltas, both after a release and\n // on a gesture that never started (e.g. a press inside `Drawer.Content`). Recomputing\n // from them would re-apply drag progress to a drawer that rests on its snap point.\n if (swiping && details && Number.isFinite(details.deltaY)) {\n resolvedProgress = offsetToProgress(clamp(baseOffset + details.deltaY, 0, popupHeight));\n } else if (snapPointProgress !== null) {\n resolvedProgress = snapPointProgress;\n }\n }\n\n // A parent drawer follows an active drag only, so drop it back to zero once the drag ends.\n if (!swiping) {\n notifyParentSwipeProgressChange?.(0);\n finishNestedSwipe();\n }\n applySwipeProgress(resolvedProgress, true, swiping);\n },\n onRelease({\n event,\n deltaX,\n deltaY,\n direction,\n velocityX,\n velocityY,\n releaseVelocityX,\n releaseVelocityY\n }) {\n const popupElement = store.context.popupRef.current;\n if (!popupElement) {\n clearSwipeRelease();\n return undefined;\n }\n const releasePopupElement = popupElement;\n function startSwipeRelease(resolvedDirection) {\n // Start ending transition styles earlier and synchronously to prevent a period where\n // the popup appears stuck on release before the actual closing animation starts.\n finishNestedSwipe();\n setSwipeDismissed(true);\n releasePopupElement.style.removeProperty('transition');\n releasePopupElement.setAttribute(TransitionStatusDataAttributes.endingStyle, '');\n ReactDOM.flushSync(() => {\n setSwipeRelease(resolveSwipeRelease(releasePopupElement, resolvedDirection, deltaX, deltaY, velocityX, velocityY, releaseVelocityX, releaseVelocityY));\n });\n }\n if (!snapPoints || snapPoints.length === 0) {\n if (!direction) {\n clearSwipeRelease();\n return undefined;\n }\n const directionalDelta = getDisplacement(direction, deltaX, deltaY);\n if (directionalDelta <= 0) {\n clearSwipeRelease();\n return false;\n }\n if (getDisplacement(direction, velocityX, velocityY) >= FAST_SWIPE_VELOCITY) {\n startSwipeRelease(direction);\n return true;\n }\n const shouldClose = directionalDelta > getBaseSwipeThreshold(releasePopupElement, direction);\n if (shouldClose) {\n startSwipeRelease(direction);\n } else {\n clearSwipeRelease();\n }\n return shouldClose;\n }\n if (swipeDirection !== 'down' && swipeDirection !== 'up') {\n clearSwipeRelease();\n return undefined;\n }\n if (!popupHeight) {\n clearSwipeRelease();\n return false;\n }\n if (resolvedSnapPoints.length === 0) {\n clearSwipeRelease();\n return undefined;\n }\n const dragDelta = swipeDirection === 'down' ? deltaY : -deltaY;\n const dragDirection = Math.sign(dragDelta);\n const releaseDirectionalVelocity = swipeDirection === 'down' ? releaseVelocityY : -releaseVelocityY;\n const fallbackDirectionalVelocity = swipeDirection === 'down' ? velocityY : -velocityY;\n let resolvedDirectionalVelocity = releaseDirectionalVelocity;\n if (dragDirection !== 0 && Math.abs(dragDelta) >= MIN_SWIPE_THRESHOLD) {\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n if (velocityDirection !== 0 && velocityDirection !== dragDirection) {\n // Ignore touch reversals that would otherwise flip the snap decision.\n resolvedDirectionalVelocity = fallbackDirectionalVelocity;\n }\n }\n const currentOffset = activeSnapPointOffset ?? 0;\n const dragTargetOffset = clamp(currentOffset + dragDelta, 0, popupHeight);\n const velocityOffset = Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD ? clamp(resolvedDirectionalVelocity, -MAX_SNAP_VELOCITY, MAX_SNAP_VELOCITY) * SNAP_VELOCITY_MULTIPLIER : 0;\n const targetOffset = snapToSequentialPoints ? dragTargetOffset : clamp(dragTargetOffset + velocityOffset, 0, popupHeight);\n const snapPointEventDetails = createChangeEventDetails(REASONS.swipe, event);\n const settleInPlace = () => {\n // Reset nested swipe state now: the hook's trailing progress update is deduped\n // when the drag never produced dismissal progress, so it may not fire.\n applySwipeProgress(0, true, true);\n clearSwipeRelease();\n return false;\n };\n const settleOnSnapPoint = snapPoint => {\n setActiveSnapPoint(snapPoint.value, snapPointEventDetails);\n return settleInPlace();\n };\n const closeFromSnapPoints = fallbackSnapPoint => {\n // An unattributed gesture (e.g. a mostly horizontal flick) may settle on a snap\n // point but must not dismiss: `useSwipeDismiss` drops a directionless dismissal,\n // stranding the popup visually closed while `open` stays `true`.\n if (!direction) {\n return settleOnSnapPoint(fallbackSnapPoint);\n }\n setActiveSnapPoint(null, snapPointEventDetails);\n if (snapPointEventDetails.isCanceled) {\n // A canceled null snap point rejects dismissal before exit styles start.\n return settleInPlace();\n }\n pendingSwipeCloseSnapPointRef.current = activeSnapPoint;\n startSwipeRelease(swipeDirection);\n return true;\n };\n if (snapToSequentialPoints) {\n const orderedSnapPoints = [...resolvedSnapPoints].sort((first, second) => first.offset - second.offset);\n const orderedOffsets = orderedSnapPoints.map(point => point.offset);\n const currentIndex = closestSnapPointIndex(orderedOffsets, currentOffset);\n let targetSnapPoint = orderedSnapPoints[closestSnapPointIndex(orderedOffsets, targetOffset)];\n const velocityDirection = Math.sign(resolvedDirectionalVelocity);\n const shouldAdvance = dragDirection !== 0 && velocityDirection !== 0 && velocityDirection === dragDirection && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD;\n let effectiveTargetOffset = targetOffset;\n if (shouldAdvance) {\n const adjacentIndex = clamp(currentIndex + dragDirection, 0, orderedSnapPoints.length - 1);\n if (adjacentIndex !== currentIndex) {\n const adjacentPoint = orderedSnapPoints[adjacentIndex];\n const shouldForceAdjacent = dragDirection > 0 ? targetOffset < adjacentPoint.offset : targetOffset > adjacentPoint.offset;\n if (shouldForceAdjacent) {\n targetSnapPoint = adjacentPoint;\n effectiveTargetOffset = adjacentPoint.offset;\n }\n } else if (dragDirection > 0) {\n return closeFromSnapPoints(targetSnapPoint);\n }\n }\n const closeDistance = Math.abs(effectiveTargetOffset - popupHeight);\n const snapDistance = Math.abs(effectiveTargetOffset - targetSnapPoint.offset);\n if (closeDistance < snapDistance) {\n return closeFromSnapPoints(targetSnapPoint);\n }\n return settleOnSnapPoint(targetSnapPoint);\n }\n const closestSnapPoint = resolvedSnapPoints[closestSnapPointIndex(resolvedSnapPoints.map(point => point.offset), targetOffset)];\n if (resolvedDirectionalVelocity >= FAST_SWIPE_VELOCITY && dragDelta > 0) {\n return closeFromSnapPoints(closestSnapPoint);\n }\n const closeDistance = Math.abs(targetOffset - popupHeight);\n if (closeDistance < Math.abs(targetOffset - closestSnapPoint.offset)) {\n return closeFromSnapPoints(closestSnapPoint);\n }\n return settleOnSnapPoint(closestSnapPoint);\n },\n onDismiss(event) {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n const backdropElement = store.context.backdropRef.current;\n if (backdropElement) {\n backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');\n backdropElement.style.removeProperty(DrawerPopupCssVars.height);\n }\n const dismissEventDetails = createChangeEventDetails(REASONS.swipe, event);\n store.setOpen(false, dismissEventDetails);\n if (dismissEventDetails.isCanceled) {\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, event));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n resetSwipeRef.current?.();\n clearSwipeRelease();\n return;\n }\n\n // In controlled mode, the effective open state may not have changed yet\n // (openProp takes precedence over state.open). Proceed optimistically with the\n // dismiss animation — React's Scheduler flushes before the next rAF, so we can\n // reliably check whether the parent accepted or rejected the close.\n // Note: if onOpenChange is asynchronous (e.g., closes the drawer after a network\n // call), the rAF check will see open === true, revert the animation, and the\n // drawer will close without animation when the parent eventually sets open={false}.\n if (store.select('open')) {\n const savedEvent = event;\n controlledDismissFrame.request(() => {\n if (store.select('open')) {\n // Parent rejected: revert animation and restore snap point.\n const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;\n if (pendingSnapPoint !== undefined) {\n setActiveSnapPoint(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, savedEvent));\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n clearSwipeRelease();\n resetSwipeRef.current?.();\n } else {\n // Parent accepted: clean up the ref.\n pendingSwipeCloseSnapPointRef.current = undefined;\n }\n });\n return;\n }\n pendingSwipeCloseSnapPointRef.current = undefined;\n setSwipeDismissed(true);\n }\n });\n const swipePointerProps = swipe.getPointerProps();\n const swipeTouchProps = swipe.getTouchProps();\n const {\n moveNative: moveSwipeNative,\n reset: resetSwipe\n } = swipe;\n resetSwipeRef.current = resetSwipe;\n React.useEffect(() => {\n const rootElement = viewportElement ?? popupElementState;\n // A non-passive document listener makes all touch scrolling wait on the main thread.\n if (!rootElement || !open || !mounted) {\n return undefined;\n }\n const resolvedRootElement = rootElement;\n const doc = ownerDocument(resolvedRootElement);\n function processTouchMove(event, touchState, touch) {\n const drawerAxisDelta = isVerticalScrollAxis ? touch.clientY - touchState.lastY : touch.clientX - touchState.lastX;\n\n // Avoid blocking pinch zoom or text selection adjustments on iOS Safari.\n if (event.touches.length === 2) {\n return;\n }\n const allowTouchMove = shouldIgnoreSwipeForTextSelection(doc, resolvedRootElement);\n if (allowTouchMove || nestedDrawerOpen) {\n return;\n }\n if (shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis)) {\n return;\n }\n const scrollTarget = touchState.scrollTarget;\n if (!scrollTarget || scrollTarget === doc.documentElement || scrollTarget === doc.body) {\n if (event.cancelable) {\n event.preventDefault();\n }\n // Claim the gesture before React's delegated touch handlers see it; dispatching the\n // move through React re-rasterizes the popup content on every frame.\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n return;\n }\n if (!hasScrollableContentOnAxis(scrollTarget, scrollAxis)) {\n // If the scroll container doesn't overflow on the drawer axis, prevent the window from\n // scrolling instead.\n if (event.cancelable) {\n event.preventDefault();\n }\n event.stopPropagation();\n return;\n }\n if (drawerAxisDelta !== 0) {\n const canSwipeFromScrollEdge = canSwipeFromScrollEdgeOnMove(scrollTarget, scrollAxis, swipeDirection, drawerAxisDelta);\n if (!touchState.allowSwipe) {\n if (event.cancelable && canSwipeFromScrollEdge) {\n touchState.allowSwipe = true;\n event.preventDefault();\n } else {\n touchState.allowSwipe = false;\n }\n } else if (event.cancelable) {\n event.preventDefault();\n }\n }\n if (touchState.allowSwipe === true) {\n event.stopPropagation();\n moveSwipeNative(event, resolvedRootElement);\n }\n }\n function handleNativeTouchMove(event) {\n // The virtual keyboard provider observes the move to tell a tap apart from a drag.\n // It must run even when the swipe gesture below claims the event with\n // `stopPropagation()`, which would otherwise prevent React's delegated handlers\n // (and the provider) from ever seeing the move.\n virtualKeyboard?.onTouchMove(event);\n if (ignoreTouchSwipeRef.current) {\n return;\n }\n const touchState = touchScrollStateRef.current;\n const touch = event.touches[0];\n if (!touch || !touchState) {\n return;\n }\n processTouchMove(event, touchState, touch);\n updateTouchScrollPosition(touchState, touch);\n }\n return addEventListener(doc, 'touchmove', handleNativeTouchMove, {\n passive: false,\n capture: true\n });\n }, [mounted, nestedDrawerOpen, open, popupElementState, isVerticalScrollAxis, scrollAxis, swipeDirection, moveSwipeNative, viewportElement, virtualKeyboard]);\n useIsoLayoutEffect(() => {\n if (!snapPointRange || swipe.swiping) {\n return;\n }\n applySwipeProgress(!open || nested ? 0 : snapPointProgress ?? 0, true, false);\n }, [applySwipeProgress, frontmostHeight, nested, notifyParentSwipeProgressChange, open, snapPointProgress, snapPointRange, swipe.swiping, store, visualStateStore]);\n useIsoLayoutEffect(() => {\n if (!notifyParentSwipeProgressChange) {\n return undefined;\n }\n if (!open) {\n notifyParentSwipeProgressChange(0);\n }\n return () => {\n notifyParentSwipeProgressChange(0);\n };\n }, [notifyParentSwipeProgressChange, open]);\n useIsoLayoutEffect(() => {\n if (open) {\n // Skip `resetSwipe` while `Drawer.SwipeArea` is driving the open: it zeroes the popup's\n // `--swipe-movement-*` (via `syncDragStyles(false)`), flashing it fully open for a frame.\n // `clearSwipeRelease` doesn't touch those vars, so always run it to clear any leftover\n // release state from a prior dismiss (e.g. when the popup is kept mounted).\n if (!swipeAreaActiveRef.current) {\n resetSwipe();\n }\n clearSwipeRelease();\n }\n }, [clearSwipeRelease, open, resetSwipe, swipeAreaActiveRef]);\n useIsoLayoutEffect(() => {\n const backdropElement = backdropRef.current;\n return () => {\n visualStateStore?.set({\n swipeProgress: 0,\n frontmostHeight: 0\n });\n setBackdropSwipingAttribute(backdropElement, false);\n // `data-swiping` is set on whichever backdrop is current when a swipe starts, which can\n // differ from the captured element if the backdrop mounted late or changed identity.\n // Reading the live ref here is intentional so the current backdrop is cleared too.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const currentBackdrop = backdropRef.current;\n if (currentBackdrop !== backdropElement) {\n setBackdropSwipingAttribute(currentBackdrop, false);\n }\n finishNestedSwipe();\n };\n }, [backdropRef, finishNestedSwipe, visualStateStore]);\n const swipeProviderValue = React.useMemo(() => ({\n swiping: swipe.swiping,\n getDragStyles: swipe.getDragStyles,\n swipeStrength: swipeRelease ?? null,\n setSwipeDismissed\n }), [setSwipeDismissed, swipe.getDragStyles, swipe.swiping, swipeRelease]);\n function resetTouchSwipeState(ignoreSwipe) {\n ignoreTouchSwipeRef.current = ignoreSwipe;\n touchScrollStateRef.current = null;\n }\n function resetTouchTrackingState() {\n resetTouchSwipeState(false);\n lastPointerTypeRef.current = '';\n ignoreNextTouchStartFromPenRef.current = false;\n }\n function handlePointerEnd(event) {\n lastPointerTypeRef.current = '';\n return event.pointerType !== 'touch';\n }\n return /*#__PURE__*/_jsx(DialogViewport, {\n ref: forwardedRef,\n className: className,\n style: style,\n render: render,\n ...mergeProps(elementProps, {\n onPointerDown(event) {\n lastPointerTypeRef.current = event.pointerType;\n ignoreNextTouchStartFromPenRef.current = event.pointerType === 'pen';\n if (!open || !mounted || nestedDrawerOpen) {\n return;\n }\n const elementAtPoint = getElementAtPoint(event.currentTarget.getRootNode(), event.clientX, event.clientY);\n // Pointer drags capture the pointer on press, so they can't wait to see which axis the\n // gesture takes; any `data-base-ui-swipe-ignore` value ignores them.\n if (isSwipeIgnoredTarget(elementAtPoint) || isDrawerContentTarget(elementAtPoint)) {\n return;\n }\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerDown?.(event);\n },\n onPointerMove(event) {\n if (event.pointerType === 'touch') {\n return;\n }\n swipePointerProps.onPointerMove?.(event);\n },\n onPointerUp(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerUp?.(event);\n }\n },\n onPointerCancel(event) {\n if (handlePointerEnd(event)) {\n swipePointerProps.onPointerCancel?.(event);\n }\n },\n onTouchStart(event) {\n const startedFromPenPointerDown = lastPointerTypeRef.current === 'pen' && ignoreNextTouchStartFromPenRef.current;\n if (startedFromPenPointerDown) {\n ignoreNextTouchStartFromPenRef.current = false;\n resetTouchSwipeState(false);\n return;\n }\n if (!open || !mounted || nestedDrawerOpen) {\n resetTouchSwipeState(false);\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n if (isReactTouchEventOnRangeInput(event)) {\n resetTouchSwipeState(false);\n return;\n }\n const rootElement = event.currentTarget;\n const elementAtPoint = getElementAtPoint(rootElement.getRootNode(), touch.clientX, touch.clientY);\n const eventTarget = getTarget(event.nativeEvent);\n const target = isElement(eventTarget) ? eventTarget : rootElement;\n if (!contains(rootElement, target)) {\n resetTouchSwipeState(true);\n return;\n }\n virtualKeyboard?.onTouchStart(event);\n\n // `x`/`y` hand touch drags along that axis to the element. Any value other than the\n // cross-axis one ignores the swipe outright; a cross-axis element is arbitrated like a\n // native cross-axis scroller below.\n if (closest(elementAtPoint, `${BASE_UI_SWIPE_IGNORE_SELECTOR}:not(${AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]})`)) {\n resetTouchSwipeState(true);\n return;\n }\n ignoreTouchSwipeRef.current = false;\n const scrollTarget = findScrollableTouchTarget(target, rootElement, scrollAxis);\n const hasCrossAxisGestureTarget = findScrollableTouchTarget(target, rootElement, crossScrollAxis) != null || closest(elementAtPoint, AXIS_SWIPE_IGNORE_SELECTORS[crossScrollAxis]) != null;\n let allowSwipe = null;\n if (scrollTarget) {\n const canSwipeFromEdge = isAtSwipeStartEdge(scrollTarget, scrollAxis, swipeDirection);\n allowSwipe = canSwipeFromEdge ? null : false;\n }\n touchScrollStateRef.current = {\n startX: touch.clientX,\n startY: touch.clientY,\n lastX: touch.clientX,\n lastY: touch.clientY,\n startedInPopup: contains(popupRef.current, elementAtPoint),\n scrollTarget,\n hasCrossAxisGestureTarget,\n allowSwipe,\n preserveNativeCrossAxisScroll: false,\n drawerAxisAttributed: false\n };\n swipeTouchProps.onTouchStart?.(event);\n },\n onTouchEnd(event) {\n virtualKeyboard?.onTouchEnd(event);\n resetTouchTrackingState();\n swipeTouchProps.onTouchEnd?.(event);\n },\n onTouchCancel(event) {\n virtualKeyboard?.onTouchCancel();\n resetTouchTrackingState();\n swipeTouchProps.onTouchCancel?.(event);\n },\n // Drawer popups use drawer-specific nested state attributes.\n // Suppress DialogViewport's generic nested dialog attribute.\n [DialogViewportDataAttributes.nestedDialogOpen]: undefined\n }),\n children: /*#__PURE__*/_jsx(DrawerViewportContext.Provider, {\n value: swipeProviderValue,\n children: children\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DrawerViewport.displayName = \"DrawerViewport\";\nfunction setBackdropSwipingAttribute(backdropElement, swiping) {\n backdropElement?.toggleAttribute(DrawerPopupDataAttributes.swiping, swiping);\n}\nfunction isSwipeIgnoredTarget(target) {\n return Boolean(closest(target, BASE_UI_SWIPE_IGNORE_SELECTOR));\n}\nfunction isDrawerContentTarget(target) {\n return Boolean(closest(target, DRAWER_CONTENT_SELECTOR));\n}\nfunction getBaseSwipeSize(element, direction) {\n return direction === 'left' || direction === 'right' ? element.offsetWidth : element.offsetHeight;\n}\nfunction getBaseSwipeThreshold(element, direction) {\n return Math.max(getBaseSwipeSize(element, direction) * 0.5, MIN_SWIPE_THRESHOLD);\n}\nfunction isRangeInput(target, win) {\n return target instanceof win.HTMLInputElement && target.type === 'range';\n}\nfunction isTextSelectionControl(target) {\n return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA';\n}\nfunction hasExpandedSelectionWithinTarget(selection, target) {\n const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;\n const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;\n return selection.containsNode(target, true) || contains(target, anchorElement) || contains(target, focusElement);\n}\nfunction shouldIgnoreSwipeForTextSelection(doc, rootElement) {\n const activeEl = activeElement(doc);\n if (activeEl && contains(rootElement, activeEl) && isTextSelectionControl(activeEl)) {\n const {\n selectionStart,\n selectionEnd\n } = activeEl;\n if (selectionStart != null && selectionEnd != null && selectionStart < selectionEnd) {\n return true;\n }\n }\n const selection = doc.getSelection?.();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n return hasExpandedSelectionWithinTarget(selection, rootElement);\n}\nfunction isEventOnRangeInput(event, win) {\n return event.composedPath().some(pathTarget => isRangeInput(pathTarget, win));\n}\nfunction isReactTouchEventOnRangeInput(event) {\n return isEventOnRangeInput(event.nativeEvent, ownerWindow(event.currentTarget));\n}\nfunction updateTouchScrollPosition(touchState, touch) {\n touchState.lastX = touch.clientX;\n touchState.lastY = touch.clientY;\n}\n\n/**\n * Arbitrates a touchmove between the drawer swipe and a cross-axis gesture: a native scroll, or an\n * element marked with the cross-axis `data-base-ui-swipe-ignore` value.\n * Returns `true` when the move must be left alone — either because the cross axis already won the\n * gesture, or because neither axis has passed the slop yet and the gesture cannot be attributed.\n */\nfunction shouldYieldTouchMove(touchState, event, touch, isVerticalScrollAxis) {\n if (touchState.preserveNativeCrossAxisScroll) {\n return true;\n }\n\n // Attribution happens once per gesture. Re-arbitrating after the drawer axis has won would let\n // the pre-attribution branches below fire mid-drag (the slop is measured from the touch origin,\n // which is never re-baselined), freezing the popup and dropping `preventDefault()`.\n if (touchState.drawerAxisAttributed || touchState.allowSwipe === true || !touchState.hasCrossAxisGestureTarget) {\n return false;\n }\n\n // A non-cancelable touchmove means the browser has already committed the gesture to a native\n // scroll; claiming it for the swipe would drag the popup alongside the scrolling content.\n if (!event.cancelable) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n const drawerAxisGestureDelta = isVerticalScrollAxis ? touch.clientY - touchState.startY : touch.clientX - touchState.startX;\n const crossAxisGestureDelta = isVerticalScrollAxis ? touch.clientX - touchState.startX : touch.clientY - touchState.startY;\n const absDrawerAxisGestureDelta = Math.abs(drawerAxisGestureDelta);\n const absCrossAxisGestureDelta = Math.abs(crossAxisGestureDelta);\n if (absCrossAxisGestureDelta >= AXIS_LOCK_SLOP && absCrossAxisGestureDelta > absDrawerAxisGestureDelta + AXIS_LOCK_BIAS) {\n touchState.preserveNativeCrossAxisScroll = true;\n return true;\n }\n if (absDrawerAxisGestureDelta >= AXIS_LOCK_SLOP) {\n touchState.drawerAxisAttributed = true;\n return false;\n }\n\n // Neither axis has traveled past the slop yet, so the gesture cannot be attributed. Leave the\n // event alone: on iOS, `preventDefault()` on the first cancelable touchmove cancels native\n // scrolling for the entire gesture, which would lock a cross-axis scroll that only passes the\n // slop on a later move.\n return true;\n}\nfunction hasScrollableContentOnAxis(scrollTarget, axis) {\n return getScrollMetrics(scrollTarget, axis).max > 0;\n}\nfunction getScrollMetrics(scrollTarget, axis) {\n if (axis === 'vertical') {\n const max = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);\n return {\n offset: scrollTarget.scrollTop,\n max\n };\n }\n const max = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);\n return {\n offset: scrollTarget.scrollLeft,\n max\n };\n}\nfunction isAtSwipeStartEdge(scrollTarget, axis, direction) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const {\n offset,\n max\n } = getScrollMetrics(scrollTarget, axis);\n return dismissFromStartEdge ? offset <= 0 : offset >= max;\n}\nfunction canSwipeFromScrollEdgeOnMove(scrollTarget, axis, direction, delta) {\n const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);\n const movingTowardDismiss = dismissFromStartEdge ? delta > 0 : delta < 0;\n if (!movingTowardDismiss) {\n return false;\n }\n return isAtSwipeStartEdge(scrollTarget, axis, direction);\n}\nfunction shouldDismissFromStartEdge(direction, axis) {\n return axis === 'vertical' ? direction === 'down' : direction === 'right';\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A positioning container for the dialog popup that can be made scrollable.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogViewport = /*#__PURE__*/React.forwardRef(function DialogViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const keepMounted = useDialogPortalContext();\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const transitionStatus = store.useState('transitionStatus');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const mounted = store.useState('mounted');\n const setViewportElement = store.useStateSetter('viewportElement');\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const shouldRender = keepMounted || mounted;\n return useRenderElement('div', componentProps, {\n enabled: shouldRender,\n state,\n ref: [forwardedRef, setViewportElement],\n stateAttributesMapping: dialogStateAttributesMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: !open ? 'none' : undefined\n },\n children\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogViewport.displayName = \"DialogViewport\";","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the dialog is open.\n */\nexport const open = CommonPopupDataAttributes.open;\n/**\n * Present when the dialog is closed.\n */\nexport const closed = CommonPopupDataAttributes.closed;\n/**\n * Present when the dialog begins animating in.\n */\nexport const startingStyle = CommonPopupDataAttributes.startingStyle;\n/**\n * Present when the dialog is animating out.\n */\nexport const endingStyle = CommonPopupDataAttributes.endingStyle;\n/**\n * Present when the dialog is nested within another dialog.\n */\nexport const nested = 'data-nested';\n/**\n * Present when the dialog has other open dialogs nested within it.\n */\nexport const nestedDialogOpen = 'data-nested-dialog-open';","'use client';\n\nimport * as React from 'react';\nexport const DrawerVirtualKeyboardContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DrawerVirtualKeyboardContext.displayName = \"DrawerVirtualKeyboardContext\";\nexport function useDrawerVirtualKeyboardContext() {\n return React.useContext(DrawerVirtualKeyboardContext);\n}","'use client';\n\nimport { Drawer } from '@base-ui/react/drawer';\nimport { Toast } from '@base-ui/react/toast';\nimport { useRouter } from 'next/navigation';\nimport { useState, useTransition } from 'react';\n\nimport { BUTTONS, INPUT } from '../../../forms/ui/look';\nimport { Switch } from '../../../forms/ui/switch';\nimport { ActionButton } from '../../../overview/ui/action-button';\nimport { StatusBadge, Tag } from '../../../outside-parties/ui/status-badge';\nimport { setPartyScopes, switchPartyTools, type TableOutcome } from '../../actions';\nimport { switchedMessageOf } from '../../switched-message';\nimport { hintSuggestionsOf, suggestedScopesOf } from '../hint-suggestions';\nimport { changedScopesOf, SCOPE_CHANGES, type ScopeChange } from '../scope-change';\nimport { partyScopesSetMessage, scopesSetMessage, statedMessage, suggestionsSetMessage, toolsSwitchedMessage } from '../table-messages';\nimport { keptToolsOf, shownTools, STATE_FILTERS, type KeptChanges, type StateFilter, type TableTool } from '../table-tools';\nimport { NeedsChips, type ListedScope } from './needs-chips';\nimport { ScopePicker } from './scope-picker';\nimport { standingRefusal, TableDialog, type DialogRefusal } from './table-dialog';\nimport { TableToasts } from './table-toasts';\n\n/** What the table shows of one outside MCP server, as its page read it. */\nexport interface ToolsTableProps {\n fleetId: string;\n party: string;\n tools: readonly TableTool[];\n /** The requirements' version the page read, which every change is made on. */\n version: number;\n partyScopes: readonly string[];\n /** The scopes the fleet lists, for an approver; none for anyone else. */\n listed: readonly ListedScope[] | null;\n /** Whether the actor approves the party: gateway:approve within manage reach. Others see the table read-only. */\n canChange: boolean;\n /** Why the server's tools could not be read: the table then shows the requirements kept per tool name. */\n serverRefusal: string | null;\n}\n\ntype OpenDialog = 'scopes' | 'party' | 'suggest' | null;\n\nconst ALL_SELECTED = 'Select all shown';\n\nfunction firstLineOf(description: string | undefined): string {\n return description?.split('\\n').find((line) => line.trim() !== '')?.trim() ?? '';\n}\n\n/**\n * An outside MCP server's tools as a table (gateway scopes 4.3, A6): filter\n * by name and state, select many, and set the scopes they need or switch them\n * in one change; set what every tool needs; or suggest scopes from the\n * server's hints. Each change is one transaction on the requirements' version\n * the page read: on success the dialog closes, the changed rows highlight and\n * a Toast says what was kept; a refusal stays inline. Only an approver within\n * manage reach sees the controls; anyone else, the same table read-only.\n */\nexport function ToolsTable(props: ToolsTableProps) {\n return (\n <Toast.Provider>\n <TableBody {...props} />\n <TableToasts />\n </Toast.Provider>\n );\n}\n\n/** What was kept since the page read the rows it was kept on; a fresh read replaces it. */\ninterface Kept extends KeptChanges {\n basis: readonly TableTool[];\n party: readonly string[] | null;\n}\n\nfunction TableBody({ fleetId, party, tools: readTools, version, partyScopes: readPartyScopes, listed, canChange, serverRefusal }: ToolsTableProps) {\n const router = useRouter();\n const toasts = Toast.useToastManager();\n const [, startTransition] = useTransition();\n const [isReloading, startReload] = useTransition();\n const [nameFilter, setNameFilter] = useState('');\n const [stateFilter, setStateFilter] = useState<StateFilter>('all');\n const [selected, setSelected] = useState<ReadonlySet<string>>(new Set());\n const [dialog, setDialog] = useState<OpenDialog>(null);\n const [picked, setPicked] = useState<string[]>([]);\n const [how, setHow] = useState<ScopeChange>('add');\n const [suggestPicks, setSuggestPicks] = useState<{ readOnly: string[]; other: string[] }>({ readOnly: [], other: [] });\n const [isSaving, setIsSaving] = useState(false);\n const [refusal, setRefusal] = useState<DialogRefusal | null>(null);\n const [switching, setSwitching] = useState<string | null>(null);\n const [switchRefusal, setSwitchRefusal] = useState<string | null>(null);\n const [highlighted, setHighlighted] = useState<{ names: ReadonlySet<string>; round: number }>({ names: new Set(), round: 0 });\n const [keptVersion, setKeptVersion] = useState<number | null>(null);\n const [isSheetOpen, setIsSheetOpen] = useState(false);\n const [keptChanges, setKeptChanges] = useState<Kept | null>(null);\n\n // A change kept here shows at once; once the page read itself again, its rows are the truth.\n const live = keptChanges?.basis === readTools ? keptChanges : null;\n const tools = live === null ? readTools : keptToolsOf(readTools, live);\n const partyScopes = live?.party ?? readPartyScopes;\n\n // A change kept here moves the version on before the page reads itself again.\n const currentVersion = Math.max(version, keptVersion ?? 0);\n const listedNames = listed === null ? null : new Set(listed.map(({ scope }) => scope));\n const shown = shownTools(tools, { name: nameFilter, state: stateFilter, partyScopes });\n const selectedTools = tools.filter(({ name }) => selected.has(name));\n const isServerAnswering = serverRefusal === null;\n const isEveryShownSelected = shown.length > 0 && shown.every(({ name }) => selected.has(name));\n const suggestions = hintSuggestionsOf(tools);\n const suggested = suggestedScopesOf(suggestions, suggestPicks);\n\n const kept = ({ outcome, changed, message, change }: { outcome: Extract<TableOutcome, { isOk: true }>; changed: readonly string[]; message: string; change: { party?: readonly string[]; scopes?: readonly { tool: string; scopes: readonly string[] }[]; switches?: ReadonlyMap<string, boolean> } }) => {\n setKeptChanges({\n basis: readTools,\n party: change.party ?? live?.party ?? null,\n scopes: new Map([...(live?.scopes ?? []), ...(change.scopes ?? []).map(({ tool, scopes }) => [tool, scopes] as const)]),\n switches: new Map([...(live?.switches ?? []), ...(change.switches ?? [])]),\n });\n if (outcome.version !== null) {\n setKeptVersion(outcome.version);\n }\n setHighlighted((previous) => ({ names: new Set(changed), round: previous.round + 1 }));\n toasts.add({ title: statedMessage(message, outcome.statementRefusal) });\n router.refresh();\n };\n\n const openDialog = (opened: Exclude<OpenDialog, null>) => {\n setRefusal(null);\n setIsSheetOpen(false);\n setPicked(opened === 'party' ? [...partyScopes] : []);\n setHow('add');\n setSuggestPicks({ readOnly: [], other: [] });\n setDialog(opened);\n };\n\n const closeDialog = () => {\n setDialog(null);\n setRefusal(null);\n };\n\n const save = ({ change, changed, message }: { change: { party?: string[]; tools: { tool: string; scopes: string[] }[] }; changed: readonly string[]; message: string }) => {\n setIsSaving(true);\n setRefusal(null);\n const madeOn = currentVersion;\n startTransition(async () => {\n const outcome = await setPartyScopes({ fleetId, name: party, version: madeOn, ...change });\n setIsSaving(false);\n if (!outcome.isOk) {\n setRefusal({ message: outcome.message, isConflict: outcome.isConflict, version: madeOn });\n return;\n }\n setDialog(null);\n setSelected(new Set());\n kept({ outcome, changed, message, change: { ...(change.party === undefined ? {} : { party: change.party }), scopes: change.tools } });\n });\n };\n\n const switchTools = ({ names, isOn, working }: { names: readonly string[]; isOn: boolean; working: string }) => {\n setSwitching(working);\n setSwitchRefusal(null);\n setIsSheetOpen(false);\n startTransition(async () => {\n const outcome = await switchPartyTools({ fleetId, name: party, tools: [...names], isOn });\n setSwitching(null);\n if (!outcome.isOk) {\n setSwitchRefusal(outcome.message);\n return;\n }\n const [only] = names;\n kept({ outcome, changed: names, change: { switches: new Map(names.map((name) => [name, isOn])) }, message: names.length === 1 && only !== undefined ? switchedMessageOf({ tool: only, isOn, statementRefusal: null }) : toolsSwitchedMessage({ count: names.length, isOn, statementRefusal: null }) });\n });\n };\n\n const reload = () => {\n startReload(() => {\n router.refresh();\n });\n };\n\n const toggle = (name: string) => {\n setSelected((previous) => {\n const next = new Set(previous);\n if (next.has(name)) {\n next.delete(name);\n } else {\n next.add(name);\n }\n return next;\n });\n };\n\n const toggleShown = () => {\n setSelected((previous) => {\n const next = new Set(previous);\n for (const { name } of shown) {\n if (isEveryShownSelected) {\n next.delete(name);\n } else {\n next.add(name);\n }\n }\n return next;\n });\n };\n\n const isBusy = switching !== null || isSaving;\n const toolbar = (\n <div className=\"grid gap-3 sm:flex sm:flex-wrap sm:items-center\" data-testid=\"tools-table-toolbar\">\n <label className=\"grid gap-1 sm:w-56\">\n <span className=\"sr-only\">Filter by name</span>\n <input className={INPUT} type=\"search\" placeholder=\"Filter by name\" value={nameFilter} onChange={(event) => { setNameFilter(event.target.value); }} data-testid=\"tools-table-name-filter\" />\n </label>\n <div role=\"group\" aria-label=\"Filter by state\" className=\"flex flex-wrap gap-1\">\n {STATE_FILTERS.map(({ state, label }) => (\n <button\n key={state}\n type=\"button\"\n aria-pressed={stateFilter === state}\n onClick={() => { setStateFilter(state); }}\n className={`h-8 rounded-md border px-3 ${stateFilter === state ? 'border-primary bg-primary text-primary-foreground' : 'border-border bg-card hover:bg-accent'}`}\n data-testid={`tools-table-state-${state}`}\n >\n {label}\n </button>\n ))}\n </div>\n {canChange ? (\n <>\n <label className=\"flex items-center gap-2\">\n <input type=\"checkbox\" checked={isEveryShownSelected} onChange={toggleShown} disabled={shown.length === 0} data-testid=\"tools-table-select-shown\" />\n {ALL_SELECTED}\n </label>\n <span className=\"text-muted-foreground\" data-testid=\"tools-table-selected\">\n {selected.size} selected\n </span>\n <div className=\"flex flex-wrap gap-2 sm:ml-auto\">\n <button type=\"button\" className={BUTTONS.secondary} disabled={selected.size === 0 || isBusy || listed === null} onClick={() => { openDialog('scopes'); }} data-testid=\"tools-table-set-scopes\">\n Set scopes…\n </button>\n <ActionButton isPending={switching === 'on'} pendingLabel=\"Switching on…\" disabled={selected.size === 0 || isBusy || !isServerAnswering} onClick={() => { switchTools({ names: [...selected], isOn: true, working: 'on' }); }} data-testid=\"tools-table-switch-on\">\n Switch on\n </ActionButton>\n <ActionButton isPending={switching === 'off'} pendingLabel=\"Switching off…\" disabled={selected.size === 0 || isBusy || !isServerAnswering} onClick={() => { switchTools({ names: [...selected], isOn: false, working: 'off' }); }} data-testid=\"tools-table-switch-off\">\n Switch off\n </ActionButton>\n <button type=\"button\" className={BUTTONS.secondary} disabled={isBusy || !isServerAnswering || listed === null} onClick={() => { openDialog('suggest'); }} data-testid=\"tools-table-suggest\">\n Suggest from hints…\n </button>\n </div>\n </>\n ) : null}\n </div>\n );\n\n return (\n <div className=\"grid gap-3\">\n <div className=\"flex flex-wrap items-center gap-2\" data-testid=\"tools-table-party-needs\">\n <span className=\"font-medium\">Every tool needs</span>\n <NeedsChips party={partyScopes} own={[]} listed={listedNames} />\n {canChange ? (\n <button type=\"button\" className=\"text-primary hover:underline disabled:opacity-60\" disabled={isBusy || listed === null} onClick={() => { openDialog('party'); }} data-testid=\"tools-table-party-change\">\n Change…\n </button>\n ) : null}\n </div>\n {serverRefusal === null ? null : (\n <p role=\"status\" className=\"rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-tone-waiting-fg\" data-testid=\"tools-table-server-down\">\n The server did not answer, so this shows the scopes kept per tool name; they can still be changed. {serverRefusal}\n </p>\n )}\n <div className=\"hidden sm:block\">{toolbar}</div>\n <div className=\"sm:hidden\">\n <Drawer.Root open={isSheetOpen} onOpenChange={setIsSheetOpen}>\n <Drawer.Trigger className={BUTTONS.secondary} data-testid=\"tools-table-sheet-open\">\n Filters and actions{canChange ? ` (${String(selected.size)} selected)` : ''}\n </Drawer.Trigger>\n <Drawer.Portal>\n <Drawer.Backdrop className=\"fixed inset-0 z-40 bg-(--overlay)\" />\n <Drawer.Viewport className=\"fixed inset-0 z-50 flex items-end\">\n <Drawer.Popup className=\"w-full rounded-t-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg\">\n <Drawer.Content className=\"grid gap-3\">\n <Drawer.Title className=\"text-heading font-semibold\">Filters and actions</Drawer.Title>\n {toolbar}\n <Drawer.Close className={BUTTONS.secondary}>Done</Drawer.Close>\n </Drawer.Content>\n </Drawer.Popup>\n </Drawer.Viewport>\n </Drawer.Portal>\n </Drawer.Root>\n </div>\n {switchRefusal === null ? null : (\n <p role=\"alert\" className=\"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg\" data-testid=\"tools-table-switch-refusal\">\n {switchRefusal}\n </p>\n )}\n <table className=\"w-full border-collapse max-sm:block\" data-testid=\"tools-table\">\n <thead className=\"max-sm:hidden\">\n <tr className=\"border-b border-border text-left text-muted-foreground\">\n {canChange ? <th className=\"w-8 py-2\"><span className=\"sr-only\">Selected</span></th> : null}\n <th className=\"py-2 font-medium\">Tool</th>\n <th className=\"py-2 font-medium\">Hints</th>\n <th className=\"py-2 font-medium\">On</th>\n <th className=\"py-2 font-medium\">Needs</th>\n </tr>\n </thead>\n <tbody className=\"max-sm:grid max-sm:gap-2\">\n {shown.map((tool) => {\n const isHighlighted = highlighted.names.has(tool.name);\n return (\n <tr\n key={isHighlighted ? `${tool.name}-${String(highlighted.round)}` : tool.name}\n className={`border-b border-border align-top last:border-b-0 max-sm:grid max-sm:grid-cols-[auto_1fr] max-sm:gap-x-2 max-sm:rounded-md max-sm:border max-sm:p-2 ${isHighlighted ? 'animate-highlight' : ''}`}\n data-testid=\"tools-table-row\"\n data-tool={tool.name}\n >\n {canChange ? (\n <td className=\"py-2 pr-2 max-sm:row-span-4\">\n <input type=\"checkbox\" aria-label={`Select ${tool.name}`} checked={selected.has(tool.name)} onChange={() => { toggle(tool.name); }} data-testid=\"tools-table-select\" />\n </td>\n ) : null}\n <td className=\"py-2 pr-3 max-sm:col-start-2\">\n <span className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-mono\">{tool.name}</span>\n {tool.isNew ? <StatusBadge tone=\"attention\" label=\"New\" /> : null}\n </span>\n {firstLineOf(tool.description) === '' ? null : <span className=\"block text-muted-foreground\">{firstLineOf(tool.description)}</span>}\n </td>\n <td className=\"py-2 pr-3 max-sm:col-start-2\">\n <span className=\"flex flex-wrap gap-1\">\n {tool.isReadOnly === true ? <Tag>Read only</Tag> : null}\n {tool.isDestructive === true ? <Tag>Destructive</Tag> : null}\n </span>\n </td>\n <td className=\"py-2 pr-3 max-sm:col-start-2\">\n {tool.isOn === null ? (\n <span className=\"text-muted-foreground\">Not known</span>\n ) : canChange ? (\n <Switch isOn={tool.isOn} label={tool.name} isPending={switching === tool.name} onClick={() => { switchTools({ names: [tool.name], isOn: tool.isOn !== true, working: tool.name }); }} testId=\"tools-table-switch\" />\n ) : (\n <Tag>{tool.isOn ? 'On' : 'Off'}</Tag>\n )}\n </td>\n <td className=\"py-2 max-sm:col-start-2\">\n <NeedsChips party={partyScopes} own={tool.scopes} listed={listedNames} />\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n {shown.length === 0 ? (\n <p className=\"text-muted-foreground\" data-testid=\"tools-table-empty\">\n {tools.length === 0 ? (isServerAnswering ? `${party} lists no tools.` : 'No tool needs a scope of its own yet.') : 'No tool matches the filters.'}\n </p>\n ) : null}\n {listed === null ? null : (\n <>\n <TableDialog\n isOpen={dialog === 'scopes'}\n onClose={closeDialog}\n title=\"Set scopes\"\n description=\"The scopes a calling ship must hold for each selected tool, beside what every tool needs.\"\n appliesTo={`Applies to ${String(selectedTools.length)} ${selectedTools.length === 1 ? 'tool' : 'tools'}`}\n action={{\n label: 'Set scopes',\n pending: 'Setting…',\n isDisabled: picked.length === 0 && how !== 'replace',\n onPress: () => {\n save({ change: { tools: changedScopesOf(selectedTools, { scopes: picked, how }) }, changed: selectedTools.map(({ name }) => name), message: scopesSetMessage({ scopes: picked, how, count: selectedTools.length }) });\n },\n }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, currentVersion)}\n isReloading={isReloading}\n onReload={reload}\n testId=\"tools-table-scopes-dialog\"\n >\n <ScopePicker label=\"Scopes\" listed={listed} picked={picked} onPick={setPicked} isDisabled={isSaving} testId=\"tools-table-scopes-picker\" />\n <fieldset className=\"grid gap-1\">\n <legend className=\"font-medium\">On each selected tool</legend>\n {SCOPE_CHANGES.map((change) => (\n <label key={change.how} className=\"flex items-center gap-2\">\n <input type=\"radio\" name=\"how\" value={change.how} checked={how === change.how} onChange={() => { setHow(change.how); }} data-testid={`tools-table-how-${change.how}`} />\n {change.label}\n </label>\n ))}\n </fieldset>\n </TableDialog>\n <TableDialog\n isOpen={dialog === 'party'}\n onClose={closeDialog}\n title=\"Every tool needs\"\n description={`The scopes a calling ship must hold for every tool of ${party}, beside each tool's own.`}\n appliesTo={`Applies to every tool of ${party}`}\n action={{\n label: 'Save',\n pending: 'Saving…',\n isDisabled: false,\n onPress: () => {\n save({ change: { party: picked, tools: [] }, changed: tools.map(({ name }) => name), message: partyScopesSetMessage({ party, scopes: picked }) });\n },\n }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, currentVersion)}\n isReloading={isReloading}\n onReload={reload}\n testId=\"tools-table-party-dialog\"\n >\n <ScopePicker label=\"Scopes\" listed={listed} picked={picked} onPick={setPicked} isDisabled={isSaving} testId=\"tools-table-party-picker\" />\n </TableDialog>\n <TableDialog\n isOpen={dialog === 'suggest'}\n onClose={closeDialog}\n title=\"Suggest from hints\"\n description=\"Scopes for each tool with no scope of its own, by what the server says of it. Hints are the server's claim: nothing applies until you confirm.\"\n appliesTo={`Applies to ${String(suggested.length)} ${suggested.length === 1 ? 'tool' : 'tools'}`}\n action={{\n label: 'Apply',\n pending: 'Applying…',\n isDisabled: suggested.length === 0,\n onPress: () => {\n const groups = [\n { scopes: suggestPicks.readOnly, count: suggestPicks.readOnly.length === 0 ? 0 : suggestions.readOnly.length },\n { scopes: suggestPicks.other, count: suggestPicks.other.length === 0 ? 0 : suggestions.other.length },\n ].filter(({ count }) => count > 0);\n save({ change: { tools: suggested }, changed: suggested.map(({ tool }) => tool), message: suggestionsSetMessage(groups) });\n },\n }}\n isSaving={isSaving}\n refusal={standingRefusal(refusal, currentVersion)}\n isReloading={isReloading}\n onReload={reload}\n testId=\"tools-table-suggest-dialog\"\n >\n <ScopePicker label=\"Scopes for read-only tools\" listed={listed} picked={suggestPicks.readOnly} onPick={(readOnly) => { setSuggestPicks((previous) => ({ ...previous, readOnly })); }} isDisabled={isSaving} testId=\"tools-table-suggest-read-only\" />\n <ScopePicker label=\"Scopes for the other tools\" listed={listed} picked={suggestPicks.other} onPick={(other) => { setSuggestPicks((previous) => ({ ...previous, other })); }} isDisabled={isSaving} testId=\"tools-table-suggest-other\" />\n <SuggestedList title=\"Read-only tools\" names={suggestions.readOnly} testId=\"tools-table-suggest-read-only-tools\" />\n <SuggestedList title=\"Other tools\" names={suggestions.other} testId=\"tools-table-suggest-other-tools\" />\n <SuggestedList title=\"Without hints, left as they are\" names={suggestions.withoutHints} testId=\"tools-table-suggest-without-hints\" />\n </TableDialog>\n </>\n )}\n </div>\n );\n}\n\n/** One group of the tools a suggestion would change, by name. */\nfunction SuggestedList({ title, names, testId }: { title: string; names: readonly string[]; testId: string }) {\n return (\n <details className=\"rounded-md border border-border px-3 py-2\" data-testid={testId}>\n <summary className=\"cursor-pointer\">\n {title} ({names.length})\n </summary>\n {names.length === 0 ? <p className=\"text-muted-foreground\">None</p> : <p className=\"font-mono text-code break-words\">{names.join(', ')}</p>}\n </details>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"40e82407011c6d236a4a2c8db8e53c307a6e8aa98f\":{\"name\":\"switchPartyTools\"}},\"web/features/outside-party/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_2=/*#__PURE__*/createServerReference(\"40e82407011c6d236a4a2c8db8e53c307a6e8aa98f\",callServer,void 0,findSourceMapURL,\"switchPartyTools\");export{$$RSC_SERVER_ACTION_2 as switchPartyTools};","/** What a tool's switch says once the API kept it: what the fleet sees now, or that the proxy ship shows it at its next statement, and why. */\nexport function switchedMessageOf({ tool, isOn, statementRefusal }: { tool: string; isOn: boolean; statementRefusal: string | null }): string {\n const state = `${tool} is ${isOn ? 'on' : 'off'}`;\n if (statementRefusal !== null) {\n return `${state}; the fleet sees it at the proxy ship's next statement: ${statementRefusal}`;\n }\n return isOn ? `${state}: the fleet may call it.` : `${state}: the fleet sees it no more, and a call to it is refused.`;\n}\n","/**\n * Suggest from hints (gateway scopes 4.3): the tools with no scope of their\n * own, split by what the server says of them. Hints are the server's claim,\n * never trusted on their own, so nothing applies until the approver confirms.\n */\n\ninterface HintedTool {\n name: string;\n isReadOnly?: boolean | undefined;\n isDestructive?: boolean | undefined;\n scopes: readonly string[];\n}\n\n/** The tools each picker would change, by name, and the ones without hints, left untouched. */\nexport interface HintSuggestions {\n readOnly: string[];\n other: string[];\n withoutHints: string[];\n}\n\nexport function hintSuggestionsOf(tools: readonly HintedTool[]): HintSuggestions {\n const suggestions: HintSuggestions = { readOnly: [], other: [], withoutHints: [] };\n for (const tool of tools.filter(({ scopes }) => scopes.length === 0)) {\n if (tool.isDestructive === true || tool.isReadOnly === false) {\n suggestions.other.push(tool.name);\n } else if (tool.isReadOnly === true) {\n suggestions.readOnly.push(tool.name);\n } else {\n suggestions.withoutHints.push(tool.name);\n }\n }\n return suggestions;\n}\n\n/** The change the suggestions make with the scopes picked: a group whose picker is empty changes nothing. */\nexport function suggestedScopesOf(suggestions: HintSuggestions, picked: { readOnly: readonly string[]; other: readonly string[] }): { tool: string; scopes: string[] }[] {\n const group = (tools: readonly string[], scopes: readonly string[]) => (scopes.length === 0 ? [] : tools.map((tool) => ({ tool, scopes: [...scopes] })));\n return [...group(suggestions.readOnly, picked.readOnly), ...group(suggestions.other, picked.other)];\n}\n","/** How a bulk change treats the picked scopes on each selected tool (gateway scopes 4.3). */\nexport const SCOPE_CHANGES = [\n { how: 'add', label: 'Add to each' },\n { how: 'remove', label: 'Remove from each' },\n { how: 'replace', label: 'Replace with these' },\n] as const;\n\nexport type ScopeChange = (typeof SCOPE_CHANGES)[number]['how'];\n\n/** What each selected tool needs of its own after the change, each scope once; none needs nothing beyond the party's. */\nexport function changedScopesOf(selected: readonly { name: string; scopes: readonly string[] }[], change: { scopes: readonly string[]; how: ScopeChange }): { tool: string; scopes: string[] }[] {\n return selected.map(({ name, scopes }) => {\n switch (change.how) {\n case 'add':\n return { tool: name, scopes: [...new Set([...scopes, ...change.scopes])] };\n case 'remove':\n return { tool: name, scopes: scopes.filter((scope) => !change.scopes.includes(scope)) };\n case 'replace':\n return { tool: name, scopes: [...new Set(change.scopes)] };\n }\n });\n}\n","/**\n * The rows of an outside MCP server's tools table (gateway scopes 4.3):\n * each tool the server lists now, with its switch, the hints it gives and\n * the scopes it needs of its own; and the filters an approver narrows them by.\n */\nimport type { Read } from '../../../lib/gateway-api/page-api';\n\n/** A tool as the server lists it now, with its switch, as the API answers it. */\nexport interface ListedTool {\n name: string;\n description?: string | undefined;\n isReadOnly?: boolean | undefined;\n isDestructive?: boolean | undefined;\n isOn: boolean;\n isNew: boolean;\n}\n\n/** A party's required scopes as the API answers them. */\nexport interface PartyRequirements {\n version: number;\n party: string[];\n tools: { tool: string; scopes: string[] }[];\n}\n\n/** One row: the tool, its switch (unknown while the server does not answer), and the scopes it needs of its own. */\nexport interface TableTool {\n name: string;\n description?: string | undefined;\n isReadOnly?: boolean | undefined;\n isDestructive?: boolean | undefined;\n isOn: boolean | null;\n isNew: boolean;\n scopes: readonly string[];\n}\n\n/**\n * The rows: every tool the server lists with what it needs; while the server\n * does not answer, the requirements kept per tool name, so they can still be\n * read and changed.\n */\nexport function tableToolsOf({ read, requirements }: { read: Read<{ tools: ListedTool[] }>; requirements: PartyRequirements }): TableTool[] {\n const own = new Map(requirements.tools.map(({ tool, scopes }) => [tool, scopes]));\n if (!read.isOk) {\n return requirements.tools.map(({ tool, scopes }) => ({ name: tool, isOn: null, isNew: false, scopes }));\n }\n return read.value.tools.map((tool) => ({ ...tool, scopes: own.get(tool.name) ?? [] }));\n}\n\n/** The table's state filter. */\nexport const STATE_FILTERS = [\n { state: 'all', label: 'All' },\n { state: 'on', label: 'On' },\n { state: 'off', label: 'Off' },\n { state: 'new', label: 'New' },\n { state: 'needsNothing', label: 'Needs nothing' },\n] as const;\n\nexport type StateFilter = (typeof STATE_FILTERS)[number]['state'];\n\nfunction isInState(tool: TableTool, { state, partyScopes }: { state: StateFilter; partyScopes: readonly string[] }): boolean {\n switch (state) {\n case 'all':\n return true;\n case 'on':\n return tool.isOn === true;\n case 'off':\n return tool.isOn === false;\n case 'new':\n return tool.isNew;\n case 'needsNothing':\n return partyScopes.length === 0 && tool.scopes.length === 0;\n }\n}\n\n/** The tools whose name holds the text, in any case, and that are in the state picked. */\nexport function shownTools(tools: readonly TableTool[], filter: { name: string; state: StateFilter; partyScopes: readonly string[] }): TableTool[] {\n const name = filter.name.trim().toLowerCase();\n return tools.filter((tool) => tool.name.toLowerCase().includes(name) && isInState(tool, filter));\n}\n\n/** What the page kept since it read the rows: each changed tool's own scopes, and each switched tool's switch. */\nexport interface KeptChanges {\n scopes: ReadonlyMap<string, readonly string[]>;\n switches: ReadonlyMap<string, boolean>;\n}\n\n/** The rows with what was kept since they were read, so a change shows at once rather than when the page reads the server again. */\nexport function keptToolsOf(tools: readonly TableTool[], kept: KeptChanges): TableTool[] {\n return tools.map((tool) => ({ ...tool, scopes: kept.scopes.get(tool.name) ?? tool.scopes, isOn: tool.isOn === null ? null : (kept.switches.get(tool.name) ?? tool.isOn) }));\n}\n","'use client';\n\nimport { useActionState } from 'react';\nimport { useFormStatus } from 'react-dom';\n\nimport { FLEET_FIELD } from '../../forms/form-state';\nimport { Switch } from '../../forms/ui/switch';\nimport { markA2aAgent, type MarkState } from '../actions';\n\nconst IDLE: MarkState = { kind: 'idle' };\n\nfunction SubmitSwitch({ isRepeatable }: { isRepeatable: boolean }) {\n const status = useFormStatus();\n return <Switch type=\"submit\" isOn={isRepeatable} label=\"Repeatable\" isPending={status.pending} testId=\"outside-party-repeatable-switch\" />;\n}\n\n/**\n * An A2A agent's repeatable mark on its page, for an approver (A9): a press\n * sends the change at once, the switch says it is on its way, then the row\n * says what it means now, or why the API refused it.\n */\nexport function RepeatableSwitch({ fleetId, party, isRepeatable }: { fleetId: string; party: string; isRepeatable: boolean }) {\n const [state, action] = useActionState(markA2aAgent, IDLE);\n const shown = state.kind === 'marked' ? state.isRepeatable : isRepeatable;\n return (\n <>\n <form action={action} className=\"contents\">\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"name\" value={party} />\n <input type=\"hidden\" name=\"isRepeatable\" value={String(!shown)} />\n <SubmitSwitch isRepeatable={shown} />\n </form>\n {state.kind === 'idle' ? null : (\n <span role={state.kind === 'refused' ? 'alert' : 'status'} className={`basis-full text-caption ${state.kind === 'refused' ? 'text-tone-attention-fg' : 'text-tone-ok-fg'}`} data-testid=\"outside-party-repeatable-outcome\">\n {state.message}\n </span>\n )}\n </>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"60566e54974f37ea23543482d9cf63a66aa5f76a47\":{\"name\":\"markA2aAgent\"}},\"web/features/outside-party/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_3=/*#__PURE__*/createServerReference(\"60566e54974f37ea23543482d9cf63a66aa5f76a47\",callServer,void 0,findSourceMapURL,\"markA2aAgent\");export{$$RSC_SERVER_ACTION_3 as markA2aAgent};"],"names":["ToastContext","undefined","useToastProviderContext","context","Error","Switch","isOn","label","isPending","type","onClick","testId","role","disabled","className","AgentNeeds","props","Provider","AgentNeedsLine","fleetId","party","version","scopes","listed","canChange","router","toasts","useToastManager","startTransition","isReloading","startReload","isOpen","setIsOpen","picked","setPicked","isSaving","setIsSaving","refusal","setRefusal","keptVersion","setKeptVersion","round","setRound","kept","setKept","shown","basis","save","madeOn","Math","max","outcome","name","tools","isOk","message","isConflict","previous","add","title","statementRefusal","refresh","own","Set","map","scope","onClose","description","appliesTo","action","pending","isDisabled","onPress","onReload","onPick","nestedDrawers","height","frontmostHeight","swipeMovementX","swipeMovementY","snapPointOffset","swipeStrength","$$RSC_SERVER_ACTION_3"],"mappings":"mHAEA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCHA,EAAA,EAAA,CAAA,CAAA,OAEO,IAAMA,EAA4B,EAAA,WAAb,EAAgC,MAACC,GAAtB,AAEhC,SAASC,IACd,IAAMC,EAAU,EAAA,UAAgB,CAACH,GACjC,GAAI,CAACG,EACH,MAAM,AAAIC,CADE,KAC+G,AAA3G,AAA2G,CAAA,EAAA,EAAA,CAAA,AAAmB,EAAC,KAEjJ,OAAOD,CACT,CCZA,IAAA,EAAA,EAAA,CAAA,CAAA,MDS4D,CET5D,IAAI,EAAU,EDEd,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OEHO,SAAS,EAAsB,CAAO,CAAE,CAAM,EACnD,GAAuB,UAAnB,AAA6B,OAAtB,EACT,MAAO,CACL,YAAa,CACf,EAEF,GAAuB,YAA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,12,13,14,15,16,17,18,19,20,21,22,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106]}
|