{ "version": 3, "sources": ["../../bits-ui/dist/bits/accordion/index.js", "../../bits-ui/dist/internal/arrays.js", "../../@melt-ui/svelte/dist/internal/helpers/array.js", "../../@melt-ui/svelte/dist/internal/helpers/style.js", "../../@melt-ui/svelte/dist/internal/helpers/attr.js", "../../@melt-ui/svelte/dist/internal/helpers/store/lightable.js", "../../@melt-ui/svelte/dist/internal/helpers/makeElement.js", "../../@melt-ui/svelte/dist/internal/helpers/is.js", "../../@melt-ui/svelte/dist/internal/helpers/dom.js", "../../@melt-ui/svelte/dist/internal/helpers/callbacks.js", "../../@melt-ui/svelte/dist/internal/helpers/event.js", "../../@melt-ui/svelte/dist/internal/helpers/highlight.js", "../../@melt-ui/svelte/dist/internal/helpers/lifecycle.js", "../../@melt-ui/svelte/dist/internal/helpers/list.js", "../../@melt-ui/svelte/dist/internal/helpers/locale.js", "../../@melt-ui/svelte/dist/internal/helpers/object.js", "../../@melt-ui/svelte/dist/internal/helpers/withGet.js", "../../@melt-ui/svelte/dist/internal/helpers/overridable.js", "../../@melt-ui/svelte/dist/internal/helpers/sleep.js", "../../@melt-ui/svelte/dist/internal/helpers/id.js", "../../@melt-ui/svelte/dist/internal/helpers/keyboard.js", "../../@melt-ui/svelte/dist/internal/helpers/debounce.js", "../../@melt-ui/svelte/dist/internal/helpers/platform.js", "../../@melt-ui/svelte/dist/internal/helpers/polygon/hull.js", "../../@melt-ui/svelte/dist/internal/helpers/polygon/index.js", "../../@melt-ui/svelte/dist/internal/helpers/scroll.js", "../../@melt-ui/svelte/dist/internal/helpers/store/derivedVisible.js", "../../@melt-ui/svelte/dist/internal/helpers/store/effect.js", "../../@melt-ui/svelte/dist/internal/helpers/store/toWritableStores.js", "../../@melt-ui/svelte/dist/internal/helpers/rovingFocus.js", "../../@melt-ui/svelte/dist/internal/helpers/typeahead.js", "../../@melt-ui/svelte/dist/internal/helpers/elements.js", "../../@melt-ui/svelte/dist/internal/helpers/ignore.js", "../../@melt-ui/svelte/dist/internal/helpers/focus.js", "../../@melt-ui/svelte/dist/internal/helpers/math.js", "../../@melt-ui/svelte/dist/builders/accordion/create.js", "../../@melt-ui/svelte/dist/builders/avatar/create.js", "../../@melt-ui/svelte/dist/builders/checkbox/create.js", "../../@melt-ui/svelte/dist/builders/collapsible/create.js", "../../@melt-ui/svelte/dist/internal/actions/click-outside/action.js", "../../@melt-ui/svelte/dist/internal/actions/escape-keydown/action.js", "../../@floating-ui/utils/dist/floating-ui.utils.mjs", "../../@floating-ui/core/dist/floating-ui.core.mjs", "../../@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../../@floating-ui/dom/dist/floating-ui.dom.mjs", "../../@melt-ui/svelte/dist/internal/actions/floating/action.js", "../../tabbable/src/index.js", "../../focus-trap/index.js", "../../@melt-ui/svelte/dist/internal/actions/focus-trap/action.js", "../../@melt-ui/svelte/dist/internal/actions/melt/index.js", "../../@melt-ui/svelte/dist/internal/actions/modal/action.js", "../../@melt-ui/svelte/dist/internal/actions/popper/action.js", "../../@melt-ui/svelte/dist/internal/actions/portal.js", "../../@melt-ui/svelte/dist/internal/actions/interact-outside/action.js", "../../@melt-ui/svelte/dist/internal/helpers/store/toReadableStores.js", "../../@melt-ui/svelte/dist/builders/hidden-input/create.js", "../../@melt-ui/svelte/dist/builders/label/create.js", "../../@melt-ui/svelte/dist/builders/listbox/create.js", "../../@melt-ui/svelte/dist/builders/combobox/create.js", "../../@melt-ui/svelte/dist/builders/menu/create.js", "../../@melt-ui/svelte/dist/builders/context-menu/create.js", "../../@swc/helpers/esm/_check_private_redeclaration.js", "../../@swc/helpers/esm/_class_private_field_init.js", "../../@internationalized/date/dist/packages/@internationalized/date/src/index.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/CalendarDate.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/manipulation.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/conversion.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/GregorianCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/utils.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/queries.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/weekStartData.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/string.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/JapaneseCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/BuddhistCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/TaiwanCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/PersianCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/IndianCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/IslamicCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/HebrewCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/calendars/EthiopicCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/createCalendar.ts", "../../@internationalized/date/dist/packages/@internationalized/date/src/DateFormatter.ts", "../../@melt-ui/svelte/dist/internal/helpers/date/utils.js", "../../@melt-ui/svelte/dist/internal/helpers/date/formatter.js", "../../@melt-ui/svelte/dist/internal/helpers/date/store.js", "../../@melt-ui/svelte/dist/internal/helpers/date/placeholders.js", "../../@melt-ui/svelte/dist/internal/helpers/date/announcer.js", "../../@melt-ui/svelte/dist/builders/date-field/_internal/parts.js", "../../@melt-ui/svelte/dist/builders/date-field/_internal/helpers.js", "../../@melt-ui/svelte/dist/internal/helpers/date/field.js", "../../@melt-ui/svelte/dist/internal/helpers/date/calendar.js", "../../@melt-ui/svelte/dist/builders/calendar/create.js", "../../@melt-ui/svelte/dist/builders/date-field/create.js", "../../@melt-ui/svelte/dist/internal/helpers/date/focus.js", "../../@melt-ui/svelte/dist/builders/date-picker/create.js", "../../@melt-ui/svelte/dist/builders/date-range-field/_internal/helpers.js", "../../@melt-ui/svelte/dist/builders/date-range-field/create.js", "../../@melt-ui/svelte/dist/builders/date-range-picker/create.js", "../../@melt-ui/svelte/dist/builders/dialog/create.js", "../../@melt-ui/svelte/dist/builders/dropdown-menu/create.js", "../../@melt-ui/svelte/dist/builders/link-preview/create.js", "../../@melt-ui/svelte/dist/builders/menubar/create.js", "../../@melt-ui/svelte/dist/builders/pagination/helpers.js", "../../@melt-ui/svelte/dist/builders/pagination/create.js", "../../@melt-ui/svelte/dist/builders/pin-input/create.js", "../../@melt-ui/svelte/dist/builders/popover/create.js", "../../@melt-ui/svelte/dist/builders/progress/create.js", "../../@melt-ui/svelte/dist/builders/radio-group/create.js", "../../@melt-ui/svelte/dist/builders/range-calendar/create.js", "../../@melt-ui/svelte/dist/builders/scroll-area/helpers.js", "../../@melt-ui/svelte/dist/internal/helpers/store/stateMachine.js", "../../@melt-ui/svelte/dist/builders/scroll-area/scrollbars.js", "../../@melt-ui/svelte/dist/builders/scroll-area/create.js", "../../@melt-ui/svelte/dist/builders/select/create.js", "../../@melt-ui/svelte/dist/builders/separator/create.js", "../../@melt-ui/svelte/dist/builders/slider/create.js", "../../@melt-ui/svelte/dist/builders/switch/create.js", "../../@melt-ui/svelte/dist/builders/tabs/create.js", "../../@melt-ui/svelte/dist/builders/tags-input/create.js", "../../@melt-ui/svelte/dist/builders/toast/create.js", "../../@melt-ui/svelte/dist/builders/toggle/create.js", "../../@melt-ui/svelte/dist/builders/toggle-group/create.js", "../../@melt-ui/svelte/dist/builders/toolbar/create.js", "../../@melt-ui/svelte/dist/builders/tooltip/create.js", "../../@melt-ui/svelte/dist/builders/tree/create.js", "../../bits-ui/dist/internal/attrs.js", "../../bits-ui/dist/internal/events.js", "../../bits-ui/dist/internal/id.js", "../../bits-ui/dist/internal/is.js", "../../bits-ui/dist/internal/object.js", "../../bits-ui/dist/internal/style.js", "../../bits-ui/dist/internal/updater.js", "../../bits-ui/dist/internal/focus.js", "../../bits-ui/dist/bits/accordion/ctx.js", "../../bits-ui/dist/bits/accordion/components/accordion.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-item.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-header.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-trigger.svelte", "../../bits-ui/dist/bits/accordion/components/accordion-content.svelte", "../../bits-ui/dist/bits/alert-dialog/index.js", "../../bits-ui/dist/bits/alert-dialog/ctx.js", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-title.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-action.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-portal.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-overlay.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-trigger.svelte", "../../bits-ui/dist/bits/alert-dialog/components/alert-dialog-description.svelte", "../../bits-ui/dist/bits/aspect-ratio/index.js", "../../bits-ui/dist/bits/aspect-ratio/components/aspect-ratio.svelte", "../../bits-ui/dist/bits/avatar/index.js", "../../bits-ui/dist/bits/avatar/ctx.js", "../../bits-ui/dist/bits/avatar/components/avatar.svelte", "../../bits-ui/dist/bits/avatar/components/avatar-image.svelte", "../../bits-ui/dist/bits/avatar/components/avatar-fallback.svelte", "../../bits-ui/dist/bits/button/index.js", "../../bits-ui/dist/helpers/builders.js", "../../bits-ui/dist/bits/button/components/button.svelte", "../../bits-ui/dist/bits/calendar/index.js", "../../bits-ui/dist/bits/calendar/ctx.js", "../../bits-ui/dist/bits/calendar/components/calendar.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-day.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid-body.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-cell.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid-head.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-head-cell.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-grid-row.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-header.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-heading.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-next-button.svelte", "../../bits-ui/dist/bits/calendar/components/calendar-prev-button.svelte", "../../bits-ui/dist/bits/checkbox/index.js", "../../bits-ui/dist/bits/checkbox/ctx.js", "../../bits-ui/dist/bits/checkbox/components/checkbox.svelte", "../../bits-ui/dist/bits/checkbox/components/checkbox-indicator.svelte", "../../bits-ui/dist/bits/checkbox/components/checkbox-input.svelte", "../../bits-ui/dist/bits/collapsible/index.js", "../../bits-ui/dist/bits/collapsible/ctx.js", "../../bits-ui/dist/bits/collapsible/components/collapsible.svelte", "../../bits-ui/dist/bits/collapsible/components/collapsible-content.svelte", "../../bits-ui/dist/bits/collapsible/components/collapsible-trigger.svelte", "../../bits-ui/dist/bits/combobox/index.js", "../../bits-ui/dist/bits/floating/helpers.js", "../../bits-ui/dist/bits/combobox/ctx.js", "../../bits-ui/dist/bits/combobox/components/combobox.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-content.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-input.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-item.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-label.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-group.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-group-label.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-arrow.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-hidden-input.svelte", "../../bits-ui/dist/bits/separator/ctx.js", "../../bits-ui/dist/bits/separator/components/separator.svelte", "../../bits-ui/dist/bits/combobox/components/combobox-item-indicator.svelte", "../../bits-ui/dist/bits/context-menu/index.js", "../../bits-ui/dist/bits/context-menu/ctx.js", "../../bits-ui/dist/bits/context-menu/components/context-menu.svelte", "../../bits-ui/dist/bits/menu/ctx.js", "../../bits-ui/dist/bits/menu/components/menu-sub.svelte", "../../bits-ui/dist/bits/menu/components/menu-item.svelte", "../../bits-ui/dist/bits/menu/components/menu-group.svelte", "../../bits-ui/dist/bits/menu/components/menu-label.svelte", "../../bits-ui/dist/bits/menu/components/menu-arrow.svelte", "../../bits-ui/dist/bits/context-menu/components/context-menu-content.svelte", "../../bits-ui/dist/bits/context-menu/components/context-menu-trigger.svelte", "../../bits-ui/dist/bits/menu/components/menu-radio-item.svelte", "../../bits-ui/dist/bits/menu/components/menu-separator.svelte", "../../bits-ui/dist/bits/menu/components/menu-radio-group.svelte", "../../bits-ui/dist/bits/menu/components/menu-sub-content.svelte", "../../bits-ui/dist/bits/menu/components/menu-sub-trigger.svelte", "../../bits-ui/dist/bits/menu/components/menu-checkbox-item.svelte", "../../bits-ui/dist/bits/menu/components/menu-radio-indicator.svelte", "../../bits-ui/dist/bits/menu/components/menu-checkbox-indicator.svelte", "../../bits-ui/dist/bits/date-field/index.js", "../../bits-ui/dist/bits/date-field/ctx.js", "../../bits-ui/dist/bits/date-field/components/date-field.svelte", "../../bits-ui/dist/bits/date-field/components/date-field-input.svelte", "../../bits-ui/dist/bits/date-field/components/date-field-label.svelte", "../../bits-ui/dist/bits/date-field/components/date-field-segment.svelte", "../../bits-ui/dist/bits/date-picker/index.js", "../../bits-ui/dist/bits/popover/ctx.js", "../../bits-ui/dist/bits/date-picker/ctx.js", "../../bits-ui/dist/bits/date-picker/components/date-picker-arrow.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-calendar.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-close.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-content.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-field.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-input.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-label.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-segment.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-trigger.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-grid-body.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-grid-head.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-grid-row.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-head-cell.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-header.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-cell.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-day.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-grid.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-heading.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-next-button.svelte", "../../bits-ui/dist/bits/date-picker/components/date-picker-prev-button.svelte", "../../bits-ui/dist/bits/date-range-field/index.js", "../../bits-ui/dist/bits/date-range-field/ctx.js", "../../bits-ui/dist/bits/date-range-field/components/date-range-field.svelte", "../../bits-ui/dist/bits/date-range-field/components/date-range-field-input.svelte", "../../bits-ui/dist/bits/date-range-field/components/date-range-field-label.svelte", "../../bits-ui/dist/bits/date-range-field/components/date-range-field-segment.svelte", "../../bits-ui/dist/bits/date-range-picker/index.js", "../../bits-ui/dist/bits/date-range-picker/ctx.js", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-arrow.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-cell.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-day.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-heading.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-next-button.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-prev-button.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-close.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-content.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-field.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-input.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-label.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-segment.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-trigger.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-grid.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-grid-body.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-grid-head.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-grid-row.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-head-cell.svelte", "../../bits-ui/dist/bits/date-range-picker/components/date-range-picker-header.svelte", "../../bits-ui/dist/bits/dialog/index.js", "../../bits-ui/dist/bits/dialog/ctx.js", "../../bits-ui/dist/bits/dialog/components/dialog.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-title.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-close.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-portal.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-content.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-overlay.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-trigger.svelte", "../../bits-ui/dist/bits/dialog/components/dialog-description.svelte", "../../bits-ui/dist/bits/dropdown-menu/index.js", "../../bits-ui/dist/bits/menu/components/menu.svelte", "../../bits-ui/dist/bits/menu/components/menu-content.svelte", "../../bits-ui/dist/bits/menu/components/menu-trigger.svelte", "../../bits-ui/dist/bits/label/index.js", "../../bits-ui/dist/bits/label/ctx.js", "../../bits-ui/dist/bits/label/components/label.svelte", "../../bits-ui/dist/bits/link-preview/index.js", "../../bits-ui/dist/bits/link-preview/ctx.js", "../../bits-ui/dist/bits/link-preview/components/link-preview.svelte", "../../bits-ui/dist/bits/link-preview/components/link-preview-arrow.svelte", "../../bits-ui/dist/bits/link-preview/components/link-preview-content.svelte", "../../bits-ui/dist/bits/link-preview/components/link-preview-trigger.svelte", "../../bits-ui/dist/bits/menubar/index.js", "../../bits-ui/dist/bits/menubar/ctx.js", "../../bits-ui/dist/bits/menubar/components/menubar.svelte", "../../bits-ui/dist/bits/menubar/components/menubar-sub.svelte", "../../bits-ui/dist/bits/menubar/components/menubar-menu.svelte", "../../bits-ui/dist/bits/menubar/components/menubar-trigger.svelte", "../../bits-ui/dist/bits/pagination/index.js", "../../bits-ui/dist/bits/pagination/ctx.js", "../../bits-ui/dist/bits/pagination/components/pagination.svelte", "../../bits-ui/dist/bits/pagination/components/pagination-prev-button.svelte", "../../bits-ui/dist/bits/pagination/components/pagination-next-button.svelte", "../../bits-ui/dist/bits/pagination/components/pagination-page.svelte", "../../bits-ui/dist/bits/pin-input/index.js", "../../bits-ui/dist/bits/pin-input/ctx.js", "../../bits-ui/dist/bits/pin-input/components/pin-input.svelte", "../../bits-ui/dist/bits/pin-input/components/pin-input-input.svelte", "../../bits-ui/dist/bits/pin-input/components/pin-input-hidden-input.svelte", "../../bits-ui/dist/bits/popover/index.js", "../../bits-ui/dist/bits/popover/components/popover.svelte", "../../bits-ui/dist/bits/popover/components/popover-arrow.svelte", "../../bits-ui/dist/bits/popover/components/popover-content.svelte", "../../bits-ui/dist/bits/popover/components/popover-trigger.svelte", "../../bits-ui/dist/bits/popover/components/popover-close.svelte", "../../bits-ui/dist/bits/progress/index.js", "../../bits-ui/dist/bits/progress/ctx.js", "../../bits-ui/dist/bits/progress/components/progress.svelte", "../../bits-ui/dist/bits/radio-group/index.js", "../../bits-ui/dist/bits/radio-group/ctx.js", "../../bits-ui/dist/bits/radio-group/components/radio-group.svelte", "../../bits-ui/dist/bits/radio-group/components/radio-group-input.svelte", "../../bits-ui/dist/bits/radio-group/components/radio-group-item.svelte", "../../bits-ui/dist/bits/radio-group/components/radio-group-item-indicator.svelte", "../../bits-ui/dist/bits/range-calendar/index.js", "../../bits-ui/dist/bits/range-calendar/ctx.js", "../../bits-ui/dist/bits/range-calendar/components/range-calendar.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-day.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-grid.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-grid-body.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-cell.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-grid-head.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-head-cell.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-grid-row.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-header.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-heading.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-next-button.svelte", "../../bits-ui/dist/bits/range-calendar/components/range-calendar-prev-button.svelte", "../../bits-ui/dist/bits/scroll-area/index.js", "../../bits-ui/dist/bits/scroll-area/ctx.js", "../../bits-ui/dist/bits/scroll-area/components/scroll-area.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-viewport.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-content.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-y.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar-x.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-thumb-y.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-thumb-x.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-thumb.svelte", "../../bits-ui/dist/bits/scroll-area/components/scroll-area-corner.svelte", "../../bits-ui/dist/bits/select/index.js", "../../bits-ui/dist/bits/select/ctx.js", "../../bits-ui/dist/bits/select/components/select.svelte", "../../bits-ui/dist/bits/select/components/select-arrow.svelte", "../../bits-ui/dist/bits/select/components/select-content.svelte", "../../bits-ui/dist/bits/select/components/select-group.svelte", "../../bits-ui/dist/bits/select/components/select-input.svelte", "../../bits-ui/dist/bits/select/components/select-item.svelte", "../../bits-ui/dist/bits/select/components/select-item-indicator.svelte", "../../bits-ui/dist/bits/select/components/select-label.svelte", "../../bits-ui/dist/bits/select/components/select-trigger.svelte", "../../bits-ui/dist/bits/select/components/select-value.svelte", "../../bits-ui/dist/bits/separator/index.js", "../../bits-ui/dist/bits/slider/index.js", "../../bits-ui/dist/bits/slider/ctx.js", "../../bits-ui/dist/bits/slider/components/slider.svelte", "../../bits-ui/dist/bits/slider/components/slider-range.svelte", "../../bits-ui/dist/bits/slider/components/slider-thumb.svelte", "../../bits-ui/dist/bits/slider/components/slider-input.svelte", "../../bits-ui/dist/bits/slider/components/slider-tick.svelte", "../../bits-ui/dist/bits/switch/index.js", "../../bits-ui/dist/bits/switch/ctx.js", "../../bits-ui/dist/bits/switch/components/switch-input.svelte", "../../bits-ui/dist/bits/switch/components/switch.svelte", "../../bits-ui/dist/bits/switch/components/switch-thumb.svelte", "../../bits-ui/dist/bits/tabs/index.js", "../../bits-ui/dist/bits/tabs/ctx.js", "../../bits-ui/dist/bits/tabs/components/tabs.svelte", "../../bits-ui/dist/bits/tabs/components/tabs-content.svelte", "../../bits-ui/dist/bits/tabs/components/tabs-list.svelte", "../../bits-ui/dist/bits/tabs/components/tabs-trigger.svelte", "../../bits-ui/dist/bits/toggle/index.js", "../../bits-ui/dist/bits/toggle/ctx.js", "../../bits-ui/dist/bits/toggle/components/toggle.svelte", "../../bits-ui/dist/bits/toggle-group/index.js", "../../bits-ui/dist/bits/toggle-group/ctx.js", "../../bits-ui/dist/bits/toggle-group/components/toggle-group.svelte", "../../bits-ui/dist/bits/toggle-group/components/toggle-group-item.svelte", "../../bits-ui/dist/bits/toolbar/index.js", "../../bits-ui/dist/bits/toolbar/ctx.js", "../../bits-ui/dist/bits/toolbar/components/toolbar.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-button.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-link.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-group.svelte", "../../bits-ui/dist/bits/toolbar/components/toolbar-group-item.svelte", "../../bits-ui/dist/bits/tooltip/index.js", "../../bits-ui/dist/bits/tooltip/ctx.js", "../../bits-ui/dist/bits/tooltip/components/tooltip.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-content.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-trigger.svelte", "../../bits-ui/dist/bits/tooltip/components/tooltip-arrow.svelte"], "sourcesContent": ["export { default as Root } from \"./components/accordion.svelte\";\nexport { default as Item } from \"./components/accordion-item.svelte\";\nexport { default as Header } from \"./components/accordion-header.svelte\";\nexport { default as Trigger } from \"./components/accordion-trigger.svelte\";\nexport { default as Content } from \"./components/accordion-content.svelte\";\nexport * from \"./types.js\";\n", "export function arraysAreEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n return arr1.every((value, index) => value === arr2[index]);\n}\n", "import { dequal as deepEqual } from 'dequal';\n/**\n * Returns the element some number before the given index. If the target index is out of bounds:\n * - If looping is disabled, the first element will be returned.\n * - If looping is enabled, the last element will be returned.\n * @param array the array.\n * @param currentIndex the index of the current element.\n * @param increment the number of elements to move forward.\n * @param loop loop to the beginning of the array if the target index is out of bounds?\n */\nexport function back(array, index, increment, loop = true) {\n const previousIndex = index - increment;\n if (previousIndex <= 0) {\n return loop ? array[array.length - 1] : array[0];\n }\n return array[previousIndex];\n}\n/**\n * Returns the element some number after the given index. If the target index is out of bounds:\n * - If looping is disabled, the last element will be returned.\n * - If looping is enabled, the first element will be returned.\n * @param array the array.\n * @param currentIndex the index of the current element.\n * @param increment the number of elements to move forward.\n * @param loop loop to the beginning of the array if the target index is out of bounds?\n */\nexport function forward(array, index, increment, loop = true) {\n const nextIndex = index + increment;\n if (nextIndex > array.length - 1) {\n return loop ? array[0] : array[array.length - 1];\n }\n return array[nextIndex];\n}\n/**\n * Returns the array element after to the given index.\n * @param array the array.\n * @param currentIndex the index of the current element.\n * @param loop loop to the beginning of the array if the next index is out of bounds?\n */\nexport function next(array, index, loop = true) {\n if (index === array.length - 1) {\n return loop ? array[0] : array[index];\n }\n return array[index + 1];\n}\n/**\n * Returns the array element prior to the given index.\n * @param array the array.\n * @param currentIndex the index of the current element.\n * @param loop loop to the end of the array if the previous index is out of bounds?\n */\nexport function prev(array, currentIndex, loop = true) {\n if (currentIndex <= 0) {\n return loop ? array[array.length - 1] : array[0];\n }\n return array[currentIndex - 1];\n}\n/**\n * Returns the last element in an array.\n * @param array the array.\n */\nexport function last(array) {\n return array[array.length - 1];\n}\n/**\n * Wraps an array around itself at a given starting index.\n * @example ```ts\n * wrapArray(['a', 'b', 'c', 'd'], 2);\n * // ['c', 'd', 'a', 'b']\n * ```\n * @see https://github.com/radix-ui/primitives\n */\nexport function wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n/**\n * Toggles an item in an array. If the item is already in the array,\n * it is removed. Otherwise, it is added.\n * @param item The item to toggle.\n * @param array The array to toggle the item in.\n * @returns The updated array with the item toggled.\n * @template T The type of the items in the array.\n * @example ```typescript\n * const arr = [1, 2, 3];\n * const newArr = toggle(2, arr);\n * // newArr = [1, 3]\n * ```\n */\nexport function toggle(item, array, compare = deepEqual) {\n const itemIdx = array.findIndex((innerItem) => compare(innerItem, item));\n if (itemIdx !== -1) {\n array.splice(itemIdx, 1);\n }\n else {\n array.push(item);\n }\n return array;\n}\n/**\n * Splits an array into chunks of a given size.\n * @param arr The array to split.\n * @param size The size of each chunk.\n * @returns An array of arrays, where each sub-array has `size` elements from the original array.\n * @example ```ts\n * const arr = [1, 2, 3, 4, 5, 6, 7, 8];\n * const chunks = chunk(arr, 3);\n * // chunks = [[1, 2, 3], [4, 5, 6], [7, 8]]\n * ```\n */\nexport function chunk(arr, size) {\n const result = [];\n for (let i = 0; i < arr.length; i += size) {\n result.push(arr.slice(i, i + size));\n }\n return result;\n}\n/**\n * Checks if the given index is valid for the given array.\n *\n * @param index - The index to check\n * @param arr - The array to check\n */\nexport function isValidIndex(index, arr) {\n return index >= 0 && index < arr.length;\n}\n", "/**\n * A utility function that converts a style object to a string.\n *\n * @param style - The style object to convert\n * @returns The style object as a string\n */\nexport function styleToString(style) {\n return Object.keys(style).reduce((str, key) => {\n if (style[key] === undefined)\n return str;\n return str + `${key}:${style[key]};`;\n }, '');\n}\n", "import { styleToString } from './style.js';\nexport function disabledAttr(disabled) {\n return disabled ? true : undefined;\n}\nexport const hiddenInputAttrs = {\n type: 'hidden',\n 'aria-hidden': true,\n hidden: true,\n tabIndex: -1,\n style: styleToString({\n position: 'absolute',\n opacity: 0,\n 'pointer-events': 'none',\n margin: 0,\n transform: 'translateX(-100%)',\n }),\n};\n/**\n * @param portal The value of the `portal` option store.\n * @returns the value of the `data-portal` attribute.\n */\nexport function portalAttr(portal) {\n if (portal !== null) {\n return '';\n }\n return undefined;\n}\n", "export function lightable(value) {\n function subscribe(run) {\n run(value);\n return () => {\n // don't need to unsub from anything\n };\n }\n return { subscribe };\n}\n", "import { derived } from 'svelte/store';\nimport { isBrowser, isHTMLElement, noop } from './index.js';\nimport { lightable } from './store/lightable.js';\nexport function getElementByMeltId(id) {\n if (!isBrowser)\n return null;\n const el = document.querySelector(`[data-melt-id=\"${id}\"]`);\n return isHTMLElement(el) ? el : null;\n}\nexport const hiddenAction = (obj) => {\n return new Proxy(obj, {\n get(target, prop, receiver) {\n return Reflect.get(target, prop, receiver);\n },\n ownKeys(target) {\n return Reflect.ownKeys(target).filter((key) => key !== 'action');\n },\n });\n};\nconst isFunctionWithParams = (fn) => {\n return typeof fn === 'function';\n};\nexport const emptyMeltElement = makeElement('empty');\nexport function makeElement(name, args) {\n const { stores, action, returned } = args ?? {};\n const derivedStore = (() => {\n if (stores && returned) {\n // If stores are provided, create a derived store from them\n return derived(stores, (values) => {\n const result = returned(values);\n if (isFunctionWithParams(result)) {\n const fn = (...args) => {\n return hiddenAction({\n ...result(...args),\n [`data-melt-${name}`]: '',\n action: action ?? noop,\n });\n };\n fn.action = action ?? noop;\n return fn;\n }\n return hiddenAction({\n ...result,\n [`data-melt-${name}`]: '',\n action: action ?? noop,\n });\n });\n }\n else {\n // If stores are not provided, return a lightable store, for consistency\n const returnedFn = returned;\n const result = returnedFn?.();\n if (isFunctionWithParams(result)) {\n const resultFn = (...args) => {\n return hiddenAction({\n ...result(...args),\n [`data-melt-${name}`]: '',\n action: action ?? noop,\n });\n };\n resultFn.action = action ?? noop;\n return lightable(resultFn);\n }\n return lightable(hiddenAction({\n ...result,\n [`data-melt-${name}`]: '',\n action: action ?? noop,\n }));\n }\n })();\n const actionFn = (action ??\n (() => {\n /** noop */\n }));\n actionFn.subscribe = derivedStore.subscribe;\n return actionFn;\n}\nexport function makeElementArray(name, args) {\n const { stores, returned, action } = args;\n const { subscribe } = derived(stores, (values) => returned(values).map((value) => hiddenAction({\n ...value,\n [`data-melt-${name}`]: '',\n action: action ?? noop,\n })));\n const actionFn = (action ??\n (() => {\n /** noop */\n }));\n actionFn.subscribe = subscribe;\n return actionFn;\n}\nexport function createElHelpers(prefix) {\n const name = (part) => (part ? `${prefix}-${part}` : prefix);\n const attribute = (part) => `data-melt-${prefix}${part ? `-${part}` : ''}`;\n const selector = (part) => `[data-melt-${prefix}${part ? `-${part}` : ''}]`;\n const getEl = (part) => document.querySelector(selector(part));\n return {\n name,\n attribute,\n selector,\n getEl,\n };\n}\n", "export const isBrowser = typeof document !== 'undefined';\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = (v) => typeof v === 'function';\nexport const isLetter = (key) => /^[a-z]$/i.test(key);\nexport function isDocument(element) {\n return element instanceof Document;\n}\nexport function isElement(element) {\n return element instanceof Element;\n}\nexport function isHTMLElement(element) {\n return element instanceof HTMLElement;\n}\nexport function isHTMLInputElement(element) {\n return element instanceof HTMLInputElement;\n}\nexport function isHTMLLabelElement(element) {\n return element instanceof HTMLLabelElement;\n}\nexport function isHTMLButtonElement(element) {\n return element instanceof HTMLButtonElement;\n}\nexport function isElementDisabled(element) {\n const ariaDisabled = element.getAttribute('aria-disabled');\n const disabled = element.getAttribute('disabled');\n const dataDisabled = element.hasAttribute('data-disabled');\n if (ariaDisabled === 'true' || disabled !== null || dataDisabled) {\n return true;\n }\n return false;\n}\nexport function isTouch(event) {\n return event.pointerType === 'touch';\n}\nexport function isLeftClick(event) {\n return event.button === 0 && event.ctrlKey === false && event.metaKey === false;\n}\nexport function isFocusVisible(element) {\n return element.matches(':focus-visible');\n}\nexport function isContentEditable(element) {\n if (!isHTMLElement(element))\n return false;\n return element.isContentEditable;\n}\nexport function isNull(value) {\n return value === null;\n}\nexport function isNumberString(value) {\n if (isNaN(parseInt(value)))\n return false;\n return true;\n}\nexport function isObject(value) {\n return value !== null && typeof value === 'object';\n}\nexport function isReadable(value) {\n return isObject(value) && 'subscribe' in value;\n}\nexport function isWritable(value) {\n return isReadable(value) && 'set' in value;\n}\n", "import { isHTMLElement } from './is.js';\nexport function focus(element) {\n if (isHTMLElement(element)) {\n element.focus();\n }\n else if (typeof element === 'string') {\n const el = document.querySelector(element);\n if (!el)\n return;\n el.focus();\n }\n}\n/**\n * Returns a list of nodes that can be in the tab sequence.\n * @see: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n */\nexport function getTabbableNodes(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) {\n nodes.push(walker.currentNode);\n }\n return nodes;\n}\nexport function isHidden(el) {\n return el.offsetParent === null;\n}\n", "/**\n * Executes an array of callback functions with the same arguments.\n * @template T The types of the arguments that the callback functions take.\n * @param n array of callback functions to execute.\n * @returns A new function that executes all of the original callback functions with the same arguments.\n */\nexport function executeCallbacks(...callbacks) {\n return (...args) => {\n for (const callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\n/**\n * A no operation function (does nothing)\n */\nexport function noop() {\n //\n}\n", "import { noop } from './callbacks.js';\nimport { isHTMLElement } from './is.js';\n/**\n * Adds an event listener to the specified target element(s) for the given event(s), and returns a function to remove it.\n * @param target The target element(s) to add the event listener to.\n * @param event The event(s) to listen for.\n * @param handler The function to be called when the event is triggered.\n * @param options An optional object that specifies characteristics about the event listener.\n * @returns A function that removes the event listener from the target element(s).\n */\nexport function addEventListener(target, event, handler, options) {\n const events = Array.isArray(event) ? event : [event];\n // Add the event listener to each specified event for the target element(s).\n events.forEach((_event) => target.addEventListener(_event, handler, options));\n // Return a function that removes the event listener from the target element(s).\n return () => {\n events.forEach((_event) => target.removeEventListener(_event, handler, options));\n };\n}\nexport function addMeltEventListener(target, event, handler, options) {\n const events = Array.isArray(event) ? event : [event];\n if (typeof handler === 'function') {\n const handlerWithMelt = withMelt((_event) => handler(_event));\n // Add the event listener to each specified event for the target element(s).\n events.forEach((_event) => target.addEventListener(_event, handlerWithMelt, options));\n // Return a function that removes the event listener from the target element(s).\n return () => {\n events.forEach((_event) => target.removeEventListener(_event, handlerWithMelt, options));\n };\n }\n return () => noop();\n}\nexport function dispatchMeltEvent(originalEvent) {\n const node = originalEvent.currentTarget;\n if (!isHTMLElement(node))\n return null;\n const customMeltEvent = new CustomEvent(`m-${originalEvent.type}`, {\n detail: {\n originalEvent,\n },\n cancelable: true,\n });\n node.dispatchEvent(customMeltEvent);\n return customMeltEvent;\n}\nexport function withMelt(handler) {\n return (event) => {\n const customEvent = dispatchMeltEvent(event);\n if (customEvent?.defaultPrevented)\n return;\n return handler(event);\n };\n}\n", "export function addHighlight(element) {\n element.setAttribute('data-highlighted', '');\n}\nexport function removeHighlight(element) {\n element.removeAttribute('data-highlighted');\n}\n", "import { onDestroy, onMount } from 'svelte';\nexport const safeOnMount = (fn) => {\n try {\n onMount(fn);\n }\n catch {\n return fn;\n }\n};\nexport const safeOnDestroy = (fn) => {\n try {\n onDestroy(fn);\n }\n catch {\n return fn;\n }\n};\n", "import { isHTMLElement } from './is.js';\n/** Retrieves all option descendants of a given element. */\nexport function getOptions(el) {\n return Array.from(el.querySelectorAll('[role=\"option\"]:not([data-disabled])')).filter((el) => isHTMLElement(el));\n}\n/** Retrieves the first option descendant of a given element. */\nexport function getFirstOption(el) {\n const firstOption = el.querySelector('[role=\"option\"]:not([data-disabled])');\n return isHTMLElement(firstOption) ? firstOption : null;\n}\n", "/**\n * Detects the text direction in the element.\n * @returns {TextDirection} The text direction ('ltr' for left-to-right or 'rtl' for right-to-left).\n */\nexport function getElemDirection(elem) {\n const style = window.getComputedStyle(elem);\n const direction = style.getPropertyValue('direction');\n return direction;\n}\n", "import { dequal } from 'dequal';\nexport function omit(obj, ...keys) {\n const result = {};\n for (const key of Object.keys(obj)) {\n if (!keys.includes(key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}\nexport function stripValues(inputObject, toStrip, recursive) {\n return Object.fromEntries(Object.entries(inputObject).filter(([_, value]) => !dequal(value, toStrip)));\n}\nexport function removeUndefined(obj) {\n const result = {};\n for (const key in obj) {\n const value = obj[key];\n if (value !== undefined) {\n result[key] = value;\n }\n }\n return result;\n}\n", "import { get, writable } from 'svelte/store';\n/**\n * Transforms an existing store into a store with a `get` method.\n * Uses subscriptions to keep the value up to date, so make sure to call `destroy` when you're done with it.\n * @date 20/01/2024 - 16:38:39\n *\n * @export\n * @template {Readable} T\n * @param {T} store\n * @returns {WithGet}\n */\nexport function withGet(store) {\n return {\n ...store,\n get: () => get(store),\n };\n}\nwithGet.writable = function (initial) {\n const internal = writable(initial);\n let value = initial;\n return {\n subscribe: internal.subscribe,\n set(newValue) {\n internal.set(newValue);\n value = newValue;\n },\n update(updater) {\n const newValue = updater(value);\n internal.set(newValue);\n value = newValue;\n },\n get() {\n return value;\n },\n };\n};\nwithGet.derived = function (stores, fn) {\n const subscribers = new Map();\n const get = () => {\n const values = Array.isArray(stores) ? stores.map((store) => store.get()) : stores.get();\n return fn(values);\n };\n const subscribe = (subscriber) => {\n const unsubscribers = [];\n const storesArr = Array.isArray(stores) ? stores : [stores];\n storesArr.forEach((store) => {\n unsubscribers.push(store.subscribe(() => {\n subscriber(get());\n }));\n });\n subscriber(get());\n subscribers.set(subscriber, unsubscribers);\n return () => {\n const unsubscribers = subscribers.get(subscriber);\n if (unsubscribers) {\n for (const unsubscribe of unsubscribers) {\n unsubscribe();\n }\n }\n subscribers.delete(subscriber);\n };\n };\n return {\n get,\n subscribe,\n };\n};\nexport function addGetToStores(stores) {\n return Object.keys(stores).reduce((acc, key) => {\n return {\n ...acc,\n [key]: withGet(stores[key]),\n };\n }, {});\n}\n", "import { withGet } from './withGet.js';\nexport const overridable = (_store, onChange) => {\n const store = withGet(_store);\n const update = (updater, sideEffect) => {\n store.update((curr) => {\n const next = updater(curr);\n let res = next;\n if (onChange) {\n res = onChange({ curr, next });\n }\n sideEffect?.(res);\n return res;\n });\n };\n const set = (curr) => {\n update(() => curr);\n };\n return {\n ...store,\n update,\n set,\n };\n};\n", "export function sleep(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n", "import { nanoid } from 'nanoid/non-secure';\n/**\n * A function that generates a random id\n * @returns An id\n */\nexport function generateId() {\n return nanoid(10);\n}\nexport function generateIds(args) {\n return args.reduce((acc, curr) => {\n acc[curr] = generateId();\n return acc;\n }, {});\n}\nexport function stringifiedIdObjType(args) {\n return `Record<${args.map((arg) => `\"${arg}\"`).join(' | ')}, string>`;\n}\n", "/**\n * A constant object that maps commonly used keyboard keys to their corresponding string values.\n * This object can be used in other parts of the application to handle keyboard input and prevent\n * hard-coded strings throughout.\n */\nexport const kbd = {\n ALT: 'Alt',\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_UP: 'ArrowUp',\n BACKSPACE: 'Backspace',\n CAPS_LOCK: 'CapsLock',\n CONTROL: 'Control',\n DELETE: 'Delete',\n END: 'End',\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n F1: 'F1',\n F10: 'F10',\n F11: 'F11',\n F12: 'F12',\n F2: 'F2',\n F3: 'F3',\n F4: 'F4',\n F5: 'F5',\n F6: 'F6',\n F7: 'F7',\n F8: 'F8',\n F9: 'F9',\n HOME: 'Home',\n META: 'Meta',\n PAGE_DOWN: 'PageDown',\n PAGE_UP: 'PageUp',\n SHIFT: 'Shift',\n SPACE: ' ',\n TAB: 'Tab',\n CTRL: 'Control',\n ASTERISK: '*',\n A: 'a',\n P: 'p',\n};\n/** Key sets for navigation within lists, such as select, menu, and combobox. */\nexport const FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME];\nexport const LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END];\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nexport const SELECTION_KEYS = [kbd.ENTER, kbd.SPACE];\nexport const getNextKey = (dir = 'ltr', orientation = 'horizontal') => {\n return {\n horizontal: dir === 'rtl' ? kbd.ARROW_LEFT : kbd.ARROW_RIGHT,\n vertical: kbd.ARROW_DOWN,\n }[orientation];\n};\nexport const getPrevKey = (dir = 'ltr', orientation = 'horizontal') => {\n return {\n horizontal: dir === 'rtl' ? kbd.ARROW_RIGHT : kbd.ARROW_LEFT,\n vertical: kbd.ARROW_UP,\n }[orientation];\n};\nexport const getDirectionalKeys = (dir = 'ltr', orientation = 'horizontal') => {\n return {\n nextKey: getNextKey(dir, orientation),\n prevKey: getPrevKey(dir, orientation),\n };\n};\n", "export function debounce(fn, wait = 500) {\n let timeout = null;\n return function (...args) {\n const later = () => {\n timeout = null;\n fn(...args);\n };\n timeout && clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n", "export const isDom = () => typeof window !== 'undefined';\nexport function getPlatform() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const agent = navigator.userAgentData;\n return (agent?.platform ?? navigator.platform);\n}\nconst pt = (v) => isDom() && v.test(getPlatform().toLowerCase());\nconst ua = (v) => isDom() && v.test(navigator.userAgent);\nconst vn = (v) => isDom() && v.test(navigator.vendor);\nexport const isTouchDevice = () => isDom() && !!navigator.maxTouchPoints;\nexport const isMac = () => pt(/^mac/) && !isTouchDevice();\nexport const isIPhone = () => pt(/^iphone/);\nexport const isSafari = () => isApple() && vn(/apple/i);\nexport const isFirefox = () => ua(/firefox\\//i);\nexport const isApple = () => pt(/mac|iphone|ipad|ipod/i);\nexport const isIos = () => isApple() && !isMac();\n", "/*\n * Convex hull algorithm - Library (TypeScript)\n *\n * Copyright (c) 2021 Project Nayuki\n * https://www.nayuki.io/page/convex-hull-algorithm\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program (see COPYING.txt and COPYING.LESSER.txt).\n * If not, see .\n */\n// Returns a new array of points representing the convex hull of\n// the given set of points. The convex hull excludes collinear points.\n// This algorithm runs in O(n log n) time.\nexport function makeHull(points) {\n const newPoints = points.slice();\n newPoints.sort(POINT_COMPARATOR);\n return makeHullPresorted(newPoints);\n}\n// Returns the convex hull, assuming that each points[i] <= points[i + 1]. Runs in O(n) time.\nexport function makeHullPresorted(points) {\n if (points.length <= 1)\n return points.slice();\n // Andrew's monotone chain algorithm. Positive y coordinates correspond to \"up\"\n // as per the mathematical convention, instead of \"down\" as per the computer\n // graphics convention. This doesn't affect the correctness of the result.\n const upperHull = [];\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n while (upperHull.length >= 2) {\n const q = upperHull[upperHull.length - 1];\n const r = upperHull[upperHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x))\n upperHull.pop();\n else\n break;\n }\n upperHull.push(p);\n }\n upperHull.pop();\n const lowerHull = [];\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n while (lowerHull.length >= 2) {\n const q = lowerHull[lowerHull.length - 1];\n const r = lowerHull[lowerHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x))\n lowerHull.pop();\n else\n break;\n }\n lowerHull.push(p);\n }\n lowerHull.pop();\n if (upperHull.length == 1 &&\n lowerHull.length == 1 &&\n upperHull[0].x == lowerHull[0].x &&\n upperHull[0].y == lowerHull[0].y)\n return upperHull;\n else\n return upperHull.concat(lowerHull);\n}\nexport function POINT_COMPARATOR(a, b) {\n if (a.x < b.x)\n return -1;\n else if (a.x > b.x)\n return +1;\n else if (a.y < b.y)\n return -1;\n else if (a.y > b.y)\n return +1;\n else\n return 0;\n}\n", "export * from './hull.js';\nimport { makeHull } from './hull.js';\nexport function getPointsFromEl(el) {\n const rect = el.getBoundingClientRect();\n return [\n { x: rect.left, y: rect.top },\n { x: rect.right, y: rect.top },\n { x: rect.right, y: rect.bottom },\n { x: rect.left, y: rect.bottom },\n ];\n}\nexport function makeHullFromElements(els) {\n const points = els.flatMap((el) => getPointsFromEl(el));\n return makeHull(points);\n}\nexport function pointInPolygon(point, polygon) {\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > point.y !== yj > point.y && point.x < ((xj - xi) * (point.y - yi)) / (yj - yi) + xi;\n if (intersect)\n inside = !inside;\n }\n return inside;\n}\n", "// Modified from @zag-js/remove-scroll v0.10.2 (2023-06-10)\n// Source: https://github.com/chakra-ui/zag\n// https://github.com/chakra-ui/zag/blob/main/packages/utilities/remove-scroll/src/index.ts\nimport { noop } from './callbacks.js';\nimport { isIos } from './platform.js';\nconst LOCK_CLASSNAME = 'data-melt-scroll-lock';\nfunction assignStyle(el, style) {\n if (!el)\n return;\n const previousStyle = el.style.cssText;\n Object.assign(el.style, style);\n return () => {\n el.style.cssText = previousStyle;\n };\n}\nfunction setCSSProperty(el, property, value) {\n if (!el)\n return;\n const previousValue = el.style.getPropertyValue(property);\n el.style.setProperty(property, value);\n return () => {\n if (previousValue) {\n el.style.setProperty(property, previousValue);\n }\n else {\n el.style.removeProperty(property);\n }\n };\n}\nfunction getPaddingProperty(documentElement) {\n // RTL scrollbar\n const documentLeft = documentElement.getBoundingClientRect().left;\n const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft;\n return scrollbarX ? 'paddingLeft' : 'paddingRight';\n}\nexport function removeScroll(_document) {\n const doc = _document ?? document;\n const win = doc.defaultView ?? window;\n const { documentElement, body } = doc;\n const locked = body.hasAttribute(LOCK_CLASSNAME);\n if (locked)\n return noop;\n body.setAttribute(LOCK_CLASSNAME, '');\n const scrollbarWidth = win.innerWidth - documentElement.clientWidth;\n const setScrollbarWidthProperty = () => setCSSProperty(documentElement, '--scrollbar-width', `${scrollbarWidth}px`);\n const paddingProperty = getPaddingProperty(documentElement);\n const scrollbarSidePadding = win.getComputedStyle(body)[paddingProperty];\n const setStyle = () => assignStyle(body, {\n overflow: 'hidden',\n [paddingProperty]: `calc(${scrollbarSidePadding} + ${scrollbarWidth}px)`,\n });\n // Only iOS doesn't respect `overflow: hidden` on document.body\n const setIOSStyle = () => {\n const { scrollX, scrollY, visualViewport } = win;\n // iOS 12 does not support `visuaViewport`.\n const offsetLeft = visualViewport?.offsetLeft ?? 0;\n const offsetTop = visualViewport?.offsetTop ?? 0;\n const restoreStyle = assignStyle(body, {\n position: 'fixed',\n overflow: 'hidden',\n top: `${-(scrollY - Math.floor(offsetTop))}px`,\n left: `${-(scrollX - Math.floor(offsetLeft))}px`,\n right: '0',\n [paddingProperty]: `calc(${scrollbarSidePadding} + ${scrollbarWidth}px)`,\n });\n return () => {\n restoreStyle?.();\n win.scrollTo(scrollX, scrollY);\n };\n };\n const cleanups = [setScrollbarWidthProperty(), isIos() ? setIOSStyle() : setStyle()];\n return () => {\n cleanups.forEach((fn) => fn?.());\n body.removeAttribute(LOCK_CLASSNAME);\n };\n}\n", "import { derived } from 'svelte/store';\n/**\n * Helper function to standardize the way we derive a visible state for the\n * popper/floating elements.\n */\nexport function derivedVisible(obj) {\n const { open, forceVisible, activeTrigger } = obj;\n return derived([open, forceVisible, activeTrigger], ([$open, $forceVisible, $activeTrigger]) => ($open || $forceVisible) && $activeTrigger !== null);\n}\n", "import { derived } from 'svelte/store';\nimport { noop } from '../index.js';\nimport { safeOnDestroy } from '../lifecycle.js';\n/**\n * A utility function that creates an effect from a set of stores and a function.\n * The effect is automatically cleaned up when the component is destroyed.\n *\n * @template S - The type of the stores object\n * @param stores - The stores object to derive from\n * @param fn - The function to run when the stores change\n * @returns A function that can be used to unsubscribe the effect\n */\nexport function effect(stores, fn) {\n let cb = undefined;\n // Create a derived store that contains the stores object and an onUnsubscribe function\n const destroy = derived(stores, (stores) => {\n cb?.();\n cb = fn(stores);\n }).subscribe(noop);\n const unsub = () => {\n destroy();\n cb?.();\n };\n // Automatically unsubscribe the effect when the component is destroyed\n safeOnDestroy(unsub);\n return unsub;\n}\n", "import { writable } from 'svelte/store';\nimport { withGet } from '../withGet.js';\n/**\n * Given an object of properties, returns an object of writable stores\n * with the same properties and values.\n */\nexport function toWritableStores(properties) {\n const result = {};\n Object.keys(properties).forEach((key) => {\n const propertyKey = key;\n const value = properties[propertyKey];\n result[propertyKey] = withGet(writable(value));\n });\n return result;\n}\n", "import { isBrowser, isHTMLElement } from './is.js';\nimport { sleep } from './sleep.js';\n/**\n * Manage roving focus between elements. Sets the current active element to\n * tabindex -1 and the next element to tabindex 0.\n *\n * @param nextElement The element to focus on\n */\nexport function handleRovingFocus(nextElement) {\n if (!isBrowser)\n return;\n sleep(1).then(() => {\n const currentFocusedElement = document.activeElement;\n if (!isHTMLElement(currentFocusedElement) || currentFocusedElement === nextElement)\n return;\n currentFocusedElement.tabIndex = -1;\n if (nextElement) {\n nextElement.tabIndex = 0;\n nextElement.focus();\n }\n });\n}\nfunction getFocusableElements() {\n return Array.from(document.querySelectorAll('a[href]:not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), input:not([disabled]):not([tabindex=\"-1\"]), select:not([disabled]):not([tabindex=\"-1\"]), textarea:not([disabled]):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'));\n}\nexport function getNextFocusable(currentElement) {\n const focusableElements = getFocusableElements();\n const currentIndex = focusableElements.indexOf(currentElement);\n const nextIndex = currentIndex + 1;\n const nextElement = focusableElements[nextIndex];\n if (nextIndex < focusableElements.length && isHTMLElement(nextElement)) {\n return nextElement;\n }\n return null;\n}\nexport function getPreviousFocusable(currentElement) {\n const focusableElements = getFocusableElements();\n const currentIndex = focusableElements.indexOf(currentElement);\n const previousIndex = currentIndex - 1;\n const prevElement = focusableElements[previousIndex];\n if (previousIndex >= 0 && isHTMLElement(prevElement)) {\n return prevElement;\n }\n return null;\n}\n", "import { get, writable } from 'svelte/store';\nimport { wrapArray } from './array.js';\nimport { debounce } from './debounce.js';\nimport { isHTMLElement } from './is.js';\nimport { handleRovingFocus } from './rovingFocus.js';\nimport { withGet } from './withGet.js';\n/**\n * Keys to ignore for typeahead so we aren't matching things\n * like `Shift menu item` or `Control center` or `Alt menu` when\n * a user presses those keys.\n */\nconst ignoredKeys = new Set(['Shift', 'Control', 'Alt', 'Meta', 'CapsLock', 'NumLock']);\n/**\n * Default options for the typeahead search.\n * We default to roving focus when a match is found, but\n * you can override this with the `onMatch` option.\n */\nconst defaults = {\n onMatch: handleRovingFocus,\n getCurrentItem: () => document.activeElement,\n};\nexport function createTypeaheadSearch(args = {}) {\n const withDefaults = { ...defaults, ...args };\n const typed = withGet(writable([]));\n const resetTyped = debounce(() => {\n typed.update(() => []);\n });\n const handleTypeaheadSearch = (key, items) => {\n if (ignoredKeys.has(key))\n return;\n const currentItem = withDefaults.getCurrentItem();\n const $typed = get(typed);\n if (!Array.isArray($typed)) {\n return;\n }\n $typed.push(key.toLowerCase());\n typed.set($typed);\n const candidateItems = items.filter((item) => {\n if (item.getAttribute('disabled') === 'true' ||\n item.getAttribute('aria-disabled') === 'true' ||\n item.hasAttribute('data-disabled')) {\n return false;\n }\n return true;\n });\n const isRepeated = $typed.length > 1 && $typed.every((char) => char === $typed[0]);\n const normalizeSearch = isRepeated ? $typed[0] : $typed.join('');\n const currentItemIndex = isHTMLElement(currentItem) ? candidateItems.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(candidateItems, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizeSearch.length === 1;\n if (excludeCurrentItem) {\n wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n }\n const nextItem = wrappedItems.find((item) => item?.innerText && item.innerText.toLowerCase().startsWith(normalizeSearch.toLowerCase()));\n if (isHTMLElement(nextItem) && nextItem !== currentItem) {\n withDefaults.onMatch(nextItem);\n }\n resetTyped();\n };\n return {\n typed,\n resetTyped,\n handleTypeaheadSearch,\n };\n}\n", "import { isHTMLElement } from './is.js';\n/**\n * Get an element's ancestor which has a `data-portal` attribute.\n * This is used to handle nested portals/overlays/dialogs/popovers.\n */\nfunction getPortalParent(node) {\n let parent = node.parentElement;\n while (isHTMLElement(parent) && !parent.hasAttribute('data-portal')) {\n parent = parent.parentElement;\n }\n return parent || 'body';\n}\n/**\n * Gets the destination for a portal given the node and a user-specified portal prop.\n * If a portal prop is not `undefined`, it is used as the destination.\n */\nexport function getPortalDestination(node, portalProp) {\n // user-specified portal prop, use it\n if (portalProp !== undefined)\n return portalProp;\n // find the closest portal parent, or the body if none is found\n const portalParent = getPortalParent(node);\n // if the portalParent is the body, we portal to the body\n // making it a \"top-level\" portal\n if (portalParent === 'body')\n return document.body;\n // if the portalParent is not the body, we have a portal parent\n // and shouldn't portal to anything so it remains within that parent\n // so we return `null`\n return null;\n}\n", "import { getElementByMeltId, isElement, isHTMLLabelElement } from './index.js';\nexport function createClickOutsideIgnore(meltId) {\n return (e) => {\n const target = e.target;\n const triggerEl = getElementByMeltId(meltId);\n if (!triggerEl || !isElement(target))\n return false;\n const id = triggerEl.id;\n if (isHTMLLabelElement(target) && id === target.htmlFor) {\n return true;\n }\n if (target.closest(`label[for=\"${id}\"]`)) {\n return true;\n }\n return false;\n };\n}\n", "import { isFunction, isHTMLElement, sleep } from './index.js';\nimport { tick } from 'svelte';\nexport async function handleFocus(args) {\n const { prop, defaultEl } = args;\n await Promise.all([sleep(1), tick]);\n if (prop === undefined) {\n defaultEl?.focus();\n return;\n }\n const returned = isFunction(prop) ? prop(defaultEl) : prop;\n if (typeof returned === 'string') {\n // Get el by selector, focus it\n const el = document.querySelector(returned);\n if (!isHTMLElement(el))\n return;\n el.focus();\n }\n else if (isHTMLElement(returned)) {\n // Focus it\n returned.focus();\n }\n}\n", "export function getDecimalCount(value) {\n return (String(value).split('.')[1] || '').length;\n}\nexport function roundValue(value, decimalCount) {\n const rounder = Math.pow(10, decimalCount);\n return Math.round(value * rounder) / rounder;\n}\nexport function snapValueToStep(value, min, max, step) {\n const remainder = (value - (isNaN(min) ? 0 : min)) % step;\n let snappedValue = Math.abs(remainder) * 2 >= step\n ? value + Math.sign(remainder) * (step - Math.abs(remainder))\n : value - remainder;\n if (!isNaN(min)) {\n if (snappedValue < min) {\n snappedValue = min;\n }\n else if (!isNaN(max) && snappedValue > max) {\n snappedValue = min + Math.floor((max - min) / step) * step;\n }\n }\n else if (!isNaN(max) && snappedValue > max) {\n snappedValue = Math.floor(max / step) * step;\n }\n const string = step.toString();\n const index = string.indexOf('.');\n const precision = index >= 0 ? string.length - index : 0;\n if (precision > 0) {\n const pow = Math.pow(10, precision);\n snappedValue = Math.round(snappedValue * pow) / pow;\n }\n return snappedValue;\n}\nexport function clamp(min, value, max) {\n return Math.max(min, Math.min(value, max));\n}\n", "import { addMeltEventListener, makeElement, createElHelpers, disabledAttr, executeCallbacks, generateId, generateIds, getElementByMeltId, isHTMLElement, kbd, omit, overridable, styleToString, toWritableStores, } from '../../internal/helpers/index.js';\nimport { tick } from 'svelte';\nimport { derived, writable } from 'svelte/store';\nconst { name, selector } = createElHelpers('accordion');\nconst defaults = {\n multiple: false,\n disabled: false,\n forceVisible: false,\n};\nexport const createAccordion = (props) => {\n const withDefaults = { ...defaults, ...props };\n const options = toWritableStores(omit(withDefaults, 'value', 'onValueChange', 'defaultValue'));\n const meltIds = generateIds(['root']);\n const { disabled, forceVisible } = options;\n const valueWritable = withDefaults.value ?? writable(withDefaults.defaultValue);\n const value = overridable(valueWritable, withDefaults?.onValueChange);\n const isSelected = (key, v) => {\n if (v === undefined)\n return false;\n if (typeof v === 'string')\n return v === key;\n return v.includes(key);\n };\n const isSelectedStore = derived(value, ($value) => {\n return (key) => isSelected(key, $value);\n });\n const root = makeElement(name(), {\n returned: () => ({\n 'data-melt-id': meltIds.root,\n }),\n });\n const parseItemProps = (props) => {\n if (typeof props === 'string') {\n return { value: props };\n }\n else {\n return props;\n }\n };\n const parseHeadingProps = (props) => {\n if (typeof props === 'number') {\n return { level: props };\n }\n else {\n return props;\n }\n };\n const item = makeElement(name('item'), {\n stores: value,\n returned: ($value) => {\n return (props) => {\n const { value: itemValue, disabled } = parseItemProps(props);\n return {\n 'data-state': isSelected(itemValue, $value) ? 'open' : 'closed',\n 'data-disabled': disabledAttr(disabled),\n };\n };\n },\n });\n const trigger = makeElement(name('trigger'), {\n stores: [value, disabled],\n returned: ([$value, $disabled]) => {\n return (props) => {\n const { value: itemValue, disabled } = parseItemProps(props);\n // generate the content ID here so that we can grab it in the content\n // builder action to ensure the values match.\n return {\n disabled: disabledAttr($disabled || disabled),\n 'aria-expanded': isSelected(itemValue, $value) ? true : false,\n 'aria-disabled': disabled ? true : false,\n 'data-disabled': disabledAttr(disabled),\n 'data-value': itemValue,\n 'data-state': isSelected(itemValue, $value) ? 'open' : 'closed',\n };\n };\n },\n action: (node) => {\n const unsub = executeCallbacks(addMeltEventListener(node, 'click', () => {\n const disabled = node.dataset.disabled === 'true';\n const itemValue = node.dataset.value;\n if (disabled || !itemValue)\n return;\n handleValueUpdate(itemValue);\n }), addMeltEventListener(node, 'keydown', (e) => {\n if (![kbd.ARROW_DOWN, kbd.ARROW_UP, kbd.HOME, kbd.END].includes(e.key)) {\n return;\n }\n e.preventDefault();\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n const disabled = node.dataset.disabled === 'true';\n const itemValue = node.dataset.value;\n if (disabled || !itemValue)\n return;\n handleValueUpdate(itemValue);\n return;\n }\n const el = e.target;\n const rootEl = getElementByMeltId(meltIds.root);\n if (!rootEl || !isHTMLElement(el))\n return;\n const items = Array.from(rootEl.querySelectorAll(selector('trigger')));\n const candidateItems = items.filter((item) => {\n if (!isHTMLElement(item))\n return false;\n return item.dataset.disabled !== 'true';\n });\n if (!candidateItems.length)\n return;\n const elIdx = candidateItems.indexOf(el);\n if (e.key === kbd.ARROW_DOWN) {\n candidateItems[(elIdx + 1) % candidateItems.length].focus();\n }\n if (e.key === kbd.ARROW_UP) {\n candidateItems[(elIdx - 1 + candidateItems.length) % candidateItems.length].focus();\n }\n if (e.key === kbd.HOME) {\n candidateItems[0].focus();\n }\n if (e.key === kbd.END) {\n candidateItems[candidateItems.length - 1].focus();\n }\n }));\n return {\n destroy: unsub,\n };\n },\n });\n const content = makeElement(name('content'), {\n stores: [value, disabled, forceVisible],\n returned: ([$value, $disabled, $forceVisible]) => {\n return (props) => {\n const { value: itemValue } = parseItemProps(props);\n const isVisible = isSelected(itemValue, $value) || $forceVisible;\n return {\n 'data-state': isVisible ? 'open' : 'closed',\n 'data-disabled': disabledAttr($disabled),\n 'data-value': itemValue,\n hidden: isVisible ? undefined : true,\n style: styleToString({\n display: isVisible ? undefined : 'none',\n }),\n };\n };\n },\n action: (node) => {\n tick().then(() => {\n const contentId = generateId();\n const triggerId = generateId();\n const parentTrigger = document.querySelector(`${selector('trigger')}, [data-value=\"${node.dataset.value}\"]`);\n if (!isHTMLElement(parentTrigger))\n return;\n node.id = contentId;\n parentTrigger.setAttribute('aria-controls', contentId);\n parentTrigger.id = triggerId;\n });\n },\n });\n const heading = makeElement(name('heading'), {\n returned: () => {\n return (props) => {\n const { level } = parseHeadingProps(props);\n return {\n role: 'heading',\n 'aria-level': level,\n 'data-heading-level': level,\n };\n };\n },\n });\n function handleValueUpdate(itemValue) {\n value.update(($value) => {\n if ($value === undefined) {\n return withDefaults.multiple ? [itemValue] : itemValue;\n }\n if (Array.isArray($value)) {\n if ($value.includes(itemValue)) {\n return $value.filter((v) => v !== itemValue);\n }\n $value.push(itemValue);\n return $value;\n }\n return $value === itemValue ? undefined : itemValue;\n });\n }\n return {\n ids: meltIds,\n elements: {\n root,\n item,\n trigger,\n content,\n heading,\n },\n states: {\n value: value,\n },\n helpers: {\n isSelected: isSelectedStore,\n },\n options,\n };\n};\n", "import { makeElement, effect, isBrowser, omit, overridable, styleToString, toWritableStores, } from '../../internal/helpers/index.js';\nimport { writable } from 'svelte/store';\nconst defaults = {\n src: '',\n delayMs: 0,\n onLoadingStatusChange: undefined,\n};\nexport const createAvatar = (props) => {\n const withDefaults = { ...defaults, ...props };\n const options = toWritableStores(omit(withDefaults, 'loadingStatus', 'onLoadingStatusChange'));\n const { src, delayMs } = options;\n const loadingStatusWritable = withDefaults.loadingStatus ?? writable('loading');\n const loadingStatus = overridable(loadingStatusWritable, withDefaults?.onLoadingStatusChange);\n effect([src, delayMs], ([$src, $delayMs]) => {\n if (isBrowser) {\n const image = new Image();\n image.src = $src;\n image.onload = () => {\n if (delayMs !== undefined) {\n const timerId = window.setTimeout(() => {\n loadingStatus.set('loaded');\n }, $delayMs);\n return () => window.clearTimeout(timerId);\n }\n else {\n loadingStatus.set('loaded');\n }\n };\n image.onerror = () => {\n loadingStatus.set('error');\n };\n }\n });\n const image = makeElement('avatar-image', {\n stores: [src, loadingStatus],\n returned: ([$src, $loadingStatus]) => {\n const imageStyles = styleToString({\n display: $loadingStatus === 'loaded' ? 'block' : 'none',\n });\n return {\n src: $src,\n style: imageStyles,\n };\n },\n });\n const fallback = makeElement('avatar-fallback', {\n stores: [loadingStatus],\n returned: ([$loadingStatus]) => {\n return {\n style: $loadingStatus === 'loaded'\n ? styleToString({\n display: 'none',\n })\n : undefined,\n hidden: $loadingStatus === 'loaded' ? true : undefined,\n };\n },\n });\n return {\n elements: {\n image,\n fallback,\n },\n states: {\n loadingStatus,\n },\n options,\n };\n};\n", "import { addMeltEventListener, makeElement, disabledAttr, executeCallbacks, kbd, omit, overridable, styleToString, toWritableStores, } from '../../internal/helpers/index.js';\nimport { derived, writable } from 'svelte/store';\nconst defaults = {\n disabled: false,\n required: false,\n name: undefined,\n value: 'on',\n defaultChecked: false,\n};\nexport function createCheckbox(props) {\n const withDefaults = { ...defaults, ...props };\n const options = toWritableStores(omit(withDefaults, 'checked', 'defaultChecked'));\n const { disabled, name, required, value } = options;\n // States\n const checkedWritable = withDefaults.checked ?? writable(withDefaults.defaultChecked);\n const checked = overridable(checkedWritable, withDefaults?.onCheckedChange);\n const root = makeElement('checkbox', {\n stores: [checked, disabled, required],\n returned: ([$checked, $disabled, $required]) => {\n return {\n 'data-disabled': disabledAttr($disabled),\n disabled: disabledAttr($disabled),\n 'data-state': $checked === 'indeterminate' ? 'indeterminate' : $checked ? 'checked' : 'unchecked',\n type: 'button',\n role: 'checkbox',\n 'aria-checked': $checked === 'indeterminate' ? 'mixed' : $checked,\n 'aria-required': $required,\n };\n },\n action: (node) => {\n const unsub = executeCallbacks(addMeltEventListener(node, 'keydown', (e) => {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n if (e.key === kbd.ENTER)\n e.preventDefault();\n }), addMeltEventListener(node, 'click', () => {\n if (disabled.get())\n return;\n checked.update((value) => {\n if (value === 'indeterminate')\n return true;\n return !value;\n });\n }));\n return {\n destroy: unsub,\n };\n },\n });\n const input = makeElement('checkbox-input', {\n stores: [checked, name, value, required, disabled],\n returned: ([$checked, $name, $value, $required, $disabled]) => {\n return {\n type: 'checkbox',\n 'aria-hidden': true,\n hidden: true,\n tabindex: -1,\n name: $name,\n value: $value,\n checked: $checked === 'indeterminate' ? false : $checked,\n required: $required,\n disabled: disabledAttr($disabled),\n style: styleToString({\n position: 'absolute',\n opacity: 0,\n 'pointer-events': 'none',\n margin: 0,\n transform: 'translateX(-100%)',\n }),\n };\n },\n });\n const isIndeterminate = derived(checked, ($checked) => $checked === 'indeterminate');\n const isChecked = derived(checked, ($checked) => $checked === true);\n return {\n elements: {\n root,\n input,\n },\n states: {\n checked,\n },\n helpers: {\n isIndeterminate,\n isChecked,\n },\n options,\n };\n}\n", "import { addMeltEventListener, makeElement, createElHelpers, disabledAttr, omit, overridable, styleToString, toWritableStores, } from '../../internal/helpers/index.js';\nimport { derived, writable } from 'svelte/store';\nconst defaults = {\n defaultOpen: false,\n disabled: false,\n forceVisible: false,\n};\nconst { name } = createElHelpers('collapsible');\nexport function createCollapsible(props) {\n const withDefaults = { ...defaults, ...props };\n const options = toWritableStores(omit(withDefaults, 'open', 'defaultOpen', 'onOpenChange'));\n const { disabled, forceVisible } = options;\n const openWritable = withDefaults.open ?? writable(withDefaults.defaultOpen);\n const open = overridable(openWritable, withDefaults?.onOpenChange);\n const root = makeElement(name(), {\n stores: [open, disabled],\n returned: ([$open, $disabled]) => ({\n 'data-state': $open ? 'open' : 'closed',\n 'data-disabled': disabledAttr($disabled),\n }),\n });\n const trigger = makeElement(name('trigger'), {\n stores: [open, disabled],\n returned: ([$open, $disabled]) => ({\n 'data-state': $open ? 'open' : 'closed',\n 'data-disabled': disabledAttr($disabled),\n disabled: disabledAttr($disabled),\n }),\n action: (node) => {\n const unsub = addMeltEventListener(node, 'click', () => {\n const disabled = node.dataset.disabled !== undefined;\n if (disabled)\n return;\n open.update(($open) => !$open);\n });\n return {\n destroy: unsub,\n };\n },\n });\n const isVisible = derived([open, forceVisible], ([$open, $forceVisible]) => $open || $forceVisible);\n const content = makeElement(name('content'), {\n stores: [isVisible, disabled],\n returned: ([$isVisible, $disabled]) => ({\n 'data-state': $isVisible ? 'open' : 'closed',\n 'data-disabled': disabledAttr($disabled),\n hidden: $isVisible ? undefined : true,\n style: styleToString({\n display: $isVisible ? undefined : 'none',\n }),\n }),\n });\n return {\n elements: {\n root,\n trigger,\n content,\n },\n states: {\n open,\n },\n options,\n };\n}\n", "// Modified from Grail UI v0.9.6 (2023-06-10)\n// Source: https://github.com/grail-ui/grail-ui\n// https://github.com/grail-ui/grail-ui/tree/master/packages/grail-ui/src/clickOutside/clickOutside.ts\nimport { readable } from 'svelte/store';\nimport { addEventListener } from '../../helpers/event.js';\nimport { get } from 'svelte/store';\nimport { isFunction } from '../../helpers/is.js';\n/**\n * Creates a readable store that tracks the latest PointerEvent that occurred on the document.\n *\n * @returns A function to unsubscribe from the event listener and stop tracking pointer events.\n */\nconst documentClickStore = readable(undefined, (set) => {\n /**\n * Event handler for pointerdown events on the document.\n * Updates the store's value with the latest PointerEvent and then resets it to undefined.\n */\n function clicked(event) {\n set(event);\n // New subscriptions will not trigger immediately\n set(undefined);\n }\n // Adds a pointerdown event listener to the document, calling the clicked function when triggered.\n const unsubscribe = addEventListener(document, 'pointerup', clicked, {\n passive: false,\n capture: true,\n });\n // Returns a function to unsubscribe from the event listener and stop tracking pointer events.\n return unsubscribe;\n});\nexport const useClickOutside = (node, config = {}) => {\n let options = { enabled: true, ...config };\n // Returns true if the click outside handler is enabled\n function isEnabled() {\n return typeof options.enabled === 'boolean' ? options.enabled : get(options.enabled);\n }\n // Handle document clicks\n const unsubscribe = documentClickStore.subscribe((e) => {\n // If the click outside handler is disabled, or if the event is null or the node itself, return early\n if (!isEnabled() || !e || e.target === node) {\n return;\n }\n const composedPath = e.composedPath();\n // If the target is in the node, return early\n if (composedPath.includes(node))\n return;\n // If an ignore function is passed, check if it returns true\n if (options.ignore) {\n if (isFunction(options.ignore)) {\n if (options.ignore(e))\n return;\n }\n // If an ignore array is passed, check if any elements in the array match the target\n else if (Array.isArray(options.ignore)) {\n if (options.ignore.length > 0 &&\n options.ignore.some((ignoreEl) => {\n return ignoreEl && (e.target === ignoreEl || composedPath.includes(ignoreEl));\n }))\n return;\n }\n }\n // If none of the above conditions are met, call the handler\n options.handler?.(e);\n });\n return {\n update(params) {\n options = { ...options, ...params };\n },\n destroy() {\n unsubscribe();\n },\n };\n};\n", "import { addEventListener } from '../../helpers/event.js';\nimport { isFunction, isHTMLElement, isReadable } from '../../helpers/is.js';\nimport { get, readable } from 'svelte/store';\nimport { effect, executeCallbacks, kbd, noop } from '../../helpers/index.js';\n/**\n * Creates a readable store that tracks the latest Escape Keydown that occurred on the document.\n *\n * @returns A function to unsubscribe from the event listener and stop tracking keydown events.\n */\nconst documentEscapeKeyStore = readable(undefined, (set) => {\n /**\n * Event handler for keydown events on the document.\n * Updates the store's value with the latest Escape Keydown event and then resets it to undefined.\n */\n function keydown(event) {\n if (event && event.key === kbd.ESCAPE) {\n set(event);\n }\n // New subscriptions will not trigger immediately\n set(undefined);\n }\n // Adds a keydown event listener to the document, calling the keydown function when triggered.\n const unsubscribe = addEventListener(document, 'keydown', keydown, {\n passive: false,\n });\n // Returns a function to unsubscribe from the event listener and stop tracking keydown events.\n return unsubscribe;\n});\nexport const useEscapeKeydown = (node, config = {}) => {\n let unsub = noop;\n function update(config = {}) {\n unsub();\n const options = { enabled: true, ...config };\n const enabled = (isReadable(options.enabled) ? options.enabled : readable(options.enabled));\n unsub = executeCallbacks(\n // Handle escape keydowns\n documentEscapeKeyStore.subscribe((e) => {\n if (!e || !get(enabled))\n return;\n const target = e.target;\n if (!isHTMLElement(target) || target.closest('[data-escapee]') !== node) {\n return;\n }\n e.preventDefault();\n // If an ignore function is passed, check if it returns true\n if (options.ignore) {\n if (isFunction(options.ignore)) {\n if (options.ignore(e))\n return;\n }\n // If an ignore array is passed, check if any elements in the array match the target\n else if (Array.isArray(options.ignore)) {\n if (options.ignore.length > 0 &&\n options.ignore.some((ignoreEl) => {\n return ignoreEl && target === ignoreEl;\n }))\n return;\n }\n }\n // If none of the above conditions are met, call the handler\n options.handler?.(e);\n }), effect(enabled, ($enabled) => {\n if ($enabled) {\n node.dataset.escapee = '';\n }\n else {\n delete node.dataset.escapee;\n }\n }));\n }\n update(config);\n return {\n update,\n destroy() {\n node.removeAttribute('data-escapee');\n unsub();\n },\n };\n};\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 return {\n ...rect,\n top: rect.y,\n left: rect.x,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\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 ...rects.floating,\n x,\n y\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 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 if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {\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$map$so;\n const placement = (_overflowsData$map$so = overflowsData.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$map$so[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 let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\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 }\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 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 overflowAvailableHeight = height - overflow[heightSide];\n const overflowAvailableWidth = width - overflow[widthSide];\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (isYAxis) {\n const maximumClippingWidth = width - overflow.left - overflow.right;\n availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;\n } else {\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : 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 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 return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n // Browsers without `ShadowRoot` support.\n if (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 isContainingBlock(element) {\n const webkit = isWebKit();\n const css = getComputedStyle(element);\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', '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 {\n currentNode = getParentNode(currentNode);\n }\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.pageXOffset,\n scrollTop: element.pageYOffset\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 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isWebKit };\n", "import { rectToClientRect, 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';\nexport { detectOverflow, offset } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getDocumentElement, getNodeName, isOverflowElement, getNodeScroll, 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 = currentWin.frameElement;\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 = currentWin.frameElement;\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(floating) {\n return topLayerSelectors.some(selector => {\n try {\n return floating.matches(selector);\n } catch (e) {\n return false;\n }\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 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,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\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 ...clippingAncestor,\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y\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' ? 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 offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const x = rect.left + scroll.scrollLeft - offsets.x;\n const y = rect.top + scroll.scrollTop - offsets.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\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 return element.offsetParent;\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 window = getWindow(element);\n if (!isHTMLElement(element) || isTopLayer(element)) {\n return window;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n return window;\n }\n return offsetParent || getContainingBlock(element) || window;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n ...(await getDimensionsFn(data.floating))\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 timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 100);\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