@theoremjs/studio 0.3.5-next.902.g334d23a → 0.3.5-next.906.g6f050f4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/agreement.js +14 -22
- package/compile.js +4 -12
- package/cookbooks/catalog.d.ts +3 -2
- package/cookbooks/catalog.js +15 -14
- package/draft.d.ts +5 -4
- package/package.json +5 -5
- package/page/assets/{Badge-C0KjAK5l.js → Badge-BUFlIXVD.js} +1 -1
- package/page/assets/BottomSheet-v4keekfB.js +1 -0
- package/page/assets/Button-Bwkht0RI.js +1 -0
- package/page/assets/{Card-BUIbjVIe.js → Card-C6l0Ne1A.js} +1 -1
- package/page/assets/{Center-BVnAO8rr.js → Center-CPu_uP6i.js} +1 -1
- package/page/assets/CheckboxIndicator-BvfHW9OX.js +2 -0
- package/page/assets/CheckboxInput-Dd_tzCIt.js +2 -0
- package/page/assets/CodeBlock-QRlV-wmv.js +3 -0
- package/page/assets/CollapsibleGroup-483UEs5v.js +1 -0
- package/page/assets/ComponentIcon-75dIY9g7.js +1 -0
- package/page/assets/ConsoleFrame-CHnnxxNA.js +3 -0
- package/page/assets/DateInput-CYFXY_3W.js +1 -0
- package/page/assets/Dialog-tyH-Jv5A.js +1 -0
- package/page/assets/Divider-DzOWjyex.js +1 -0
- package/page/assets/{EmptyState-B_rMeBCn.js → EmptyState-DW-8doL9.js} +1 -1
- package/page/assets/Field-DvUFAlQ-.js +1 -0
- package/page/assets/FieldStatus-DOXgh0K8.js +1 -0
- package/page/assets/{HStack-D3i0gAme.js → HStack-B00ufja5.js} +1 -1
- package/page/assets/HoverCard-BgPoXy85.js +1 -0
- package/page/assets/Icon-Cd9sDRzY.js +48 -0
- package/page/assets/{IconButton-Crxt9XEq.js → IconButton-BenRR-zK.js} +1 -1
- package/page/assets/IconX-Cx51PGNB.js +1 -0
- package/page/assets/{ItemSwipeLayer-CVeHWmee.js → ItemSwipeLayer-DwHCHfiK.js} +1 -1
- package/page/assets/LayoutContent-BWpUj2Iy.js +1 -0
- package/page/assets/ListItem-C8WPxjPx.js +1 -0
- package/page/assets/{MenuBottomSheet-Kk5gIkzY.js → MenuBottomSheet-BR8JYBqn.js} +1 -1
- package/page/assets/MenuBottomSheetActionList-CZkxfDz5.js +1 -0
- package/page/assets/OverflowList-DDC9bnia.js +1 -0
- package/page/assets/{PanelSearchInput-CGk0XlVX.js → PanelSearchInput-CS1aeOUr.js} +1 -1
- package/page/assets/PowerSearchBottomSheet-DSkpQQys.js +1 -0
- package/page/assets/PressTracker-CEJ69JTB.js +1 -0
- package/page/assets/{ProgressBarMarkTooltip-BCgy6kk7.js → ProgressBarMarkTooltip-BTRXm_SP.js} +1 -1
- package/page/assets/{RankedBars-HSq4wPeA.js → RankedBars-C_arZO1h.js} +1 -1
- package/page/assets/{SchemaFields-DhHzB3cY.js → SchemaFields-DvOp5_M3.js} +1 -1
- package/page/assets/ScrollableArea-DgswAvfJ.js +1 -0
- package/page/assets/SegmentedControlItem-DLUgv9BP.js +1 -0
- package/page/assets/SidePanel-DcAhRInK.js +2 -0
- package/page/assets/Spinner-ObDlWHHD.js +1 -0
- package/page/assets/{Stack-BZiu21ta.js → Stack-3jR93LgR.js} +1 -1
- package/page/assets/StackItem-nWHq5y--.js +1 -0
- package/page/assets/Text-Cq4yqBpQ.js +2 -0
- package/page/assets/TextInput-DwHcdc-E.js +1 -0
- package/page/assets/TimestampHoverCard-CVXPEToD.js +1 -0
- package/page/assets/Token-CGIAH1hn.js +1 -0
- package/page/assets/TokenizerBottomSheet-DjiTJgA9.js +1 -0
- package/page/assets/{ToolResultCharts-BmoE9xfE.js → ToolResultCharts-t1kqy-J6.js} +1 -1
- package/page/assets/Toolbar-CkD1V_z_.js +1 -0
- package/page/assets/Tooltip-Rh2iV9Vn.js +1 -0
- package/page/assets/TraceInspector-CGGxz_g-.js +2 -0
- package/page/assets/{TraceOverview-DFi4TFKx.js → TraceOverview-C3RFiWfu.js} +3 -3
- package/page/assets/{VStack-BGVV0uKl.js → VStack-D1ZLA9g3.js} +1 -1
- package/page/assets/{_virtual_studio-type-sources-DndWNIpu.js → _virtual_studio-type-sources-CuPTbB69.js} +56 -15
- package/page/assets/animatedLayout-alPkNRf2.js +1 -0
- package/page/assets/boxHold-C4vf0eaW.js +1 -0
- package/page/assets/browser-connection-UWxIyv6u.js +1 -0
- package/page/assets/browser-engine-Ds0-ThtZ.js +16 -0
- package/page/assets/browser-transport-Dq9itWDy.js +2 -0
- package/page/assets/chainEventHandlers-BSZ5MWAl.js +1 -0
- package/page/assets/characters-Dp4H_dX7.js +1 -0
- package/page/assets/{tokens.stylex-a4pw9QVe.js → coarsePointer-B10KWVuz.js} +1 -1
- package/page/assets/compile-NWqVUG3a.js +4 -0
- package/page/assets/composeEventHandlers-CHIontwB.js +1 -0
- package/page/assets/{container.stylex-CkS70he6.js → container.stylex-CS4Pmkv3.js} +1 -1
- package/page/assets/devWarning-DxuplmRl.js +1 -0
- package/page/assets/disabledInteraction-u9yjM5Jo.js +1 -0
- package/page/assets/{embedding-space-view-D-Bnd0fH.js → embedding-space-view-3-qgFVUo.js} +1 -1
- package/page/assets/encode-files-Dc2wHsb6.js +1 -0
- package/page/assets/{export-agent-OANxVkvE.js → export-agent-Y0Y8mdbB.js} +3 -3
- package/page/assets/fieldParts-rVBtMOBE.js +1 -0
- package/page/assets/{focusOutline.stylex-LUQxyg0W.js → focusOutline.stylex-DXNeAcgS.js} +1 -1
- package/page/assets/{focusReturn-C7gRi2IE.js → focusReturn-DNKESCUc.js} +1 -1
- package/page/assets/focusableSelector-kxmVieoO.js +1 -0
- package/page/assets/fullEnglishFallback-Css2A5hC.js +1 -0
- package/page/assets/{getRadiusAndStrokeWidthFromDot-CFpiLWPo.js → getRadiusAndStrokeWidthFromDot-bzD-VA8b.js} +1 -1
- package/page/assets/groupItems-BLHEgC4O.js +1 -0
- package/page/assets/guardrail-health-BGyQi_jA.js +3 -0
- package/page/assets/guardrail-tester-DbR85sml.js +9 -0
- package/page/assets/haptics-5boj200r.js +1 -0
- package/page/assets/{highlightStyles-C7fXGwpK.js → highlightStyles-CJuQk9n5.js} +1 -1
- package/page/assets/holdEntranceInput-BRGRVT6b.js +1 -0
- package/page/assets/index-BvVj0JHm.css +1 -0
- package/page/assets/index-Cfhzi3KD.js +140 -0
- package/page/assets/{json-code-D2OkfSza.js → json-code-D2imJbsd.js} +1 -1
- package/page/assets/{labels-provider-26qkmR1c.js → labels-provider-CTjEbRdu.js} +2 -2
- package/page/assets/{live-messages-Df38_7Lx.js → live-messages-Bp_b714P.js} +1 -1
- package/page/assets/{map-token-CgKWabfH.js → map-token-BcCSmfJy.js} +1 -1
- package/page/assets/menuBottomSheet.stylex-BF-z_H3I.js +1 -0
- package/page/assets/modalOutlet-CNlIUlZC.js +1 -0
- package/page/assets/padding.stylex-Nfq09GFM.js +1 -0
- package/page/assets/press.stylex-aDT5uXq9.js +1 -0
- package/page/assets/projection-C57DLs2K.js +1 -0
- package/page/assets/prompt-row-eETPWTfK.js +76 -0
- package/page/assets/{read-map-BJqwz_gJ.js → read-map-C0E3pErZ.js} +1 -1
- package/page/assets/reader-C8mnJAB6.js +5 -0
- package/page/assets/registry-DJBxNVIO.js +1 -0
- package/page/assets/rubberBand-urxgJfJ0.js +1 -0
- package/page/assets/schema-D4bn5YDU.js +3 -0
- package/page/assets/scroll-74w_rjcI.js +1 -0
- package/page/assets/scrollView-DKN9Tc2s.js +1 -0
- package/page/assets/shaped-data-yrTrXPh4.js +25 -0
- package/page/assets/sharedResizeObserver-Ce0raAy-.js +1 -0
- package/page/assets/{stub-D6-YFRxO.js → stub-CZ_Xswg8.js} +1 -1
- package/page/assets/studio-code-pane-lxwvQgJE.js +8 -0
- package/page/assets/studio-console-BNOXf-xr.js +1 -0
- package/page/assets/studio-decision-C9oxa1xo.js +1 -0
- package/page/assets/studio-embedding-D8rA6MOH.js +2 -0
- package/page/assets/studio-host-console-XPl__wj7.js +2 -0
- package/page/assets/studio-labels-CUJQgb-k.js +3 -0
- package/page/assets/studio-live-B3gN-hIU.js +5 -0
- package/page/assets/studio-map-Cf2DHvn2.js +1 -0
- package/page/assets/{studio-trace-replay-CAW03Aol.js → studio-trace-replay-BCOqVguH.js} +3 -3
- package/page/assets/{studio-type-checker-CDfrrQ9W.js → studio-type-checker-BWW15y7M.js} +1 -1
- package/page/assets/textEntryTraits-C_EOnS4-.js +1 -0
- package/page/assets/tokenReferences-tYcl-8O-.js +1 -0
- package/page/assets/{tool-schema-lNJyGpcM.js → tool-schema-BMNs-MyH.js} +1 -1
- package/page/assets/touchHitArea.stylex-D2yrbNzX.js +1 -0
- package/page/assets/{trace-patterns-YZSpKAfw.js → trace-patterns-Bka_qf33.js} +1 -1
- package/page/assets/{trace-record-CmhXXllR.js → trace-record-CS_K7b8l.js} +1 -1
- package/page/assets/tree-D6WoHLJe.js +3 -0
- package/page/assets/{turn-client-BfkK4BN-.js → turn-client-8TS8z-jZ.js} +2 -2
- package/page/assets/types-D9SHTHld.js +1 -0
- package/page/assets/{use-one-call-KOcgOvF7.js → use-one-call-Ch9fKeMJ.js} +1 -1
- package/page/assets/use-second-ticker-C3VX4c6o.css +1 -0
- package/page/assets/useAdaptivePresentation-D53OuCPm.js +1 -0
- package/page/assets/useAnnounceRenderedText-C7Yqc9vL.js +1 -0
- package/page/assets/useCalendarSystem-Crg71MEB.js +1 -0
- package/page/assets/useClickableContainer-B08uXDf4.js +1 -0
- package/page/assets/useClipboard-CE6Krn40.js +1 -0
- package/page/assets/useDevWarning-WeXt8Pe8.js +1 -0
- package/page/assets/useDismissSearchOnTouchDrag-DJ9Di3hZ.js +1 -0
- package/page/assets/useFocusLeavingChange-xsJxlBAc.js +1 -0
- package/page/assets/useFocusTrap-DyznXJtp.js +1 -0
- package/page/assets/useGestureRecognizer-C1yNE90T.js +1 -0
- package/page/assets/useIsHydrating-DmtPcCGm.js +1 -0
- package/page/assets/useKeyboardHint-CV0b5BIQ.js +1 -0
- package/page/assets/useLayerDismissal-DwwLDEpO.js +1 -0
- package/page/assets/useListFormatter-BL-mfYUA.js +1 -0
- package/page/assets/useLocale-CPtOawsd.js +1 -0
- package/page/assets/useMediaQuery-Q9CwxYQy.js +1 -0
- package/page/assets/{useMenuOverflow-x8Ox3IyG.js → useMenuOverflow-C6hNF-rg.js} +1 -1
- package/page/assets/useMenuPress-Bjaz5nPC.js +1 -0
- package/page/assets/useMergedRefs-S6y2xAId.js +1 -0
- package/page/assets/usePressFeedback-DoNqlnA9.js +1 -0
- package/page/assets/useScrollLock-DGeH0BW_.js +1 -0
- package/page/assets/useScrollRegionProps-CnJi1TnL.js +1 -0
- package/page/assets/useScrollableArea-DLpP0enQ.js +1 -0
- package/page/assets/useTooltip-DQ4LKI-B.js +1 -0
- package/page/assets/useTranslator-BKF5qhFP.js +1 -0
- package/page/assets/{workspace-LbPd2mMU.js → workspace-CCtOtOGD.js} +1 -1
- package/page/index.html +112 -93
- package/prompt-doc.d.ts +21 -2
- package/prompt-doc.js +53 -2
- package/read-source.js +21 -34
- package/system-markup.d.ts +8 -11
- package/system-markup.js +20 -10
- package/ui/built/theme.css +43 -21
- package/ui/built/theme.css.d.ts +2 -2
- package/ui/built/theorem-studio.d.ts +2 -2
- package/ui/built/theorem-studio.js +42 -25
- package/ui/built/theorem-studio.variants.d.ts +2 -2
- package/ui/guardrail-health.js +1 -1
- package/ui/prompt-editor.d.ts +11 -7
- package/ui/prompt-editor.js +17 -11
- package/ui/prompt-row.d.ts +8 -3
- package/ui/prompt-row.js +34 -5
- package/ui/studio-save.js +1 -1
- package/page/assets/BaseTypeahead-CHXE162p.js +0 -1
- package/page/assets/BottomSheet-DoQyCSv5.js +0 -1
- package/page/assets/Button-Cb-mh6ml.js +0 -1
- package/page/assets/CheckboxIndicator-CWc5B_d1.js +0 -2
- package/page/assets/CheckboxInput-BrhD5W3u.js +0 -2
- package/page/assets/CodeBlock-B8SfIXyW.js +0 -3
- package/page/assets/CollapsibleGroup-YxyQ-UXo.js +0 -1
- package/page/assets/ConsoleFrame-6pxwtmj7.js +0 -3
- package/page/assets/DateInput-B9iV939o.js +0 -1
- package/page/assets/Dialog-BatAn-DX.js +0 -1
- package/page/assets/Field-BSCYng6A.js +0 -1
- package/page/assets/FieldStatus-D_97agai.js +0 -1
- package/page/assets/HoverCard-YEWLJPhx.js +0 -1
- package/page/assets/Icon-C9dlIB4I.js +0 -48
- package/page/assets/LayoutContent-NlcSjVn7.js +0 -1
- package/page/assets/ListItem-C80mhugw.js +0 -1
- package/page/assets/MenuBottomSheetActionList-BkRKLMkR.js +0 -1
- package/page/assets/OverflowList-T3oyz0uY.js +0 -1
- package/page/assets/ScrollableArea-Db8BBKVt.js +0 -1
- package/page/assets/SegmentedControlItem-DRVmwW9x.js +0 -1
- package/page/assets/SidePanel-7cMNIHsg.js +0 -2
- package/page/assets/Spinner-sCbvL2qs.js +0 -1
- package/page/assets/StackItem-ClAjT294.js +0 -1
- package/page/assets/Text-DfN1tSUL.js +0 -2
- package/page/assets/TextInput-CYSGEp-G.js +0 -1
- package/page/assets/TimestampHoverCard-0-rfsRpo.js +0 -1
- package/page/assets/Token-C0MCeuZZ.js +0 -1
- package/page/assets/TokenizerBottomSheet-CMErW59w.js +0 -1
- package/page/assets/Toolbar-R7By0ClV.js +0 -1
- package/page/assets/Tooltip-BO0yrDVt.js +0 -1
- package/page/assets/TraceInspector-B2-q3kdh.js +0 -1
- package/page/assets/browser-connection-BSNet_H3.js +0 -1
- package/page/assets/browser-engine-HY1MiOBw.js +0 -16
- package/page/assets/browser-transport-CqE21ewt.js +0 -2
- package/page/assets/browserClickWait-BSA4ZCzN.js +0 -1
- package/page/assets/chainEventHandlers-C6ttXGfW.js +0 -1
- package/page/assets/compile-DTDHCKfi.js +0 -2
- package/page/assets/devWarning-B-QAZEJI.js +0 -1
- package/page/assets/disabledInteraction-2qeNzu0m.js +0 -1
- package/page/assets/encode-files-DPDNany5.js +0 -1
- package/page/assets/fieldParts-DJZ7Rxcc.js +0 -1
- package/page/assets/focusableSelector-DXZeMU85.js +0 -1
- package/page/assets/guardrail-health-CwTKl0zG.js +0 -3
- package/page/assets/guardrail-tester-CKlDr0k_.js +0 -9
- package/page/assets/index-DoHtpQ_c.css +0 -1
- package/page/assets/index-OCKUpKmV.js +0 -150
- package/page/assets/isApplePlatform-BSwFAKoe.js +0 -1
- package/page/assets/menuBottomSheet.stylex-DRbZhkuJ.js +0 -1
- package/page/assets/plainDate-CE-glc6O.js +0 -1
- package/page/assets/prompt-row-DjQm0bw2.js +0 -75
- package/page/assets/reader-CR8x2duE.js +0 -5
- package/page/assets/registry-yn0Ipf-_.js +0 -1
- package/page/assets/schema-CvmO11hb.js +0 -3
- package/page/assets/shaped-data-D9qzQU2m.js +0 -25
- package/page/assets/sharedMutationObserver-BHa8gqlp.js +0 -1
- package/page/assets/stackItem.stylex-BkECao56.js +0 -1
- package/page/assets/studio-code-pane-C_AN-d0W.js +0 -10
- package/page/assets/studio-console-BjDwiYxB.js +0 -1
- package/page/assets/studio-decision-NFrI5pe7.js +0 -1
- package/page/assets/studio-embedding-lf-ItxLq.js +0 -2
- package/page/assets/studio-host-console-BPaTXrnv.js +0 -2
- package/page/assets/studio-labels-B_l5mKbZ.js +0 -3
- package/page/assets/studio-live-Babh_n6b.js +0 -5
- package/page/assets/studio-map-Ddk7GO_i.js +0 -1
- package/page/assets/textEntryTraits-C8qoTZ3W.js +0 -1
- package/page/assets/tree-DxJnvWmh.js +0 -3
- package/page/assets/types-YRukYg-4.js +0 -1
- package/page/assets/use-second-ticker-C09v74b0.css +0 -1
- package/page/assets/useAnnounceRenderedText-BWNmfFlE.js +0 -1
- package/page/assets/useBusyAnnouncement-DwJYqyJC.js +0 -1
- package/page/assets/useClickableContainer-dg6qYWze.js +0 -1
- package/page/assets/useClipboard-C7IeReFJ.js +0 -1
- package/page/assets/useFocusLeavingChange-CRkFJGdd.js +0 -1
- package/page/assets/useHighlightedOptionScroll-C7rzQTVc.js +0 -1
- package/page/assets/useIsHydrating-wiKgLSH8.js +0 -1
- package/page/assets/useKeyboardHint-B6oH_Cll.js +0 -1
- package/page/assets/useLayerDismissal-CqRa7y6J.js +0 -1
- package/page/assets/useLocale-DtI8SMic.js +0 -1
- package/page/assets/useMediaQuery-Dvkq1PZg.js +0 -1
- package/page/assets/useMenuPress-DM12OZUv.js +0 -1
- package/page/assets/useMergedRefs-DJD-JnFZ.js +0 -1
- package/page/assets/usePressFeedback-nkH67NDc.js +0 -1
- package/page/assets/useResolvedRequired-B-0WnbIo.js +0 -1
- package/page/assets/useScrollLock--U5R1vFj.js +0 -1
- package/page/assets/useScrollableArea-uSlz-RoI.js +0 -1
- package/page/assets/useSettledOpen-BJQ5dTsM.js +0 -1
- package/page/assets/useTooltip-NPYEayzZ.js +0 -1
- package/page/assets/useTranslator-CGZ-h6ng.js +0 -1
- /package/page/assets/{use-second-ticker-CDQ3LLWp.js → use-second-ticker-Dd57a-0O.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{i as n,n as r}from"./coarsePointer-B10KWVuz.js";import{i}from"./IconX-Cx51PGNB.js";import{t as a}from"./createReactComponent-DVEyVJ-p.js";var o=a(`outline`,`code`,`Code`,[[`path`,{d:`M7 8l-4 4l4 4`,key:`svg-0`}],[`path`,{d:`M17 8l4 4l-4 4`,key:`svg-1`}],[`path`,{d:`M14 4l-4 16`,key:`svg-2`}]]),s=a(`outline`,`eye`,`Eye`,[[`path`,{d:`M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6`,key:`svg-1`}]]),c=e(t(),1),l=()=>()=>{},u=()=>!1;function d(e){let t=e===`adaptive`,a=i().coarsePointerQuery,o=(0,c.useCallback)(e=>t?n(window,a,e):l(),[t,a]),s=(0,c.useCallback)(()=>t&&r(window,a),[t,a]),d=(0,c.useSyncExternalStore)(o,s,u);return t?d?`bottom-sheet`:`popover`:e}export{s as n,o as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{h as n,t as r}from"./useIsHydrating-DmtPcCGm.js";var i=e(t(),1),a=`[role="log"], [role="status"], [role="alert"], [aria-live="polite"], [aria-live="assertive"]`,o=`[aria-hidden="true"], [hidden]`,s=`p, div, li, br, h1, h2, h3, h4, h5, h6`;function c(e){return Array.from(e.childNodes).map(e=>{if(e.nodeType===Node.TEXT_NODE)return(e.textContent??``).replace(/\s+/g,` `).trim();if(e.nodeType===Node.ELEMENT_NODE){let t=e;return t.matches(o)?``:l(t)}return``}).filter(e=>e!==``).join(` `)}function l(e){let t=e.ownerDocument.defaultView,n=e=>t?.getComputedStyle(e).display??``,r=[],i=(e,t)=>{if(e.nodeType===Node.TEXT_NODE){r.push(e.textContent??``);return}if(e.nodeType!==Node.ELEMENT_NODE)return;let a=e;if(a.matches(o))return;let c=n(a),l=a.matches(s)||c!==``&&c!==`contents`&&!c.startsWith(`inline`)||/\b(flex|grid)\b/.test(t);l&&r.push(` `),a.childNodes.forEach(e=>i(e,c)),l&&r.push(` `)},a=n(e);return e.childNodes.forEach(e=>i(e,a)),r.join(``).replace(/\s+/g,` `).trim()}function u(e,t,s,{skipFirstRender:u=!1,politeness:d=`polite`,fallbackText:f,announce:p}={}){let m=n(),h=p??m,g=(0,i.useRef)(null),_=r(),[v]=(0,i.useState)(()=>_||document.readyState!==`complete`),y=(0,i.useRef)(!0);(0,i.useEffect)(()=>{let n=y.current;y.current=!1;let r=e.current;if(!t||r?.closest(o)||r?.checkVisibility?.()===!1){g.current=null;return}if(!r||u&&r.parentElement?.closest(a))return;let i=u?c(r):l(r);if(i===``&&f!==void 0&&(i=(r.getAttribute(`aria-labelledby`)??``).split(/\s+/).map(e=>{let t=r.ownerDocument.getElementById(e);return t==null?``:l(t)}).join(` `).replace(/\s+/g,` `).trim()||f),i===``)return;let p=`${s}\u0000${i}`;if(g.current===p)return;g.current=p;let m=n&&v||document.readyState!==`complete`;u&&m||h(i,d)})}export{u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{O as n}from"./Icon-Cd9sDRzY.js";import"./devWarning-DxuplmRl.js";import{n as r}from"./characters-Dp4H_dX7.js";var i=e(t(),1),a={gregory:!0,iso8601:!0,buddhist:!0,roc:!0,japanese:!0,persian:!0,indian:!0,hebrew:!0,chinese:!0,dangi:!0,coptic:!0,ethiopic:!0,ethioaa:!0,"islamic-civil":!0,"islamic-tbla":!0,"islamic-umalqura":!0};Object.keys(a);var o=new Set([`gregory`,`iso8601`,`buddhist`,`roc`,`japanese`]);function s(e){return e===`gregory`||e===`iso8601`}function c(e){return o.has(e)}function l(e){return Object.hasOwn(a,e)}function u(){let e=globalThis.Temporal;return typeof e?.PlainDate==`function`?e:void 0}var d=new WeakMap;function f(e){if(c(e))return!0;let t=u();if(t==null)return!1;let n=d.get(t);n??(n=new Map,d.set(t,n));let r=n.get(e);if(r==null){try{new t.PlainDate(2e3,1,1,e),r=!0}catch{r=!1}n.set(e,r)}return r}function p(e,t){let n=u();if(n==null)throw Error(`The "${e}" calendar needs Temporal.`);return new n.PlainDate(t.year,t.month,t.day,e)}function m(e){let t=e.withCalendar(`iso8601`);return{year:t.year,month:t.month,day:t.day}}function h(e,t){return{start:e,end:R(e,t-1),length:t}}function g(e,t){return h({year:e,month:t,day:1},I(e,t))}function _(e){return h(m(e),e.daysInMonth)}function ee(e,t){return c(e)?t.day:p(e,t).day}function te(e,t){return c(e)?g(t.year,t.month):_(p(e,t).with({day:1}))}var v={buddhist:543,roc:-1911};function ne(e,t){if(c(e))return{year:t.start.year+(v[e]??0),month:t.start.month};let{year:n,month:r}=p(e,t.start);return{year:n,month:r}}function y(e,{year:t,month:n}){return c(e)?g(t-(v[e]??0),n):_(p(e,{year:2e3,month:1,day:1}).with({year:t,month:n,day:1}))}function re(e,t,n){if(n===0)return t;if(c(e)){let{year:e,month:r}=L(t.start,n);return g(e,r)}return _(p(e,t.start).add({months:n}))}function ie(e,t,n){return c(e)?L(t,n):m(p(e,t).add({months:n}))}function ae(e,t,n){return c(e)?L(t,n*12):m(p(e,t).add({years:n}))}function oe(e,t){return G(e,[t.start,t.end])}function se(e){return R(e.start,Math.floor(e.length/2))}function ce(e,t,n,r){return Fe(r!=null&&le(e,t,n)?R(t.start,Math.min(Math.max(r,1),t.length)-1):se(t),n,b(e))}function le(e,t,n){return!s(e)&&A(e,t.start,n).era!==A(e,t.end,n).era}function b(e){return e===`iso8601`?`gregory`:e}function x(e,t,n,r){return J(t,{...n,calendar:e},r)}var S=new Set([`era`,`year`,`relatedYear`,`yearName`,`month`]);function C(e){return e.filter(e=>S.has(e.type)).map(e=>e.value).join(`|`)}function w(e,t,n,r,i){return T(ue(e,t,n,r,i))}function ue(e,t,n,r,{relatedYear:i=!1}={}){let a=fe(e,t,x(b(e),t,n,r),n,r);return i?de(e,t,a,n,r):a}function de(e,t,n,r,i){if(e!==`chinese`&&e!==`dangi`||!f(e)||n.some(e=>e.type===`relatedYear`))return n;let{numberingSystem:a}=X(i,{...r,calendar:e,timeZone:`UTC`}).resolvedOptions(),{year:o}=p(e,t),s=Q(o,i,a);return n.map(e=>/^year(Name)?$/.test(e.type)?{...e,value:s}:e)}function fe(e,t,n,r,i){if(c(e)||!f(e))return n;let a=p(e,t),o=x(e,R(t,Math.floor(a.daysInMonth/2)-(a.day-1)),r,i),s=x(e,t,{day:`numeric`},`en-u-nu-latn`).find(e=>e.type===`day`)?.value;if(Number(s)===a.day&&C(n)===C(o))return n;let{numberingSystem:l}=X(i,{...r,calendar:e,timeZone:`UTC`}).resolvedOptions(),u=new Map(o.map(e=>[e.type,e.value]));return n.map(e=>e.type===`day`?{...e,value:Q(a.day,i,l)}:S.has(e.type)?{...e,value:u.get(e.type)??e.value}:e)}function pe(e,t,n,r,i){return me(e,t,n,r,i).text}function me(e,t,n,r,i){let a=Ve(r,{...n,...i===void 0?{}:{timeZone:i},calendar:b(e)}),o=a.formatToParts(t),s=fe(e,i===void 0?F(t):U(t.getTime(),i),o,n,r),c=s===o;return{format:a,isIntl:c,text:c?a.format(t):T(s)}}function T(e){return e.map(e=>e.value).join(``)}function he(e,t){let n=u();if(n==null)throw Error(`The "${e}" calendar needs Temporal.`);try{return m(n.PlainDate.from({...t,calendar:e},{overflow:`reject`}))}catch(e){if(e instanceof RangeError||e instanceof TypeError)return null;throw e}}function E(e,t){return c(e)?12:p(e,t).monthsInYear}function ge(e,t,n){return c(e)?(n.start.year-t.start.year)*12+(n.start.month-t.start.month):p(e,t.start).until(p(e,n.start),{largestUnit:`months`}).months}function D(e,t,n){return c(e)?g(t,n):y(e,{year:t,month:n})}function O(e,t){return c(e)?12:E(e,D(e,t,1).start)}function _e(e,t,n){return w(e,R(t.start,Math.floor(t.length/2)),Le,n)}var k=new Set([`era`,`year`,`relatedYear`]);function A(e,t,n){let r=x(e,t,{era:`short`,year:`numeric`,month:`long`,day:`numeric`},n),i=r.find(e=>e.type===`era`)?.value,a=r.findIndex(e=>k.has(e.type));if(a===-1)return{era:i,label:null};let o=a;return r.forEach((e,t)=>{k.has(e.type)&&(o=t)}),{era:i,label:r.slice(a,o+1).filter(e=>k.has(e.type)||e.type===`literal`).map(e=>e.value).join(``).replace(/\s+/g,` `).trim()}}function j(e,t,n){if(s(e))return!1;let r=O(e,t),i=A(e,D(e,t,1).start,n),a=A(e,D(e,t,r).end,n);return i.era!==a.era&&i.label!=null&&a.label!=null}function ve(e,t,n,r){if(s(e))return String(t);let i=O(e,t);if(r!=null&&j(e,t,n)){let a=D(e,t,Math.min(Math.max(r.month,1),i)),o=Math.min(Math.max(r.day,1),a.length);return A(e,R(a.start,o-1),n).label??String(t)}return A(e,D(e,t,Math.floor(i/2)+1).start,n).label??String(t)}var ye=new Set([`es`,`fr`,`it`,`nl`,`pl`,`ru`,`uk`]);function M(e,t,n){if(!Number.isInteger(e)||e<1)throw RangeError(`year must be a positive integer, got ${e}`);if(!Number.isInteger(t)||t<1||t>12)throw RangeError(`month must be 1–12, got ${t}`);let r=I(e,t);if(!Number.isInteger(n)||n<1||n>r)throw RangeError(`day must be 1–${r} for ${e}-${String(t).padStart(2,`0`)}, got ${n}`);return{year:e,month:t,day:n}}function be(e){let[t,n,r]=e.split(`-`).map(Number);return M(t,n,r)}function N(e){return`${String(e.year).padStart(4,`0`)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`}function P(e){let t=new Date(0,0,1);return t.setFullYear(e.year,e.month-1,e.day),t}function F(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function xe(){return F(new Date)}function I(e,t){return t===2?e%4==0&&e%100!=0||e%400==0?29:28:[0,31,0,31,30,31,30,31,31,30,31,30,31][t]}function Se(e){return P(e).getDay()}function L(e,t){let n=e.year*12+(e.month-1)+t,r=Math.floor(n/12),i=(n%12+12)%12+1;return{year:r,month:i,day:Math.min(e.day,I(r,i))}}function R(e,t){let n=P(e);return n.setDate(n.getDate()+t),F(n)}function z(e,t,n,r=0,i=0,a=0){let o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(r,i,a),o.getTime()}function Ce(e,t){let n=z(e.year,e.month-1,e.day),r=z(t.year,t.month-1,t.day);return Math.round((r-n)/864e5)}function B(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`,calendar:`gregory`}).formatToParts(new Date(e)),r=Object.fromEntries(n.filter(e=>e.type!==`literal`).map(e=>[e.type,Number(e.value)]));return{year:r.year,month:r.month,day:r.day,hour:r.hour,minute:r.minute,second:r.second}}function we(e,t){return t?B(e.getTime(),t):{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()}}function V(e,t){let n=B(t,e);return z(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-t}var H=864e5;function Te(e,t,n=0,r=0){let i=z(e.year,e.month-1,e.day,n,r),a=V(t,i-H),o=V(t,i+H),s=[a,o].map(e=>i-e).filter((e,n)=>V(t,e)===(n===0?a:o));return s.length>0?Math.min(...s):i-a}function U(e,t){let n=B(e,t);return M(n.year,n.month,n.day)}function W(e,t){return e.year===t.year?e.month===t.month?e.day-t.day:e.month-t.month:e.year-t.year}function Ee(e,t){return W(e,t)<0}function De(e,t){return W(e,t)>0}function Oe(e,t){return W(e,t)===0}function G(e,t){return W(e,t[0])>=0&&W(e,t[1])<=0}function ke(e,{min:t,max:n,isDateDisabled:r,searchDays:i=366}){let a=e;if(t!=null&&W(a,t)<0&&(a=t),n!=null&&W(a,n)>0&&(a=n),r==null||!r(a))return a;let o=e=>(t==null||W(e,t)>=0)&&(n==null||W(e,n)<=0)&&!r(e);for(let e=1;e<=i;e+=1){let t=R(a,e);if(o(t))return t;let n=R(a,-e);if(o(n))return n}return a}function Ae(e){let t=864e5,n=z(e.year,e.month-1,e.day),r=n+(4-(new Date(n).getUTCDay()||7))*t,i=(r-z(new Date(r).getUTCFullYear(),0,1))/t+1;return Math.ceil(i/7)}var je={weekday:`long`,year:`numeric`,month:`long`,day:`numeric`},Me={weekday:`short`,month:`short`,day:`numeric`,year:`numeric`},Ne={year:`numeric`,month:`long`,day:`numeric`},Pe={year:`numeric`,month:`long`};function Fe(e,t,n=`gregory`){let i=q(e,{...Pe,calendar:n},t),a;try{a=new Intl.Locale(t).language}catch{return i}if(!ye.has(a))return i;let o=r(i);return o.toLocaleUpperCase(t)+i.slice(o.length)}function Ie(e,t=`short`){let n={weekday:t},r=X(e,{...n,calendar:`gregory`}).resolvedOptions().locale;return new Intl.Locale(r).language===new Intl.Locale(e).language?Array.from({length:7},(t,r)=>q({year:1970,month:1,day:4+r},n,e)):null}var Le={month:`long`},Re={month:`short`,day:`numeric`},K={month:`short`,day:`numeric`,year:`numeric`};function q(e,t,n=`en`){let r=t.calendar??`gregory`;if(r!==`gregory`&&l(r))return w(r,e,t,n);let[i,a]=Y(e,t,n);return i.format(a)}function J(e,t,n){let[r,i]=Y(e,t,n);return r.formatToParts(i)}function Y(e,t,n){let r=t.calendar??`gregory`;return t.timeZone==null?ze.some(e=>t[e]!=null)?[new Intl.DateTimeFormat(n,{...t,calendar:r}),P(e)]:[X(n,{...t,calendar:r,timeZone:`UTC`}),z(e.year,e.month-1,e.day)]:[X(n,{...t,calendar:r}),P(e)]}var ze=[`timeZoneName`,`hour`,`minute`,`second`,`fractionalSecondDigits`,`dayPeriod`,`timeStyle`],Be=new Map;function X(e,t){let n=JSON.stringify([e,Object.entries(t).sort(([e],[t])=>e<t?-1:+(e>t))]),r=Be.get(n);return r??(r=new Intl.DateTimeFormat(e,t),Be.set(n,r)),r}function Ve(e,t){return t.timeZone===void 0?new Intl.DateTimeFormat(e,t):X(e,t)}function He(e=`en`){try{let t=new Intl.DisplayNames(e,{type:`dateTimeField`}).of(`weekOfYear`);if(t!=null&&t!==``)return t}catch{}return`week`}var Z=new Map;function Q(e,t,n){let r=`${t}|${n??``}`,i=Z.get(r);return i??(i=new Intl.NumberFormat(t,{useGrouping:!1,numberingSystem:n}),Z.set(r,i)),i.format(e)}var Ue={date:K,date_long:Ne,date_weekday:Me};function We(e,t,n=`en`,r=`gregory`){return t===`system_date`?N(e):q(e,{...Ue[t],calendar:r},n)}function Ge(e,t){return l(e)?e:(`${e}`,`${e}`,`gregory`)}function Ke(e,t){return f(e)?e:(`${e}`,`${e}`,`gregory`)}function $(e,t){return Ke(Ge(e,t),t)}function qe(e,t){let r=(0,i.use)(n);return $(e??r.calendar??`gregory`,t)}export{s as $,xe as A,O as B,De as C,P as D,G as E,ee as F,j as G,ie as H,y as I,ce as J,w as K,te as L,Ie as M,re as N,N as O,he as P,c as Q,D as R,Ae as S,Oe as T,ae as U,E as V,ne as W,ve as X,_e as Y,f as Z,Q as _,K as a,be as b,We as c,ke as d,oe as et,R as f,q as g,Ce as h,Re as i,He as j,Te as k,I as l,Se as m,$ as n,je as o,M as p,pe as q,qe as r,Ue as s,Ge as t,we as u,J as v,Ee as w,U as x,F as y,ge as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{r as n,t as r}from"./coarsePointer-B10KWVuz.js";import{b as i,c as a,k as o,n as s,x as c,y as l}from"./scrollView-DKN9Tc2s.js";var u=e(t(),1),ee={duration:`200ms`,easing:`cubic-bezier(0.42, 0, 0.58, 1)`},d=new WeakSet;function te(e){if(e==null)return;d.add(e);let t=e.parentElement;t?.hasAttribute(`popover`)&&d.add(t)}function ne(e){return d.has(e)}function f(e){return e.replace(/[\x00-\x1f\x7f]/g,``).trim()}function re(e){return e.toLowerCase().replace(/^([a-z][a-z\d+.-]*:) +/,`$1`)}function p(e){let t=f(e),n=re(t);return n.startsWith(`javascript:`)||n.startsWith(`vbscript:`)||n.startsWith(`data:text/html`)?null:t}function m(e){return p(e)!==null}function ie(e){if(e==null)return!0;if(typeof e==`string`)return m(e);if(typeof e!=`object`)return!1;let{pathname:t,href:n,protocol:r,host:i,hostname:a}=e;for(let e of[t,n,r,i,a])if(e!=null&&typeof e!=`string`)return!1;if(typeof t==`string`&&!m(t)||typeof n==`string`&&!m(n))return!1;if(typeof r==`string`&&r!==``){let e=f(r),n=e.endsWith(`:`)?e:`${e}:`;if(!m(n)||!m(`${n}${i||a||``}${typeof t==`string`?t:``}`))return!1}return!0}var ae=`data-astryx-menu-press`,oe=`data-astryx-press-holds-drag`;function se(e){return e?{[oe]:``}:{}}function ce(e){return e.hasAttribute(oe)}var h=`data-astryx-press-group-item`;function le(e){return{[h]:e.join(` `)}}function g(e,t=null){let n=e.closest(`[${h}]`);return n==null?!1:t==null||(n.getAttribute(h)??``).split(` `).includes(t)}var _=`data-astryx-pressable`,v=`data-astryx-press`,ue={[_]:``},de=`:disabled, [aria-disabled="true"]`,fe=new Set([`button`,`image`,`reset`,`submit`]),pe=`[${ae}]`,y={live:null},b=null;function x(e){let t=b;b=null,t?.end(e)}var S=null;function me(e){S=e}var C={live:null},w=0,T=0,E=null,D=0,O=null,he={fade:l,flash:100,onset:150};function k(e){let t=a(`duration`,getComputedStyle(e).getPropertyValue(`--duration-exit`))??l,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,r=a(`duration`,ee.duration);return n&&r!=null?Math.min(t,r):t}function ge(e){return typeof e.getAnimations==`function`?e.getAnimations({subtree:!0}).filter(t=>{let n=t.effect,r=n?.target??null;return n==null||r==null||!(`animationName`in t)||r!==e&&r.closest(`[data-astryx-pressable]`)!==e||!Number.isFinite(Number(n.getComputedTiming().endTime))?!1:t.playState!==`finished`}):[]}function _e(e,t,n){let r=!0,i=setTimeout(()=>{let t=ge(e);t.length===0?n():Promise.allSettled(t.map(async e=>e.finished)).then(()=>{r&&n()})},t);return()=>{r=!1,clearTimeout(i)}}var ve={fade:`fadeEnd`,flash:`flashEnd`,onset:`onset`};function ye(e,t){t===`none`?e.removeAttribute(v):e.getAttribute(`data-astryx-press`)!==t&&e.setAttribute(v,t)}function A(e){e.live?.timer!=null&&(e.live.timer(),e.live.timer=null)}function j(e,t){let n=e.live;if(n==null)return;let r=t.gesture.phase!==n.gesture.phase;if((t.timer!=null||r)&&A(e),n.gesture=t.gesture,ye(n.element,t.paint),t.gesture.phase===`idle`)e.live=null;else if(t.timer!=null){let r=t.timer,a=()=>{e.live!=null&&(e.live.timer=null),j(e,c(e.live?.gesture??i(),{kind:ve[r]}))};if(r===`fade`)n.timer=_e(n.element,k(n.element),a);else{let e=setTimeout(a,he[r]);n.timer=()=>clearTimeout(e)}}}function M(e){if(!(e instanceof Element))return null;let t=e.closest(`[${_}]`);return!(t instanceof HTMLElement)||t.matches(de)?null:t}function be(e){return Date.now()-T>=150?!1:E instanceof Node&&E.contains(e)}function N(e){e.live?.gesture.phase===`dead`&&(A(e),e.live=null)}function P(e){let t=e.live;t!=null&&(A(e),t.element.removeAttribute(v),e.live=null,e===C&&J(!1))}function xe(e){y.live?.element===e&&P(y),C.live?.element===e&&P(C)}function F(e,t){e.live?.element===t&&P(e)}function I(){return typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches}function Se(e,t){let n=M(e);return n==null||n.closest(pe)!=null||t!=null&&g(n,`mouse`)||t==null&&n!==e?null:n}function L(e,t){P(C);let n=Se(e,t);n!=null&&(F(y,n),C.live={element:n,gesture:i(),pointerId:t,timer:null},J(t==null),j(C,c(C.live.gesture,{kind:`buttonDown`})))}function R(){J(!1),C.live!=null&&j(C,c(C.live.gesture,{kind:`up`}))}function z(){J(!1),C.live!=null&&(j(C,c(C.live.gesture,{kind:`cancel`})),N(C))}function Ce(e){if(e.pointerType===`mouse`){e.button===0&&I()&&L(e.target,e.pointerId);return}if(je(),x(!1),y.live!=null){if(y.live.gesture.phase!==`fading`&&y.live.gesture.phase!==`flash`){P(y);return}P(y)}let t=M(e.target),n=t!=null&&be(t);if(D=Date.now(),O=e.target instanceof Node?e.target:null,t==null||g(t,e.pointerType))return;let r=S?.start(t,e.target)??null,a=n?null:{element:t,gesture:i(),pointerId:e.pointerId,timer:null};r!=null&&(b={pointerId:e.pointerId,live:a,end:r}),a!=null&&(F(C,t),y.live=a,j(y,c(a.gesture,{kind:`down`,x:e.clientX,y:e.clientY,delayed:s(t)})))}function we(e){let t=y.live;t==null||t.pointerId!=null&&e.pointerId!==t.pointerId||ce(t.element)||j(y,c(t.gesture,{kind:`move`,x:e.clientX,y:e.clientY}))}function Te(e){if(e.pointerType===`mouse`){C.live!=null&&C.live.pointerId===e.pointerId&&R();return}if(D=Date.now(),e.target instanceof Node&&(O=e.target),b?.pointerId===e.pointerId){let e=b.live;x(e!=null&&y.live===e&&e.gesture.phase!==`dead`)}let t=y.live;t==null||t.pointerId!=null&&e.pointerId!==t.pointerId||(j(y,c(t.gesture,{kind:`up`})),N(y))}function B(e){let t=e;if(t?.pointerType===`mouse`){C.live!=null&&C.live.pointerId===t.pointerId&&z();return}t?.pointerId!=null&&b?.pointerId===t.pointerId&&x(!1);let n=y.live;n!=null&&(j(y,c(n.gesture,{kind:`cancel`})),N(y))}function Ee(){B(),z()}function De(e){let t=e.target instanceof Node?e.target:document;Date.now()-D<3e3&&O!=null&&t.contains(O)&&(T=Date.now(),E=t);let n=y.live;n!=null&&(t===document||t.contains(n.element))&&B()}function Oe(e){return e instanceof HTMLButtonElement||e instanceof HTMLInputElement&&fe.has(e.type)}function ke(e){return e instanceof Element&&g(e)}function V(e){e.key!==` `||e.repeat||e.isComposing||e.defaultPrevented||!Oe(e.target)||!(I()||ke(e.target))||L(e.target,null)}function H(e){e.key===` `&&C.live!=null&&C.live.pointerId==null&&R()}function U(){C.live!=null&&C.live.pointerId==null&&R()}function Ae(){document.visibilityState===`hidden`&&(x(!1),P(y),P(C))}var W=[],G=null,K=null;function q(e){e!==(G!=null)&&(e?G=o(window,`touchcancel`,B):(G?.(),G=null))}function je(){K??(K=n(window,q),q(r(window)))}function Me(){W=[o(window,`pointerdown`,Ce),o(window,`pointermove`,we),o(window,`pointerup`,Te),o(window,`pointercancel`,B),o(window,`dragstart`,Ee),o(window,`scroll`,De),o(window,`visibilitychange`,Ae)],window.addEventListener(`keydown`,V,Fe)}function Ne(){x(!1),S?.endWaits();for(let e of W.splice(0))e();K?.(),K=null,q(!1),window.removeEventListener(`keydown`,V),J(!1)}var Pe={capture:!0,passive:!0},Fe={passive:!0},Ie=!1;function J(e){e!==Ie&&(Ie=e,e?(window.addEventListener(`keyup`,H,Fe),window.addEventListener(`blur`,U,Pe)):(window.removeEventListener(`keyup`,H),window.removeEventListener(`blur`,U,Pe)))}function Le(){if(typeof window>`u`)return()=>void 0;w===0&&Me(),w+=1;let e=!1;return()=>{e||(e=!0,--w,!(w>0)&&(Ne(),P(y),P(C),T=0,E=null,D=0,O=null))}}var Y=`data-pressable-container`,X=[`button`,`a`,`input`,`select`,`textarea`,`[role="button"]`,`[role="link"]`,`[role="checkbox"]`,`[role="radio"]`,`[role="switch"]`,`[role="tab"]`,`[role="menuitem"]`,`[role="option"]`,`[role="combobox"]`,`[role="listbox"]`,`[role="slider"]`,`[role="spinbutton"]`,`[${Y}]`].join(`,`),Re=`[aria-readonly="true"]`;function Z(e){return e.matches(X)&&!e.matches(Re)}function ze(e,t,n=Z){let r=e;for(;r!=null&&r!==t&&r!==document.body;){if(n(r))return r;r=r.parentElement}return null}function Q(e,t){return ze(e,t,Be)!=null}function Be(e){return Z(e)||ne(e)}function Ve(e,t,n){let r=e.target;e.pointerType===`touch`&&t!=null&&r instanceof Element&&r!==e.currentTarget&&Q(r,t)&&n?.contains(r)!==!0&&xe(t)}function He(e){if(typeof document>`u`||!(`getSelection`in document))return!1;let t=document.getSelection();return t==null||t.isCollapsed?!1:e.contains(t.anchorNode)}function Ue(e){let{containerRef:t}=e;return(0,u.useEffect)(()=>{let e=t.current;e&&e.setAttribute(Y,`true`)},[t]),$(e)}function $({containerRef:e,interactiveRef:t,onClick:n,href:r,target:i,disabled:a=!1}){return{onClick:(0,u.useCallback)(o=>{if(a)return;let s=e.current;if(!s||He(s))return;let c=o.target;if(c instanceof Element&&!(c!==o.currentTarget&&Q(c,s))&&(n?.(o),!o.defaultPrevented&&(r!=null&&m(r)&&(i===`_blank`||o.ctrlKey||o.metaKey?window.open(r,`_blank`,`noopener`):t?.current?t.current.click():window.location.href=r),r==null&&n==null&&t?.current))){let e=new MouseEvent(`click`,{bubbles:o.bubbles,cancelable:o.cancelable,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey,altKey:o.altKey,button:o.button});t.current.dispatchEvent(e),o.stopPropagation()}},[e,t,n,r,i,a]),onMouseUp:(0,u.useCallback)(t=>{if(a)return;let n=e.current;if(!n)return;let i=t.target;i instanceof Element&&t.button===1&&r!=null&&m(r)&&(i===t.currentTarget||!Q(i,n))&&window.open(r,`_blank`,`noopener`)},[e,r,a]),onPointerDown:(0,u.useCallback)(n=>{a||Ve(n,e.current,t?.current??null)},[e,t,a])}}export{ee as S,ae as _,ze as a,p as b,$ as c,me as d,Le as f,se as g,le as h,Q as i,_ as l,ue as m,Y as n,Z as o,k as p,Ve as r,Ue as s,X as t,v as u,ie as v,te as x,m as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{h as n}from"./useIsHydrating-DmtPcCGm.js";var r=e(t(),1),i=2e3;function a(e={}){let{copy:t,isCopied:n}=o(e);return{copy:t,isCopied:n}}function o(e={}){let{announce:t,announceFailure:a,resetAfterMs:o=i,onError:s}=e,c=n(),[l,u]=(0,r.useState)(!1),[d,f]=(0,r.useState)(!1),p=(0,r.useRef)(null),m=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{p.current!=null&&clearTimeout(p.current),m.current!=null&&clearTimeout(m.current)},[]),{copy:(0,r.useCallback)(async e=>{try{await navigator.clipboard.writeText(e)}catch(e){return f(!0),m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{m.current=null,f(!1)},o),a&&c(a),s?.(e),!1}return m.current!=null&&(clearTimeout(m.current),m.current=null),f(!1),u(!0),t&&c(t),p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null,u(!1)},o),!0},[c,t,a,o,s]),isCopied:l,isFailed:d}}export{o as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import"./devWarning-DxuplmRl.js";var n=e(t(),1);function r(e,t,r=!0){let i=(0,n.useRef)(!1);(0,n.useEffect)(()=>{r&&!i.current&&(i.current=!0)},[e,t,r])}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,l as n,r}from"./themeProps-Bo2jNkIC.js";import{n as i,t as a}from"./LayoutContent-BWpUj2Iy.js";import{t as o}from"./Stack-3jR93LgR.js";import{t as s}from"./Text-Cq4yqBpQ.js";import{t as c}from"./Button-Bwkht0RI.js";import{n as l}from"./CheckboxIndicator-BvfHW9OX.js";import{t as u}from"./Dialog-tyH-Jv5A.js";import{I as d}from"./index-Cfhzi3KD.js";var f=e(t(),1),p=n(),m={action:{kzqmXN:`xh8yej3`,$$css:!0}};function h({isOpen:e,onOpenChange:t,title:n,description:h,cancelLabel:g,actionLabel:_,onAction:v}){let y=(0,f.useId)(),b=(0,f.useId)();return(0,p.jsx)(u,{...r(`alert-dialog`),isOpen:e,onOpenChange:t,purpose:`info`,role:`alertdialog`,"aria-labelledby":y,"aria-describedby":b,width:400,children:(0,p.jsx)(i,{content:(0,p.jsxs)(a,{children:[(0,p.jsx)(l,{level:2,id:y,children:n}),(0,p.jsx)(s,{type:`body`,color:`secondary`,id:b,children:h})]}),footer:(0,p.jsx)(d,{children:(0,p.jsxs)(o,{direction:`vertical`,gap:4,hAlign:`stretch`,children:[(0,p.jsx)(c,{label:_,variant:`destructive`,size:`lg`,onClick:v,xstyle:m.action}),(0,p.jsx)(c,{label:g,variant:`secondary`,size:`lg`,onClick:()=>t(!1),"data-autofocus":!0,xstyle:m.action})]})})})})}var g=8;function _(e,t){let n=(0,f.useRef)(null),r=()=>{n.current=null};return{onTouchStart:e=>{n.current=e.touches.length===1?e.touches[0].clientY:null},onTouchMove:i=>{if(i.touches.length!==1){r();return}let a=n.current;if(a==null||Math.abs(i.touches[0].clientY-a)<g)return;r();let o=e().find(e=>e!=null&&e===document.activeElement);if(o==null)return;let s=t?.();s==null?o.blur():s.focus({preventScroll:!0})},onTouchEnd:r,onTouchCancel:r}}export{h as n,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";var n=e(t(),1),r=class extends n.Component{getSnapshotBeforeUpdate(e){return Object.is(e.value,this.props.value)||this.props.onBeforeChange(e.value),null}componentDidUpdate(){}render(){return null}};function i(e,t,r){let i=(0,n.useRef)(t),a=(0,n.useRef)(r),o=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{i.current=t,a.current=r}),(0,n.useLayoutEffect)(()=>{let t=o.current;o.current=null,t!=null&&a.current(t,e)},[e]),(0,n.useCallback)(e=>{o.current=i.current(e)},[])}export{r as n,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{t as n}from"./useLayerDismissal-DwwLDEpO.js";import{t as r}from"./focusableSelector-kxmVieoO.js";import{n as i}from"./focusReturn-DNKESCUc.js";import{w as a}from"./scrollView-DKN9Tc2s.js";var o={0:{kZCmMZ:`x18gyask`,kwRFfy:`x1s0aq8i`,kLKAdn:`x1ydh6w3`,kGO01o:`x1l20ajd`,$$css:!0},1:{kZCmMZ:`x1vsv5vr`,kwRFfy:`x1nryj5t`,kLKAdn:`xfsso4q`,kGO01o:`xy143xn`,$$css:!0},2:{kZCmMZ:`x12gdq22`,kwRFfy:`x1djylfy`,kLKAdn:`x1xye8es`,kGO01o:`x1wesfrj`,$$css:!0},3:{kZCmMZ:`x126nfab`,kwRFfy:`x1t818jl`,kLKAdn:`x1vlblms`,kGO01o:`xvmdzux`,$$css:!0},4:{kZCmMZ:`x1rey3nv`,kwRFfy:`xnjyzlh`,kLKAdn:`x1oa1p4a`,kGO01o:`x1awphl8`,$$css:!0},5:{kZCmMZ:`x1blguxw`,kwRFfy:`xdbrk9v`,kLKAdn:`xx7rijo`,kGO01o:`x1hk98q`,$$css:!0},6:{kZCmMZ:`x31w388`,kwRFfy:`x1we12cn`,kLKAdn:`x1adxfkp`,kGO01o:`xjpqqx5`,$$css:!0},8:{kZCmMZ:`x1j3hnjz`,kwRFfy:`x1q91b2g`,kLKAdn:`xoxd1wu`,kGO01o:`x2oz4g1`,$$css:!0},10:{kZCmMZ:`xqp078j`,kwRFfy:`x160ivqr`,kLKAdn:`xk6660b`,kGO01o:`x2izi54`,$$css:!0},"0.5":{kZCmMZ:`x138rykx`,kwRFfy:`x1le3yxw`,kLKAdn:`xbx876j`,kGO01o:`xij103a`,$$css:!0},"1.5":{kZCmMZ:`xfti1ec`,kwRFfy:`x17hk9do`,kLKAdn:`x1kwdpsa`,kGO01o:`x1opdxmq`,$$css:!0}},s=e(t(),1),c=0;function l(e){(0,s.useEffect)(()=>{if(e)return c+=1,()=>{--c}},[e])}function u(e){try{return e.matches(`:popover-open`)}catch{return!1}}function d(e){if(e.hasAttribute(`inert`)||e.closest(`[inert]`)||e.hidden||e.closest(`[hidden]`))return!1;for(let t=e.closest(`dialog`);t!=null;t=t.parentElement?.closest(`dialog`)??null)if(!t.open&&!u(t))return!1;if(e.closest(`[aria-hidden="true"]`))return!1;if(typeof window<`u`&&window.getComputedStyle){let t=window.getComputedStyle(e);if(t.visibility===`hidden`||t.display===`none`)return!1}return!0}function f(e){return Array.from(e.querySelectorAll(r)).filter(d)}function p(e){return e?.ownerDocument??document}function m(e,t){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)!==0}function h(e){try{e.focus()}catch{}return e.ownerDocument.activeElement===e}function g(e,t){h(t)&&e.preventDefault()}function _(e){let t=f(e);for(let e of t)if(h(e))return!0;return!1}function v(e){let t=f(e);for(let e=t.length-1;e>=0;e--)if(h(t[e]))return!0;return!1}var y=new Set;function b(e,t){let n=t.closest(`dialog[open]`);if(n!=null&&n!==e&&e.contains(n))return!0;for(let n of y)if(n!==e&&e.contains(n)&&n.contains(t))return!0;return!1}function x(e,t){let n=(0,s.useRef)(null),r=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let n=e.current;if(t&&n!=null)return y.add(n),()=>{y.delete(n)}},[e,t]),(0,s.useEffect)(()=>{if(!t)return;let i=p(e.current),o=t=>{let o=e.current;if(!o)return;let s=t.target;if(o.contains(s))n.current=s;else if(r.current){let e=_(o);e&&n.current===i.activeElement?v(o):!e&&a(n.current)&&o.contains(n.current)&&h(n.current),n.current=i.activeElement}r.current=!1};return i.addEventListener(`focus`,o,!0),()=>{i.removeEventListener(`focus`,o,!0)}},[e,t]),(0,s.useEffect)(()=>{if(!t)return;let i=p(e.current),a=t=>{let a=e.current;if(a&&t.key===`Tab`){if(t.defaultPrevented)return;let e=i.activeElement;if(e==null||!a.contains(e)||b(a,e))return;r.current=!0;let o=f(a);if(o.length===0){t.preventDefault(),n.current=e,r.current=!1;return}let s=o[0],c=o[o.length-1];if(i.activeElement===a){g(t,t.shiftKey?c:s);return}let l=!o.includes(e);t.shiftKey?(e===s||l&&m(e,s))&&g(t,c):(e===c||l&&m(c,e))&&g(t,s)}};return i.addEventListener(`keydown`,a),()=>{i.removeEventListener(`keydown`,a)}},[e,t])}function S(e){let{isActive:t,onEscape:r,getRestoreTarget:a}=e,o=(0,s.useRef)(a);o.current=a;let c=(0,s.useRef)(null);x(c,t);let u=t&&r!=null;n({isActive:u,onDismiss:()=>{r?.()},getContainer:()=>c.current}),l(u);let d=(0,s.useCallback)(()=>{c.current&&_(c.current)},[]);return(0,s.useEffect)(()=>{if(!t)return;let e=c.current,n=p(e),r=o.current?.()??n.activeElement,a=e!=null&&e.contains(n.activeElement),s=e=>{let t=e.target;t!=null&&c.current?.contains(t)&&(a=!0)};return n.addEventListener(`focusin`,s,!0),()=>{n.removeEventListener(`focusin`,s,!0),a&&i(e,n)&&r!=null&&r.isConnected&&typeof r.focus==`function`&&r.focus()}},[t]),{containerRef:c,focusFirst:d}}export{o as i,x as n,S as r,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,d as n,l as r,r as i,u as a}from"./themeProps-Bo2jNkIC.js";import{r as o,s,t as c}from"./coarsePointer-B10KWVuz.js";import{t as l}from"./mergeProps-ptS-gIMz.js";import{i as u,r as d}from"./useFocusTrap-DyznXJtp.js";import{C as f,D as p,O as m,R as h,T as g,d as _,k as v,n as ee,w as te,x as ne}from"./useLayerDismissal-DwwLDEpO.js";import{A as y,D as re}from"./Icon-Cd9sDRzY.js";import{t as b}from"./focusableSelector-kxmVieoO.js";import{c as ie}from"./focusReturn-DNKESCUc.js";import{t as ae}from"./rtlStyles-CVVETNV7.js";import{r as oe}from"./focusOutline.stylex-DXNeAcgS.js";import{f as se}from"./useTooltip-DQ4LKI-B.js";import{C as x,T as S,c as C,g as w,k as T,r as E,s as D,v as O,w as k}from"./scrollView-DKN9Tc2s.js";import{n as ce}from"./tokenReferences-tYcl-8O-.js";import{t as le}from"./Button-Bwkht0RI.js";import{i as ue}from"./chainEventHandlers-BSZ5MWAl.js";import{A,C as de,b as j,j as M,k as fe,u as N,w as pe,x as P}from"./scroll-74w_rjcI.js";import{t as me}from"./isRtlElement-BG33-k_H.js";import{t as he}from"./useDevWarning-WeXt8Pe8.js";function ge(e,t){return e==null?`fallback:${typeof t==`function`?t():t}`:`id:${e}`}var _e={"--duration-fast-min":`130ms`,"--duration-fast":`175ms`,"--duration-fast-max":`230ms`,"--duration-medium-min":`310ms`,"--duration-medium":`410ms`,"--duration-medium-max":`550ms`,"--duration-slow-min":`730ms`,"--duration-slow":`975ms`,"--duration-slow-max":`1300ms`,"--duration-exit":`var(--duration-fast)`,"--ease-standard":`cubic-bezier(0.24, 1, 0.4, 1)`,"--ease-entrance":`cubic-bezier(0.24, 1, 0.4, 1)`,"--ease-move":`cubic-bezier(0.24, 1, 0.4, 1)`,"--ease-exit":`cubic-bezier(0.3, 0, 0.6, 0.6)`};function ve(e,t,{jumps:n=!1}={}){let r=n=>e<=0||n>=e?1:t(Math.max(0,n)/e),i=Math.min(.001,e/100);return{duration:e,at:r,velocity:t=>{if(e<=0||t>=e)return 0;let a=Math.max(0,t-i),o=Math.min(e,t+i);if(!n)return(r(o)-r(a))/(o-a);let s=r(t),c=[];return t>a&&c.push((s-r(a))/(t-a)),o>t&&c.push((r(o)-s)/(o-t)),c.reduce((e,t)=>Math.abs(t)<Math.abs(e)?t:e)}}}function ye(e){return C(`duration`,e.transitionDuration.split(`,`)[0]??``)}function be(e){return e.transitionTimingFunction.split(/,(?![^(]*\))/)[0]??``}function xe(e){return D(be(e))}function Se(e,t){let n=e.defaultView;if(typeof n?.Animation!=`function`||typeof n.KeyframeEffect!=`function`)return null;let r;try{r=new n.Animation(new n.KeyframeEffect(null,null,{duration:1e3,easing:t,fill:`both`}),null)}catch{return null}return e=>(r.currentTime=Math.min(1,Math.max(0,e))*1e3,r.effect?.getComputedTiming().progress??1)}function Ce(e,{ms:t,points:n},r){if(t==null||t<=0)return null;if(n!=null)return ve(t/1e3,_(n));let i=Se(e,r);return i==null?null:ve(t/1e3,i,{jumps:!0})}function we(e,{duration:t,easing:n}){let r=t==null?null:C(`duration`,t),i=n==null?null:D(n),a=e.ownerDocument,o=a.defaultView,s=t!=null&&r==null,c=n!=null&&i==null;if(o==null||!s&&!c)return{ms:r,points:i};let l=a.createElement(`span`);l.style.setProperty(`display`,`none`,`important`);let u=(e,t)=>(l.style.setProperty(e,t,`important`),l.style.getPropertyValue(e)!==``),d=s&&u(`transition-duration`,t),f=c&&u(`transition-timing-function`,n);(a.body??a.documentElement).append(l);try{let e=o.getComputedStyle(l);return{ms:d?ye(e):r,points:f?xe(e):i}}finally{l.remove()}}function Te(e,t){let n=e.getPropertyValue(t).trim();if(n!==``)return n;let r={};for(let[t,n]of Object.entries(_e))r[t]=e.getPropertyValue(t).trim()||n;return ce(r)[t]??``}function Ee(e,t){let n=e.ownerDocument.defaultView?.getComputedStyle(e);return n==null?null:Te(n,t)}function De(e,t){let n=e.ownerDocument,r=n.defaultView?.getComputedStyle(e);if(r==null)return null;if(t!=null){let i=Te(r,t.easing);return Ce(n,we(e,{duration:Te(r,t.duration),easing:i}),i)}let i=be(r);return Ce(n,{ms:ye(r),points:D(i)},i)}var F=e(n(),1),Oe={"@astryx.popover.close":`Close popover`},I=r();y(Oe);var ke=`[data-astryx-popover-fallback-close]`;function Ae(e){try{e.focus()}catch{}return e.ownerDocument.activeElement===e}function je(e){let t=Array.from(e.querySelectorAll(b)).filter(e=>e.closest(ke)==null);for(let e of t)if(Ae(e))return!0;return!1}var L={surface:{kWkggS:`x1prclbq`,"--_popover-radius":`xiki222`,kaIpWk:`x11m9jtl`,kGVxlE:`x1i5ehqx`,$$css:!0},contentWrapper:{kVAEAm:`x1n2onr6`,$$css:!0},closeButtonWrapper:{kVAEAm:`x10l6tqk`,krVfgx:`x1ey2m1c`,kY2c9j:`x1vjfegm`,kzqmXN:`x1i1rx1s x10okhzq`,kZKoxP:`xjm9jq1 x132qfvm`,kVQacm:`xb3r6kr x1dordxg`,kz4h6p:`x1hyvwdk x10wafsz`,kfzvcC:`x47corl xbt4iw`,kLKAdn:`xexx8yu x1kw28su`,$$css:!0}};function Me(e={}){let{onShow:n,onHide:r,onCloseStart:o,xstyle:s,className:c,style:f,hasLightDismiss:p=!0,hasEscapeDismiss:m=!0,hasAutoFocus:h=!0,hasSurface:g=!0,padding:_,surfaceTarget:v,hasCloseButton:te=!0,closeButtonLabel:ne,dialogLabel:y,role:b=`dialog`,isModal:x=!0}=e,S=re(),C=ne??S(`@astryx.popover.close`),w=(0,F.useRef)(null),T=(0,F.useRef)(!1),E=(0,F.useRef)(!1),D=(0,F.useRef)(!1),O=(0,F.useCallback)(()=>{D.current=!0,n?.()},[n]),k=se({mode:`context`,lightDismiss:p,onShow:O,onHide:r,onCloseStart:o}),ce=(0,F.useRef)(null),ue=(0,F.useCallback)(()=>ce.current,[]),{containerRef:A,focusFirst:de}=d({isActive:k.isOpen,onEscape:m||p?k.hide:void 0,getRestoreTarget:ue}),j=(0,F.useCallback)(()=>{let e=A.current;if(!e)return;let t=e.ownerDocument.activeElement;t!=null&&t!==e&&e.contains(t)||je(e)||(b===`dialog`?Ae(e):de())},[A,de,b]);(0,F.useEffect)(()=>{if(!k.isOpen)T.current=!1,E.current=!1;else if(h&&!T.current){let e=requestAnimationFrame(()=>{let e=A.current?.ownerDocument??document;(!E.current||ie(e))&&j()});return()=>cancelAnimationFrame(e)}},[k.isOpen,h,j,A]);let M=k.ref,fe=(0,F.useCallback)(e=>{w.current=e,M(e)},[M]),N=(0,F.useCallback)(e=>{T.current=e?.skipAutoFocus??!1,D.current=!1;let t=(w.current?.ownerDocument??document).activeElement;ce.current=t!=null&&!A.current?.contains(t)?t:null,k.show();let n=A.current;D.current&&h&&!T.current&&n!=null&&!n.contains(n.ownerDocument.activeElement)&&je(n)&&(E.current=!0)},[k,h,A]),pe=(0,F.useCallback)(()=>{k.isOpen?k.hide():N()},[k,N]),P={"aria-haspopup":b===`dialog`?`dialog`:`true`,"aria-expanded":k.isOpen,"aria-controls":k.id};he(`usePopover`,'role="dialog" without a `dialogLabel` renders an unnamed dialog. Pass `dialogLabel`, or use `role: "none"` for listbox/menu popups whose content already carries its own role.',b===`dialog`&&!y);let me=(0,F.useCallback)((e,n)=>{let r=i(`popover`),o=v!=null&&v!==`popover`?`${r.className} ${t(v)}`:r.className;return k.render((0,I.jsx)(ee,{children:(0,I.jsxs)(`div`,{ref:A,role:b===`dialog`?`dialog`:void 0,"aria-modal":b===`dialog`&&x?!0:void 0,"aria-label":b===`dialog`?y:void 0,tabIndex:b===`dialog`?-1:void 0,...l({...r,className:o},oe.focusVisible(L.contentWrapper,g&&L.surface,_!=null&&u[_],s),c,f),children:[e,te&&(0,I.jsx)(`div`,{"data-astryx-popover-fallback-close":``,...a(L.closeButtonWrapper,ae.centerInline(`100%`)),children:(0,I.jsx)(le,{variant:`secondary`,label:C,onClick:k.hide})})]})}),{...n,xstyle:n?.xstyle})},[k,te,g,_,v,c,f,C,A,y,b,x,s]);return{triggerRef:fe,contentRef:A,anchorId:k.anchorId,show:N,hide:k.hide,toggle:pe,isOpen:k.isOpen,id:k.id,render:me,triggerProps:P}}function Ne(e={}){return Me(e)}function Pe(e={}){return Me(e)}function Fe({isOpen:e,highlightedIndex:t,setHighlightedIndex:n,getOptionId:r,itemCount:i}){let a=(0,F.useRef)(null),o=(0,F.useRef)(t),s=(0,F.useRef)(null),c=(0,F.useRef)(null),l=(0,F.useRef)(n),u=(0,F.useRef)(null),d=(0,F.useCallback)(e=>{a.current=e.index,l.current(e.index),e.onHighlight?.()},[]),f=(0,F.useCallback)(()=>{c.current?.(),c.current=null},[]),p=(0,F.useCallback)(()=>{f();let e=s.current;s.current=null,e!=null&&d(e)},[d,f]),m=(0,F.useCallback)(()=>{if(s.current=null,c.current!=null)return;let e=e=>{let t=u.current;u.current={x:e.screenX,y:e.screenY},(t==null||t.x!==e.screenX||t.y!==e.screenY)&&p()},t={capture:!0,passive:!0};document.addEventListener(`pointermove`,e,t),document.addEventListener(`pointerdown`,p,t),c.current=()=>{document.removeEventListener(`pointermove`,e,t),document.removeEventListener(`pointerdown`,p,t)}},[p]),h=(0,F.useCallback)((e,t)=>{c.current==null?(a.current=e,n(e),t?.()):s.current={index:e,onHighlight:t}},[n]);return(0,F.useEffect)(()=>{l.current=n},[n]),(0,F.useEffect)(()=>f,[f]),(0,F.useEffect)(()=>{let n=o.current!==t;o.current=t;let i=n&&a.current===t;if(a.current=null,i)return;let c=e&&t>=0?document.getElementById(r(t)):null;c==null?(s.current=null,f()):(m(),c.scrollIntoView?.({block:`nearest`}))},[e,t,r,i,f,m]),h}function Ie(){if(typeof navigator>`u`)return!1;let e=`userAgentData`in navigator?navigator.userAgentData:null;if(e&&typeof e==`object`&&`platform`in e){let t=e.platform,n=typeof t==`string`?t.trim():``;if(n!==``&&n.toLowerCase()!==`unknown`)return/mac/i.test(n)}return/Mac|iPhone|iPad|iPod/.test(navigator.platform??``)}var Le={allowableMovement:{value:45,unit:`px`},maximumIntervalBetweenTaps:{value:350,unit:`ms`},allowableSeparation:{value:45,unit:`px`},maximumTapDuration:{value:1500,unit:`ms`}},Re={minimumPressDuration:{value:500,unit:`ms`},allowableMovement:{value:10,unit:`px`}},ze={hysteresis:{value:10,unit:`px`}},Be={minimumDistance:{value:50,unit:`px`},maximumDuration:{value:500,unit:`ms`},maximumSecondaryMovement:{value:50,unit:`px`},minimumMovementDecay:{value:.06,unit:`ratio`}},Ve={hysteresis:{value:8,unit:`px`}},He={hysteresis:{value:.08726646259971647,unit:`rad`}},Ue={edgeRegion:{value:40.2,unit:`px`},hysteresis:{value:15,unit:`px`}},We={trackingExpansion:{value:70,unit:`px`}},R={contentTouchDelay:{value:150,unit:`ms`},quickTapFlash:{value:100,unit:`ms`},slop:{value:10,unit:`px`},scrollBrake:{value:150,unit:`ms`},momentumMemory:{value:3e3,unit:`ms`}},Ge={handoff:{value:10,unit:`px`}},z={currentWeight:{value:.2,unit:`ratio`},scrollReleaseWeight:{value:.25,unit:`ratio`},stillness:{value:40,unit:`ms`}},Ke={tap:Le,longPress:Re,pan:ze,swipe:Be,pinch:Ve,rotation:He,screenEdgePan:Ue,control:We,press:R,menuPress:Ge,velocity:z},qe={selection:{value:[5],unit:`ms`},impactLight:{value:[8],unit:`ms`},impactMedium:{value:[12],unit:`ms`},impactHeavy:{value:[18],unit:`ms`},impactSoft:{value:[10],unit:`ms`},impactRigid:{value:[6],unit:`ms`},notificationSuccess:{value:[8,60,12],unit:`ms`},notificationWarning:{value:[12,80,12],unit:`ms`},notificationError:{value:[12,50,12,50,18],unit:`ms`}};function B(e,t){let n=0,r=0,i=0;for(let a of e)t?.has(a.id)||(n+=a.x,r+=a.y,i+=1);return i===0?{x:0,y:0}:{x:n/i,y:r/i}}function Je(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ye(e){return Math.hypot(e.x-e.startX,e.y-e.startY)}var Xe={viewportSize(){return typeof window>`u`?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight}},isRtl(e){return typeof window>`u`||!x(e)?!1:(e.ownerDocument.defaultView??window).getComputedStyle(e).direction===`rtl`},viewRect(e){if(!x(e))return null;let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{left:t,top:n,width:r,height:i}}},Ze=new Set([`began`,`changed`,`ended`,`cancelled`]),Qe={possible:[`began`,`ended`,`failed`],began:[`changed`,`ended`,`cancelled`],changed:[`changed`,`ended`,`cancelled`],ended:[`possible`],cancelled:[`possible`],failed:[`possible`]};function $e(e,t){return Qe[e].includes(t)}function V(e){return e===`ended`||e===`cancelled`||e===`failed`}function H(e){return e===`began`||e===`changed`}var et={panX:!0,panY:!0,pinchZoom:!0,doubleTapZoom:!0},tt={panX:!0,panY:!0,pinchZoom:!0,doubleTapZoom:!1},nt=1,rt=class{id=nt++;view=null;arena=null;pending=null;stateValue=`possible`;listeners=new Set;transitionListeners=new Set;failureRequirements=new Set;simultaneousWith=new Set;touches=new Map;seenTouchIds=new Set;lastLocation={x:0,y:0};constructor(e={}){this.options=e,this.name=e.name??this.constructor.name,this.isEnabled=e.isEnabled??!0,this.cancelsTouchesInView=e.cancelsTouchesInView??!0,this.selectionLock=e.selectionLock??null,this.delaysTouchesBegan=e.delaysTouchesBegan??!1,this.delaysTouchesEnded=e.delaysTouchesEnded??!0,this.allowedPointerTypes=e.allowedPointerTypes==null?null:new Set(e.allowedPointerTypes),this.allowedScrollTypes=new Set(e.allowedScrollTypes??this.defaultScrollTypes),this.requiresExclusiveTouchType=e.requiresExclusiveTouchType??!0}get isDiscrete(){return!1}get claimsTouches(){return this.options.claimsTouches??!0}get state(){return this.stateValue}get nativeTouchBehavior(){return et}get acceptsTouchInput(){return this.allowedPointerTypes==null||this.allowedPointerTypes.has(`touch`)}get numberOfTouches(){return this.touches.size}get trackedTouches(){return[...this.touches.values()]}location(){if(this.touches.size===0)return this.lastLocation;let e=0,t=0;for(let n of this.touches.values())e+=n.x,t+=n.y;return this.lastLocation={x:e/this.touches.size,y:t/this.touches.size},this.lastLocation}get environment(){return this.arena?.environment??Xe}requireToFail(e){return this.failureRequirements.add(e),this}recognizeSimultaneouslyWith(...e){for(let t of e)this.simultaneousWith.add(t),t.simultaneousWith.add(this);return this}requiresFailureOf(e){return this.failureRequirements.has(e)||this.options.shouldRequireFailureOf?.(this,e)===!0||e.options.shouldBeRequiredToFailBy?.(e,this)===!0}allowsSimultaneous(e){return this.simultaneousWith.has(e)||this.options.shouldRecognizeSimultaneously?.(this,e)===!0&&e.options.shouldRecognizeSimultaneously?.(e,this)===!0}shouldBegin(){return this.options.shouldBegin?.(this)??!0}keepsTouch(e){return!1}canPrevent(e){return!0}canBePrevented(e){return!0}isInvolved(){return this.touches.size>0||this.pending!=null}addListener(e){let t=e;return this.listeners.add(t),()=>{this.listeners.delete(t)}}addTransitionListener(e){let t=e;return this.transitionListeners.add(t),()=>{this.transitionListeners.delete(t)}}touchesBegan(e,t){}touchesMoved(e,t){}touchesEnded(e,t){}touchesCancelled(e,t){H(this.state)?this.setState(`cancelled`):this.state===`possible`&&this.setState(`failed`)}touchesTakenByBrowser(e,t){return!this.claimsTouches||(this.touchesCancelled(e,t),!1)}touchBeganElsewhere(e,t){}reset(){}get defaultScrollTypes(){return[]}acceptsTouch(e){if(!this.isEnabled)return!1;if(e.scrollType!=null)return this.allowedScrollTypes.has(e.scrollType)&&(this.options.shouldReceiveTouch?.(this,e)??!0);if(this.allowedPointerTypes!=null&&!this.allowedPointerTypes.has(e.pointerType))return!1;if(this.requiresExclusiveTouchType){for(let t of this.touches.values())if(t.pointerType!==e.pointerType)return!1}return this.options.shouldReceiveTouch?.(this,e)??!0}setState(e){this.arena==null?this.applyState(e):this.arena.requestTransition(this,e)}setTimer(e,t){this.arena?.setTimer(this,e,t)}clearTimer(){this.arena?.clearTimer(this)}now(){return this.arena?.now()??0}wantsTouch(e){return this.state!==`possible`&&!H(this.state)||this.pending!=null?!1:this.acceptsTouch(e)}deliverBegan(e,t){for(let t of e)this.touches.set(t.id,t),this.seenTouchIds.add(t.id);this.location(),this.touchesBegan(e,t)}deliverBeganElsewhere(e,t){V(this.state)||this.touchBeganElsewhere(e,t)}deliverMoved(e,t){let n=e.filter(e=>this.touches.has(e.id));n.length===0||V(this.state)||(this.location(),this.touchesMoved(n,t))}deliverEnded(e,t){let n=e.filter(e=>this.touches.has(e.id));if(n.length!==0){this.location(),V(this.state)||this.touchesEnded(n,t);for(let e of n)this.touches.delete(e.id)}}deliverCancelled(e,t){let n=e.filter(e=>this.touches.has(e.id));if(n.length!==0){V(this.state)||this.touchesCancelled(n,t);for(let e of n)this.touches.delete(e.id)}}deliverTakenByBrowser(e,t){let n=e.filter(e=>this.touches.has(e.id));if(n.length!==0&&(V(this.state)||!this.touchesTakenByBrowser(n,t)))for(let e of n)this.touches.delete(e.id)}onEnabledChange=null;setEnabled(e){let t=this.isEnabled!==e;this.isEnabled=e,t&&this.onEnabledChange?.(),!e&&(this.state!==`possible`||this.isInvolved())&&this.cancel()}cancel(){this.arena==null?H(this.state)?this.applyState(`cancelled`):this.state===`possible`&&this.isInvolved()&&this.applyState(`failed`):this.arena.stop(this)}applyState(e){let t=this.stateValue;if((t!==e||e===`changed`)&&$e(t,e)){this.stateValue=e,e!==`possible`&&(this.pending=null);for(let n of[...this.transitionListeners])n(this,t,e);if(Ze.has(e))for(let e of[...this.listeners])e(this)}}resetToPossible(){this.clearTimer(),this.pending=null,this.touches.clear(),this.seenTouchIds.clear(),this.reset(),this.applyState(`possible`)}},U={x:0,y:0},it=z.currentWeight.value,at=z.scrollReleaseWeight.value;function ot(e,t,n){return{x:e*t.x+(1-e)*n.x,y:e*t.y+(1-e)*n.y}}var st=class{newest=null;moved=[];moves=0;pan=U;previousPan=U;constructor(e={}){this.stillness=e.stillness??z.stillness.value}reset(){this.newest=null,this.moved=[],this.moves=0,this.pan=U,this.previousPan=U}add(e,t,n,{isMotion:r=!1}={}){if(this.newest!=null&&n<this.newest.time)return;this.newest={x:e,y:t,time:n};let i=this.moved[this.moved.length-1];(i==null||e!==i.x||t!==i.y||r)&&(i!=null&&n===i.time?this.moved[this.moved.length-1]={x:e,y:t,time:n}:(this.moved.push({x:e,y:t,time:n}),this.moved.length>3&&this.moved.shift(),i!=null&&(this.moves+=1,this.previousPan=this.pan)),this.pan=ct(this.moved))}offsetBy(e,t){let n=n=>({...n,x:n.x+e,y:n.y+t});this.newest=this.newest==null?null:n(this.newest),this.moved=this.moved.map(n)}scaleBy(e){let t=t=>({...t,x:t.x*e,y:t.y*e});this.newest=this.newest==null?null:t(this.newest),this.moved=this.moved.map(t),this.pan={x:this.pan.x*e,y:this.pan.y*e},this.previousPan={x:this.previousPan.x*e,y:this.previousPan.y*e}}addSamples(e){for(let t of e)this.add(t.x,t.y,t.time)}get lastSample(){return this.newest}velocity(e){return e!=null&&!this.releases(e)?U:this.pan}scrollVelocity(e){return this.releases(e)?ot(at,this.pan,this.previousPan):U}releases(e){let t=this.moved[this.moved.length-1];return this.moves>=2&&t!=null&&e-t.time<=this.stillness}};function ct(e){let t=e.length;if(t<2)return U;let n=lt(e[t-2],e[t-1]);return t===2?n:ot(it,n,lt(e[t-3],e[t-2]))}function lt(e,t){let n=t.time-e.time;return n<=0?U:{x:(t.x-e.x)/n*1e3,y:(t.y-e.y)/n*1e3}}var W={x:0,y:0},ut={left:{x:-1,y:0},right:{x:1,y:0},up:{x:0,y:-1},down:{x:0,y:1}},dt=class extends rt{get kind(){return`pan`}get family(){return`pan`}lockedAxis=null;travelAtBegan=W;releaseTime=void 0;origin=W;adjust=W;raw=W;offset=W;firstMove=null;constructor(e={}){super(e),this.minimumNumberOfTouches=e.minimumNumberOfTouches??1,this.maximumNumberOfTouches=e.maximumNumberOfTouches??1/0;let{hysteresis:t}=e;this.hysteresisFor=typeof t==`function`?t:null,this.hysteresis=typeof t==`number`?t:ze.hysteresis.value,this.direction=e.direction??`any`,this.axisRatio=e.axisRatio??1,this.lockAxis=e.lockAxis??!1,this.scrollEdge=e.scrollEdge??!1,this.firstMoveDecides=e.firstMoveDecides??!1,this.tracker=new st}translation(){return this.locked({x:this.raw.x+this.offset.x,y:this.raw.y+this.offset.y})}setDirection(e){this.direction=e}setTranslation(e){this.offset={x:e.x-this.raw.x,y:e.y-this.raw.y}}totalTranslation(){return this.raw}velocity(){return this.locked(this.tracker.velocity(this.releaseTime))}scrollVelocity(){return this.locked(this.tracker.scrollVelocity(this.releaseTime??this.tracker.lastSample?.time??0))}get nativeTouchBehavior(){if(this.scrollEdge||ut[this.direction]!=null)return et;let e=this.direction===`horizontal`||this.direction===`left`||this.direction===`right`;return{panX:this.direction===`vertical`||this.direction===`up`||this.direction===`down`,panY:e,pinchZoom:!0,doubleTapZoom:!1}}acceptsTouch(e){return H(this.state)&&this.numberOfTouches>=this.maximumNumberOfTouches?!1:super.acceptsTouch(e)}touchesBegan(e,t){if(this.numberOfTouches===e.length){let n=e[0];this.hysteresisFor!=null&&n!=null&&(this.hysteresis=this.hysteresisFor(n)),this.origin=B(this.touches.values()),this.adjust=W,this.raw=W,this.offset=W,this.tracker.reset(),this.tracker.add(this.origin.x,this.origin.y,t.time)}else this.rebase(new Set(e.map(e=>e.id)),`added`);this.state===`possible`&&this.numberOfTouches>this.maximumNumberOfTouches&&this.setState(`failed`)}touchesMoved(e,t){if(this.track(t.time),this.state===`possible`){if(this.firstMoveDecides&&this.firstMove==null&&(this.raw.x!==0||this.raw.y!==0)&&(this.firstMove=this.classify(this.raw),this.firstMove!==`begin`)){this.setState(`failed`);return}this.tryBegin()}else H(this.state)&&this.setState(`changed`)}touchesEnded(e,t){let n=this.numberOfTouches-e.length;if(H(this.state)){if(n<this.minimumNumberOfTouches){this.releaseTime=t.time,this.setState(`ended`);return}this.rebase(new Set(e.map(e=>e.id)),`removed`)}else n===0||n<this.minimumNumberOfTouches?this.setState(`failed`):this.rebase(new Set(e.map(e=>e.id)),`removed`)}reset(){this.lockedAxis=null,this.travelAtBegan=W,this.origin=W,this.adjust=W,this.raw=W,this.offset=W,this.releaseTime=void 0,this.firstMove=null,this.tracker.reset()}classify(e){if(this.direction===`any`)return`begin`;let t=this.direction===`horizontal`||this.direction===`left`||this.direction===`right`,n=t?e.x:e.y,r=Math.abs(t?e.y:e.x),i=Math.abs(n);if(i>this.axisRatio*r){let e=ut[this.direction],t=e==null?0:e.x+e.y;return t===0||Math.sign(n)===t?`begin`:`fail`}return r*Math.min(1,this.axisRatio)>i?`fail`:`wait`}tryBegin(){let e=this.numberOfTouches;if(e<this.minimumNumberOfTouches)return;if(e>this.maximumNumberOfTouches){this.setState(`failed`);return}let t=this.raw;if(Math.max(Math.abs(t.x),Math.abs(t.y))<this.hysteresis)return;let n=this.classify(t);n===`fail`||n===`wait`||this.scrollEdge&&this.nativeCanScroll(t.x,t.y)?this.setState(`failed`):(this.lockAxis&&this.direction===`any`&&(this.lockedAxis=Math.abs(t.x)>=Math.abs(t.y)?`x`:`y`),this.startFromHere(),this.setState(`began`))}startFromHere(){let e=this.hysteresis,t={x:Math.sign(this.raw.x)*Math.min(Math.abs(this.raw.x),e),y:Math.sign(this.raw.y)*Math.min(Math.abs(this.raw.y),e)};this.travelAtBegan=t,this.offset={x:-t.x,y:-t.y}}keepsTouch(e){let t=this.touches.get(e);if(!this.scrollEdge&&!this.firstMoveDecides||this.state!==`possible`||this.touches.size!==1||t==null||t.pointerType!==`touch`||t.takenByBrowser)return!1;if(this.firstMoveDecides)return this.firstMove===`begin`;let n=this.raw;return(n.x!==0||n.y!==0)&&this.classify(n)===`begin`&&!this.nativeCanScroll(n.x,n.y)}nativeCanScroll(e,t){for(let n of this.touches.values())if(n.scroll?.canScroll(e,t)===!0)return!0;return!1}track(e){let t=B(this.touches.values()),n={x:t.x+this.adjust.x,y:t.y+this.adjust.y};this.tracker.add(n.x,n.y,e),this.raw={x:n.x-this.origin.x,y:n.y-this.origin.y}}rebase(e,t){let n=B(this.touches.values()),r=B(this.touches.values(),e),[i,a]=t===`added`?[r,n]:[n,r];this.adjust={x:this.adjust.x+i.x-a.x,y:this.adjust.y+i.y-a.y}}locked(e){return this.lockedAxis===`x`?{x:e.x,y:0}:this.lockedAxis===`y`?{x:0,y:e.y}:e}};function G(e){return e}var ft={now:()=>typeof performance>`u`?Date.now():performance.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},pt=class{movingIds=new Set;records=new Map;active=[];timers=new Map;realTimer=null;realTimerDeadline=1/0;currentTime=null;latestTime=-1/0;depth=0;deferDepth=0;owesResolution=!1;constructor(e={}){this.options=e,this.clock=e.clock??ft,this.environment=e.environment??Xe}now(){return this.currentTime??Math.max(this.latestTime,this.clock.now())}isClaimed(e){return this.records.get(e)?.isClaimed===!0}consumerOf(e){return this.records.get(e)?.consumer??null}getTouch(e){return this.records.get(e)?.touch}participantsOf(e){return this.records.get(e)?.participants??[]}get touches(){return[...this.records.values()].map(e=>e.touch)}get involvedRecognizers(){return this.active}began(e){e.length!==0&&this.run(e[0].time,()=>{let t=new Map,n=[];for(let r of e){if(this.records.has(r.id))continue;let e=this.clampTime(r.time),i={x:r.x,y:r.y,time:e},a={id:r.id,pointerType:r.pointerType,phase:`began`,x:r.x,y:r.y,time:e,startX:r.x,startY:r.y,startTime:e,samples:[...r.history??[],i],target:r.target,scroll:r.scroll??null,takenByBrowser:!1,...r.scrollType==null?{}:{scrollType:r.scrollType}},o=[];for(let[e,n]of r.recognizers.entries()){if(!G(n).wantsTouch(a))continue;if(o.push(n),G(n).arena=this,!this.active.includes(n)){let t=this.active.findIndex(t=>r.recognizers.indexOf(t)>e);t===-1?this.active.push(n):this.active.splice(t,0,n)}let i=t.get(n)??[];i.push(a),t.set(n,i)}let s={touch:a,participants:o,consumer:r.consumer??null,view:`none`,isLifted:!1,isClaimed:!1,suppressClick:!1,deferredClick:!1};this.records.set(r.id,s),n.push(s)}let r=this.context();for(let e of[...this.active]){let n=t.get(e);n!=null&&G(e).deliverBegan(n,r)}for(let e of[...this.active]){let i=t.get(e),a=n.map(e=>e.touch).filter(e=>i==null||!i.includes(e));a.length>0&&e.numberOfTouches>0&&G(e).deliverBeganElsewhere(a,r)}for(let e of n)this.deliverViewBegan(e)})}untrackedBegan(e){this.active.some(e=>e.numberOfTouches>0)&&this.run(e.time,()=>{let t=this.clampTime(e.time),n={id:e.id,pointerType:e.pointerType,phase:`began`,x:e.x,y:e.y,time:t,startX:e.x,startY:e.y,startTime:t,samples:[{x:e.x,y:e.y,time:t}],target:e.target,scroll:e.scroll??null,takenByBrowser:!1},r=this.context();for(let e of[...this.active])e.numberOfTouches>0&&G(e).deliverBeganElsewhere([n],r)})}moved(e){e.length!==0&&this.run(e[0].time,()=>{let t=this.update(e,`moved`);if(t.length===0)return;let n=this.context(),r=this.movingIds;this.movingIds=new Set(t.map(e=>e.id));try{for(let e of[...this.active])G(e).deliverMoved(t,n)}finally{this.movingIds=r}for(let e of t){let t=this.records.get(e.id);t?.view===`delivered`&&t.consumer?.touchMoved(e)}})}ended(e){let t=new Map;return e.length===0||this.run(e[0].time,()=>{let n=this.update(e,`ended`),r=this.context();for(let e of[...this.active])G(e).deliverEnded(n,r);this.reviewPending();for(let e of n){let n=this.records.get(e.id);n!=null&&(n.isLifted=!0,t.set(e.id,this.resolveEnd(n)))}}),t}cancelled(e,t){this.run(t,()=>{let t=this.liveTouches(e);for(let e of t)e.phase=`cancelled`;let n=this.context();for(let e of[...this.active])G(e).deliverCancelled(t,n);for(let e of t){let t=this.records.get(e.id);t!=null&&(t.isLifted=!0,t.suppressClick=!0,this.cancelView(t))}})}browserTookOver(e,t){this.run(t,()=>{let t=this.liveTouches(e).filter(e=>!e.takenByBrowser);if(t.length===0)return;for(let e of t)e.takenByBrowser=!0;let n=this.context();for(let e of[...this.active])G(e).deliverTakenByBrowser(t,n);for(let e of t){let t=this.records.get(e.id);t!=null&&(t.suppressClick=!0,this.cancelView(t))}})}advanceTime(e){this.run(e,()=>{})}requestTransition(e,t){let n=e.state;t===`failed`?this.fail(e):(G(e).pending==null||t!==`began`&&t!==`ended`)&&(n===`possible`&&(t===`began`||t===`ended`)?this.attemptRecognition(e,t):H(n)&&(t===`changed`||t===`ended`)?this.apply(e,t):H(n)&&t===`cancelled`&&this.apply(e,`cancelled`))}setTimer(e,t,n){this.timers.set(e,{deadline:t,callback:n}),this.scheduleRealTimer()}clearTimer(e){this.timers.delete(e)&&this.scheduleRealTimer()}deferResolution(e){this.deferDepth+=1;try{e()}finally{--this.deferDepth}this.deferDepth===0&&this.owesResolution&&queueMicrotask(()=>{this.owesResolution&&this.deferDepth===0&&this.run(this.lastEventTime(),()=>{})})}lastEventTime(){return Number.isFinite(this.latestTime)?this.latestTime:this.clock.now()}stop(e){let t=this.currentTime??(Number.isFinite(this.latestTime)?this.latestTime:this.clock.now());this.run(t,()=>{H(e.state)?this.apply(e,`cancelled`):e.state===`possible`&&e.isInvolved()&&this.fail(e)})}attemptRecognition(e,t){if(!G(e).shouldBegin()||this.isVetoedByConsumer(e)||this.isRefusedByBrowser(e)){this.fail(e);return}let n=!1;for(let t of this.active)if(t!==e&&G(e).requiresFailureOf(t)&&t.state!==`failed`){if(t.state!==`possible`){this.fail(e);return}t.isInvolved()&&(n=!0)}if(n)G(e).pending=t,this.claim(e);else{for(let t of this.active)if(t!==e&&(H(t.state)||t.state===`ended`&&t.trackedTouches.length>0)&&this.conflicts(t,e)){this.fail(e);return}this.apply(e,t);for(let t of[...this.active])t!==e&&t.state===`possible`&&(G(t).requiresFailureOf(e)||this.conflicts(e,t))&&this.fail(t);this.claim(e),e.claimsTouches&&e.cancelsTouchesInView&&this.cancelViewTouchesOf(e)}}conflicts(e,t){return!mt(e,t)||G(e).allowsSimultaneous(t)||!e.claimsTouches||!t.claimsTouches?!1:e.canPrevent(t)&&t.canBePrevented(e)}isRefusedByBrowser(e){let t=this.options.refusesClaim;return t==null||!e.claimsTouches?!1:e.trackedTouches.some(e=>e.phase!==`ended`&&e.phase!==`cancelled`&&t(e))}isVetoedByConsumer(e){for(let t of G(e).seenTouchIds)if((this.records.get(t)?.consumer)?.allowsAncestorRecognizer?.(e)===!1)return!0;return!1}fail(e){V(e.state)||(H(e.state)?this.apply(e,`cancelled`):(G(e).pending=null,this.apply(e,`failed`),this.reviewPending()))}releaseClaim(e,t=new Set){let n=[];for(let r of e.trackedTouches){let i=this.records.get(r.id);i!=null&&i.isClaimed&&!t.has(r.id)&&(this.active.some(t=>t!==e&&t.claimsTouches&&(H(t.state)||t.state===`ended`||G(t).pending!=null)&&t.trackedTouches.some(e=>e.id===r.id))||(i.isClaimed=!1,n.push(r.id)))}n.length>0&&this.options.onRelease?.(n)}apply(e,t){let n=e.state;G(e).applyState(t),(e.state===t&&n!==t||t===`changed`&&n===`changed`)&&this.options.onTransition?.(e,n,t),V(t)&&this.clearTimer(e),t===`cancelled`?this.releaseClaim(e,this.movingIds):t===`failed`&&this.releaseClaim(e)}reviewPending(){if(this.deferDepth>0){this.owesResolution=!0;return}let e=!0;for(;e;){e=!1;for(let t of[...this.active]){let n=G(t).pending;n!=null&&t.state===`possible`&&(this.active.some(e=>e!==t&&G(t).requiresFailureOf(e)&&e.state===`possible`&&e.isInvolved())||(G(t).pending=null,this.attemptRecognition(t,n),e=!0))}}}claim(e){if(!e.claimsTouches)return;let t=[];for(let n of e.trackedTouches){let e=this.records.get(n.id);e!=null&&!e.isLifted&&!e.isClaimed&&!e.touch.takenByBrowser&&(e.isClaimed=!0,t.push(n.id))}t.length>0&&this.options.onClaim?.(t,e)}deliverViewBegan(e){e.consumer!=null&&e.view===`none`&&(e.suppressClick?e.view=`done`:this.beginDelayers(e)?e.view=`held`:(e.view=`delivered`,e.consumer.touchBegan(e.touch)))}resolveEnd(e){if(e.suppressClick)return`suppress`;let t=this.endDelayers(e);switch(e.view){case`delivered`:return t?(e.view=`endHeld`,e.deferredClick=!0,`defer`):(e.view=`done`,e.consumer?.touchEnded(e.touch),`allow`);case`held`:return this.beginDelayers(e)?(e.deferredClick=!0,`defer`):(e.view=`delivered`,e.consumer?.touchBegan(e.touch),this.resolveEnd(e));case`none`:case`endHeld`:case`done`:return t?(e.deferredClick=!0,`defer`):`allow`}}reviewHeld(){for(let e of this.records.values())e.view===`held`&&!this.beginDelayers(e)&&(e.suppressClick?e.view=`done`:(e.view=`delivered`,e.consumer?.touchBegan(e.touch),e.isLifted&&!this.endDelayers(e)?(e.view=`done`,e.consumer?.touchEnded(e.touch)):e.isLifted&&(e.view=`endHeld`))),e.view===`endHeld`&&!this.endDelayers(e)&&(e.view=`done`,e.suppressClick?e.consumer?.touchCancelled(e.touch):e.consumer?.touchEnded(e.touch)),e.deferredClick&&e.view!==`held`&&e.view!==`endHeld`&&!this.endDelayers(e)&&(e.deferredClick=!1,this.options.onDeferredClick?.(e.touch,!e.suppressClick))}beginDelayers(e){return e.participants.some(t=>t.delaysTouchesBegan&&t.state===`possible`&&t.isInvolved()&&G(t).seenTouchIds.has(e.touch.id))}endDelayers(e){return e.participants.some(t=>t.delaysTouchesEnded&&t.state===`possible`&&t.isInvolved()&&G(t).seenTouchIds.has(e.touch.id))}cancelViewTouchesOf(e){for(let t of G(e).seenTouchIds){let e=this.records.get(t);e!=null&&(e.suppressClick=!0,this.cancelView(e))}}cancelView(e){(e.view===`delivered`||e.view===`endHeld`)&&e.consumer?.touchCancelled(e.touch),(e.view!==`none`||e.consumer!=null)&&(e.view=`done`)}context(){return{time:this.now(),allTouches:[...this.records.values()].filter(e=>!e.isLifted).map(e=>e.touch)}}liveTouches(e){let t=[];for(let n of e){let e=this.records.get(n);e!=null&&!e.isLifted&&t.push(e.touch)}return t}update(e,t){let n=[];for(let r of e){let e=this.records.get(r.id);if(e==null||e.isLifted)continue;let i=this.clampTime(r.time),a=e.touch;a.samples=[...(r.history??[]).filter(e=>e.time>a.time&&e.time<i),{x:r.x,y:r.y,time:i}],a.x=r.x,a.y=r.y,a.time=i,a.phase=t,n.push(a)}return n}clampTime(e){let t=Math.max(e,this.latestTime);return this.latestTime=t,t}run(e,t){this.depth+=1;try{this.depth===1&&this.deferDepth===0&&this.owesResolution&&(this.owesResolution=!1,this.currentTime=this.clampTime(this.lastEventTime()),this.settle()),this.flushTimers(e),this.currentTime=this.clampTime(e),t(),this.depth===1&&(this.deferDepth>0?this.owesResolution=!0:(this.owesResolution=!1,this.settle()))}finally{--this.depth,this.depth===0&&(this.currentTime=null)}}flushTimers(e){for(;;){let t=null;for(let n of this.timers)n[1].deadline<=e&&(t==null||n[1].deadline<t[1].deadline||n[1].deadline===t[1].deadline&&this.rank(n[0])<this.rank(t[0]))&&(t=n);if(t==null)break;let[n,r]=t;this.timers.delete(n),this.currentTime=this.clampTime(r.deadline),r.callback(),this.depth<=1&&this.settle()}this.scheduleRealTimer()}rank(e){let t=this.active.indexOf(e);return t===-1?1/0:t}settle(){this.reviewPending(),this.reviewHeld();let e=!1;for(let t of[...this.active]){if(!(V(t.state)&&t.numberOfTouches===0||t.state===`possible`&&!t.isInvolved()))continue;this.active=this.active.filter(e=>e!==t);let n=t.state;G(t).resetToPossible(),e=!0,n!==`possible`&&this.options.onTransition?.(t,n,`possible`)}e&&this.reviewHeld();let t=!1;for(let[e,n]of this.records)n.isLifted&&n.view!==`held`&&n.view!==`endHeld`&&!n.deferredClick&&(this.records.delete(e),t=!0);t&&this.records.size===0&&this.options.onIdle?.()}scheduleRealTimer(){let e=1/0;for(let t of this.timers.values())e=Math.min(e,t.deadline);if(e===this.realTimerDeadline||(this.realTimer!=null&&(this.clock.clearTimeout(this.realTimer),this.realTimer=null),this.realTimerDeadline=e,e===1/0))return;let t=Math.max(0,e-this.clock.now()),n=t=>{this.realTimer=null,this.realTimerDeadline=1/0,t&&this.clock.now()>e?(this.realTimerDeadline=e,this.realTimer=this.clock.setTimeout(()=>n(!1),0)):this.advanceTime(e)};this.realTimer=this.clock.setTimeout(()=>n(!0),t)}};function mt(e,t){for(let n of G(e).seenTouchIds)if(G(t).seenTouchIds.has(n))return!0;return!1}var ht=50,gt=1.5,_t=4,vt=.8,yt=1,bt=.25,xt=64,St=.15,Ct=.5,wt=16,Tt=1e3/60,Et=3;function Dt(e){return e<=gt}var Ot=class{gesture=0;phase=`finger`;last=-1/0;previous=0;sign=0;count=0;run=0;runStart=0;ratio=1;paces=[];slower=[];onPace=-1/0;paced=0;resumed=!1;joined=0;push(e,t,n,r=!1){let i=Math.abs(t),a=Math.sign(t),o=e-this.last,s=this.count>0&&Dt(o),c=this.frameMs(),l=null,u=null;if(this.count===0)l=this.gesture===0?`first`:`idle`;else if(this.phase===`finger`&&o>=n)l=`idle`;else if(this.phase===`momentum`){let t=Math.round((e-this.onPace)/c),n=o>=ht,d=!s&&i>=2&&i>this.previous*1.3+.5;a!==0&&this.sign!==0&&a!==this.sign?l=`reversal`:n||d?(r&&a===this.sign&&(n||o>=1.5*c)&&(u=this.glideSteps(i,Math.max(1,t),St)),u??(l=n?`gap`:`jump`)):r&&this.resumed&&!s&&i>yt&&i>this.paced+Ct&&(l=`jump`)}if(u==null&&l==null&&s&&r){if(this.phase===`momentum`)u=this.glideSteps(i,xt);else if(this.run>0){let e=this.glideSteps(i,xt);e!=null&&e>1&&Math.abs(i-this.glideSum(e))<this.steadyOff(i)&&(u=e)}}let d=u??(l==null&&s&&this.previous>0?Math.max(1,Math.round(i/this.previous)):1),f=u!=null&&u>1,p=f?this.previous*this.ratio**d:i/d;l!=null&&(this.gesture+=1,this.phase=`finger`,this.count=0,this.run=0,this.ratio=1,this.resumed=!1,this.paces=[],this.slower=[]);let m=l===`jump`?this.joined:0,h=l==null&&u!=null&&!s;h&&(this.resumed=!0),this.joined=h?t:s&&l==null&&this.joined!==0?this.joined+t:0,s||(this.paced=i);let g=!1,_=!1;return this.phase===`finger`&&this.count>=3&&i>0&&(_=f?this.ratio<=.995:p<=this.previous*.995&&p>=this.previous*.5,_?(this.run===0&&(this.runStart=this.previous),this.run+=1):this.run=0,this.run>=_t&&p<=this.runStart*vt&&(this.phase=`momentum`,g=!0)),d===1&&this.count>0&&this.previous>0&&p>0&&(this.ratio=Math.min(1,Math.max(.5,p/this.previous))),!s&&l==null&&o<ht&&this.notePace(o,c),(l!=null||!s&&o<2*c)&&(this.onPace=e),this.count+=1,this.previous=p,a!==0&&(this.sign=a),this.last=e,{boundary:l,phase:this.phase,gesture:this.gesture,liftNow:g,decaying:_&&!g,bunched:l==null&&s,carried:m}}notePace(e,t){let n=e>=.5*t&&e<=1.5*t;this.paces.length<Et||n?(this.paces=[...this.paces.slice(-7),e],this.slower=[]):(this.slower=e>1.5*t?[...this.slower,e]:[],this.slower.length>=Et&&(this.paces=this.slower,this.slower=[]))}frameMs(){if(this.paces.length===0)return wt;let e=[...this.paces].sort((e,t)=>e-t),t=e.length>>1,n=e.length%2==1?e[t]:(e[t-1]+e[t])/2;return Math.min(n,Tt)}glideSum(e){let t=this.previous*this.ratio,n=0;for(let r=0;r<e;r++)n+=t,t*=this.ratio;return n}steadyOff(e){return Math.min(...[this.runStart,this.previous].filter(e=>e>0).map(t=>Math.abs(e-Math.max(1,Math.round(e/t))*t)))}glideSteps(e,t,n=bt){if(this.previous<=0||e<=0)return null;let r=this.previous*this.ratio;if(e<=r+yt)return 1;let i=r;for(let a=2;a<=Math.min(t,xt);a++)if(r*=this.ratio,i+=r,Math.abs(e-i)<=Math.max(yt,i*n))return a;return null}end(){this.count=0}};function kt(e){let t=!0,n=!0,r=!0,i=!0;for(let a of e){if(!G(a).acceptsTouchInput||!a.claimsTouches)continue;let e=a.nativeTouchBehavior;t&&=e.panX,n&&=e.panY,r&&=e.pinchZoom,i&&=e.doubleTapZoom}return{panX:t,panY:n,pinchZoom:r,doubleTapZoom:i}}function At(e){let t=kt(e);if(t.panX&&t.panY&&t.pinchZoom&&t.doubleTapZoom)return null;if(t.panX&&t.panY&&t.pinchZoom)return`manipulation`;let n=[];return t.panX&&n.push(`pan-x`),t.panY&&n.push(`pan-y`),t.pinchZoom&&n.push(`pinch-zoom`),n.length===0?`none`:n.join(` `)}function jt(e){let t={},n=At(e);return n!=null&&(t.touchAction=n),t}var K=[`pan-left`,`pan-right`,`pan-up`,`pan-down`,`pinch-zoom`];function Mt(e){let t=e.trim().split(/\s+/).filter(e=>e!==``),n=new Set;t.length===0&&t.push(`auto`);for(let e of t)e===`auto`?(K.forEach(e=>n.add(e)),n.add(`double-tap-zoom`)):e===`manipulation`?K.forEach(e=>n.add(e)):e===`pan-x`?n.add(`pan-left`).add(`pan-right`):e===`pan-y`?n.add(`pan-up`).add(`pan-down`):K.includes(e)&&n.add(e);return n}function Nt(e,t){let n=Mt(t),r=new Set([...Mt(e)].filter(e=>n.has(e)));if(K.every(e=>r.has(e)))return r.has(`double-tap-zoom`)?`auto`:`manipulation`;let i=[];for(let[e,t,n]of[[`pan-x`,`pan-left`,`pan-right`],[`pan-y`,`pan-up`,`pan-down`]])r.has(t)&&r.has(n)?i.push(e):r.has(t)?i.push(t):r.has(n)&&i.push(n);return r.has(`pinch-zoom`)&&i.push(`pinch-zoom`),i.length===0?`none`:i.join(` `)}var q=`data-astryx-touch-action`,Pt=`reset`,J=new WeakMap,Y=new WeakMap;function Ft(e){let t=J.get(e);if(t==null){let n=e.nodeType===9?e:e.ownerDocument,r,i,a=n?.defaultView?.CSSStyleSheet;if(typeof a==`function`&&`replaceSync`in a.prototype&&`adoptedStyleSheets`in e){let t=new a;e.adoptedStyleSheets=[...e.adoptedStyleSheets,t],r=e=>t.replaceSync(e),i=()=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==t)}}else{let t=n?.createElement(`style`),a=e.nodeType===9?n?.head??n?.documentElement:e;t!=null&&a!=null&&(a.append(t),r=e=>{t.textContent=e},i=()=>t.remove())}if(r==null||i==null)return null;t={values:new Set,marked:new Set,css:``,write:r,remove:i},J.set(e,t)}return t}function It(e,t){let n=e.getRootNode(),r=e.isConnected&&(n.nodeType===9||`host`in n)?Ft(n):null;if(r==null)return!1;r.values.has(t)||(r.values.add(t),r.css+=`:where([${q}="${t}"]){touch-action:${t}}`,r.write(`@layer ${Pt}{${r.css}}`)),e.getAttribute(`data-astryx-touch-action`)!==t&&e.setAttribute(q,t);let i=Y.get(e);return i!=null&&i!==n&&Lt(e,i),r.marked.add(e),Y.set(e,n),!0}function Lt(e,t){let n=J.get(t);n!=null&&(n.marked.delete(e),n.marked.size===0&&(n.remove(),J.delete(t)))}function Rt(e){e.removeAttribute(q);let t=Y.get(e);t!=null&&(Y.delete(e),Lt(e,t))}function zt(e){return e.button===0&&!(e.ctrlKey&&Ie())}var Bt={touchAction:`touch-action`,WebkitTouchCallout:`-webkit-touch-callout`,WebkitUserSelect:`-webkit-user-select`,userSelect:`user-select`};function Vt(e){return Ht.has(e.trim().toLowerCase())}var Ht=new Set([`initial`,`inherit`,`unset`,`revert`,`revert-layer`]);function Ut(e,t){if(e!=null&&typeof e.requestAnimationFrame==`function`){let n=e.requestAnimationFrame(t);return()=>e.cancelAnimationFrame(n)}let n=setTimeout(t,0);return()=>clearTimeout(n)}var Wt={capture:!0,passive:!0};function Gt(e){return e.claimsTouches&&G(e).acceptsTouchInput&&G(e).family!==`tap`}function Kt(e){let t=e.allowedPointerTypes;return t==null||t.has(`touch`)||t.has(`pen`)}function qt(e){return G(e).family===`pan`}function Jt(e){return e.kind===`screenEdgePan`?e:null}function Yt(e){return $(e.changedTouches).some(e=>e.touchType===`stylus`)}var Xt=500,Zt=8;function Qt(e,t){return e.target===t.target&&Math.abs(e.x-t.x)<=1&&Math.abs(e.y-t.y)<=1}function $t(e){return e===`touch`||e===`mouse`||e===`pen`}function X(e,t=e.target){return t===e.target?e.composedPath()[0]??t:t}var en=100,tn=180,nn=220,rn=40,an=100;function on(e,t,n){return e===`pinch`||t!==`continuous`?en:n?nn:tn}function sn(e,t){return Math.sign(e)*Math.max(0,Math.abs(e)-Math.abs(t)/2)}function cn(e,t,n){e.readSpan<=0||(e.speedX=ln(e.speedX,(t-e.readFromX)/e.readSpan,e.priorSpeedX),e.speedY=ln(e.speedY,(n-e.readFromY)/e.readSpan,e.priorSpeedY))}function ln(e,t,n){let r=Math.sign(t)*Math.min(Math.abs(t),Math.abs(n));return r*e>=0&&Math.abs(r)>Math.abs(e)?r:e}function un(e,t,n){return n===0||(t-e)*Math.sign(n)>0?t:e}function dn(e,t){return e.deltaMode===1?{dx:e.deltaX*rn,dy:e.deltaY*rn}:e.deltaMode===2?{dx:e.deltaX*(t?.innerWidth??0),dy:e.deltaY*(t?.innerHeight??0)}:{dx:e.deltaX,dy:e.deltaY}}function Z(e){if(e.deltaMode!==0||e.shiftKey)return`discrete`;let t=e=>{let t=Math.abs(e-Math.round(e));return t>0&&t<.01};if(t(e.deltaX)||t(e.deltaY))return`discrete`;let n=e;if(typeof n.wheelDeltaY!=`number`||typeof n.wheelDeltaX!=`number`)return`discrete`;let r=(e,t)=>e===0?t===0:Math.abs(Math.abs(t)-3*Math.abs(e))<=Math.max(1.5,.05*Math.abs(e)*3);if(!r(e.deltaY,n.wheelDeltaY)||!r(e.deltaX,n.wheelDeltaX))return`discrete`;let i=(e,t)=>t!==0&&t%120==0&&e%40==0;return i(e.deltaY,n.wheelDeltaY)||i(e.deltaX,n.wheelDeltaX)?`discrete`:`continuous`}function fn(e){return e.scrollEdge===!0}function pn(e,t,n){return(G(e).classify?.({x:t,y:n})??`begin`)===`begin`}function Q(e){let t=e.timeStamp;return t>0xe8d4a51000&&typeof performance<`u`&&performance.timeOrigin>0?t-performance.timeOrigin:t}function $(e){return e==null?[]:Array.from(e)}var mn=class{registry=new Map;stopWatchingMovers=null;stopBlockingForMovers=null;pendingCallerReads=new Set;isCallerReadScheduled=!1;cancelCallerRead=null;lockedBy=new Map;pressSelections=new Map;selectingContacts=new Set;dragHolds=new Set;claimHolds=new Map;retargeted=new Map;touchIds=new Map;cancelledFingers=new Set;cancelledPointers=new Map;touchTargets=new Map;watched=new Map;blockingFingers=new Set;claimingFingers=new Set;processed=new WeakSet;pointerIds=new Map;pointerKinds=new Map;layoutWatched=new Set;layoutObserver=null;judgedUncancelable=new Set;fingerPointers=new Map;pendingPointers=new Map;claimedLifts=[];claimedLiftTimer=null;unpairedTouches=new Map;lastFed=new Map;pointerFed=new Set;lastTouch=null;ownedScrolls=new Map;ownScrollCalls=0;ownScrollFrames=new Map;lastScroll=null;touchGates=new Set;retainers=0;fingerListeners=new Set;fingerTargets=[];nextId=1;wheel=null;stopWheelLatch=null;segmenter=new Ot;wheelSegment=null;wheelsSeen=new WeakSet;isInstalled=!1;isCoarse=!1;stopWatchingPointer=null;unsubscribers=[];armedElements=new Map;isArmedPress=!1;isClaimingInstalled=!1;claimingUnsubscribers=[];usesTouchEvents=!0;constructor(e,t={}){this.doc=e,this.inputMode=t.inputMode??`auto`,this.presentedHitTesting=t.presentedHitTesting??`auto`;let n={viewportSize:()=>({width:e.defaultView?.innerWidth??0,height:e.defaultView?.innerHeight??0}),isRtl:e=>x(e)&&me(e),viewRect:e=>{if(!x(e))return null;let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{left:t,top:n,width:r,height:i}}};this.clock=t.clock??ft,this.arena=new pt({clock:this.clock,environment:n,onDeferredClick:(e,t)=>this.replayClick(e,t),onIdle:()=>this.releaseArmedPress(),onTransition:t.onTransition,onClaim:(e,t)=>this.lockClaimedDrags(e,t),onRelease:e=>this.releaseClaimedDrags(e),refusesClaim:e=>this.selectingContacts.has(e.id)&&(e.x!==e.startX||e.y!==e.startY)});let r=e.defaultView;this.followsPointer=t.isPrimaryPointerCoarse==null,this.isPrimaryPointerCoarse=t.isPrimaryPointerCoarse??(()=>c(r))}attach(e,t,n={}){let r=this.registrationFor(e);n.manageStyle===!1?(r.unstyled.add(t),r.recognizers.length===0&&(r.manageStyle=!1)):r.manageStyle=!0;let i=n.actionGroup===!0;i&&(r.actionGroupAsks+=1,r.actionGroup=!0),t.view=e,r.recognizers.push(t),t.onEnabledChange=()=>{this.refresh(e,r),this.syncListeners()};let a=Jt(t);return a!=null&&(a.onTouchBehaviorChange=()=>{this.refresh(e,r),this.syncLayoutWatch()}),this.refresh(e,r),this.syncListeners(),()=>{t.onEnabledChange=null,i&&(--r.actionGroupAsks,r.actionGroup=r.actionGroupAsks>0),a!=null&&(a.onTouchBehaviorChange=null);let n=r.recognizers.indexOf(t);n>=0&&r.recognizers.splice(n,1),r.unstyled.delete(t),(t.state!==`possible`||t.isInvolved())&&t.cancel();let o=this.wheel;o!=null&&o.takers.includes(t)&&!this.wheelHasTaker(o)&&this.endWheel(o.last),this.refresh(e,r),this.syncListeners(),this.cleanup(e,r)}}syncLayoutWatch(){let e=new Set,t=!1;for(let[n,r]of this.registry)for(let i of r.recognizers){let r=Jt(i);r!=null&&r.isEnabled&&(e.add(n),t||=r.watchesViewport)}t&&e.add(this.doc.documentElement);for(let t of[...this.layoutWatched])e.has(t)||(this.layoutObserver?.unobserve(t),this.layoutWatched.delete(t));if(e.size===0){this.layoutObserver?.disconnect(),this.layoutObserver=null;return}let n=this.doc.defaultView;if(this.layoutObserver==null&&n!=null&&typeof n.ResizeObserver==`function`){this.layoutObserver=new n.ResizeObserver(this.onLayoutChange);for(let e of this.layoutWatched)this.layoutObserver.observe(e)}for(let t of e)this.layoutWatched.has(t)||(this.layoutObserver?.observe(t),this.layoutWatched.add(t))}onLayoutChange=()=>{for(let e of this.registry.values())for(let t of e.recognizers){let e=Jt(t);e!=null&&e.isEnabled&&e.layoutChanged()}};attachConsumer(e,t,n={}){let r=this.registrationFor(e);return r.consumer=t,this.refresh(e,r),this.syncListeners(),()=>{r.consumer===t&&(r.consumer=null),this.refresh(e,r),this.syncListeners(),this.cleanup(e,r)}}get document(){return this.doc}isTouchClaimed(e){let t=this.touchIds.get(e);return t!=null&&this.arena.isClaimed(t)}presentedRect(e){let t=e.getBoundingClientRect();if(!this.hitTestsLayout())return t;let{x:n,y:r}=P(e);return n===0&&r===0?t:{left:t.left+n,top:t.top+r,right:t.right+n,bottom:t.bottom+r}}hitTestsLayout(){return this.presentedHitTesting===`always`||this.presentedHitTesting===`auto`&&s(this.doc.defaultView)}presentedTarget(e,t,n,r){if(!this.hitTestsLayout())return e;let i=j().filter(e=>{if(!e.isConnected||e.ownerDocument!==this.doc)return!1;let{x:t,y:n}=P(e);return Math.abs(t)>=.5||Math.abs(n)>=.5});if(i.length===0)return e;de(i);let a=this.drawnAt(t,n),o=(this.doc.defaultView?.performance.now()??r)-r;if(o>0&&o<1e3){let e=e=>{let t=P(e,r);return Math.abs(t.x)>=.5||Math.abs(t.y)>=.5?t:null},o=a,s=o==null?void 0:i.find(e=>w(e,o)),c=!1;for(let r of i){let i=e(r);if(i==null)continue;let o=this.drawnAt(t-i.x,n-i.y);if(o!=null&&w(r,o)){a=o,c=!0;break}}!c&&s!=null&&e(s)!=null&&(a=this.drawnBeneath(t,n,i))}if(a==null||a===e)return e;let s=a,c=S(e)?e:null;return i.some(e=>w(e,s)||c!=null&&w(e,c))?s:e}drawnBeneath(e,t,n){return typeof this.doc.elementsFromPoint==`function`?this.doc.elementsFromPoint(e,t).find(e=>!n.some(t=>w(t,e)))??null:null}drawnAt(e,t){let n=this.doc.elementFromPoint(e,t);for(;n?.shadowRoot!=null;){let r=n.shadowRoot.elementFromPoint(e,t);if(r==null||r===n)break;n=r}return n}browserTook(e,t){for(let t of e)this.retargeted.delete(t);this.arena.browserTookOver(e,t)}clickRetargeted(e,t,n,r){let i=this.doc.defaultView;x(e)&&e.isConnected&&i!=null&&(p(this.doc,{takesLateMouse:r===`touch`}),k(e)&&e.matches(`input, textarea, select, [contenteditable]`)&&e.focus(),v(()=>e.dispatchEvent(new i.MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:1,clientX:t,clientY:n}))))}update(e){this.followsPointer||(this.isCoarse=this.isPrimaryPointerCoarse());let t=this.registry.get(e);t!=null&&this.refresh(e,t),this.syncListeners()}pointerIdOf(e){let t=typeof e==`number`?e:e.id;for(let[e,n]of this.fingerPointers)if(n===t)return e;for(let[e,n]of this.pointerIds)if(n===t)return e;return null}isScrollBraking(e,t=R.scrollBrake.value){let n=this.lastScroll;return n!=null&&this.arena.now()-n.time<t&&w(n.scroller,e)}retain(){this.retainers+=1,this.watchPointer(),this.syncListeners();let e=!0;return()=>{e&&(e=!1,--this.retainers,this.uninstallIfIdle())}}onFingersChange(e){return this.fingerListeners.add(e),()=>{this.fingerListeners.delete(e)}}isFingerDownIn(e){return this.fingerTargets.some(t=>w(e,t))}registrationFor(e){this.watchPointer();let t=this.registry.get(e);return t??(t={recognizers:[],consumer:null,hasTouchEndListener:!1,hasTouchMoveListener:!1,hasWheelListener:!1,savedStyle:new Map,authorTouchAction:null,manageStyle:!0,unstyled:new Set,actionGroup:!1,actionGroupAsks:0},this.registry.set(e,t)),t}needsInput(){return this.registry.size>0||this.retainers>0}refresh(e,t){t.manageStyle&&k(e)&&this.applyStyle(e,t),this.syncTouchMoveListener(e,t)}syncTouchMoveListener(e,t){let n=this.readsFingersFromPointerEvents()&&(this.isCoarse||this.sendsTouchEvents())&&t.recognizers.some(e=>e.isEnabled&&G(e).acceptsTouchInput);n&&!t.hasTouchEndListener?(e.addEventListener(`touchend`,this.onClaimedTouchEnd,{passive:!1}),t.hasTouchEndListener=!0):!n&&t.hasTouchEndListener&&(e.removeEventListener(`touchend`,this.onClaimedTouchEnd),t.hasTouchEndListener=!1);let r=t.recognizers.some(e=>e.isEnabled&&Gt(e))||t.consumer?.keepsTouch!=null&&t.consumer.isEnabled?.()!==!1&&(this.isCoarse||this.isArmedPress);r&&!t.hasTouchMoveListener?(e.addEventListener(`touchmove`,this.onBlockingTouchMove,{passive:!1}),t.hasTouchMoveListener=!0):!r&&t.hasTouchMoveListener&&(e.removeEventListener(`touchmove`,this.onBlockingTouchMove),t.hasTouchMoveListener=!1);let i=t.recognizers.some(e=>e.isEnabled&&e.claimsTouches&&e.allowedScrollTypes.size>0&&(G(e).family===`pan`||G(e).family===`pinch`));i&&!t.hasWheelListener?(e.addEventListener(`wheel`,this.onWheel,{passive:!1}),t.hasWheelListener=!0):!i&&t.hasWheelListener&&(e.removeEventListener(`wheel`,this.onWheel),t.hasWheelListener=!1)}applyStyle(e,t){let n=t.recognizers.filter(e=>e.isEnabled&&!t.unstyled.has(e)),r=n.length>0?jt(n):{};r.touchAction==null&&t.consumer?.keepsTouch!=null&&(r={...r,touchAction:`manipulation`});for(let n of Object.keys(Bt)){let i=Bt[n],a=r[n];if(n===`touchAction`&&(a=this.touchActionToWrite(e,t,a)),a!=null)t.savedStyle.has(i)||t.savedStyle.set(i,e.style.getPropertyValue(i)),e.style.setProperty(i,a);else if(t.savedStyle.has(i)){let n=t.savedStyle.get(i)??``;t.savedStyle.delete(i),n===``?e.style.removeProperty(i):e.style.setProperty(i,n)}}}touchActionToWrite(e,t,n){if(n==null){Rt(e),t.authorTouchAction=null;return}let r=Bt.touchAction,i=t.savedStyle.has(r)?t.savedStyle.get(r)??``:e.style.getPropertyValue(r);if(i!==``&&!Vt(i))return Rt(e),Nt(n,i);if(!It(e,n)){this.readCallerTouchActionInNextFrame(e);return}let a=t.authorTouchAction;if(a==null||a.derived!==n){this.readCallerTouchActionInNextFrame(e);return}if(a.author==null)return;let o=Nt(n,a.author);return o===a.author?void 0:o}readCallerTouchActionInNextFrame(e){this.pendingCallerReads.add(e),!this.isCallerReadScheduled&&(this.isCallerReadScheduled=!0,this.cancelCallerRead=Ut(this.doc.defaultView,()=>{this.isCallerReadScheduled=!1,this.cancelCallerRead=null;let e=[];for(let t of this.pendingCallerReads){let n=this.registry.get(t);n!=null&&e.push([t,n])}this.pendingCallerReads.clear();let t=this.doc.defaultView;for(let[n,r]of e){let e=n.getAttribute(q);if(e==null||t==null)continue;let i=t.getComputedStyle(n).touchAction||`auto`;r.authorTouchAction={derived:e,author:i===e?null:i}}for(let[t,n]of e)this.applyStyle(t,n)}))}cleanup(e,t){t.recognizers.length>0||t.consumer!=null?this.syncListeners():(t.hasTouchEndListener&&=(e.removeEventListener(`touchend`,this.onClaimedTouchEnd),!1),t.hasTouchMoveListener&&e.removeEventListener(`touchmove`,this.onBlockingTouchMove),t.hasWheelListener&&e.removeEventListener(`wheel`,this.onWheel),this.registry.delete(e),this.uninstallIfIdle())}syncListeners(){this.syncLayoutWatch(),this.syncArmed(),this.shouldListen()?(this.install(),this.syncClaimingListeners()):this.uninstall(),this.syncMoverBlocking()}syncMoverBlocking(){let e=this.isInstalled&&this.hitTestsLayout();e&&this.stopWatchingMovers==null?this.stopWatchingMovers=pe(()=>this.syncMoverBlocking()):!e&&this.stopWatchingMovers!=null&&(this.stopWatchingMovers(),this.stopWatchingMovers=null);let t=e&&j().some(e=>this.hasClaimingRecognizerAround(e));if(t===(this.stopBlockingForMovers!=null))return;let n=this.doc.defaultView;t&&n!=null?this.stopBlockingForMovers=T(n,`touchmove`,this.onBlockingTouchMove,{cancels:!0}):t||(this.stopBlockingForMovers?.(),this.stopBlockingForMovers=null)}hasClaimingRecognizerAround(e){if(!e.isConnected||e.ownerDocument!==this.doc)return!1;for(let[t,n]of this.registry)if((w(e,t)||w(t,e))&&n.recognizers.some(e=>e.isEnabled&&Gt(e)))return!0;return!1}syncArmed(){let e=new Set;if(!this.isCoarse)for(let[t,n]of this.registry){let r=n.consumer;(n.recognizers.some(e=>e.isEnabled&&(e.allowedPointerTypes==null||e.allowedPointerTypes.size>0))||r!=null&&r.isEnabled?.()!==!1)&&e.add(t)}for(let[t,n]of this.armedElements)e.has(t)||(n(),this.armedElements.delete(t));for(let t of e)this.armedElements.has(t)||(t.addEventListener(`pointerdown`,this.onArmedPress,Wt),this.armedElements.set(t,()=>{t.removeEventListener(`pointerdown`,this.onArmedPress,Wt)}));e.size===0&&this.isArmedPress&&(this.isArmedPress=!1,this.syncKeptPresses())}onArmedPress=e=>{let t=e;this.isInstalled||!$t(t.pointerType)||t.pointerType!==`touch`&&!zt(t)||(this.isArmedPress=!0,this.syncKeptPresses(),this.install(),t.pointerType!==`mouse`&&this.syncClaimingListeners(),this.onPointerDown(t))};syncKeptPresses(){for(let[e,t]of this.registry)t.consumer?.keepsTouch!=null&&this.syncTouchMoveListener(e,t)}dropCancelledLifts(e){let t=e.pointerType===`touch`&&e.isPrimary===!1;for(let[n,r]of[...this.cancelledPointers])(n===e.pointerId||!(t&&r===`touch`))&&this.cancelledPointers.delete(n)}releaseArmedPress(){this.isArmedPress&&queueMicrotask(()=>{this.isArmedPress&&this.arena.touches.length===0&&this.cancelledPointers.size===0&&(this.isArmedPress=!1,this.syncKeptPresses(),this.syncListeners())})}uninstallIfIdle(){this.syncListeners(),this.registry.size===0&&this.retainers===0&&(this.uninstall(),this.stopWatchingPointer?.(),this.stopWatchingPointer=null,this.releaseWhenIdle())}releaseWhenIdle(){queueMicrotask(()=>{if(!(this.registry.size>0||this.retainers>0)){this.cancelledFingers.clear(),this.cancelledPointers.clear(),this.clearClaimedLifts(),this.cancelCallerRead?.(),this.cancelCallerRead=null,this.isCallerReadScheduled=!1,this.pendingCallerReads.clear();for(let e of this.ownScrollFrames.values())e();this.ownScrollFrames.clear(),this.ownedScrolls.clear();for(let e of[...this.dragHolds])e({isCancel:!0});this.pressSelections.clear(),this.selectingContacts.clear()}})}watchPointer(){if(this.stopWatchingPointer!=null)return;let e=this.doc.defaultView;this.isCoarse=this.isPrimaryPointerCoarse(),this.stopWatchingPointer=this.followsPointer?o(e,e=>this.pointerChanged(e)):()=>{}}pointerChanged(e){if(e!==this.isCoarse){this.isCoarse=e,e||this.cancelEverything(this.arena.now());for(let[e,t]of this.registry)this.refresh(e,t);this.syncListeners()}}hasClaimer(){for(let e of this.registry.values()){let t=e.consumer;if(t!=null&&t.isEnabled?.()!==!1||e.recognizers.some(e=>e.isEnabled&&e.claimsTouches&&Kt(e)))return!0}return!1}syncClaimingListeners(){if(!this.isInstalled)return;let e=this.hasClaimer();if(e===this.isClaimingInstalled)return;let t=this.doc.defaultView;for(let e of this.claimingUnsubscribers.splice(0))e();t!=null&&(this.inputMode===`auto`&&this.claimingUnsubscribers.push(T(t,`touchend`,this.onTouchEnd,{cancels:e})),e&&this.claimingUnsubscribers.push(T(t,`contextmenu`,this.onContextMenu,{cancels:!0}))),this.isClaimingInstalled=e}shouldListen(){if(!this.needsInput())return!1;if(this.isCoarse&&this.retainers>0)return!0;let e=!1;for(let t of this.registry.values()){let n=t.consumer;if(n!=null&&n.isEnabled?.()!==!1||t.recognizers.some(e=>e.isEnabled)){e=!0;break}}return e&&(this.isCoarse||this.isArmedPress)}install(){if(this.watchPointer(),!this.needsInput()||this.isInstalled)return;let e=this.doc.defaultView;this.isInstalled=!0,this.usesTouchEvents=this.inputMode===`auto`&&e!=null&&`ontouchstart`in e,e!=null&&(this.unsubscribers=[...this.inputMode===`auto`?[T(e,`touchstart`,this.onTouchStart),T(e,`touchmove`,this.onTouchMove),T(e,`touchcancel`,this.onTouchCancel)]:[],T(e,`pointerdown`,this.onPointerDown),T(e,`pointermove`,this.onPointerMove),T(e,`pointerup`,this.onPointerUp),T(e,`pointercancel`,this.onPointerCancel),T(e,`scroll`,this.onScroll),T(e,`visibilitychange`,this.onVisibilityChange),T(e,`blur`,e=>{S(e.target)||this.onBlur()})],this.isClaimingInstalled=!1,this.claimingUnsubscribers=this.inputMode===`auto`?[T(e,`touchend`,this.onTouchEnd)]:[])}uninstall(){if(this.isInstalled){this.isInstalled=!1,this.fingerTargets=[],this.isClaimingInstalled=!1;for(let e of[...this.unsubscribers.splice(0),...this.claimingUnsubscribers.splice(0)])e();this.cancelEverything(this.arena.now()),this.lastTouch=null,this.lastScroll=null}}participantsAt(e,t){let n=[],r=null,i=null;if(S(e)&&(ue(e)||[...this.touchGates].some(t=>t(e))))return{recognizers:n,consumer:r,consumerElement:i};let a=t==null;for(let o=S(e)?e:null;o!=null;o=O(o)){if(!x(o))continue;let e=this.registry.get(o);e!=null&&n.push(...e.recognizers),!(a||t==null)&&e?.consumer!=null&&(r=e.consumer,i=o,a=!0)}return{recognizers:n,consumer:r,consumerElement:i}}lockSelection(e,t,n,r,i){let a=(e,t)=>{let n=this.registry.get(e);return n?.manageStyle!==!1&&(t==null||n?.unstyled.has(t)!==!0)},o=new Map;for(let e of t){let t=e.selectionLock;if(t!=null&&x(e.view)&&a(e.view,e)){let n=o.get(t)??new Set;n.add(e.view),o.set(t,n)}}let s=r?.selectionLock;if(s!=null&&i!=null&&a(i)){let e=o.get(s)??new Set;e.add(i),o.set(s,e)}if(o.size>0){let t=[...o].map(([e,t])=>e(t,n));this.lockedBy.set(e,()=>{for(let e of t)e()})}}onWheel=e=>{let t=e;if(this.wheelsSeen.has(t))return;this.wheelsSeen.add(t);let n=Q(t),r=t.ctrlKey?`pinch`:`pan`,i=this.wheel;if(i!=null&&(i.kind!==r||n-i.last>=i.endMs)&&(this.endWheel(n),i=null),i!=null&&i.ids.length>0&&i.follow?.lifted!==!0&&!this.wheelHasTaker(i)){this.endWheel(i.last);let e=dn(t,this.doc.defaultView);i={kind:r,scrollType:Z(t),ids:[],x:t.clientX,y:t.clientY,span:an,last:n,endMs:on(r,Z(t),Math.abs(e.dx)>Math.abs(e.dy)),timer:null,takers:[]},this.wheel=i}let{dx:a,dy:o}=dn(t,this.doc.defaultView),s=Math.abs(a)>Math.abs(o),c=null;if(r===`pan`?c=this.segmenter.push(n,s?a:o,s?nn:tn,Z(t)===`continuous`):this.segmenter.end(),this.wheelSegment=c,c?.boundary!=null&&i!=null&&(this.endWheel(n),i=null),c!=null&&c.carried!==0&&(s?a+=c.carried:o+=c.carried),i??(i=this.beginWheel(t,r,a,o,n),this.wheel=i,i.ids.length>0&&this.latchWheel()),i.last=n,i.timer!=null&&this.clock.clearTimeout(i.timer),i.timer=this.clock.setTimeout(()=>{this.segmenter.end(),this.endWheel()},i.endMs),i.ids.length!==0){if(t.preventDefault(),i.kind===`pan`&&i.follow){let e=i.follow;if(e.lifted)return;if(this.wheelSegment?.liftNow===!0){this.followProvisionally(i,e,n),e.lifted=!0,this.arena.ended([{id:i.ids[0],x:i.x,y:i.y,time:n}]);return}if(this.wheelSegment?.decaying===!0){if(e.heldX+=a,e.heldY+=o,this.wheelSegment.bunched){let t=n-e.lastMove,r=e.speedX,i=e.speedY;cn(e,e.trueX-e.heldX,e.trueY-e.heldY),e.baseX+=(r-e.speedX)*t,e.baseY+=(i-e.speedY)*t}else e.readSpan=0;this.followProvisionally(i,e,n);return}let t=e.trueX-e.heldX,r=e.trueY-e.heldY,s=sn(i.x-t,a),c=sn(i.y-r,o),l=t-a,u=r-o,d=n-e.lastMove;this.wheelSegment?.bunched===!0?cn(e,l,u):d>0&&(e.priorSpeedX=e.speedX,e.priorSpeedY=e.speedY,e.readFromX=e.trueX,e.readFromY=e.trueY,e.readSpan=d,e.speedX=(l-e.trueX)/d,e.speedY=(u-e.trueY)/d),e.trueX=l,e.trueY=u,e.heldX=0,e.heldY=0,e.lastMove=n,i.x=l+s,i.y=u+c,e.baseX=i.x,e.baseY=i.y,this.arena.moved([{id:i.ids[0],x:i.x,y:i.y,time:n}])}else i.kind===`pan`?(i.x-=a,i.y-=o,this.arena.moved([{id:i.ids[0],x:i.x,y:i.y,time:n}])):(i.span*=Math.exp(-o/100),this.arena.moved(this.pinchContacts(i,n)))}};followProvisionally(e,t,n){let r=Math.max(0,n-t.lastMove),i=t.baseX+t.speedX*r,a=t.baseY+t.speedY*r;(i!==e.x||a!==e.y)&&(e.x=i,e.y=a,this.arena.moved([{id:e.ids[0],x:i,y:a,time:n}]))}beginWheel(e,t,n,r,i){let a=Z(e),o=Math.abs(n)>Math.abs(r),s={kind:t,scrollType:a,ids:[],x:e.clientX,y:e.clientY,span:an,last:i,endMs:on(t,a,o),timer:null,takers:[]};if(this.arena.touches.length>0||n===0&&r===0||e.defaultPrevented||!e.cancelable)return s;let c=X(e),l=A(c,{readsTouchAction:!1}),u=[];for(let e=S(c)?c:null;e!=null;e=O(e))if(x(e))for(let i of this.registry.get(e)?.recognizers??[])i.isEnabled&&i.claimsTouches&&i.allowedScrollTypes.has(a)&&G(i).family===t&&(t!==`pan`||a===`continuous`)&&(t===`pan`&&(!pn(i,-n,-r)||this.scrollerTakes(c,e,n,r,o,this.keepsAxis(e,o))||fn(i)&&l.canScroll(-n,-r))||u.push(i));if(u.length===0)return s;let d={pointerType:`mouse`,target:c,scroll:l,scrollType:a,recognizers:u,consumer:null},f=t===`pan`?[this.nextId++]:[this.nextId++,this.nextId++],p={...s,ids:f,takers:u};return t===`pan`&&a===`continuous`&&(p.follow={lifted:!1,heldX:0,heldY:0,lastMove:i,trueX:s.x,trueY:s.y,baseX:s.x,baseY:s.y,speedX:0,speedY:0,readFromX:s.x,readFromY:s.y,readSpan:0,priorSpeedX:0,priorSpeedY:0}),this.arena.began(t===`pan`?[{...d,id:f[0],x:e.clientX,y:e.clientY,time:i}]:this.pinchContacts(p,i).map(e=>({...d,...e}))),f.every(e=>this.arena.participantsOf(e).length===0)?(this.arena.cancelled(f,i),s):p}scrollerTakes(e,t,n,r,i,a){for(let o=S(e)?e:null;o!=null&&!(o===t&&a);o=O(o)){if(x(o)&&fe(o,i?-n:0,i?0:-r))return!0;if(o===t)break}return!1}keepsAxis(e,t){let n=this.registry.get(e);if(n==null||!n.manageStyle)return!1;let r=n.recognizers.filter(e=>e.isEnabled&&!n.unstyled.has(e)),i=r.length>0?jt(r).touchAction:void 0;if(i==null)return!1;let a=E(i);return t?!a.x:!a.y}pinchContacts(e,t){return[{id:e.ids[0],x:e.x-e.span/2,y:e.y,time:t},{id:e.ids[1],x:e.x+e.span/2,y:e.y,time:t}]}wheelHasTaker(e){return e.takers.some(e=>{let{state:t}=e;return e.isEnabled&&(t===`began`||t===`changed`||t===`possible`&&e.isInvolved())})}latchWheel(){let e=this.doc.defaultView;if(this.stopWheelLatch==null&&e!=null){let t=()=>{let e=this.dropDrivenWheel();e.length>0&&this.arena.cancelled(e,this.arena.now())},n=[T(e,`wheel`,this.onWheel,{cancels:!0}),T(e,`blur`,e=>{S(e.target)||t()}),T(e,`visibilitychange`,()=>{this.doc.visibilityState===`hidden`&&t()})];this.stopWheelLatch=()=>{for(let e of n)e()}}}lockClaimedDrags(e,t){for(let n of e){if(this.claimHolds.has(n))continue;let e=this.arena.touches.find(e=>e.id===n);if(e==null||e.pointerType===`touch`||e.scrollType!=null||e.phase===`ended`||e.phase===`cancelled`)continue;let r=new Set;for(let e of this.arena.participantsOf(n))(e.state===`began`||e.state===`changed`)&&e.view?.nodeType===1&&r.add(e.view);if(t.view?.nodeType===1&&r.add(t.view),r.size===0)continue;let i=ne(r,this.doc.defaultView,this.pressSelections.get(n)??[],()=>{this.dragHolds.delete(i)});this.dragHolds.add(i),this.lockedBy.has(n)||this.lockedBy.set(n,i),this.claimHolds.set(n,i)}}releaseClaimedDrags(e){for(let t of e){let e=this.claimHolds.get(t);e!=null&&(this.claimHolds.delete(t),this.lockedBy.get(t)===e&&this.lockedBy.delete(t),e({isCancel:!0}))}}dropDrivenWheel(){let e=this.wheel;if(e==null||e.kind!==`pan`||e.ids.length===0||e.follow?.lifted===!0)return[];let t={...e,ids:[],takers:[]};return delete t.follow,this.wheel=t,this.stopWheelLatch?.(),this.stopWheelLatch=null,e.ids}endWheel(e){let t=this.wheel;if(this.stopWheelLatch?.(),this.stopWheelLatch=null,t==null||(this.wheel=null,t.timer!=null&&this.clock.clearTimeout(t.timer),t.ids.length===0||t.follow?.lifted))return;if(t.follow!=null){let e=t.follow,n=un(t.x,e.trueX-e.heldX,e.speedX),r=un(t.y,e.trueY-e.heldY,e.speedY);(n!==t.x||r!==t.y)&&(t.x=n,t.y=r,this.arena.moved([{id:t.ids[0],x:n,y:r,time:t.last}]))}let n=t.last+t.endMs,r=e==null?n:Math.max(t.last,Math.min(n,e));this.arena.ended(t.kind===`pan`?[{id:t.ids[0],x:t.x,y:t.y,time:r}]:this.pinchContacts(t,r))}noteSelectingPress(e,t,n,r){!this.lockedBy.has(e)&&g(this.doc,t,n,r)&&this.selectingContacts.add(e)}unlockSelection(e,t=!1){let n=this.lockedBy.get(e);n?.({isCancel:t});let r=this.claimHolds.get(e);r!=null&&r!==n&&r({isCancel:t}),this.lockedBy.delete(e),this.claimHolds.delete(e),this.pressSelections.delete(e),this.selectingContacts.delete(e)}addTouchGate(e){return this.touchGates.add(e),()=>{this.touchGates.delete(e)}}fingersDown(){return this.fingerTargets.length}takeEvent(e){return!this.processed.has(e)&&(this.processed.add(e),!0)}onTouchStart=e=>{if(this.endWheel(Q(e)),this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;this.fingerTargets.length>1&&this.failUnclaimedLoneFingerPans();let t=Q(e),n=[],r=[],i=[],a=[];for(let o of $(e.changedTouches)){if(o.touchType===`stylus`)continue;this.cancelledFingers.delete(o.identifier);let s=this.forgetFinger(o.identifier);s!=null&&i.push(s);let c=S(o.target)?X(e,o.target):X(e),l=this.presentedTarget(c,o.clientX,o.clientY,e.timeStamp),{recognizers:u,consumer:d,consumerElement:p}=this.participantsAt(l,`touch`);if(u.length===0&&d==null){r.push({id:this.nextId++,x:o.clientX,y:o.clientY,time:t,pointerType:`touch`,target:l});continue}let m=this.nextId++;this.touchIds.set(o.identifier,m),f(`touch`)&&a.push({id:m,target:l,consumerElement:p}),this.watchTarget(o.identifier,c,u.some(e=>e.isEnabled&&Gt(e))||d?.keepsTouch!=null&&d.isEnabled?.()!==!1,d!=null&&d.isEnabled?.()!==!1||u.some(e=>e.isEnabled&&e.claimsTouches)),this.lastFed.set(m,{x:o.clientX,y:o.clientY,time:t}),this.pairTouch(m,{x:o.clientX,y:o.clientY,target:c}),l!==c&&l!=null&&this.retargeted.set(m,{x:o.clientX,y:o.clientY,target:l}),n.push({id:m,x:o.clientX,y:o.clientY,time:t,pointerType:`touch`,target:l,scroll:A(l),recognizers:u,consumer:d})}i.length>0&&this.arena.cancelled(i,t),this.arena.began(n);for(let{id:e,target:t,consumerElement:n}of a)this.lockSelection(e,this.arena.participantsOf(e),t,this.arena.consumerOf(e)??null,n);for(let e of r)this.arena.untrackedBegan(e);this.fingerTargets.length>1&&!this.isFingerClaimed()&&this.failUnclaimedLoneFingerPans();let o=X(e);S(o)&&(this.lastTouch={target:o,time:t})};onTouchMove=e=>{if(this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;this.dropFingersNotDown(e);let t=Q(e),n=[],r=[];for(let i of $(e.changedTouches)){let e=this.touchIds.get(i.identifier);e!=null&&(n.push(e),r.push({id:e,x:i.clientX,y:i.clientY,time:t}))}if(r.length!==0){if(!e.cancelable){let e=new Map(r.map(e=>[e.id,e])),i=n.filter(t=>{let n=this.arena.getTouch(t);if(n==null||n.takenByBrowser||this.arena.isClaimed(t)||n.scroll?.allowsNativePan===!1||this.judgedUncancelable.has(t))return!1;this.judgedUncancelable.add(t);let r=e.get(t);if(r==null||n.scroll==null)return!0;let i=r.x-n.startX,a=r.y-n.startY;return Math.abs(i)>=Math.abs(a)?n.scroll.canScroll(i,0):n.scroll.canScroll(0,a)});i.length>0&&this.browserTook(i,t)}this.feedMoves(r.filter(e=>!this.pointerFed.has(e.id)))}};onBlockingTouchMove=e=>{this.cancelIfClaimed(e)};pointerFingerAt(e){let t=null,n=1/0;for(let r of this.arena.touches){if(r.pointerType!==`touch`||r.phase===`ended`||r.phase===`cancelled`||!S(r.target)||!S(e.target)||!(w(r.target,e.target)||w(e.target,r.target)))continue;let i=Math.hypot(r.x-e.clientX,r.y-e.clientY);i<n&&(t=r,n=i)}return t?.id}onClaimedTouchEnd=e=>{let t=e,n=Q(t);for(let e=this.claimedLifts.length-1;e>=0;e--)n-this.claimedLifts[e].time>Xt&&this.claimedLifts.splice(e,1);if(t.cancelable&&!t.defaultPrevented)for(let e of $(t.changedTouches)){let n=this.claimedLifts.findIndex(n=>Qt(n,{x:e.clientX,y:e.clientY,target:X(t,e.target)}));if(n>=0){this.claimedLifts.splice(n,1),this.claimedLifts.length===0&&this.clearClaimedLifts(),t.preventDefault();return}}};cancelIfClaimed(e){if(!e.cancelable||e.defaultPrevented)return;let t=$(e.changedTouches);for(let n of t){let t=this.touchIds.get(n.identifier)??(this.usesTouchEvents?void 0:this.pointerFingerAt(n));if(t!=null&&(this.arena.isClaimed(t)||this.arena.consumerOf(t)?.keepsTouch?.(t)===!0||e.touches.length===1&&this.arena.participantsOf(t).some(e=>G(e).keepsTouch(t)))){e.preventDefault();return}}if(Yt(e)){for(let t of this.pointerIds.values())if(this.arena.isClaimed(t)){e.preventDefault();return}}}onTouchEnd=e=>{if(this.releaseArmedPress(),this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;this.dropFingersNotDown(e);let t=Q(e),n=[],r=[],i=!1;for(let a of $(e.changedTouches)){if(this.cancelledFingers.delete(a.identifier)){i=!0;continue}let e=this.touchIds.get(a.identifier),o=e==null?void 0:this.retargeted.get(e),s=this.forgetFinger(a.identifier);s!=null&&(n.push({id:s,x:a.clientX,y:a.clientY,time:t}),o!=null&&r.push({id:s,landed:o,x:a.clientX,y:a.clientY}))}let a=X(e);S(a)&&(this.lastTouch={target:a,time:t});let o=n.length>0?this.arena.ended(n):new Map,s=i||hn(o);for(let e of r)this.clickRetargetedTap(e.landed,e,o.get(e.id),`touch`)&&(s=!0);s&&(e.cancelable&&e.preventDefault(),p(this.doc,{takesLateMouse:!0}))};clickRetargetedTap(e,t,n,r){return e==null||n!==`allow`||Math.hypot(t.x-e.x,t.y-e.y)>Le.allowableMovement.value?!1:(this.clickRetargeted(e.target,t.x,t.y,r),!0)}onTouchCancel=e=>{if(this.releaseArmedPress(),this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;let t=$(e.changedTouches),n=t.length>0?t.map(e=>e.identifier):[...this.touchIds.keys()];t.length===0&&this.cancelledFingers.clear();for(let e of n)this.cancelledFingers.delete(e);let r=[];for(let e of n){let t=this.forgetFinger(e);t!=null&&r.push(t)}r.length>0&&this.arena.cancelled(r,Q(e))};onTargetTouchMove=e=>{this.onTouchMove(e),this.cancelIfClaimed(e)};onTargetTouchMovePassive=e=>{this.onTouchMove(e)};onTargetTouchEnd=e=>{this.onTouchEnd(e)};onTargetTouchEndPassive=e=>{this.onTouchEnd(e)};onTargetTouchCancel=e=>{this.onTouchCancel(e)};dropFingersNotDown(e){if(e.touches==null||this.touchIds.size===0&&this.cancelledFingers.size===0)return;let t=new Set;for(let n of $(e.touches))t.add(n.identifier);for(let n of $(e.changedTouches))t.add(n.identifier);for(let e of[...this.cancelledFingers])t.has(e)||this.cancelledFingers.delete(e);let n=[...this.touchIds.keys()].filter(e=>!t.has(e)),r=[];for(let e of n){let t=this.forgetFinger(e);t!=null&&r.push(t)}r.length>0&&this.arena.cancelled(r,Q(e))}watchTarget(e,t,n,r){if(t==null||typeof t.addEventListener!=`function`)return;this.touchTargets.set(e,t);let i=this.watched.get(t);if(i==null){this.watched.set(t,{count:1,blocking:+!!n,claiming:+!!r}),n&&this.blockingFingers.add(e),r&&this.claimingFingers.add(e),t.addEventListener(`touchmove`,n?this.onTargetTouchMove:this.onTargetTouchMovePassive,{passive:!n}),t.addEventListener(`touchend`,r?this.onTargetTouchEnd:this.onTargetTouchEndPassive,{passive:!r}),t.addEventListener(`touchcancel`,this.onTargetTouchCancel,{passive:!0});return}let a=i.blocking>0,o=i.claiming>0;i.count+=1,n&&(i.blocking+=1,this.blockingFingers.add(e)),r&&(i.claiming+=1,this.claimingFingers.add(e)),this.swapTargetTouchMove(t,a,i.blocking>0),this.swapTargetTouchEnd(t,o,i.claiming>0)}unwatchTarget(e){let t=this.touchTargets.get(e);if(t==null)return;this.touchTargets.delete(e);let n=this.watched.get(t);if(n==null)return;let r=n.blocking>0,i=n.claiming>0;--n.count,this.blockingFingers.delete(e)&&--n.blocking,this.claimingFingers.delete(e)&&--n.claiming,n.count>0?(this.swapTargetTouchMove(t,r,n.blocking>0),this.swapTargetTouchEnd(t,i,n.claiming>0)):(this.watched.delete(t),t.removeEventListener(`touchmove`,r?this.onTargetTouchMove:this.onTargetTouchMovePassive),t.removeEventListener(`touchend`,i?this.onTargetTouchEnd:this.onTargetTouchEndPassive),t.removeEventListener(`touchcancel`,this.onTargetTouchCancel))}swapTargetTouchMove(e,t,n){t!==n&&(e.removeEventListener(`touchmove`,t?this.onTargetTouchMove:this.onTargetTouchMovePassive),e.addEventListener(`touchmove`,n?this.onTargetTouchMove:this.onTargetTouchMovePassive,{passive:!n}))}swapTargetTouchEnd(e,t,n){t!==n&&(e.removeEventListener(`touchend`,t?this.onTargetTouchEnd:this.onTargetTouchEndPassive),e.addEventListener(`touchend`,n?this.onTargetTouchEnd:this.onTargetTouchEndPassive,{passive:!n}))}forgetFinger(e){let t=this.touchIds.get(e);return this.touchIds.delete(e),this.unwatchTarget(e),t!=null&&this.forgetContact(t),t}pairTouch(e,t){for(let[n,r]of this.pendingPointers)if(Qt(r,t)){this.pendingPointers.delete(n),this.fingerPointers.set(n,e),this.pointerFed.add(e);return}this.unpairedTouches.set(e,t)}pairPointer(e,t){for(let[n,r]of this.unpairedTouches)if(Qt(r,t)){this.unpairedTouches.delete(n),this.fingerPointers.set(e,n),this.pointerFed.add(n);return}this.pendingPointers.set(e,t)}feedMoves(e){let t=e.filter(e=>{let t=this.lastFed.get(e.id);return t!=null&&e.time<t.time?!1:(this.lastFed.set(e.id,{x:e.x,y:e.y,time:e.time}),!0)});t.length>0&&this.arena.moved(t)}forgetContact(e){this.unlockSelection(e),this.retargeted.delete(e),this.lastFed.delete(e),this.pointerFed.delete(e),this.judgedUncancelable.delete(e),this.unpairedTouches.delete(e);for(let[t,n]of this.fingerPointers)n===e&&this.fingerPointers.delete(t)}onPointerDown=e=>{if(this.endWheel(Q(e)),m(this.doc),!$t(e.pointerType))return;if(this.dropCancelledLifts(e),e.pointerType===`touch`&&this.usesTouchEvents){this.pairPointer(e.pointerId,{x:e.clientX,y:e.clientY,target:X(e)});return}if(e.pointerType===`touch`&&e.isPrimary===!1&&this.failUnclaimedLoneFingerPans(),e.pointerType!==`touch`&&!zt(e))return;let t=X(e),n=this.presentedTarget(t,e.clientX,e.clientY,e.timeStamp),{recognizers:r,consumer:i,consumerElement:a}=this.participantsAt(n,e.pointerType);if(r.length===0&&i==null)return;let o=this.nextId++;this.pointerIds.set(e.pointerId,o),this.pointerKinds.set(e.pointerId,e.pointerType),n!==t&&n!=null&&this.retargeted.set(o,{x:e.clientX,y:e.clientY,target:n}),e.pointerType!==`touch`&&this.pressSelections.set(o,te(this.doc.defaultView)),this.arena.began([{id:o,x:e.clientX,y:e.clientY,time:Q(e),pointerType:e.pointerType,target:n,scroll:A(n),recognizers:r,consumer:i}]),e.pointerType===`touch`&&e.isPrimary===!1&&!this.isFingerClaimed()&&this.failUnclaimedLoneFingerPans(),f(e.pointerType)&&this.lockSelection(o,this.arena.participantsOf(o),n,this.arena.consumerOf(o)??null,a),e.pointerType!==`touch`&&this.noteSelectingPress(o,e.clientX,e.clientY,t)};onPointerMove=e=>{if(e.pointerType===`touch`&&this.usesTouchEvents){let t=this.fingerPointers.get(e.pointerId);t!=null&&this.feedMoves([{id:t,x:e.clientX,y:e.clientY,time:Q(e),history:gn(e)}]);return}let t=this.pointerIds.get(e.pointerId);t!=null&&this.arena.moved([{id:t,x:e.clientX,y:e.clientY,time:Q(e),history:gn(e)}])};onPointerUp=e=>{if(this.releaseArmedPress(),e.pointerType===`touch`&&this.usesTouchEvents){this.fingerPointers.delete(e.pointerId),this.pendingPointers.delete(e.pointerId);return}let t=this.pointerIds.get(e.pointerId);if(t==null){this.cancelledPointers.delete(e.pointerId)&&this.refuseCancelledLift(e);return}this.pointerIds.delete(e.pointerId),this.pointerKinds.delete(e.pointerId);let n=this.claimHolds.get(t);this.unlockSelection(t);let r=this.arena.ended([{id:t,x:e.clientX,y:e.clientY,time:Q(e)}]);n?.keepLiftSelection();let i=this.retargeted.get(t);this.retargeted.delete(t);let a=this.clickRetargetedTap(i,{x:e.clientX,y:e.clientY},r.get(t),e.pointerType);!a&&hn(r)&&p(this.doc,{takesLateMouse:e.pointerType===`touch`}),e.pointerType===`touch`&&(a||hn(r))&&this.noteClaimedLift(e)};noteClaimedLift(e){this.readsFingersFromPointerEvents()&&(this.isCoarse||this.sendsTouchEvents())&&(this.claimedLifts.push({x:e.clientX,y:e.clientY,target:X(e),time:Q(e)}),this.claimedLifts.length>Zt&&this.claimedLifts.shift(),this.armClaimedLiftTimer())}armClaimedLiftTimer(){if(this.claimedLiftTimer!=null||this.claimedLifts.length===0)return;let e=this.claimedLifts[0].time+Xt;this.claimedLiftTimer=this.clock.setTimeout(()=>{this.claimedLiftTimer=null;let e=this.clock.now();for(let t=this.claimedLifts.length-1;t>=0;t--)e-this.claimedLifts[t].time>=Xt&&this.claimedLifts.splice(t,1);this.armClaimedLiftTimer()},Math.max(0,e-this.clock.now()))}clearClaimedLifts(){this.claimedLifts.length=0,this.claimedLiftTimer!=null&&(this.clock.clearTimeout(this.claimedLiftTimer),this.claimedLiftTimer=null)}onPointerCancel=e=>{if(this.releaseArmedPress(),e.pointerType===`touch`&&this.usesTouchEvents){let t=this.fingerPointers.get(e.pointerId)??this.touchForCancelledPointer(e);this.fingerPointers.delete(e.pointerId),this.pendingPointers.delete(e.pointerId),t!=null&&(this.pointerFed.delete(t),this.browserTook([t],Q(e)));return}this.cancelledPointers.delete(e.pointerId);let t=this.pointerIds.get(e.pointerId);t!=null&&(this.pointerIds.delete(e.pointerId),this.pointerKinds.delete(e.pointerId),this.unlockSelection(t,!0),this.retargeted.delete(t),this.arena.cancelled([t],Q(e)))};touchForCancelledPointer(e){let t=null,n=1/0;for(let r of this.arena.touches){if(r.pointerType!==`touch`||r.phase===`ended`||r.phase===`cancelled`||r.target!==X(e))continue;let i=Math.hypot(r.x-e.clientX,r.y-e.clientY);i<n&&(t=r,n=i)}return t==null?this.touchIds.get(e.pointerId)??null:t.id}replayClick(e,t){if(!t)return;m(this.doc);let n=e.target,r=this.doc.defaultView;x(n)&&n.isConnected&&r!=null&&v(()=>n.dispatchEvent(new r.MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:1,clientX:e.x,clientY:e.y})))}onContextMenu=e=>{for(let t of this.arena.touches)if(this.arena.isClaimed(t.id)||this.arena.consumerOf(t.id)?.holdsContextMenu?.(t.id)===!0){e.preventDefault();return}};ownScroll(e){let t=++this.ownScrollCalls;this.ownedScrolls.set(e,t);let n=this.doc.defaultView;if(n==null)return;this.ownScrollFrames.get(e)?.();let r=0,i=n.requestAnimationFrame(()=>{r=n.requestAnimationFrame(()=>{this.ownScrollFrames.delete(e),this.ownedScrolls.get(e)===t&&this.ownedScrolls.delete(e)})});this.ownScrollFrames.set(e,()=>{n.cancelAnimationFrame(i),r!==0&&n.cancelAnimationFrame(r)})}isOwnScroll(e){return this.ownedScrolls.has(e)}onScroll=e=>{let t=Q(e),n=e.target===this.doc?this.doc:e.target;if(!S(n)||this.ownedScrolls.has(n))return;let r=this.lastTouch;r!=null&&t-r.time<R.momentumMemory.value&&w(n,r.target)&&(this.lastScroll={scroller:n,time:t});let i=[];for(let e of this.arena.touches)e.takenByBrowser||e.phase===`ended`||e.phase===`cancelled`||e.pointerType!==`touch`||this.arena.isClaimed(e.id)||S(e.target)&&w(n,e.target)&&Math.hypot(e.x-e.startX,e.y-e.startY)>=R.slop.value&&i.push(e.id);i.length>0&&this.browserTook(i,t)};noteFingersDown(e){let t=[];for(let n of $(e.touches))n.touchType!==`stylus`&&S(n.target)&&t.push(n.target);this.fingerTargets=t;for(let e of[...this.fingerListeners])e()}failUnclaimedLoneFingerPans(){for(let e of[...this.arena.involvedRecognizers])qt(e)&&e.state===`possible`&&e.maximumNumberOfTouches===1&&e.trackedTouches.length>0&&e.trackedTouches.every(e=>e.pointerType===`touch`&&!this.arena.isClaimed(e.id))&&e.cancel()}isFingerClaimed(){return this.arena.touches.some(e=>e.pointerType===`touch`&&this.arena.isClaimed(e.id))}onVisibilityChange=()=>{this.doc.visibilityState===`hidden`&&(this.cancelEverything(this.arena.now()),this.releaseArmedPress())};onBlur=()=>{this.cancelEverything(this.arena.now()),this.releaseArmedPress()};sendsTouchEvents(){let e=this.doc.defaultView;return e!=null&&`ontouchstart`in e}readsFingersFromPointerEvents(){let e=this.doc.defaultView;return this.inputMode===`pointer-events`||e!=null&&!(`ontouchstart`in e)}refuseCancelledLift(e){p(this.doc,{takesLateMouse:e.pointerType===`touch`}),e.pointerType===`touch`&&this.noteClaimedLift(e)}cancelEverything(e){for(let[e,t]of this.pointerKinds)t!==`mouse`&&this.cancelledPointers.set(e,t);let t=[...this.pointerIds.values()];for(let e of t)this.unlockSelection(e,!0);for(let e of[...this.touchIds.keys()]){this.cancelledFingers.add(e);let n=this.forgetFinger(e);n!=null&&t.push(n)}this.pointerIds.clear(),this.pointerKinds.clear(),this.retargeted.clear(),this.fingerPointers.clear(),this.pendingPointers.clear(),this.unpairedTouches.clear(),this.lastFed.clear(),this.pointerFed.clear(),t.push(...this.dropDrivenWheel()),t.length>0&&this.arena.cancelled(t,e)}};function hn(e){for(let t of e.values())if(t!==`allow`)return!0;return!1}function gn(e){return typeof e.getCoalescedEvents==`function`?e.getCoalescedEvents().slice(0,-1).map(e=>({x:e.clientX,y:e.clientY,time:Q(e)})):[]}function _n(e){let t=M.get(e);return t??(t=new mn(e),M.set(e,t)),t}var vn=0;function yn(e){vn+=1;try{return e()}finally{--vn}}function bn(){return vn>0}function xn(){let e=(0,F.useRef)(!1);return h(()=>(e.current=!1,()=>{e.current=!0}),[]),e}function Sn(e,t){let{arena:n}=G(e);n==null?t():n.deferResolution(t)}function Cn(e,t,n,r={}){let[i]=(0,F.useState)(t),a=(0,F.useRef)(n);h(()=>{a.current=n});let{isEnabled:o=!0,manageStyle:s=!0,perEventPointer:c=!1,actionGroup:l=!1}=r,u=xn();return(0,F.useEffect)(()=>i.addListener(e=>{!u.current&&!bn()&&a.current?.(e)}),[i,u]),h(()=>{yn(()=>{Sn(i,()=>{i.setEnabled(o)})})},[i,o]),N(e,e=>{if(!o)return()=>{};let t=_n(e.ownerDocument).attach(e,i,{manageStyle:s,perEventPointer:c,actionGroup:l});return()=>{yn(()=>Sn(i,t))}},`${s}:${c}:${o}:${l}`),i}export{De as A,Le as C,Ne as D,ke as E,ge as M,Pe as O,R as S,Fe as T,We as _,_n as a,ze as b,dt as c,tt as d,H as f,qe as g,Ye as h,xn as i,Ee as j,ve as k,st as l,Je as m,bn as n,Z as o,B as p,yn as r,zt as s,Cn as t,rt as u,Ke as v,Ie as w,Ve as x,Re as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";var n=e(t(),1);function r(e){return()=>{let t=e.withdraw;e.withdraw=null,t?.()}}function i(e,t){for(let{text:n,receipts:r}of e)for(let e of r)e.withdraw=t(n)}var a=`data-astryx-live-region`,o=`position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;inset-block-start:0;inset-inline-start:0;pointer-events:none;user-select:none;`,s=2e3,c={polite:null,assertive:null};function l(e){let t=c[e];t!=null&&(clearTimeout(t),c[e]=null)}var u={polite:null,assertive:null},d={polite:[],assertive:[]},f=null;function p(e){let t=u[e];t!=null&&(cancelAnimationFrame(t),u[e]=null),d[e]=[]}function m(e,t){l(e),c[e]=setTimeout(()=>{c[e]=null,t.textContent=``},s)}var h=null;function g(e){let t=document.createElement(`div`);return t.setAttribute(a,e),t.setAttribute(`aria-live`,e),t.setAttribute(`aria-atomic`,`true`),t.setAttribute(`role`,e===`assertive`?`alert`:`status`),t.style.cssText=o,document.body.appendChild(t),t}function _(){return typeof document>`u`?null:h?(h.polite.isConnected||document.body.appendChild(h.polite),h.assertive.isConnected||document.body.appendChild(h.assertive),h):(h={polite:g(`polite`),assertive:g(`assertive`)},h)}function v(e,t){let n=_();if(!n)return null;let r=t===`assertive`?n.assertive:n.polite,i=d[t].find(t=>t.text===e);if(i!=null)return i.holders+=1,f=i,()=>z(i,t);let a={text:e,holders:1};return d[t].push(a),f=a,u[t]??(r.textContent=``,u[t]=requestAnimationFrame(()=>{u[t]=null,r.textContent=d[t].map(e=>e.text).join(` `),d[t]=[]})),m(t,r),()=>z(a,t)}function y(e){if(p(e),l(e),!h)return;let t=e===`assertive`?h.assertive:h.polite;t.textContent=``}function b({hasReplace:e=!1}={}){let t=(0,n.use)(S),r=(0,n.useRef)(null);return(0,n.useCallback)((n,i=`polite`)=>{if(e){let e=r.current;r.current=null,e?.()}let a;t!=null&&C!=null?a=C.announce(t,n,i):n?a=v(n,i):(y(i),a=null),e&&(r.current=a)},[e,t])}var x=`data-astryx-modal-live-region`,S=(0,n.createContext)(null);S.displayName=`ModalAnnounceContext`;var C=null;function w(e){C=e}function T(e){return e!=null&&e.open&&e.matches(`:modal`)}function E(e){let t=e?.closest(`dialog`)??null;for(;t!=null;){if(T(t))return t;t=t.parentElement?.closest(`dialog`)??null}return null}function D(e,t,n=`polite`){return C==null?T(e)?F(e,t,n):v(t,n):C.announceInModal(e,t,n)}var O=new WeakMap;function k(e){e.frame!=null&&cancelAnimationFrame(e.frame),e.settleFrame!=null&&cancelAnimationFrame(e.settleFrame),e.timer!=null&&clearTimeout(e.timer)}function A(e){return M(e).map(e=>e.text)}function j(e){return e.messages.map(t=>({text:t,receipts:e.receipts.get(t)??[]}))}function M(e){let t=O.get(e);return t==null?[]:t.frame!=null||t.settleFrame!=null?j(t):[]}function N(e,t){return e.querySelector(`:scope > [${x}="${t}"]`)}function P(e,t){let n=N(e,t);return n??(n=document.createElement(`div`),n.setAttribute(x,t),n.setAttribute(`role`,t===`assertive`?`alert`:`status`),n.setAttribute(`aria-live`,t),n.setAttribute(`aria-atomic`,`true`),n.style.cssText=o,e.appendChild(n)),n}function F(e,t,n,i){let a=P(e,n),o=A(a),c=o.includes(t)?o:[...o,t],l=O.get(a),u=o.length>0&&l!=null?l.receipts:new Map,d={withdraw:null};u.set(t,[...u.get(t)??[],d]),l!=null&&k(l),a.textContent=``;let f={messages:c,receipts:u,frame:null,settleFrame:null,timer:null};return f.frame=requestAnimationFrame(()=>{f.frame=null,i!=null&&!i.isExposed()?(O.delete(a),i.redirect(j(f))):(a.textContent=f.messages.join(` `),f.settleFrame=requestAnimationFrame(()=>{f.settleFrame=null}),f.timer=setTimeout(()=>{a.textContent=``,O.delete(a)},s))}),O.set(a,f),d.withdraw=()=>I(a,t,d),r(d)}function I(e,t,n){let r=O.get(e);if(r==null||r.frame==null&&r.settleFrame==null)return;let i=r.receipts.get(t),a=i?.indexOf(n)??-1;i==null||a<0||(i.splice(a,1),!(i.length>0)&&(r.receipts.delete(t),r.messages=r.messages.filter(e=>e!==t),r.messages.length===0?(k(r),O.delete(e),e.textContent=``):r.frame??(e.textContent=r.messages.join(` `))))}function L(e,t){let n=N(e,t);if(n==null)return;let r=O.get(n);r!=null&&(k(r),O.delete(n)),n.textContent=``}function R(){let e=f;return f=null,e}function z(e,t){let n=d[t],r=n.indexOf(e);r<0||(--n[r].holders,n[r].holders<=0&&n.splice(r,1))}var B=()=>()=>{},V=()=>!1,H=()=>!0;function U(){return(0,n.useSyncExternalStore)(B,V,H)}export{F as _,L as a,i as c,T as d,N as f,z as g,b as h,v as i,r as l,M as m,S as n,y as o,R as p,D as r,E as s,U as t,w as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,l as n,r,u as i}from"./themeProps-Bo2jNkIC.js";import{T as a}from"./coarsePointer-B10KWVuz.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{A as s,D as c}from"./Icon-Cd9sDRzY.js";import{w as l}from"./useGestureRecognizer-C1yNE90T.js";import{d as u}from"./useTooltip-DQ4LKI-B.js";var d=e(t(),1),f={"@astryx.kbd.key.alt":`Alt`,"@astryx.kbd.key.backspace":`Backspace`,"@astryx.kbd.key.command":`Command`,"@astryx.kbd.key.control":`Control`,"@astryx.kbd.key.controlShort":`Ctrl`,"@astryx.kbd.key.down":`Down arrow`,"@astryx.kbd.key.enter":`Enter`,"@astryx.kbd.key.escape":`Escape`,"@astryx.kbd.key.escapeShort":`Esc`,"@astryx.kbd.key.left":`Left arrow`,"@astryx.kbd.key.plus":`Plus`,"@astryx.kbd.key.right":`Right arrow`,"@astryx.kbd.key.shift":`Shift`,"@astryx.kbd.key.tab":`Tab`,"@astryx.kbd.key.up":`Up arrow`,"@astryx.kbd.shortcut":`{shortcut} + {key}`},p=n();s(f);var m={wrapper:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xzye2dw`,kmuXW:`x2lah0s`,$$css:!0}},h=new Map([[`ctrl`,`⌃`],[`alt`,`⌥`],[`shift`,`⇧`],[`enter`,`↵`],[`backspace`,`⌫`],[`tab`,`⇥`],[`up`,`↑`],[`down`,`↓`],[`left`,`←`],[`right`,`→`],[`plus`,`+`]]),g=new Map([[`esc`,`escape`],[`return`,`enter`]]);function _(e,t,n){return e===`mod`?t?`⌘`:n(`@astryx.kbd.key.controlShort`):e===`escape`?n(`@astryx.kbd.key.escapeShort`):h.get(e)??e.toUpperCase()}var v=new Map([[`ctrl`,`@astryx.kbd.key.control`],[`alt`,`@astryx.kbd.key.alt`],[`shift`,`@astryx.kbd.key.shift`],[`enter`,`@astryx.kbd.key.enter`],[`backspace`,`@astryx.kbd.key.backspace`],[`escape`,`@astryx.kbd.key.escape`],[`tab`,`@astryx.kbd.key.tab`],[`up`,`@astryx.kbd.key.up`],[`down`,`@astryx.kbd.key.down`],[`left`,`@astryx.kbd.key.left`],[`right`,`@astryx.kbd.key.right`],[`plus`,`@astryx.kbd.key.plus`]]);function y(e,t,n){if(e===`mod`)return n(t?`@astryx.kbd.key.command`:`@astryx.kbd.key.control`);let r=v.get(e);return r?n(r):e.toUpperCase()}function b(){return()=>{}}function x(){return!1}function S({keys:e,ref:t,xstyle:n,className:a,style:s,...u}){let f=c(),h=(0,d.useSyncExternalStore)(b,l,x),v=new Map,S=e.split(`+`).map(e=>e.trim().toLowerCase()).map(e=>{let t=v.get(e)??0;return v.set(e,t+1),{key:g.get(e)??e,reactKey:`${e}:${t}`}}),C=S.map(({key:e})=>y(e,h,f)).reduce((e,t,n)=>n===0?t:f(`@astryx.kbd.shortcut`,{shortcut:e,key:t}),``);return(0,p.jsx)(`span`,{...u,ref:t,role:`img`,"aria-label":C,...o(r(`kbd`),i(m.wrapper,n),a,s),children:S.map(({key:e,reactKey:t})=>(0,p.jsx)(`kbd`,{"aria-hidden":`true`,className:`x3nfvp2 x6s0dn4 xl56j7k x16asifk x1grt7ep x1tn5z8q x7a5moj xx3sua9 x17x4s8c xlxy82 x1q0q8m5 xib2hle x1tgivj0 x9ynric x141an7d x1e4wzip x1ltkj2j x87ps6o`,children:_(e,h,f)},t))})}S.displayName=`Kbd`,s({"@astryx.keyboardHint.toNavigate":`to navigate`});var C=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`]),w={horizontal:[`left`,`right`],vertical:[`up`,`down`],both:[`left`,`right`,`up`,`down`]},T={hint:{kVAEAm:`xixxii4`,kpwlN0:`x1anvkwx`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`x1prclbq`,kaIpWk:`xh6dtrn`,kGVxlE:`x1i5ehqx`,kLKAdn:`xfsso4q`,kGO01o:`xy143xn`,kZCmMZ:`x12gdq22`,kwRFfy:`x1djylfy`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,kMwMTN:`xv1l7n4`,khDVqt:`xuxw1ft`,kSiTet:`xg01cxk xofkqq2`,k1ekBW:`xsm4mo9`,kIyJzY:`xx6bhzk`,kzIqYQ:`xd00j3c`,kfzvcC:`x47corl`,$$css:!0}};function E(e={}){let{orientation:t=`horizontal`,dismissAfterMs:n=3e3,isEnabled:r=!0}=e,i=c(),o=(0,d.useRef)(null),s=(0,d.useRef)(!1),l=(0,d.useRef)(!1),f=(0,d.useRef)(()=>{}),m=(0,d.useCallback)(()=>{o.current&&=(clearTimeout(o.current),null)},[]),h=(0,d.useCallback)(()=>{l.current=!0},[]),g=(0,d.useCallback)(()=>{l.current=!1,m(),f.current(null)},[m]),_=u({mode:`context`,onShow:h,onHide:g});f.current=_.ref;let v=(0,d.useCallback)(()=>{s.current=!0,m(),_.hide(),l.current=!1,f.current(null)},[m,_]),y=(0,d.useCallback)(e=>{!s.current&&r&&(f.current(e),_.show(),m(),o.current=setTimeout(()=>{v()},n))},[m,v,n,r,_]);(0,d.useEffect)(()=>()=>{m(),f.current(null)},[m]);let b=(0,d.useCallback)(e=>{if(s.current||!r)return;let t=e.target;if(!t.matches(`:focus-visible`))return;let n=e.currentTarget;n.contains(t)&&(e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||y(t))},[y,r]),x=(0,d.useCallback)(e=>{if(!l.current)return;let t=e.currentTarget;e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)?!s.current&&e.relatedTarget instanceof HTMLElement&&f.current(e.relatedTarget):v()},[v]),E=(0,d.useCallback)(e=>{l.current&&C.has(e.key)&&v()},[v]),D=(0,p.jsx)(`span`,{className:`x3nfvp2 x6s0dn4 xzye2dw`,children:w[t].map(e=>(0,p.jsx)(S,{keys:e},e))});return{hintElement:_.render((0,p.jsxs)(`span`,{"aria-hidden":`true`,children:[D,(0,p.jsx)(`span`,{className:`x11g1kdw`,children:i(`@astryx.keyboardHint.toNavigate`)})]}),{placement:`below`,alignment:`start`,xstyle:T.hint,style:{marginBlockStart:a[`--spacing-2`]}}),onFocus:b,onBlur:x,onKeyDown:E}}export{S as n,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{d as n,l as r}from"./themeProps-Bo2jNkIC.js";import{s as i}from"./coarsePointer-B10KWVuz.js";import{C as a,T as o,_ as s,g as c,k as l,l as u,v as d}from"./scrollView-DKN9Tc2s.js";var f={reset:{"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,"--layout-padding-outer-x":`xdt8ak2`,"--layout-padding-outer-y":`x1rs4lu4`,"--layout-padding-own-outer-x":`x1vii845`,"--layout-padding-own-outer-y":`xojybgt`,"--layout-padding-inner-x":`x1qfll2g`,"--layout-padding-inner-y":`xyvxpqs`,"--_section-padding-propagated":`x1f17rg1`,$$css:!0}},p=e(n(),1),m=r(),h=229;function g(e){return e.isComposing===!0||e.keyCode===h}var _=typeof window<`u`?p.useLayoutEffect:p.useEffect,v=Symbol.for(`@astryxdesign/core/interaction-modality/v1`);function y(e){let t=e,n=t[v];if(n!=null)return n;let r={modality:`keyboard`,isListening:!1,onPointerDown:()=>{r.modality=`pointer`},onKeyDown:e=>{e.metaKey||e.altKey||e.ctrlKey||(r.modality=`keyboard`)}};return Object.defineProperty(t,v,{value:r}),r}function b(e,t,n){t.isListening!==n&&(t.isListening=n,n?(e.addEventListener(`pointerdown`,t.onPointerDown,{capture:!0,passive:!0}),e.addEventListener(`keydown`,t.onKeyDown,{capture:!0,passive:!0})):(e.removeEventListener(`pointerdown`,t.onPointerDown,{capture:!0}),e.removeEventListener(`keydown`,t.onKeyDown,{capture:!0})))}function x(){return typeof document>`u`||b(document,y(document),!0),()=>{}}function ee(e){if(typeof document<`u`&&e===document)return x();let t=y(e);t.consumers=(t.consumers??0)+1,b(e,t,!0);let n=!1;return()=>{n||(n=!0,t.consumers=(t.consumers??1)-1,t.consumers===0&&b(e,t,!1))}}function te(e,t){t.release?.(),t.release=null;let n=e?.ownerDocument;if(n==null||typeof document<`u`&&n===document)return;let r=ee(n);return t.release=r,()=>{r(),t.release===r&&(t.release=null)}}function ne(){(0,p.useEffect)(()=>x(),[]);let e=(0,p.useRef)(null),t=(0,p.useRef)({release:null});return{ref:(0,p.useCallback)(n=>{e.current=n;let r=te(n,t.current);return()=>{r?.(),e.current===n&&(e.current=null)}},[]),readModality:(0,p.useCallback)(()=>S(e.current),[])}}function re(e){return(0,p.useEffect)(()=>x(),[]),(0,p.useEffect)(()=>{let t=e.current?.ownerDocument;if(!(t==null||typeof document<`u`&&t===document))return ee(t)}),(0,p.useCallback)(()=>S(e.current),[e])}function S(e){let t=e==null?null:e.nodeType===9?e:e.ownerDocument;return t==null?typeof document>`u`?`keyboard`:y(document).modality:y(t).modality}var ie=t((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),ae=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ie()})),oe={"data-astryx-layer-root":``},se=[`onClick`,`onAuxClick`,`onDoubleClick`,`onContextMenu`,`onMouseDown`,`onMouseUp`,`onMouseMove`,`onMouseOver`,`onMouseOut`,`onPointerDown`,`onPointerUp`,`onPointerMove`,`onPointerOver`,`onPointerOut`,`onPointerCancel`,`onGotPointerCapture`,`onLostPointerCapture`,`onTouchStart`,`onTouchMove`,`onTouchEnd`,`onTouchCancel`],ce=()=>!0;function C(e){e.isPropagationStopped=ce}function le(e={}){let t={};for(let n of se){let r=e[n];t[n]=typeof r==`function`?e=>{r(e),C(e)}:C}return{...t,...oe}}var ue={reset:{kMv6JI:`x9ynric`,kGuDYH:`xjm74w1`,k63SB2:`xxovm9e`,kLWn49:`xw6l6zx`,kKX8nH:`x1j61x8r`,k9WMMc:`x1yc453h`,kJI5tL:`x7ssn7h`,kTHuQy:`xzugeeo`,kP9fke:`x6mezaz`,kb6lSQ:`x1i21sxh`,k4JVr9:`xp3md9m`,kKMj4B:`x19pm5ym`,khDVqt:`xeaf4i8`,kTgw9:`x1lldw8n`,kHjlTd:`x1h4wwuj`,kE4Cay:`xxydokm`,$$css:!0}},de={reset:{"--step-connector-gap":`x1qkaldv`,"--_astryx-text-overflow-wrap":`x1c9qq8g`,$$css:!0}},fe=`data-astryx-haptic-switch`;function pe(e){return e instanceof Element&&e.hasAttribute(fe)}var w=new Map,T=new WeakMap,E=0;function me(e){return l(e,`click`,t=>{let n=e.document;w.has(n)&&!ve(t)&&(t.preventDefault(),t.stopImmediatePropagation(),D(n))},{cancels:!0})}function he(e,{staysInstalled:t=!1,takesLateMouse:n=!1,cancelsTouchEnd:r=!1}={}){let i=e.defaultView;if(i==null)return;D(e);let a={unsubscribers:[],timer:null};if(t&&!T.has(i)&&T.set(i,me(i)),T.has(i)||a.unsubscribers.push(me(i)),w.set(e,a),a.unsubscribers.push(l(i,`pointerdown`,()=>D(e))),n)for(let e of[`mousedown`,`mouseup`])a.unsubscribers.push(l(i,e,_e,{cancels:!0}));if(r){let t=l(i,`touchend`,n=>{t(),n.cancelable&&(n.preventDefault(),D(e))},{cancels:!0});a.unsubscribers.push(t)}a.timer=setTimeout(()=>D(e),400)}function D(e){let t=w.get(e);if(t!=null){w.delete(e),t.timer!=null&&clearTimeout(t.timer);for(let e of t.unsubscribers)e()}}function ge(e){E++;try{return e()}finally{E--}}function _e(e){ve(e)||(e.preventDefault(),e.stopImmediatePropagation())}function ve(e){return e.detail===0||E>0||pe(e.target)}function ye(e){let t=e.visualViewport,n=t?.width??0;if(t==null||!(n>0))return e.innerHeight-be(e);let r=t.scale;return(Math.abs(e.innerWidth-n)<Math.abs(e.innerWidth-n*r)?e.innerHeight*r:e.innerHeight)-be(e)}function be(e){let t=e.document.documentElement,n=e.innerHeight-t.clientHeight;return!(n>0)||t.scrollWidth<=t.clientWidth?0:Math.min(n,Se(e.document))}var xe=new WeakMap;function Se(e){let t=e.defaultView?.devicePixelRatio??1,n=xe.get(e);if(n!=null&&n.devicePixelRatio===t)return n.thickness;let r=Ce(e);return xe.set(e,{devicePixelRatio:t,thickness:r}),r}function Ce(e){let t=e.createElement(`div`);t.style.position=`absolute`,t.style.top=`-200px`,t.style.width=`100px`,t.style.height=`100px`,t.style.overflow=`scroll`,t.style.visibility=`hidden`,(e.body??e.documentElement).append(t);let n=t.offsetHeight-t.clientHeight;return t.remove(),n}var we=[`-webkit-touch-callout`,`-webkit-user-select`,`user-select`],Te=new Set([`text`,`search`,`email`,`url`,`tel`,`password`,`number`]);function Ee(e){return e!==`mouse`}var O=new WeakMap;function De(e,t){let n=new Set(e);if(Re(t)&&[...n].some(e=>c(e,t))&&n.add(t),!i()){let e=e=>{I(e.target)||e.preventDefault()};for(let t of n)t.addEventListener(`selectstart`,e);let t=!0;return()=>{if(t){t=!1;for(let t of n)t.removeEventListener(`selectstart`,e)}}}return F(n)}function Oe(e,t,n,r){let i=t?.document??null,a=n,o=N(a),c=null,u=()=>{let e=t?.getSelection();if(e==null||I(s(i)))return;let n=Me(e,o);a.length===0?n.some(e=>!e.collapsed)&&e.removeAllRanges():!M(n,a)&&a.every(Pe)&&Fe(e,a)};u();let d=new Set(e),f=e=>{I(e.target)||e.preventDefault()};for(let e of d)e.addEventListener(`selectstart`,f);let p=t==null?[]:[l(t,`selectstart`,f,{cancels:!0}),l(t,`selectionchange`,u)],m=F(d),h=`held`,g=null,_=()=>{if(h!==`done`){h=`done`,g!=null&&(t?.clearTimeout(g),g=null);try{u()}finally{for(let e of p)e();r?.()}}},v=({isCancel:e=!1}={})=>{if(h===`held`){h=`lifted`,c=k(t);for(let e of d)e.removeEventListener(`selectstart`,f);m(),t==null||e?_():g=t.setTimeout(_,0)}else h===`lifted`&&e&&_()};return v.keepLiftSelection=()=>{if(h!==`lifted`||c==null)return;let e=c;c=null;let n=()=>{let n=k(t);h!==`done`&&!M(n,e)&&(a=n,o=N(n))};n(),queueMicrotask(n)},v}function k(e){let t=e?.getSelection();if(t==null)return[];let n=Ie(t,[]);if(n!=null)return n.filter(e=>!e.collapsed).map(Ne);if(t.isCollapsed)return[];let r=[];for(let e=0;e<t.rangeCount;e++)r.push(t.getRangeAt(e).cloneRange());return r}function ke(e,t,n,r){if(I(r))return!0;let i=A(e,t,n,[...Le(r),...P(r)]);if(i==null)return!1;let{node:a,offset:o}=i;if(a.nodeType!==3||(a.textContent??``).trim()===``)return!1;let s=a.parentElement??(a.parentNode?.nodeType===11?a.parentNode.host:null);if(s==null||!je(s)||Ae(a))return!1;let c=(a.textContent??``).length,l=e.createRange();if(typeof l.getClientRects!=`function`)return!1;for(let e of[o-1,o])if(!(e<0||e>=c)){l.setStart(a,e),l.setEnd(a,e+1);for(let e of Array.from(l.getClientRects()))if(t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom)return!0}return!1}function Ae(e){for(let t=e;t!=null;t=d(t))if(t.nodeType===1&&t.localName===`button`)return!0;return!1}function A(e,t,n,r){let i=e;if(typeof i.caretPositionFromPoint==`function`){let e=r.length>0?i.caretPositionFromPoint(t,n,{shadowRoots:[...r]}):i.caretPositionFromPoint(t,n);return e==null?null:{node:e.offsetNode,offset:e.offset}}if(typeof i.caretRangeFromPoint==`function`){let e=i.caretRangeFromPoint(t,n);return e==null?null:{node:e.startContainer,offset:e.startOffset}}return null}function je(e){let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t!=null&&t.getPropertyValue(`user-select`)!==`none`&&t.getPropertyValue(`-webkit-user-select`)!==`none`}function Me(e,t){let n=Ie(e,t);if(n!=null)return n;let r=[];for(let t=0;t<e.rangeCount;t++)r.push(e.getRangeAt(t));return r}function Ne(e){let t=e.startContainer.ownerDocument?.createRange();return t==null||e.startContainer.getRootNode()!==e.endContainer.getRootNode()?e:(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t)}function Pe(e){return j(e.startContainer,e.startOffset)&&j(e.endContainer,e.endOffset)}function j(e,t){let n=e.nodeType===3||e.nodeType===4||e.nodeType===8?e.length:e.childNodes.length;return e.isConnected&&t>=0&&t<=n}function M(e,t){return e.length===t.length&&t.every((t,n)=>{let r=e[n];return r.startContainer===t.startContainer&&r.startOffset===t.startOffset&&r.endContainer===t.endContainer&&r.endOffset===t.endOffset})}function Fe(e,t){let[n]=t;if(t.length===1&&typeof e.setBaseAndExtent==`function`)e.setBaseAndExtent(n.startContainer,n.startOffset,n.endContainer,n.endOffset);else{e.removeAllRanges();for(let n of t){let t=n.startContainer.ownerDocument?.createRange();t!=null&&(t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.addRange(t))}}}function Ie(e,t){let n=e.getComposedRanges;if(typeof n!=`function`)return null;let r=t=>{try{return n.call(e,{shadowRoots:t})}catch{try{return n.call(e,...t)}catch{return null}}},i=[...t];for(;;){let e=r([...i]);if(e==null)return null;let t=new Set;for(let n of e)for(let[e,r]of[[n.startContainer,n.startOffset],[n.endContainer,n.endOffset]])for(let n of[e.childNodes[r],e.childNodes[r-1]]){let e=n?.nodeType===1?n.shadowRoot:null;e!=null&&!i.includes(e)&&t.add(e)}if(t.size===0)return e;i.push(...t)}}function N(e){let t=new Set;for(let n of e)for(let e of[...P(n.startContainer),...P(n.endContainer)])t.add(e);return[...t]}function Le(e){let t=e?.nodeType===1?e.shadowRoot:null;return t==null?[]:[t]}function P(e){let t=[],n=e!=null&&typeof e.nodeType==`number`?e.getRootNode():null;for(;n!=null&&n.nodeType===11;){let e=n.host;if(e==null)break;n.mode===`open`&&t.push(n),n=e.getRootNode()}return t}function F(e){let t=[];for(let n of e){let e=ze(n);if(e==null)continue;t.push(n);let r=O.get(n);if(r!=null)r.count+=1;else{O.set(n,{count:1,saved:we.map(t=>({name:t,value:e.getPropertyValue(t),priority:e.getPropertyPriority(t)}))});for(let t of we)e.setProperty(t,`none`)}}let n=!1;return()=>{if(!n){n=!0;for(let e of t){let t=O.get(e);if(t==null||--t.count>0)continue;O.delete(e);let n=ze(e);for(let{name:e,value:r,priority:i}of t.saved)r===``?n?.removeProperty(e):n?.setProperty(e,r,i)}}}}function Re(e){return a(e)&&e.localName===`input`&&!Te.has(e.type)}function I(e){let t=a(e)?e:o(e)?e.parentElement:null;return t==null?!1:t.localName===`textarea`?!0:t.localName===`input`?Te.has(t.type):t.isContentEditable}function ze(e){let t=e.style;return typeof t==`object`&&t?t:null}var Be=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]);function Ve(e){return e.visualViewport!=null&&e.self===e.top}function L(e){let t=e.visualViewport;if(t==null||!Ve(e))return 0;let n=ye(e)-t.height*(t.scale??1);return n>1?Math.round(n*100)/100:0}var R=new WeakMap;function He(e){let t=R.get(e);return t??(t={height:0,listeners:new Set,focusListeners:new Set,detach:null,detachFocus:null},R.set(e,t)),t}function Ue(e,t){let n=e.visualViewport;t.height=L(e);let r=n=>{t.height=L(e);let r={type:`viewport`,height:t.height,timeStamp:n.timeStamp};for(let e of[...t.listeners])e(r)};n?.addEventListener(`resize`,r),n?.addEventListener(`scroll`,r);let i=l(e,`resize`,e=>{o(e.target)||r(e)});return()=>{n?.removeEventListener(`resize`,r),n?.removeEventListener(`scroll`,r),i()}}function We(e,t){let n=e=>{let n={type:e.type===`focusin`?`focusin`:`focusout`,height:t.height,timeStamp:e.timeStamp,target:e.target,relatedTarget:e.relatedTarget};for(let e of[...t.focusListeners])e(n)},r=l(e,`focusin`,n),i=l(e,`focusout`,n);return()=>{r(),i()}}function z(e,t,{focus:n=!1}={}){let r=He(e);return r.listeners.add(t),r.detach??=Ue(e,r),n&&(r.focusListeners.add(t),r.detachFocus??=We(e,r)),()=>{r.listeners.delete(t),n&&(r.focusListeners.delete(t),r.focusListeners.size===0&&r.detachFocus!=null&&(r.detachFocus(),r.detachFocus=null)),r.listeners.size===0&&r.detach!=null&&(r.detach(),r.detach=null)}}function B(e){let t=R.get(e);return t?.detach==null?L(e):t.height}function V(e){return e instanceof HTMLElement&&e.getAttribute(`inputmode`)===`none`?!1:e instanceof HTMLTextAreaElement?!e.disabled&&!e.readOnly:e instanceof HTMLInputElement?!e.disabled&&!e.readOnly&&!Be.has((e.getAttribute(`type`)??`text`).toLowerCase()):e instanceof HTMLElement&&e.matches(`[contenteditable]:not([contenteditable="false"])`)}function Ge(e,t){if(!(e instanceof Element))return null;let n=e.closest(`input, textarea, [contenteditable]:not([contenteditable="false"])`);if(t.contains(n)&&V(n))return n;let r=e.closest(`label`),i=r instanceof HTMLLabelElement?r.control:null;return t.contains(i)&&V(i)?i:null}var H=new WeakMap;function Ke(e,{isActive:t,claim:n,park:r}){let i=i=>{if(t!=null&&!t())return;let a=n(i.relatedTarget);a==null?i.relatedTarget??r?.(i.target):a!==e.activeElement&&a.focus({preventScroll:!0})},a=H.get(e);if(a==null){let t=e.defaultView;if(t==null)return()=>{};let n=new Set,r=e=>{for(let t of[...n])n.has(t)&&t(e)};a={stop:l(t,`blur`,e=>{o(e.target)&&r(e)}),callers:n},H.set(e,a)}return a.callers.add(i),()=>{let t=H.get(e);t!=null&&t.callers.delete(i)&&t.callers.size===0&&(t.stop(),H.delete(e))}}var U=new WeakMap;function qe(e,t){let n=U.get(e);if(n==null){let t=e.defaultView;if(t==null)return()=>{};let r=new Set;n={stop:l(t,`touchstart`,()=>{for(let e of[...r])e()}),watches:r},U.set(e,n)}return n.watches.add(t),()=>{let n=U.get(e);n!=null&&n.watches.delete(t)&&n.watches.size===0&&(n.stop(),U.delete(e))}}function Je(e,{owns:t,onTouch:n}){let r=e.document,i=null,a=!1;return{report:()=>{let t=e.visualViewport;i=t==null?null:{x:e.scrollX,y:e.scrollY,top:t.offsetTop,scale:t.scale},a=!1},isRevealPan:n=>{let o=e.visualViewport,s=r.activeElement;return o!=null&&i!=null&&!a&&n>0&&o.offsetTop>i.top&&o.scale===i.scale&&e.scrollX===i.x&&e.scrollY===i.y&&s instanceof HTMLElement&&V(s)&&t(s)},putBack:e=>{let t={block:`start`,inline:`nearest`,behavior:`instant`};if(e!=null){e.scrollIntoView(t);return}let n=r.createElement(`div`);n.style.position=`fixed`,n.style.left=`0`,n.style.top=`${i?.top??0}px`,n.style.width=`1px`,n.style.height=`1px`,n.style.visibility=`hidden`,n.style.pointerEvents=`none`,(r.body??r.documentElement).append(n),n.scrollIntoView(t),n.remove()},stop:qe(r,()=>{a=!0,n?.()})}}function Ye(e,{claim:t,deliver:n}){let r=null,i=()=>{r=null,e.removeEventListener(`touchmove`,a),e.removeEventListener(`touchend`,o),e.removeEventListener(`touchcancel`,i)};function a(e){let t=e.touches[0];(r==null||e.touches.length!==1||t==null||Math.hypot(t.clientX-r.x,t.clientY-r.y)>10)&&i()}function o(a){let o=a.changedTouches[0],s=r;i(),s!=null&&o!=null&&a.cancelable&&t(s.control)===s.control&&(a.preventDefault(),n(s.control,o.clientX,o.clientY,o),he(e.ownerDocument,{takesLateMouse:!0}))}let s=n=>{if(r!=null){i();return}let s=n.touches[0],c=n.touches.length===1&&s!=null?t(n.target):null;c!=null&&s!=null&&(r={x:s.clientX,y:s.clientY,control:c},e.addEventListener(`touchmove`,a,{passive:!0}),e.addEventListener(`touchend`,o),e.addEventListener(`touchcancel`,i))};return e.addEventListener(`touchstart`,s,{passive:!0}),()=>{i(),e.removeEventListener(`touchstart`,s)}}function Xe(e){return e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement}function Ze(e,t,n){if(e.selectionStart==null)return;let r=A(e.ownerDocument,t,n,[]),i=r!=null&&r.node===e?r.offset:e.value.length;e.setSelectionRange(i,i)}function Qe(e,t,n){if(e.focus({preventScroll:!0}),Xe(e)){Ze(e,t,n);return}let r=e.ownerDocument,i=A(r,t,n,[]);if(i!=null&&e.isContentEditable&&e.contains(i.node)){let e=r.createRange();e.setStart(i.node,i.offset),e.collapse(!0);let t=r.getSelection();t?.removeAllRanges(),t?.addRange(e)}}var W={showMs:267,showCurve:[.1,0,0,1],showReportLagMs:25,hideMs:167,hideCurve:[.3,.1,.2,.9],hideAfterBlurMs:16,hideReportLagMs:33};function G([e,t,n,r]){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c,u=e=>((o*e+a)*e+i)*e,d=e=>((l*e+c)*e+s)*e,f=e=>(3*o*e+2*a)*e+i,p=e=>{let t=e;for(let n=0;n<8;n++){let n=u(t)-e;if(Math.abs(n)<1e-7)return t;let r=f(t);if(Math.abs(r)<1e-6)break;t-=n/r}let n=0,r=1;t=e;for(let i=0;i<60;i++){let i=u(t);if(Math.abs(i-e)<1e-7)break;i<e?n=t:r=t,t=(n+r)/2}return t};return e=>e<=0?0:e>=1?1:d(p(e))}var K=.5;function $e(e=0){let t={kind:`change`,from:e,to:e,start:-1/0,velocity:0,animated:!1,predicted:!1,curve:null},n=null,r=(e,t,n)=>{let r=n.durationMs/1e3,i=G(n.points),a=n=>e+(t-e)*i(Math.min(1,Math.max(0,n/r)));return{value:a,velocity:e=>{if(e>=r)return 0;let t=Math.max(0,e-.001),n=Math.min(r,e+.001);return(a(n)-a(t))/(n-t)}}},i={durationMs:W.showMs,points:W.showCurve},a={durationMs:W.hideMs,points:W.hideCurve},o=()=>t.curve==null?0:t.curve.durationMs,s=e,c=e=>e<t.start?t.from:n==null||e>=t.start+o()?t.to:n.value((e-t.start)/1e3),l=e=>e<=t.start?t.velocity:n==null||e>=t.start+o()?0:n.velocity((e-t.start)/1e3),u=(e,o,u,{animated:d=!0,predicted:f=!1}={})=>{let p=Math.max(u,t.start),m=c(p),h=d?l(p):0,g=d?o>m?i:a:null;return t={kind:e,from:m,to:o,start:p,velocity:h,animated:d,predicted:f,curve:g},n=g!=null&&Math.abs(o-m)+Math.abs(h)>0?r(m,o,g):null,o>K&&(s=o),t},d=()=>(t.predicted&&(t={...t,predicted:!1}),null);return{get inset(){return t.to},get transition(){return t},presentation:c,velocity:l,report(e,n){if(e==null)return null;let r=t.to;if(Math.abs(e-r)<K)return d();if(e<=K)return u(`hide`,0,n-W.hideReportLagMs);if(r<=K){let t=s>e+K;return u(`show`,t?s:e,n-W.showReportLagMs,{predicted:t})}return u(`change`,e,n,{animated:!1})},blurred(e){return t.to<=K?null:u(`hide`,0,e+W.hideAfterBlurMs,{predicted:!0})},focused(e){return t.kind!==`hide`||!t.predicted?null:u(`show`,s,Math.max(e,t.start),{predicted:!0})},verify(e,n){return!t.predicted||e==null||n<t.start+o()?null:Math.abs(e-t.to)<K?d():u(e>t.to?`show`:`hide`,e,n)}}}function q(e){return`virtualKeyboard`in e.navigator?`chromium`:null}var et=150,tt=150,nt=new Set([`date`,`datetime-local`,`month`,`time`,`week`]);function rt(e){let t=e instanceof Element?e:null;return V(t)||t instanceof HTMLSelectElement&&!t.disabled}function it(e){let t=e;return t==null||t.nodeType!==1?!1:t.tagName===`SELECT`||t.tagName===`INPUT`&&nt.has(t.type)}function at(e){return e.tagName===`IFRAME`||e.tagName===`FRAME`||e.tagName===`OBJECT`||e.tagName===`EMBED`||e.shadowRoot!=null||e.tagName.includes(`-`)}var ot=new WeakMap;function st(e){let t=ot.get(e);return t??(t=ct(e),ot.set(e,t)),t}function ct(e){let t=new Set,n=q(e),r=$e(B(e)),i=null,a=null,o=e=>rt(e)&&!(n===`chromium`&&it(e)),s=()=>{let t=e.document.activeElement;return r.transition.kind===`hide`&&r.transition.predicted&&!o(t)&&!(t!=null&&at(t))},c=e=>{if(e!=null){e.predicted&&l(e);for(let n of[...t])n(e)}},l=t=>{i!=null&&clearTimeout(i);let n=t.start+(t.curve?.durationMs??0)+et;i=setTimeout(()=>{i=null;let t=B(e);t!=null&&t>.5&&s()||c(r.verify(t,e.performance.now()))},Math.max(0,n-e.performance.now()))},u=()=>{n=q(e),r=$e(B(e));let t=-1/0,a=null,l=(i,l)=>{a!=null&&(clearTimeout(a),a=null);let u=t+tt;return n===`chromium`&&i<.5&&r.inset>=.5&&l<u&&o(e.document.activeElement)?(a=setTimeout(()=>{a=null,c(r.report(B(e),u))},u-l),null):i>.5&&s()?null:r.report(i,l)},u=z(e,e=>{e.type===`viewport`?c(l(e.height,e.timeStamp)):e.type===`focusin`?o(e.target)&&(t=e.timeStamp,c(r.focused(e.timeStamp))):o(e.target)&&!o(e.relatedTarget)&&c(r.blurred(e.timeStamp))},{focus:!0});return()=>{u(),a!=null&&(clearTimeout(a),a=null),i!=null&&(clearTimeout(i),i=null)}};return{get profile(){return n},get inset(){return r.inset},get transition(){return r.transition},presentation(t=e.performance.now()){return r.presentation(t)},subscribe(e){return t.add(e),a??=u(),()=>{t.delete(e),t.size===0&&a!=null&&(a(),a=null)}}}}var lt={highlightInMs:0,flashMs:100,highlightOutMs:200,highlightOutCurve:[0,0,.2,1],scrollBrakeMs:150,buttonReleaseMs:250},ut={durationMs:200,curve:[.42,0,.58,1]},{durationMs:dt,curve:ft}=ut,pt={press:lt,curves:{viewChange:[.25,.1,.25,1],move:ft,exit:[.42,0,1,1],entrance:[0,0,.58,1]},navigationBarHideShowMs:200,keyboardNotificationMs:383.3,stateChangeMs:250,reducedMotionCrossFadeMs:dt},mt={curves:{move:ft}};function ht(){u(`timing`,mt,{roles:[`curves.move`]})}var J=(0,p.createContext)(0);J.displayName=`LayerDepthContext`;function gt(){return(0,p.use)(J)}function _t({children:e}){let t=(0,p.use)(J);return(0,m.jsx)(J,{value:t+1,children:e})}_t.displayName=`LayerDepthProvider`;var Y=[],vt=new WeakMap,yt=0,X=new Map;function bt(e){let t=vt.get(e);if(t!==void 0)return t;let n=yt++;return vt.set(e,n),n}function xt(e,t){if(e.depth!==t.depth)return e.depth-t.depth;let n=e.getContainer?.()??null,r=t.getContainer?.()??null;if(n!=null&&r!=null&&n!==r){if(r.contains(n))return 1;if(n.contains(r))return-1}return e.seq-t.seq}function St(e){return e.isPresent?.()??!0}var Z=new Set;function Ct(){return Z.size>0}function wt(e){Z.add(e.currentTarget)}function Q(e){Z.delete(e.currentTarget)}function $(e){let t=null;for(let n of Y)n.ownerDocument===e&&St(n)&&(t==null||xt(n,t)>0)&&(t=n);return t}function Tt(e){let t=Y.find(t=>t.token===e);return t!=null&&$(t.ownerDocument)===t}function Et(){return typeof document>`u`?null:document}function Dt(e){let t=e.target;return t==null?null:t.nodeType===9?t:t.ownerDocument}function Ot(e){let t=$(e);return t!=null&&(t.behavior===`block`||t.dismiss(),!0)}function kt(e){if(e.key!==`Escape`)return;let t=Dt(e)??Et();g(e)?$(t)!=null&&e.preventDefault():e.defaultPrevented||Ot(t)&&e.preventDefault()}function At(e){e.addEventListener(`keydown`,kt),e.addEventListener(`compositionstart`,wt,!0),e.addEventListener(`compositionend`,Q,!0),e.addEventListener(`blur`,Q,!0)}function jt(e){e.removeEventListener(`keydown`,kt),e.removeEventListener(`compositionstart`,wt,!0),e.removeEventListener(`compositionend`,Q,!0),e.removeEventListener(`blur`,Q,!0),Z.delete(e)}function Mt(e){let t=e.getContainer?.()?.ownerDocument??Et(),n={...e,seq:bt(e.token),ownerDocument:t};if(Y.push(n),t!=null){let e=X.get(t)??0;X.set(t,e+1),e===0&&At(t)}return()=>{let e=Y.indexOf(n);if(e===-1||(Y.splice(e,1),t==null))return;let r=X.get(t)??1;r>1?X.set(t,r-1):(X.delete(t),jt(t))}}function Nt(e){let{isActive:t,onDismiss:n,escapeBehavior:r=`close`,getContainer:i,isPresent:a,isEnabled:o=!0}=e,s=gt(),c=(0,p.useRef)({}),l=(0,p.useRef)(!1),u=(0,p.useRef)(n),d=(0,p.useRef)(i),f=(0,p.useRef)(a);(0,p.useEffect)(()=>{u.current=n,d.current=i,f.current=a});let m=t&&o;return(0,p.useEffect)(()=>{if(!m)l.current=!1;else return l.current||=(c.current={},!0),Mt({token:c.current,depth:s,behavior:r,getContainer:()=>d.current?.()??null,isPresent:()=>f.current?.()??!0,dismiss:()=>u.current()})},[m,s,r]),{shouldDismissOnCloseRequest:(0,p.useCallback)(()=>m&&!Ct()&&Tt(c.current),[m])}}export{de as A,f as B,Ee as C,he as D,ye as E,S as F,ne as I,re as L,le as M,C as N,D as O,ae as P,_ as R,De as S,ke as T,V as _,ht as a,Je as b,st as c,G as d,Ye as f,Ve as g,B as h,ut as i,ue as j,ge as k,at as l,Qe as m,_t as n,pt as o,Ge as p,lt as r,rt as s,Nt as t,q as u,Ke as v,k as w,Oe as x,z as y,g as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{O as n}from"./Icon-Cd9sDRzY.js";var r=e(t(),1);function i(){let e=(0,r.use)(n);return(0,r.useMemo)(()=>{let t=new Intl.ListFormat(e.locale,{type:`conjunction`,style:`narrow`});return e=>t.format(e)},[e.locale])}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{O as n}from"./Icon-Cd9sDRzY.js";var r=e(t(),1);function i(){return(0,r.use)(n).locale}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{i as n}from"./coarsePointer-B10KWVuz.js";var r=e(t(),1),i=new Map;function a(e,t){if(typeof window.matchMedia!=`function`)return()=>{};let r=i.get(e);if(r==null){let t=new Set;r={readers:t,stop:n(window,e,()=>{for(let e of Array.from(t))e()})},i.set(e,r)}let a=r;return a.readers.add(t),()=>{a.readers.delete(t),a.readers.size===0&&i.get(e)===a&&(a.stop(),i.delete(e))}}function o(e,t=!1){let n=(0,r.useCallback)(t=>a(e,t),[e]),i=(0,r.useCallback)(()=>typeof window.matchMedia==`function`?window.matchMedia(e).matches:t,[e,t]),o=(0,r.useCallback)(()=>t,[t]);return(0,r.useSyncExternalStore)(n,i,o)}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{R as n}from"./useLayerDismissal-DwwLDEpO.js";import{n as r,t as i}from"./typeaheadMatch-BJfmSQc6.js";var a=e(t(),1);function o(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!s(e)&&e.key!==` `}function s(e){return e.isComposing===!0||e.nativeEvent?.isComposing===!0}function c(e){let{getItemLabels:t,onMatch:n,getCurrentIndex:c,resetMs:l=750,isDisabled:u}=e,d=(0,a.useRef)(``),f=(0,a.useRef)(void 0),p=(0,a.useCallback)(()=>{d.current=``,f.current&&=(clearTimeout(f.current),void 0)},[]);(0,a.useEffect)(()=>p,[p]);let m=(0,a.useCallback)(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d.current=``,f.current=void 0},l)},[l]);return{onKeyDown:(0,a.useCallback)(e=>{let a=e.key===` `&&!e.ctrlKey&&!e.metaKey&&!s(e)&&d.current.length>0;if(!o(e)&&!a)return!1;let l=r(d.current,e.key);if(l==null)return!1;let f=t();if(f.length===0)return!1;d.current=l,m();let p=c?.()??-1,h=f.length,g=p>=0,_=g?p:0,v=g&&l.length===1?1:0,y=[];for(let e=0;e<h;e++){let t=(_+v+e+h)%h;u?.(t)||y.push(t)}let b=i(y,e=>f[e],l);return b>=0&&n(b),!0},[t,n,c,m,u]),reset:p}}function l(e,t,r,i){let o=(0,a.useRef)(null);n(()=>{o.current=i===void 0?null:t});let[s,c]=(0,a.useState)(null),l=(0,a.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.scrollHeight>t.clientHeight+1;c(e=>e!=null&&e.hasOverflow===n&&Object.is(e.content,o.current)?e:{content:o.current,hasOverflow:n})},[e]);return n(()=>{if(!r)return;let t=e.current;if(!t)return;l();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(l),i=typeof MutationObserver>`u`?null:new MutationObserver(l);return n?.observe(t),i?.observe(t,{childList:!0,characterData:!0,subtree:!0}),t.addEventListener(`load`,l,!0),window.addEventListener(`resize`,l),window.visualViewport?.addEventListener(`resize`,l),()=>{n?.disconnect(),i?.disconnect(),t.removeEventListener(`load`,l,!0),window.removeEventListener(`resize`,l),window.visualViewport?.removeEventListener(`resize`,l)}},[r,l,e]),n(()=>{r&&l()},[t,r,l]),i===void 0?s?.hasOverflow??!1:s!=null&&Object.is(s.content,t)?s.hasOverflow:i}export{c as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{d as n}from"./coarsePointer-B10KWVuz.js";import{D as r,L as i,R as a,k as o}from"./useLayerDismissal-DwwLDEpO.js";import{t as s}from"./focusReturn-DNKESCUc.js";import{_ as c}from"./useClickableContainer-B08uXDf4.js";import{w as l}from"./useTooltip-DQ4LKI-B.js";import{a as u}from"./chainEventHandlers-BSZ5MWAl.js";import{i as d}from"./boxHold-C4vf0eaW.js";var f=e(t(),1),p=`data-astryx-menu-press-lit`,m=`--_menu-row-active-paint`;function h(e){e.setAttribute(p,``)}function g(e){e.removeAttribute(p)}function _(e){e.style.setProperty(m,`transparent`)}function v(e){e.style.removeProperty(m)}n[`--color-overlay-pressed`],n[`--color-overlay-pressed`];var y={row:{"--_menu-row-focus-paint":`x1ar3rj9`,"--_menu-row-active-paint":`xcukuoe`,$$css:!0}}.row,b=10,x={phase:`idle`},S={type:`none`};function C(e){return{gesture:{phase:`idle`},effect:e}}function w(e){return e==null?{type:`clear`}:{type:`highlight`,row:e}}function T(e){return e!==`mouse`}function E(e){return e.x!=null&&e.y!=null}function D(e,t){return Math.hypot(t.x-e.x,t.y-e.y)>=b}function O(e,t){return t.row==null?t.isInMenu||t.isOnTrigger?C({type:`settle`,stray:!0,dismiss:!1}):C({type:`settle`,stray:!0,dismiss:e===`mouse`}):C({type:`act`,row:t.row})}function k(e,t){switch(e.phase){case`idle`:return A(e,t);case`triggerPress`:return j(e,t);case`open`:return M(e,t);case`tracking`:return N(e,t)}}function A(e,t){return t.type===`down`?t.target===`menu`?{gesture:{phase:`tracking`,pointerType:t.pointerType,origin:`menu`,row:t.row},effect:w(t.row)}:t.pointerType===`mouse`?{gesture:{phase:`open`,pointerType:`mouse`,openedAt:t.time},effect:{type:`open`}}:{gesture:{phase:`triggerPress`,pointerType:t.pointerType,startedAt:t.time},effect:S}:{gesture:e,effect:S}}function j(e,t){switch(t.type){case`opened`:return{gesture:{phase:`open`,pointerType:e.pointerType,openedAt:t.time},effect:S};case`up`:return C({type:`settle`,stray:!1,dismiss:!1});case`cancel`:return C({type:`settle`,stray:!1,dismiss:!1});case`down`:case`move`:return{gesture:e,effect:S}}}function M(e,t){switch(t.type){case`move`:if(T(e.pointerType)&&E(t)){let n=e.handoffFrom;return n==null?{gesture:{...e,handoffFrom:{x:t.x,y:t.y}},effect:S}:D(n,t)?{gesture:{phase:`tracking`,pointerType:e.pointerType,origin:`trigger`,row:t.row},effect:w(t.row)}:{gesture:e,effect:S}}return t.isInMenu?{gesture:{phase:`tracking`,pointerType:e.pointerType,origin:`trigger`,row:t.row},effect:w(t.row)}:{gesture:e,effect:S};case`up`:return T(e.pointerType)&&E(t)||!(t.time-e.openedAt>=300)?C({type:`settle`,stray:!0,dismiss:!1}):O(e.pointerType,t);case`cancel`:return C({type:`settle`,stray:!1,dismiss:!1});case`down`:case`opened`:return{gesture:e,effect:S}}}function N(e,t){switch(t.type){case`move`:return t.row===e.row?{gesture:e,effect:S}:{gesture:{...e,row:t.row},effect:w(t.row)};case`up`:return O(e.pointerType,t);case`cancel`:return C({type:`settle`,stray:!1,dismiss:!1});case`down`:case`opened`:return{gesture:e,effect:S}}}var P=500,F=10;function I(e){return e.view?.performance??(typeof performance>`u`?null:performance)}function L(e,t){if(!(t==null||!Number.isFinite(t)||t<=0))return e!=null&&Math.abs(Date.now()-t)<Math.abs(e.now()-t)?e.now()-(Date.now()-t):t}function R(e){let t=e,n=null,r=null,i=null,a=null,o=null,s=()=>{n!=null&&(clearTimeout(n),n=null),r=null,i=null,a=null},c=()=>{let e=r;e!=null&&(s(),d(),t.onLongPress({x:e.x,y:e.y}))},l=e=>{let t=e==null?void 0:L(a,e.timeStamp);i!=null&&t!=null&&t>=i&&c()},u=(e,l,u)=>{if(t.disabled===!0)return;s();let d=t.delayMs??P;r={x:e.x,y:e.y},o=l??null;let f=u?.clock??null,p=u==null?null:u.at+d;a=f,i=p;let m=f==null||p==null?d:Math.min(d,Math.max(0,p-f.now())),h=e=>{n=null,e&&f!=null&&p!=null&&f.now()>p?n=setTimeout(()=>h(!1),0):c()};n=setTimeout(()=>h(!0),m)},f=e=>{let n=r;if(n==null)return!1;let i=o?.moveCancelPx??t.moveCancelPx??F;return Math.abs(e.x-n.x)>i||Math.abs(e.y-n.y)>i?(s(),!1):!0};return{start(e,t){u(e,t,void 0)},touchStart(e){if(t.disabled===!0)return;if(e.touches.length!==1){l(e),s();return}let n=e.touches[0],r=I(e),i=L(r,e.timeStamp);u({x:n.clientX,y:n.clientY},void 0,r==null||i==null?void 0:{at:i,clock:r})},touchMove(e){if(r==null||(l(e),r==null))return;if(e.touches.length!==1){s();return}let t=e.touches[0];f({x:t.clientX,y:t.clientY})},touchEnd(e){l(e),s()},moveTo:f,cancel:s,isPending:()=>r!=null,setOptions(e){t=e}}}function z(e){let{start:t,...n}=B(e),r=(0,f.useCallback)(e=>t(e),[t]);return{...n,start:r}}function B(e){let[t]=(0,f.useState)(()=>R(e));return a(()=>{t.setOptions(e)}),(0,f.useEffect)(()=>t.cancel,[t]),{onTouchStart:t.touchStart,onTouchMove:t.touchMove,onTouchEnd:t.touchEnd,onTouchCancel:t.touchEnd,start:t.start,moveTo:t.moveTo,cancel:t.cancel}}function V(e){let{intervalMs:t,immediate:n=!1,catchUp:r=!1}=e,i=e.now??(()=>performance.now()),a=null,o=0,s=0,c=()=>{a!=null&&(clearInterval(a),a=null)},l=n=>{let a=e.step();if(a===0){c();return}let l=1;if(r&&n){let e=Math.floor((i()-o)/t);l=Math.max(1,Math.min(2,e-s)),s=Math.max(s+l,e)}e.apply(a*l)===0&&c()};return{update(){e.step()===0?c():a??(o=i(),s=0,a=setInterval(()=>l(!0),t),n&&l(!1))},stop:c,get isRunning(){return a!=null}}}var H=`[${c}]`,U=`data-astryx-menu-press-surface`,ee=500,te={moveCancelPx:13},ne=6,re=16,W=`[tabindex], a[href], button, input, select, textarea, [contenteditable]`,ie=`a[href], button, [tabindex]`,G=!1;function K(){return G}function q(e){return e===`mouse`||e===`touch`||e===`pen`?e:null}function ae(e){return e.matches(W)}function J(e){let t=e;for(;;){let e=t.parentElement?.closest(H)??Y(t);if(e==null||e===t)return t;t=e}}function Y(e){let t=e.getAttribute(U);if(!t)return null;let n=e.ownerDocument.getElementById(t);return n?.matches(H)===!0?n:null}function X(e,t){if(t.contains(e))return!0;let n=e.closest(H);return n!=null&&J(n)===t}function Z(e,t){return t?{x:e.clientX,y:e.clientY}:{}}function Q(e){let{touchModel:t,...n}=e;return $({...n,touchModel:`pointer`})}function $(e){let t=(0,f.useRef)(e);t.current=e,i(e.menuRef);let n=(0,f.useRef)(x),a=(0,f.useRef)(null),d=(0,f.useRef)(null),p=(0,f.useRef)(null),m=(0,f.useRef)(null),y=(0,f.useRef)(null),[b]=(0,f.useState)(()=>V({intervalMs:re,immediate:!0,step:()=>(y.current?.direction??0)*ne,apply:e=>{let t=y.current;if(t==null)return 0;let n=t.scroller.scrollTop;t.scroller.scrollTop=n+e;let r=t.scroller.scrollTop-n;return r===0?(y.current=null,0):(t.reread(),r)}})),S=(0,f.useRef)(null),C=(0,f.useRef)(null),w=(0,f.useRef)(null),T=(0,f.useCallback)(()=>t.current.menuRef.current?.ownerDocument??t.current.triggerRef?.current?.ownerDocument??document,[]),E=(0,f.useCallback)(e=>{let{menuRef:n,triggerRef:r,itemSelector:i,hitTest:a}=t.current,o=n.current,s=T(),c;if(a!=null)c=a(e.clientX,e.clientY);else if(typeof s.elementFromPoint==`function`){let t=o?.getRootNode(),n=t!=null&&t!==s&&typeof t.elementFromPoint==`function`?t:s;c=n.elementFromPoint(e.clientX,e.clientY),u(c)&&typeof n.elementsFromPoint==`function`&&(c=n.elementsFromPoint(e.clientX,e.clientY).find(e=>!u(e))??null)}else c=e.target instanceof Element?e.target:null;let l=o==null?null:J(o),d=l!=null&&c!=null&&X(c,l),f=r?.current??null,p=f!=null&&c!=null&&f.contains(c),m=null;return d&&c!=null&&(m=c.closest(i),m!=null&&!X(m,l)&&(m=null)),{row:m,isInMenu:d,isOnTrigger:p}},[T]),D=(0,f.useCallback)(()=>{b.stop(),y.current=null},[b]),O=(0,f.useRef)(null),A=(0,f.useRef)(null),j=(0,f.useCallback)(()=>{p.current?.cancel(),O.current!=null&&(g(O.current),O.current=null),A.current!=null&&(v(A.current),A.current=null),m.current?.(),m.current=null,D(),d.current?.(),d.current=null,a.current=null,S.current=null,n.current=x},[D]),M=(0,f.useCallback)(e=>{let r=n.current,i=r.phase!==`idle`&&r.pointerType!==`mouse`,a=i?e:null;O.current!==a&&(O.current!=null&&g(O.current),O.current=a,a!=null&&h(a));let{onHighlight:o,menuRef:c}=t.current,l=i?c.current:null;if(A.current!==l&&(A.current!=null&&v(A.current),A.current=l,l!=null&&_(l)),o!=null){o(e);return}let u=e==null?c.current:ae(e)?e:e.querySelector(ie);u!=null&&u!==T().activeElement&&s(u,{preventScroll:!0})},[T]),N=(0,f.useCallback)((e,n)=>{o(()=>{let{onActivate:r}=t.current;G=!0;try{if(r!=null){r(e,n);return}e.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:0,button:n.button,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,altKey:n.altKey,metaKey:n.metaKey}))}finally{G=!1}})},[]),P=(0,f.useRef)(()=>{}),F=(0,f.useCallback)((e,n,i)=>{let a=T();switch(e.type){case`none`:return;case`open`:{let e=n.phase===`open`?n.pointerType:`mouse`;C.current=l(),(t.current.onTriggerPress?.(e)??!1)||j();return}case`highlight`:M(e.row);return;case`clear`:M(null);return;case`act`:j(),r(a,{staysInstalled:!0,cancelsTouchEnd:i?.pointerType===`touch`}),i!=null&&N(e.row,i);return;case`settle`:j(),e.stray&&r(a,{staysInstalled:!0,cancelsTouchEnd:i?.pointerType===`touch`}),e.dismiss&&t.current.onDismiss?.();return}},[N,j,T,M]),I=(0,f.useCallback)((e,t)=>{let r=k(n.current,e);n.current=r.gesture,F(r.effect,r.gesture,t)},[F]);P.current=I;let L=(0,f.useCallback)(()=>{let{getScroller:e,menuRef:n}=t.current;if(e!=null)return e();let r=n.current;return r==null?null:r.scrollHeight>r.clientHeight+1?r:null},[]),R=(0,f.useCallback)(e=>{if(n.current.phase!==`tracking`){D();return}let t=L();if(t==null){D();return}let r=t.getBoundingClientRect();if(r.height<=0){D();return}let i=0;e.clientY<=r.top+24?i=-1:e.clientY>=r.bottom-24&&(i=1),i===0?D():y.current?.direction!==i&&(D(),y.current={scroller:t,direction:i,reread:()=>{let e=S.current;if(e!=null){let t=E(e);P.current({type:`move`,row:t.row,isInMenu:t.isInMenu,time:Date.now()},e)}}},b.update())},[b,L,E,D]),z=(0,f.useCallback)(e=>{d.current?.();let r=T(),i=r.defaultView;a.current=e;let o=e=>{if(e.pointerId!==a.current)return;if(S.current=e,n.current.phase===`triggerPress`){p.current?.moveTo({x:e.clientX,y:e.clientY})===!1&&P.current({type:`cancel`});return}let r=E(e);P.current({type:`move`,row:r.row,isInMenu:r.isInMenu,time:Date.now(),...Z(e,t.current.touchModel===`uikit`)},e),R(e)},s=e=>{if(e.pointerId!==a.current)return;let n=E(e);P.current({type:`up`,row:n.row,isInMenu:n.isInMenu,isOnTrigger:n.isOnTrigger,time:Date.now(),...Z(e,t.current.touchModel===`uikit`)},e)},c=e=>{e.pointerId===a.current&&P.current({type:`cancel`})},l=e=>{e.pointerId!==a.current&&(w.current=e.pointerId,P.current({type:`cancel`}))},u=()=>{P.current({type:`cancel`})};r.addEventListener(`pointermove`,o,!0),r.addEventListener(`pointerup`,s,!0),r.addEventListener(`pointercancel`,c,!0),r.addEventListener(`pointerdown`,l,!0),i?.addEventListener(`blur`,u),d.current=()=>{r.removeEventListener(`pointermove`,o,!0),r.removeEventListener(`pointerup`,s,!0),r.removeEventListener(`pointercancel`,c,!0),r.removeEventListener(`pointerdown`,l,!0),i?.removeEventListener(`blur`,u)}},[T,E,R]);p.current=B({onLongPress:(0,f.useCallback)(()=>{let e=n.current;if(e.phase!==`triggerPress`)return;if(C.current=l(),!(t.current.onTriggerPress?.(e.pointerType)??!1)){I({type:`cancel`});return}let r=T(),i=e=>{e.cancelable&&e.preventDefault()};r.addEventListener(`touchmove`,i,{passive:!1,capture:!0}),m.current=()=>{r.removeEventListener(`touchmove`,i,!0)},I({type:`opened`,time:Date.now()})},[T,I]),delayMs:e.longPressDelayMs??ee});let U=(0,f.useCallback)(e=>{let{menuRef:r,isEnabled:i=!0}=t.current,a=r.current;if(!i||a==null)return;if(e.pointerId===w.current){w.current=null;return}if(n.current.phase!==`idle`){I({type:`cancel`});return}let o=q(e.pointerType);if(o==null||o===`mouse`&&e.button!==0||e.target?.closest(H)!==a)return;o!==`mouse`&&e.preventDefault();let s=e.nativeEvent;z(s.pointerId),S.current=s;let c=E(s);I({type:`down`,target:`menu`,pointerType:o,row:c.row,time:Date.now()},s)},[z,E,I]),W=(0,f.useCallback)(e=>{let{isEnabled:r=!0}=t.current;if(e.pointerId===w.current){w.current=null;return}if(!r||n.current.phase!==`idle`)return;let i=q(e.pointerType);if(i==null||e.button!==0||i===`mouse`&&e.ctrlKey)return;let a=e.nativeEvent;z(a.pointerId),S.current=a,i!==`mouse`&&p.current?.start({x:a.clientX,y:a.clientY},te),I({type:`down`,target:`trigger`,pointerType:i,row:null,time:Date.now()},a)},[z,I]),K=(0,f.useCallback)(e=>{let t=n.current;t.phase!==`idle`&&t.pointerType!==`mouse`&&e.preventDefault()},[]),Y=(0,f.useCallback)(()=>C.current!=null&&C.current===l(),[]),Q=(0,f.useCallback)(()=>{n.current.phase!==`idle`&&I({type:`cancel`}),j()},[j,I]);return(0,f.useEffect)(()=>(l(),()=>{j()}),[j]),(0,f.useMemo)(()=>({menuProps:{onPointerDown:U,[c]:``},triggerProps:{onPointerDown:W,onContextMenu:K},isTriggerClickFromPress:Y,cancel:Q}),[U,W,K,Y,Q])}export{z as a,Q as i,K as n,y as o,$ as r,U as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,l as n}from"./themeProps-Bo2jNkIC.js";var r=e(t(),1),i=n(),a=[];function o(e){let t=(0,r.createContext)(e);return t.displayName=`LayerScopedContext`,a.push(n=>(0,i.jsx)(t,{value:e,children:n})),t}function s({children:e}){let[t]=(0,r.useState)(()=>a.slice());return t.reduceRight((e,t)=>t(e),e)}function c(...e){return t=>{let n=[];for(let r of e)if(typeof r==`function`){let e=r(t);n.push(typeof e==`function`?e:()=>r(null))}else if(r!=null){let e=r;e.current=t,n.push(()=>{e.current=null})}if(t!=null&&n.length>0)return()=>{for(let e of n)e()}}}function l(e,t,n,i,a,o){return(0,r.useMemo)(()=>c(e,t,n,i,a,o),[e,t,n,i,a,o])}export{o as i,c as n,s as r,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{d as n,h as r,p as i}from"./coarsePointer-B10KWVuz.js";import{S as a,f as o,m as s,v as c}from"./useClickableContainer-B08uXDf4.js";var l={"--astryx-press-alpha":`var(--astryx-press-alpha)`,__varGroupHash__:`x1qqxm5o`};i[`--duration-exit`],`${i[`--duration-exit`]}${a.duration}`;var u=l[`--astryx-press-alpha`];`${n[`--color-overlay-hover`]}${n[`--color-overlay-hover`]}`,`${n[`--color-overlay-pressed`]}${n[`--color-overlay-pressed`]}`,`${n[`--color-neutral`]}${n[`--color-neutral`]}`,`${n[`--color-overlay-pressed`]}${u}`,r[`--ease-exit`];var d={backgroundColor:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`xem8lmn xogcwkh`,kyAemX:`x1t1ddl7`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kWkggS:`xjbqb8w x1anq1lc x1s5nr2v x13ugjdw xl8sb5e xoevpu5 xprvw0a`,kKwaWg:`x7ngsy6 xubczrd`,$$css:!0},backgroundImage:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`xem8lmn xogcwkh`,kyAemX:`x1t1ddl7`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kKwaWg:`x7uyq82 x3f84ok x7ngsy6 xubczrd xmvprkv xetgvay`,$$css:!0},backgroundImageOnNeutral:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`xem8lmn xogcwkh`,kyAemX:`x1t1ddl7`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kKwaWg:`x14bno8m xzmimnh xvbnuu x5rw36h x1qxwyo6 x1otsd3y xo3fi6e`,$$css:!0},pressedBackgroundColor:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`xem8lmn xogcwkh`,kyAemX:`x1t1ddl7`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,kWkggS:`x1anq1lc x1s5nr2v x13ugjdw xl8sb5e`,kKwaWg:`x7ngsy6 xubczrd`,$$css:!0},pressedAlpha:{"--astryx-press-alpha":`x11z29ks xli5ek3`,kKVMdj:`x14e4jsf`,k44tkh:`xem8lmn xogcwkh`,kyAemX:`x1t1ddl7`,kWV6AL:`xziyay6`,"--_press-paint":`xz2mauf`,"--_press-paint-image":`x1l7afqf`,$$css:!0}},f=e(t(),1),p=(0,f.createContext)(null);p.displayName=`LinkContext`;function m(e){function t({href:t,to:n,ref:r,...i}){return!c(t)||!c(n)?(0,f.createElement)(`a`,{ref:r,...i}):e===`a`?(0,f.createElement)(`a`,{ref:r,...i,href:t}):(0,f.createElement)(e,{ref:r,...i,href:t,to:n??t})}return t.displayName=`SafeLink(${typeof e==`string`?e:e.displayName||e.name||`Component`})`,t}function h(e){let t=(0,f.use)(p),n=e??t?.component??`a`;return(0,f.useMemo)(()=>m(n),[n])}function g(){return(0,f.useEffect)(()=>o(),[]),s}export{l as i,h as n,d as r,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,l as n}from"./themeProps-Bo2jNkIC.js";import{r,t as i}from"./coarsePointer-B10KWVuz.js";import{R as a}from"./useLayerDismissal-DwwLDEpO.js";import{i as o}from"./sharedResizeObserver-Ce0raAy-.js";import{k as s,v as c}from"./scrollView-DKN9Tc2s.js";import{_ as ee,a as l,c as u,d,f,i as p,l as m,m as te,n as h,o as g,u as ne}from"./useIsHydrating-DmtPcCGm.js";import{j as re,k as _}from"./scroll-74w_rjcI.js";var v=e(t(),1);function y(e){return d(e)&&!e.inert&&e.getAttribute(`aria-hidden`)!==`true`}function b(e){for(let t=e;t!=null;t=t.parent){let e=t.dialogRef.current;if(d(e))return e}return null}var x=[];function S(e){let t=x.indexOf(e);t!==-1&&x.splice(t,1),e.open&&x.push(e)}function C(e){let t=x.indexOf(e);t!==-1&&x.splice(t,1)}function ie(){for(let e=x.length-1;e>=0;--e)if(y(x[e]))return x[e];return null}function ae(e){for(let t=x.length-1;t>=0;--t){let n=x[t];if(n!==e&&y(n))return n;if(d(n))return`covered`}let t=null;for(let n of document.querySelectorAll(`dialog`))n!==e&&!x.includes(n)&&y(n)&&(t=n);return t}function w(){for(let e of document.querySelectorAll(`dialog`))if(d(e))return!0;return!1}var T=new Map;function E(e,t,n,r){let i=T.get(e);i??(i={polite:[],assertive:[]},T.set(e,i));let a=i[n].find(e=>e.text===t);a??(a={text:t,receipts:[]},i[n].push(a)),a.receipts.push(r);let o=a;r.withdraw=()=>D(e,n,o,r)}function D(e,t,n,r){let i=T.get(e),a=n.receipts.indexOf(r);i==null||!i[t].includes(n)||a<0||(n.receipts.splice(a,1),n.receipts.length===0&&(i[t]=i[t].filter(e=>e!==n),i.polite.length===0&&i.assertive.length===0&&T.delete(e)))}function oe(e,t){let n=T.get(e);n!=null&&(n[t]=[],n.polite.length===0&&n.assertive.length===0&&T.delete(e))}function se(e){let t=T.get(e);if(t!=null){T.delete(e);for(let n of[`polite`,`assertive`])u(t[n],t=>y(e)?M(e,t,n):k(e,t,n))}}function O(){for(let e of[...T.keys()])se(e)}function k(e,t,n){let r=ae(e);if(r===`covered`||r==null&&w()){let r={withdraw:null};return E(e,t,n,r),m(r)}return r==null?p(t,n):M(r,t,n)}function A(e){for(let t of[`polite`,`assertive`])u(ce(e,t),n=>k(e,n,t))}function j(e,t){l(e,t),oe(e,t)}function ce(e,t){let n=f(e,t);if(n==null)return[];let r=te(n);return l(e,t),r}function M(e,t,n=`polite`){if(!y(e))return k(e,t,n);let r=ie();return r!=null&&r!==e&&x.includes(e)?(l(e,n),null):ee(e,t,n,{isExposed:()=>y(e),redirect:t=>u(t,t=>k(e,t,n))})}var N=new WeakMap;function le(e,t,n){let r=N.get(e);if(r==null){let t={frame:requestAnimationFrame(()=>{N.delete(e);let n=b(e);for(let e of[`polite`,`assertive`])t.clears[e]&&(n==null?g(e):j(n,e)),u(t.words[e],t=>n==null?p(t,e):M(n,t,e))}),words:{polite:[],assertive:[]},clears:{polite:!1,assertive:!1}};r=t,N.set(e,r)}let i=r;if(!t){for(let e of i.words[n])for(let t of e.receipts)t.withdraw=null;return i.words[n]=[],i.clears[n]=!0,null}let a=i.words[n].find(e=>e.text===t);a??(a={text:t,receipts:[]},i.words[n].push(a));let o=a,s={withdraw:null};return s.withdraw=()=>{let e=o.receipts.indexOf(s);e<0||(o.receipts.splice(e,1),o.receipts.length===0&&(i.words[n]=i.words[n].filter(e=>e!==o)))},o.receipts.push(s),m(s)}function ue(e){for(let t=e;t!=null;t=t.parent){let e=t.dialogRef.current;if(d(e))return!1;if(t.isOpen&&(e==null||!e.open))return!0}return!1}function de(e,t,n){if(ue(e))return le(e,t,n);let r=b(e);return t?r==null?p(t,n):M(r,t,n):(r==null?g(n):j(r,n),null)}ne({announce:de,announceInModal:M});var fe=n();function P({dialogRef:e,isOpen:t,children:n}){let r=(0,v.use)(h),i=(0,v.useMemo)(()=>({dialogRef:e,isOpen:!1,parent:r}),[e,r]);a(()=>{i.isOpen=t},[i,t]);let s=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let n=e.current;if(n==null||s.current!=null||!t&&!n.open)return;S(n);let r=n.open,i=()=>{a(),C(n),s.current=null},a=()=>c(),c=o(n,{attributes:!0,attributeFilter:[`open`,`inert`,`aria-hidden`]},()=>{n.open!==r&&(r=n.open,S(n)),y(n)||A(n),(!n.open||y(n))&&O(),n.open||i()});s.current={dialog:n,stop:a}},[e,t]),(0,v.useEffect)(()=>()=>{let e=s.current;e!=null&&(s.current=null,e.stop(),A(e.dialog),C(e.dialog),O())},[]),(0,fe.jsx)(h,{value:i,children:n})}var F=[`overflow`,`overscrollBehaviorY`,`scrollbarGutter`],I={overflow:[],overscrollBehaviorY:[],scrollbarGutter:[]},L={overflow:[`overflow`,`overflowX`,`overflowY`],overscrollBehaviorY:[`overscrollBehaviorY`],scrollbarGutter:[`scrollbarGutter`]},R=new Map,z=0;function B(e){let t=e.documentElement,{body:n}=e,r=e.defaultView;if(n==null||r==null)return t;let i=e=>{let t=r.getComputedStyle(e);return(t.overflowX||`visible`)===`visible`&&(t.overflowY||`visible`)===`visible`};return i(t)&&!i(n)?n:t}function pe(e,t){return e===`overflow`?[B(t)]:e===`scrollbarGutter`||t.body==null?[t.documentElement]:[t.documentElement,t.body]}function V(e){let t=R.get(e);if(t==null)return;let n=I[e],r=n[n.length-1];for(let n of t){let{style:t}=n.element;if(r!=null)t[e]=r.value,n.written=r.value;else if(t[e]===n.written){t[e]=``;for(let r of L[e]){let e=n.pageValues[r];e&&(t[r]=e)}}}r??R.delete(e)}function H(e){if(typeof document>`u`)return()=>{};z+=1;let t=z,n=[];for(let r of F){let i=e[r];i!=null&&(I[r].length===0&&R.set(r,pe(r,document).map(e=>{let t={};for(let n of L[r])t[n]=e.style[n];return{element:e,pageValues:t,written:``}})),I[r].push({id:t,value:i}),n.push(r),V(r))}let r=!1;return()=>{if(!r){r=!0;for(let e of n){let n=I[e],r=n.findIndex(e=>e.id===t);r!==-1&&n.splice(r,1),V(e)}}}}var U=0,me=new Set;function W(e){let t=U>0;U=Math.max(0,U+e);let n=U>0;if(n!==t)for(let e of[...me])e(n)}var he=5,G=new WeakMap;function K(e){return e.touches==null?[]:Array.from(e.touches)}function ge(e){let t={decisions:new Set,touch:null,unsubscribers:[],stopPointerDown:null,stopWatchingPointer:null,onPointerDown:n=>{if(n.pointerType!==`touch`&&n.pointerType!==`pen`)return;t.stopPointerDown?.(),t.stopPointerDown=null;let r=e.defaultView;q(e,t),i(r)&&(J(e,t,!0),t.touch={id:null,x:n.clientX,y:n.clientY,verdict:null})},onTouchStart:e=>{let n=K(e),r=t.touch;if(r?.id!=null&&n.some(e=>e.identifier===r.id)&&!Array.from(e.changedTouches).some(e=>e.identifier===r.id))return;let i=n[0];t.touch=n.length===1&&i!=null?{id:i.identifier,x:i.clientX,y:i.clientY,verdict:null}:null},onTouchMove:n=>{let r=K(n),i=r[0];t.touch?.id===null&&r.length===1&&i!=null&&(t.touch={...t.touch,id:i.identifier});let a=t.touch;if(r.length===1&&i!=null&&a!=null&&i.identifier===a.id&&re.get(e)?.isTouchClaimed(a.id)!==!0){if(a.verdict==null){let e=i.clientX-a.x,r=i.clientY-a.y;if(Math.max(Math.abs(e),Math.abs(r))<he)return;let o=n.composedPath()[0]??n.target;a.verdict=[...t.decisions].some(t=>t.decide(o,e,r))}a.verdict&&n.cancelable&&n.preventDefault()}}};return t}function q(e,t){t.stopWatchingPointer??=r(e.defaultView,n=>J(e,t,n))}function J(e,t,n){let r=e.defaultView;if(r!=null&&n!==t.unsubscribers.length>0){if(n)t.unsubscribers=[s(r,`touchstart`,t.onTouchStart),s(r,`touchmove`,t.onTouchMove,{cancels:!0})];else{for(let e of t.unsubscribers.splice(0))e();t.touch=null}}}function _e(e,t){let n=G.get(e);n??(n=ge(e),G.set(e,n));let r=n,a={decide:t};r.decisions.add(a);let o=e.defaultView;r.decisions.size===1&&o!=null&&(r.stopPointerDown=s(o,`pointerdown`,r.onPointerDown),i(o)&&(q(e,r),J(e,r,!0)));let c=!0;return()=>{c&&(c=!1,r.decisions.delete(a),r.decisions.size===0&&(r.stopPointerDown?.(),r.stopPointerDown=null,r.stopWatchingPointer?.(),r.stopWatchingPointer=null,J(e,r,!1)))}}function Y(e,t,n,r,i){let a=n?0:r,o=n?i:0;if(_(e,a,o))return!0;if(!_(e,-a,-o))return!1;let s=n?t.overscrollBehaviorY:t.overscrollBehaviorX;return s===`contain`||s===`none`}function X(e,t){let n=e.ownerDocument.defaultView?.CSS;return typeof n?.supports==`function`&&n.supports(`selector(${t})`)&&e.matches(t)}function ve(e,t){return t.position===`fixed`||X(e,`:modal`)||X(e,`:popover-open`)}function ye(e){return(e.defaultView?.visualViewport?.scale??1)>1}function be(e){return e.matches(`input[type="range"]:not(:disabled)`)}function xe(e,t,n){if(!(e instanceof Node))return!1;let r=e.ownerDocument??document,i=r.defaultView;if(i==null)return!1;let a=Math.abs(n)>=Math.abs(t);for(let o=e;o!=null;o=c(o)){if(!(o instanceof Element))continue;if(be(o))return!0;if(o===r.documentElement||o===r.body||o===r.scrollingElement)break;let e=i.getComputedStyle(o);if(Y(o,e,a,t,n))return!0;if(ve(o,e))break}return!1}var Z={settle(){},release(){}};function Se(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`scrollbar-gutter`,`stable`)}function Ce(e){if(typeof window>`u`||typeof document>`u`)return Z;let t=document.documentElement.clientWidth;if(t===0||window.innerWidth<=t)return Z;if(Se()){let e=null;return{settle(){e??=H({scrollbarGutter:`stable`})},release(){e?.(),e=null}}}let n=e.style.paddingRight,r=e.getBoundingClientRect().width,i=!1,a=!1;return{settle(){if(a)return;a=!0;let t=e.getBoundingClientRect().width-r;if(t<=0)return;let n=Number.parseFloat(window.getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${n+t}px`,i=!0},release(){i&&=(e.style.paddingRight=n,!1)}}}var Q=0,$=null;function we(e){(0,v.useEffect)(()=>{if(e){if(Q===0){let e=Ce(document.documentElement),t=H({overflow:`hidden`,overscrollBehaviorY:`none`}),n=_e(document,(e,t,n)=>!ye(document)&&!xe(e,t,n));e.settle(),$={releaseRootStyle:t,releasePageHold:n,gutter:e}}return Q+=1,W(1),()=>{if(--Q,W(-1),Q!==0||$==null)return;let e=$;$=null,e.releasePageHold(),e.releaseRootStyle(),e.gutter.release()}}},[e])}export{P as n,we as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t}from"./themeProps-Bo2jNkIC.js";import{A as n,D as r}from"./Icon-Cd9sDRzY.js";import{i,n as a}from"./focusableSelector-kxmVieoO.js";import{i as o,t as s}from"./sharedResizeObserver-Ce0raAy-.js";var c={reset:{kAzted:`x2lwn1j`,k7Eaqz:`xeuugli`,$$css:!0}},l={center:{kSGwAc:`xamitd3`,$$css:!0},end:{kSGwAc:`xpvyfi4`,$$css:!0},start:{kSGwAc:`xqcrz7y`,$$css:!0},stretch:{kSGwAc:`xkh2ocl`,$$css:!0}},u={fill:{kzQI83:`x1iyjqo2`,$$css:!0},static:{kzQI83:`x1c4vz4f`,kmuXW:`x2lah0s`,$$css:!0}};function d({crossAlignSelf:e,size:t}={}){return[c.reset,u[t??`static`],e!=null&&l[e]]}var f=e(t(),1),p={"@astryx.scrollRegion.label":`Content`},m={attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`],characterData:!0,childList:!0,subtree:!0};function h(e,t){let n=!0,r=null,c=null,l=()=>{if(r=null,!n)return;let o=getComputedStyle(e),s=a(o.writingMode,o.direction),l=i(e,`inline`,s),u=i(e,`block`,s);if(l==null||u==null)return;let d=l.isScrollable||u.isScrollable;d!==c&&(c=d,t(d))},u=()=>{n&&r==null&&(r=window.requestAnimationFrame(l))},d=new Map,f=()=>{let t=new Set(Array.from(e.children));for(let[e,n]of d)t.has(e)||(n(),d.delete(e));for(let e of t)d.has(e)||d.set(e,s(e,u))},p=()=>{f(),u()};l(),f();let h=s(e,u),g=o(e,m,p);window.addEventListener(`resize`,u),window.visualViewport?.addEventListener(`resize`,u),e.addEventListener(`load`,u,!0),e.addEventListener(`transitionend`,u),e.addEventListener(`animationend`,u);let _=document.fonts;return _?.addEventListener?.(`loadingdone`,u),_?.ready.then(u),()=>{n=!1,r!=null&&(window.cancelAnimationFrame(r),r=null),h(),g();for(let e of d.values())e();d.clear(),window.removeEventListener(`resize`,u),window.visualViewport?.removeEventListener(`resize`,u),e.removeEventListener(`load`,u,!0),e.removeEventListener(`transitionend`,u),e.removeEventListener(`animationend`,u),_?.removeEventListener?.(`loadingdone`,u)}}n(p);function g({isScrollable:e,role:t,label:n}){let i=r(),[a,o]=(0,f.useState)(!1),s=t!=null,c=(0,f.useCallback)(t=>{if(t==null||!e||s)o(!1);else return h(t,o)},[s,e]),l=!s&&e&&a;return{ref:c,role:t??(l?`group`:void 0),"aria-label":n??(l?i(`@astryx.scrollRegion.label`):void 0)}}export{h as n,d as r,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,u as n}from"./themeProps-Bo2jNkIC.js";import{n as r}from"./useMergedRefs-S6y2xAId.js";import{t as i}from"./mergeProps-ptS-gIMz.js";import{R as a}from"./useLayerDismissal-DwwLDEpO.js";import{a as o,i as s,n as c,r as l,t as u}from"./focusableSelector-kxmVieoO.js";import{t as d}from"./sharedResizeObserver-Ce0raAy-.js";var f=e(t(),1),p=new WeakMap;function m(e,t){p.set(e,t)}function h(e){p.delete(e)}function g(e){return p.get(e)}var _=new Set([`article`,`banner`,`complementary`,`contentinfo`,`definition`,`directory`,`document`,`figure`,`form`,`generic`,`group`,`heading`,`list`,`listitem`,`main`,`navigation`,`none`,`note`,`paragraph`,`presentation`,`region`,`section`,`status`,`table`,`term`]);function v(e){if(e.tabIndex<0||e.matches(`:disabled`)||e.closest(`[inert], [hidden]`)!=null||e.getClientRects().length===0)return!1;let t=getComputedStyle(e).visibility;return t!==`hidden`&&t!==`collapse`}function y(e,t){let n=t.querySelectorAll(u),r=t!==e&&t.matches(`button:not([disabled]), a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child`)&&v(t)?t:null;for(let e of n)if(!(r!=null&&e.tabIndex<=0)&&v(e)){if(e.tabIndex>0)return null;r??=e}if(r==null||r.tabIndex!==0||!r.matches(`a[href], button`)||r.closest(`[aria-hidden="true"]`)!=null||r.matches(`[aria-disabled="true"], [aria-haspopup]:not([aria-haspopup="false"])`))return null;let i=r;for(;i!=null&&i!==e;){let e=i.getAttribute(`role`)?.trim().toLowerCase(),t=i===r&&(e===`button`&&r.localName===`button`||e===`link`&&r.localName===`a`);if(e!=null&&e!==``&&!t&&!_.has(e)||i===r&&e!=null&&e!==``&&!t||i.hasAttribute(`aria-activedescendant`)||i.isContentEditable||i.matches(`[contenteditable]:not([contenteditable="false"])`)||g(i)!=null)return null;let n=getComputedStyle(i);if(/^(auto|scroll|overlay)$/.test(n.overflowX)&&i.scrollWidth>i.clientWidth+1||/^(auto|scroll|overlay)$/.test(n.overflowY)&&i.scrollHeight>i.clientHeight+1)return null;i=i.parentElement}return i===e?r:null}function b(e,t){let n=e.ownerDocument,r=n.defaultView;if(r==null)return()=>{};let i=null,a=null,o=null,s,c,l=()=>{i=null,a=null,r.clearTimeout(s),c?.(),c=void 0},u=t=>{if(l(),!(t.key!==`Tab`||t.ctrlKey||t.metaKey)){if(i=t,a=t.target,t.shiftKey&&o!=null&&n.activeElement===o&&e.contains(o)){let t=e.getAttribute(`tabindex`);e.tabIndex=-1,c=()=>{e.getAttribute(`tabindex`)===`-1`&&(t==null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t))}}s=r.setTimeout(l,0)}},d=r=>{let s=i,c=a;if(l(),r.target!==e){e.contains(r.target)||(o=null);return}if(o=null,s==null||s.shiftKey||s.defaultPrevented||s.eventPhase!==0||r.relatedTarget!=null&&r.relatedTarget!==c)return;let u=y(e,t);u!=null&&(o=u,u.focus(),n.activeElement!==u&&(o=null))};return n.addEventListener(`keydown`,u,!0),n.addEventListener(`keyup`,l,!0),n.addEventListener(`pointerdown`,l,!0),n.addEventListener(`focusin`,d,!0),r.addEventListener(`blur`,l),()=>{l(),n.removeEventListener(`keydown`,u,!0),n.removeEventListener(`keyup`,l,!0),n.removeEventListener(`pointerdown`,l,!0),n.removeEventListener(`focusin`,d,!0),r.removeEventListener(`blur`,l)}}var x={isScrollable:!1,atStart:!0,atEnd:!0},S={inline:x,block:x},C={inline:!1,block:!1},w={inline:`x`,block:`y`,inlineReversed:!1,blockReversed:!1},T=[`inline`,`block`],E={overflow:(e,t)=>[{kXHlph:e==null?e:`xyto64x`,kORKVm:t==null?t:`x4ncuvb`,$$css:!0},{"--x-overflowX":e??void 0,"--x-overflowY":t??void 0}]};function D(e,t){return e===t||e===`both`}function O(e,t){return e.inline.isScrollable===t.inline.isScrollable&&e.inline.atStart===t.inline.atStart&&e.inline.atEnd===t.inline.atEnd&&e.block.isScrollable===t.block.isScrollable&&e.block.atStart===t.block.atStart&&e.block.atEnd===t.block.atEnd}function k(e,t){return e.inline===t.inline&&e.block===t.block}function A(e,t){return e.inline===t.inline&&e.block===t.block&&e.inlineReversed===t.inlineReversed&&e.blockReversed===t.blockReversed}function j(e){if(e==null)return;let t={...e};return delete t.overflow,delete t.overflowX,delete t.overflowY,delete t.overflowInline,delete t.overflowBlock,t}function M(e){let t=(0,f.useRef)(void 0),n=(0,f.useRef)(null);return(0,f.useCallback)(i=>{if(n.current!=null&&Object.is(t.current,i))return n.current;let a=r(i,e);return t.current=i,n.current=a,a},[e])}function N({axis:e,keyboardAccess:t,overscroll:r=`allow`,stickyContainment:u=`whenScrollable`}){let[p,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(null),[y,N]=(0,f.useState)(S),[P,F]=(0,f.useState)(C),[I,L]=(0,f.useState)(w),R=(0,f.useRef)(S),z=(0,f.useRef)(null),B=(0,f.useCallback)(e=>{g(t=>t===e?t:e)},[]),V=(0,f.useCallback)(e=>{v(t=>t===e?t:e)},[]),H=M(B),U=M(V);a(()=>{if(p==null||_==null)return;let t=null,n=!0,r=w,i=C,a=e=>{R.current=e,m(p,e),N(t=>O(t,e)?t:e)},u=()=>{let t=getComputedStyle(p),n=c(t.writingMode,t.direction),o=D(e,`inline`)?l(p,`inline`,n):!1,u=D(e,`block`)?l(p,`block`,n):!1,d=D(e,`inline`)?s(p,`inline`,n):x,f=D(e,`block`)?s(p,`block`,n):x;if(o==null||u==null||d==null||f==null)return;let m={inline:o,block:u},h={inline:d,block:f};r=n,i=m,F(e=>k(e,m)?e:m),a(h),L(e=>A(e,n)?e:n)},f=()=>{t=null,u()},g=()=>{n&&t==null&&(t=window.requestAnimationFrame(f))},v=()=>{if(!n||t!=null)return;let s=R.current,c=s;for(let t of T){if(!D(e,t))continue;let n=o(p,t,r);if(n==null)return;if(n.overflows!==i[t]||n.contradictsMapping){g();return}let a=s[t];!a.isScrollable||a.atStart===n.atStart&&a.atEnd===n.atEnd||(c={...c,[t]:{isScrollable:!0,atStart:n.atStart,atEnd:n.atEnd}})}c!==s&&a(c)};m(p,R.current),z.current=u,f();let y=d(p,g),b=d(_,g);p.addEventListener(`scroll`,v,{passive:!0}),window.addEventListener(`resize`,g),window.visualViewport?.addEventListener(`resize`,g),_.addEventListener(`load`,g,!0),p.addEventListener(`transitionend`,g),p.addEventListener(`animationend`,g),_.addEventListener(`transitionend`,g),_.addEventListener(`animationend`,g);let S=typeof MutationObserver>`u`?null:new MutationObserver(g);S?.observe(p,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`]}),S?.observe(_,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`],characterData:!0,childList:!0,subtree:!0});let E=p.parentElement;for(;E!=null;)S?.observe(E,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`]}),E=E.parentElement;let j=document.fonts;return j?.addEventListener?.(`loadingdone`,g),j?.ready.then(g),()=>{n=!1,z.current=null,h(p),y(),b(),S?.disconnect(),p.removeEventListener(`scroll`,v),window.removeEventListener(`resize`,g),window.visualViewport?.removeEventListener(`resize`,g),_.removeEventListener(`load`,g,!0),p.removeEventListener(`transitionend`,g),p.removeEventListener(`animationend`,g),_.removeEventListener(`transitionend`,g),_.removeEventListener(`animationend`,g),j?.removeEventListener?.(`loadingdone`,g),t!=null&&window.cancelAnimationFrame(t)}},[e,_,p]);let W=(0,f.useRef)(C),G=(0,f.useRef)(w);a(()=>{let e=W.current,t=P.inline&&!e.inline||P.block&&!e.block,n=I!==G.current;W.current=P,G.current=I,(t||n)&&z.current?.()},[P,I]);let K=(0,f.useMemo)(()=>({inline:D(e,`inline`)?y.inline:x,block:D(e,`block`)?y.block:x}),[e,y]),q=K.inline.isScrollable||K.block.isScrollable;return a(()=>{if(t.owner===`contentOrViewport`&&q&&p!=null&&_!=null)return b(p,_)},[_,q,t.owner,p]),{getViewportProps:(0,f.useCallback)((a={})=>{let o=K.inline.isScrollable||K.block.isScrollable,s=D(e,`inline`)&&I.inline===`x`||D(e,`block`)&&I.block===`x`,c=D(e,`inline`)&&I.inline===`y`||D(e,`block`)&&I.block===`y`,l=P.inline&&I.inline===`x`||P.block&&I.block===`x`,d=P.inline&&I.inline===`y`||P.block&&I.block===`y`,f=l||d||u===`always`,m=u===`always`?s:l,h=u===`always`?c:d,{xstyle:g,..._}=a,v={..._,style:j(_.style)},y=i(v,n(g,E.overflow(f?m?`auto`:`hidden`:`clip`,f?h?`auto`:`hidden`:`clip`))),b=t.owner!==`content`,x=(!b||!o)&&p!=null&&typeof document<`u`&&document.activeElement===p,S={...y.style},C=r===`contain`&&K.inline.isScrollable,w=r===`contain`&&K.block.isScrollable,T=I.inline,O=I.block;D(e,`inline`)&&(S[T===`x`?`overscrollBehaviorX`:`overscrollBehaviorY`]=C?`contain`:`auto`),D(e,`block`)&&(S[O===`x`?`overscrollBehaviorX`:`overscrollBehaviorY`]=w?`contain`:`auto`);let k=t.owner===`content`?{}:{role:t.role??`group`,"aria-label":t.label,tabIndex:b&&o?0:x?-1:void 0};return{...y,...k,ref:H(y.ref),style:S,"data-scroll-axis":e,"data-scrollable-inline":K.inline.isScrollable?`true`:void 0,"data-scrollable-block":K.block.isScrollable?`true`:void 0,"data-scroll-inline-start":K.inline.atStart?`true`:void 0,"data-scroll-inline-end":K.inline.atEnd?`true`:void 0,"data-scroll-block-start":K.block.atStart?`true`:void 0,"data-scroll-block-end":K.block.atEnd?`true`:void 0}},[e,H,t,I,P,r,K,u,p]),getContentProps:(0,f.useCallback)((e={})=>({...e,ref:U(e.ref),"data-scroll-content":``}),[U]),state:K}}export{b as n,N as t};
|