{"version":3,"file":"chakra-vendor-Cs2d-5ra.js","sources":["../../node_modules/react/cjs/react-jsx-runtime.production.js","../../node_modules/react/jsx-runtime.js","../../node_modules/@chakra-ui/react/dist/esm/utils/cx.js","../../node_modules/@chakra-ui/react/dist/esm/create-context.js","../../node_modules/@chakra-ui/react/dist/esm/utils/call-all.js","../../node_modules/@chakra-ui/react/dist/esm/merge-props.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/empty.js","../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Parser.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/stylis/src/Middleware.js","../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../../node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js","../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../../node_modules/@chakra-ui/react/dist/esm/merge-refs.js","../../node_modules/@chakra-ui/react/dist/esm/utils/compact.js","../../node_modules/@chakra-ui/react/dist/esm/utils/interop.js","../../node_modules/@chakra-ui/react/dist/esm/utils/is.js","../../node_modules/@chakra-ui/react/dist/esm/utils/ref.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/provider.js","../../node_modules/@chakra-ui/react/dist/esm/utils/split-props.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/use-resolved-props.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/factory.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/use-recipe.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/create-recipe-context.js","../../node_modules/@chakra-ui/react/dist/esm/components/grid/grid.js","../../node_modules/@zag-js/dom-query/dist/index.mjs","../../node_modules/@ark-ui/react/dist/utils/create-context.js","../../node_modules/@ark-ui/react/dist/providers/locale/use-locale-context.js","../../node_modules/@ark-ui/react/dist/utils/compose-refs.js","../../node_modules/proxy-compare/dist/index.js","../../node_modules/@zag-js/store/dist/index.mjs","../../node_modules/@zag-js/utils/dist/index.mjs","../../node_modules/@zag-js/core/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/factory.js","../../node_modules/@ark-ui/react/dist/utils/create-split-props.js","../../node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js","../../node_modules/@zag-js/types/dist/index.mjs","../../node_modules/@zag-js/presence/dist/index.mjs","../../node_modules/@zag-js/react/dist/index.mjs","../../node_modules/@ark-ui/react/dist/utils/use-event.js","../../node_modules/@ark-ui/react/dist/components/presence/use-presence.js","../../node_modules/@ark-ui/react/dist/components/presence/use-presence-context.js","../../node_modules/@zag-js/anatomy/dist/index.mjs","../../node_modules/@zag-js/accordion/dist/index.mjs","../../node_modules/@zag-js/collapsible/dist/index.mjs","../../node_modules/@ark-ui/react/dist/providers/environment/use-environment-context.js","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../node_modules/@zag-js/popper/dist/index.mjs","../../node_modules/@zag-js/interact-outside/dist/index.mjs","../../node_modules/@zag-js/dismissable/dist/index.mjs","../../node_modules/@zag-js/color-picker/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/avatar/use-avatar-context.js","../../node_modules/@ark-ui/react/dist/components/avatar/avatar-fallback.js","../../node_modules/@ark-ui/react/dist/components/avatar/avatar-image.js","../../node_modules/@zag-js/avatar/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js","../../node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js","../../node_modules/@ark-ui/react/dist/components/avatar/avatar-root-provider.js","../../node_modules/@zag-js/focus-visible/dist/index.mjs","../../node_modules/@zag-js/checkbox/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox.anatomy.js","../../node_modules/@ark-ui/react/dist/components/field/use-field-context.js","../../node_modules/@ark-ui/react/dist/components/color-picker/color-picker.anatomy.js","../../node_modules/@zag-js/collection/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/collection.js","../../node_modules/@zag-js/dialog/dist/index.mjs","../../node_modules/@zag-js/editable/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-input.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/field.anatomy.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@zag-js/auto-resize/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/field/field-textarea.js","../../node_modules/@ark-ui/react/dist/components/fieldset/fieldset.anatomy.js","../../node_modules/@zag-js/file-upload/dist/index.mjs","../../node_modules/@zag-js/hover-card/dist/index.mjs","../../node_modules/@zag-js/menu/dist/index.mjs","../../node_modules/@zag-js/number-input/dist/index.mjs","../../node_modules/@zag-js/pin-input/dist/index.mjs","../../node_modules/@zag-js/popover/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/portal/portal.js","../../node_modules/@ark-ui/react/dist/components/progress/use-progress-context.js","../../node_modules/@ark-ui/react/dist/components/progress/progress-label.js","../../node_modules/@ark-ui/react/dist/components/progress/progress-range.js","../../node_modules/@zag-js/progress/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/progress/use-progress.js","../../node_modules/@ark-ui/react/dist/components/progress/progress-root.js","../../node_modules/@ark-ui/react/dist/components/progress/progress-root-provider.js","../../node_modules/@ark-ui/react/dist/components/progress/progress-track.js","../../node_modules/@ark-ui/react/dist/components/progress/progress-value-text.js","../../node_modules/@zag-js/qr-code/dist/index.mjs","../../node_modules/@zag-js/element-rect/dist/index.mjs","../../node_modules/@zag-js/radio-group/dist/index.mjs","../../node_modules/@zag-js/rating-group/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/segment-group/use-segment-group-context.js","../../node_modules/@ark-ui/react/dist/components/segment-group/segment-group.anatomy.js","../../node_modules/@ark-ui/react/dist/components/segment-group/segment-group-indicator.js","../../node_modules/@ark-ui/react/dist/components/segment-group/use-segment-group-item-context.js","../../node_modules/@ark-ui/react/dist/components/segment-group/use-segment-group-item-props-context.js","../../node_modules/@ark-ui/react/dist/components/segment-group/segment-group-item.js","../../node_modules/@ark-ui/react/dist/components/segment-group/segment-group-item-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/segment-group/segment-group-item-text.js","../../node_modules/@ark-ui/react/dist/components/segment-group/use-segment-group.js","../../node_modules/@ark-ui/react/dist/components/segment-group/segment-group-root.js","../../node_modules/@ark-ui/react/dist/components/segment-group/segment-group-root-provider.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-context.js","../../node_modules/@ark-ui/react/dist/components/select/select-clear-trigger.js","../../node_modules/@ark-ui/react/dist/components/select/select-content.js","../../node_modules/@ark-ui/react/dist/components/select/select-context.js","../../node_modules/@ark-ui/react/dist/components/select/select-control.js","../../node_modules/@ark-ui/react/dist/components/select/select-hidden-select.js","../../node_modules/@ark-ui/react/dist/components/select/select-indicator.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-context.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-props-context.js","../../node_modules/@ark-ui/react/dist/components/select/select-item.js","../../node_modules/@ark-ui/react/dist/components/select/use-select-item-group-props.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-group.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-group-label.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-indicator.js","../../node_modules/@ark-ui/react/dist/components/select/select-item-text.js","../../node_modules/@ark-ui/react/dist/components/select/select-label.js","../../node_modules/@ark-ui/react/dist/components/select/select-positioner.js","../../node_modules/@zag-js/select/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/select/use-select.js","../../node_modules/@ark-ui/react/dist/components/select/select-root.js","../../node_modules/@ark-ui/react/dist/components/select/select-root-provider.js","../../node_modules/@ark-ui/react/dist/components/select/select-trigger.js","../../node_modules/@ark-ui/react/dist/components/select/select-value-text.js","../../node_modules/@zag-js/slider/dist/index.mjs","../../node_modules/@zag-js/switch/dist/index.mjs","../../node_modules/@zag-js/toast/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/toast/create-toaster.js","../../node_modules/@ark-ui/react/dist/components/toast/use-toast-context.js","../../node_modules/@ark-ui/react/dist/components/toast/toast-action-trigger.js","../../node_modules/@ark-ui/react/dist/components/toast/toast-close-trigger.js","../../node_modules/@ark-ui/react/dist/components/toast/toast-description.js","../../node_modules/@ark-ui/react/dist/components/toast/toast-root.js","../../node_modules/@ark-ui/react/dist/components/toast/toast-title.js","../../node_modules/@ark-ui/react/dist/components/toast/toaster.js","../../node_modules/@zag-js/tooltip/dist/index.mjs","../../node_modules/@chakra-ui/react/dist/esm/styled-system/color-mix.js","../../node_modules/@chakra-ui/react/dist/esm/utils/clone.js","../../node_modules/@chakra-ui/react/dist/esm/utils/merge.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/config.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/css-var.js","../../node_modules/@chakra-ui/react/dist/esm/preset-base.js","../../node_modules/@pandacss/is-valid-prop/dist/index.mjs","../../node_modules/@chakra-ui/react/dist/esm/utils/walk-object.js","../../node_modules/@chakra-ui/react/dist/esm/utils/flatten.js","../../node_modules/fast-safe-stringify/index.js","../../node_modules/@chakra-ui/react/dist/esm/utils/memo.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/unit-conversion.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/breakpoints.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/conditions.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/sort-at-params.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/sort-at-rules.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/css.js","../../node_modules/@chakra-ui/react/dist/esm/utils/omit.js","../../node_modules/@chakra-ui/react/dist/esm/utils/uniq.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/cva.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/layers.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/normalize.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/preflight.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/serialize.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/sva.js","../../node_modules/@chakra-ui/react/dist/esm/utils/create-props.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/esc.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/expand-reference.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/map-to-json.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/references.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/calc.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/token-middleware.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/token-transforms.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/token-dictionary.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/utility.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/system.js","../../node_modules/@chakra-ui/react/dist/esm/theme/breakpoints.js","../../node_modules/@chakra-ui/react/dist/esm/theme/global-css.js","../../node_modules/@chakra-ui/react/dist/esm/theme/layer-styles.js","../../node_modules/@chakra-ui/react/dist/esm/theme/motion-styles.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/badge.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/button.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/checkmark.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/code.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/color-swatch.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/container.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/heading.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/icon.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/input.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/input-addon.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/kbd.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/link.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/mark.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/radiomark.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/separator.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/skeleton.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/skip-nav-link.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/spinner.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/textarea.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes.js","../../node_modules/@chakra-ui/react/dist/esm/theme/semantic-tokens/colors.js","../../node_modules/@chakra-ui/react/dist/esm/theme/semantic-tokens/radii.js","../../node_modules/@chakra-ui/react/dist/esm/theme/semantic-tokens/shadows.js","../../node_modules/@chakra-ui/react/dist/esm/anatomy.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/accordion.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/action-bar.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/alert.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/avatar.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/blockquote.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/breadcrumb.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/card.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/checkbox.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/checkbox-card.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/collapsible.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/color-picker.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/data-list.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/dialog.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/drawer.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/editable.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/empty-state.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/field.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/fieldset.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/file-upload.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/hover-card.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/list.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/menu.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/select.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/native-select.js","../../node_modules/@chakra-ui/react/dist/esm/utils/entries.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/number-input.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/pin-input.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/popover.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/progress.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/progress-circle.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/qr-code.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/radio-card.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/radio-group.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/rating-group.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/segment-group.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/slider.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/stat.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/status.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/steps.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/switch.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/table.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/tabs.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/tag.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/timeline.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/toast.js","../../node_modules/@chakra-ui/react/dist/esm/theme/recipes/tooltip.js","../../node_modules/@chakra-ui/react/dist/esm/theme/slot-recipes.js","../../node_modules/@chakra-ui/react/dist/esm/theme/text-styles.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/animations.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/aspect-ratios.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/blurs.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/borders.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/colors.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/cursor.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/durations.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/easings.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/font-sizes.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/font-weights.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/fonts.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/keyframes.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/letter-spacing.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/line-heights.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/radius.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/spacing.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/sizes.js","../../node_modules/@chakra-ui/react/dist/esm/theme/tokens/z-indices.js","../../node_modules/@chakra-ui/react/dist/esm/theme/index.js","../../node_modules/@chakra-ui/react/dist/esm/preset.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/use-slot-recipe.js","../../node_modules/@chakra-ui/react/dist/esm/styled-system/create-slot-recipe-context.js","../../node_modules/@chakra-ui/react/dist/esm/components/icons.js","../../node_modules/@chakra-ui/react/dist/esm/utils/attr.js","../../node_modules/@chakra-ui/react/dist/esm/components/group/group.js","../../node_modules/@chakra-ui/react/dist/esm/components/avatar/avatar.js","../../node_modules/@chakra-ui/react/dist/esm/components/badge/badge.js","../../node_modules/@chakra-ui/react/dist/esm/components/box/box.js","../../node_modules/@chakra-ui/react/dist/esm/components/box/span.js","../../node_modules/@chakra-ui/react/dist/esm/components/center/absolute-center.js","../../node_modules/@chakra-ui/react/dist/esm/components/spinner/spinner.js","../../node_modules/@chakra-ui/react/dist/esm/components/loader/loader.js","../../node_modules/@chakra-ui/react/dist/esm/components/button/button.js","../../node_modules/@chakra-ui/react/dist/esm/components/button/icon-button.js","../../node_modules/@chakra-ui/react/dist/esm/components/card/card.js","../../node_modules/@chakra-ui/react/dist/esm/components/show/show.js","../../node_modules/@chakra-ui/react/dist/esm/components/client-only/client-only.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../node_modules/@chakra-ui/react/dist/esm/components/flex/flex.js","../../node_modules/@chakra-ui/react/dist/esm/components/for/for.js","../../node_modules/@chakra-ui/react/dist/esm/components/grid/grid-item.js","../../node_modules/@chakra-ui/react/dist/esm/components/grid/simple-grid.js","../../node_modules/@chakra-ui/react/dist/esm/components/input/input.js","../../node_modules/@chakra-ui/react/dist/esm/components/progress/progress.js","../../node_modules/@chakra-ui/react/dist/esm/components/segment-group/segment-group.js","../../node_modules/@chakra-ui/react/dist/esm/components/select/select.js","../../node_modules/@chakra-ui/react/dist/esm/components/skeleton/skeleton.js","../../node_modules/@chakra-ui/react/dist/esm/components/stack/get-separator-style.js","../../node_modules/@chakra-ui/react/dist/esm/components/stack/stack.js","../../node_modules/@chakra-ui/react/dist/esm/components/stack/h-stack.js","../../node_modules/@chakra-ui/react/dist/esm/components/stack/stack-separator.js","../../node_modules/@chakra-ui/react/dist/esm/components/stat/stat.js","../../node_modules/@chakra-ui/react/dist/esm/components/textarea/textarea.js","../../node_modules/@chakra-ui/react/dist/esm/components/toast/toast.js","../../node_modules/@chakra-ui/react/dist/esm/components/typography/heading.js","../../node_modules/@chakra-ui/react/dist/esm/components/typography/text.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","\"use strict\";\nconst cx = (...classNames) => classNames.filter(Boolean).map((r) => r.trim()).join(\" \");\n\nexport { cx };\n","\"use strict\";\n\"use client\";\nimport { createContext as createContext$1, useContext } from 'react';\n\nfunction getErrorMessage(hook, provider) {\n return `${hook} returned \\`undefined\\`. Seems you forgot to wrap component within ${provider}`;\n}\nfunction createContext(options = {}) {\n const {\n name,\n strict = true,\n hookName = \"useContext\",\n providerName = \"Provider\",\n errorMessage,\n defaultValue\n } = options;\n const Context = createContext$1(defaultValue);\n Context.displayName = name;\n function useContext$1() {\n const context = useContext(Context);\n if (!context && strict) {\n const error = new Error(\n errorMessage ?? getErrorMessage(hookName, providerName)\n );\n error.name = \"ContextError\";\n Error.captureStackTrace?.(error, useContext$1);\n throw error;\n }\n return context;\n }\n return [Context.Provider, useContext$1, Context];\n}\n\nexport { createContext };\n","\"use strict\";\nfunction callAll(...fns) {\n return function mergedFn(...args) {\n fns.forEach((fn) => fn?.(...args));\n };\n}\n\nexport { callAll };\n","\"use strict\";\nimport { callAll } from './utils/call-all.js';\n\nconst clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(\" \");\nconst eventRegex = /^on[A-Z]/;\nfunction mergeProps(...args) {\n let result = {};\n for (let props of args) {\n for (let key in result) {\n if (eventRegex.test(key) && typeof result[key] === \"function\" && typeof props[key] === \"function\") {\n result[key] = callAll(result[key], props[key]);\n continue;\n }\n if (key === \"className\" || key === \"class\") {\n result[key] = clsx(result[key], props[key]);\n continue;\n }\n if (key === \"style\") {\n result[key] = Object.assign({}, result[key] ?? {}, props[key] ?? {});\n continue;\n }\n result[key] = props[key] !== void 0 ? props[key] : result[key];\n }\n for (let key in props) {\n if (result[key] === void 0) {\n result[key] = props[key];\n }\n }\n }\n return result;\n}\n\nexport { mergeProps };\n","\"use strict\";\nconst EMPTY_STYLES = Object.freeze({});\nconst EMPTY_SLOT_STYLES = Object.freeze(\n {}\n);\n\nexport { EMPTY_SLOT_STYLES, EMPTY_STYLES };\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n","var isDevelopment = false;\n\n/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n } // this function should always return with a value\n // TS can't understand it though so we make it stop complaining here\n\n\n return undefined;\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n this.tags.forEach(function (tag) {\n var _tag$parentNode;\n\n return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value;\n var parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' ');\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","var isBrowser = true;\n\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else if (className) {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar isDevelopment = false;\n\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n var componentSelector = interpolation;\n\n if (componentSelector.__emotion_styles !== undefined) {\n\n return componentSelector;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n var keyframes = interpolation;\n\n if (keyframes.anim === 1) {\n cursor = {\n name: keyframes.name,\n styles: keyframes.styles,\n next: cursor\n };\n return keyframes.name;\n }\n\n var serializedStyles = interpolation;\n\n if (serializedStyles.styles !== undefined) {\n var next = serializedStyles.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = serializedStyles.styles + \";\";\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n }\n\n break;\n }\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n var asString = interpolation;\n\n if (registered == null) {\n return asString;\n }\n\n var cached = registered[asString];\n return cached !== undefined ? cached : asString;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var key in obj) {\n var value = obj[key];\n\n if (typeof value !== 'object') {\n var asString = value;\n\n if (registered != null && registered[asString] !== undefined) {\n string += key + \"{\" + registered[asString] + \"}\";\n } else if (isProcessableValue(asString)) {\n string += processStyleName(key) + \":\" + processStyleValue(key, asString) + \";\";\n }\n } else {\n if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(key) + \":\" + processStyleValue(key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n\n string += key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;{]+)\\s*(;|$)/g; // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\nvar cursor;\nfunction serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n var asTemplateStringsArr = strings;\n\n styles += asTemplateStringsArr[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n var templateStringsArr = strings;\n\n styles += templateStringsArr[i];\n }\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n}\n\nexport { serializeStyles };\n","import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isDevelopment = false;\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n return mergedTheme;\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n var WithTheme = /*#__PURE__*/React.forwardRef(function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n });\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar hasOwn = {}.hasOwnProperty;\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n\n var newProps = {};\n\n for (var _key in props) {\n if (hasOwn.call(props, _key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var _key2 in props) {\n if (hasOwn.call(props, _key2) && _key2 !== 'css' && _key2 !== typePropName && (!isDevelopment )) {\n newProps[_key2] = props[_key2];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isDevelopment as i, useTheme as u, withEmotionCache as w };\n","import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isDevelopment } from './emotion-element-f0de968e.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-f0de968e.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar jsx = function jsx(type, props) {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n }\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\n(function (_jsx) {\n var JSX;\n\n (function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));\n})(jsx || (jsx = {}));\n\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false;\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nfunction keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name;\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n}\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && isDevelopment) {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && isDevelopment) {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","\"use strict\";\nfunction assignRef(ref, value) {\n if (ref == null) return;\n if (typeof ref === \"function\") {\n ref(value);\n return;\n }\n try {\n ref.current = value;\n } catch (error) {\n throw new Error(`Cannot assign value '${value}' to ref '${ref}'`);\n }\n}\nfunction mergeRefs(...refs) {\n return (node) => {\n refs.forEach((ref) => {\n assignRef(ref, node);\n });\n };\n}\n\nexport { assignRef, mergeRefs };\n","\"use strict\";\nfunction compact(object) {\n const clone = Object.assign({}, object);\n for (let key in clone) {\n if (clone[key] === void 0) delete clone[key];\n }\n return clone;\n}\n\nexport { compact };\n","\"use strict\";\nfunction interopDefault(mod) {\n return mod.default || mod;\n}\n\nexport { interopDefault };\n","\"use strict\";\nconst isObject = (v) => v != null && typeof v === \"object\" && !Array.isArray(v);\nconst isCssVar = (v) => /^var\\(--.+\\)$/.test(v);\nconst isString = (v) => typeof v === \"string\";\nconst isFunction = (v) => typeof v === \"function\";\n\nexport { isCssVar, isFunction, isObject, isString };\n","\"use strict\";\nimport * as React from 'react';\nimport { isString } from './is.js';\n\nfunction getElementRef(el) {\n const version = React.version;\n if (!isString(version)) return el?.ref;\n if (version.startsWith(\"18.\")) return el?.ref;\n return el?.props?.ref;\n}\n\nexport { getElementRef };\n","\"use strict\";\n\"use client\";\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { Global } from '@emotion/react';\nimport { createContext } from '../create-context.js';\n\nconst [ChakraContextProvider, useChakraContext] = createContext({\n name: \"ChakraContext\",\n strict: true,\n providerName: \"\"\n});\nfunction ChakraProvider(props) {\n const { value: sys, children } = props;\n return /* @__PURE__ */ jsxs(ChakraContextProvider, { value: sys, children: [\n !sys._config.disableLayers && /* @__PURE__ */ jsx(Global, { styles: sys.layers.atRule }),\n /* @__PURE__ */ jsx(Global, { styles: sys._global }),\n children\n ] });\n}\n\nexport { ChakraProvider, useChakraContext };\n","\"use strict\";\nimport { isFunction } from './is.js';\n\nconst splitPropFn = (props, predicate) => {\n const rest = {};\n const result = {};\n const allKeys = Object.keys(props);\n for (const key of allKeys) {\n if (predicate(key)) {\n result[key] = props[key];\n } else {\n rest[key] = props[key];\n }\n }\n return [result, rest];\n};\nconst splitProps = (props, keys) => {\n const predicate = isFunction(keys) ? keys : (key) => keys.includes(key);\n return splitPropFn(props, predicate);\n};\nconst createSplitProps = (keys) => {\n return function split(props) {\n return splitProps(props, keys);\n };\n};\n\nexport { createSplitProps, splitProps };\n","\"use strict\";\nimport { useMemo } from 'react';\nimport { splitProps } from '../utils/split-props.js';\nimport { useChakraContext } from './provider.js';\n\nconst htmlProps = /* @__PURE__ */ new Set([\n \"htmlWidth\",\n \"htmlHeight\",\n \"htmlSize\",\n \"htmlTranslate\"\n]);\nfunction isHtmlProp(prop) {\n return typeof prop === \"string\" && htmlProps.has(prop);\n}\nfunction useResolvedProps(inProps, cvaRecipe, shouldForwardProps) {\n const { css, isValidProperty } = useChakraContext();\n const { children, ...props } = inProps;\n const result = useMemo(() => {\n const [forwardedProps, restProps_B] = splitProps(\n props,\n (key) => shouldForwardProps(key, cvaRecipe.variantKeys)\n );\n const [variantProps, restProps_C] = splitProps(\n restProps_B,\n cvaRecipe.variantKeys\n );\n const [styleProps, elementProps] = splitProps(restProps_C, isValidProperty);\n return {\n forwardedProps,\n variantProps,\n styleProps,\n elementProps\n };\n }, [cvaRecipe.variantKeys, shouldForwardProps, props, isValidProperty]);\n const { css: cssStyles, ...propStyles } = result.styleProps;\n const cvaStyles = useMemo(() => {\n const variantProps = { ...result.variantProps };\n if (!cvaRecipe.variantKeys.includes(\"colorPalette\")) {\n variantProps.colorPalette = props.colorPalette;\n }\n if (!cvaRecipe.variantKeys.includes(\"orientation\")) {\n variantProps.orientation = props.orientation;\n }\n return cvaRecipe(variantProps);\n }, [cvaRecipe, result.variantProps, props.colorPalette, props.orientation]);\n const styles = useMemo(() => {\n return css(cvaStyles, ...toArray(cssStyles), propStyles);\n }, [css, cvaStyles, cssStyles, propStyles]);\n return {\n styles,\n props: {\n ...result.forwardedProps,\n ...result.elementProps,\n children\n }\n };\n}\nconst toArray = (val) => {\n const res = Array.isArray(val) ? val : [val];\n return res.filter(Boolean).flat();\n};\n\nexport { isHtmlProp, useResolvedProps };\n","\"use strict\";\n\"use client\";\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport emotionIsPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport * as React from 'react';\nimport { mergeProps } from '../merge-props.js';\nimport { mergeRefs } from '../merge-refs.js';\nimport { compact } from '../utils/compact.js';\nimport { cx } from '../utils/cx.js';\nimport { interopDefault } from '../utils/interop.js';\nimport { getElementRef } from '../utils/ref.js';\nimport { useChakraContext } from './provider.js';\nimport { useResolvedProps, isHtmlProp } from './use-resolved-props.js';\n\nconst isPropValid = interopDefault(emotionIsPropValid);\nconst testOmitPropsOnStringTag = isPropValid;\nconst testOmitPropsOnComponent = (key) => key !== \"theme\";\nconst composeShouldForwardProps = (tag, options, isReal) => {\n let shouldForwardProp;\n if (options) {\n const optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? (propName) => tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName) : optionsShouldForwardProp;\n }\n if (typeof shouldForwardProp !== \"function\" && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n return shouldForwardProp;\n};\nlet isBrowser = typeof document !== \"undefined\";\nconst Insertion = ({ cache: cache2, serialized, isStringTag }) => {\n registerStyles(cache2, serialized, isStringTag);\n const rules = useInsertionEffectAlwaysWithSyncFallback(\n () => insertStyles(cache2, serialized, isStringTag)\n );\n if (!isBrowser && rules !== void 0) {\n let serializedNames = serialized.name;\n let next = serialized.next;\n while (next !== void 0) {\n serializedNames = cx(serializedNames, next.name);\n next = next.next;\n }\n return /* @__PURE__ */ jsx(\n \"style\",\n {\n ...{\n [`data-emotion`]: cx(cache2.key, serializedNames),\n dangerouslySetInnerHTML: { __html: rules },\n nonce: cache2.sheet.nonce\n }\n }\n );\n }\n return null;\n};\nconst createStyled = (tag, configOrCva = {}, options = {}) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (tag === void 0) {\n throw new Error(\n \"You are trying to create a styled element with an undefined component.\\nYou may have forgotten to import it.\"\n );\n }\n }\n const isReal = tag.__emotion_real === tag;\n const baseTag = isReal && tag.__emotion_base || tag;\n let identifierName;\n let targetClassName;\n if (options !== void 0) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n let styles = [];\n const Styled = withEmotionCache((inProps, cache2, ref) => {\n const { cva, isValidProperty } = useChakraContext();\n const cvaFn = configOrCva.__cva__ ? configOrCva : cva(configOrCva);\n const cvaRecipe = mergeCva(tag.__emotion_cva, cvaFn);\n const createShouldForwardProps = (props2) => {\n return (prop, variantKeys) => {\n if (props2.includes(prop)) return true;\n return !variantKeys?.includes(prop) && !isValidProperty(prop);\n };\n };\n if (!options.shouldForwardProp && options.forwardProps) {\n options.shouldForwardProp = createShouldForwardProps(options.forwardProps);\n }\n const fallbackShouldForwardProp = (prop, variantKeys) => {\n const emotionSfp = typeof tag === \"string\" && tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n const chakraSfp = !variantKeys?.includes(prop) && !isValidProperty(prop);\n return emotionSfp(prop) && chakraSfp;\n };\n const shouldForwardProp = composeShouldForwardProps(tag, options, isReal) || fallbackShouldForwardProp;\n const propsWithDefault = React.useMemo(\n () => Object.assign({}, options.defaultProps, compact(inProps)),\n [inProps]\n );\n const { props, styles: styleProps } = useResolvedProps(\n propsWithDefault,\n cvaRecipe,\n shouldForwardProp\n );\n let className = \"\";\n let classInterpolations = [styleProps];\n let mergedProps = props;\n if (props.theme == null) {\n mergedProps = {};\n for (let key in props) {\n mergedProps[key] = props[key];\n }\n mergedProps.theme = React.useContext(ThemeContext);\n }\n if (typeof props.className === \"string\") {\n className = getRegisteredStyles(\n cache2.registered,\n classInterpolations,\n props.className\n );\n } else if (props.className != null) {\n className = cx(className, props.className);\n }\n const serialized = serializeStyles(\n styles.concat(classInterpolations),\n cache2.registered,\n mergedProps\n );\n className = cx(className, `${cache2.key}-${serialized.name}`);\n if (targetClassName !== void 0) {\n className = cx(className, targetClassName);\n }\n const shouldUseAs = !shouldForwardProp(\"as\");\n let FinalTag = shouldUseAs && props.as || baseTag;\n let finalProps = {};\n for (let prop in props) {\n if (shouldUseAs && prop === \"as\") continue;\n if (isHtmlProp(prop)) {\n const nativeProp = prop.replace(\"html\", \"\").toLowerCase();\n finalProps[nativeProp] = props[prop];\n continue;\n }\n if (shouldForwardProp(prop)) {\n finalProps[prop] = props[prop];\n }\n }\n finalProps.className = className.trim();\n finalProps.ref = ref;\n const forwardAsChild = options.forwardAsChild || options.forwardProps?.includes(\"asChild\");\n if (props.asChild && !forwardAsChild) {\n const child = React.Children.only(props.children);\n FinalTag = child.type;\n finalProps.children = null;\n Reflect.deleteProperty(finalProps, \"asChild\");\n finalProps = mergeProps(finalProps, child.props);\n finalProps.ref = mergeRefs(ref, getElementRef(child));\n }\n if (finalProps.as && forwardAsChild) {\n finalProps.as = void 0;\n return /* @__PURE__ */ jsxs(React.Fragment, { children: [\n /* @__PURE__ */ jsx(\n Insertion,\n {\n cache: cache2,\n serialized,\n isStringTag: typeof FinalTag === \"string\"\n }\n ),\n /* @__PURE__ */ jsx(FinalTag, { asChild: true, ...finalProps, children: /* @__PURE__ */ jsx(props.as, { children: finalProps.children }) })\n ] });\n }\n return /* @__PURE__ */ jsxs(React.Fragment, { children: [\n /* @__PURE__ */ jsx(\n Insertion,\n {\n cache: cache2,\n serialized,\n isStringTag: typeof FinalTag === \"string\"\n }\n ),\n /* @__PURE__ */ jsx(FinalTag, { ...finalProps })\n ] });\n });\n Styled.displayName = identifierName !== void 0 ? identifierName : `chakra(${typeof baseTag === \"string\" ? baseTag : baseTag.displayName || baseTag.name || \"Component\"})`;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_forwardProp = options.shouldForwardProp;\n Styled.__emotion_cva = configOrCva;\n Object.defineProperty(Styled, \"toString\", {\n value() {\n if (targetClassName === void 0 && process.env.NODE_ENV !== \"production\") {\n return \"NO_COMPONENT_SELECTOR\";\n }\n return `.${targetClassName}`;\n }\n });\n return Styled;\n};\nconst styledFn = createStyled.bind();\nconst cache = /* @__PURE__ */ new Map();\nconst chakraImpl = new Proxy(styledFn, {\n apply(_, __, args) {\n return styledFn(...args);\n },\n get(_, el) {\n if (!cache.has(el)) {\n cache.set(el, styledFn(el));\n }\n return cache.get(el);\n }\n});\nconst chakra = chakraImpl;\nconst mergeCva = (cvaA, cvaB) => {\n if (cvaA && !cvaB) return cvaA;\n if (!cvaA && cvaB) return cvaB;\n return cvaA.merge(cvaB);\n};\n\nexport { chakra };\n","\"use strict\";\n\"use client\";\nimport { useMemo } from 'react';\nimport { useChakraContext } from './provider.js';\n\nfunction useRecipe(options) {\n const { key, recipe: recipeProp } = options;\n const sys = useChakraContext();\n return useMemo(() => {\n const recipe = recipeProp || (key != null ? sys.getRecipe(key) : {});\n return sys.cva(structuredClone(recipe));\n }, [key, recipeProp, sys]);\n}\n\nexport { useRecipe };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { useMemo, forwardRef } from 'react';\nimport { createContext } from '../create-context.js';\nimport { mergeProps } from '../merge-props.js';\nimport { cx } from '../utils/cx.js';\nimport { EMPTY_STYLES } from './empty.js';\nimport { chakra } from './factory.js';\nimport { useRecipe } from './use-recipe.js';\n\nconst upperFirst = (str) => str.charAt(0).toUpperCase() + str.slice(1);\nfunction createRecipeContext(options) {\n const { key: recipeKey, recipe: recipeConfig } = options;\n const contextName = upperFirst(\n recipeKey || recipeConfig.className || \"Component\"\n );\n const [PropsProvider, usePropsContext] = createContext({\n strict: false,\n name: `${contextName}PropsContext`,\n providerName: `${contextName}PropsContext`\n });\n function useRecipeResult(props) {\n const { unstyled, ...restProps } = props;\n const recipe = useRecipe({\n key: recipeKey,\n recipe: restProps.recipe || recipeConfig\n });\n const [variantProps, otherProps] = useMemo(\n () => recipe.splitVariantProps(restProps),\n [recipe, restProps]\n );\n const styles = unstyled ? EMPTY_STYLES : recipe(variantProps);\n return {\n styles,\n className: recipe.className,\n props: otherProps\n };\n }\n const withContext = (Component, options2) => {\n const SuperComponent = chakra(Component, {}, options2);\n const StyledComponent = forwardRef((inProps, ref) => {\n const propsContext = usePropsContext();\n const props = useMemo(\n () => mergeProps(propsContext, inProps),\n [inProps, propsContext]\n );\n const { styles, className, props: localProps } = useRecipeResult(props);\n return /* @__PURE__ */ jsx(\n SuperComponent,\n {\n ...localProps,\n ref,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n });\n StyledComponent.displayName = Component.displayName || Component.name;\n return StyledComponent;\n };\n function withPropsProvider() {\n return PropsProvider;\n }\n return {\n withContext,\n PropsProvider,\n withPropsProvider,\n usePropsContext,\n useRecipeResult\n };\n}\n\nexport { createRecipeContext };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst Grid = forwardRef(\n function Grid2(props, ref) {\n const {\n templateAreas,\n column,\n row,\n autoFlow,\n autoRows,\n templateRows,\n autoColumns,\n templateColumns,\n inline,\n ...rest\n } = props;\n return /* @__PURE__ */ jsx(\n chakra.div,\n {\n ...rest,\n ref,\n css: [\n {\n display: inline ? \"inline-grid\" : \"grid\",\n gridTemplateAreas: templateAreas,\n gridAutoColumns: autoColumns,\n gridColumn: column,\n gridRow: row,\n gridAutoFlow: autoFlow,\n gridAutoRows: autoRows,\n gridTemplateRows: templateRows,\n gridTemplateColumns: templateColumns\n },\n props.css\n ]\n }\n );\n }\n);\n\nexport { Grid };\n","// src/shared.ts\nvar clamp = (value) => Math.max(0, Math.min(1, value));\nvar wrap = (v, idx) => {\n return v.map((_, index) => v[(Math.max(idx, 0) + index) % v.length]);\n};\nvar pipe = (...fns) => (arg) => fns.reduce((acc, fn) => fn(acc), arg);\nvar noop = () => void 0;\nvar isObject = (v) => typeof v === \"object\" && v !== null;\nvar MAX_Z_INDEX = 2147483647;\nvar dataAttr = (guard) => guard ? \"\" : void 0;\nvar ariaAttr = (guard) => guard ? \"true\" : void 0;\n\n// src/node.ts\nvar ELEMENT_NODE = 1;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\nvar isHTMLElement = (el) => isObject(el) && el.nodeType === ELEMENT_NODE && typeof el.nodeName === \"string\";\nvar isDocument = (el) => isObject(el) && el.nodeType === DOCUMENT_NODE;\nvar isWindow = (el) => isObject(el) && el === el.window;\nvar isVisualViewport = (el) => isObject(el) && el.constructor.name === \"VisualViewport\";\nvar getNodeName = (node) => {\n if (isHTMLElement(node)) return node.localName || \"\";\n return \"#document\";\n};\nfunction isRootElement(node) {\n return [\"html\", \"body\", \"#document\"].includes(getNodeName(node));\n}\nvar isNode = (el) => isObject(el) && el.nodeType !== void 0;\nvar isShadowRoot = (el) => isNode(el) && el.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in el;\nvar isInputElement = (el) => isHTMLElement(el) && el.localName === \"input\";\nvar isAnchorElement = (el) => !!el?.matches(\"a[href]\");\nvar isElementVisible = (el) => {\n if (!isHTMLElement(el)) return false;\n return el.offsetWidth > 0 || el.offsetHeight > 0 || el.getClientRects().length > 0;\n};\nvar TEXTAREA_SELECT_REGEX = /(textarea|select)/;\nfunction isEditableElement(el) {\n if (el == null || !isHTMLElement(el)) return false;\n try {\n return isInputElement(el) && el.selectionStart != null || TEXTAREA_SELECT_REGEX.test(el.localName) || el.isContentEditable || el.getAttribute(\"contenteditable\") === \"true\" || el.getAttribute(\"contenteditable\") === \"\";\n } catch {\n return false;\n }\n}\nfunction contains(parent, child) {\n if (!parent || !child) return false;\n if (!isHTMLElement(parent) || !isHTMLElement(child)) return false;\n const rootNode = child.getRootNode?.();\n if (parent === child) return true;\n if (parent.contains(child)) return true;\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) return true;\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nfunction getDocument(el) {\n if (isDocument(el)) return el;\n if (isWindow(el)) return el.document;\n return el?.ownerDocument ?? document;\n}\nfunction getDocumentElement(el) {\n return getDocument(el).documentElement;\n}\nfunction getWindow(el) {\n if (isShadowRoot(el)) return getWindow(el.host);\n if (isDocument(el)) return el.defaultView ?? window;\n if (isHTMLElement(el)) return el.ownerDocument?.defaultView ?? window;\n return window;\n}\nfunction getActiveElement(rootNode) {\n let activeElement = rootNode.activeElement;\n while (activeElement?.shadowRoot) {\n const el = activeElement.shadowRoot.activeElement;\n if (el === activeElement) break;\n else activeElement = el;\n }\n return activeElement;\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === \"html\") return node;\n const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\n\n// src/computed-style.ts\nvar styleCache = /* @__PURE__ */ new WeakMap();\nfunction getComputedStyle(el) {\n if (!styleCache.has(el)) {\n styleCache.set(el, getWindow(el).getComputedStyle(el));\n }\n return styleCache.get(el);\n}\n\n// src/data-url.ts\nfunction getDataUrl(svg, opts) {\n const { type, quality = 0.92, background } = opts;\n if (!svg) throw new Error(\"[zag-js > getDataUrl]: Could not find the svg element\");\n const win = getWindow(svg);\n const doc = win.document;\n const svgBounds = svg.getBoundingClientRect();\n const svgClone = svg.cloneNode(true);\n if (!svgClone.hasAttribute(\"viewBox\")) {\n svgClone.setAttribute(\"viewBox\", `0 0 ${svgBounds.width} ${svgBounds.height}`);\n }\n const serializer = new win.XMLSerializer();\n const source = '\\r\\n' + serializer.serializeToString(svgClone);\n const svgString = \"data:image/svg+xml;charset=utf-8,\" + encodeURIComponent(source);\n if (type === \"image/svg+xml\") {\n return Promise.resolve(svgString).then((str) => {\n svgClone.remove();\n return str;\n });\n }\n const dpr = win.devicePixelRatio || 1;\n const canvas = doc.createElement(\"canvas\");\n const image = new win.Image();\n image.src = svgString;\n canvas.width = svgBounds.width * dpr;\n canvas.height = svgBounds.height * dpr;\n const context = canvas.getContext(\"2d\");\n if (type === \"image/jpeg\" || background) {\n context.fillStyle = background || \"white\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n }\n return new Promise((resolve) => {\n image.onload = () => {\n context?.drawImage(image, 0, 0, canvas.width, canvas.height);\n resolve(canvas.toDataURL(type, quality));\n svgClone.remove();\n };\n });\n}\n\n// src/platform.ts\nvar isDom = () => typeof document !== \"undefined\";\nfunction getPlatform() {\n const agent = navigator.userAgentData;\n return agent?.platform ?? navigator.platform;\n}\nfunction getUserAgent() {\n const ua2 = navigator.userAgentData;\n if (ua2 && Array.isArray(ua2.brands)) {\n return ua2.brands.map(({ brand, version }) => `${brand}/${version}`).join(\" \");\n }\n return navigator.userAgent;\n}\nvar pt = (v) => isDom() && v.test(getPlatform());\nvar ua = (v) => isDom() && v.test(getUserAgent());\nvar vn = (v) => isDom() && v.test(navigator.vendor);\nvar isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;\nvar isMac = () => pt(/^Mac/);\nvar isSafari = () => isApple() && vn(/apple/i);\nvar isFirefox = () => ua(/firefox\\//i);\nvar isApple = () => pt(/mac|iphone|ipad|ipod/i);\nvar isIos = () => pt(/iP(hone|ad|od)|iOS/);\nvar isWebKit = () => ua(/AppleWebKit/);\nvar isAndroid = () => {\n const re = /android/i;\n return pt(re) || ua(re);\n};\n\n// src/event.ts\nfunction getBeforeInputValue(event) {\n const { selectionStart, selectionEnd, value } = event.currentTarget;\n return value.slice(0, selectionStart) + event.data + value.slice(selectionEnd);\n}\nfunction getComposedPath(event) {\n return event.composedPath?.() ?? event.nativeEvent?.composedPath?.();\n}\nfunction getEventTarget(event) {\n const composedPath = getComposedPath(event);\n return composedPath?.[0] ?? event.target;\n}\nvar isSelfTarget = (event) => {\n return contains(event.currentTarget, getEventTarget(event));\n};\nfunction isOpeningInNewTab(event) {\n const element = event.currentTarget;\n if (!element) return false;\n const isAppleDevice = isApple();\n if (isAppleDevice && !event.metaKey) return false;\n if (!isAppleDevice && !event.ctrlKey) return false;\n const localName = element.localName;\n if (localName === \"a\") return true;\n if (localName === \"button\" && element.type === \"submit\") return true;\n if (localName === \"input\" && element.type === \"submit\") return true;\n return false;\n}\nfunction isDownloadingEvent(event) {\n const element = event.currentTarget;\n if (!element) return false;\n const localName = element.localName;\n if (!event.altKey) return false;\n if (localName === \"a\") return true;\n if (localName === \"button\" && element.type === \"submit\") return true;\n if (localName === \"input\" && element.type === \"submit\") return true;\n return false;\n}\nfunction isComposingEvent(event) {\n return getNativeEvent(event).isComposing;\n}\nfunction isKeyboardClick(e) {\n return e.detail === 0 || e.clientX === 0 && e.clientY === 0;\n}\nfunction isPrintableKey(e) {\n return e.key.length === 1 && !e.ctrlKey && !e.metaKey;\n}\nfunction isVirtualPointerEvent(e) {\n return e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === \"mouse\";\n}\nfunction isVirtualClick(e) {\n if (e.mozInputSource === 0 && e.isTrusted) return true;\n if (isAndroid() && e.pointerType) {\n return e.type === \"click\" && e.buttons === 1;\n }\n return e.detail === 0 && !e.pointerType;\n}\nvar isLeftClick = (e) => e.button === 0;\nvar isContextMenuEvent = (e) => {\n return e.button === 2 || isMac() && e.ctrlKey && e.button === 0;\n};\nvar isModifierKey = (e) => e.ctrlKey || e.altKey || e.metaKey;\nvar isTouchEvent = (event) => \"touches\" in event && event.touches.length > 0;\nvar keyMap = {\n Up: \"ArrowUp\",\n Down: \"ArrowDown\",\n Esc: \"Escape\",\n \" \": \"Space\",\n \",\": \"Comma\",\n Left: \"ArrowLeft\",\n Right: \"ArrowRight\"\n};\nvar rtlKeyMap = {\n ArrowLeft: \"ArrowRight\",\n ArrowRight: \"ArrowLeft\"\n};\nfunction getEventKey(event, options = {}) {\n const { dir = \"ltr\", orientation = \"horizontal\" } = options;\n let key = event.key;\n key = keyMap[key] ?? key;\n const isRtl = dir === \"rtl\" && orientation === \"horizontal\";\n if (isRtl && key in rtlKeyMap) key = rtlKeyMap[key];\n return key;\n}\nfunction getNativeEvent(event) {\n return event.nativeEvent ?? event;\n}\nvar pageKeys = /* @__PURE__ */ new Set([\"PageUp\", \"PageDown\"]);\nvar arrowKeys = /* @__PURE__ */ new Set([\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"]);\nfunction getEventStep(event) {\n if (event.ctrlKey || event.metaKey) {\n return 0.1;\n } else {\n const isPageKey = pageKeys.has(event.key);\n const isSkipKey = isPageKey || event.shiftKey && arrowKeys.has(event.key);\n return isSkipKey ? 10 : 1;\n }\n}\nfunction getEventPoint(event, type = \"client\") {\n const point = isTouchEvent(event) ? event.touches[0] || event.changedTouches[0] : event;\n return { x: point[`${type}X`], y: point[`${type}Y`] };\n}\nvar addDomEvent = (target, eventName, handler, options) => {\n const node = typeof target === \"function\" ? target() : target;\n node?.addEventListener(eventName, handler, options);\n return () => {\n node?.removeEventListener(eventName, handler, options);\n };\n};\n\n// src/form.ts\nfunction getDescriptor(el, options) {\n const { type = \"HTMLInputElement\", property = \"value\" } = options;\n const proto = getWindow(el)[type].prototype;\n return Object.getOwnPropertyDescriptor(proto, property) ?? {};\n}\nfunction getElementType(el) {\n if (el.localName === \"input\") return \"HTMLInputElement\";\n if (el.localName === \"textarea\") return \"HTMLTextAreaElement\";\n if (el.localName === \"select\") return \"HTMLSelectElement\";\n}\nfunction setElementValue(el, value, property = \"value\") {\n const type = getElementType(el);\n if (type) {\n const descriptor = getDescriptor(el, { type, property });\n descriptor.set?.call(el, value);\n }\n el.setAttribute(property, value);\n}\nfunction setElementChecked(el, checked) {\n const descriptor = getDescriptor(el, { type: \"HTMLInputElement\", property: \"checked\" });\n descriptor.set?.call(el, checked);\n if (checked) el.setAttribute(\"checked\", \"\");\n else el.removeAttribute(\"checked\");\n}\nfunction dispatchInputValueEvent(el, options) {\n const { value, bubbles = true } = options;\n if (!el) return;\n const win = getWindow(el);\n if (!(el instanceof win.HTMLInputElement)) return;\n setElementValue(el, `${value}`);\n el.dispatchEvent(new win.Event(\"input\", { bubbles }));\n}\nfunction dispatchInputCheckedEvent(el, options) {\n const { checked, bubbles = true } = options;\n if (!el) return;\n const win = getWindow(el);\n if (!(el instanceof win.HTMLInputElement)) return;\n setElementChecked(el, checked);\n el.dispatchEvent(new win.Event(\"click\", { bubbles }));\n}\nfunction getClosestForm(el) {\n return isFormElement(el) ? el.form : el.closest(\"form\");\n}\nfunction isFormElement(el) {\n return el.matches(\"textarea, input, select, button\");\n}\nfunction trackFormReset(el, callback) {\n if (!el) return;\n const form = getClosestForm(el);\n const onReset = (e) => {\n if (e.defaultPrevented) return;\n callback();\n };\n form?.addEventListener(\"reset\", onReset, { passive: true });\n return () => form?.removeEventListener(\"reset\", onReset);\n}\nfunction trackFieldsetDisabled(el, callback) {\n const fieldset = el?.closest(\"fieldset\");\n if (!fieldset) return;\n callback(fieldset.disabled);\n const win = getWindow(fieldset);\n const obs = new win.MutationObserver(() => callback(fieldset.disabled));\n obs.observe(fieldset, {\n attributes: true,\n attributeFilter: [\"disabled\"]\n });\n return () => obs.disconnect();\n}\nfunction trackFormControl(el, options) {\n if (!el) return;\n const { onFieldsetDisabledChange, onFormReset } = options;\n const cleanups2 = [trackFormReset(el, onFormReset), trackFieldsetDisabled(el, onFieldsetDisabledChange)];\n return () => cleanups2.forEach((cleanup) => cleanup?.());\n}\n\n// src/tabbable.ts\nvar isFrame = (el) => isHTMLElement(el) && el.tagName === \"IFRAME\";\nvar hasTabIndex = (el) => !Number.isNaN(parseInt(el.getAttribute(\"tabindex\") || \"0\", 10));\nvar hasNegativeTabIndex = (el) => parseInt(el.getAttribute(\"tabindex\") || \"0\", 10) < 0;\nvar focusableSelector = \"input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type\";\nvar getFocusables = (container, includeContainer = false) => {\n if (!container) return [];\n const elements = Array.from(container.querySelectorAll(focusableSelector));\n const include = includeContainer == true || includeContainer == \"if-empty\" && elements.length === 0;\n if (include && isHTMLElement(container) && isFocusable(container)) {\n elements.unshift(container);\n }\n const focusableElements = elements.filter(isFocusable);\n focusableElements.forEach((element, i) => {\n if (isFrame(element) && element.contentDocument) {\n const frameBody = element.contentDocument.body;\n focusableElements.splice(i, 1, ...getFocusables(frameBody));\n }\n });\n return focusableElements;\n};\nfunction isFocusable(element) {\n if (!element || element.closest(\"[inert]\")) return false;\n return element.matches(focusableSelector) && isElementVisible(element);\n}\nfunction getFirstFocusable(container, includeContainer) {\n const [first] = getFocusables(container, includeContainer);\n return first || null;\n}\nfunction getTabbables(container, includeContainer) {\n if (!container) return [];\n const elements = Array.from(container.querySelectorAll(focusableSelector));\n const tabbableElements = elements.filter(isTabbable);\n if (includeContainer && isTabbable(container)) {\n tabbableElements.unshift(container);\n }\n tabbableElements.forEach((element, i) => {\n if (isFrame(element) && element.contentDocument) {\n const frameBody = element.contentDocument.body;\n const allFrameTabbable = getTabbables(frameBody);\n tabbableElements.splice(i, 1, ...allFrameTabbable);\n }\n });\n if (!tabbableElements.length && includeContainer) {\n return elements;\n }\n return tabbableElements;\n}\nfunction isTabbable(el) {\n if (el != null && el.tabIndex > 0) return true;\n return isFocusable(el) && !hasNegativeTabIndex(el);\n}\nfunction getFirstTabbable(container, includeContainer) {\n const [first] = getTabbables(container, includeContainer);\n return first || null;\n}\nfunction getLastTabbable(container, includeContainer) {\n const elements = getTabbables(container, includeContainer);\n return elements[elements.length - 1] || null;\n}\nfunction getTabbableEdges(container, includeContainer) {\n const elements = getTabbables(container, includeContainer);\n const first = elements[0] || null;\n const last = elements[elements.length - 1] || null;\n return [first, last];\n}\nfunction getNextTabbable(container, current) {\n const tabbables = getTabbables(container);\n const doc = container?.ownerDocument || document;\n const currentElement = current ?? doc.activeElement;\n if (!currentElement) return null;\n const index = tabbables.indexOf(currentElement);\n return tabbables[index + 1] || null;\n}\nfunction getTabIndex(node) {\n if (node.tabIndex < 0) {\n if ((/^(audio|video|details)$/.test(node.localName) || isEditableElement(node)) && !hasTabIndex(node)) {\n return 0;\n }\n }\n return node.tabIndex;\n}\n\n// src/initial-focus.ts\nfunction getInitialFocus(options) {\n const { root, getInitialEl, filter, enabled = true } = options;\n if (!enabled) return;\n let node = null;\n node || (node = typeof getInitialEl === \"function\" ? getInitialEl() : getInitialEl);\n node || (node = root?.querySelector(\"[data-autofocus],[autofocus]\"));\n if (!node) {\n const tabbables = getTabbables(root);\n node = filter ? tabbables.filter(filter)[0] : tabbables[0];\n }\n return node || root || void 0;\n}\nfunction isValidTabEvent(event) {\n const container = event.currentTarget;\n if (!container) return false;\n const [firstTabbable, lastTabbable] = getTabbableEdges(container);\n const doc = container.ownerDocument || document;\n if (doc.activeElement === firstTabbable && event.shiftKey) return false;\n if (doc.activeElement === lastTabbable && !event.shiftKey) return false;\n if (!firstTabbable && !lastTabbable) return false;\n return true;\n}\n\n// src/raf.ts\nfunction nextTick(fn) {\n const set2 = /* @__PURE__ */ new Set();\n function raf2(fn2) {\n const id = globalThis.requestAnimationFrame(fn2);\n set2.add(() => globalThis.cancelAnimationFrame(id));\n }\n raf2(() => raf2(fn));\n return function cleanup() {\n set2.forEach((fn2) => fn2());\n };\n}\nfunction raf(fn) {\n const id = globalThis.requestAnimationFrame(fn);\n return () => {\n globalThis.cancelAnimationFrame(id);\n };\n}\nfunction queueBeforeEvent(el, type, cb) {\n const cancelTimer = raf(() => {\n el.removeEventListener(type, exec, true);\n cb();\n });\n const exec = () => {\n cancelTimer();\n cb();\n };\n el.addEventListener(type, exec, { once: true, capture: true });\n return cancelTimer;\n}\n\n// src/mutation-observer.ts\nfunction observeAttributesImpl(node, options) {\n if (!node) return;\n const { attributes, callback: fn } = options;\n const win = node.ownerDocument.defaultView || window;\n const obs = new win.MutationObserver((changes) => {\n for (const change of changes) {\n if (change.type === \"attributes\" && change.attributeName && attributes.includes(change.attributeName)) {\n fn(change);\n }\n }\n });\n obs.observe(node, { attributes: true, attributeFilter: attributes });\n return () => obs.disconnect();\n}\nfunction observeAttributes(nodeOrFn, options) {\n const { defer } = options;\n const func = defer ? raf : (v) => v();\n const cleanups2 = [];\n cleanups2.push(\n func(() => {\n const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn;\n cleanups2.push(observeAttributesImpl(node, options));\n })\n );\n return () => {\n cleanups2.forEach((fn) => fn?.());\n };\n}\nfunction observeChildrenImpl(node, options) {\n const { callback: fn } = options;\n if (!node) return;\n const win = node.ownerDocument.defaultView || window;\n const obs = new win.MutationObserver(fn);\n obs.observe(node, { childList: true, subtree: true });\n return () => obs.disconnect();\n}\nfunction observeChildren(nodeOrFn, options) {\n const { defer } = options;\n const func = defer ? raf : (v) => v();\n const cleanups2 = [];\n cleanups2.push(\n func(() => {\n const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn;\n cleanups2.push(observeChildrenImpl(node, options));\n })\n );\n return () => {\n cleanups2.forEach((fn) => fn?.());\n };\n}\n\n// src/navigate.ts\nfunction clickIfLink(el) {\n const click = () => el.click();\n if (isFirefox()) {\n queueBeforeEvent(el, \"keyup\", click);\n } else {\n queueMicrotask(click);\n }\n}\n\n// src/overflow.ts\nfunction getNearestOverflowAncestor(el) {\n const parentNode = getParentNode(el);\n if (isRootElement(parentNode)) return getDocument(parentNode).body;\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(el, list = []) {\n const scrollableAncestor = getNearestOverflowAncestor(el);\n const isBody = scrollableAncestor === el.ownerDocument.body;\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));\n}\nvar getElementRect = (el) => {\n if (isHTMLElement(el)) return el.getBoundingClientRect();\n if (isVisualViewport(el)) return { top: 0, left: 0, bottom: el.height, right: el.width };\n return { top: 0, left: 0, bottom: el.innerHeight, right: el.innerWidth };\n};\nfunction isInView(el, ancestor) {\n if (!isHTMLElement(el)) return true;\n const ancestorRect = getElementRect(ancestor);\n const elRect = el.getBoundingClientRect();\n return elRect.top >= ancestorRect.top && elRect.left >= ancestorRect.left && elRect.bottom <= ancestorRect.bottom && elRect.right <= ancestorRect.right;\n}\nvar OVERFLOW_RE = /auto|scroll|overlay|hidden|clip/;\nfunction isOverflowElement(el) {\n const win = getWindow(el);\n const { overflow, overflowX, overflowY, display } = win.getComputedStyle(el);\n return OVERFLOW_RE.test(overflow + overflowY + overflowX) && ![\"inline\", \"contents\"].includes(display);\n}\nfunction isScrollable(el) {\n return el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth;\n}\nfunction scrollIntoView(el, options) {\n const { rootEl, ...scrollOptions } = options || {};\n if (!el || !rootEl) return;\n if (!isOverflowElement(rootEl) || !isScrollable(rootEl)) return;\n el.scrollIntoView(scrollOptions);\n}\nfunction getScrollPosition(element) {\n if (isHTMLElement(element)) {\n return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop };\n }\n return { scrollLeft: element.scrollX, scrollTop: element.scrollY };\n}\n\n// src/point.ts\nfunction getRelativePoint(point, element) {\n const { left, top, width, height } = element.getBoundingClientRect();\n const offset = { x: point.x - left, y: point.y - top };\n const percent = { x: clamp(offset.x / width), y: clamp(offset.y / height) };\n function getPercentValue(options = {}) {\n const { dir = \"ltr\", orientation = \"horizontal\", inverted } = options;\n const invertX = typeof inverted === \"object\" ? inverted.x : inverted;\n const invertY = typeof inverted === \"object\" ? inverted.y : inverted;\n if (orientation === \"horizontal\") {\n return dir === \"rtl\" || invertX ? 1 - percent.x : percent.x;\n }\n return invertY ? 1 - percent.y : percent.y;\n }\n return { offset, percent, getPercentValue };\n}\n\n// src/pointer-lock.ts\nfunction requestPointerLock(doc, fn) {\n const body = doc.body;\n const supported = \"pointerLockElement\" in doc || \"mozPointerLockElement\" in doc;\n const isLocked = () => !!doc.pointerLockElement;\n function onPointerChange() {\n fn?.(isLocked());\n }\n function onPointerError(event) {\n if (isLocked()) fn?.(false);\n console.error(\"PointerLock error occurred:\", event);\n doc.exitPointerLock();\n }\n if (!supported) return;\n try {\n body.requestPointerLock();\n } catch {\n }\n const cleanup = [\n addDomEvent(doc, \"pointerlockchange\", onPointerChange, false),\n addDomEvent(doc, \"pointerlockerror\", onPointerError, false)\n ];\n return () => {\n cleanup.forEach((cleanup2) => cleanup2());\n doc.exitPointerLock();\n };\n}\n\n// src/text-selection.ts\nvar state = \"default\";\nvar userSelect = \"\";\nvar elementMap = /* @__PURE__ */ new WeakMap();\nfunction disableTextSelectionImpl(options = {}) {\n const { target, doc } = options;\n const docNode = doc ?? document;\n const rootEl = docNode.documentElement;\n if (isIos()) {\n if (state === \"default\") {\n userSelect = rootEl.style.webkitUserSelect;\n rootEl.style.webkitUserSelect = \"none\";\n }\n state = \"disabled\";\n } else if (target) {\n elementMap.set(target, target.style.userSelect);\n target.style.userSelect = \"none\";\n }\n return () => restoreTextSelection({ target, doc: docNode });\n}\nfunction restoreTextSelection(options = {}) {\n const { target, doc } = options;\n const docNode = doc ?? document;\n const rootEl = docNode.documentElement;\n if (isIos()) {\n if (state !== \"disabled\") return;\n state = \"restoring\";\n setTimeout(() => {\n nextTick(() => {\n if (state === \"restoring\") {\n if (rootEl.style.webkitUserSelect === \"none\") {\n rootEl.style.webkitUserSelect = userSelect || \"\";\n }\n userSelect = \"\";\n state = \"default\";\n }\n });\n }, 300);\n } else {\n if (target && elementMap.has(target)) {\n const prevUserSelect = elementMap.get(target);\n if (target.style.userSelect === \"none\") {\n target.style.userSelect = prevUserSelect ?? \"\";\n }\n if (target.getAttribute(\"style\") === \"\") {\n target.removeAttribute(\"style\");\n }\n elementMap.delete(target);\n }\n }\n}\nfunction disableTextSelection(options = {}) {\n const { defer, target, ...restOptions } = options;\n const func = defer ? raf : (v) => v();\n const cleanups2 = [];\n cleanups2.push(\n func(() => {\n const node = typeof target === \"function\" ? target() : target;\n cleanups2.push(disableTextSelectionImpl({ ...restOptions, target: node }));\n })\n );\n return () => {\n cleanups2.forEach((fn) => fn?.());\n };\n}\n\n// src/pointer-move.ts\nfunction trackPointerMove(doc, handlers) {\n const { onPointerMove, onPointerUp } = handlers;\n const handleMove = (event) => {\n const point = getEventPoint(event);\n const distance = Math.sqrt(point.x ** 2 + point.y ** 2);\n const moveBuffer = event.pointerType === \"touch\" ? 10 : 5;\n if (distance < moveBuffer) return;\n if (event.pointerType === \"mouse\" && event.button === 0) {\n onPointerUp();\n return;\n }\n onPointerMove({ point, event });\n };\n const cleanups2 = [\n addDomEvent(doc, \"pointermove\", handleMove, false),\n addDomEvent(doc, \"pointerup\", onPointerUp, false),\n addDomEvent(doc, \"pointercancel\", onPointerUp, false),\n addDomEvent(doc, \"contextmenu\", onPointerUp, false),\n disableTextSelection({ doc })\n ];\n return () => {\n cleanups2.forEach((cleanup) => cleanup());\n };\n}\n\n// src/press.ts\nfunction trackPress(options) {\n const {\n pointerNode,\n keyboardNode = pointerNode,\n onPress,\n onPressStart,\n onPressEnd,\n isValidKey = (e) => e.key === \"Enter\"\n } = options;\n if (!pointerNode) return noop;\n const win = getWindow(pointerNode);\n const doc = getDocument(pointerNode);\n let removeStartListeners = noop;\n let removeEndListeners = noop;\n let removeAccessibleListeners = noop;\n const getInfo = (event) => ({\n point: getEventPoint(event),\n event\n });\n function startPress(event) {\n onPressStart?.(getInfo(event));\n }\n function cancelPress(event) {\n onPressEnd?.(getInfo(event));\n }\n const startPointerPress = (startEvent) => {\n removeEndListeners();\n const endPointerPress = (endEvent) => {\n const target = getEventTarget(endEvent);\n if (contains(pointerNode, target)) {\n onPress?.(getInfo(endEvent));\n } else {\n onPressEnd?.(getInfo(endEvent));\n }\n };\n const removePointerUpListener = addDomEvent(win, \"pointerup\", endPointerPress, { passive: !onPress });\n const removePointerCancelListener = addDomEvent(win, \"pointercancel\", cancelPress, { passive: !onPressEnd });\n removeEndListeners = pipe(removePointerUpListener, removePointerCancelListener);\n if (doc.activeElement === keyboardNode && startEvent.pointerType === \"mouse\") {\n startEvent.preventDefault();\n }\n startPress(startEvent);\n };\n const removePointerListener = addDomEvent(pointerNode, \"pointerdown\", startPointerPress, { passive: !onPressStart });\n const removeFocusListener = addDomEvent(keyboardNode, \"focus\", startAccessiblePress);\n removeStartListeners = pipe(removePointerListener, removeFocusListener);\n function startAccessiblePress() {\n const handleKeydown = (keydownEvent) => {\n if (!isValidKey(keydownEvent)) return;\n const handleKeyup = (keyupEvent) => {\n if (!isValidKey(keyupEvent)) return;\n const evt2 = new win.PointerEvent(\"pointerup\");\n const info = getInfo(evt2);\n onPress?.(info);\n onPressEnd?.(info);\n };\n removeEndListeners();\n removeEndListeners = addDomEvent(keyboardNode, \"keyup\", handleKeyup);\n const evt = new win.PointerEvent(\"pointerdown\");\n startPress(evt);\n };\n const handleBlur = () => {\n const evt = new win.PointerEvent(\"pointercancel\");\n cancelPress(evt);\n };\n const removeKeydownListener = addDomEvent(keyboardNode, \"keydown\", handleKeydown);\n const removeBlurListener = addDomEvent(keyboardNode, \"blur\", handleBlur);\n removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener);\n }\n return () => {\n removeStartListeners();\n removeEndListeners();\n removeAccessibleListeners();\n };\n}\n\n// src/proxy-tab-focus.ts\nfunction proxyTabFocusImpl(container, options = {}) {\n const { triggerElement, onFocus } = options;\n const doc = container?.ownerDocument || document;\n const body = doc.body;\n function onKeyDown(event) {\n if (event.key !== \"Tab\") return;\n let elementToFocus = null;\n const [firstTabbable, lastTabbable] = getTabbableEdges(container, true);\n const noTabbableElements = !firstTabbable && !lastTabbable;\n if (event.shiftKey && (doc.activeElement === firstTabbable || noTabbableElements)) {\n elementToFocus = triggerElement;\n } else if (!event.shiftKey && doc.activeElement === triggerElement) {\n elementToFocus = firstTabbable;\n } else if (!event.shiftKey && (doc.activeElement === lastTabbable || noTabbableElements)) {\n elementToFocus = getNextTabbable(body, triggerElement);\n }\n if (!elementToFocus) return;\n event.preventDefault();\n if (typeof onFocus === \"function\") {\n onFocus(elementToFocus);\n } else {\n elementToFocus.focus();\n }\n }\n return addDomEvent(doc, \"keydown\", onKeyDown, true);\n}\nfunction proxyTabFocus(container, options) {\n const { defer, triggerElement, ...restOptions } = options;\n const func = defer ? raf : (v) => v();\n const cleanups2 = [];\n cleanups2.push(\n func(() => {\n const node = typeof container === \"function\" ? container() : container;\n const trigger = typeof triggerElement === \"function\" ? triggerElement() : triggerElement;\n cleanups2.push(proxyTabFocusImpl(node, { triggerElement: trigger, ...restOptions }));\n })\n );\n return () => {\n cleanups2.forEach((fn) => fn?.());\n };\n}\n\n// src/query.ts\nfunction queryAll(root, selector) {\n return Array.from(root?.querySelectorAll(selector) ?? []);\n}\nfunction query(root, selector) {\n return root?.querySelector(selector) ?? null;\n}\nvar defaultItemToId = (v) => v.id;\nfunction itemById(v, id, itemToId = defaultItemToId) {\n return v.find((item) => itemToId(item) === id);\n}\nfunction indexOfId(v, id, itemToId = defaultItemToId) {\n const item = itemById(v, id, itemToId);\n return item ? v.indexOf(item) : -1;\n}\nfunction nextById(v, id, loop = true) {\n let idx = indexOfId(v, id);\n idx = loop ? (idx + 1) % v.length : Math.min(idx + 1, v.length - 1);\n return v[idx];\n}\nfunction prevById(v, id, loop = true) {\n let idx = indexOfId(v, id);\n if (idx === -1) return loop ? v[v.length - 1] : null;\n idx = loop ? (idx - 1 + v.length) % v.length : Math.max(0, idx - 1);\n return v[idx];\n}\n\n// src/scope.ts\nfunction createScope(methods) {\n const dom = {\n getRootNode: (ctx) => ctx.getRootNode?.() ?? document,\n getDoc: (ctx) => getDocument(dom.getRootNode(ctx)),\n getWin: (ctx) => dom.getDoc(ctx).defaultView ?? window,\n getActiveElement: (ctx) => getActiveElement(dom.getRootNode(ctx)),\n isActiveElement: (ctx, elem) => elem === dom.getActiveElement(ctx),\n getById: (ctx, id) => dom.getRootNode(ctx).getElementById(id),\n setValue: (elem, value) => {\n if (elem == null || value == null) return;\n setElementValue(elem, value.toString());\n }\n };\n return { ...dom, ...methods };\n}\n\n// src/searchable.ts\nvar sanitize = (str) => str.split(\"\").map((char) => {\n const code = char.charCodeAt(0);\n if (code > 0 && code < 128) return char;\n if (code >= 128 && code <= 255) return `/x${code.toString(16)}`.replace(\"/\", \"\\\\\");\n return \"\";\n}).join(\"\").trim();\nvar getValueText = (el) => {\n return sanitize(el.dataset?.valuetext ?? el.textContent ?? \"\");\n};\nvar match = (valueText, query2) => {\n return valueText.trim().toLowerCase().startsWith(query2.toLowerCase());\n};\nfunction getByText(v, text, currentId, itemToId = defaultItemToId) {\n const index = currentId ? indexOfId(v, currentId, itemToId) : -1;\n let items = currentId ? wrap(v, index) : v;\n const isSingleKey = text.length === 1;\n if (isSingleKey) {\n items = items.filter((item) => itemToId(item) !== currentId);\n }\n return items.find((item) => match(getValueText(item), text));\n}\n\n// src/set.ts\nvar cleanups = /* @__PURE__ */ new WeakMap();\nfunction set(element, key, setup) {\n if (!cleanups.has(element)) {\n cleanups.set(element, /* @__PURE__ */ new Map());\n }\n const elementCleanups = cleanups.get(element);\n const prevCleanup = elementCleanups.get(key);\n if (!prevCleanup) {\n elementCleanups.set(key, setup());\n return () => {\n elementCleanups.get(key)?.();\n elementCleanups.delete(key);\n };\n }\n const cleanup = setup();\n const nextCleanup = () => {\n cleanup();\n prevCleanup();\n elementCleanups.delete(key);\n };\n elementCleanups.set(key, nextCleanup);\n return () => {\n const isCurrent = elementCleanups.get(key) === nextCleanup;\n if (!isCurrent) return;\n cleanup();\n elementCleanups.set(key, prevCleanup);\n };\n}\nfunction setAttribute(element, attr, value) {\n const setup = () => {\n const previousValue = element.getAttribute(attr);\n element.setAttribute(attr, value);\n return () => {\n if (previousValue == null) {\n element.removeAttribute(attr);\n } else {\n element.setAttribute(attr, previousValue);\n }\n };\n };\n return set(element, attr, setup);\n}\nfunction setProperty(element, property, value) {\n const setup = () => {\n const exists = property in element;\n const previousValue = element[property];\n element[property] = value;\n return () => {\n if (!exists) {\n delete element[property];\n } else {\n element[property] = previousValue;\n }\n };\n };\n return set(element, property, setup);\n}\nfunction setStyle(element, style) {\n if (!element) return () => {\n };\n const setup = () => {\n const prevStyle = element.style.cssText;\n Object.assign(element.style, style);\n return () => {\n element.style.cssText = prevStyle;\n };\n };\n return set(element, \"style\", setup);\n}\n\n// src/typeahead.ts\nfunction getByTypeaheadImpl(baseItems, options) {\n const { state: state2, activeId, key, timeout = 350, itemToId } = options;\n const search = state2.keysSoFar + key;\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const query2 = isRepeated ? search[0] : search;\n let items = baseItems.slice();\n const next = getByText(items, query2, activeId, itemToId);\n function cleanup() {\n clearTimeout(state2.timer);\n state2.timer = -1;\n }\n function update(value) {\n state2.keysSoFar = value;\n cleanup();\n if (value !== \"\") {\n state2.timer = +setTimeout(() => {\n update(\"\");\n cleanup();\n }, timeout);\n }\n }\n update(search);\n return next;\n}\nvar getByTypeahead = /* @__PURE__ */ Object.assign(getByTypeaheadImpl, {\n defaultOptions: { keysSoFar: \"\", timer: -1 },\n isValidEvent: isValidTypeaheadEvent\n});\nfunction isValidTypeaheadEvent(event) {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey;\n}\n\n// src/visual-viewport.ts\nfunction trackVisualViewport(doc, fn) {\n const win = doc?.defaultView || window;\n const onResize = () => {\n fn?.(getViewportSize(win));\n };\n onResize();\n return addDomEvent(win.visualViewport ?? win, \"resize\", onResize);\n}\nfunction getViewportSize(win) {\n return {\n width: win.visualViewport?.width || win.innerWidth,\n height: win.visualViewport?.height || win.innerHeight\n };\n}\n\n// src/visually-hidden.ts\nvar visuallyHiddenStyle = {\n border: \"0\",\n clip: \"rect(0 0 0 0)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0\",\n position: \"absolute\",\n width: \"1px\",\n whiteSpace: \"nowrap\",\n wordWrap: \"normal\"\n};\nfunction setVisuallyHidden(el) {\n Object.assign(el.style, visuallyHiddenStyle);\n}\n\n// src/wait-for.ts\nvar fps = 1e3 / 60;\nfunction waitForElement(query2, cb) {\n const el = query2();\n if (isHTMLElement(el) && el.isConnected) {\n cb(el);\n return () => void 0;\n } else {\n const timerId = setInterval(() => {\n const el2 = query2();\n if (isHTMLElement(el2) && el2.isConnected) {\n cb(el2);\n clearInterval(timerId);\n }\n }, fps);\n return () => clearInterval(timerId);\n }\n}\nfunction waitForElements(queries, cb) {\n const cleanups2 = [];\n queries?.forEach((query2) => {\n const clean = waitForElement(query2, cb);\n cleanups2.push(clean);\n });\n return () => {\n cleanups2.forEach((fn) => fn());\n };\n}\n\nexport { MAX_Z_INDEX, addDomEvent, ariaAttr, clickIfLink, contains, createScope, dataAttr, defaultItemToId, disableTextSelection, dispatchInputCheckedEvent, dispatchInputValueEvent, getActiveElement, getBeforeInputValue, getByText, getByTypeahead, getComputedStyle, getDataUrl, getDocument, getDocumentElement, getEventKey, getEventPoint, getEventStep, getEventTarget, getFirstFocusable, getFirstTabbable, getFocusables, getInitialFocus, getLastTabbable, getNativeEvent, getNearestOverflowAncestor, getNextTabbable, getNodeName, getOverflowAncestors, getParentNode, getPlatform, getRelativePoint, getScrollPosition, getTabIndex, getTabbableEdges, getTabbables, getUserAgent, getWindow, indexOfId, isAnchorElement, isAndroid, isApple, isComposingEvent, isContextMenuEvent, isDocument, isDom, isDownloadingEvent, isEditableElement, isElementVisible, isFirefox, isFocusable, isHTMLElement, isInView, isInputElement, isIos, isKeyboardClick, isLeftClick, isMac, isModifierKey, isNode, isOpeningInNewTab, isOverflowElement, isPrintableKey, isRootElement, isSafari, isSelfTarget, isShadowRoot, isTabbable, isTouchDevice, isTouchEvent, isValidTabEvent, isVirtualClick, isVirtualPointerEvent, isVisualViewport, isWebKit, isWindow, itemById, nextById, nextTick, observeAttributes, observeChildren, prevById, proxyTabFocus, query, queryAll, queueBeforeEvent, raf, requestPointerLock, restoreTextSelection, scrollIntoView, setAttribute, setElementChecked, setElementValue, setProperty, setStyle, setVisuallyHidden, trackFormControl, trackPointerMove, trackPress, trackVisualViewport, visuallyHiddenStyle, waitForElement, waitForElements };\n","'use client';\nimport { createContext as createContext$1, useContext } from 'react';\n\nfunction getErrorMessage(hook, provider) {\n return `${hook} returned \\`undefined\\`. Seems you forgot to wrap component within ${provider}`;\n}\nfunction createContext(options = {}) {\n const {\n name,\n strict = true,\n hookName = \"useContext\",\n providerName = \"Provider\",\n errorMessage,\n defaultValue\n } = options;\n const Context = createContext$1(defaultValue);\n Context.displayName = name;\n function useContext$1() {\n const context = useContext(Context);\n if (!context && strict) {\n const error = new Error(errorMessage ?? getErrorMessage(hookName, providerName));\n error.name = \"ContextError\";\n Error.captureStackTrace?.(error, useContext$1);\n throw error;\n }\n return context;\n }\n return [Context.Provider, useContext$1, Context];\n}\n\nexport { createContext };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [LocaleContextProvider, useLocaleContext] = createContext({\n name: \"LocaleContext\",\n hookName: \"useLocaleContext\",\n providerName: \"\",\n strict: false,\n defaultValue: { dir: \"ltr\", locale: \"en-US\" }\n});\n\nexport { LocaleContextProvider, useLocaleContext };\n","function setRef(ref, value) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n for (const ref of refs) {\n setRef(ref, node);\n }\n };\n}\n\nexport { composeRefs };\n","/* eslint @typescript-eslint/no-explicit-any: off */\n// symbols\nconst TRACK_MEMO_SYMBOL = Symbol();\nconst GET_ORIGINAL_SYMBOL = Symbol();\n// properties\nconst AFFECTED_PROPERTY = 'a';\nconst IS_TARGET_COPIED_PROPERTY = 'f';\nconst PROXY_PROPERTY = 'p';\nconst PROXY_CACHE_PROPERTY = 'c';\nconst TARGET_CACHE_PROPERTY = 't';\nconst HAS_KEY_PROPERTY = 'h';\nconst ALL_OWN_KEYS_PROPERTY = 'w';\nconst HAS_OWN_KEY_PROPERTY = 'o';\nconst KEYS_PROPERTY = 'k';\n// function to create a new bare proxy\nlet newProxy = (target, handler) => new Proxy(target, handler);\n// get object prototype\nconst getProto = Object.getPrototypeOf;\nconst objectsToTrack = new WeakMap();\n// check if obj is a plain object or an array\nconst isObjectToTrack = (obj) => obj &&\n (objectsToTrack.has(obj)\n ? objectsToTrack.get(obj)\n : getProto(obj) === Object.prototype || getProto(obj) === Array.prototype);\n// check if it is object\nconst isObject = (x) => typeof x === 'object' && x !== null;\n// Properties that are both non-configurable and non-writable will break\n// the proxy get trap when we try to return a recursive/child compare proxy\n// from them. We can avoid this by making a copy of the target object with\n// all descriptors marked as configurable, see `copyTargetObject`.\n// See: https://github.com/dai-shi/proxy-compare/pull/8\nconst needsToCopyTargetObject = (obj) => Object.values(Object.getOwnPropertyDescriptors(obj)).some((descriptor) => !descriptor.configurable && !descriptor.writable);\n// Make a copy with all descriptors marked as configurable.\nconst copyTargetObject = (obj) => {\n if (Array.isArray(obj)) {\n // Arrays need a special way to copy\n return Array.from(obj);\n }\n // For non-array objects, we create a new object keeping the prototype\n // with changing all configurable options (otherwise, proxies will complain)\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n Object.values(descriptors).forEach((desc) => {\n desc.configurable = true;\n });\n return Object.create(getProto(obj), descriptors);\n};\nconst createProxyHandler = (origObj, isTargetCopied) => {\n const state = {\n [IS_TARGET_COPIED_PROPERTY]: isTargetCopied,\n };\n let trackObject = false; // for trackMemo\n const recordUsage = (type, key) => {\n if (!trackObject) {\n let used = state[AFFECTED_PROPERTY].get(origObj);\n if (!used) {\n used = {};\n state[AFFECTED_PROPERTY].set(origObj, used);\n }\n if (type === ALL_OWN_KEYS_PROPERTY) {\n used[ALL_OWN_KEYS_PROPERTY] = true;\n }\n else {\n let set = used[type];\n if (!set) {\n set = new Set();\n used[type] = set;\n }\n set.add(key);\n }\n }\n };\n const recordObjectAsUsed = () => {\n trackObject = true;\n state[AFFECTED_PROPERTY].delete(origObj);\n };\n const handler = {\n get(target, key) {\n if (key === GET_ORIGINAL_SYMBOL) {\n return origObj;\n }\n recordUsage(KEYS_PROPERTY, key);\n return createProxy(Reflect.get(target, key), state[AFFECTED_PROPERTY], state[PROXY_CACHE_PROPERTY], state[TARGET_CACHE_PROPERTY]);\n },\n has(target, key) {\n if (key === TRACK_MEMO_SYMBOL) {\n recordObjectAsUsed();\n return true;\n }\n recordUsage(HAS_KEY_PROPERTY, key);\n return Reflect.has(target, key);\n },\n getOwnPropertyDescriptor(target, key) {\n recordUsage(HAS_OWN_KEY_PROPERTY, key);\n return Reflect.getOwnPropertyDescriptor(target, key);\n },\n ownKeys(target) {\n recordUsage(ALL_OWN_KEYS_PROPERTY);\n return Reflect.ownKeys(target);\n },\n };\n if (isTargetCopied) {\n handler.set = handler.deleteProperty = () => false;\n }\n return [handler, state];\n};\nconst getOriginalObject = (obj) => \n// unwrap proxy\nobj[GET_ORIGINAL_SYMBOL] ||\n // otherwise\n obj;\n/**\n * Create a proxy.\n *\n * This function will create a proxy at top level and proxy nested objects as you access them,\n * in order to keep track of which properties were accessed via get/has proxy handlers:\n *\n * NOTE: Printing of WeakMap is hard to inspect and not very readable\n * for this purpose you can use the `affectedToPathList` helper.\n *\n * @param {object} obj - Object that will be wrapped on the proxy.\n * @param {WeakMap} affected -\n * WeakMap that will hold the tracking of which properties in the proxied object were accessed.\n * @param {WeakMap} [proxyCache] -\n * WeakMap that will help keep referential identity for proxies.\n * @returns {Proxy} - Object wrapped in a proxy.\n *\n * @example\n * import { createProxy } from 'proxy-compare';\n *\n * const original = { a: \"1\", c: \"2\", d: { e: \"3\" } };\n * const affected = new WeakMap();\n * const proxy = createProxy(original, affected);\n *\n * proxy.a // Will mark as used and track its value.\n * // This will update the affected WeakMap with original as key\n * // and a Set with \"a\"\n *\n * proxy.d // Will mark \"d\" as accessed to track and proxy itself ({ e: \"3\" }).\n * // This will update the affected WeakMap with original as key\n * // and a Set with \"d\"\n */\nexport const createProxy = (obj, affected, proxyCache, targetCache) => {\n if (!isObjectToTrack(obj))\n return obj;\n let targetAndCopied = targetCache && targetCache.get(obj);\n if (!targetAndCopied) {\n const target = getOriginalObject(obj);\n if (needsToCopyTargetObject(target)) {\n targetAndCopied = [target, copyTargetObject(target)];\n }\n else {\n targetAndCopied = [target];\n }\n targetCache === null || targetCache === void 0 ? void 0 : targetCache.set(obj, targetAndCopied);\n }\n const [target, copiedTarget] = targetAndCopied;\n let handlerAndState = proxyCache && proxyCache.get(target);\n if (!handlerAndState ||\n handlerAndState[1][IS_TARGET_COPIED_PROPERTY] !== !!copiedTarget) {\n handlerAndState = createProxyHandler(target, !!copiedTarget);\n handlerAndState[1][PROXY_PROPERTY] = newProxy(copiedTarget || target, handlerAndState[0]);\n if (proxyCache) {\n proxyCache.set(target, handlerAndState);\n }\n }\n handlerAndState[1][AFFECTED_PROPERTY] = affected;\n handlerAndState[1][PROXY_CACHE_PROPERTY] = proxyCache;\n handlerAndState[1][TARGET_CACHE_PROPERTY] = targetCache;\n return handlerAndState[1][PROXY_PROPERTY];\n};\nconst isAllOwnKeysChanged = (prevObj, nextObj) => {\n const prevKeys = Reflect.ownKeys(prevObj);\n const nextKeys = Reflect.ownKeys(nextObj);\n return (prevKeys.length !== nextKeys.length ||\n prevKeys.some((k, i) => k !== nextKeys[i]));\n};\n/**\n * Compare changes on objects.\n *\n * This will compare the affected properties on tracked objects inside the proxy\n * to check if there were any changes made to it,\n * by default if no property was accessed on the proxy it will attempt to do a\n * reference equality check for the objects provided (Object.is(a, b)). If you access a property\n * on the proxy, then isChanged will only compare the affected properties.\n *\n * @param {object} prevObj - The previous object to compare.\n * @param {object} nextObj - Object to compare with the previous one.\n * @param {WeakMap} affected -\n * WeakMap that holds the tracking of which properties in the proxied object were accessed.\n * @param {WeakMap} [cache] -\n * WeakMap that holds a cache of the comparisons for better performance with repetitive comparisons,\n * and to avoid infinite loop with circular structures.\n * @returns {boolean} - Boolean indicating if the affected property on the object has changed.\n *\n * @example\n * import { createProxy, isChanged } from 'proxy-compare';\n *\n * const obj = { a: \"1\", c: \"2\", d: { e: \"3\" } };\n * const affected = new WeakMap();\n *\n * const proxy = createProxy(obj, affected);\n *\n * proxy.a\n *\n * isChanged(obj, { a: \"1\" }, affected) // false\n *\n * proxy.a = \"2\"\n *\n * isChanged(obj, { a: \"1\" }, affected) // true\n */\nexport const isChanged = (prevObj, nextObj, affected, cache, // for object with cycles\nisEqual = Object.is) => {\n if (isEqual(prevObj, nextObj)) {\n return false;\n }\n if (!isObject(prevObj) || !isObject(nextObj))\n return true;\n const used = affected.get(getOriginalObject(prevObj));\n if (!used)\n return true;\n if (cache) {\n const hit = cache.get(prevObj);\n if (hit === nextObj) {\n return false;\n }\n // for object with cycles\n cache.set(prevObj, nextObj);\n }\n let changed = null;\n for (const key of used[HAS_KEY_PROPERTY] || []) {\n changed = Reflect.has(prevObj, key) !== Reflect.has(nextObj, key);\n if (changed)\n return changed;\n }\n if (used[ALL_OWN_KEYS_PROPERTY] === true) {\n changed = isAllOwnKeysChanged(prevObj, nextObj);\n if (changed)\n return changed;\n }\n else {\n for (const key of used[HAS_OWN_KEY_PROPERTY] || []) {\n const hasPrev = !!Reflect.getOwnPropertyDescriptor(prevObj, key);\n const hasNext = !!Reflect.getOwnPropertyDescriptor(nextObj, key);\n changed = hasPrev !== hasNext;\n if (changed)\n return changed;\n }\n }\n for (const key of used[KEYS_PROPERTY] || []) {\n changed = isChanged(prevObj[key], nextObj[key], affected, cache, isEqual);\n if (changed)\n return changed;\n }\n if (changed === null)\n throw new Error('invalid used');\n return changed;\n};\n// explicitly track object with memo\nexport const trackMemo = (obj) => {\n if (isObjectToTrack(obj)) {\n return TRACK_MEMO_SYMBOL in obj;\n }\n return false;\n};\n/**\n * Unwrap proxy to get the original object.\n *\n * Used to retrieve the original object used to create the proxy instance with `createProxy`.\n *\n * @param {Proxy} obj - The proxy wrapper of the originial object.\n * @returns {object | null} - Return either the unwrapped object if exists.\n *\n * @example\n * import { createProxy, getUntracked } from 'proxy-compare';\n *\n * const original = { a: \"1\", c: \"2\", d: { e: \"3\" } };\n * const affected = new WeakMap();\n *\n * const proxy = createProxy(original, affected);\n * const originalFromProxy = getUntracked(proxy)\n *\n * Object.is(original, originalFromProxy) // true\n * isChanged(original, originalFromProxy, affected) // false\n */\nexport const getUntracked = (obj) => {\n if (isObjectToTrack(obj)) {\n return obj[GET_ORIGINAL_SYMBOL] || null;\n }\n return null;\n};\n/**\n * Mark object to be tracked.\n *\n * This function marks an object that will be passed into `createProxy`\n * as marked to track or not. By default only Array and Object are marked to track,\n * so this is useful for example to mark a class instance to track or to mark a object\n * to be untracked when creating your proxy.\n *\n * @param obj - Object to mark as tracked or not.\n * @param mark - Boolean indicating whether you want to track this object or not.\n * @returns - No return.\n *\n * @example\n * import { createProxy, markToTrack, isChanged } from 'proxy-compare';\n *\n * const nested = { e: \"3\" }\n *\n * markToTrack(nested, false)\n *\n * const original = { a: \"1\", c: \"2\", d: nested };\n * const affected = new WeakMap();\n *\n * const proxy = createProxy(original, affected);\n *\n * proxy.d.e\n *\n * isChanged(original, { d: { e: \"3\" } }, affected) // true\n */\nexport const markToTrack = (obj, mark = true) => {\n objectsToTrack.set(obj, mark);\n};\n/**\n * Convert `affected` to path list\n *\n * `affected` is a weak map which is not printable.\n * This function is can convert it to printable path list.\n * It's for debugging purpose.\n *\n * @param obj - An object that is used with `createProxy`.\n * @param affected - A weak map that is used with `createProxy`.\n * @param onlyWithValues - An optional boolean to exclude object getters.\n * @returns - An array of paths.\n */\nexport const affectedToPathList = (obj, affected, onlyWithValues) => {\n const list = [];\n const seen = new WeakSet();\n const walk = (x, path) => {\n var _a, _b, _c;\n if (seen.has(x)) {\n // for object with cycles\n return;\n }\n if (isObject(x)) {\n seen.add(x);\n }\n const used = isObject(x) && affected.get(getOriginalObject(x));\n if (used) {\n (_a = used[HAS_KEY_PROPERTY]) === null || _a === void 0 ? void 0 : _a.forEach((key) => {\n const segment = `:has(${String(key)})`;\n list.push(path ? [...path, segment] : [segment]);\n });\n if (used[ALL_OWN_KEYS_PROPERTY] === true) {\n const segment = ':ownKeys';\n list.push(path ? [...path, segment] : [segment]);\n }\n else {\n (_b = used[HAS_OWN_KEY_PROPERTY]) === null || _b === void 0 ? void 0 : _b.forEach((key) => {\n const segment = `:hasOwn(${String(key)})`;\n list.push(path ? [...path, segment] : [segment]);\n });\n }\n (_c = used[KEYS_PROPERTY]) === null || _c === void 0 ? void 0 : _c.forEach((key) => {\n if (!onlyWithValues ||\n 'value' in (Object.getOwnPropertyDescriptor(x, key) || {})) {\n walk(x[key], path ? [...path, key] : [key]);\n }\n });\n }\n else if (path) {\n list.push(path);\n }\n };\n walk(obj);\n return list;\n};\n/**\n * replace newProxy function.\n *\n * This can be used if you want to use proxy-polyfill.\n * Note that proxy-polyfill can't polyfill everything.\n * Use it at your own risk.\n */\nexport const replaceNewProxy = (fn) => {\n newProxy = fn;\n};\n","import { markToTrack, getUntracked } from 'proxy-compare';\n\n// src/global.ts\nfunction glob() {\n if (typeof globalThis !== \"undefined\") return globalThis;\n if (typeof self !== \"undefined\") return self;\n if (typeof window !== \"undefined\") return window;\n if (typeof global !== \"undefined\") return global;\n}\nfunction globalRef(key, value) {\n const g = glob();\n if (!g) return value();\n g[key] || (g[key] = value());\n return g[key];\n}\nvar refSet = globalRef(\"__zag__refSet\", () => /* @__PURE__ */ new WeakSet());\n\n// src/utils.ts\nvar isReactElement = (x) => typeof x === \"object\" && x !== null && \"$$typeof\" in x && \"props\" in x;\nvar isVueElement = (x) => typeof x === \"object\" && x !== null && \"__v_isVNode\" in x;\nvar isDOMElement = (x) => typeof x === \"object\" && x !== null && \"nodeType\" in x && typeof x.nodeName === \"string\";\nvar isElement = (x) => isReactElement(x) || isVueElement(x) || isDOMElement(x);\nvar isObject = (x) => x !== null && typeof x === \"object\";\nvar canProxy = (x) => isObject(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !isElement(x) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer) && !(x instanceof Promise);\nvar isDev = () => process.env.NODE_ENV !== \"production\";\n\n// src/clone.ts\nfunction set(obj, key, val) {\n if (typeof val.value === \"object\" && !canProxy(val.value)) val.value = clone(val.value);\n if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === \"__proto__\") {\n Object.defineProperty(obj, key, val);\n } else obj[key] = val.value;\n}\nfunction clone(x) {\n if (typeof x !== \"object\") return x;\n var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);\n if (str === \"[object Object]\") {\n tmp = Object.create(Object.getPrototypeOf(x) || null);\n } else if (str === \"[object Array]\") {\n tmp = Array(x.length);\n } else if (str === \"[object Set]\") {\n tmp = /* @__PURE__ */ new Set();\n x.forEach(function(val) {\n tmp.add(clone(val));\n });\n } else if (str === \"[object Map]\") {\n tmp = /* @__PURE__ */ new Map();\n x.forEach(function(val, key) {\n tmp.set(clone(key), clone(val));\n });\n } else if (str === \"[object Date]\") {\n tmp = /* @__PURE__ */ new Date(+x);\n } else if (str === \"[object RegExp]\") {\n tmp = new RegExp(x.source, x.flags);\n } else if (str === \"[object DataView]\") {\n tmp = new x.constructor(clone(x.buffer));\n } else if (str === \"[object ArrayBuffer]\") {\n tmp = x.slice(0);\n } else if (str === \"[object Blob]\") {\n tmp = x.slice();\n } else if (str.slice(-6) === \"Array]\") {\n tmp = new x.constructor(x);\n }\n if (tmp) {\n for (list = Object.getOwnPropertySymbols(x); i < list.length; i++) {\n set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));\n }\n for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {\n if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k]) continue;\n set(tmp, k, Object.getOwnPropertyDescriptor(x, k));\n }\n }\n return tmp || x;\n}\nvar proxyStateMap = globalRef(\"__zag__proxyStateMap\", () => /* @__PURE__ */ new WeakMap());\nvar buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) => new Proxy(target, handler), snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version) => {\n const cache = snapCache.get(target);\n if (cache?.[0] === version) {\n return cache[1];\n }\n const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));\n markToTrack(snap, true);\n snapCache.set(target, [version, snap]);\n Reflect.ownKeys(target).forEach((key) => {\n const value = Reflect.get(target, key);\n if (refSet.has(value)) {\n markToTrack(value, false);\n snap[key] = value;\n } else if (proxyStateMap.has(value)) {\n snap[key] = snapshot(value);\n } else {\n snap[key] = value;\n }\n });\n return Object.freeze(snap);\n}, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction2 = (initialObject) => {\n if (!isObject(initialObject)) {\n throw new Error(\"object required\");\n }\n const found = proxyCache.get(initialObject);\n if (found) {\n return found;\n }\n let version = versionHolder[0];\n const listeners = /* @__PURE__ */ new Set();\n const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {\n if (version !== nextVersion) {\n version = nextVersion;\n listeners.forEach((listener) => listener(op, nextVersion));\n }\n };\n let checkVersion = versionHolder[1];\n const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => {\n if (checkVersion !== nextCheckVersion && !listeners.size) {\n checkVersion = nextCheckVersion;\n propProxyStates.forEach(([propProxyState]) => {\n const propVersion = propProxyState[1](nextCheckVersion);\n if (propVersion > version) {\n version = propVersion;\n }\n });\n }\n return version;\n };\n const createPropListener = (prop) => (op, nextVersion) => {\n const newOp = [...op];\n newOp[1] = [prop, ...newOp[1]];\n notifyUpdate(newOp, nextVersion);\n };\n const propProxyStates = /* @__PURE__ */ new Map();\n const addPropListener = (prop, propProxyState) => {\n if (isDev() && propProxyStates.has(prop)) {\n throw new Error(\"prop listener already exists\");\n }\n if (listeners.size) {\n const remove = propProxyState[3](createPropListener(prop));\n propProxyStates.set(prop, [propProxyState, remove]);\n } else {\n propProxyStates.set(prop, [propProxyState]);\n }\n };\n const removePropListener = (prop) => {\n const entry = propProxyStates.get(prop);\n if (entry) {\n propProxyStates.delete(prop);\n entry[1]?.();\n }\n };\n const addListener = (listener) => {\n listeners.add(listener);\n if (listeners.size === 1) {\n propProxyStates.forEach(([propProxyState, prevRemove], prop) => {\n if (isDev() && prevRemove) {\n throw new Error(\"remove already exists\");\n }\n const remove = propProxyState[3](createPropListener(prop));\n propProxyStates.set(prop, [propProxyState, remove]);\n });\n }\n const removeListener = () => {\n listeners.delete(listener);\n if (listeners.size === 0) {\n propProxyStates.forEach(([propProxyState, remove], prop) => {\n if (remove) {\n remove();\n propProxyStates.set(prop, [propProxyState]);\n }\n });\n }\n };\n return removeListener;\n };\n const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));\n const handler = {\n deleteProperty(target, prop) {\n const prevValue = Reflect.get(target, prop);\n removePropListener(prop);\n const deleted = Reflect.deleteProperty(target, prop);\n if (deleted) {\n notifyUpdate([\"delete\", [prop], prevValue]);\n }\n return deleted;\n },\n set(target, prop, value, receiver) {\n const hasPrevValue = Reflect.has(target, prop);\n const prevValue = Reflect.get(target, prop, receiver);\n if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {\n return true;\n }\n removePropListener(prop);\n if (isObject(value)) {\n value = getUntracked(value) || value;\n }\n let nextValue = value;\n if (Object.getOwnPropertyDescriptor(target, prop)?.set) ; else {\n if (!proxyStateMap.has(value) && canProxy(value)) {\n nextValue = proxy(value);\n }\n const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue);\n if (childProxyState) {\n addPropListener(prop, childProxyState);\n }\n }\n Reflect.set(target, prop, nextValue, receiver);\n notifyUpdate([\"set\", [prop], value, prevValue]);\n return true;\n }\n };\n const proxyObject = newProxy(baseObject, handler);\n proxyCache.set(initialObject, proxyObject);\n const proxyState = [baseObject, ensureVersion, createSnapshot, addListener];\n proxyStateMap.set(proxyObject, proxyState);\n Reflect.ownKeys(initialObject).forEach((key) => {\n const desc = Object.getOwnPropertyDescriptor(initialObject, key);\n if (desc.get || desc.set) {\n Object.defineProperty(baseObject, key, desc);\n } else {\n proxyObject[key] = initialObject[key];\n }\n });\n return proxyObject;\n}) => [\n // public functions\n proxyFunction2,\n // shared state\n proxyStateMap,\n refSet,\n // internal things\n objectIs,\n newProxy,\n canProxy,\n snapCache,\n createSnapshot,\n proxyCache,\n versionHolder\n];\nvar [proxyFunction] = buildProxyFunction();\nfunction proxy(initialObject = {}) {\n return proxyFunction(initialObject);\n}\nfunction subscribe(proxyObject, callback, notifyInSync) {\n const proxyState = proxyStateMap.get(proxyObject);\n if (isDev() && !proxyState) {\n console.warn(\"Please use proxy object\");\n }\n let promise;\n const ops = [];\n const addListener = proxyState[3];\n let isListenerActive = false;\n const listener = (op) => {\n ops.push(op);\n if (notifyInSync) {\n callback(ops.splice(0));\n return;\n }\n if (!promise) {\n promise = Promise.resolve().then(() => {\n promise = void 0;\n if (isListenerActive) {\n callback(ops.splice(0));\n }\n });\n }\n };\n const removeListener = addListener(listener);\n isListenerActive = true;\n return () => {\n isListenerActive = false;\n removeListener();\n };\n}\nfunction snapshot(proxyObject) {\n const proxyState = proxyStateMap.get(proxyObject);\n if (isDev() && !proxyState) {\n console.warn(\"Please use proxy object\");\n }\n const [target, ensureVersion, createSnapshot] = proxyState;\n return createSnapshot(target, ensureVersion());\n}\nfunction ref(obj) {\n refSet.add(obj);\n return obj;\n}\n\n// src/proxy-computed.ts\nfunction proxyWithComputed(initialObject, computedFns) {\n const keys = Object.keys(computedFns);\n keys.forEach((key) => {\n if (Object.getOwnPropertyDescriptor(initialObject, key)) {\n throw new Error(\"object property already defined\");\n }\n const computedFn = computedFns[key];\n const { get, set: set2 } = typeof computedFn === \"function\" ? { get: computedFn } : computedFn;\n const desc = {};\n desc.get = () => get(snapshot(proxyObject));\n if (set2) {\n desc.set = (newValue) => set2(proxyObject, newValue);\n }\n Object.defineProperty(initialObject, key, desc);\n });\n const proxyObject = proxy(initialObject);\n return proxyObject;\n}\n\nexport { clone, globalRef, proxy, proxyWithComputed, ref, snapshot, subscribe };\n","// src/array.ts\nfunction toArray(v) {\n if (!v) return [];\n return Array.isArray(v) ? v : [v];\n}\nvar fromLength = (length) => Array.from(Array(length).keys());\nvar first = (v) => v[0];\nvar last = (v) => v[v.length - 1];\nvar isEmpty = (v) => v.length === 0;\nvar has = (v, t) => v.indexOf(t) !== -1;\nvar add = (v, ...items) => v.concat(items);\nvar remove = (v, ...items) => v.filter((t) => !items.includes(t));\nvar removeAt = (v, i) => v.filter((_, idx) => idx !== i);\nvar insertAt = (v, i, ...items) => [...v.slice(0, i), ...items, ...v.slice(i)];\nvar uniq = (v) => Array.from(new Set(v));\nvar addOrRemove = (v, item) => {\n if (has(v, item)) return remove(v, item);\n return add(v, item);\n};\nfunction clear(v) {\n while (v.length > 0) v.pop();\n return v;\n}\nfunction nextIndex(v, idx, opts = {}) {\n const { step = 1, loop = true } = opts;\n const next2 = idx + step;\n const len = v.length;\n const last2 = len - 1;\n if (idx === -1) return step > 0 ? 0 : last2;\n if (next2 < 0) return loop ? last2 : 0;\n if (next2 >= len) return loop ? 0 : idx > len ? len : idx;\n return next2;\n}\nfunction next(v, idx, opts = {}) {\n return v[nextIndex(v, idx, opts)];\n}\nfunction prevIndex(v, idx, opts = {}) {\n const { step = 1, loop = true } = opts;\n return nextIndex(v, idx, { step: -step, loop });\n}\nfunction prev(v, index, opts = {}) {\n return v[prevIndex(v, index, opts)];\n}\nvar chunk = (v, size) => {\n const res = [];\n return v.reduce((rows, value, index) => {\n if (index % size === 0) rows.push([value]);\n else last(rows)?.push(value);\n return rows;\n }, res);\n};\n\n// src/equal.ts\nvar isArrayLike = (value) => value?.constructor.name === \"Array\";\nvar isArrayEqual = (a, b) => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (!isEqual(a[i], b[i])) return false;\n }\n return true;\n};\nvar isEqual = (a, b) => {\n if (Object.is(a, b)) return true;\n if (a == null && b != null || a != null && b == null) return false;\n if (typeof a?.isEqual === \"function\" && typeof b?.isEqual === \"function\") {\n return a.isEqual(b);\n }\n if (typeof a === \"function\" && typeof b === \"function\") {\n return a.toString() === b.toString();\n }\n if (isArrayLike(a) && isArrayLike(b)) {\n return isArrayEqual(Array.from(a), Array.from(b));\n }\n if (!(typeof a === \"object\") || !(typeof b === \"object\")) return false;\n const keys = Object.keys(b ?? /* @__PURE__ */ Object.create(null));\n const length = keys.length;\n for (let i = 0; i < length; i++) {\n const hasKey = Reflect.has(a, keys[i]);\n if (!hasKey) return false;\n }\n for (let i = 0; i < length; i++) {\n const key = keys[i];\n if (!isEqual(a[key], b[key])) return false;\n }\n return true;\n};\n\n// src/functions.ts\nvar runIfFn = (v, ...a) => {\n const res = typeof v === \"function\" ? v(...a) : v;\n return res ?? void 0;\n};\nvar cast = (v) => v;\nvar noop = () => {\n};\nvar callAll = (...fns) => (...a) => {\n fns.forEach(function(fn) {\n fn?.(...a);\n });\n};\nvar uuid = /* @__PURE__ */ (() => {\n let id = 0;\n return () => {\n id++;\n return id.toString(36);\n };\n})();\nfunction match(key, record, ...args) {\n if (key in record) {\n const fn = record[key];\n return typeof fn === \"function\" ? fn(...args) : fn;\n }\n const error = new Error(`No matching key: ${JSON.stringify(key)} in ${JSON.stringify(Object.keys(record))}`);\n Error.captureStackTrace?.(error, match);\n throw error;\n}\nvar tryCatch = (fn, fallback) => {\n try {\n return fn();\n } catch (error) {\n if (error instanceof Error) {\n Error.captureStackTrace?.(error, tryCatch);\n }\n return fallback?.();\n }\n};\n\n// src/guard.ts\nvar isDev = () => process.env.NODE_ENV !== \"production\";\nvar isArray = (v) => Array.isArray(v);\nvar isBoolean = (v) => v === true || v === false;\nvar isObjectLike = (v) => v != null && typeof v === \"object\";\nvar isObject = (v) => isObjectLike(v) && !isArray(v);\nvar isNumber = (v) => typeof v === \"number\" && !Number.isNaN(v);\nvar isString = (v) => typeof v === \"string\";\nvar isFunction = (v) => typeof v === \"function\";\nvar isNull = (v) => v == null;\nvar hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nvar baseGetTag = (v) => Object.prototype.toString.call(v);\nvar fnToString = Function.prototype.toString;\nvar objectCtorString = fnToString.call(Object);\nvar isPlainObject = (v) => {\n if (!isObjectLike(v) || baseGetTag(v) != \"[object Object]\") return false;\n const proto = Object.getPrototypeOf(v);\n if (proto === null) return true;\n const Ctor = hasProp(proto, \"constructor\") && proto.constructor;\n return typeof Ctor == \"function\" && Ctor instanceof Ctor && fnToString.call(Ctor) == objectCtorString;\n};\n\n// src/number.ts\nvar { floor, abs, round, min, max, pow, sign } = Math;\nvar isNaN = (v) => Number.isNaN(v);\nvar nan = (v) => isNaN(v) ? 0 : v;\nvar mod = (v, m) => (v % m + m) % m;\nvar wrap = (v, vmax) => (v % vmax + vmax) % vmax;\nvar getMinValueAtIndex = (i, v, vmin) => i === 0 ? vmin : v[i - 1];\nvar getMaxValueAtIndex = (i, v, vmax) => i === v.length - 1 ? vmax : v[i + 1];\nvar isValueAtMax = (v, vmax) => nan(v) >= vmax;\nvar isValueAtMin = (v, vmin) => nan(v) <= vmin;\nvar isValueWithinRange = (v, vmin, vmax) => nan(v) >= vmin && nan(v) <= vmax;\nvar roundValue = (v, vmin, step) => round((nan(v) - vmin) / step) * step + vmin;\nvar clampValue = (v, vmin, vmax) => min(max(nan(v), vmin), vmax);\nvar clampPercent = (v) => clampValue(v, 0, 1);\nvar getValuePercent = (v, vmin, vmax) => (nan(v) - vmin) / (vmax - vmin);\nvar getPercentValue = (p, vmin, vmax, step) => clampValue(roundValue(p * (vmax - vmin) + vmin, vmin, step), vmin, vmax);\nvar roundToStepPrecision = (v, step) => {\n let rv = v;\n let ss = step.toString();\n let pi = ss.indexOf(\".\");\n let p = pi >= 0 ? ss.length - pi : 0;\n if (p > 0) {\n let pw = pow(10, p);\n rv = round(rv * pw) / pw;\n }\n return rv;\n};\nvar roundToDpr = (v, dpr) => typeof dpr === \"number\" ? floor(v * dpr + 0.5) / dpr : round(v);\nvar snapValueToStep = (v, vmin, vmax, step) => {\n vmin = Number(vmin);\n vmax = Number(vmax);\n let remainder = (v - (isNaN(vmin) ? 0 : vmin)) % step;\n let sv = roundToStepPrecision(\n abs(remainder) * 2 >= step ? v + sign(remainder) * (step - abs(remainder)) : v - remainder,\n step\n );\n if (!isNaN(vmin)) {\n if (sv < vmin) {\n sv = vmin;\n } else if (!isNaN(vmax) && sv > vmax) {\n sv = vmin + floor(roundToStepPrecision((vmax - vmin) / step, step)) * step;\n }\n } else if (!isNaN(vmax) && sv > vmax) {\n sv = vmin + floor(roundToStepPrecision((vmax - vmin) / step, step)) * step;\n }\n return roundToStepPrecision(sv, step);\n};\nvar setValueAtIndex = (vs, i, v) => {\n if (vs[i] === v) return vs;\n return [...vs.slice(0, i), v, ...vs.slice(i + 1)];\n};\nfunction getValueSetterAtIndex(index, ctx) {\n const minValueAtIndex = getMinValueAtIndex(index, ctx.values, ctx.min);\n const maxValueAtIndex = getMaxValueAtIndex(index, ctx.values, ctx.max);\n let nextValues = ctx.values.slice();\n return function setValue(value) {\n let nextValue = snapValueToStep(value, minValueAtIndex, maxValueAtIndex, ctx.step);\n nextValues = setValueAtIndex(nextValues, index, value);\n nextValues[index] = nextValue;\n return nextValues;\n };\n}\nfunction getNextStepValue(index, ctx) {\n const nextValue = ctx.values[index] + ctx.step;\n return getValueSetterAtIndex(index, ctx)(nextValue);\n}\nfunction getPreviousStepValue(index, ctx) {\n const nextValue = ctx.values[index] - ctx.step;\n return getValueSetterAtIndex(index, ctx)(nextValue);\n}\nvar getClosestValueIndex = (vs, t) => {\n let i = vs.findIndex((v) => t - v < 0);\n if (i === 0) return i;\n if (i === -1) return vs.length - 1;\n let vLeft = vs[i - 1];\n let vRight = vs[i];\n if (abs(vLeft - t) < abs(vRight - t)) return i - 1;\n return i;\n};\nvar getClosestValue = (vs, t) => vs[getClosestValueIndex(vs, t)];\nvar getValueRanges = (vs, vmin, vmax, gap) => vs.map((v, i) => ({\n min: i === 0 ? vmin : vs[i - 1] + gap,\n max: i === vs.length - 1 ? vmax : vs[i + 1] - gap,\n value: v\n}));\nvar getValueTransformer = (va, vb) => {\n const [a, b] = va;\n const [c, d] = vb;\n return (v) => a === b || c === d ? c : c + (d - c) / (b - a) * (v - a);\n};\nvar toFixedNumber = (v, d = 0, b = 10) => {\n const pow2 = Math.pow(b, d);\n return round(v * pow2) / pow2;\n};\nvar countDecimals = (value) => {\n if (!Number.isFinite(value)) return 0;\n let e = 1, p = 0;\n while (Math.round(value * e) / e !== value) {\n e *= 10;\n p += 1;\n }\n return p;\n};\nvar decimalOp = (a, op, b) => {\n let result = op === \"+\" ? a + b : a - b;\n if (a % 1 !== 0 || b % 1 !== 0) {\n const multiplier = 10 ** Math.max(countDecimals(a), countDecimals(b));\n a = Math.round(a * multiplier);\n b = Math.round(b * multiplier);\n result = op === \"+\" ? a + b : a - b;\n result /= multiplier;\n }\n return result;\n};\nvar incrementValue = (v, s) => decimalOp(nan(v), \"+\", s);\nvar decrementValue = (v, s) => decimalOp(nan(v), \"-\", s);\n\n// src/object.ts\nfunction compact(obj) {\n if (!isPlainObject2(obj) || obj === void 0) return obj;\n const keys = Reflect.ownKeys(obj).filter((key) => typeof key === \"string\");\n const filtered = {};\n for (const key of keys) {\n const value = obj[key];\n if (value !== void 0) {\n filtered[key] = compact(value);\n }\n }\n return filtered;\n}\nvar json = (v) => JSON.parse(JSON.stringify(v));\nvar isPlainObject2 = (v) => {\n return v && typeof v === \"object\" && v.constructor === Object;\n};\nfunction pick(obj, keys) {\n const filtered = {};\n for (const key of keys) {\n const value = obj[key];\n if (value !== void 0) {\n filtered[key] = value;\n }\n }\n return filtered;\n}\nfunction splitProps(props, keys) {\n const rest = {};\n const result = {};\n const keySet = new Set(keys);\n for (const key in props) {\n if (keySet.has(key)) {\n result[key] = props[key];\n } else {\n rest[key] = props[key];\n }\n }\n return [result, rest];\n}\nvar createSplitProps = (keys) => {\n return function split(props) {\n return splitProps(props, keys);\n };\n};\nfunction omit(obj, keys) {\n return createSplitProps(keys)(obj)[1];\n}\n\n// src/warning.ts\nfunction warn(...a) {\n const m = a.length === 1 ? a[0] : a[1];\n const c = a.length === 2 ? a[0] : true;\n if (c && process.env.NODE_ENV !== \"production\") {\n console.warn(m);\n }\n}\nfunction invariant(...a) {\n const m = a.length === 1 ? a[0] : a[1];\n const c = a.length === 2 ? a[0] : true;\n if (c && process.env.NODE_ENV !== \"production\") {\n throw new Error(m);\n }\n}\n\nexport { add, addOrRemove, callAll, cast, chunk, clampPercent, clampValue, clear, compact, createSplitProps, decrementValue, first, fromLength, getClosestValue, getClosestValueIndex, getMaxValueAtIndex, getMinValueAtIndex, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, getValueSetterAtIndex, getValueTransformer, has, hasProp, incrementValue, insertAt, invariant, isArray, isBoolean, isDev, isEmpty, isEqual, isFunction, isNaN, isNull, isNumber, isObject, isObjectLike, isPlainObject, isString, isValueAtMax, isValueAtMin, isValueWithinRange, json, last, match, mod, nan, next, nextIndex, noop, omit, pick, prev, prevIndex, remove, removeAt, roundToDpr, roundToStepPrecision, roundValue, runIfFn, setValueAtIndex, snapValueToStep, splitProps, toArray, toFixedNumber, tryCatch, uniq, uuid, warn, wrap };\n","import { clone, snapshot, proxy, proxyWithComputed, subscribe, ref } from '@zag-js/store';\nexport { proxy, ref, snapshot, subscribe } from '@zag-js/store';\nimport { compact, isPlainObject, uuid, cast, callAll, isString, isFunction, noop, isObject, runIfFn, invariant, clear, isArray, hasProp, warn, isDev, isNumber } from '@zag-js/utils';\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nfunction deepMerge(source, ...objects) {\n for (const obj of objects) {\n const target = compact(obj);\n for (const key in target) {\n if (isPlainObject(obj[key])) {\n if (!source[key]) {\n source[key] = {};\n }\n deepMerge(source[key], obj[key]);\n } else {\n source[key] = obj[key];\n }\n }\n }\n return source;\n}\nfunction toEvent(event) {\n const obj = isString(event) ? { type: event } : event;\n return obj;\n}\nfunction toArray(value) {\n if (!value) return [];\n return isArray(value) ? value.slice() : [value];\n}\nfunction isGuardHelper(value) {\n return isObject(value) && value.predicate != null;\n}\n\n// src/guard-utils.ts\nvar Truthy = () => true;\nfunction exec(guardMap, ctx, event, meta) {\n return (guard) => {\n if (isString(guard)) {\n return !!guardMap[guard]?.(ctx, event, meta);\n }\n if (isFunction(guard)) {\n return guard(ctx, event, meta);\n }\n return guard.predicate(guardMap)(ctx, event, meta);\n };\n}\nfunction or(...conditions) {\n return {\n predicate: (guardMap) => (ctx, event, meta) => conditions.map(exec(guardMap, ctx, event, meta)).some(Boolean)\n };\n}\nfunction and(...conditions) {\n return {\n predicate: (guardMap) => (ctx, event, meta) => conditions.map(exec(guardMap, ctx, event, meta)).every(Boolean)\n };\n}\nfunction not(condition) {\n return {\n predicate: (guardMap) => (ctx, event, meta) => {\n return !exec(guardMap, ctx, event, meta)(condition);\n }\n };\n}\nfunction stateIn(...values) {\n return (_ctx, _evt, meta) => meta.state.matches(...values);\n}\nvar guards = { or, and, not, stateIn };\nfunction choose(actions) {\n return {\n predicate: (guardMap) => (ctx, event, meta) => actions.find((def) => {\n const guard = def.guard ?? Truthy;\n return exec(guardMap, ctx, event, meta)(guard);\n })?.actions\n };\n}\nfunction determineGuardFn(guard, guardMap) {\n guard = guard ?? Truthy;\n return (context, event, meta) => {\n if (isString(guard)) {\n const value = guardMap[guard];\n return isFunction(value) ? value(context, event, meta) : value;\n }\n if (isGuardHelper(guard)) {\n return guard.predicate(guardMap)(context, event, meta);\n }\n return guard?.(context, event, meta);\n };\n}\nfunction determineActionsFn(values, guardMap) {\n return (context, event, meta) => {\n if (isGuardHelper(values)) {\n return values.predicate(guardMap)(context, event, meta);\n }\n return values;\n };\n}\nfunction createProxy(config) {\n const computedContext = config.computed ?? cast({});\n const initialContext = config.context ?? cast({});\n const initialTags = config.initial ? config.states?.[config.initial]?.tags : [];\n const state = proxy({\n value: config.initial ?? \"\",\n previousValue: \"\",\n event: cast({}),\n previousEvent: cast({}),\n context: proxyWithComputed(initialContext, computedContext),\n done: false,\n tags: initialTags ?? [],\n hasTag(tag) {\n return this.tags.includes(tag);\n },\n matches(...value) {\n return value.includes(this.value);\n },\n can(event) {\n return cast(this).nextEvents.includes(event);\n },\n get nextEvents() {\n const stateEvents = config.states?.[this.value]?.[\"on\"] ?? {};\n const globalEvents = config?.on ?? {};\n return Object.keys({ ...stateEvents, ...globalEvents });\n },\n get changed() {\n if (this.event.value === \"machine.init\" /* Init */ || !this.previousValue) return false;\n return this.value !== this.previousValue;\n }\n });\n return cast(state);\n}\nfunction determineDelayFn(delay, delaysMap) {\n return (context, event) => {\n if (isNumber(delay)) return delay;\n if (isFunction(delay)) {\n return delay(context, event);\n }\n if (isString(delay)) {\n const value = Number.parseFloat(delay);\n if (!Number.isNaN(value)) {\n return value;\n }\n if (delaysMap) {\n const valueOrFn = delaysMap?.[delay];\n invariant(\n valueOrFn == null,\n `[@zag-js/core > determine-delay] Cannot determine delay for \\`${delay}\\`. It doesn't exist in \\`options.delays\\``\n );\n return isFunction(valueOrFn) ? valueOrFn(context, event) : valueOrFn;\n }\n }\n };\n}\nfunction toTarget(target) {\n return isString(target) ? { target } : target;\n}\nfunction determineTransitionFn(transitions, guardMap) {\n return (context, event, meta) => {\n return toArray(transitions).map(toTarget).find((transition) => {\n const determineGuard = determineGuardFn(transition.guard, guardMap);\n const guard = determineGuard(context, event, meta);\n return guard ?? transition.target ?? transition.actions;\n });\n };\n}\n\n// src/machine.ts\nvar Machine = class {\n // Let's get started!\n constructor(config, options) {\n __publicField(this, \"status\", \"Not Started\" /* NotStarted */);\n __publicField(this, \"state\");\n __publicField(this, \"initialState\");\n __publicField(this, \"initialContext\");\n __publicField(this, \"id\");\n __publicField(this, \"type\", \"machine\" /* Machine */);\n // Cleanup function map (per state)\n __publicField(this, \"activityEvents\", /* @__PURE__ */ new Map());\n __publicField(this, \"delayedEvents\", /* @__PURE__ */ new Map());\n // state update listeners the user can opt-in for\n __publicField(this, \"stateListeners\", /* @__PURE__ */ new Set());\n __publicField(this, \"doneListeners\", /* @__PURE__ */ new Set());\n __publicField(this, \"contextWatchers\", /* @__PURE__ */ new Set());\n // Cleanup functions (for `subscribe`)\n __publicField(this, \"removeStateListener\", noop);\n // For Parent <==> Spawned Actor relationship\n __publicField(this, \"parent\");\n __publicField(this, \"children\", /* @__PURE__ */ new Map());\n // A map of guard, action, delay implementations\n __publicField(this, \"guardMap\");\n __publicField(this, \"actionMap\");\n __publicField(this, \"delayMap\");\n __publicField(this, \"activityMap\");\n __publicField(this, \"sync\");\n __publicField(this, \"options\");\n __publicField(this, \"config\");\n // created actions\n __publicField(this, \"_created\", () => {\n if (!this.config.created) return;\n const event = toEvent(\"machine.created\" /* Created */);\n this.executeActions(this.config.created, event);\n });\n // Starts the interpreted machine.\n __publicField(this, \"start\", (init) => {\n this.state.value = \"\";\n this.state.tags = [];\n if (this.status === \"Running\" /* Running */) {\n return this;\n }\n this.status = \"Running\" /* Running */;\n this.removeStateListener = subscribe(\n this.state,\n () => {\n this.stateListeners.forEach((listener) => {\n listener(this.stateSnapshot);\n });\n },\n this.sync\n );\n this.setupContextWatchers();\n this.executeActivities(toEvent(\"machine.start\" /* Start */), toArray(this.config.activities), \"machine.start\" /* Start */);\n this.executeActions(this.config.entry, toEvent(\"machine.start\" /* Start */));\n const event = toEvent(\"machine.init\" /* Init */);\n const target = isObject(init) ? init.value : init;\n const context = isObject(init) ? init.context : void 0;\n if (context) {\n this.setContext(context);\n }\n const transition = {\n target: target ?? this.config.initial\n };\n const next = this.getNextStateInfo(transition, event);\n this.initialState = next;\n this.performStateChangeEffects(this.state.value, next, event);\n return this;\n });\n __publicField(this, \"setupContextWatchers\", () => {\n const { watch } = this.config;\n if (!watch) return;\n let prev = snapshot(this.state.context);\n const cleanup = subscribe(this.state.context, () => {\n const next = snapshot(this.state.context);\n for (const [key, fn] of Object.entries(watch)) {\n const isEqual = this.options.compareFns?.[key] ?? Object.is;\n if (isEqual(prev[key], next[key])) continue;\n this.executeActions(fn, this.state.event);\n }\n prev = next;\n });\n this.contextWatchers.add(cleanup);\n });\n // Stops the interpreted machine\n __publicField(this, \"stop\", () => {\n if (this.status === \"Stopped\" /* Stopped */) return;\n this.performExitEffects(this.state.value, toEvent(\"machine.stop\" /* Stop */));\n this.executeActions(this.config.exit, toEvent(\"machine.stop\" /* Stop */));\n this.setState(\"\");\n this.setEvent(\"machine.stop\" /* Stop */);\n this.stopStateListeners();\n this.stopChildren();\n this.stopActivities();\n this.stopDelayedEvents();\n this.stopContextWatchers();\n this.status = \"Stopped\" /* Stopped */;\n return this;\n });\n __publicField(this, \"stopStateListeners\", () => {\n this.removeStateListener();\n this.stateListeners.clear();\n });\n __publicField(this, \"stopContextWatchers\", () => {\n this.contextWatchers.forEach((fn) => fn());\n this.contextWatchers.clear();\n });\n __publicField(this, \"stopDelayedEvents\", () => {\n this.delayedEvents.forEach((state) => {\n state.forEach((stop) => stop());\n });\n this.delayedEvents.clear();\n });\n // Cleanup running activities (e.g `setInterval`, invoked callbacks, promises)\n __publicField(this, \"stopActivities\", (state) => {\n if (state) {\n this.activityEvents.get(state)?.forEach((stop) => stop());\n this.activityEvents.get(state)?.clear();\n this.activityEvents.delete(state);\n } else {\n this.activityEvents.forEach((state2) => {\n state2.forEach((stop) => stop());\n state2.clear();\n });\n this.activityEvents.clear();\n }\n });\n /**\n * Function to send event to spawned child machine or actor\n */\n __publicField(this, \"sendChild\", (evt, to) => {\n const event = toEvent(evt);\n const id = runIfFn(to, this.contextSnapshot);\n const child = this.children.get(id);\n if (!child) {\n invariant(`[@zag-js/core] Cannot send '${event.type}' event to unknown child`);\n }\n child.send(event);\n });\n /**\n * Function to stop a running child machine or actor\n */\n __publicField(this, \"stopChild\", (id) => {\n if (!this.children.has(id)) {\n invariant(`[@zag-js/core > stop-child] Cannot stop unknown child ${id}`);\n }\n this.children.get(id).stop();\n this.children.delete(id);\n });\n __publicField(this, \"removeChild\", (id) => {\n this.children.delete(id);\n });\n // Stop and delete spawned actors\n __publicField(this, \"stopChildren\", () => {\n this.children.forEach((child) => child.stop());\n this.children.clear();\n });\n __publicField(this, \"setParent\", (parent) => {\n this.parent = parent;\n });\n __publicField(this, \"spawn\", (src, id) => {\n const actor = runIfFn(src);\n if (id) actor.id = id;\n actor.type = \"machine.actor\" /* Actor */;\n actor.setParent(this);\n this.children.set(actor.id, cast(actor));\n actor.onDone(() => {\n this.removeChild(actor.id);\n }).start();\n return cast(ref(actor));\n });\n __publicField(this, \"stopActivity\", (key) => {\n if (!this.state.value) return;\n const cleanups = this.activityEvents.get(this.state.value);\n cleanups?.get(key)?.();\n cleanups?.delete(key);\n });\n __publicField(this, \"addActivityCleanup\", (state, key, cleanup) => {\n if (!state) return;\n if (!this.activityEvents.has(state)) {\n this.activityEvents.set(state, /* @__PURE__ */ new Map([[key, cleanup]]));\n } else {\n this.activityEvents.get(state)?.set(key, cleanup);\n }\n });\n __publicField(this, \"setState\", (target) => {\n this.state.previousValue = this.state.value;\n this.state.value = target;\n const stateNode = this.getStateNode(target);\n if (target == null) {\n clear(this.state.tags);\n } else {\n this.state.tags = toArray(stateNode?.tags);\n }\n });\n /**\n * To used within side effects for React or Vue to update context\n */\n __publicField(this, \"setContext\", (context) => {\n if (!context) return;\n deepMerge(this.state.context, compact(context));\n });\n __publicField(this, \"setOptions\", (options) => {\n const opts = compact(options);\n this.actionMap = { ...this.actionMap, ...opts.actions };\n this.delayMap = { ...this.delayMap, ...opts.delays };\n this.activityMap = { ...this.activityMap, ...opts.activities };\n this.guardMap = { ...this.guardMap, ...opts.guards };\n });\n __publicField(this, \"getStateNode\", (state) => {\n if (!state) return;\n return this.config.states?.[state];\n });\n __publicField(this, \"getNextStateInfo\", (transitions, event) => {\n const transition = this.determineTransition(transitions, event);\n const isTargetless = !transition?.target;\n const target = transition?.target ?? this.state.value;\n const changed = this.state.value !== target;\n const stateNode = this.getStateNode(target);\n const reenter = !isTargetless && !changed && !transition?.internal;\n const info = {\n reenter,\n transition,\n stateNode,\n target,\n changed\n };\n this.log(\"NextState:\", `[${event.type}]`, this.state.value, \"---->\", info.target);\n return info;\n });\n __publicField(this, \"getAfterActions\", (transition, delay) => {\n let id;\n const current = this.state.value;\n return {\n entry: () => {\n id = globalThis.setTimeout(() => {\n const next = this.getNextStateInfo(transition, this.state.event);\n this.performStateChangeEffects(current, next, this.state.event);\n }, delay);\n },\n exit: () => {\n globalThis.clearTimeout(id);\n }\n };\n });\n /**\n * All `after` events leverage `setTimeout` and `clearTimeout`,\n * we invoke the `clearTimeout` on exit and `setTimeout` on entry.\n *\n * To achieve this, we split the `after` definition into `entry` and `exit`\n * functions and append them to the state's `entry` and `exit` actions\n */\n __publicField(this, \"getDelayedEventActions\", (state) => {\n const stateNode = this.getStateNode(state);\n const event = this.state.event;\n if (!stateNode || !stateNode.after) return;\n const entries = [];\n const exits = [];\n if (isArray(stateNode.after)) {\n const transition = this.determineTransition(stateNode.after, event);\n if (!transition) return;\n if (!hasProp(transition, \"delay\")) {\n throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(transition)}`);\n }\n const determineDelay = determineDelayFn(transition.delay, this.delayMap);\n const __delay = determineDelay(this.contextSnapshot, event);\n const actions = this.getAfterActions(transition, __delay);\n entries.push(actions.entry);\n exits.push(actions.exit);\n return { entries, exits };\n }\n if (isObject(stateNode.after)) {\n for (const delay in stateNode.after) {\n const transition = stateNode.after[delay];\n const determineDelay = determineDelayFn(delay, this.delayMap);\n const __delay = determineDelay(this.contextSnapshot, event);\n const actions = this.getAfterActions(transition, __delay);\n entries.push(actions.entry);\n exits.push(actions.exit);\n }\n }\n return { entries, exits };\n });\n /**\n * Function to executes defined actions. It can accept actions as string\n * (referencing `options.actions`) or actual functions.\n */\n __publicField(this, \"executeActions\", (actions, event) => {\n const pickedActions = determineActionsFn(actions, this.guardMap)(this.contextSnapshot, event, this.guardMeta);\n for (const action of toArray(pickedActions)) {\n const fn = isString(action) ? this.actionMap?.[action] : action;\n warn(\n isString(action) && !fn,\n `[@zag-js/core > execute-actions] No implementation found for action: \\`${action}\\``\n );\n fn?.(this.state.context, event, this.meta);\n }\n });\n /**\n * Function to execute running activities and registers\n * their cleanup function internally (to be called later on when we exit the state)\n */\n __publicField(this, \"executeActivities\", (event, activities, state) => {\n for (const activity of activities) {\n const fn = isString(activity) ? this.activityMap?.[activity] : activity;\n if (!fn) {\n warn(`[@zag-js/core > execute-activity] No implementation found for activity: \\`${activity}\\``);\n continue;\n }\n const cleanup = fn(this.state.context, event, this.meta);\n if (cleanup) {\n const key = isString(activity) ? activity : activity.name || uuid();\n this.addActivityCleanup(state ?? this.state.value, key, cleanup);\n }\n }\n });\n /**\n * Normalizes the `every` definition to transition. `every` can be:\n * - An array of possible actions to run (we need to pick the first match based on guard)\n * - An object of intervals and actions\n */\n __publicField(this, \"createEveryActivities\", (every, callbackfn) => {\n if (!every) return;\n if (isArray(every)) {\n const picked = toArray(every).find((transition) => {\n const delayOrFn = transition.delay;\n const determineDelay2 = determineDelayFn(delayOrFn, this.delayMap);\n const delay2 = determineDelay2(this.contextSnapshot, this.state.event);\n const determineGuard = determineGuardFn(transition.guard, this.guardMap);\n const guard = determineGuard(this.contextSnapshot, this.state.event, this.guardMeta);\n return guard ?? delay2 != null;\n });\n if (!picked) return;\n const determineDelay = determineDelayFn(picked.delay, this.delayMap);\n const delay = determineDelay(this.contextSnapshot, this.state.event);\n const activity = () => {\n const id = globalThis.setInterval(() => {\n this.executeActions(picked.actions, this.state.event);\n }, delay);\n return () => {\n globalThis.clearInterval(id);\n };\n };\n callbackfn(activity);\n } else {\n for (const interval in every) {\n const actions = every?.[interval];\n const determineDelay = determineDelayFn(interval, this.delayMap);\n const delay = determineDelay(this.contextSnapshot, this.state.event);\n const activity = () => {\n const id = globalThis.setInterval(() => {\n this.executeActions(actions, this.state.event);\n }, delay);\n return () => {\n globalThis.clearInterval(id);\n };\n };\n callbackfn(activity);\n }\n }\n });\n __publicField(this, \"setEvent\", (event) => {\n this.state.previousEvent = this.state.event;\n this.state.event = ref(toEvent(event));\n });\n __publicField(this, \"performExitEffects\", (current, event) => {\n const currentState = this.state.value;\n if (currentState === \"\") return;\n const stateNode = current ? this.getStateNode(current) : void 0;\n this.stopActivities(currentState);\n const _exit = determineActionsFn(stateNode?.exit, this.guardMap)(this.contextSnapshot, event, this.guardMeta);\n const exitActions = toArray(_exit);\n const afterExitActions = this.delayedEvents.get(currentState);\n if (afterExitActions) {\n exitActions.push(...afterExitActions);\n }\n this.executeActions(exitActions, event);\n this.delayedEvents.delete(currentState);\n });\n __publicField(this, \"performEntryEffects\", (next, event) => {\n const stateNode = this.getStateNode(next);\n const activities = toArray(stateNode?.activities);\n this.createEveryActivities(stateNode?.every, (activity) => {\n activities.unshift(activity);\n });\n if (activities.length > 0) {\n this.executeActivities(event, activities);\n }\n const pickedActions = determineActionsFn(stateNode?.entry, this.guardMap)(\n this.contextSnapshot,\n event,\n this.guardMeta\n );\n const entryActions = toArray(pickedActions);\n const afterActions = this.getDelayedEventActions(next);\n if (stateNode?.after && afterActions) {\n this.delayedEvents.set(next, afterActions?.exits);\n entryActions.push(...afterActions.entries);\n }\n this.executeActions(entryActions, event);\n if (stateNode?.type === \"final\") {\n this.state.done = true;\n this.doneListeners.forEach((listener) => {\n listener(this.stateSnapshot);\n });\n this.stop();\n }\n });\n __publicField(this, \"performTransitionEffects\", (transitions, event) => {\n const transition = this.determineTransition(transitions, event);\n this.executeActions(transition?.actions, event);\n });\n /**\n * Performs all the requires side-effects or reactions when\n * we move from state A => state B.\n *\n * The Effect order:\n * Exit actions (current state) => Transition actions => Go to state => Entry actions (next state)\n */\n __publicField(this, \"performStateChangeEffects\", (current, next, event) => {\n this.setEvent(event);\n const changed = next.changed || next.reenter;\n if (changed) {\n this.performExitEffects(current, event);\n }\n this.performTransitionEffects(next.transition, event);\n this.setState(next.target);\n if (changed) {\n this.performEntryEffects(next.target, event);\n }\n });\n __publicField(this, \"determineTransition\", (transition, event) => {\n const fn = determineTransitionFn(transition, this.guardMap);\n return fn?.(this.contextSnapshot, event, this.guardMeta);\n });\n /**\n * Function to send event to parent machine from spawned child\n */\n __publicField(this, \"sendParent\", (evt) => {\n if (!this.parent) {\n invariant(\"[@zag-js/core > send-parent] Cannot send event to an unknown parent\");\n }\n const event = toEvent(evt);\n this.parent?.send(event);\n });\n __publicField(this, \"log\", (...args) => {\n if (isDev() && this.options.debug) {\n console.log(...args);\n }\n });\n /**\n * Function to send an event to current machine\n */\n __publicField(this, \"send\", (evt) => {\n const event = toEvent(evt);\n this.transition(this.state.value, event);\n });\n __publicField(this, \"transition\", (state, evt) => {\n const stateNode = isString(state) ? this.getStateNode(state) : state?.stateNode;\n const event = toEvent(evt);\n if (!stateNode && !this.config.on) {\n const msg = this.status === \"Stopped\" /* Stopped */ ? \"[@zag-js/core > transition] Cannot transition a stopped machine\" : `[@zag-js/core > transition] State does not have a definition for \\`state\\`: ${state}, \\`event\\`: ${event.type}`;\n warn(msg);\n return;\n }\n const transitions = (\n // @ts-expect-error - Fix this\n stateNode?.on?.[event.type] ?? this.config.on?.[event.type]\n );\n const next = this.getNextStateInfo(transitions, event);\n this.performStateChangeEffects(this.state.value, next, event);\n return next.stateNode;\n });\n __publicField(this, \"subscribe\", (listener) => {\n this.stateListeners.add(listener);\n if (this.status === \"Running\" /* Running */) {\n listener(this.stateSnapshot);\n }\n return () => {\n this.stateListeners.delete(listener);\n };\n });\n __publicField(this, \"onDone\", (listener) => {\n this.doneListeners.add(listener);\n return this;\n });\n __publicField(this, \"onTransition\", (listener) => {\n this.stateListeners.add(listener);\n if (this.status === \"Running\" /* Running */) {\n listener(this.stateSnapshot);\n }\n return this;\n });\n this.config = clone(config);\n this.options = clone(options ?? {});\n this.id = this.config.id ?? `machine-${uuid()}`;\n this.guardMap = this.options?.guards ?? {};\n this.actionMap = this.options?.actions ?? {};\n this.delayMap = this.options?.delays ?? {};\n this.activityMap = this.options?.activities ?? {};\n this.sync = this.options?.sync ?? false;\n this.state = createProxy(this.config);\n this.initialContext = snapshot(this.state.context);\n }\n // immutable state value\n get stateSnapshot() {\n return cast(snapshot(this.state));\n }\n getState() {\n return this.stateSnapshot;\n }\n // immutable context value\n get contextSnapshot() {\n return this.stateSnapshot.context;\n }\n /**\n * A reference to the instance methods of the machine.\n * Useful when spawning child machines and managing the communication between them.\n */\n get self() {\n const self = this;\n return {\n id: this.id,\n send: this.send.bind(this),\n sendParent: this.sendParent.bind(this),\n sendChild: this.sendChild.bind(this),\n stop: this.stop.bind(this),\n stopChild: this.stopChild.bind(this),\n spawn: this.spawn.bind(this),\n stopActivity: this.stopActivity.bind(this),\n get state() {\n return self.stateSnapshot;\n },\n get initialContext() {\n return self.initialContext;\n },\n get initialState() {\n return self.initialState?.target ?? \"\";\n }\n };\n }\n get meta() {\n return {\n state: this.stateSnapshot,\n guards: this.guardMap,\n send: this.send.bind(this),\n self: this.self,\n initialContext: this.initialContext,\n initialState: this.initialState?.target ?? \"\",\n getState: () => this.stateSnapshot,\n getAction: (key) => this.actionMap[key],\n getGuard: (key) => this.guardMap[key]\n };\n }\n get guardMeta() {\n return {\n state: this.stateSnapshot\n };\n }\n get [Symbol.toStringTag]() {\n return \"Machine\";\n }\n getHydrationState() {\n const state = this.getState();\n return {\n value: state.value,\n tags: state.tags\n };\n }\n};\nvar createMachine = (config, options) => new Machine(config, options);\nvar isMachine = (value) => {\n return value instanceof Machine || value?.type === \"machine\" /* Machine */;\n};\nvar clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(\" \");\nvar CSS_REGEX = /((?:--)?(?:\\w+-?)+)\\s*:\\s*([^;]*)/g;\nvar serialize = (style) => {\n const res = {};\n let match;\n while (match = CSS_REGEX.exec(style)) {\n res[match[1]] = match[2];\n }\n return res;\n};\nvar css = (a, b) => {\n if (isString(a)) {\n if (isString(b)) return `${a};${b}`;\n a = serialize(a);\n } else if (isString(b)) {\n b = serialize(b);\n }\n return Object.assign({}, a ?? {}, b ?? {});\n};\nfunction mergeProps(...args) {\n let result = {};\n for (let props of args) {\n for (let key in result) {\n if (key.startsWith(\"on\") && typeof result[key] === \"function\" && typeof props[key] === \"function\") {\n result[key] = callAll(props[key], result[key]);\n continue;\n }\n if (key === \"className\" || key === \"class\") {\n result[key] = clsx(result[key], props[key]);\n continue;\n }\n if (key === \"style\") {\n result[key] = css(result[key], props[key]);\n continue;\n }\n result[key] = props[key] !== void 0 ? props[key] : result[key];\n }\n for (let key in props) {\n if (result[key] === void 0) {\n result[key] = props[key];\n }\n }\n }\n return result;\n}\n\nexport { Machine, choose, createMachine, deepMerge, guards, isMachine, mergeProps };\n","import { mergeProps } from '@zag-js/core';\nimport { memo, forwardRef, createElement, Children, isValidElement, cloneElement } from 'react';\nimport { composeRefs } from '../utils/compose-refs.js';\n\nfunction getRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nconst withAsChild = (Component) => {\n const Comp = memo(\n forwardRef((props, ref) => {\n const { asChild, children, ...restProps } = props;\n if (!asChild) {\n return createElement(Component, { ...restProps, ref }, children);\n }\n const onlyChild = Children.only(children);\n if (!isValidElement(onlyChild)) {\n return null;\n }\n const childRef = getRef(onlyChild);\n return cloneElement(onlyChild, {\n ...mergeProps(restProps, onlyChild.props),\n ref: ref ? composeRefs(ref, childRef) : childRef\n });\n })\n );\n Comp.displayName = Component.displayName || Component.name;\n return Comp;\n};\nconst jsxFactory = () => {\n const cache = /* @__PURE__ */ new Map();\n return new Proxy(withAsChild, {\n apply(_target, _thisArg, argArray) {\n return withAsChild(argArray[0]);\n },\n get(_, element) {\n const asElement = element;\n if (!cache.has(asElement)) {\n cache.set(asElement, withAsChild(asElement));\n }\n return cache.get(asElement);\n }\n });\n};\nconst ark = jsxFactory();\n\nexport { ark, jsxFactory };\n","'use client';\nconst createSplitProps = () => (props, keys) => keys.reduce(\n (previousValue, currentValue) => {\n const [target, source] = previousValue;\n const key = currentValue;\n if (source[key] !== void 0) {\n target[key] = source[key];\n }\n delete source[key];\n return [target, source];\n },\n [{}, { ...props }]\n);\n\nexport { createSplitProps };\n","'use client';\nimport { createSplitProps } from '../../utils/create-split-props.js';\n\nconst splitPresenceProps = (props) => createSplitProps()(props, [\n \"immediate\",\n \"lazyMount\",\n \"onExitComplete\",\n \"present\",\n \"unmountOnExit\"\n]);\n\nexport { splitPresenceProps };\n","// src/prop-types.ts\nfunction createNormalizer(fn) {\n return new Proxy({}, {\n get() {\n return fn;\n }\n });\n}\n\n// src/create-props.ts\nvar createProps = () => (props) => Array.from(new Set(props));\n\nexport { createNormalizer, createProps };\n","import { createMachine, ref } from '@zag-js/core';\nimport { createProps } from '@zag-js/types';\n\n// src/presence.connect.ts\nfunction connect(state, send, _normalize) {\n const present = state.matches(\"mounted\", \"unmountSuspended\");\n return {\n skip: !state.context.initial && present,\n present,\n setNode(node) {\n if (!node) return;\n send({ type: \"NODE.SET\", node });\n },\n unmount() {\n send({ type: \"UNMOUNT\" });\n }\n };\n}\nfunction machine(ctx) {\n return createMachine(\n {\n initial: ctx.present ? \"mounted\" : \"unmounted\",\n context: {\n node: null,\n styles: null,\n unmountAnimationName: null,\n prevAnimationName: null,\n present: false,\n initial: false,\n ...ctx\n },\n exit: [\"clearInitial\", \"cleanupNode\"],\n watch: {\n present: [\"setInitial\", \"syncPresence\"]\n },\n on: {\n \"NODE.SET\": {\n actions: [\"setNode\", \"setStyles\"]\n }\n },\n states: {\n mounted: {\n on: {\n UNMOUNT: {\n target: \"unmounted\",\n actions: [\"invokeOnExitComplete\"]\n },\n \"UNMOUNT.SUSPEND\": \"unmountSuspended\"\n }\n },\n unmountSuspended: {\n activities: [\"trackAnimationEvents\"],\n after: {\n // Fallback to timeout to ensure we exit this state even if the `animationend` event\n // did not get trigger\n ANIMATION_DURATION: {\n target: \"unmounted\",\n actions: [\"invokeOnExitComplete\"]\n }\n },\n on: {\n MOUNT: {\n target: \"mounted\",\n actions: [\"setPrevAnimationName\"]\n },\n UNMOUNT: {\n target: \"unmounted\",\n actions: [\"invokeOnExitComplete\"]\n }\n }\n },\n unmounted: {\n entry: [\"clearPrevAnimationName\"],\n on: {\n MOUNT: {\n target: \"mounted\",\n actions: [\"setPrevAnimationName\"]\n }\n }\n }\n }\n },\n {\n delays: {\n ANIMATION_DURATION(ctx2) {\n return parseMs(ctx2.styles?.animationDuration) + parseMs(ctx2.styles?.animationDelay) + ANIMATION_TIMEOUT_MARGIN;\n }\n },\n actions: {\n setInitial(ctx2) {\n ctx2.initial = true;\n },\n clearInitial(ctx2) {\n ctx2.initial = false;\n },\n cleanupNode(ctx2) {\n ctx2.node = null;\n ctx2.styles = null;\n },\n invokeOnExitComplete(ctx2) {\n ctx2.onExitComplete?.();\n },\n setNode(ctx2, evt) {\n ctx2.node = ref(evt.node);\n },\n setStyles(ctx2, evt) {\n const win = evt.node.ownerDocument.defaultView || window;\n ctx2.styles = ref(win.getComputedStyle(evt.node));\n },\n syncPresence(ctx2, _evt, { send }) {\n if (ctx2.present) {\n send({ type: \"MOUNT\", src: \"presence.changed\" });\n return;\n }\n if (!ctx2.present && ctx2.node?.ownerDocument.visibilityState === \"hidden\") {\n send({ type: \"UNMOUNT\", src: \"visibilitychange\" });\n return;\n }\n const animationName = getAnimationName(ctx2.styles);\n const exec = ctx2.immediate ? queueMicrotask : requestAnimationFrame;\n exec(() => {\n ctx2.unmountAnimationName = animationName;\n if (animationName === \"none\" || animationName === ctx2.prevAnimationName || ctx2.styles?.display === \"none\" || ctx2.styles?.animationDuration === \"0s\") {\n send({ type: \"UNMOUNT\", src: \"presence.changed\" });\n } else {\n send({ type: \"UNMOUNT.SUSPEND\" });\n }\n });\n },\n setPrevAnimationName(ctx2) {\n const exec = ctx2.immediate ? queueMicrotask : requestAnimationFrame;\n exec(() => {\n ctx2.prevAnimationName = getAnimationName(ctx2.styles);\n });\n },\n clearPrevAnimationName(ctx2) {\n ctx2.prevAnimationName = null;\n }\n },\n activities: {\n trackAnimationEvents(ctx2, _evt, { send }) {\n const node = ctx2.node;\n if (!node) return;\n const onStart = (event) => {\n const target = event.composedPath?.()?.[0] ?? event.target;\n if (target === node) {\n ctx2.prevAnimationName = getAnimationName(ctx2.styles);\n }\n };\n const onEnd = (event) => {\n const animationName = getAnimationName(ctx2.styles);\n const target = event.composedPath?.()?.[0] ?? event.target;\n if (target === node && animationName === ctx2.unmountAnimationName) {\n send({ type: \"UNMOUNT\", src: \"animationend\" });\n }\n };\n node.addEventListener(\"animationstart\", onStart);\n node.addEventListener(\"animationcancel\", onEnd);\n node.addEventListener(\"animationend\", onEnd);\n return () => {\n node.removeEventListener(\"animationstart\", onStart);\n node.removeEventListener(\"animationcancel\", onEnd);\n node.removeEventListener(\"animationend\", onEnd);\n };\n }\n }\n }\n );\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction parseMs(value) {\n return parseFloat(value || \"0\") * 1e3;\n}\nvar ANIMATION_TIMEOUT_MARGIN = 16.667;\nvar props = createProps()([\"onExitComplete\", \"present\", \"immediate\"]);\n\nexport { connect, machine, props };\n","export { mergeProps } from '@zag-js/core';\nimport { createNormalizer } from '@zag-js/types';\nimport { Children, useRef, useSyncExternalStore, useCallback, useMemo, useEffect, useLayoutEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { globalRef, subscribe, snapshot } from '@zag-js/store';\nimport { isChanged, createProxy } from 'proxy-compare';\n\nvar normalizeProps = createNormalizer((v) => v);\nvar Portal = (props) => {\n const { children, container, disabled, getRootNode } = props;\n const isServer = typeof window === \"undefined\";\n if (isServer || disabled) return /* @__PURE__ */ jsx(Fragment, { children });\n const doc = getRootNode?.().ownerDocument ?? document;\n const mountNode = container?.current ?? doc.body;\n return /* @__PURE__ */ jsx(Fragment, { children: Children.map(children, (child) => createPortal(child, mountNode)) });\n};\n\n// ../../utilities/core/src/equal.ts\nvar isArrayLike = (value) => value?.constructor.name === \"Array\";\nvar isArrayEqual = (a, b) => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (!isEqual(a[i], b[i])) return false;\n }\n return true;\n};\nvar isEqual = (a, b) => {\n if (Object.is(a, b)) return true;\n if (a == null && b != null || a != null && b == null) return false;\n if (typeof a?.isEqual === \"function\" && typeof b?.isEqual === \"function\") {\n return a.isEqual(b);\n }\n if (typeof a === \"function\" && typeof b === \"function\") {\n return a.toString() === b.toString();\n }\n if (isArrayLike(a) && isArrayLike(b)) {\n return isArrayEqual(Array.from(a), Array.from(b));\n }\n if (!(typeof a === \"object\") || !(typeof b === \"object\")) return false;\n const keys = Object.keys(b ?? /* @__PURE__ */ Object.create(null));\n const length = keys.length;\n for (let i = 0; i < length; i++) {\n const hasKey = Reflect.has(a, keys[i]);\n if (!hasKey) return false;\n }\n for (let i = 0; i < length; i++) {\n const key = keys[i];\n if (!isEqual(a[key], b[key])) return false;\n }\n return true;\n};\n\n// ../../utilities/core/src/guard.ts\nvar isDev = () => process.env.NODE_ENV !== \"production\";\nvar fnToString = Function.prototype.toString;\nfnToString.call(Object);\n\n// ../../utilities/core/src/object.ts\nfunction compact(obj) {\n if (!isPlainObject(obj) || obj === void 0) return obj;\n const keys = Reflect.ownKeys(obj).filter((key) => typeof key === \"string\");\n const filtered = {};\n for (const key of keys) {\n const value = obj[key];\n if (value !== void 0) {\n filtered[key] = compact(value);\n }\n }\n return filtered;\n}\nvar isPlainObject = (v) => {\n return v && typeof v === \"object\" && v.constructor === Object;\n};\nfunction useUpdateEffect(callback, deps) {\n const render = useRef(false);\n const effect = useRef(false);\n useEffect(() => {\n const mounted = render.current;\n const run = mounted && effect.current;\n if (run) {\n return callback();\n }\n effect.current = true;\n }, deps);\n useEffect(() => {\n render.current = true;\n return () => {\n render.current = false;\n };\n }, []);\n}\n\n// src/use-snapshot.ts\nvar targetCache = globalRef(\"__zag__targetCache\", () => /* @__PURE__ */ new WeakMap());\nfunction useSnapshot(service, options) {\n const { actions, context, sync: notifyInSync } = options ?? {};\n const lastSnapshot = useRef(void 0);\n const lastAffected = useRef(void 0);\n const currSnapshot = useSyncExternalStore(\n useCallback((callback) => subscribe(service.state, callback, notifyInSync), [notifyInSync]),\n () => {\n const nextSnapshot = snapshot(service.state);\n try {\n if (lastSnapshot.current && lastAffected.current && !isChanged(lastSnapshot.current, nextSnapshot, lastAffected.current, /* @__PURE__ */ new WeakMap())) {\n return lastSnapshot.current;\n }\n } catch {\n }\n return nextSnapshot;\n },\n () => snapshot(service.state)\n );\n service.setOptions({ actions });\n const ctx = useMemo(() => compact(context ?? {}), [context]);\n useUpdateEffect(() => {\n const entries = Object.entries(ctx);\n const previousCtx = service.contextSnapshot ?? {};\n const equality = entries.map(([key, value]) => ({\n key,\n curr: value,\n prev: previousCtx[key],\n equal: isEqual(previousCtx[key], value)\n }));\n const allEqual = equality.every(({ equal }) => equal);\n if (!allEqual) {\n service.setContext(ctx);\n }\n }, [ctx]);\n const currAffected = /* @__PURE__ */ new WeakMap();\n useEffect(() => {\n lastSnapshot.current = currSnapshot;\n lastAffected.current = currAffected;\n });\n const proxyCache = useMemo(() => /* @__PURE__ */ new WeakMap(), []);\n return createProxy(currSnapshot, currAffected, proxyCache, targetCache);\n}\n\n// src/use-actor.ts\nfunction useActor(service) {\n const state = useSnapshot(service);\n return [state, service.send];\n}\nfunction useConstant(fn) {\n const ref = useRef(void 0);\n if (!ref.current) ref.current = { v: fn() };\n return ref.current.v;\n}\nvar useSafeLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/use-service.ts\nfunction useService(machine, options) {\n const { state: hydratedState, context } = options ?? {};\n const service = useConstant(() => {\n const instance = typeof machine === \"function\" ? machine() : machine;\n if (context) instance.setContext(context);\n instance._created();\n return instance;\n });\n const snapshotRef = useRef(void 0);\n useSafeLayoutEffect(() => {\n const stateInit = hydratedState ?? snapshotRef.current;\n service.start(stateInit);\n return () => {\n if (isDev()) {\n snapshotRef.current = service.getHydrationState();\n }\n service.stop();\n };\n }, []);\n return service;\n}\n\n// src/use-machine.ts\nfunction useMachine(machine, options) {\n const service = useService(machine, options);\n const state = useSnapshot(service, options);\n return [state, service.send, service];\n}\n\nexport { Portal, normalizeProps, useActor, useMachine };\n","'use client';\nimport { useCallback, useRef } from 'react';\n\nfunction useEvent(callback, opts = {}) {\n const { sync = false } = opts;\n const callbackRef = useLatestRef(callback);\n return useCallback(\n // biome-ignore lint/suspicious/noExplicitAny: \n (...args) => {\n if (sync) return queueMicrotask(() => callbackRef.current?.(...args));\n return callbackRef.current?.(...args);\n },\n [sync, callbackRef]\n );\n}\nfunction useLatestRef(value) {\n const ref = useRef(value);\n ref.current = value;\n return ref;\n}\n\nexport { useEvent };\n","'use client';\nimport * as presence from '@zag-js/presence';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport { useRef } from 'react';\nimport { useEvent } from '../../utils/use-event.js';\n\nconst usePresence = (props) => {\n const { lazyMount, unmountOnExit, present, ...rest } = props;\n const wasEverPresent = useRef(false);\n const context = {\n ...rest,\n present,\n onExitComplete: useEvent(props.onExitComplete)\n };\n const [state, send] = useMachine(presence.machine(context), { context });\n const api = presence.connect(state, send, normalizeProps);\n if (api.present) {\n wasEverPresent.current = true;\n }\n const unmounted = !api.present && !wasEverPresent.current && lazyMount || unmountOnExit && !api.present && wasEverPresent.current;\n const getPresenceProps = () => ({\n \"data-state\": present ? \"open\" : \"closed\",\n hidden: !api.present\n });\n return {\n ref: api.setNode,\n getPresenceProps,\n present: api.present,\n unmounted\n };\n};\n\nexport { usePresence };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [PresenceProvider, usePresenceContext] = createContext({\n name: \"PresenceContext\",\n hookName: \"usePresenceContext\",\n providerName: \"\"\n});\n\nexport { PresenceProvider, usePresenceContext };\n","// src/create-anatomy.ts\nvar createAnatomy = (name, parts = []) => ({\n parts: (...values) => {\n if (isEmpty(parts)) {\n return createAnatomy(name, values);\n }\n throw new Error(\"createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?\");\n },\n extendWith: (...values) => createAnatomy(name, [...parts, ...values]),\n rename: (newName) => createAnatomy(newName, parts),\n keys: () => parts,\n build: () => [...new Set(parts)].reduce(\n (prev, part) => Object.assign(prev, {\n [part]: {\n selector: [\n `&[data-scope=\"${toKebabCase(name)}\"][data-part=\"${toKebabCase(part)}\"]`,\n `& [data-scope=\"${toKebabCase(name)}\"][data-part=\"${toKebabCase(part)}\"]`\n ].join(\", \"),\n attrs: { \"data-scope\": toKebabCase(name), \"data-part\": toKebabCase(part) }\n }\n }),\n {}\n )\n});\nvar toKebabCase = (value) => value.replace(/([A-Z])([A-Z])/g, \"$1-$2\").replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[\\s_]+/g, \"-\").toLowerCase();\nvar isEmpty = (v) => v.length === 0;\n\nexport { createAnatomy };\n","import { createAnatomy } from '@zag-js/anatomy';\nimport { createScope, queryAll, nextById, prevById, dataAttr, isSafari, getEventKey } from '@zag-js/dom-query';\nimport { first, last, createSplitProps, compact, remove, add, warn, isEqual } from '@zag-js/utils';\nimport { createMachine, guards } from '@zag-js/core';\nimport { createProps } from '@zag-js/types';\n\n// src/accordion.anatomy.ts\nvar anatomy = createAnatomy(\"accordion\").parts(\"root\", \"item\", \"itemTrigger\", \"itemContent\", \"itemIndicator\");\nvar parts = anatomy.build();\nvar dom = createScope({\n getRootId: (ctx) => ctx.ids?.root ?? `accordion:${ctx.id}`,\n getItemId: (ctx, value) => ctx.ids?.item?.(value) ?? `accordion:${ctx.id}:item:${value}`,\n getItemContentId: (ctx, value) => ctx.ids?.itemContent?.(value) ?? `accordion:${ctx.id}:content:${value}`,\n getItemTriggerId: (ctx, value) => ctx.ids?.itemTrigger?.(value) ?? `accordion:${ctx.id}:trigger:${value}`,\n getRootEl: (ctx) => dom.getById(ctx, dom.getRootId(ctx)),\n getTriggerEls: (ctx) => {\n const ownerId = CSS.escape(dom.getRootId(ctx));\n const selector = `[aria-controls][data-ownedby='${ownerId}']:not([disabled])`;\n return queryAll(dom.getRootEl(ctx), selector);\n },\n getFirstTriggerEl: (ctx) => first(dom.getTriggerEls(ctx)),\n getLastTriggerEl: (ctx) => last(dom.getTriggerEls(ctx)),\n getNextTriggerEl: (ctx, id) => nextById(dom.getTriggerEls(ctx), dom.getItemTriggerId(ctx, id)),\n getPrevTriggerEl: (ctx, id) => prevById(dom.getTriggerEls(ctx), dom.getItemTriggerId(ctx, id))\n});\n\n// src/accordion.connect.ts\nfunction connect(state, send, normalize) {\n const focusedValue = state.context.focusedValue;\n const value = state.context.value;\n const multiple = state.context.multiple;\n function setValue(value2) {\n let nextValue = value2;\n if (multiple && nextValue.length > 1) {\n nextValue = [nextValue[0]];\n }\n send({ type: \"VALUE.SET\", value: nextValue });\n }\n function getItemState(props2) {\n return {\n expanded: value.includes(props2.value),\n focused: focusedValue === props2.value,\n disabled: Boolean(props2.disabled ?? state.context.disabled)\n };\n }\n return {\n focusedValue,\n value,\n setValue,\n getItemState,\n getRootProps() {\n return normalize.element({\n ...parts.root.attrs,\n dir: state.context.dir,\n id: dom.getRootId(state.context),\n \"data-orientation\": state.context.orientation\n });\n },\n getItemProps(props2) {\n const itemState = getItemState(props2);\n return normalize.element({\n ...parts.item.attrs,\n dir: state.context.dir,\n id: dom.getItemId(state.context, props2.value),\n \"data-state\": itemState.expanded ? \"open\" : \"closed\",\n \"data-focus\": dataAttr(itemState.focused),\n \"data-disabled\": dataAttr(itemState.disabled),\n \"data-orientation\": state.context.orientation\n });\n },\n getItemContentProps(props2) {\n const itemState = getItemState(props2);\n return normalize.element({\n ...parts.itemContent.attrs,\n dir: state.context.dir,\n role: \"region\",\n id: dom.getItemContentId(state.context, props2.value),\n \"aria-labelledby\": dom.getItemTriggerId(state.context, props2.value),\n hidden: !itemState.expanded,\n \"data-state\": itemState.expanded ? \"open\" : \"closed\",\n \"data-disabled\": dataAttr(itemState.disabled),\n \"data-focus\": dataAttr(itemState.focused),\n \"data-orientation\": state.context.orientation\n });\n },\n getItemIndicatorProps(props2) {\n const itemState = getItemState(props2);\n return normalize.element({\n ...parts.itemIndicator.attrs,\n dir: state.context.dir,\n \"aria-hidden\": true,\n \"data-state\": itemState.expanded ? \"open\" : \"closed\",\n \"data-disabled\": dataAttr(itemState.disabled),\n \"data-focus\": dataAttr(itemState.focused),\n \"data-orientation\": state.context.orientation\n });\n },\n getItemTriggerProps(props2) {\n const { value: value2 } = props2;\n const itemState = getItemState(props2);\n return normalize.button({\n ...parts.itemTrigger.attrs,\n type: \"button\",\n dir: state.context.dir,\n id: dom.getItemTriggerId(state.context, value2),\n \"aria-controls\": dom.getItemContentId(state.context, value2),\n \"aria-expanded\": itemState.expanded,\n disabled: itemState.disabled,\n \"data-orientation\": state.context.orientation,\n \"aria-disabled\": itemState.disabled,\n \"data-state\": itemState.expanded ? \"open\" : \"closed\",\n \"data-ownedby\": dom.getRootId(state.context),\n onFocus() {\n if (itemState.disabled) return;\n send({ type: \"TRIGGER.FOCUS\", value: value2 });\n },\n onBlur() {\n if (itemState.disabled) return;\n send(\"TRIGGER.BLUR\");\n },\n onClick(event) {\n if (itemState.disabled) return;\n if (isSafari()) {\n event.currentTarget.focus();\n }\n send({ type: \"TRIGGER.CLICK\", value: value2 });\n },\n onKeyDown(event) {\n if (event.defaultPrevented) return;\n if (itemState.disabled) return;\n const keyMap = {\n ArrowDown() {\n if (state.context.isHorizontal) return;\n send({ type: \"GOTO.NEXT\", value: value2 });\n },\n ArrowUp() {\n if (state.context.isHorizontal) return;\n send({ type: \"GOTO.PREV\", value: value2 });\n },\n ArrowRight() {\n if (!state.context.isHorizontal) return;\n send({ type: \"GOTO.NEXT\", value: value2 });\n },\n ArrowLeft() {\n if (!state.context.isHorizontal) return;\n send({ type: \"GOTO.PREV\", value: value2 });\n },\n Home() {\n send({ type: \"GOTO.FIRST\", value: value2 });\n },\n End() {\n send({ type: \"GOTO.LAST\", value: value2 });\n }\n };\n const key = getEventKey(event, {\n dir: state.context.dir,\n orientation: state.context.orientation\n });\n const exec = keyMap[key];\n if (exec) {\n exec(event);\n event.preventDefault();\n }\n }\n });\n }\n };\n}\nvar { and, not } = guards;\nfunction machine(userContext) {\n const ctx = compact(userContext);\n return createMachine(\n {\n id: \"accordion\",\n initial: \"idle\",\n context: {\n focusedValue: null,\n value: [],\n collapsible: false,\n multiple: false,\n orientation: \"vertical\",\n ...ctx\n },\n watch: {\n value: \"coarseValue\",\n multiple: \"coarseValue\"\n },\n created: \"coarseValue\",\n computed: {\n isHorizontal: (ctx2) => ctx2.orientation === \"horizontal\"\n },\n on: {\n \"VALUE.SET\": {\n actions: [\"setValue\"]\n }\n },\n states: {\n idle: {\n on: {\n \"TRIGGER.FOCUS\": {\n target: \"focused\",\n actions: \"setFocusedValue\"\n }\n }\n },\n focused: {\n on: {\n \"GOTO.NEXT\": {\n actions: \"focusNextTrigger\"\n },\n \"GOTO.PREV\": {\n actions: \"focusPrevTrigger\"\n },\n \"TRIGGER.CLICK\": [\n {\n guard: and(\"isExpanded\", \"canToggle\"),\n actions: [\"collapse\"]\n },\n {\n guard: not(\"isExpanded\"),\n actions: [\"expand\"]\n }\n ],\n \"GOTO.FIRST\": {\n actions: \"focusFirstTrigger\"\n },\n \"GOTO.LAST\": {\n actions: \"focusLastTrigger\"\n },\n \"TRIGGER.BLUR\": {\n target: \"idle\",\n actions: \"clearFocusedValue\"\n }\n }\n }\n }\n },\n {\n guards: {\n canToggle: (ctx2) => !!ctx2.collapsible || !!ctx2.multiple,\n isExpanded: (ctx2, evt) => ctx2.value.includes(evt.value)\n },\n actions: {\n collapse(ctx2, evt) {\n const next = ctx2.multiple ? remove(ctx2.value, evt.value) : [];\n set.value(ctx2, ctx2.multiple ? next : []);\n },\n expand(ctx2, evt) {\n const next = ctx2.multiple ? add(ctx2.value, evt.value) : [evt.value];\n set.value(ctx2, next);\n },\n focusFirstTrigger(ctx2) {\n dom.getFirstTriggerEl(ctx2)?.focus();\n },\n focusLastTrigger(ctx2) {\n dom.getLastTriggerEl(ctx2)?.focus();\n },\n focusNextTrigger(ctx2) {\n if (!ctx2.focusedValue) return;\n const triggerEl = dom.getNextTriggerEl(ctx2, ctx2.focusedValue);\n triggerEl?.focus();\n },\n focusPrevTrigger(ctx2) {\n if (!ctx2.focusedValue) return;\n const triggerEl = dom.getPrevTriggerEl(ctx2, ctx2.focusedValue);\n triggerEl?.focus();\n },\n setFocusedValue(ctx2, evt) {\n set.focusedValue(ctx2, evt.value);\n },\n clearFocusedValue(ctx2) {\n set.focusedValue(ctx2, null);\n },\n setValue(ctx2, evt) {\n set.value(ctx2, evt.value);\n },\n coarseValue(ctx2) {\n if (!ctx2.multiple && ctx2.value.length > 1) {\n warn(`The value of accordion should be a single value when multiple is false.`);\n ctx2.value = [ctx2.value[0]];\n }\n }\n }\n }\n );\n}\nvar invoke = {\n change(ctx) {\n ctx.onValueChange?.({ value: Array.from(ctx.value) });\n },\n focusChange(ctx) {\n ctx.onFocusChange?.({ value: ctx.focusedValue });\n }\n};\nvar set = {\n value(ctx, value) {\n if (isEqual(ctx.value, value)) return;\n ctx.value = value;\n invoke.change(ctx);\n },\n focusedValue(ctx, value) {\n if (isEqual(ctx.focusedValue, value)) return;\n ctx.focusedValue = value;\n invoke.focusChange(ctx);\n }\n};\nvar props = createProps()([\n \"collapsible\",\n \"dir\",\n \"disabled\",\n \"getRootNode\",\n \"id\",\n \"ids\",\n \"multiple\",\n \"onFocusChange\",\n \"onValueChange\",\n \"orientation\",\n \"value\"\n]);\nvar splitProps = createSplitProps(props);\nvar itemProps = createProps()([\"value\", \"disabled\"]);\nvar splitItemProps = createSplitProps(itemProps);\n\nexport { anatomy, connect, itemProps, machine, props, splitItemProps, splitProps };\n","import { createAnatomy } from '@zag-js/anatomy';\nimport { createScope, dataAttr, raf, getComputedStyle, getEventTarget } from '@zag-js/dom-query';\nimport { createMachine, ref } from '@zag-js/core';\nimport { createSplitProps, compact } from '@zag-js/utils';\nimport { createProps } from '@zag-js/types';\n\n// src/collapsible.anatomy.ts\nvar anatomy = createAnatomy(\"collapsible\").parts(\"root\", \"trigger\", \"content\");\nvar parts = anatomy.build();\nvar dom = createScope({\n getRootId: (ctx) => ctx.ids?.root ?? `collapsible:${ctx.id}`,\n getContentId: (ctx) => ctx.ids?.content ?? `collapsible:${ctx.id}:content`,\n getTriggerId: (ctx) => ctx.ids?.trigger ?? `collapsible:${ctx.id}:trigger`,\n getRootEl: (ctx) => dom.getById(ctx, dom.getRootId(ctx)),\n getContentEl: (ctx) => dom.getById(ctx, dom.getContentId(ctx)),\n getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx))\n});\n\n// src/collapsible.connect.ts\nfunction connect(state, send, normalize) {\n const visible = state.matches(\"open\", \"closing\");\n const open = state.matches(\"open\");\n const height = state.context.height;\n const width = state.context.width;\n const disabled = !!state.context.disabled;\n const skip = !state.context.initial && open;\n return {\n disabled,\n visible,\n open,\n measureSize() {\n send(\"SIZE.MEASURE\");\n },\n setOpen(nextOpen) {\n if (nextOpen === open) return;\n send(nextOpen ? \"OPEN\" : \"CLOSE\");\n },\n getRootProps() {\n return normalize.element({\n ...parts.root.attrs,\n \"data-state\": open ? \"open\" : \"closed\",\n dir: state.context.dir,\n id: dom.getRootId(state.context)\n });\n },\n getContentProps() {\n return normalize.element({\n ...parts.content.attrs,\n \"data-collapsible\": \"\",\n \"data-state\": skip ? void 0 : open ? \"open\" : \"closed\",\n id: dom.getContentId(state.context),\n \"data-disabled\": dataAttr(disabled),\n hidden: !visible,\n style: {\n \"--height\": height != null ? `${height}px` : void 0,\n \"--width\": width != null ? `${width}px` : void 0\n }\n });\n },\n getTriggerProps() {\n return normalize.element({\n ...parts.trigger.attrs,\n id: dom.getTriggerId(state.context),\n dir: state.context.dir,\n type: \"button\",\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-disabled\": dataAttr(disabled),\n \"aria-controls\": dom.getContentId(state.context),\n \"aria-expanded\": visible || false,\n onClick(event) {\n if (event.defaultPrevented) return;\n if (disabled) return;\n send({ type: open ? \"CLOSE\" : \"OPEN\", src: \"trigger.click\" });\n }\n });\n }\n };\n}\nfunction machine(userContext) {\n const ctx = compact(userContext);\n return createMachine(\n {\n id: \"collapsible\",\n initial: ctx.open ? \"open\" : \"closed\",\n context: {\n ...ctx,\n height: 0,\n width: 0,\n initial: false,\n stylesRef: null,\n unmountAnimationName: null\n },\n watch: {\n open: [\"setInitial\", \"computeSize\", \"toggleVisibility\"]\n },\n exit: [\"clearInitial\", \"cleanupNode\"],\n states: {\n closed: {\n tags: [\"closed\"],\n on: {\n \"CONTROLLED.OPEN\": \"open\",\n OPEN: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnOpen\"]\n },\n {\n target: \"open\",\n actions: [\"setInitial\", \"computeSize\", \"invokeOnOpen\"]\n }\n ]\n }\n },\n closing: {\n tags: [\"open\"],\n activities: [\"trackExitAnimation\"],\n on: {\n \"CONTROLLED.CLOSE\": \"closed\",\n \"CONTROLLED.OPEN\": \"open\",\n OPEN: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnOpen\"]\n },\n {\n target: \"open\",\n actions: [\"setInitial\", \"invokeOnOpen\"]\n }\n ],\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnExitComplete\"]\n },\n {\n target: \"closed\",\n actions: [\"setInitial\", \"computeSize\", \"invokeOnExitComplete\"]\n }\n ],\n \"ANIMATION.END\": {\n target: \"closed\",\n actions: [\"invokeOnExitComplete\", \"clearInitial\"]\n }\n }\n },\n open: {\n tags: [\"open\"],\n activities: [\"trackEnterAnimation\"],\n on: {\n \"CONTROLLED.CLOSE\": \"closing\",\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"closing\",\n actions: [\"setInitial\", \"computeSize\", \"invokeOnClose\"]\n }\n ],\n \"SIZE.MEASURE\": {\n actions: [\"measureSize\"]\n },\n \"ANIMATION.END\": {\n actions: [\"clearInitial\"]\n }\n }\n }\n }\n },\n {\n guards: {\n isOpenControlled: (ctx2) => !!ctx2[\"open.controlled\"]\n },\n activities: {\n trackEnterAnimation(ctx2, _evt, { send }) {\n let cleanup;\n const rafCleanup = raf(() => {\n const contentEl = dom.getContentEl(ctx2);\n if (!contentEl) return;\n const animationName = getComputedStyle(contentEl).animationName;\n const hasNoAnimation = !animationName || animationName === \"none\";\n if (hasNoAnimation) {\n send({ type: \"ANIMATION.END\" });\n return;\n }\n const onEnd = (event) => {\n const target = getEventTarget(event);\n if (target === contentEl) {\n send({ type: \"ANIMATION.END\" });\n }\n };\n contentEl.addEventListener(\"animationend\", onEnd);\n cleanup = () => {\n contentEl.removeEventListener(\"animationend\", onEnd);\n };\n });\n return () => {\n rafCleanup();\n cleanup?.();\n };\n },\n trackExitAnimation(ctx2, _evt, { send }) {\n let cleanup;\n const rafCleanup = raf(() => {\n const contentEl = dom.getContentEl(ctx2);\n if (!contentEl) return;\n const animationName = getComputedStyle(contentEl).animationName;\n const hasNoAnimation = !animationName || animationName === \"none\";\n if (hasNoAnimation) {\n send({ type: \"ANIMATION.END\" });\n return;\n }\n const onEnd = (event) => {\n const win = contentEl.ownerDocument.defaultView || window;\n const animationName2 = win.getComputedStyle(contentEl).animationName;\n const target = getEventTarget(event);\n if (target === contentEl && animationName2 === ctx2.unmountAnimationName) {\n send({ type: \"ANIMATION.END\" });\n }\n };\n contentEl.addEventListener(\"animationend\", onEnd);\n cleanup = () => {\n contentEl.removeEventListener(\"animationend\", onEnd);\n };\n });\n return () => {\n rafCleanup();\n cleanup?.();\n };\n }\n },\n actions: {\n setInitial(ctx2) {\n ctx2.initial = true;\n },\n clearInitial(ctx2) {\n raf(() => {\n ctx2.initial = false;\n });\n },\n cleanupNode(ctx2) {\n ctx2.stylesRef = null;\n },\n measureSize(ctx2) {\n const contentEl = dom.getContentEl(ctx2);\n if (!contentEl) return;\n const { height, width } = contentEl.getBoundingClientRect();\n ctx2.height = height;\n ctx2.width = width;\n },\n computeSize(ctx2, evt) {\n ctx2._rafCleanup?.();\n ctx2._rafCleanup = raf(() => {\n const contentEl = dom.getContentEl(ctx2);\n if (!contentEl) return;\n ctx2.stylesRef || (ctx2.stylesRef = ref({\n animationName: contentEl.style.animationName,\n animationDuration: contentEl.style.animationDuration\n }));\n if (evt.type === \"CLOSE\" || !ctx2.open) {\n const win = contentEl.ownerDocument.defaultView || window;\n ctx2.unmountAnimationName = win.getComputedStyle(contentEl).animationName;\n }\n const hidden = contentEl.hidden;\n contentEl.style.animationName = \"none\";\n contentEl.style.animationDuration = \"0s\";\n contentEl.hidden = false;\n const rect = contentEl.getBoundingClientRect();\n ctx2.height = rect.height;\n ctx2.width = rect.width;\n if (ctx2.initial) {\n contentEl.style.animationName = ctx2.stylesRef.animationName;\n contentEl.style.animationDuration = ctx2.stylesRef.animationDuration;\n }\n contentEl.hidden = hidden;\n });\n },\n invokeOnOpen: (ctx2) => {\n ctx2.onOpenChange?.({ open: true });\n },\n invokeOnClose: (ctx2) => {\n ctx2.onOpenChange?.({ open: false });\n },\n invokeOnExitComplete(ctx2) {\n ctx2.onExitComplete?.();\n },\n toggleVisibility: (ctx2, _evt, { send }) => {\n send({ type: ctx2.open ? \"CONTROLLED.OPEN\" : \"CONTROLLED.CLOSE\" });\n }\n }\n }\n );\n}\nvar props = createProps()([\n \"dir\",\n \"disabled\",\n \"getRootNode\",\n \"id\",\n \"ids\",\n \"onExitComplete\",\n \"onOpenChange\",\n \"open.controlled\",\n \"open\"\n]);\nvar splitProps = createSplitProps(props);\n\nexport { anatomy, connect, machine, props, splitProps };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [EnvironmentContextProvider, useEnvironmentContext] = createContext({\n name: \"EnvironmentContext\",\n hookName: \"useEnvironmentContext\",\n providerName: \"\",\n strict: false,\n defaultValue: {\n getRootNode: () => document,\n getDocument: () => document,\n getWindow: () => window\n }\n});\n\nexport { EnvironmentContextProvider, useEnvironmentContext };\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n // RTL scrollbar.\n getWindowScrollBarX(documentElement, htmlRect));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n // If the scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the element as the offsetParent if it's non-static,\n // while Chrome and Safari return the element. The element must\n // be used to perform the correct calculations even if the element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle